diff --git a/.gitignore b/.gitignore index 640a7a13..e8979698 100644 --- a/.gitignore +++ b/.gitignore @@ -33,8 +33,8 @@ seeds/ mnemonics/ certs/ blockchains/ -test/stress/machines -test/stress/config.json +tests/stress/machines +tests/stress/config.json lamassu.json terraform.* diff --git a/Dockerfiles/admin.Dockerfile b/Dockerfiles/admin.Dockerfile deleted file mode 100644 index a4a3902f..00000000 --- a/Dockerfiles/admin.Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -FROM node:14 as build-admin - -WORKDIR /app - -# COPY new-lamassu-admin/src packages/lamassu-admin/src -# COPY new-lamassu-admin/patches packages/lamassu-admin/patches -# COPY new-lamassu-admin/public packages/lamassu-admin/public -# COPY new-lamassu-admin/nginx packages/lamassu-admin/nginx -# COPY new-lamassu-admin/.env packages/lamassu-admin/.env -# COPY new-lamassu-admin/.eslintrc.js packages/lamassu-admin/.eslintrc.js -# COPY new-lamassu-admin/jsconfig.json packages/lamassu-admin/jsconfig.json -# COPY new-lamassu-admin/package.json packages/lamassu-admin/package.json - -COPY new-lamassu-admin packages/lamassu-admin - -WORKDIR /app/packages/lamassu-admin - -# RUN npm install - -RUN npm run build - -FROM nginx:1.21.4-alpine as production-admin - -ENV NODE_ENV=production - -COPY --from=build-admin /app/packages/lamassu-admin/build /usr/share/nginx/html/ -RUN rm /etc/nginx/conf.d/default.conf -COPY --from=build-admin /app/packages/lamassu-admin/nginx/nginx.conf /etc/nginx/conf.d - -EXPOSE 80 - -CMD [ "nginx", "-g", "daemon off;" ] \ No newline at end of file diff --git a/Dockerfiles/common.Dockerfile b/Dockerfiles/common.Dockerfile new file mode 100644 index 00000000..c913e8bf --- /dev/null +++ b/Dockerfiles/common.Dockerfile @@ -0,0 +1,36 @@ +FROM ubuntu:20.04 as base + +ARG DEBIAN_FRONTEND=noninteractive +ENV TZ=Europe/Lisbon + +RUN apt-get update + +RUN apt-get install -y -q curl \ + sudo \ + git \ + python2-minimal \ + build-essential \ + libpq-dev \ + net-tools + +RUN curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - +RUN apt-get install nodejs -y -q + +FROM base as build-l-s + +WORKDIR /app + +COPY bin/ packages/lamassu-server/bin +COPY lib/ packages/lamassu-server/lib +COPY data/ packages/lamassu-server/data +COPY tools/ packages/lamassu-server/tools +COPY migrations/ packages/lamassu-server/migrations +COPY package.json packages/lamassu-server/package.json +COPY Lamassu_CA.pem packages/lamassu-server/Lamassu_CA.pem + +WORKDIR /app/packages/lamassu-server + +RUN chmod +x tools/build-docker-certs.sh +RUN chmod +x bin/lamassu-server-entrypoint.sh + +RUN npm install \ No newline at end of file diff --git a/bin/convert-txs.js b/bin/convert-txs.js deleted file mode 100755 index e4e685cc..00000000 --- a/bin/convert-txs.js +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env node - - -var pgp = require('pg-promise')() - -require('../lib/environment-helper') -const { PSQL_URL } = require('../lib/constants') - -var db = pgp(PSQL_URL) - -db.manyOrNone(`select * from transactions where incoming=false - and stage='final_request' and authority='machine'`) - .then(rs => - db.tx(t => - t.batch(rs.map(r => db.none(`insert into cash_in_txs (session_id, - device_fingerprint, to_address, crypto_atoms, crypto_code, fiat, - currency_code, fee, tx_hash, error, created) values ($1, $2, $3, $4, $5, - $6, $7, $8, $9, $10, $11)`, [r.session_id, r.device_fingerprint, - r.to_address, r.satoshis, r.crypto_code, r.fiat, r.currency_code, r.fee, - r.tx_hash, r.error, r.created])) - ) - ) - ) - .then(() => db.manyOrNone(`select * from transactions where incoming=true - and stage='initial_request' and authority='pending'`)) - .then(rs => - db.tx(t => - t.batch(rs.map(r => db.none(`insert into cash_out_txs (session_id, - device_fingerprint, to_address, crypto_atoms, crypto_code, fiat, - currency_code, tx_hash, phone, error, created) values ($1, $2, $3, $4, $5, - $6, $7, $8, $9, $10, $11)`, [r.session_id, r.device_fingerprint, - r.to_address, r.satoshis, r.crypto_code, r.fiat, r.currency_code, - r.tx_hash, r.phone, r.error, r.created])) - ) - ) - ) - .then(() => db.manyOrNone(`select * from transactions where incoming=true - and stage='dispense' and authority='authorized'`)) - .then(rs => - db.tx(t => - t.batch(rs.map(r => - db.none(`update cash_out_txs set dispensed=true where session_id=$1`, [r.session_id]) - .then(() => db.none(`insert into cash_out_actions (session_id, action, - created) values ($1, $2, $3)`, [r.session_id, 'dispensed', r.created])) - )) - ) - ) - .then(() => pgp.end()) - .then(() => console.log('Success.')) - .catch(e => { - console.log(e) - pgp.end() - }) diff --git a/bin/insecure-dev.sh b/bin/insecure-dev.sh deleted file mode 100755 index 053e8c0e..00000000 --- a/bin/insecure-dev.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -node bin/new-lamassu-admin-server --dev & node bin/new-graphql-dev-insecure \ No newline at end of file diff --git a/bin/lamassu-display-config.js b/bin/lamassu-display-config.js deleted file mode 100644 index 83fad452..00000000 --- a/bin/lamassu-display-config.js +++ /dev/null @@ -1,14 +0,0 @@ -require('../lib/environment-helper') - -const settingsLoader = require('../lib/new-settings-loader') -const pp = require('../lib/pp') - -settingsLoader.loadLatest() - .then(r => { - pp('config')(r) - process.exit(0) - }) - .catch(e => { - console.log(e.stack) - process.exit(1) - }) \ No newline at end of file diff --git a/bin/lamassu-eth-sweep-old-addresses.js b/bin/lamassu-eth-sweep-old-addresses.js deleted file mode 100644 index dcd88dd7..00000000 --- a/bin/lamassu-eth-sweep-old-addresses.js +++ /dev/null @@ -1,75 +0,0 @@ -require('../lib/environment-helper') - -const hdkey = require('ethereumjs-wallet/hdkey') -const _ = require('lodash/fp') -const hkdf = require('futoin-hkdf') -const pify = require('pify') -const fs = pify(require('fs')) -const Web3 = require('web3') -const web3 = new Web3() - -const db = require('../lib/db') -const configManager = require('../lib/new-config-manager') -const { loadLatest } = require('../lib/new-settings-loader') -const mnemonicHelpers = require('../lib/mnemonic-helpers') -const { sweep } = require('../lib/wallet') -const ph = require('../lib/plugin-helper') - -const MNEMONIC_PATH = process.env.MNEMONIC_PATH - -function fetchWallet (settings, cryptoCode) { - return fs.readFile(MNEMONIC_PATH, 'utf8') - .then(mnemonic => { - const masterSeed = mnemonicHelpers.toEntropyBuffer(mnemonic) - const plugin = configManager.getWalletSettings(cryptoCode, settings.config).wallet - const wallet = ph.load(ph.WALLET, plugin) - const rawAccount = settings.accounts[plugin] - const account = _.set('seed', computeSeed(masterSeed), rawAccount) - if (_.isFunction(wallet.run)) wallet.run(account) - return { wallet, account } - }) -} - -function computeSeed (masterSeed) { - return hkdf(masterSeed, 32, { salt: 'lamassu-server-salt', info: 'wallet-seed' }) -} - -function paymentHdNode (account) { - const masterSeed = account.seed - if (!masterSeed) throw new Error('No master seed!') - const key = hdkey.fromMasterSeed(masterSeed) - return key.derivePath("m/44'/60'/0'/0'") -} - -const getHdIndices = db => { - const sql = `SELECT id, crypto_code, hd_index FROM cash_out_txs WHERE hd_index IS NOT NULL AND status IN ('confirmed', 'instant') AND crypto_code = 'ETH'` - return db.any(sql) -} - -const getCashoutAddresses = (settings, indices) => { - return Promise.all(_.map(it => { - return fetchWallet(settings, it.crypto_code) - .then(({ wallet, account }) => Promise.all([wallet, paymentHdNode(account).deriveChild(it.hd_index).getWallet().getChecksumAddressString()])) - .then(([wallet, address]) => Promise.all([address, wallet._balance(false, address, 'ETH')])) - .then(([address, balance]) => ({ address, balance: balance.toNumber(), cryptoCode: it.crypto_code, index: it.hd_index, txId: it.id })) - }, indices)) -} - -Promise.all([getHdIndices(db), loadLatest()]) - .then(([indices, settings]) => Promise.all([settings, getCashoutAddresses(settings, indices)])) - .then(([settings, addresses]) => { - console.log('Found these cash-out addresses for ETH:') - console.log(addresses) - - return Promise.all(_.map(it => { - // If the address only has dust in it, don't bother sweeping - if (web3.utils.fromWei(it.balance.toString()) > 0.00001) { - console.log(`Address ${it.address} found to have ${web3.utils.fromWei(it.balance.toString())} ETH in it. Sweeping...`) - return sweep(settings, it.txId, it.cryptoCode, it.index) - } - - console.log(`Address ${it.address} contains no significant balance (${web3.utils.fromWei(it.balance.toString())}). Skipping the sweep process...`) - return Promise.resolve() - }, addresses)) - }) - .then(() => console.log('Process finished!')) diff --git a/bin/migrate-config.js b/bin/migrate-config.js deleted file mode 100644 index bab5f5a5..00000000 --- a/bin/migrate-config.js +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -const pgp = require('pg-promise')() - -require('../lib/environment-helper') -const { PSQL_URL } = require('../lib/constants') - -const db = pgp(PSQL_URL) - -db.many('select data from user_config', 'exchanges') - .then(rows => { - const config = rows.filter(r => r.type === 'exchanges')[0].data - const brain = rows.filter(r => r.type === 'unit')[0].data - const settings = config.exchanges.settings - const compliance = settings.compliance - const newConfig = { - global: { - cashInTransactionLimit: compliance.maximum.limit, - cashOutTransactionLimit: settings.fiatTxLimit, - cashInCommission: settings.commission, - cashOutCommission: settings.fiatCommission || settings.commission, - idVerificationEnabled: compliance.idVerificationEnabled, - idVerificationLimit: compliance.idVerificationLimit, - lowBalanceMargin: settings.lowBalanceMargin, - zeroConfLimit: settings.zeroConfLimit, - fiatCurrency: settings.currency, - topCashOutDenomination: settings.cartridges[0], - bottomCashOutDenomination: settings.cartridges[1], - virtualCashOutDenomination: settings.virtualCartridges[0], - machineLanguages: brain.locale.localeInfo.primaryLocales, - coins: settings.coins - }, - accounts: settings.plugins.settings - } - - db.none('insert into user_config (type, data) values ($1, $2)', ['global', newConfig]) - .then(() => { - console.log('Success.') - process.exit(0) - }) - .catch(err => { - console.error('Error: %s', err) - process.exit(1) - }) - }) diff --git a/dev/coinatmradar.js b/dev/coinatmradar.js deleted file mode 100644 index 4f4cf1be..00000000 --- a/dev/coinatmradar.js +++ /dev/null @@ -1,15 +0,0 @@ -const car = require('../lib/coinatmradar/coinatmradar') -const plugins = require('../lib/plugins') - -require('../lib/new-settings-loader').loadLatest() - .then(settings => { - const pi = plugins(settings) - - return pi.getRawRates() - .then(rates => { - return car.update(rates, settings) - .then(require('../lib/pp')('DEBUG100')) - .catch(console.log) - .then(() => process.exit()) - }) - }) diff --git a/dev/coinatmradarserver.js b/dev/coinatmradarserver.js deleted file mode 100644 index 5a561ad0..00000000 --- a/dev/coinatmradarserver.js +++ /dev/null @@ -1,14 +0,0 @@ -const express = require('express') -const app = express() - -app.use(express.raw({ type: '*/*' })) - -app.post('/api/lamassu', (req, res) => { - console.log(req.headers) - console.log(req.body.toString()) - res.send('Hello World!') -}) - -app.listen(3200, () => console.log('Example app listening on port 3200!')) - -// "url": "https://coinatmradar.info/api/lamassu/" diff --git a/dev/config.js b/dev/config.js deleted file mode 100644 index 97a2d33a..00000000 --- a/dev/config.js +++ /dev/null @@ -1,8 +0,0 @@ -const settingsLoader = require('../lib/new-settings-loader') -const configManager = require('../lib/new-config-manager') - -settingsLoader.loadLatest() - .then(settings => { - const config = settings.config - require('../lib/pp')('config')(configManager.getAllCryptoCurrencies(config)) - }) diff --git a/dev/double-dispense.js b/dev/double-dispense.js deleted file mode 100644 index 81a652d7..00000000 --- a/dev/double-dispense.js +++ /dev/null @@ -1,19 +0,0 @@ -const got = require('got') - -const tx = { - sessionId: 'a9fdfedc-1d45-11e6-be13-2f68ff6306b9', - toAddress: '1DrK44np3gMKuvcGeFVv9Jk67zodP52eMu', - fiat: 10 -} - -const headers = { - 'content-type': 'application/json', - 'session-id': '36f17fbe-1d44-11e6-a1a9-bbe8a5a41617' -} - -const body = JSON.stringify({tx: tx}) -got('http://localhost:3000/dispense', {body: body, json: true, headers: headers}) - .then(res => { - console.log(res.body) - }) - .catch(console.log) diff --git a/dev/double-spend-scenario.js b/dev/double-spend-scenario.js deleted file mode 100644 index eef96ccb..00000000 --- a/dev/double-spend-scenario.js +++ /dev/null @@ -1,60 +0,0 @@ -var db = require('../lib/postgresql_interface') -var connectionString = 'postgres://lamassu:lamassu@localhost/lamassu' -db.init(connectionString) - -var session = { - id: '6ede611c-cd03-11e5-88ee-2b5fcfdb0bc2', - fingerprint: 'xx:xx' -} -var tx = { - fiat: 40, - satoshis: 6980000, - toAddress: '1xxx', - currencyCode: 'CAD', - incoming: false -} - -var tx2 = { - fiat: 0, - satoshis: 6980000, - toAddress: '1xxx', - currencyCode: 'CAD', - incoming: false -} - -db.addOutgoingTx(session, tx, function (err, res) { - console.log('DEBUG1') - console.log(err) - console.log(res) -}) - -db.addOutgoingTx(session, tx2, function (err, res) { - console.log('DEBUG2') - console.log(err) - console.log(res) -}) - -/* -setTimeout(function () { - db.addOutgoingTx(session, tx2, function (err, res) { - console.log('DEBUG2') - console.log(err) - console.log(res) - }) -}, 0) -*/ - -var bills = { - uuid: 'c630338c-cd03-11e5-a9df-dbc9be2e9fbb', - currency: 'CAD', - toAddress: '1xxx', - deviceTime: Date.now(), - satoshis: 6980000, - fiat: 40 -} - -/* -db.recordBill(session, bills, function (err) { - console.log(err) -}) -*/ diff --git a/dev/get-compat-trigger.js b/dev/get-compat-trigger.js deleted file mode 100644 index 0b3e9035..00000000 --- a/dev/get-compat-trigger.js +++ /dev/null @@ -1,10 +0,0 @@ -const complianceTriggers = require('../lib/compliance-triggers') -const settingsLoader = require('../lib/new-settings-loader') -const configManager = require('../lib/new-config-manager') - -settingsLoader.loadLatest().then(settings => { - const triggers = configManager.getTriggers(settings.config) - const response = complianceTriggers.getBackwardsCompatibleTriggers(triggers) - console.log(response) -}) - diff --git a/dev/json-rpc.js b/dev/json-rpc.js deleted file mode 100644 index 01f49cdd..00000000 --- a/dev/json-rpc.js +++ /dev/null @@ -1,19 +0,0 @@ -const rpc = require('../lib/plugins/common/json-rpc') - -const method = '' - -// const url = null -// const url = 'https://httpstat.us/500' -// const url = 'https://httpstat.us/400' -const url = 'https://httpstat.us/200' - -const account = { - username: 'test', - password: 'test', - port: 8080, - url -} - -rpc.fetch(account, method) - .then(res => console.log('got result', res)) - .catch(err => console.error('gor error', err)) diff --git a/dev/notify.js b/dev/notify.js deleted file mode 100644 index 5bb41bcf..00000000 --- a/dev/notify.js +++ /dev/null @@ -1,31 +0,0 @@ -require('es6-promise').polyfill() - -var notifier = require('../lib/notifier') -var db = require('../lib/postgresql_interface') -const { PSQL_URL } = require('../lib/constants') - -function getBalances () { - return [ - {fiatBalance: 23.2345, fiatCode: 'USD', cryptoCode: 'BTC'}, - {fiatBalance: 23, fiatCode: 'USD', cryptoCode: 'ETH'} - ] -} - -db.init(PSQL_URL) -notifier.init(db, getBalances, {lowBalanceThreshold: 10}) -console.log('DEBUG0') -notifier.checkStatus() - .then(function (alertRec) { - console.log('DEBUG1') - console.log('%j', alertRec) - var subject = notifier.alertSubject(alertRec) - console.log(subject) - var body = notifier.printEmailAlerts(alertRec) - console.log(body) - console.log(notifier.alertFingerprint(alertRec)) - process.exit(0) - }) - .catch(function (err) { - console.log(err.stack) - process.exit(1) - }) diff --git a/dev/ofac-match.js b/dev/ofac-match.js deleted file mode 100644 index 1088724b..00000000 --- a/dev/ofac-match.js +++ /dev/null @@ -1,16 +0,0 @@ -const compliance = require('../lib/compliance') -const ofac = require('../lib/ofac/index') - -const [customerId, firstName, lastName, dateOfBirth] = process.argv.slice(2) - -const customer = { - id: customerId, - idCardData: {firstName, lastName, dateOfBirth} -} - -const deviceId = 'test-device' - -ofac.load() - .then(() => compliance.validationPatch(deviceId, true, customer)) - .then(console.log) - .catch(err => console.log(err)) diff --git a/dev/plugins.js b/dev/plugins.js deleted file mode 100644 index 30488199..00000000 --- a/dev/plugins.js +++ /dev/null @@ -1,10 +0,0 @@ -const plugins = require('../lib/plugins') -const settingsLoader = require('../lib/new-settings-loader') -const pp = require('../lib/pp') - -settingsLoader.loadLatest() - .then(settings => { - console.log('DEBUG300') - const pi = plugins(settings) - pi.getRates().then(r => console.log(JSON.stringify(r))) - }) diff --git a/dev/recreate-seeds.js b/dev/recreate-seeds.js deleted file mode 100644 index 8acb3920..00000000 --- a/dev/recreate-seeds.js +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -const fs = require('fs') -const path = require('path') -const os = require('os') -const bip39 = require('bip39') - -require('../lib/environment-helper') -const setEnvVariable = require('../tools/set-env-var') - -if (process.env.MNEMONIC_PATH && !process.env.SEED_PATH) { - const mnemonic = fs.readFileSync(process.env.MNEMONIC_PATH, 'utf8') - const seed = bip39.mnemonicToEntropy(mnemonic.split('\n').join(' ').trim()).toString('hex') - - setEnvVariable('SEED_PATH', path.resolve(os.homedir(), '.lamassu', 'seeds', 'seed.txt')) - - if (!fs.existsSync(path.dirname(process.env.SEED_PATH))) { - fs.mkdirSync(path.dirname(process.env.SEED_PATH)) - } - - if (!fs.existsSync(process.env.SEED_PATH)) { - fs.writeFileSync(process.env.SEED_PATH, seed, 'utf8') - } -} diff --git a/dev/send-message.js b/dev/send-message.js deleted file mode 100644 index dcf8acd2..00000000 --- a/dev/send-message.js +++ /dev/null @@ -1,30 +0,0 @@ -require('es6-promise').polyfill() - -var config = require('../lib/new-settings-loader') -var sms = require('../lib/sms') - -var rand = Math.floor(Math.random() * 1e6) -var db = config.connection -var rec = { - email: { - subject: 'Test email ' + rand, - body: 'This is a test email from lamassu-server' - }, - sms: { - toNumber: '666', - body: '[Lamassu] This is a test sms ' + rand - } -} - -config.loadLatest(db) - .then(function (config) { - sms.sendMessage(config, rec) - .then(function () { - console.log('Success.') - process.exit(0) - }) - .catch(function (err) { - console.log(err.stack) - process.exit(1) - }) - }) diff --git a/dev/strike.js b/dev/strike.js deleted file mode 100644 index c7bb0390..00000000 --- a/dev/strike.js +++ /dev/null @@ -1,20 +0,0 @@ -const strike = require('../lib/plugins/wallet/strike/strike') -const BN = require('../lib/bn') - -const account = {token: 'xxx'} - -strike.newAddress(account, { cryptoCode: 'BTC', cryptoAtoms: new BN(10000) }) - .then(r => { - console.log(r) - - const toAddress = r - const requested = null - const cryptoCode = 'BTC' - - setInterval(() => { - strike.getStatus(account, toAddress, requested, cryptoCode) - .then(console.log) - .catch(r => console.log(r.message)) - }, 2000) - }) - .catch(console.log) diff --git a/docker-compose.yaml b/docker-compose.yaml index 0b261b35..bf75645a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -125,19 +125,4 @@ services: - LOG_LEVEL=info depends_on: lamassu-server: - condition: service_started - - # admin: - # container_name: lamassu-admin - # build: - # context: . - # dockerfile: Dockerfiles/admin.Dockerfile - # target: production-admin - # restart: always - # ports: - # - 80:80 - # networks: - # - lamassu-network - # depends_on: - # lamassu-admin-server: - # condition: service_started \ No newline at end of file + condition: service_started \ No newline at end of file diff --git a/lamassu-remote-install/README.md b/lamassu-remote-install/README.md deleted file mode 100644 index f1aa6c6a..00000000 --- a/lamassu-remote-install/README.md +++ /dev/null @@ -1,23 +0,0 @@ -lamassu-remote-install -=============== - -This will install your Lamassu Bitcoin Machine remote server. - -Instructions ------------- - -1. Start a new Digital Ocean droplet - -2. ssh into the droplet - - ``` - ssh root@ - ``` - -3. Run the following command once you're logged in (default branch name is master): - - ``` - curl -sS https://raw.githubusercontent.com/lamassu/lamassu-server/master/lamassu-remote-install/install | bash -s -- - ``` - -4. You should be set. Just follow the instructions on the screen to open your dashboard. diff --git a/lamassu-remote-install/Vagrantfile b/lamassu-remote-install/Vagrantfile deleted file mode 100644 index f49511f3..00000000 --- a/lamassu-remote-install/Vagrantfile +++ /dev/null @@ -1,72 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -# All Vagrant configuration is done below. The "2" in Vagrant.configure -# configures the configuration version (we support older styles for -# backwards compatibility). Please don't change it unless you know what -# you're doing. -Vagrant.configure(2) do |config| - # The most common configuration options are documented and commented below. - # For a complete reference, please see the online documentation at - # https://docs.vagrantup.com. - - # Every Vagrant development environment requires a box. You can search for - # boxes at https://atlas.hashicorp.com/search. - config.vm.box = "ubuntu/xenial64" - - # Disable automatic box update checking. If you disable this, then - # boxes will only be checked for updates when the user runs - # `vagrant box outdated`. This is not recommended. - # config.vm.box_check_update = false - - # Create a forwarded port mapping which allows access to a specific port - # within the machine from a port on the host machine. In the example below, - # accessing "localhost:8080" will access port 80 on the guest machine. - config.vm.network "forwarded_port", guest: 8081, host: 8091 - - # Create a private network, which allows host-only access to the machine - # using a specific IP. - # config.vm.network "private_network", ip: "192.168.33.10" - - # Create a public network, which generally matched to bridged network. - # Bridged networks make the machine appear as another physical device on - # your network. - # config.vm.network "public_network" - - # Share an additional folder to the guest VM. The first argument is - # the path on the host to the actual folder. The second argument is - # the path on the guest to mount the folder. And the optional third - # argument is a set of non-required options. - config.vm.synced_folder ".", "/vagrant" - config.vm.synced_folder "../lamassu-scripts", "/lamassu-scripts" - - # Provider-specific configuration so you can fine-tune various - # backing providers for Vagrant. These expose provider-specific options. - # Example for VirtualBox: - # - config.vm.provider "virtualbox" do |vb| - # # Display the VirtualBox GUI when booting the machine - # vb.gui = true - # - # # Customize the amount of memory on the VM: - vb.memory = "2048" - end - # - # View the documentation for the provider you are using for more - # information on available options. - - # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies - # such as FTP and Heroku are also available. See the documentation at - # https://docs.vagrantup.com/v2/push/atlas.html for more information. - # config.push.define "atlas" do |push| - # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME" - # end - - # Enable provisioning with a shell script. Additional provisioners such as - # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the - # documentation for more information about their specific syntax and use. - # config.vm.provision "shell", inline: <<-SHELL - # sudo apt-get update - # sudo apt-get install -y apache2 - # SHELL -end diff --git a/lamassu-remote-install/default.sql b/lamassu-remote-install/default.sql deleted file mode 100644 index 8fbb08e3..00000000 --- a/lamassu-remote-install/default.sql +++ /dev/null @@ -1,40 +0,0 @@ -COPY user_config (id, type, data) FROM stdin; -1 exchanges {"exchanges" : {\ - "settings": {\ - "commission": 1.0,\ - "compliance": {\ - "maximum": {\ - "limit": null\ - }\ - }\ - },\ - "plugins" : {\ - "current": {\ - "ticker": "bitpay",\ - "transfer": "bitgo"\ - },\ - "settings": {\ - "bitpay": {},\ - "bitgo" : {}\ - }\ - }\ - }\ -} -\. - -COPY user_config (id, type, data) FROM stdin; -2 unit { "brain": {\ - "unit": {\ - "ssn": "xx-1234-45",\ - "owner": "Unlisted"\ - },\ - "locale": {\ - "currency": "USD",\ - "localeInfo": {\ - "primaryLocale": "en-US",\ - "primaryLocales": ["en-US"]\ - }\ - }\ - }\ -} -\. diff --git a/lamassu-remote-install/install b/lamassu-remote-install/install deleted file mode 100755 index b4dd5dd5..00000000 --- a/lamassu-remote-install/install +++ /dev/null @@ -1,280 +0,0 @@ -#!/usr/bin/env bash -set -e - -export LOG_FILE=/tmp/install.log - -CERT_DIR=/etc/ssl/certs -KEY_DIR=/etc/ssl/private -CONFIG_DIR=/etc/lamassu -MIGRATE_STATE_PATH=$CONFIG_DIR/.migrate -LAMASSU_CA_PATH=$CERT_DIR/Lamassu_CA.pem -CA_KEY_PATH=$KEY_DIR/Lamassu_OP_Root_CA.key -CA_PATH=$CERT_DIR/Lamassu_OP_Root_CA.pem -SERVER_KEY_PATH=$KEY_DIR/Lamassu_OP.key -SERVER_CERT_PATH=$CERT_DIR/Lamassu_OP.pem -MNEMONIC_DIR=$CONFIG_DIR/mnemonics -MNEMONIC_FILE=$MNEMONIC_DIR/mnemonic.txt -BACKUP_DIR=/var/backups/postgresql -BLOCKCHAIN_DIR=/mnt/blockchains -OFAC_DATA_DIR=/var/lamassu/ofac -ID_PHOTO_CARD_DIR=/opt/lamassu-server/idphotocard -FRONTCAMERA_DIR=/opt/lamassu-server/frontcamera -OPERATOR_DIR=/opt/lamassu-server/operatordata - -# Look into http://unix.stackexchange.com/questions/140734/configure-localtime-dpkg-reconfigure-tzdata - -decho () { - echo `date +"%H:%M:%S"` $1 - echo `date +"%H:%M:%S"` $1 >> $LOG_FILE -} - -retry() { - local -r -i max_attempts="$1"; shift - local -r cmd="$@" - local -i attempt_num=1 - - until $cmd - do - if (( attempt_num == max_attempts )) - then - echo - echo "****************************************************************" - echo "Attempt $attempt_num failed and there are no more attempts left! ($cmd)" - return 1 - else - echo - echo "****************************************************************" - echo "Attempt $attempt_num failed! Trying again in $attempt_num seconds..." - sleep $(( attempt_num++ )) - fi - done -} - -rm -f $LOG_FILE - -cat <<'FIG' - _ -| | __ _ _ __ ___ __ _ ___ ___ _ _ ___ ___ _ ____ _____ _ __ -| |/ _` | '_ ` _ \ / _` / __/ __| | | |_____/ __|/ _ \ '__\ \ / / _ \ '__| -| | (_| | | | | | | (_| \__ \__ \ |_| |_____\__ \ __/ | \ V / __/ | -|_|\__,_|_| |_| |_|\__,_|___/___/\__,_| |___/\___|_| \_/ \___|_| -FIG - -echo -e "\nStarting \033[1mlamassu-server\033[0m install. This will take a few minutes...\n" - -if [ "$(whoami)" != "root" ]; then - echo -e "This script has to be run as \033[1mroot\033[0m user" - exit 3 -fi - -release=$(lsb_release -rs) -processor=$(uname -i) -if [ "$release" != "16.04" ] || [ "$processor" != "x86_64" ]; then - echo "You're attempting to install on an unsupported Linux distribution or release ("$release $processor")." - echo - uname -a - echo - echo "Please return to DigitalOcean and create a droplet running Ubuntu 16.04 x64 instead." - exit 1 -fi - -# So we don't run out of memory -decho "Enabling swap file for install only..." -fallocate -l 1G /swapfile >> $LOG_FILE 2>&1 -chmod 600 /swapfile >> $LOG_FILE 2>&1 -mkswap /swapfile >> $LOG_FILE 2>&1 -swapon /swapfile >> $LOG_FILE 2>&1 - -IP=$(ifconfig eth0 | grep "inet" | grep -v "inet6" | awk -F: '{print $2}' | awk '{print $1}') - -decho "Updating system..." -sleep 10 -curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - >> $LOG_FILE 2>&1 -apt update >> $LOG_FILE 2>&1 - -decho "Installing necessary packages..." -apt install nodejs python-minimal build-essential supervisor postgresql libpq-dev -y -q >> $LOG_FILE 2>&1 - -decho "Installing latest npm package manager for node..." -retry 3 npm -g --unsafe-perm install npm@5 >> $LOG_FILE 2>&1 -NODE_MODULES=$(npm -g root) -NPM_BIN=$(npm -g bin) - -decho "Installing lamassu-server..." -retry 3 npm -g --unsafe-perm install lamassu/lamassu-server#${1-master} >> $LOG_FILE 2>&1 - -decho "Generating mnemonic..." -mkdir -p $MNEMONIC_DIR >> $LOG_FILE 2>&1 -SEED=$(openssl rand -hex 32) -MNEMONIC=$(bip39 $SEED) -echo "$MNEMONIC" > $MNEMONIC_FILE - -decho "Creating postgres user..." -POSTGRES_PW=$(hkdf postgres-pw $SEED) -su -l postgres >> $LOG_FILE 2>&1 <> $LOG_FILE 2>&1 -mkdir -p $CONFIG_DIR >> $LOG_FILE 2>&1 - -decho "Generating SSL certificates..." - -openssl genrsa \ - -out $CA_KEY_PATH \ - 4096 >> $LOG_FILE 2>&1 - -openssl req \ - -x509 \ - -sha256 \ - -new \ - -nodes \ - -key $CA_KEY_PATH \ - -days 3650 \ - -out $CA_PATH \ - -subj "/C=IS/ST=/L=Reykjavik/O=Lamassu Operator CA/CN=lamassu-operator.is" \ - >> $LOG_FILE 2>&1 - -openssl genrsa \ - -out $SERVER_KEY_PATH \ - 4096 >> $LOG_FILE 2>&1 - -openssl req -new \ - -key $SERVER_KEY_PATH \ - -out /tmp/Lamassu_OP.csr.pem \ - -subj "/C=IS/ST=/L=Reykjavik/O=Lamassu Operator/CN=$IP" \ - -reqexts SAN \ - -sha256 \ - -config <(cat /etc/ssl/openssl.cnf \ - <(printf "[SAN]\nsubjectAltName=IP.1:$IP")) \ - >> $LOG_FILE 2>&1 - -openssl x509 \ - -req -in /tmp/Lamassu_OP.csr.pem \ - -CA $CA_PATH \ - -CAkey $CA_KEY_PATH \ - -CAcreateserial \ - -out $SERVER_CERT_PATH \ - -extfile <(cat /etc/ssl/openssl.cnf \ - <(printf "[SAN]\nsubjectAltName=IP.1:$IP")) \ - -extensions SAN \ - -days 3650 >> $LOG_FILE 2>&1 - -rm /tmp/Lamassu_OP.csr.pem - -decho "Copying Lamassu certificate authority..." -LAMASSU_CA_FILE=$NODE_MODULES/lamassu-server/Lamassu_CA.pem -cp $LAMASSU_CA_FILE $LAMASSU_CA_PATH - -mkdir -p $OFAC_DATA_DIR - -cat < $CONFIG_DIR/lamassu.json -{ - "postgresql": "postgres://lamassu_pg:$POSTGRES_PW@localhost/lamassu", - "mnemonicPath": "$MNEMONIC_FILE", - "lamassuCaPath": "$LAMASSU_CA_PATH", - "caPath": "$CA_PATH", - "certPath": "$SERVER_CERT_PATH", - "keyPath": "$SERVER_KEY_PATH", - "hostname": "$IP", - "logLevel": "info", - "migrateStatePath": "$MIGRATE_STATE_PATH", - "blockchainDir": "$BLOCKCHAIN_DIR", - "ofacDataDir": "$OFAC_DATA_DIR", - "idPhotoCardDir": "$ID_PHOTO_CARD_DIR", - "frontCameraDir": "$FRONTCAMERA_DIR", - "operatorDataDir": "$OPERATOR_DIR" - "strike": { - "baseUrl": "https://api.strike.acinq.co/api/" - }, - "coinAtmRadar": { - "url": "https://coinatmradar.info/api/lamassu/" - }, - "ofacSources": [ - { - "name": "sdn_advanced", - "url": "https://www.treasury.gov/ofac/downloads/sanctions/1.0/sdn_advanced.xml" - }, - { - "name": "cons_advanced", - "url": "https://www.treasury.gov/ofac/downloads/sanctions/1.0/cons_advanced.xml" - } - ] -} -EOF - -decho "Setting up database tables..." -lamassu-migrate >> $LOG_FILE 2>&1 - -decho "Setting up lamassu-admin..." -ADMIN_REGISTRATION_URL=`lamassu-register admin 2>> $LOG_FILE` - -decho "Setting up backups..." -BIN=$(npm -g bin) -BACKUP_CMD=$BIN/lamassu-backup-pg -mkdir -p $BACKUP_DIR -BACKUP_CRON="@daily $BACKUP_CMD > /dev/null" -(crontab -l 2>/dev/null || echo -n ""; echo "$BACKUP_CRON") | crontab - >> $LOG_FILE 2>&1 -$BACKUP_CMD >> $LOG_FILE 2>&1 - -decho "Setting up firewall..." -ufw allow ssh >> $LOG_FILE 2>&1 -ufw allow 443/tcp >> $LOG_FILE 2>&1 # Admin -ufw allow 3000/tcp >> $LOG_FILE 2>&1 # Server -ufw allow 8071/tcp >> $LOG_FILE 2>&1 # Lamassu support -ufw -f enable >> $LOG_FILE 2>&1 - -decho "Setting up supervisor..." -cat < /etc/supervisor/conf.d/lamassu-server.conf -[program:lamassu-server] -command=${NPM_BIN}/lamassu-server -autostart=true -autorestart=true -stderr_logfile=/var/log/supervisor/lamassu-server.err.log -stdout_logfile=/var/log/supervisor/lamassu-server.out.log -environment=HOME="/root" -EOF - -cat < /etc/supervisor/conf.d/lamassu-admin-server.conf -[program:lamassu-admin-server] -command=${NPM_BIN}/lamassu-admin-server -autostart=true -autorestart=true -stderr_logfile=/var/log/supervisor/lamassu-admin-server.err.log -stdout_logfile=/var/log/supervisor/lamassu-admin-server.out.log -environment=HOME="/root" -EOF - -service supervisor restart >> $LOG_FILE 2>&1 - -decho "Disabling swap file..." -swapoff /swapfile >> $LOG_FILE 2>&1 - -# disable exitting on error in case DO changes motd scripts -set +e -chmod -x /etc/update-motd.d/*-release-upgrade -chmod -x /etc/update-motd.d/*-updates-available -chmod -x /etc/update-motd.d/*-reboot-required -chmod -x /etc/update-motd.d/*-help-text -chmod -x /etc/update-motd.d/*-cloudguest -set -e - -# reset terminal to link new executables -hash -r - -echo -decho "Done! Now it's time to configure Lamassu stack." -echo -echo -e "\n*** IMPORTANT ***" -echo "In a private space, run lamassu-mnemonic, write down the words" -echo "and keep them in a safe place." -echo -echo "This secret will allow you to retrieve system passwords, such " -echo "as the keys to your Ethereum account. However, you must still " -echo "backup your wallets separately. Visit support.lamassu.is for " -echo "details on regularly backing up your wallets and coins." -echo -echo -echo "Activation URL for lamassu-admin:" -echo $ADMIN_REGISTRATION_URL diff --git a/lib/admin/accounts.js b/lib/admin/accounts.js deleted file mode 100644 index 8ae3084a..00000000 --- a/lib/admin/accounts.js +++ /dev/null @@ -1,133 +0,0 @@ -const path = require('path') -const fs = require('fs') - -const _ = require('lodash/fp') - -const db = require('../db') -const configValidate = require('./config-validate') -const config = require('./config') - -function loadSchemas () { - const schemasRoot = path.resolve(__dirname, 'schemas') - const schemaFiles = fs.readdirSync(schemasRoot) - const stripJson = fileName => fileName.slice(0, -5) - const readSchema = fileName => JSON.parse(fs.readFileSync(path.resolve(schemasRoot, fileName))) - return _.zipObject(_.map(stripJson, schemaFiles), _.map(readSchema, schemaFiles)) -} - -const schemas = loadSchemas() - -function fetchAccounts () { - return db.oneOrNone('select data from user_config where type=$1 and schema_version=$2', ['accounts', configValidate.SETTINGS_LOADER_SCHEMA_VERSION]) - .then(row => { - // Hard code this for now - const accounts = [{ - code: 'blockcypher', - display: 'Blockcypher', - fields: [ - { code: 'confidenceFactor', display: 'Confidence Factor', fieldType: 'integer', required: true, value: 40 } - ] - }] - - return row - ? Promise.resolve(row.data.accounts) - : db.none('insert into user_config (type, data, valid) values ($1, $2, $3)', ['accounts', {accounts}, true]) - .then(fetchAccounts) - }) -} - -function selectedAccounts () { - const mapAccount = v => v.fieldLocator.fieldType === 'account' && - v.fieldValue.value - - const mapSchema = code => schemas[code] - return config.fetchConfig() - .then(conf => { - const accountCodes = _.uniq(conf.map(mapAccount) - .filter(_.identity)) - - return _.sortBy(_.get('display'), accountCodes.map(mapSchema) - .filter(_.identity)) - }) -} - -function fetchAccountSchema (account) { - return schemas[account] -} - -function mergeAccount (oldAccount, newAccount) { - if (!newAccount) return oldAccount - - const newFields = newAccount.fields - - const updateWithData = oldField => { - const newField = _.find(r => r.code === oldField.code, newFields) - const newValue = _.isUndefined(newField) ? oldField.value : newField.value - return _.set('value', newValue, oldField) - } - - const updatedFields = oldAccount.fields.map(updateWithData) - - return _.set('fields', updatedFields, oldAccount) -} - -function getAccounts (accountCode) { - const schema = fetchAccountSchema(accountCode) - if (!schema) return Promise.reject(new Error('No schema for: ' + accountCode)) - - return fetchAccounts() - .then(accounts => { - if (_.isEmpty(accounts)) return [schema] - const account = _.find(r => r.code === accountCode, accounts) - const mergedAccount = mergeAccount(schema, account) - - return updateAccounts(mergedAccount, accounts) - }) -} - -function elideSecrets (account) { - const elideSecret = field => { - return field.fieldType === 'password' - ? _.set('value', !_.isEmpty(field.value), field) - : field - } - - return _.set('fields', account.fields.map(elideSecret), account) -} - -function getAccount (accountCode) { - return getAccounts(accountCode) - .then(accounts => _.find(r => r.code === accountCode, accounts)) - .then(elideSecrets) -} - -function save (accounts) { - return db.none('update user_config set data=$1 where type=$2 and schema_version=$3', [{accounts: accounts}, 'accounts', configValidate.SETTINGS_LOADER_SCHEMA_VERSION]) -} - -function updateAccounts (newAccount, accounts) { - const accountCode = newAccount.code - const isPresent = _.some(_.matchesProperty('code', accountCode), accounts) - const updateAccount = r => r.code === accountCode - ? newAccount - : r - - return isPresent - ? _.map(updateAccount, accounts) - : _.concat(accounts, newAccount) -} - -function updateAccount (account) { - return getAccounts(account.code) - .then(accounts => { - const merged = mergeAccount(_.find(_.matchesProperty('code', account.code), accounts), account) - return save(updateAccounts(merged, accounts)) - }) - .then(() => getAccount(account.code)) -} - -module.exports = { - selectedAccounts, - getAccount, - updateAccount -} diff --git a/lib/admin/admin-server.js b/lib/admin/admin-server.js deleted file mode 100644 index fe179ae8..00000000 --- a/lib/admin/admin-server.js +++ /dev/null @@ -1,342 +0,0 @@ -const EventEmitter = require('events') -const qs = require('querystring') -const fs = require('fs') -const path = require('path') -const express = require('express') -const app = express() -const https = require('https') -const serveStatic = require('serve-static') -const cookieParser = require('cookie-parser') -const argv = require('minimist')(process.argv.slice(2)) -const got = require('got') -const morgan = require('morgan') -const helmet = require('helmet') -// const WebSocket = require('ws') -const http = require('http') -// const SocketIo = require('socket.io') -const makeDir = require('make-dir') -const _ = require('lodash/fp') - -const machineLoader = require('../machine-loader') -const T = require('../time') -const logger = require('../logger') - -const accounts = require('./accounts') -const config = require('./config') -const login = require('./login') -const pairing = require('./pairing') -const server = require('./server') -const transactions = require('./transactions') -const customers = require('../customers') -const logs = require('../logs') -const funding = require('./funding') -const supportServer = require('./admin-support') - -const NEVER = new Date(Date.now() + 100 * T.years) -const REAUTHENTICATE_INTERVAL = T.minute - -const HOSTNAME = process.env.HOSTNAME -const KEY_PATH = process.env.KEY_PATH -const CERT_PATH = process.env.CERT_PATH -const ID_PHOTO_CARD_DIR = process.env.ID_PHOTO_CARD_DIR -const FRONT_CAMERA_DIR = process.env.FRONT_CAMERA_DIR -const OPERATOR_DATA_DIR = process.env.OPERATOR_DATA_DIR - -const devMode = argv.dev - -const version = require('../../package.json').version -logger.info('Version: %s', version) - -if (!HOSTNAME) { - logger.error('no hostname specified.') - process.exit(1) -} - -module.exports = {run} - -function dbNotify () { - return got.post('http://localhost:3030/dbChange') - .catch(e => logger.error('lamassu-server not responding')) -} - -const skip = (req, res) => req.path === '/api/status/' && res.statusCode === 200 - -// Note: no rate limiting applied since that would allow an attacker to -// easily DDoS by just hitting the aggregate rate limit. We assume the -// attacker has unlimited unique IP addresses. -// -// The best we can do at the application level is to make the authentication -// lookup very fast. There will only be a few users at most, so it's not a problem -// to keep them in memory, but we need to update right after a new one is added. -// For now, we believe that probability of sustained DDoS by saturating our ability to -// fetch from the DB is pretty low. - -app.use(morgan('dev', {skip})) -app.use(helmet({noCache: true})) -app.use(cookieParser()) -app.use(register) -app.use(authenticate) -app.use(express.json()) - -app.get('/api/totem', (req, res) => { - const name = req.query.name - - if (!name) return res.status(400).send('Name is required') - - return pairing.totem(HOSTNAME, name) - .then(totem => res.send(totem)) -}) - -app.get('/api/accounts', (req, res) => { - accounts.selectedAccounts() - .then(accounts => res.json({accounts: accounts})) -}) - -app.get('/api/account/:account', (req, res) => { - accounts.getAccount(req.params.account) - .then(account => res.json(account)) -}) - -app.post('/api/account', (req, res) => { - return accounts.updateAccount(req.body) - .then(account => res.json(account)) - .then(() => dbNotify()) -}) - -app.get('/api/config/:config', (req, res, next) => - config.fetchConfigGroup(req.params.config) - .then(c => res.json(c)) - .catch(next)) - -app.post('/api/config', (req, res, next) => { - config.saveConfigGroup(req.body) - .then(c => res.json(c)) - .then(() => dbNotify()) - .catch(next) -}) - -app.get('/api/accounts/account/:account', (req, res) => { - accounts.getAccount(req.params.account) - .then(r => res.send(r)) -}) - -app.get('/api/machines', (req, res) => { - machineLoader.getMachineNames() - .then(r => res.send({machines: r})) -}) - -app.post('/api/machines', (req, res) => { - machineLoader.setMachine(req.body) - .then(() => machineLoader.getMachineNames()) - .then(r => res.send({machines: r})) - .then(() => dbNotify()) -}) - -app.get('/api/funding', (req, res) => { - return funding.getFunding() - .then(r => res.json(r)) -}) - -app.get('/api/funding/:cryptoCode', (req, res) => { - const cryptoCode = req.params.cryptoCode - - return funding.getFunding(cryptoCode) - .then(r => res.json(r)) -}) - -app.get('/api/status', (req, res, next) => { - return Promise.all([server.status(), config.validateCurrentConfig()]) - .then(([serverStatus, invalidConfigGroups]) => res.send({ - server: serverStatus, - invalidConfigGroups - })) - .catch(next) -}) - -app.get('/api/transactions', (req, res, next) => { - return transactions.batch() - .then(r => res.send({transactions: r})) - .catch(next) -}) - -app.get('/api/transaction/:id', (req, res, next) => { - return transactions.single(req.params.id) - .then(r => { - if (!r) return res.status(404).send({Error: 'Not found'}) - return res.send(r) - }) -}) - -app.patch('/api/transaction/:id', (req, res, next) => { - if (!req.query.cancel) return res.status(400).send({Error: 'Requires cancel'}) - - return transactions.cancel(req.params.id) - .then(r => { - return res.send(r) - }) - .catch(() => res.status(404).send({Error: 'Not found'})) -}) - -app.get('/api/customers', (req, res, next) => { - return customers.batch() - .then(r => res.send({customers: r})) - .catch(next) -}) - -app.get('/api/customer/:id', (req, res, next) => { - return customers.getById(req.params.id) - .then(r => { - if (!r) return res.status(404).send({Error: 'Not found'}) - return res.send(r) - }) -}) - -app.get('/api/logs/:deviceId', (req, res, next) => { - return logs.getMachineLogs(req.params.deviceId) - .then(r => res.send(r)) - .catch(next) -}) - -app.get('/api/logs', (req, res, next) => { - return machineLoader.getMachines() - .then(machines => { - const firstMachine = _.first(machines) - if (!firstMachine) return res.status(404).send({Error: 'No machines'}) - return logs.getMachineLogs(firstMachine.deviceId) - .then(r => res.send(r)) - }) - .catch(next) -}) - -app.patch('/api/customer/:id', (req, res, next) => { - if (!req.params.id) return res.status(400).send({Error: 'Requires id'}) - const token = req.token || req.cookies.token - return customers.update(req.params.id, req.query, token) - .then(r => res.send(r)) - .catch(() => res.status(404).send({Error: 'Not found'})) -}) - -app.use((err, req, res, next) => { - logger.error(err) - - return res.status(500).send(err.message) -}) - -const certOptions = { - key: fs.readFileSync(KEY_PATH), - cert: fs.readFileSync(CERT_PATH) -} - -app.use(serveStatic(path.resolve(__dirname, 'public'))) - -if (!fs.existsSync(ID_PHOTO_CARD_DIR)) { - makeDir.sync(ID_PHOTO_CARD_DIR) -} - -if (!fs.existsSync(FRONT_CAMERA_DIR)) { - makeDir.sync(FRONT_CAMERA_DIR) -} - -if (!fs.existsSync(OPERATOR_DATA_DIR)) { - makeDir.sync(OPERATOR_DATA_DIR) -} - -app.use('/id-card-photo', serveStatic(ID_PHOTO_CARD_DIR, {index: false})) -app.use('/front-camera-photo', serveStatic(FRONT_CAMERA_DIR, {index: false})) -app.use('/operator-data', serveStatic(OPERATOR_DATA_DIR, {index: false})) - -function register (req, res, next) { - const otp = req.query.otp - - if (!otp) return next() - - return login.register(otp) - .then(r => { - if (r.expired) return res.status(401).send('OTP expired, generate new registration link') - - // Maybe user is using old registration key, attempt to authenticate - if (!r.success) return next() - - const cookieOpts = { - httpOnly: true, - secure: true, - domain: HOSTNAME, - sameSite: true, - expires: NEVER - } - - const token = r.token - req.token = token - res.cookie('token', token, cookieOpts) - next() - }) -} - -function authenticate (req, res, next) { - const token = req.token || req.cookies.token - - return login.authenticate(token) - .then(success => { - if (!success) return res.status(401).send('Authentication failed') - next() - }) -} - -process.on('unhandledRejection', err => { - logger.error(err.stack) - process.exit(1) -}) - -const socketServer = http.createServer() -const io = SocketIo(socketServer) -socketServer.listen(3060) -const socketEmitter = new EventEmitter() - -io.on('connection', client => { - client.on('message', msg => socketEmitter.emit('message', msg)) -}) - -const webServer = https.createServer(certOptions, app) -const wss = new WebSocket.Server({server: webServer}) - -function establishSocket (ws, token) { - return login.authenticate(token) - .then(success => { - if (!success) return ws.close(1008, 'Authentication error') - - const listener = data => { - ws.send(JSON.stringify(data)) - } - - // Reauthenticate every once in a while, in case token expired - setInterval(() => { - return login.authenticate(token) - .then(success => { - if (!success) { - socketEmitter.removeListener('message', listener) - ws.close() - } - }) - }, REAUTHENTICATE_INTERVAL) - - socketEmitter.on('message', listener) - ws.send('Testing123') - }) -} - -wss.on('connection', ws => { - const token = qs.parse(ws.upgradeReq.headers.cookie).token - - return establishSocket(ws, token) -}) - -function run () { - const serverPort = devMode ? 8072 : 443 - const supportPort = 8071 - - const serverLog = `lamassu-admin-server listening on port ${serverPort}` - const supportLog = `lamassu-support-server listening on port ${supportPort}` - - webServer.listen(serverPort, () => logger.info(serverLog)) - supportServer.run(supportPort).then(logger.info(supportLog)) -} diff --git a/lib/admin/admin-support.js b/lib/admin/admin-support.js deleted file mode 100644 index 13fd5f9d..00000000 --- a/lib/admin/admin-support.js +++ /dev/null @@ -1,39 +0,0 @@ -const fs = require('fs') -const cookieParser = require('cookie-parser') -const helmet = require('helmet') -const morgan = require('morgan') -const express = require('express') -const app = express() -const https = require('https') -const _ = require('lodash/fp') -const serveStatic = require('serve-static') -const path = require('path') - -const KEY_PATH = process.env.KEY_PATH -const CERT_PATH = process.env.CERT_PATH -const LAMASSU_CA_PATH = process.env.LAMASSU_CA_PATH - -app.use(morgan('dev')) -app.use(helmet({noCache: true})) -app.use(cookieParser()) -app.use(express.json()) -app.use(serveStatic(path.resolve(__dirname, '..', '..', 'public'), { - 'index': ['support-index.html'] -})) - -const certOptions = { - key: fs.readFileSync(KEY_PATH), - cert: fs.readFileSync(CERT_PATH), - ca: [fs.readFileSync(LAMASSU_CA_PATH)], - requestCert: true, - rejectUnauthorized: true -} - -function run (port) { - return new Promise((resolve, reject) => { - const webServer = https.createServer(certOptions, app) - webServer.listen(port, resolve) - }) -} - -module.exports = { run } diff --git a/lib/admin/funding.js b/lib/admin/funding.js deleted file mode 100644 index a448cf6a..00000000 --- a/lib/admin/funding.js +++ /dev/null @@ -1,99 +0,0 @@ -const _ = require('lodash/fp') -const BN = require('../bn') -const settingsLoader = require('./settings-loader') -const configManager = require('./config-manager') -const wallet = require('../wallet') -const ticker = require('../ticker') -const { utils: coinUtils } = require('@lamassu/coins') -const machineLoader = require('../machine-loader') - -module.exports = {getFunding} - -function allScopes (cryptoScopes, machineScopes) { - const scopes = [] - cryptoScopes.forEach(c => { - machineScopes.forEach(m => scopes.push([c, m])) - }) - - return scopes -} - -function allMachineScopes (machineList, machineScope) { - const machineScopes = [] - - if (machineScope === 'global' || machineScope === 'both') machineScopes.push('global') - if (machineScope === 'specific' || machineScope === 'both') machineList.forEach(r => machineScopes.push(r)) - - return machineScopes -} - -function getCryptos (config, machineList) { - const scopes = allScopes(['global'], allMachineScopes(machineList, 'both')) - const scoped = scope => configManager.scopedValue(scope[0], scope[1], 'cryptoCurrencies', config) - - return _.uniq(_.flatten(_.map(scoped, scopes))) -} - -function fetchMachines () { - return machineLoader.getMachines() - .then(machineList => machineList.map(r => r.deviceId)) -} - -function computeCrypto (cryptoCode, _balance) { - const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode) - const unitScale = cryptoRec.unitScale - - return new BN(_balance).shiftedBy(-unitScale).decimalPlaces(5) -} - -function computeFiat (rate, cryptoCode, _balance) { - const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode) - const unitScale = cryptoRec.unitScale - - return new BN(_balance).shiftedBy(-unitScale).times(rate).decimalPlaces(5) -} - -function getFunding (_cryptoCode) { - return Promise.all([settingsLoader.loadLatest(), fetchMachines()]) - .then(([settings, machineList]) => { - const config = configManager.unscoped(settings.config) - const cryptoCodes = getCryptos(settings.config, machineList) - const cryptoCode = _cryptoCode || cryptoCodes[0] - const fiatCode = config.fiatCurrency - const pareCoins = c => _.includes(c.cryptoCode, cryptoCodes) - const cryptoCurrencies = coinUtils.cryptoCurrencies() - const cryptoDisplays = _.filter(pareCoins, cryptoCurrencies) - const cryptoRec = coinUtils.getCryptoCurrency(cryptoCode) - - if (!cryptoRec) throw new Error(`Unsupported coin: ${cryptoCode}`) - - const promises = [ - wallet.newFunding(settings, cryptoCode), - ticker.getRates(settings, fiatCode, cryptoCode) - ] - - return Promise.all(promises) - .then(([fundingRec, ratesRec]) => { - const rates = ratesRec.rates - const rate = (rates.ask.plus(rates.bid)).div(2) - const fundingConfirmedBalance = fundingRec.fundingConfirmedBalance - const fiatConfirmedBalance = computeFiat(rate, cryptoCode, fundingConfirmedBalance) - const pending = fundingRec.fundingPendingBalance - const fiatPending = computeFiat(rate, cryptoCode, pending) - const fundingAddress = fundingRec.fundingAddress - const fundingAddressUrl = coinUtils.buildUrl(cryptoCode, fundingAddress) - - return { - cryptoCode, - cryptoDisplays, - fundingAddress, - fundingAddressUrl, - confirmedBalance: computeCrypto(cryptoCode, fundingConfirmedBalance).toFormat(5), - pending: computeCrypto(cryptoCode, pending).toFormat(5), - fiatConfirmedBalance: fiatConfirmedBalance.toFormat(2), - fiatPending: fiatPending.toFormat(2), - fiatCode - } - }) - }) -} diff --git a/lib/admin/login.js b/lib/admin/login.js deleted file mode 100644 index c7cf852b..00000000 --- a/lib/admin/login.js +++ /dev/null @@ -1,48 +0,0 @@ -const crypto = require('crypto') - -const db = require('../db') - -function generateOTP (name) { - const otp = crypto.randomBytes(32).toString('hex') - - const sql = 'insert into one_time_passes (token, name) values ($1, $2)' - - return db.none(sql, [otp, name]) - .then(() => otp) -} - -function validateOTP (otp) { - const sql = `delete from one_time_passes - where token=$1 - returning name, created < now() - interval '1 hour' as expired` - - return db.one(sql, [otp]) - .then(r => ({success: !r.expired, expired: r.expired, name: r.name})) - .catch(() => ({success: false, expired: false})) -} - -function register (otp) { - return validateOTP(otp) - .then(r => { - if (!r.success) return r - - const token = crypto.randomBytes(32).toString('hex') - const sql = 'insert into user_tokens (token, name) values ($1, $2)' - - return db.none(sql, [token, r.name]) - .then(() => ({success: true, token: token})) - }) - .catch(() => ({success: false, expired: false})) -} - -function authenticate (token) { - const sql = 'select token from user_tokens where token=$1' - - return db.one(sql, [token]).then(() => true).catch(() => false) -} - -module.exports = { - generateOTP, - register, - authenticate -} diff --git a/lib/admin/pairing.js b/lib/admin/pairing.js deleted file mode 100644 index 7d520bbf..00000000 --- a/lib/admin/pairing.js +++ /dev/null @@ -1,32 +0,0 @@ -const fs = require('fs') -const pify = require('pify') -const readFile = pify(fs.readFile) -const crypto = require('crypto') -const baseX = require('base-x') - -const db = require('../db') -const pairing = require('../pairing') - -const ALPHA_BASE = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:' -const bsAlpha = baseX(ALPHA_BASE) - -const CA_PATH = process.env.CA_PATH - -const unpair = pairing.unpair - -function totem (hostname, name) { - return readFile(CA_PATH) - .then(data => { - const caHash = crypto.createHash('sha256').update(data).digest() - const token = crypto.randomBytes(32) - const hexToken = token.toString('hex') - const caHexToken = crypto.createHash('sha256').update(hexToken).digest('hex') - const buf = Buffer.concat([caHash, token, Buffer.from(hostname)]) - const sql = 'insert into pairing_tokens (token, name) values ($1, $3), ($2, $3)' - - return db.none(sql, [hexToken, caHexToken, name]) - .then(() => bsAlpha.encode(buf)) - }) -} - -module.exports = {totem, unpair} diff --git a/lib/admin/public/bower.json b/lib/admin/public/bower.json deleted file mode 100644 index d21a9346..00000000 --- a/lib/admin/public/bower.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "lamassu-admin-elm", - "homepage": "https://github.com/lamassu/lamassu-admin-elm", - "authors": [ - "Josh Harvey " - ], - "description": "", - "main": "", - "license": "MIT", - "private": true, - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/lib/admin/public/bower_components/gridism/.bower.json b/lib/admin/public/bower_components/gridism/.bower.json deleted file mode 100644 index 38f81cc3..00000000 --- a/lib/admin/public/bower_components/gridism/.bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "gridism", - "version": "0.2.2", - "author": "Coby Chapple", - "homepage": "http://cobyism.com/gridism", - "main": "./gridism.css", - "repository": { - "type": "git", - "url": "git://github.com/cobyism/gridism.git" - }, - "ignore": [ - "shapeshifter/", - "**/*.yml", - "**/*.html" - ], - "license": "MIT", - "_release": "0.2.2", - "_resolution": { - "type": "version", - "tag": "0.2.2", - "commit": "490be0b6813d701dcc35a82b0bcc8f639e5ad63f" - }, - "_source": "https://github.com/cobyism/gridism.git", - "_target": "^0.2.2", - "_originalSource": "gridism", - "_direct": true -} \ No newline at end of file diff --git a/lib/admin/public/bower_components/gridism/LICENSE b/lib/admin/public/bower_components/gridism/LICENSE deleted file mode 100644 index ee27726e..00000000 --- a/lib/admin/public/bower_components/gridism/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Coby Chapple. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the 'Software'), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/lib/admin/public/bower_components/gridism/README.md b/lib/admin/public/bower_components/gridism/README.md deleted file mode 100644 index a60072ef..00000000 --- a/lib/admin/public/bower_components/gridism/README.md +++ /dev/null @@ -1,80 +0,0 @@ -# Gridism - -A simple responsive CSS grid. [View the demo →](http://cobyism.com/gridism/) - -## Why? - -### My process - -When I design web layouts, my thought process usually goes something like this: - -> Alright, in this section, I want a bit that’s one third of the section’s width, -> and then next to that I want another bit that’s two thirds of the sections’s width. -> Now, in the next section… - -I don’t think in 12 or 16 column grids. Instead, my mental model basically just consists of the page being divided up into multiple full-width vertical sections, and each vertical section being divided up into simple fractions of the section width. - -### Existing grid frameworks - -Most frameworks I’ve used don’t match that thought process *at all*. I usually have to: - -1. Remember how many columns are in the grid for the particular framework I’m using. -1. Decide how I want to divide up this particular section’s content. -1. Mentally do the conversion from what I want to see (one quarter + three quarters, for example) into the number of columns I need for the grid I’m using. -1. Remember the class naming structure for the framework I’m using. Is it `.span3`, `.grid_3`, `.col-3`, or something else altogether? -1. Deal with other hassles like clearing floats, messing with column padding to have the gutters look right, indicating which elements are the first in a row, and so forth. - -Only the second step should be necessary. - -### Gridism’s Goals - -I couldn’t find a framework that matched this mental model of how I work, so I started hacking on Gridism with the following goals: - -- Class names should be memorable and self-evident. -- Gutters and basic content padding should be taken care of. -- Clearing floats should be done automatically. -- Wrapped grid sections should be independant of vertical page sections. -- Frequently required utility classes should be provided. -- Common patterns for Responsive Design™ should be built-in. - -I hope you find that this project is living up to those goals. If not, please [create an issue](https://github.com/cobyism/gridism/issues/new) and let me know. - -## Installation - -### 1. Get the files - -The easiest way to use Gridism in your project is via the [Bower](http://twitter.github.com/bower) package manager. - -```sh -bower install gridism -``` - -Elsewise, [download the zip folder](https://github.com/cobyism/gridism/archive/gh-pages.zip), extract it, and copy `gridism.css` into your project’s folder. Boom. Done. - -### 2. Link the stylesheet - -Add the following stylesheet to your HTML’s `` section: - -```html - -``` - -**Note:** If you didn’t install using Bower, you need to adjust the path of CSS file to match your file structure. - -### 3. Viewport scale - -Add the following meta tag to your HTML’s `` section: - -```html - -``` - -Without this meta tag, mobiles and tablets might load your page as a scaled-down version of the desktop size, instead of resizing the content to match the device’s actual viewport width. - -## Contributing - -I’d :heart: to receive contributions to this project. It doesn’t matter if it’s just a typo, or if you’re proposing an overhaul of the entire project—I’ll gladly take a look at your changes. Fork at will! :grinning:. - -## License - -Go nuts. See [LICENSE](https://github.com/cobyism/gridism/blob/gh-pages/LICENSE) (MIT). diff --git a/lib/admin/public/bower_components/gridism/bower.json b/lib/admin/public/bower_components/gridism/bower.json deleted file mode 100644 index fd0bbdc3..00000000 --- a/lib/admin/public/bower_components/gridism/bower.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "gridism", - "version": "0.2.1", - "author": "Coby Chapple", - "homepage": "http://cobyism.com/gridism", - "main": "./gridism.css", - "repository": { - "type": "git", - "url": "git://github.com/cobyism/gridism.git" - }, - "ignore": [ - "shapeshifter/", - "**/*.yml", - "**/*.html" - ], - "license": "MIT" -} diff --git a/lib/admin/public/bower_components/gridism/gridism.css b/lib/admin/public/bower_components/gridism/gridism.css deleted file mode 100644 index 11894bc6..00000000 --- a/lib/admin/public/bower_components/gridism/gridism.css +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Gridism - * A simple, responsive, and handy CSS grid by @cobyism - * https://github.com/cobyism/gridism - */ - -/* Preserve some sanity */ -.grid, -.unit { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} - -/* Set up some rules to govern the grid */ -.grid { - display: block; - clear: both; -} -.grid .unit { - float: left; - width: 100%; - padding: 10px; -} - -/* This ensures the outer gutters are equal to the (doubled) inner gutters. */ -.grid .unit:first-child { padding-left: 20px; } -.grid .unit:last-child { padding-right: 20px; } - -/* Nested grids already have padding though, so let's nuke it */ -.unit .unit:first-child { padding-left: 0; } -.unit .unit:last-child { padding-right: 0; } -.unit .grid:first-child > .unit { padding-top: 0; } -.unit .grid:last-child > .unit { padding-bottom: 0; } - -/* Let people nuke the gutters/padding completely in a couple of ways */ -.no-gutters .unit, -.unit.no-gutters { - padding: 0 !important; -} - -/* Wrapping at a maximum width is optional */ -.wrap .grid, -.grid.wrap { - max-width: 978px; - margin: 0 auto; -} - -/* Width classes also have shorthand versions numbered as fractions - * For example: for a grid unit 1/3 (one third) of the parent width, - * simply apply class="w-1-3" to the element. */ -.grid .whole, .grid .w-1-1 { width: 100%; } -.grid .half, .grid .w-1-2 { width: 50%; } -.grid .one-third, .grid .w-1-3 { width: 33.3332%; } -.grid .two-thirds, .grid .w-2-3 { width: 66.6665%; } -.grid .one-quarter, -.grid .one-fourth, .grid .w-1-4 { width: 25%; } -.grid .three-quarters, -.grid .three-fourths, .grid .w-3-4 { width: 75%; } -.grid .one-fifth, .grid .w-1-5 { width: 20%; } -.grid .two-fifths, .grid .w-2-5 { width: 40%; } -.grid .three-fifths, .grid .w-3-5 { width: 60%; } -.grid .four-fifths, .grid .w-4-5 { width: 80%; } -.grid .golden-small, .grid .w-g-s { width: 38.2716%; } /* Golden section: smaller piece */ -.grid .golden-large, .grid .w-g-l { width: 61.7283%; } /* Golden section: larger piece */ - -/* Clearfix after every .grid */ -.grid { - *zoom: 1; -} -.grid:before, .grid:after { - display: table; - content: ""; - line-height: 0; -} -.grid:after { - clear: both; -} - -/* Utility classes */ -.align-center { text-align: center; } -.align-left { text-align: left; } -.align-right { text-align: right; } -.pull-left { float: left; } -.pull-right { float: right; } - -/* A property for a better rendering of images in units: in - this way bigger pictures are just resized if the unit - becomes smaller */ -.unit img { - max-width: 100%; -} - -/* Hide elements using this class by default */ -.only-on-mobiles { - display: none !important; -} - -/* Responsive Stuff */ -@media screen and (max-width: 568px) { - /* Stack anything that isn't full-width on smaller screens - and doesn't provide the no-stacking-on-mobiles class */ - .grid:not(.no-stacking-on-mobiles) > .unit { - width: 100% !important; - padding-left: 20px; - padding-right: 20px; - } - .unit .grid .unit { - padding-left: 0px; - padding-right: 0px; - } - - /* Sometimes, you just want to be different on small screens */ - .center-on-mobiles { - text-align: center !important; - } - .hide-on-mobiles { - display: none !important; - } - .only-on-mobiles { - display: block !important; - } -} - -/* Expand the wrap a bit further on larger screens */ -@media screen and (min-width: 1180px) { - .wider .grid, - .grid.wider { - max-width: 1180px; - margin: 0 auto; - } -} diff --git a/lib/admin/public/bower_components/qr-code/.bower.json b/lib/admin/public/bower_components/qr-code/.bower.json deleted file mode 100644 index a7cec63b..00000000 --- a/lib/admin/public/bower_components/qr-code/.bower.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "qr-code", - "version": "0.1.8", - "homepage": "https://github.com/educastellano/qr-code", - "authors": [ - "Eduard Castellano " - ], - "description": "Web Component for generating QR codes", - "main": "src/qr-code.js", - "keywords": [ - "qr", - "qrcode", - "qr-code", - "webcomponent", - "customelement", - "web-components" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests", - "demo" - ], - "dependencies": { - "qrjs": "~0.1.2" - }, - "_release": "0.1.8", - "_resolution": { - "type": "version", - "tag": "v0.1.8", - "commit": "28a413834c62d8ec7f5b3f3005fe2ee78e47e647" - }, - "_source": "https://github.com/educastellano/qr-code.git", - "_target": "^0.1.8", - "_originalSource": "webcomponent-qr-code", - "_direct": true -} \ No newline at end of file diff --git a/lib/admin/public/bower_components/qr-code/README.md b/lib/admin/public/bower_components/qr-code/README.md deleted file mode 100644 index a3841583..00000000 --- a/lib/admin/public/bower_components/qr-code/README.md +++ /dev/null @@ -1,94 +0,0 @@ -# <qr-code> - -Web Component for generating QR Codes, using (a [fork](https://github.com/educastellano/qr.js) of) [qr.js](https://github.com/lifthrasiir/qr.js) lib. - -> Maintained by [Eduard Castellano](https://github.com/educastellano). - -## Demo - -> [Check it live](http://educastellano.github.io/qr-code/demo). - -## Usage - -* **NPM and Browserify** ([polyfill](https://github.com/WebComponents/webcomponentsjs) and the component): - - Install: - - ```sh - npm install webcomponents.js - npm install webcomponent-qr-code - ``` - - Import: - - ```js - require('webcomponents.js'); - require('webcomponent-qr-code'); - ``` - -* **Bower** ([polyfill](https://github.com/WebComponents/webcomponentsjs), [qr.js](https://github.com/educastellano/qr.js) and the component): - - Install: - - ```sh - bower install webcomponentsjs - bower install webcomponent-qr-code - ``` - - Import: - - ```html - - - - ``` - - > You can also import the component with [HTML Imports](http://w3c.github.io/webcomponents/spec/imports/), but you still need to import the polyfill and the qr.js lib separately: - > - > ```html - > - > ``` - -* **Start using it!** - - ```html - - ``` - - - -## Options - -Attribute | Options | Default | Description ---- | --- | --- | --- -`data` | *string* | `null` | The information encoded by the QR code. -`format` | `png`, `html`, `svg` | `png` | Format of the QR code rendered inside the component. -`modulesize` | *int* | `5` | Size of the modules in *pixels*. -`margin` | *int* | `4` | Margin of the QR code in *modules*. - - -## Contributing - -1. Fork it! -2. Create your feature branch: `git checkout -b my-new-feature` -3. Commit your changes: `git commit -m 'Add some feature'` -4. Push to the branch: `git push origin my-new-feature` -5. Submit a pull request :D - -## History - -* v0.1.7 April 11, 2015 - * Support for SVG -* v0.1.6 April 10, 2015 - * Default attributes - * qr.js removed and used as a dependency - * Available in NPM -* v0.1.1 March 31, 2015 - * Framework-agnostic webcomponent (no use of Polymer) - * Available in Bower -* v0.0.1 September 18, 2013 - * Started project using [boilerplate-element](https://github.com/customelements/boilerplate-element) - -## License - -[MIT License](http://opensource.org/licenses/MIT) diff --git a/lib/admin/public/bower_components/qr-code/bower.json b/lib/admin/public/bower_components/qr-code/bower.json deleted file mode 100644 index 14e071e0..00000000 --- a/lib/admin/public/bower_components/qr-code/bower.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "qr-code", - "version": "0.1.7", - "homepage": "https://github.com/educastellano/qr-code", - "authors": [ - "Eduard Castellano " - ], - "description": "Web Component for generating QR codes", - "main": "src/qr-code.js", - "keywords": [ - "qr", - "qrcode", - "qr-code", - "webcomponent", - "customelement", - "web-components" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests", - "demo" - ], - "dependencies": { - "qrjs": "~0.1.2" - } -} diff --git a/lib/admin/public/bower_components/qr-code/index.html b/lib/admin/public/bower_components/qr-code/index.html deleted file mode 100644 index a8d632d7..00000000 --- a/lib/admin/public/bower_components/qr-code/index.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - <qr-code> - - - Demo here - - \ No newline at end of file diff --git a/lib/admin/public/bower_components/qr-code/index.js b/lib/admin/public/bower_components/qr-code/index.js deleted file mode 100644 index 14ece1cf..00000000 --- a/lib/admin/public/bower_components/qr-code/index.js +++ /dev/null @@ -1 +0,0 @@ -require('./src/qr-code.js') \ No newline at end of file diff --git a/lib/admin/public/bower_components/qr-code/package.json b/lib/admin/public/bower_components/qr-code/package.json deleted file mode 100644 index 7381b8b5..00000000 --- a/lib/admin/public/bower_components/qr-code/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "webcomponent-qr-code", - "version": "0.1.8", - "description": "Web Component for generating QR codes", - "main": "qr-code.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/educastellano/qr-code.git" - }, - "keywords": [ - "qr", - "qrcode", - "qr-code", - "webcomponent", - "custom-element" - ], - "author": "Eduard Castellano", - "license": "MIT", - "bugs": { - "url": "https://github.com/educastellano/qr-code/issues" - }, - "homepage": "https://github.com/educastellano/qr-code", - "dependencies": { - "qrjs": "^0.1.2" - } -} diff --git a/lib/admin/public/bower_components/qr-code/src/polymer/qr-code.html b/lib/admin/public/bower_components/qr-code/src/polymer/qr-code.html deleted file mode 100644 index a228615a..00000000 --- a/lib/admin/public/bower_components/qr-code/src/polymer/qr-code.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - \ No newline at end of file diff --git a/lib/admin/public/bower_components/qr-code/src/qr-code.html b/lib/admin/public/bower_components/qr-code/src/qr-code.html deleted file mode 100644 index 71882d90..00000000 --- a/lib/admin/public/bower_components/qr-code/src/qr-code.html +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/lib/admin/public/bower_components/qr-code/src/qr-code.js b/lib/admin/public/bower_components/qr-code/src/qr-code.js deleted file mode 100644 index 2b11b09b..00000000 --- a/lib/admin/public/bower_components/qr-code/src/qr-code.js +++ /dev/null @@ -1,144 +0,0 @@ -'use strict'; - -(function(definition) { - if (typeof define === 'function' && define.amd) { - define(['QRCode'], definition); - } else if (typeof module === 'object' && module.exports) { - var QRCode = require('qrjs'); - module.exports = definition(QRCode); - } else { - definition(window.QRCode); - } -})(function(QRCode) { -// -// Prototype -// -var proto = Object.create(HTMLElement.prototype, { - // - // Attributes - // - attrs: { - value: { - data: null, - format: 'png', - modulesize: 5, - margin: 4 - } - }, - defineAttributes: { - value: function () { - var attrs = Object.keys(this.attrs), - attr; - for (var i=0; i' - } - } - else { - this.shadowRoot.innerHTML = '
qr-code: no data!
' - } - } - }, - generatePNG: { - value: function () { - try { - var img = document.createElement('img'); - img.src = QRCode.generatePNG(this.data, this.getOptions()); - this.clear(); - this.shadowRoot.appendChild(img); - } - catch (e) { - this.shadowRoot.innerHTML = '
qr-code: no canvas support!
' - } - } - }, - generateHTML: { - value: function () { - var div = QRCode.generateHTML(this.data, this.getOptions()); - this.clear(); - this.shadowRoot.appendChild(div); - } - }, - generateSVG: { - value: function () { - var div = QRCode.generateSVG(this.data, this.getOptions()); - this.clear(); - this.shadowRoot.appendChild(div); - } - }, - clear: { - value: function () { - while (this.shadowRoot.lastChild) { - this.shadowRoot.removeChild(this.shadowRoot.lastChild); - } - } - } -}); -// -// Register -// -document.registerElement('qr-code', { - prototype: proto -}); -}); - - diff --git a/lib/admin/public/bower_components/qrcodejs/.bower.json b/lib/admin/public/bower_components/qrcodejs/.bower.json deleted file mode 100644 index a4bd9ee3..00000000 --- a/lib/admin/public/bower_components/qrcodejs/.bower.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "qrcodejs", - "version": "0.1.0", - "homepage": "https://github.com/CatTail/qrcodejs", - "authors": [ - "davidshimjs ssm0123@gmail.com" - ], - "description": "Cross-browser QRCode generator for javascript", - "main": "qrcode.js", - "keywords": [ - "qrcode" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "_release": "0.1.0", - "_resolution": { - "type": "version", - "tag": "v0.1.0", - "commit": "71340740270b3c9d797ecaa7d7a75af36037217d" - }, - "_source": "https://github.com/CatTail/qrcodejs.git", - "_target": "^0.1.0", - "_originalSource": "qrcodejs", - "_direct": true -} \ No newline at end of file diff --git a/lib/admin/public/bower_components/qrcodejs/LICENSE b/lib/admin/public/bower_components/qrcodejs/LICENSE deleted file mode 100644 index 93c33233..00000000 --- a/lib/admin/public/bower_components/qrcodejs/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ -The MIT License (MIT) ---------------------- -Copyright (c) 2012 davidshimjs - -Permission is hereby granted, free of charge, -to any person obtaining a copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, -including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/lib/admin/public/bower_components/qrcodejs/README.md b/lib/admin/public/bower_components/qrcodejs/README.md deleted file mode 100644 index ce0da3b7..00000000 --- a/lib/admin/public/bower_components/qrcodejs/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# QRCode.js -QRCode.js is javascript library for making QRCode. QRCode.js supports Cross-browser with HTML5 Canvas and table tag in DOM. -QRCode.js has no dependencies. - -## Basic Usages -``` -
- -``` - -or with some options - -``` -var qrcode = new QRCode("test", { - text: "http://jindo.dev.naver.com/collie", - width: 128, - height: 128, - colorDark : "#000000", - colorLight : "#ffffff", - correctLevel : QRCode.CorrectLevel.H -}); -``` - -and you can use some methods - -``` -qrcode.clear(); // clear the code. -qrcode.makeCode("http://naver.com"); // make another code. -``` - -## Browser Compatibility -IE6~10, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile, ETC. - -## License -MIT License - -## Contact -twitter @davidshimjs - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/davidshimjs/qrcodejs/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - diff --git a/lib/admin/public/bower_components/qrcodejs/bower.json b/lib/admin/public/bower_components/qrcodejs/bower.json deleted file mode 100644 index 47aec06c..00000000 --- a/lib/admin/public/bower_components/qrcodejs/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "qrcodejs", - "version": "0.1.0", - "homepage": "https://github.com/CatTail/qrcodejs", - "authors": [ - "davidshimjs ssm0123@gmail.com" - ], - "description": "Cross-browser QRCode generator for javascript", - "main": "qrcode.js", - "keywords": [ - "qrcode" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/lib/admin/public/bower_components/qrcodejs/index.html b/lib/admin/public/bower_components/qrcodejs/index.html deleted file mode 100644 index fc16f3d9..00000000 --- a/lib/admin/public/bower_components/qrcodejs/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - -Cross-Browser QRCode generator for Javascript - - - - - - -
-
- - - \ No newline at end of file diff --git a/lib/admin/public/bower_components/qrcodejs/index.svg b/lib/admin/public/bower_components/qrcodejs/index.svg deleted file mode 100644 index fabe56aa..00000000 --- a/lib/admin/public/bower_components/qrcodejs/index.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - -
- -
- - - -
-
diff --git a/lib/admin/public/bower_components/qrcodejs/jquery.min.js b/lib/admin/public/bower_components/qrcodejs/jquery.min.js deleted file mode 100644 index 2740cc4c..00000000 --- a/lib/admin/public/bower_components/qrcodejs/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v1.8.3 jquery.com | jquery.org/license */ -(function(e,t){function _(e){var t=M[e]={};return v.each(e.split(y),function(e,n){t[n]=!0}),t}function H(e,n,r){if(r===t&&e.nodeType===1){var i="data-"+n.replace(P,"-$1").toLowerCase();r=e.getAttribute(i);if(typeof r=="string"){try{r=r==="true"?!0:r==="false"?!1:r==="null"?null:+r+""===r?+r:D.test(r)?v.parseJSON(r):r}catch(s){}v.data(e,n,r)}else r=t}return r}function B(e){var t;for(t in e){if(t==="data"&&v.isEmptyObject(e[t]))continue;if(t!=="toJSON")return!1}return!0}function et(){return!1}function tt(){return!0}function ut(e){return!e||!e.parentNode||e.parentNode.nodeType===11}function at(e,t){do e=e[t];while(e&&e.nodeType!==1);return e}function ft(e,t,n){t=t||0;if(v.isFunction(t))return v.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return v.grep(e,function(e,r){return e===t===n});if(typeof t=="string"){var r=v.grep(e,function(e){return e.nodeType===1});if(it.test(t))return v.filter(t,r,!n);t=v.filter(t,r)}return v.grep(e,function(e,r){return v.inArray(e,t)>=0===n})}function lt(e){var t=ct.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function At(e,t){if(t.nodeType!==1||!v.hasData(e))return;var n,r,i,s=v._data(e),o=v._data(t,s),u=s.events;if(u){delete o.handle,o.events={};for(n in u)for(r=0,i=u[n].length;r").appendTo(i.body),n=t.css("display");t.remove();if(n==="none"||n===""){Pt=i.body.appendChild(Pt||v.extend(i.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!Ht||!Pt.createElement)Ht=(Pt.contentWindow||Pt.contentDocument).document,Ht.write(""),Ht.close();t=Ht.body.appendChild(Ht.createElement(e)),n=Dt(t,"display"),i.body.removeChild(Pt)}return Wt[e]=n,n}function fn(e,t,n,r){var i;if(v.isArray(t))v.each(t,function(t,i){n||sn.test(e)?r(e,i):fn(e+"["+(typeof i=="object"?t:"")+"]",i,n,r)});else if(!n&&v.type(t)==="object")for(i in t)fn(e+"["+i+"]",t[i],n,r);else r(e,t)}function Cn(e){return function(t,n){typeof t!="string"&&(n=t,t="*");var r,i,s,o=t.toLowerCase().split(y),u=0,a=o.length;if(v.isFunction(n))for(;u)[^>]*$|#([\w\-]*)$)/,E=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,S=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,T=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,N=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,C=/^-ms-/,k=/-([\da-z])/gi,L=function(e,t){return(t+"").toUpperCase()},A=function(){i.addEventListener?(i.removeEventListener("DOMContentLoaded",A,!1),v.ready()):i.readyState==="complete"&&(i.detachEvent("onreadystatechange",A),v.ready())},O={};v.fn=v.prototype={constructor:v,init:function(e,n,r){var s,o,u,a;if(!e)return this;if(e.nodeType)return this.context=this[0]=e,this.length=1,this;if(typeof e=="string"){e.charAt(0)==="<"&&e.charAt(e.length-1)===">"&&e.length>=3?s=[null,e,null]:s=w.exec(e);if(s&&(s[1]||!n)){if(s[1])return n=n instanceof v?n[0]:n,a=n&&n.nodeType?n.ownerDocument||n:i,e=v.parseHTML(s[1],a,!0),E.test(s[1])&&v.isPlainObject(n)&&this.attr.call(e,n,!0),v.merge(this,e);o=i.getElementById(s[2]);if(o&&o.parentNode){if(o.id!==s[2])return r.find(e);this.length=1,this[0]=o}return this.context=i,this.selector=e,this}return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e)}return v.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),v.makeArray(e,this))},selector:"",jquery:"1.8.3",length:0,size:function(){return this.length},toArray:function(){return l.call(this)},get:function(e){return e==null?this.toArray():e<0?this[this.length+e]:this[e]},pushStack:function(e,t,n){var r=v.merge(this.constructor(),e);return r.prevObject=this,r.context=this.context,t==="find"?r.selector=this.selector+(this.selector?" ":"")+n:t&&(r.selector=this.selector+"."+t+"("+n+")"),r},each:function(e,t){return v.each(this,e,t)},ready:function(e){return v.ready.promise().done(e),this},eq:function(e){return e=+e,e===-1?this.slice(e):this.slice(e,e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(l.apply(this,arguments),"slice",l.call(arguments).join(","))},map:function(e){return this.pushStack(v.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:[].sort,splice:[].splice},v.fn.init.prototype=v.fn,v.extend=v.fn.extend=function(){var e,n,r,i,s,o,u=arguments[0]||{},a=1,f=arguments.length,l=!1;typeof u=="boolean"&&(l=u,u=arguments[1]||{},a=2),typeof u!="object"&&!v.isFunction(u)&&(u={}),f===a&&(u=this,--a);for(;a0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u-1)a.splice(n,1),i&&(n<=o&&o--,n<=u&&u--)}),this},has:function(e){return v.inArray(e,a)>-1},empty:function(){return a=[],this},disable:function(){return a=f=n=t,this},disabled:function(){return!a},lock:function(){return f=t,n||c.disable(),this},locked:function(){return!f},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],a&&(!r||f)&&(i?f.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},v.extend({Deferred:function(e){var t=[["resolve","done",v.Callbacks("once memory"),"resolved"],["reject","fail",v.Callbacks("once memory"),"rejected"],["notify","progress",v.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return v.Deferred(function(n){v.each(t,function(t,r){var s=r[0],o=e[t];i[r[1]](v.isFunction(o)?function(){var e=o.apply(this,arguments);e&&v.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===i?n:this,[e])}:n[s])}),e=null}).promise()},promise:function(e){return e!=null?v.extend(e,r):r}},i={};return r.pipe=r.then,v.each(t,function(e,s){var o=s[2],u=s[3];r[s[1]]=o.add,u&&o.add(function(){n=u},t[e^1][2].disable,t[2][2].lock),i[s[0]]=o.fire,i[s[0]+"With"]=o.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=l.call(arguments),r=n.length,i=r!==1||e&&v.isFunction(e.promise)?r:0,s=i===1?e:v.Deferred(),o=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?l.call(arguments):r,n===u?s.notifyWith(t,n):--i||s.resolveWith(t,n)}},u,a,f;if(r>1){u=new Array(r),a=new Array(r),f=new Array(r);for(;t
a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
t
",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
","
"]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.ajQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/lib/admin/public/bower_components/qrcodejs/qrcode.js b/lib/admin/public/bower_components/qrcodejs/qrcode.js deleted file mode 100644 index c1217a38..00000000 --- a/lib/admin/public/bower_components/qrcodejs/qrcode.js +++ /dev/null @@ -1,609 +0,0 @@ -/** - * @fileoverview - * - Using the 'QRCode for Javascript library' - * - Fixed dataset of 'QRCode for Javascript library' for support full-spec. - * - this library has no dependencies. - * - * @author davidshimjs - * @see http://www.d-project.com/ - * @see http://jeromeetienne.github.com/jquery-qrcode/ - */ -var QRCode; - -(function () { - //--------------------------------------------------------------------- - // QRCode for JavaScript - // - // Copyright (c) 2009 Kazuhiko Arase - // - // URL: http://www.d-project.com/ - // - // Licensed under the MIT license: - // http://www.opensource.org/licenses/mit-license.php - // - // The word "QR Code" is registered trademark of - // DENSO WAVE INCORPORATED - // http://www.denso-wave.com/qrcode/faqpatent-e.html - // - //--------------------------------------------------------------------- - function QR8bitByte(data) { - this.mode = QRMode.MODE_8BIT_BYTE; - this.data = data; - this.parsedData = []; - - // Added to support UTF-8 Characters - for (var i = 0, l = this.data.length; i < l; i++) { - var byteArray = []; - var code = this.data.charCodeAt(i); - - if (code > 0x10000) { - byteArray[0] = 0xF0 | ((code & 0x1C0000) >>> 18); - byteArray[1] = 0x80 | ((code & 0x3F000) >>> 12); - byteArray[2] = 0x80 | ((code & 0xFC0) >>> 6); - byteArray[3] = 0x80 | (code & 0x3F); - } else if (code > 0x800) { - byteArray[0] = 0xE0 | ((code & 0xF000) >>> 12); - byteArray[1] = 0x80 | ((code & 0xFC0) >>> 6); - byteArray[2] = 0x80 | (code & 0x3F); - } else if (code > 0x80) { - byteArray[0] = 0xC0 | ((code & 0x7C0) >>> 6); - byteArray[1] = 0x80 | (code & 0x3F); - } else { - byteArray[0] = code; - } - - this.parsedData.push(byteArray); - } - - this.parsedData = Array.prototype.concat.apply([], this.parsedData); - - if (this.parsedData.length != this.data.length) { - this.parsedData.unshift(191); - this.parsedData.unshift(187); - this.parsedData.unshift(239); - } - } - - QR8bitByte.prototype = { - getLength: function (buffer) { - return this.parsedData.length; - }, - write: function (buffer) { - for (var i = 0, l = this.parsedData.length; i < l; i++) { - buffer.put(this.parsedData[i], 8); - } - } - }; - - function QRCodeModel(typeNumber, errorCorrectLevel) { - this.typeNumber = typeNumber; - this.errorCorrectLevel = errorCorrectLevel; - this.modules = null; - this.moduleCount = 0; - this.dataCache = null; - this.dataList = []; - } - - QRCodeModel.prototype={addData:function(data){var newData=new QR8bitByte(data);this.dataList.push(newData);this.dataCache=null;},isDark:function(row,col){if(row<0||this.moduleCount<=row||col<0||this.moduleCount<=col){throw new Error(row+","+col);} - return this.modules[row][col];},getModuleCount:function(){return this.moduleCount;},make:function(){this.makeImpl(false,this.getBestMaskPattern());},makeImpl:function(test,maskPattern){this.moduleCount=this.typeNumber*4+17;this.modules=new Array(this.moduleCount);for(var row=0;row=7){this.setupTypeNumber(test);} - if(this.dataCache==null){this.dataCache=QRCodeModel.createData(this.typeNumber,this.errorCorrectLevel,this.dataList);} - this.mapData(this.dataCache,maskPattern);},setupPositionProbePattern:function(row,col){for(var r=-1;r<=7;r++){if(row+r<=-1||this.moduleCount<=row+r)continue;for(var c=-1;c<=7;c++){if(col+c<=-1||this.moduleCount<=col+c)continue;if((0<=r&&r<=6&&(c==0||c==6))||(0<=c&&c<=6&&(r==0||r==6))||(2<=r&&r<=4&&2<=c&&c<=4)){this.modules[row+r][col+c]=true;}else{this.modules[row+r][col+c]=false;}}}},getBestMaskPattern:function(){var minLostPoint=0;var pattern=0;for(var i=0;i<8;i++){this.makeImpl(true,i);var lostPoint=QRUtil.getLostPoint(this);if(i==0||minLostPoint>lostPoint){minLostPoint=lostPoint;pattern=i;}} - return pattern;},createMovieClip:function(target_mc,instance_name,depth){var qr_mc=target_mc.createEmptyMovieClip(instance_name,depth);var cs=1;this.make();for(var row=0;row>i)&1)==1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=mod;} - for(var i=0;i<18;i++){var mod=(!test&&((bits>>i)&1)==1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=mod;}},setupTypeInfo:function(test,maskPattern){var data=(this.errorCorrectLevel<<3)|maskPattern;var bits=QRUtil.getBCHTypeInfo(data);for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<6){this.modules[i][8]=mod;}else if(i<8){this.modules[i+1][8]=mod;}else{this.modules[this.moduleCount-15+i][8]=mod;}} - for(var i=0;i<15;i++){var mod=(!test&&((bits>>i)&1)==1);if(i<8){this.modules[8][this.moduleCount-i-1]=mod;}else if(i<9){this.modules[8][15-i-1+1]=mod;}else{this.modules[8][15-i-1]=mod;}} - this.modules[this.moduleCount-8][8]=(!test);},mapData:function(data,maskPattern){var inc=-1;var row=this.moduleCount-1;var bitIndex=7;var byteIndex=0;for(var col=this.moduleCount-1;col>0;col-=2){if(col==6)col--;while(true){for(var c=0;c<2;c++){if(this.modules[row][col-c]==null){var dark=false;if(byteIndex>>bitIndex)&1)==1);} - var mask=QRUtil.getMask(maskPattern,row,col-c);if(mask){dark=!dark;} - this.modules[row][col-c]=dark;bitIndex--;if(bitIndex==-1){byteIndex++;bitIndex=7;}}} - row+=inc;if(row<0||this.moduleCount<=row){row-=inc;inc=-inc;break;}}}}};QRCodeModel.PAD0=0xEC;QRCodeModel.PAD1=0x11;QRCodeModel.createData=function(typeNumber,errorCorrectLevel,dataList){var rsBlocks=QRRSBlock.getRSBlocks(typeNumber,errorCorrectLevel);var buffer=new QRBitBuffer();for(var i=0;itotalDataCount*8){throw new Error("code length overflow. (" - +buffer.getLengthInBits() - +">" - +totalDataCount*8 - +")");} - if(buffer.getLengthInBits()+4<=totalDataCount*8){buffer.put(0,4);} - while(buffer.getLengthInBits()%8!=0){buffer.putBit(false);} - while(true){if(buffer.getLengthInBits()>=totalDataCount*8){break;} - buffer.put(QRCodeModel.PAD0,8);if(buffer.getLengthInBits()>=totalDataCount*8){break;} - buffer.put(QRCodeModel.PAD1,8);} - return QRCodeModel.createBytes(buffer,rsBlocks);};QRCodeModel.createBytes=function(buffer,rsBlocks){var offset=0;var maxDcCount=0;var maxEcCount=0;var dcdata=new Array(rsBlocks.length);var ecdata=new Array(rsBlocks.length);for(var r=0;r=0)?modPoly.get(modIndex):0;}} - var totalCodeCount=0;for(var i=0;i=0){d^=(QRUtil.G15<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G15)));} - return((data<<10)|d)^QRUtil.G15_MASK;},getBCHTypeNumber:function(data){var d=data<<12;while(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)>=0){d^=(QRUtil.G18<<(QRUtil.getBCHDigit(d)-QRUtil.getBCHDigit(QRUtil.G18)));} - return(data<<12)|d;},getBCHDigit:function(data){var digit=0;while(data!=0){digit++;data>>>=1;} - return digit;},getPatternPosition:function(typeNumber){return QRUtil.PATTERN_POSITION_TABLE[typeNumber-1];},getMask:function(maskPattern,i,j){switch(maskPattern){case QRMaskPattern.PATTERN000:return(i+j)%2==0;case QRMaskPattern.PATTERN001:return i%2==0;case QRMaskPattern.PATTERN010:return j%3==0;case QRMaskPattern.PATTERN011:return(i+j)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(i/2)+Math.floor(j/3))%2==0;case QRMaskPattern.PATTERN101:return(i*j)%2+(i*j)%3==0;case QRMaskPattern.PATTERN110:return((i*j)%2+(i*j)%3)%2==0;case QRMaskPattern.PATTERN111:return((i*j)%3+(i+j)%2)%2==0;default:throw new Error("bad maskPattern:"+maskPattern);}},getErrorCorrectPolynomial:function(errorCorrectLength){var a=new QRPolynomial([1],0);for(var i=0;i5){lostPoint+=(3+sameCount-5);}}} - for(var row=0;row=256){n-=255;} - return QRMath.EXP_TABLE[n];},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++){QRMath.EXP_TABLE[i]=1<>>(7-index%8))&1)==1;},put:function(num,length){for(var i=0;i>>(length-i-1))&1)==1);}},getLengthInBits:function(){return this.length;},putBit:function(bit){var bufIndex=Math.floor(this.length/8);if(this.buffer.length<=bufIndex){this.buffer.push(0);} - if(bit){this.buffer[bufIndex]|=(0x80>>>(this.length%8));} - this.length++;}};var QRCodeLimitLength=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]; - - function _isSupportCanvas() { - return typeof CanvasRenderingContext2D != "undefined"; - } - - // android 2.x doesn't support Data-URI spec - function _getAndroid() { - var android = false; - var sAgent = navigator.userAgent; - - if (/android/i.test(sAgent)) { // android - android = true; - aMat = sAgent.toString().match(/android ([0-9]\.[0-9])/i); - - if (aMat && aMat[1]) { - android = parseFloat(aMat[1]); - } - } - - return android; - } - - var svgDrawer = (function() { - - var Drawing = function (el, htOption) { - this._el = el; - this._htOption = htOption; - }; - - Drawing.prototype.draw = function (oQRCode) { - var _htOption = this._htOption; - var _el = this._el; - var nCount = oQRCode.getModuleCount(); - var nWidth = Math.floor(_htOption.width / nCount); - var nHeight = Math.floor(_htOption.height / nCount); - - this.clear(); - - function makeSVG(tag, attrs) { - var el = document.createElementNS('http://www.w3.org/2000/svg', tag); - for (var k in attrs) - if (attrs.hasOwnProperty(k)) el.setAttribute(k, attrs[k]); - return el; - } - - var svg = makeSVG("svg" , {'viewBox': '0 0 ' + String(nCount) + " " + String(nCount), 'width': '100%', 'height': '100%', 'fill': _htOption.colorLight}); - svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink"); - _el.appendChild(svg); - - svg.appendChild(makeSVG("rect", {"fill": _htOption.colorDark, "width": "1", "height": "1", "id": "template"})); - - for (var row = 0; row < nCount; row++) { - for (var col = 0; col < nCount; col++) { - if (oQRCode.isDark(row, col)) { - var child = makeSVG("use", {"x": String(row), "y": String(col)}); - child.setAttributeNS("http://www.w3.org/1999/xlink", "href", "#template") - svg.appendChild(child); - } - } - } - }; - Drawing.prototype.clear = function () { - while (this._el.hasChildNodes()) - this._el.removeChild(this._el.lastChild); - }; - return Drawing; - })(); - - var useSVG = document.documentElement.tagName.toLowerCase() === "svg"; - - // Drawing in DOM by using Table tag - var Drawing = useSVG ? svgDrawer : !_isSupportCanvas() ? (function () { - var Drawing = function (el, htOption) { - this._el = el; - this._htOption = htOption; - }; - - /** - * Draw the QRCode - * - * @param {QRCode} oQRCode - */ - Drawing.prototype.draw = function (oQRCode) { - var _htOption = this._htOption; - var _el = this._el; - var nCount = oQRCode.getModuleCount(); - var nWidth = Math.floor(_htOption.width / nCount); - var nHeight = Math.floor(_htOption.height / nCount); - var aHTML = ['
']; - - for (var row = 0; row < nCount; row++) { - aHTML.push(''); - - for (var col = 0; col < nCount; col++) { - aHTML.push(''); - } - - aHTML.push(''); - } - - aHTML.push('
'); - _el.innerHTML = aHTML.join(''); - - // Fix the margin values as real size. - var elTable = _el.childNodes[0]; - var nLeftMarginTable = (_htOption.width - elTable.offsetWidth) / 2; - var nTopMarginTable = (_htOption.height - elTable.offsetHeight) / 2; - - if (nLeftMarginTable > 0 && nTopMarginTable > 0) { - elTable.style.margin = nTopMarginTable + "px " + nLeftMarginTable + "px"; - } - }; - - /** - * Clear the QRCode - */ - Drawing.prototype.clear = function () { - this._el.innerHTML = ''; - }; - - return Drawing; - })() : (function () { // Drawing in Canvas - function _onMakeImage() { - this._elImage.src = this._elCanvas.toDataURL("image/png"); - this._elImage.style.display = "block"; - this._elCanvas.style.display = "none"; - } - - // Android 2.1 bug workaround - // http://code.google.com/p/android/issues/detail?id=5141 - if (this._android && this._android <= 2.1) { - var factor = 1 / window.devicePixelRatio; - var drawImage = CanvasRenderingContext2D.prototype.drawImage; - CanvasRenderingContext2D.prototype.drawImage = function (image, sx, sy, sw, sh, dx, dy, dw, dh) { - if (("nodeName" in image) && /img/i.test(image.nodeName)) { - for (var i = arguments.length - 1; i >= 1; i--) { - arguments[i] = arguments[i] * factor; - } - } else if (typeof dw == "undefined") { - arguments[1] *= factor; - arguments[2] *= factor; - arguments[3] *= factor; - arguments[4] *= factor; - } - - drawImage.apply(this, arguments); - }; - } - - /** - * Check whether the user's browser supports Data URI or not - * - * @private - * @param {Function} fSuccess Occurs if it supports Data URI - * @param {Function} fFail Occurs if it doesn't support Data URI - */ - function _safeSetDataURI(fSuccess, fFail) { - var self = this; - self._fFail = fFail; - self._fSuccess = fSuccess; - - // Check it just once - if (self._bSupportDataURI === null) { - var el = document.createElement("img"); - var fOnError = function() { - self._bSupportDataURI = false; - - if (self._fFail) { - _fFail.call(self); - } - }; - var fOnSuccess = function() { - self._bSupportDataURI = true; - - if (self._fSuccess) { - self._fSuccess.call(self); - } - }; - - el.onabort = fOnError; - el.onerror = fOnError; - el.onload = fOnSuccess; - el.src = "data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="; // the Image contains 1px data. - return; - } else if (self._bSupportDataURI === true && self._fSuccess) { - self._fSuccess.call(self); - } else if (self._bSupportDataURI === false && self._fFail) { - self._fFail.call(self); - } - }; - - /** - * Drawing QRCode by using canvas - * - * @constructor - * @param {HTMLElement} el - * @param {Object} htOption QRCode Options - */ - var Drawing = function (el, htOption) { - this._bIsPainted = false; - this._android = _getAndroid(); - - this._htOption = htOption; - this._elCanvas = document.createElement("canvas"); - this._elCanvas.width = htOption.width; - this._elCanvas.height = htOption.height; - el.appendChild(this._elCanvas); - this._el = el; - this._oContext = this._elCanvas.getContext("2d"); - this._bIsPainted = false; - this._elImage = document.createElement("img"); - this._elImage.alt = "Scan me!"; - this._elImage.style.display = "none"; - this._el.appendChild(this._elImage); - this._bSupportDataURI = null; - }; - - /** - * Draw the QRCode - * - * @param {QRCode} oQRCode - */ - Drawing.prototype.draw = function (oQRCode) { - var _elImage = this._elImage; - var _oContext = this._oContext; - var _htOption = this._htOption; - - var nCount = oQRCode.getModuleCount(); - var nWidth = _htOption.width / nCount; - var nHeight = _htOption.height / nCount; - var nRoundedWidth = Math.round(nWidth); - var nRoundedHeight = Math.round(nHeight); - - _elImage.style.display = "none"; - this.clear(); - - for (var row = 0; row < nCount; row++) { - for (var col = 0; col < nCount; col++) { - var bIsDark = oQRCode.isDark(row, col); - var nLeft = col * nWidth; - var nTop = row * nHeight; - _oContext.strokeStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; - _oContext.lineWidth = 1; - _oContext.fillStyle = bIsDark ? _htOption.colorDark : _htOption.colorLight; - _oContext.fillRect(nLeft, nTop, nWidth, nHeight); - - // 안티 앨리어싱 방지 처리 - _oContext.strokeRect( - Math.floor(nLeft) + 0.5, - Math.floor(nTop) + 0.5, - nRoundedWidth, - nRoundedHeight - ); - - _oContext.strokeRect( - Math.ceil(nLeft) - 0.5, - Math.ceil(nTop) - 0.5, - nRoundedWidth, - nRoundedHeight - ); - } - } - - this._bIsPainted = true; - }; - - /** - * Make the image from Canvas if the browser supports Data URI. - */ - Drawing.prototype.makeImage = function () { - if (this._bIsPainted) { - _safeSetDataURI.call(this, _onMakeImage); - } - }; - - /** - * Return whether the QRCode is painted or not - * - * @return {Boolean} - */ - Drawing.prototype.isPainted = function () { - return this._bIsPainted; - }; - - /** - * Clear the QRCode - */ - Drawing.prototype.clear = function () { - this._oContext.clearRect(0, 0, this._elCanvas.width, this._elCanvas.height); - this._bIsPainted = false; - }; - - /** - * @private - * @param {Number} nNumber - */ - Drawing.prototype.round = function (nNumber) { - if (!nNumber) { - return nNumber; - } - - return Math.floor(nNumber * 1000) / 1000; - }; - - return Drawing; - })(); - - /** - * Get the type by string length - * - * @private - * @param {String} sText - * @param {Number} nCorrectLevel - * @return {Number} type - */ - function _getTypeNumber(sText, nCorrectLevel) { - var nType = 1; - var length = _getUTF8Length(sText); - - for (var i = 0, len = QRCodeLimitLength.length; i <= len; i++) { - var nLimit = 0; - - switch (nCorrectLevel) { - case QRErrorCorrectLevel.L : - nLimit = QRCodeLimitLength[i][0]; - break; - case QRErrorCorrectLevel.M : - nLimit = QRCodeLimitLength[i][1]; - break; - case QRErrorCorrectLevel.Q : - nLimit = QRCodeLimitLength[i][2]; - break; - case QRErrorCorrectLevel.H : - nLimit = QRCodeLimitLength[i][3]; - break; - } - - if (length <= nLimit) { - break; - } else { - nType++; - } - } - - if (nType > QRCodeLimitLength.length) { - throw new Error("Too long data"); - } - - return nType; - } - - function _getUTF8Length(sText) { - var replacedText = encodeURI(sText).toString().replace(/\%[0-9a-fA-F]{2}/g, 'a'); - return replacedText.length + (replacedText.length != sText ? 3 : 0); - } - - /** - * @class QRCode - * @constructor - * @example - * new QRCode(document.getElementById("test"), "http://jindo.dev.naver.com/collie"); - * - * @example - * var oQRCode = new QRCode("test", { - * text : "http://naver.com", - * width : 128, - * height : 128 - * }); - * - * oQRCode.clear(); // Clear the QRCode. - * oQRCode.makeCode("http://map.naver.com"); // Re-create the QRCode. - * - * @param {HTMLElement|String} el target element or 'id' attribute of element. - * @param {Object|String} vOption - * @param {String} vOption.text QRCode link data - * @param {Number} [vOption.width=256] - * @param {Number} [vOption.height=256] - * @param {String} [vOption.colorDark="#000000"] - * @param {String} [vOption.colorLight="#ffffff"] - * @param {QRCode.CorrectLevel} [vOption.correctLevel=QRCode.CorrectLevel.H] [L|M|Q|H] - */ - QRCode = function (el, vOption) { - this._htOption = { - width : 256, - height : 256, - typeNumber : 4, - colorDark : "#000000", - colorLight : "#ffffff", - correctLevel : QRErrorCorrectLevel.H - }; - - if (typeof vOption === 'string') { - vOption = { - text : vOption - }; - } - - // Overwrites options - if (vOption) { - for (var i in vOption) { - this._htOption[i] = vOption[i]; - } - } - - if (typeof el == "string") { - el = document.getElementById(el); - } - - this._android = _getAndroid(); - this._el = el; - this._oQRCode = null; - this._oDrawing = new Drawing(this._el, this._htOption); - - if (this._htOption.text) { - this.makeCode(this._htOption.text); - } - }; - - /** - * Make the QRCode - * - * @param {String} sText link data - */ - QRCode.prototype.makeCode = function (sText) { - this._oQRCode = new QRCodeModel(_getTypeNumber(sText, this._htOption.correctLevel), this._htOption.correctLevel); - this._oQRCode.addData(sText); - this._oQRCode.make(); - this._el.title = sText; - this._oDrawing.draw(this._oQRCode); - this.makeImage(); - }; - - /** - * Make the Image from Canvas element - * - It occurs automatically - * - Android below 3 doesn't support Data-URI spec. - * - * @private - */ - QRCode.prototype.makeImage = function () { - if (typeof this._oDrawing.makeImage == "function" && (!this._android || this._android >= 3)) { - this._oDrawing.makeImage(); - } - }; - - /** - * Clear the QRCode - */ - QRCode.prototype.clear = function () { - this._oDrawing.clear(); - }; - - /** - * @name QRCode.CorrectLevel - */ - QRCode.CorrectLevel = QRErrorCorrectLevel; -})(); diff --git a/lib/admin/public/bower_components/qrcodejs/qrcode.min.js b/lib/admin/public/bower_components/qrcodejs/qrcode.min.js deleted file mode 100644 index 993e88f3..00000000 --- a/lib/admin/public/bower_components/qrcodejs/qrcode.min.js +++ /dev/null @@ -1 +0,0 @@ -var QRCode;!function(){function a(a){this.mode=c.MODE_8BIT_BYTE,this.data=a,this.parsedData=[];for(var b=[],d=0,e=this.data.length;e>d;d++){var f=this.data.charCodeAt(d);f>65536?(b[0]=240|(1835008&f)>>>18,b[1]=128|(258048&f)>>>12,b[2]=128|(4032&f)>>>6,b[3]=128|63&f):f>2048?(b[0]=224|(61440&f)>>>12,b[1]=128|(4032&f)>>>6,b[2]=128|63&f):f>128?(b[0]=192|(1984&f)>>>6,b[1]=128|63&f):b[0]=f,this.parsedData=this.parsedData.concat(b)}this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function b(a,b){this.typeNumber=a,this.errorCorrectLevel=b,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function i(a,b){if(void 0==a.length)throw new Error(a.length+"/"+b);for(var c=0;c=f;f++){var h=0;switch(b){case d.L:h=l[f][0];break;case d.M:h=l[f][1];break;case d.Q:h=l[f][2];break;case d.H:h=l[f][3]}if(h>=e)break;c++}if(c>l.length)throw new Error("Too long data");return c}function s(a){var b=encodeURI(a).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return b.length+(b.length!=a?3:0)}a.prototype={getLength:function(){return this.parsedData.length},write:function(a){for(var b=0,c=this.parsedData.length;c>b;b++)a.put(this.parsedData[b],8)}},b.prototype={addData:function(b){var c=new a(b);this.dataList.push(c),this.dataCache=null},isDark:function(a,b){if(0>a||this.moduleCount<=a||0>b||this.moduleCount<=b)throw new Error(a+","+b);return this.modules[a][b]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var d=0;d=7&&this.setupTypeNumber(a),null==this.dataCache&&(this.dataCache=b.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,b){for(var c=-1;7>=c;c++)if(!(-1>=a+c||this.moduleCount<=a+c))for(var d=-1;7>=d;d++)-1>=b+d||this.moduleCount<=b+d||(this.modules[a+c][b+d]=c>=0&&6>=c&&(0==d||6==d)||d>=0&&6>=d&&(0==c||6==c)||c>=2&&4>=c&&d>=2&&4>=d?!0:!1)},getBestMaskPattern:function(){for(var a=0,b=0,c=0;8>c;c++){this.makeImpl(!0,c);var d=f.getLostPoint(this);(0==c||a>d)&&(a=d,b=c)}return b},createMovieClip:function(a,b,c){var d=a.createEmptyMovieClip(b,c),e=1;this.make();for(var f=0;f=g;g++)for(var h=-2;2>=h;h++)this.modules[d+g][e+h]=-2==g||2==g||-2==h||2==h||0==g&&0==h?!0:!1}},setupTypeNumber:function(a){for(var b=f.getBCHTypeNumber(this.typeNumber),c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[Math.floor(c/3)][c%3+this.moduleCount-8-3]=d}for(var c=0;18>c;c++){var d=!a&&1==(1&b>>c);this.modules[c%3+this.moduleCount-8-3][Math.floor(c/3)]=d}},setupTypeInfo:function(a,b){for(var c=this.errorCorrectLevel<<3|b,d=f.getBCHTypeInfo(c),e=0;15>e;e++){var g=!a&&1==(1&d>>e);6>e?this.modules[e][8]=g:8>e?this.modules[e+1][8]=g:this.modules[this.moduleCount-15+e][8]=g}for(var e=0;15>e;e++){var g=!a&&1==(1&d>>e);8>e?this.modules[8][this.moduleCount-e-1]=g:9>e?this.modules[8][15-e-1+1]=g:this.modules[8][15-e-1]=g}this.modules[this.moduleCount-8][8]=!a},mapData:function(a,b){for(var c=-1,d=this.moduleCount-1,e=7,g=0,h=this.moduleCount-1;h>0;h-=2)for(6==h&&h--;;){for(var i=0;2>i;i++)if(null==this.modules[d][h-i]){var j=!1;g>>e));var k=f.getMask(b,d,h-i);k&&(j=!j),this.modules[d][h-i]=j,e--,-1==e&&(g++,e=7)}if(d+=c,0>d||this.moduleCount<=d){d-=c,c=-c;break}}}},b.PAD0=236,b.PAD1=17,b.createData=function(a,c,d){for(var e=j.getRSBlocks(a,c),g=new k,h=0;h8*l)throw new Error("code length overflow. ("+g.getLengthInBits()+">"+8*l+")");for(g.getLengthInBits()+4<=8*l&&g.put(0,4);0!=g.getLengthInBits()%8;)g.putBit(!1);for(;;){if(g.getLengthInBits()>=8*l)break;if(g.put(b.PAD0,8),g.getLengthInBits()>=8*l)break;g.put(b.PAD1,8)}return b.createBytes(g,e)},b.createBytes=function(a,b){for(var c=0,d=0,e=0,g=new Array(b.length),h=new Array(b.length),j=0;j=0?p.get(q):0}}for(var r=0,m=0;mm;m++)for(var j=0;jm;m++)for(var j=0;j=0;)b^=f.G15<=0;)b^=f.G18<>>=1;return b},getPatternPosition:function(a){return f.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,b,c){switch(a){case e.PATTERN000:return 0==(b+c)%2;case e.PATTERN001:return 0==b%2;case e.PATTERN010:return 0==c%3;case e.PATTERN011:return 0==(b+c)%3;case e.PATTERN100:return 0==(Math.floor(b/2)+Math.floor(c/3))%2;case e.PATTERN101:return 0==b*c%2+b*c%3;case e.PATTERN110:return 0==(b*c%2+b*c%3)%2;case e.PATTERN111:return 0==(b*c%3+(b+c)%2)%2;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var b=new i([1],0),c=0;a>c;c++)b=b.multiply(new i([1,g.gexp(c)],0));return b},getLengthInBits:function(a,b){if(b>=1&&10>b)switch(a){case c.MODE_NUMBER:return 10;case c.MODE_ALPHA_NUM:return 9;case c.MODE_8BIT_BYTE:return 8;case c.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(27>b)switch(a){case c.MODE_NUMBER:return 12;case c.MODE_ALPHA_NUM:return 11;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else{if(!(41>b))throw new Error("type:"+b);switch(a){case c.MODE_NUMBER:return 14;case c.MODE_ALPHA_NUM:return 13;case c.MODE_8BIT_BYTE:return 16;case c.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}}},getLostPoint:function(a){for(var b=a.getModuleCount(),c=0,d=0;b>d;d++)for(var e=0;b>e;e++){for(var f=0,g=a.isDark(d,e),h=-1;1>=h;h++)if(!(0>d+h||d+h>=b))for(var i=-1;1>=i;i++)0>e+i||e+i>=b||(0!=h||0!=i)&&g==a.isDark(d+h,e+i)&&f++;f>5&&(c+=3+f-5)}for(var d=0;b-1>d;d++)for(var e=0;b-1>e;e++){var j=0;a.isDark(d,e)&&j++,a.isDark(d+1,e)&&j++,a.isDark(d,e+1)&&j++,a.isDark(d+1,e+1)&&j++,(0==j||4==j)&&(c+=3)}for(var d=0;b>d;d++)for(var e=0;b-6>e;e++)a.isDark(d,e)&&!a.isDark(d,e+1)&&a.isDark(d,e+2)&&a.isDark(d,e+3)&&a.isDark(d,e+4)&&!a.isDark(d,e+5)&&a.isDark(d,e+6)&&(c+=40);for(var e=0;b>e;e++)for(var d=0;b-6>d;d++)a.isDark(d,e)&&!a.isDark(d+1,e)&&a.isDark(d+2,e)&&a.isDark(d+3,e)&&a.isDark(d+4,e)&&!a.isDark(d+5,e)&&a.isDark(d+6,e)&&(c+=40);for(var k=0,e=0;b>e;e++)for(var d=0;b>d;d++)a.isDark(d,e)&&k++;var l=Math.abs(100*k/b/b-50)/5;return c+=10*l}},g={glog:function(a){if(1>a)throw new Error("glog("+a+")");return g.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;a>=256;)a-=255;return g.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},h=0;8>h;h++)g.EXP_TABLE[h]=1<h;h++)g.EXP_TABLE[h]=g.EXP_TABLE[h-4]^g.EXP_TABLE[h-5]^g.EXP_TABLE[h-6]^g.EXP_TABLE[h-8];for(var h=0;255>h;h++)g.LOG_TABLE[g.EXP_TABLE[h]]=h;i.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var b=new Array(this.getLength()+a.getLength()-1),c=0;cf;f++)for(var g=c[3*f+0],h=c[3*f+1],i=c[3*f+2],k=0;g>k;k++)e.push(new j(h,i));return e},j.getRsBlockTable=function(a,b){switch(b){case d.L:return j.RS_BLOCK_TABLE[4*(a-1)+0];case d.M:return j.RS_BLOCK_TABLE[4*(a-1)+1];case d.Q:return j.RS_BLOCK_TABLE[4*(a-1)+2];case d.H:return j.RS_BLOCK_TABLE[4*(a-1)+3];default:return void 0}},k.prototype={get:function(a){var b=Math.floor(a/8);return 1==(1&this.buffer[b]>>>7-a%8)},put:function(a,b){for(var c=0;b>c;c++)this.putBit(1==(1&a>>>b-c-1))},getLengthInBits:function(){return this.length},putBit:function(a){var b=Math.floor(this.length/8);this.buffer.length<=b&&this.buffer.push(0),a&&(this.buffer[b]|=128>>>this.length%8),this.length++}};var l=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],o=function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){function g(a,b){var c=document.createElementNS("http://www.w3.org/2000/svg",a);for(var d in b)b.hasOwnProperty(d)&&c.setAttribute(d,b[d]);return c}var b=this._htOption,c=this._el,d=a.getModuleCount();Math.floor(b.width/d),Math.floor(b.height/d),this.clear();var h=g("svg",{viewBox:"0 0 "+String(d)+" "+String(d),width:"100%",height:"100%",fill:b.colorLight});h.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),c.appendChild(h),h.appendChild(g("rect",{fill:b.colorDark,width:"1",height:"1",id:"template"}));for(var i=0;d>i;i++)for(var j=0;d>j;j++)if(a.isDark(i,j)){var k=g("use",{x:String(i),y:String(j)});k.setAttributeNS("http://www.w3.org/1999/xlink","href","#template"),h.appendChild(k)}},a.prototype.clear=function(){for(;this._el.hasChildNodes();)this._el.removeChild(this._el.lastChild)},a}(),p="svg"===document.documentElement.tagName.toLowerCase(),q=p?o:m()?function(){function a(){this._elImage.src=this._elCanvas.toDataURL("image/png"),this._elImage.style.display="block",this._elCanvas.style.display="none"}function d(a,b){var c=this;if(c._fFail=b,c._fSuccess=a,null===c._bSupportDataURI){var d=document.createElement("img"),e=function(){c._bSupportDataURI=!1,c._fFail&&_fFail.call(c)},f=function(){c._bSupportDataURI=!0,c._fSuccess&&c._fSuccess.call(c)};return d.onabort=e,d.onerror=e,d.onload=f,d.src="data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",void 0}c._bSupportDataURI===!0&&c._fSuccess?c._fSuccess.call(c):c._bSupportDataURI===!1&&c._fFail&&c._fFail.call(c)}if(this._android&&this._android<=2.1){var b=1/window.devicePixelRatio,c=CanvasRenderingContext2D.prototype.drawImage;CanvasRenderingContext2D.prototype.drawImage=function(a,d,e,f,g,h,i,j){if("nodeName"in a&&/img/i.test(a.nodeName))for(var l=arguments.length-1;l>=1;l--)arguments[l]=arguments[l]*b;else"undefined"==typeof j&&(arguments[1]*=b,arguments[2]*=b,arguments[3]*=b,arguments[4]*=b);c.apply(this,arguments)}}var e=function(a,b){this._bIsPainted=!1,this._android=n(),this._htOption=b,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=b.width,this._elCanvas.height=b.height,a.appendChild(this._elCanvas),this._el=a,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return e.prototype.draw=function(a){var b=this._elImage,c=this._oContext,d=this._htOption,e=a.getModuleCount(),f=d.width/e,g=d.height/e,h=Math.round(f),i=Math.round(g);b.style.display="none",this.clear();for(var j=0;e>j;j++)for(var k=0;e>k;k++){var l=a.isDark(j,k),m=k*f,n=j*g;c.strokeStyle=l?d.colorDark:d.colorLight,c.lineWidth=1,c.fillStyle=l?d.colorDark:d.colorLight,c.fillRect(m,n,f,g),c.strokeRect(Math.floor(m)+.5,Math.floor(n)+.5,h,i),c.strokeRect(Math.ceil(m)-.5,Math.ceil(n)-.5,h,i)}this._bIsPainted=!0},e.prototype.makeImage=function(){this._bIsPainted&&d.call(this,a)},e.prototype.isPainted=function(){return this._bIsPainted},e.prototype.clear=function(){this._oContext.clearRect(0,0,this._elCanvas.width,this._elCanvas.height),this._bIsPainted=!1},e.prototype.round=function(a){return a?Math.floor(1e3*a)/1e3:a},e}():function(){var a=function(a,b){this._el=a,this._htOption=b};return a.prototype.draw=function(a){for(var b=this._htOption,c=this._el,d=a.getModuleCount(),e=Math.floor(b.width/d),f=Math.floor(b.height/d),g=[''],h=0;d>h;h++){g.push("");for(var i=0;d>i;i++)g.push('');g.push("")}g.push("
"),c.innerHTML=g.join("");var j=c.childNodes[0],k=(b.width-j.offsetWidth)/2,l=(b.height-j.offsetHeight)/2;k>0&&l>0&&(j.style.margin=l+"px "+k+"px")},a.prototype.clear=function(){this._el.innerHTML=""},a}();QRCode=function(a,b){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:d.H},"string"==typeof b&&(b={text:b}),b)for(var c in b)this._htOption[c]=b[c];"string"==typeof a&&(a=document.getElementById(a)),this._android=n(),this._el=a,this._oQRCode=null,this._oDrawing=new q(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},QRCode.prototype.makeCode=function(a){this._oQRCode=new b(r(a,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(a),this._oQRCode.make(),this._el.title=a,this._oDrawing.draw(this._oQRCode),this.makeImage()},QRCode.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},QRCode.prototype.clear=function(){this._oDrawing.clear()},QRCode.CorrectLevel=d}(); \ No newline at end of file diff --git a/lib/admin/public/bower_components/qrious/.bower.json b/lib/admin/public/bower_components/qrious/.bower.json deleted file mode 100644 index 3891e55c..00000000 --- a/lib/admin/public/bower_components/qrious/.bower.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "qrious", - "version": "2.0.2", - "description": "Library for QR code generation using canvas", - "homepage": "https://github.com/neocotic/qrious", - "authors": [ - { - "name": "Alasdair Mercer", - "email": "mercer.alasdair@gmail.com", - "homepage": "http://neocotic.com" - } - ], - "license": "GPL-3.0", - "keywords": [ - "qr", - "code", - "encode", - "canvas", - "image" - ], - "repository": { - "type": "git", - "url": "https://github.com/neocotic/qrious.git" - }, - "main": "dist/umd/qrious.js", - "ignore": [ - "src/", - ".*", - "AUTHORS.md", - "CHANGES.md", - "CONTRIBUTING.md", - "demo.html", - "Gruntfile.js", - "package.json", - "README.md" - ], - "_release": "2.0.2", - "_resolution": { - "type": "version", - "tag": "2.0.2", - "commit": "1ffd092e97ab3ba212fad21ab865eb1754155296" - }, - "_source": "https://github.com/neocotic/qrious.git", - "_target": "^2.0.2", - "_originalSource": "qrious", - "_direct": true -} \ No newline at end of file diff --git a/lib/admin/public/bower_components/qrious/LICENSE.md b/lib/admin/public/bower_components/qrious/LICENSE.md deleted file mode 100644 index 7ac38638..00000000 --- a/lib/admin/public/bower_components/qrious/LICENSE.md +++ /dev/null @@ -1,16 +0,0 @@ -QRious -Copyright (C) 2016 Alasdair Mercer -Copyright (C) 2010 Tom Zerucha - -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 . diff --git a/lib/admin/public/bower_components/qrious/bower.json b/lib/admin/public/bower_components/qrious/bower.json deleted file mode 100644 index 25a23fb3..00000000 --- a/lib/admin/public/bower_components/qrious/bower.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "name": "qrious", - "version": "2.0.2", - "description": "Library for QR code generation using canvas", - "homepage": "https://github.com/neocotic/qrious", - "authors": [ - { - "name": "Alasdair Mercer", - "email": "mercer.alasdair@gmail.com", - "homepage": "http://neocotic.com" - } - ], - "license": "GPL-3.0", - "keywords": [ - "qr", - "code", - "encode", - "canvas", - "image" - ], - "repository": { - "type": "git", - "url": "https://github.com/neocotic/qrious.git" - }, - "main": "dist/umd/qrious.js", - "ignore": [ - "src/", - ".*", - "AUTHORS.md", - "CHANGES.md", - "CONTRIBUTING.md", - "demo.html", - "Gruntfile.js", - "package.json", - "README.md" - ] -} diff --git a/lib/admin/public/bower_components/qrjs/.bower.json b/lib/admin/public/bower_components/qrjs/.bower.json deleted file mode 100644 index a754ab2d..00000000 --- a/lib/admin/public/bower_components/qrjs/.bower.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "qrjs", - "main": "qr.js", - "version": "0.1.2", - "homepage": "https://github.com/educastellano/qr.js", - "authors": [ - "Kang Seonghoon ", - "Eduard Castellano " - ], - "description": "QR code generator in Javascript", - "moduleType": [ - "globals" - ], - "keywords": [ - "qr", - "qr.js", - "qrcode" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ], - "_release": "0.1.2", - "_resolution": { - "type": "version", - "tag": "v0.1.2", - "commit": "dbfa732cb309195a51a656b021f309d354154e04" - }, - "_source": "https://github.com/educastellano/qr.js.git", - "_target": "~0.1.2", - "_originalSource": "qrjs" -} \ No newline at end of file diff --git a/lib/admin/public/bower_components/qrjs/README.md b/lib/admin/public/bower_components/qrjs/README.md deleted file mode 100644 index 549a9b24..00000000 --- a/lib/admin/public/bower_components/qrjs/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# qr.js: QR code generator in pure Javascript (2011) - -This is a fairly standalone script for producing QR code on the fly. -Originally developed for my own interest, the code is fully commented and well-structured. -The code is in the public domain (or to be exact, [Creative Commons Zero](https://creativecommons.org/publicdomain/zero/1.0/)), -and you can use it for absolutely any purpose. - -See also a [node.js module based on qr.js](https://github.com/shesek/qruri), packaged by Nadav Ivgi. diff --git a/lib/admin/public/bower_components/qrjs/bower.json b/lib/admin/public/bower_components/qrjs/bower.json deleted file mode 100644 index 39261ebf..00000000 --- a/lib/admin/public/bower_components/qrjs/bower.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "qrjs", - "main": "qr.js", - "version": "0.1.2", - "homepage": "https://github.com/educastellano/qr.js", - "authors": [ - "Kang Seonghoon ", - "Eduard Castellano " - ], - "description": "QR code generator in Javascript", - "moduleType": [ - "globals" - ], - "keywords": [ - "qr", - "qr.js", - "qrcode" - ], - "license": "MIT", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/lib/admin/public/bower_components/qrjs/package.json b/lib/admin/public/bower_components/qrjs/package.json deleted file mode 100644 index 58b852ba..00000000 --- a/lib/admin/public/bower_components/qrjs/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "qrjs", - "version": "0.1.1", - "description": "QR code generator in Javascript", - "main": "qr.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/educastellano/qr.js.git" - }, - "keywords": [ - "qr", - "qr.js", - "qrcode" - ], - "author": "Kang Seonghoon ", - "license": "MIT", - "bugs": { - "url": "https://github.com/educastellano/qr.js/issues" - }, - "homepage": "https://github.com/educastellano/qr.js" -} diff --git a/lib/admin/public/bower_components/qrjs/qr.js b/lib/admin/public/bower_components/qrjs/qr.js deleted file mode 100644 index 2dd08112..00000000 --- a/lib/admin/public/bower_components/qrjs/qr.js +++ /dev/null @@ -1,804 +0,0 @@ -/* qr.js -- QR code generator in Javascript (revision 2011-01-19) - * Written by Kang Seonghoon . - * - * This source code is in the public domain; if your jurisdiction does not - * recognize the public domain the terms of Creative Commons CC0 license - * apply. In the other words, you can always do what you want. - */ -(function(root, name, definition) { - if (typeof define === 'function' && define.amd) { - define([], definition); - } else if (typeof module === 'object' && module.exports) { - module.exports = definition(); - } else { - root[name] = definition(); - } -})(this, 'QRCode', function() { -/* Quick overview: QR code composed of 2D array of modules (a rectangular - * area that conveys one bit of information); some modules are fixed to help - * the recognition of the code, and remaining data modules are further divided - * into 8-bit code words which are augumented by Reed-Solomon error correcting - * codes (ECC). There could be multiple ECCs, in the case the code is so large - * that it is helpful to split the raw data into several chunks. - * - * The number of modules is determined by the code's "version", ranging from 1 - * (21x21) to 40 (177x177). How many ECC bits are used is determined by the - * ECC level (L/M/Q/H). The number and size (and thus the order of generator - * polynomial) of ECCs depend to the version and ECC level. - */ - -// per-version information (cf. JIS X 0510:2004 pp. 30--36, 71) -// -// [0]: the degree of generator polynomial by ECC levels -// [1]: # of code blocks by ECC levels -// [2]: left-top positions of alignment patterns -// -// the number in this table (in particular, [0]) does not exactly match with -// the numbers in the specficiation. see augumenteccs below for the reason. -var VERSIONS = [ - null, - [[10, 7,17,13], [ 1, 1, 1, 1], []], - [[16,10,28,22], [ 1, 1, 1, 1], [4,16]], - [[26,15,22,18], [ 1, 1, 2, 2], [4,20]], - [[18,20,16,26], [ 2, 1, 4, 2], [4,24]], - [[24,26,22,18], [ 2, 1, 4, 4], [4,28]], - [[16,18,28,24], [ 4, 2, 4, 4], [4,32]], - [[18,20,26,18], [ 4, 2, 5, 6], [4,20,36]], - [[22,24,26,22], [ 4, 2, 6, 6], [4,22,40]], - [[22,30,24,20], [ 5, 2, 8, 8], [4,24,44]], - [[26,18,28,24], [ 5, 4, 8, 8], [4,26,48]], - [[30,20,24,28], [ 5, 4,11, 8], [4,28,52]], - [[22,24,28,26], [ 8, 4,11,10], [4,30,56]], - [[22,26,22,24], [ 9, 4,16,12], [4,32,60]], - [[24,30,24,20], [ 9, 4,16,16], [4,24,44,64]], - [[24,22,24,30], [10, 6,18,12], [4,24,46,68]], - [[28,24,30,24], [10, 6,16,17], [4,24,48,72]], - [[28,28,28,28], [11, 6,19,16], [4,28,52,76]], - [[26,30,28,28], [13, 6,21,18], [4,28,54,80]], - [[26,28,26,26], [14, 7,25,21], [4,28,56,84]], - [[26,28,28,30], [16, 8,25,20], [4,32,60,88]], - [[26,28,30,28], [17, 8,25,23], [4,26,48,70,92]], - [[28,28,24,30], [17, 9,34,23], [4,24,48,72,96]], - [[28,30,30,30], [18, 9,30,25], [4,28,52,76,100]], - [[28,30,30,30], [20,10,32,27], [4,26,52,78,104]], - [[28,26,30,30], [21,12,35,29], [4,30,56,82,108]], - [[28,28,30,28], [23,12,37,34], [4,28,56,84,112]], - [[28,30,30,30], [25,12,40,34], [4,32,60,88,116]], - [[28,30,30,30], [26,13,42,35], [4,24,48,72,96,120]], - [[28,30,30,30], [28,14,45,38], [4,28,52,76,100,124]], - [[28,30,30,30], [29,15,48,40], [4,24,50,76,102,128]], - [[28,30,30,30], [31,16,51,43], [4,28,54,80,106,132]], - [[28,30,30,30], [33,17,54,45], [4,32,58,84,110,136]], - [[28,30,30,30], [35,18,57,48], [4,28,56,84,112,140]], - [[28,30,30,30], [37,19,60,51], [4,32,60,88,116,144]], - [[28,30,30,30], [38,19,63,53], [4,28,52,76,100,124,148]], - [[28,30,30,30], [40,20,66,56], [4,22,48,74,100,126,152]], - [[28,30,30,30], [43,21,70,59], [4,26,52,78,104,130,156]], - [[28,30,30,30], [45,22,74,62], [4,30,56,82,108,134,160]], - [[28,30,30,30], [47,24,77,65], [4,24,52,80,108,136,164]], - [[28,30,30,30], [49,25,81,68], [4,28,56,84,112,140,168]]]; - -// mode constants (cf. Table 2 in JIS X 0510:2004 p. 16) -var MODE_TERMINATOR = 0; -var MODE_NUMERIC = 1, MODE_ALPHANUMERIC = 2, MODE_OCTET = 4, MODE_KANJI = 8; - -// validation regexps -var NUMERIC_REGEXP = /^\d*$/; -var ALPHANUMERIC_REGEXP = /^[A-Za-z0-9 $%*+\-./:]*$/; -var ALPHANUMERIC_OUT_REGEXP = /^[A-Z0-9 $%*+\-./:]*$/; - -// ECC levels (cf. Table 22 in JIS X 0510:2004 p. 45) -var ECCLEVEL_L = 1, ECCLEVEL_M = 0, ECCLEVEL_Q = 3, ECCLEVEL_H = 2; - -// GF(2^8)-to-integer mapping with a reducing polynomial x^8+x^4+x^3+x^2+1 -// invariant: GF256_MAP[GF256_INVMAP[i]] == i for all i in [1,256) -var GF256_MAP = [], GF256_INVMAP = [-1]; -for (var i = 0, v = 1; i < 255; ++i) { - GF256_MAP.push(v); - GF256_INVMAP[v] = i; - v = (v * 2) ^ (v >= 128 ? 0x11d : 0); -} - -// generator polynomials up to degree 30 -// (should match with polynomials in JIS X 0510:2004 Appendix A) -// -// generator polynomial of degree K is product of (x-\alpha^0), (x-\alpha^1), -// ..., (x-\alpha^(K-1)). by convention, we omit the K-th coefficient (always 1) -// from the result; also other coefficients are written in terms of the exponent -// to \alpha to avoid the redundant calculation. (see also calculateecc below.) -var GF256_GENPOLY = [[]]; -for (var i = 0; i < 30; ++i) { - var prevpoly = GF256_GENPOLY[i], poly = []; - for (var j = 0; j <= i; ++j) { - var a = (j < i ? GF256_MAP[prevpoly[j]] : 0); - var b = GF256_MAP[(i + (prevpoly[j-1] || 0)) % 255]; - poly.push(GF256_INVMAP[a ^ b]); - } - GF256_GENPOLY.push(poly); -} - -// alphanumeric character mapping (cf. Table 5 in JIS X 0510:2004 p. 19) -var ALPHANUMERIC_MAP = {}; -for (var i = 0; i < 45; ++i) { - ALPHANUMERIC_MAP['0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:'.charAt(i)] = i; -} - -// mask functions in terms of row # and column # -// (cf. Table 20 in JIS X 0510:2004 p. 42) -var MASKFUNCS = [ - function(i,j) { return (i+j) % 2 == 0; }, - function(i,j) { return i % 2 == 0; }, - function(i,j) { return j % 3 == 0; }, - function(i,j) { return (i+j) % 3 == 0; }, - function(i,j) { return (((i/2)|0) + ((j/3)|0)) % 2 == 0; }, - function(i,j) { return (i*j) % 2 + (i*j) % 3 == 0; }, - function(i,j) { return ((i*j) % 2 + (i*j) % 3) % 2 == 0; }, - function(i,j) { return ((i+j) % 2 + (i*j) % 3) % 2 == 0; }]; - -// returns true when the version information has to be embeded. -var needsverinfo = function(ver) { return ver > 6; }; - -// returns the size of entire QR code for given version. -var getsizebyver = function(ver) { return 4 * ver + 17; }; - -// returns the number of bits available for code words in this version. -var nfullbits = function(ver) { - /* - * |<--------------- n --------------->| - * | |<----- n-17 ---->| | - * +-------+ ///+-------+ ---- - * | | ///| | ^ - * | 9x9 | @@@@@ ///| 9x8 | | - * | | # # # @5x5@ # # # | | | - * +-------+ @@@@@ +-------+ | - * # ---| - * ^ | - * # | - * @@@@@ @@@@@ @@@@@ | n - * @5x5@ @5x5@ @5x5@ n-17 - * @@@@@ @@@@@ @@@@@ | | - * # | | - * ////// v | - * //////# ---| - * +-------+ @@@@@ @@@@@ | - * | | @5x5@ @5x5@ | - * | 8x9 | @@@@@ @@@@@ | - * | | v - * +-------+ ---- - * - * when the entire code has n^2 modules and there are m^2-3 alignment - * patterns, we have: - * - 225 (= 9x9 + 9x8 + 8x9) modules for finder patterns and - * format information; - * - 2n-34 (= 2(n-17)) modules for timing patterns; - * - 36 (= 3x6 + 6x3) modules for version information, if any; - * - 25m^2-75 (= (m^2-3)(5x5)) modules for alignment patterns - * if any, but 10m-20 (= 2(m-2)x5) of them overlaps with - * timing patterns. - */ - var v = VERSIONS[ver]; - var nbits = 16*ver*ver + 128*ver + 64; // finder, timing and format info. - if (needsverinfo(ver)) nbits -= 36; // version information - if (v[2].length) { // alignment patterns - nbits -= 25 * v[2].length * v[2].length - 10 * v[2].length - 55; - } - return nbits; -}; - -// returns the number of bits available for data portions (i.e. excludes ECC -// bits but includes mode and length bits) in this version and ECC level. -var ndatabits = function(ver, ecclevel) { - var nbits = nfullbits(ver) & ~7; // no sub-octet code words - var v = VERSIONS[ver]; - nbits -= 8 * v[0][ecclevel] * v[1][ecclevel]; // ecc bits - return nbits; -} - -// returns the number of bits required for the length of data. -// (cf. Table 3 in JIS X 0510:2004 p. 16) -var ndatalenbits = function(ver, mode) { - switch (mode) { - case MODE_NUMERIC: return (ver < 10 ? 10 : ver < 27 ? 12 : 14); - case MODE_ALPHANUMERIC: return (ver < 10 ? 9 : ver < 27 ? 11 : 13); - case MODE_OCTET: return (ver < 10 ? 8 : 16); - case MODE_KANJI: return (ver < 10 ? 8 : ver < 27 ? 10 : 12); - } -}; - -// returns the maximum length of data possible in given configuration. -var getmaxdatalen = function(ver, mode, ecclevel) { - var nbits = ndatabits(ver, ecclevel) - 4 - ndatalenbits(ver, mode); // 4 for mode bits - switch (mode) { - case MODE_NUMERIC: - return ((nbits/10) | 0) * 3 + (nbits%10 < 4 ? 0 : nbits%10 < 7 ? 1 : 2); - case MODE_ALPHANUMERIC: - return ((nbits/11) | 0) * 2 + (nbits%11 < 6 ? 0 : 1); - case MODE_OCTET: - return (nbits/8) | 0; - case MODE_KANJI: - return (nbits/13) | 0; - } -}; - -// checks if the given data can be encoded in given mode, and returns -// the converted data for the further processing if possible. otherwise -// returns null. -// -// this function does not check the length of data; it is a duty of -// encode function below (as it depends on the version and ECC level too). -var validatedata = function(mode, data) { - switch (mode) { - case MODE_NUMERIC: - if (!data.match(NUMERIC_REGEXP)) return null; - return data; - - case MODE_ALPHANUMERIC: - if (!data.match(ALPHANUMERIC_REGEXP)) return null; - return data.toUpperCase(); - - case MODE_OCTET: - if (typeof data === 'string') { // encode as utf-8 string - var newdata = []; - for (var i = 0; i < data.length; ++i) { - var ch = data.charCodeAt(i); - if (ch < 0x80) { - newdata.push(ch); - } else if (ch < 0x800) { - newdata.push(0xc0 | (ch >> 6), - 0x80 | (ch & 0x3f)); - } else if (ch < 0x10000) { - newdata.push(0xe0 | (ch >> 12), - 0x80 | ((ch >> 6) & 0x3f), - 0x80 | (ch & 0x3f)); - } else { - newdata.push(0xf0 | (ch >> 18), - 0x80 | ((ch >> 12) & 0x3f), - 0x80 | ((ch >> 6) & 0x3f), - 0x80 | (ch & 0x3f)); - } - } - return newdata; - } else { - return data; - } - } -}; - -// returns the code words (sans ECC bits) for given data and configurations. -// requires data to be preprocessed by validatedata. no length check is -// performed, and everything has to be checked before calling this function. -var encode = function(ver, mode, data, maxbuflen) { - var buf = []; - var bits = 0, remaining = 8; - var datalen = data.length; - - // this function is intentionally no-op when n=0. - var pack = function(x, n) { - if (n >= remaining) { - buf.push(bits | (x >> (n -= remaining))); - while (n >= 8) buf.push((x >> (n -= 8)) & 255); - bits = 0; - remaining = 8; - } - if (n > 0) bits |= (x & ((1 << n) - 1)) << (remaining -= n); - }; - - var nlenbits = ndatalenbits(ver, mode); - pack(mode, 4); - pack(datalen, nlenbits); - - switch (mode) { - case MODE_NUMERIC: - for (var i = 2; i < datalen; i += 3) { - pack(parseInt(data.substring(i-2,i+1), 10), 10); - } - pack(parseInt(data.substring(i-2), 10), [0,4,7][datalen%3]); - break; - - case MODE_ALPHANUMERIC: - for (var i = 1; i < datalen; i += 2) { - pack(ALPHANUMERIC_MAP[data.charAt(i-1)] * 45 + - ALPHANUMERIC_MAP[data.charAt(i)], 11); - } - if (datalen % 2 == 1) { - pack(ALPHANUMERIC_MAP[data.charAt(i-1)], 6); - } - break; - - case MODE_OCTET: - for (var i = 0; i < datalen; ++i) { - pack(data[i], 8); - } - break; - }; - - // final bits. it is possible that adding terminator causes the buffer - // to overflow, but then the buffer truncated to the maximum size will - // be valid as the truncated terminator mode bits and padding is - // identical in appearance (cf. JIS X 0510:2004 sec 8.4.8). - pack(MODE_TERMINATOR, 4); - if (remaining < 8) buf.push(bits); - - // the padding to fill up the remaining space. we should not add any - // words when the overflow already occurred. - while (buf.length + 1 < maxbuflen) buf.push(0xec, 0x11); - if (buf.length < maxbuflen) buf.push(0xec); - return buf; -}; - -// calculates ECC code words for given code words and generator polynomial. -// -// this is quite similar to CRC calculation as both Reed-Solomon and CRC use -// the certain kind of cyclic codes, which is effectively the division of -// zero-augumented polynomial by the generator polynomial. the only difference -// is that Reed-Solomon uses GF(2^8), instead of CRC's GF(2), and Reed-Solomon -// uses the different generator polynomial than CRC's. -var calculateecc = function(poly, genpoly) { - var modulus = poly.slice(0); - var polylen = poly.length, genpolylen = genpoly.length; - for (var i = 0; i < genpolylen; ++i) modulus.push(0); - for (var i = 0; i < polylen; ) { - var quotient = GF256_INVMAP[modulus[i++]]; - if (quotient >= 0) { - for (var j = 0; j < genpolylen; ++j) { - modulus[i+j] ^= GF256_MAP[(quotient + genpoly[j]) % 255]; - } - } - } - return modulus.slice(polylen); -}; - -// auguments ECC code words to given code words. the resulting words are -// ready to be encoded in the matrix. -// -// the much of actual augumenting procedure follows JIS X 0510:2004 sec 8.7. -// the code is simplified using the fact that the size of each code & ECC -// blocks is almost same; for example, when we have 4 blocks and 46 data words -// the number of code words in those blocks are 11, 11, 12, 12 respectively. -var augumenteccs = function(poly, nblocks, genpoly) { - var subsizes = []; - var subsize = (poly.length / nblocks) | 0, subsize0 = 0; - var pivot = nblocks - poly.length % nblocks; - for (var i = 0; i < pivot; ++i) { - subsizes.push(subsize0); - subsize0 += subsize; - } - for (var i = pivot; i < nblocks; ++i) { - subsizes.push(subsize0); - subsize0 += subsize+1; - } - subsizes.push(subsize0); - - var eccs = []; - for (var i = 0; i < nblocks; ++i) { - eccs.push(calculateecc(poly.slice(subsizes[i], subsizes[i+1]), genpoly)); - } - - var result = []; - var nitemsperblock = (poly.length / nblocks) | 0; - for (var i = 0; i < nitemsperblock; ++i) { - for (var j = 0; j < nblocks; ++j) { - result.push(poly[subsizes[j] + i]); - } - } - for (var j = pivot; j < nblocks; ++j) { - result.push(poly[subsizes[j+1] - 1]); - } - for (var i = 0; i < genpoly.length; ++i) { - for (var j = 0; j < nblocks; ++j) { - result.push(eccs[j][i]); - } - } - return result; -}; - -// auguments BCH(p+q,q) code to the polynomial over GF(2), given the proper -// genpoly. the both input and output are in binary numbers, and unlike -// calculateecc genpoly should include the 1 bit for the highest degree. -// -// actual polynomials used for this procedure are as follows: -// - p=10, q=5, genpoly=x^10+x^8+x^5+x^4+x^2+x+1 (JIS X 0510:2004 Appendix C) -// - p=18, q=6, genpoly=x^12+x^11+x^10+x^9+x^8+x^5+x^2+1 (ibid. Appendix D) -var augumentbch = function(poly, p, genpoly, q) { - var modulus = poly << q; - for (var i = p - 1; i >= 0; --i) { - if ((modulus >> (q+i)) & 1) modulus ^= genpoly << i; - } - return (poly << q) | modulus; -}; - -// creates the base matrix for given version. it returns two matrices, one of -// them is the actual one and the another represents the "reserved" portion -// (e.g. finder and timing patterns) of the matrix. -// -// some entries in the matrix may be undefined, rather than 0 or 1. this is -// intentional (no initialization needed!), and putdata below will fill -// the remaining ones. -var makebasematrix = function(ver) { - var v = VERSIONS[ver], n = getsizebyver(ver); - var matrix = [], reserved = []; - for (var i = 0; i < n; ++i) { - matrix.push([]); - reserved.push([]); - } - - var blit = function(y, x, h, w, bits) { - for (var i = 0; i < h; ++i) { - for (var j = 0; j < w; ++j) { - matrix[y+i][x+j] = (bits[i] >> j) & 1; - reserved[y+i][x+j] = 1; - } - } - }; - - // finder patterns and a part of timing patterns - // will also mark the format information area (not yet written) as reserved. - blit(0, 0, 9, 9, [0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x17f, 0x00, 0x40]); - blit(n-8, 0, 8, 9, [0x100, 0x7f, 0x41, 0x5d, 0x5d, 0x5d, 0x41, 0x7f]); - blit(0, n-8, 9, 8, [0xfe, 0x82, 0xba, 0xba, 0xba, 0x82, 0xfe, 0x00, 0x00]); - - // the rest of timing patterns - for (var i = 9; i < n-8; ++i) { - matrix[6][i] = matrix[i][6] = ~i & 1; - reserved[6][i] = reserved[i][6] = 1; - } - - // alignment patterns - var aligns = v[2], m = aligns.length; - for (var i = 0; i < m; ++i) { - var minj = (i==0 || i==m-1 ? 1 : 0), maxj = (i==0 ? m-1 : m); - for (var j = minj; j < maxj; ++j) { - blit(aligns[i], aligns[j], 5, 5, [0x1f, 0x11, 0x15, 0x11, 0x1f]); - } - } - - // version information - if (needsverinfo(ver)) { - var code = augumentbch(ver, 6, 0x1f25, 12); - var k = 0; - for (var i = 0; i < 6; ++i) { - for (var j = 0; j < 3; ++j) { - matrix[i][(n-11)+j] = matrix[(n-11)+j][i] = (code >> k++) & 1; - reserved[i][(n-11)+j] = reserved[(n-11)+j][i] = 1; - } - } - } - - return {matrix: matrix, reserved: reserved}; -}; - -// fills the data portion (i.e. unmarked in reserved) of the matrix with given -// code words. the size of code words should be no more than available bits, -// and remaining bits are padded to 0 (cf. JIS X 0510:2004 sec 8.7.3). -var putdata = function(matrix, reserved, buf) { - var n = matrix.length; - var k = 0, dir = -1; - for (var i = n-1; i >= 0; i -= 2) { - if (i == 6) --i; // skip the entire timing pattern column - var jj = (dir < 0 ? n-1 : 0); - for (var j = 0; j < n; ++j) { - for (var ii = i; ii > i-2; --ii) { - if (!reserved[jj][ii]) { - // may overflow, but (undefined >> x) - // is 0 so it will auto-pad to zero. - matrix[jj][ii] = (buf[k >> 3] >> (~k&7)) & 1; - ++k; - } - } - jj += dir; - } - dir = -dir; - } - return matrix; -}; - -// XOR-masks the data portion of the matrix. repeating the call with the same -// arguments will revert the prior call (convenient in the matrix evaluation). -var maskdata = function(matrix, reserved, mask) { - var maskf = MASKFUNCS[mask]; - var n = matrix.length; - for (var i = 0; i < n; ++i) { - for (var j = 0; j < n; ++j) { - if (!reserved[i][j]) matrix[i][j] ^= maskf(i,j); - } - } - return matrix; -} - -// puts the format information. -var putformatinfo = function(matrix, reserved, ecclevel, mask) { - var n = matrix.length; - var code = augumentbch((ecclevel << 3) | mask, 5, 0x537, 10) ^ 0x5412; - for (var i = 0; i < 15; ++i) { - var r = [0,1,2,3,4,5,7,8,n-7,n-6,n-5,n-4,n-3,n-2,n-1][i]; - var c = [n-1,n-2,n-3,n-4,n-5,n-6,n-7,n-8,7,5,4,3,2,1,0][i]; - matrix[r][8] = matrix[8][c] = (code >> i) & 1; - // we don't have to mark those bits reserved; always done - // in makebasematrix above. - } - return matrix; -}; - -// evaluates the resulting matrix and returns the score (lower is better). -// (cf. JIS X 0510:2004 sec 8.8.2) -// -// the evaluation procedure tries to avoid the problematic patterns naturally -// occuring from the original matrix. for example, it penaltizes the patterns -// which just look like the finder pattern which will confuse the decoder. -// we choose the mask which results in the lowest score among 8 possible ones. -// -// note: zxing seems to use the same procedure and in many cases its choice -// agrees to ours, but sometimes it does not. practically it doesn't matter. -var evaluatematrix = function(matrix) { - // N1+(k-5) points for each consecutive row of k same-colored modules, - // where k >= 5. no overlapping row counts. - var PENALTY_CONSECUTIVE = 3; - // N2 points for each 2x2 block of same-colored modules. - // overlapping block does count. - var PENALTY_TWOBYTWO = 3; - // N3 points for each pattern with >4W:1B:1W:3B:1W:1B or - // 1B:1W:3B:1W:1B:>4W, or their multiples (e.g. highly unlikely, - // but 13W:3B:3W:9B:3W:3B counts). - var PENALTY_FINDERLIKE = 40; - // N4*k points for every (5*k)% deviation from 50% black density. - // i.e. k=1 for 55~60% and 40~45%, k=2 for 60~65% and 35~40%, etc. - var PENALTY_DENSITY = 10; - - var evaluategroup = function(groups) { // assumes [W,B,W,B,W,...,B,W] - var score = 0; - for (var i = 0; i < groups.length; ++i) { - if (groups[i] >= 5) score += PENALTY_CONSECUTIVE + (groups[i]-5); - } - for (var i = 5; i < groups.length; i += 2) { - var p = groups[i]; - if (groups[i-1] == p && groups[i-2] == 3*p && groups[i-3] == p && - groups[i-4] == p && (groups[i-5] >= 4*p || groups[i+1] >= 4*p)) { - // this part differs from zxing... - score += PENALTY_FINDERLIKE; - } - } - return score; - }; - - var n = matrix.length; - var score = 0, nblacks = 0; - for (var i = 0; i < n; ++i) { - var row = matrix[i]; - var groups; - - // evaluate the current row - groups = [0]; // the first empty group of white - for (var j = 0; j < n; ) { - var k; - for (k = 0; j < n && row[j]; ++k) ++j; - groups.push(k); - for (k = 0; j < n && !row[j]; ++k) ++j; - groups.push(k); - } - score += evaluategroup(groups); - - // evaluate the current column - groups = [0]; - for (var j = 0; j < n; ) { - var k; - for (k = 0; j < n && matrix[j][i]; ++k) ++j; - groups.push(k); - for (k = 0; j < n && !matrix[j][i]; ++k) ++j; - groups.push(k); - } - score += evaluategroup(groups); - - // check the 2x2 box and calculate the density - var nextrow = matrix[i+1] || []; - nblacks += row[0]; - for (var j = 1; j < n; ++j) { - var p = row[j]; - nblacks += p; - // at least comparison with next row should be strict... - if (row[j-1] == p && nextrow[j] === p && nextrow[j-1] === p) { - score += PENALTY_TWOBYTWO; - } - } - } - - score += PENALTY_DENSITY * ((Math.abs(nblacks / n / n - 0.5) / 0.05) | 0); - return score; -}; - -// returns the fully encoded QR code matrix which contains given data. -// it also chooses the best mask automatically when mask is -1. -var generate = function(data, ver, mode, ecclevel, mask) { - var v = VERSIONS[ver]; - var buf = encode(ver, mode, data, ndatabits(ver, ecclevel) >> 3); - buf = augumenteccs(buf, v[1][ecclevel], GF256_GENPOLY[v[0][ecclevel]]); - - var result = makebasematrix(ver); - var matrix = result.matrix, reserved = result.reserved; - putdata(matrix, reserved, buf); - - if (mask < 0) { - // find the best mask - maskdata(matrix, reserved, 0); - putformatinfo(matrix, reserved, ecclevel, 0); - var bestmask = 0, bestscore = evaluatematrix(matrix); - maskdata(matrix, reserved, 0); - for (mask = 1; mask < 8; ++mask) { - maskdata(matrix, reserved, mask); - putformatinfo(matrix, reserved, ecclevel, mask); - var score = evaluatematrix(matrix); - if (bestscore > score) { - bestscore = score; - bestmask = mask; - } - maskdata(matrix, reserved, mask); - } - mask = bestmask; - } - - maskdata(matrix, reserved, mask); - putformatinfo(matrix, reserved, ecclevel, mask); - return matrix; -}; - -// the public interface is trivial; the options available are as follows: -// -// - version: an integer in [1,40]. when omitted (or -1) the smallest possible -// version is chosen. -// - mode: one of 'numeric', 'alphanumeric', 'octet'. when omitted the smallest -// possible mode is chosen. -// - ecclevel: one of 'L', 'M', 'Q', 'H'. defaults to 'L'. -// - mask: an integer in [0,7]. when omitted (or -1) the best mask is chosen. -// -// for generate{HTML,PNG}: -// -// - modulesize: a number. this is a size of each modules in pixels, and -// defaults to 5px. -// - margin: a number. this is a size of margin in *modules*, and defaults to -// 4 (white modules). the specficiation mandates the margin no less than 4 -// modules, so it is better not to alter this value unless you know what -// you're doing. -var QRCode = { - 'generate': function(data, options) { - var MODES = {'numeric': MODE_NUMERIC, 'alphanumeric': MODE_ALPHANUMERIC, - 'octet': MODE_OCTET}; - var ECCLEVELS = {'L': ECCLEVEL_L, 'M': ECCLEVEL_M, 'Q': ECCLEVEL_Q, - 'H': ECCLEVEL_H}; - - options = options || {}; - var ver = options.version || -1; - var ecclevel = ECCLEVELS[(options.ecclevel || 'L').toUpperCase()]; - var mode = options.mode ? MODES[options.mode.toLowerCase()] : -1; - var mask = 'mask' in options ? options.mask : -1; - - if (mode < 0) { - if (typeof data === 'string') { - if (data.match(NUMERIC_REGEXP)) { - mode = MODE_NUMERIC; - } else if (data.match(ALPHANUMERIC_OUT_REGEXP)) { - // while encode supports case-insensitive - // encoding, we restrict the data to be - // uppercased when auto-selecting the mode. - mode = MODE_ALPHANUMERIC; - } else { - mode = MODE_OCTET; - } - } else { - mode = MODE_OCTET; - } - } else if (!(mode == MODE_NUMERIC || mode == MODE_ALPHANUMERIC || - mode == MODE_OCTET)) { - throw 'invalid or unsupported mode'; - } - - data = validatedata(mode, data); - if (data === null) throw 'invalid data format'; - - if (ecclevel < 0 || ecclevel > 3) throw 'invalid ECC level'; - - if (ver < 0) { - for (ver = 1; ver <= 40; ++ver) { - if (data.length <= getmaxdatalen(ver, mode, ecclevel)) break; - } - if (ver > 40) throw 'too large data'; - } else if (ver < 1 || ver > 40) { - throw 'invalid version'; - } - - if (mask != -1 && (mask < 0 || mask > 8)) throw 'invalid mask'; - - return generate(data, ver, mode, ecclevel, mask); - }, - - 'generateHTML': function(data, options) { - options = options || {}; - var matrix = QRCode['generate'](data, options); - var modsize = Math.max(options.modulesize || 5, 0.5); - var margin = Math.max(options.margin !== null ? options.margin : 4, 0.0); - - var e = document.createElement('div'); - var n = matrix.length; - var html = ['']; - for (var i = 0; i < n; ++i) { - html.push(''); - for (var j = 0; j < n; ++j) { - html.push(''); - } - html.push(''); - } - e.className = 'qrcode'; - e.innerHTML = html.join('') + '
'; - return e; - }, - - 'generateSVG': function(data, options) { - options = options || {}; - var matrix = QRCode['generate'](data, options); - var n = matrix.length; - var modsize = Math.max(options.modulesize || 5, 0.5); - var margin = Math.max(options.margin !== null ? options.margin : 4, 0.0); - var size = modsize * (n + 2 * margin); - - var common = ' class= "fg"'+' width="'+modsize+'" height="'+modsize+'"/>'; - - var e = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - e.setAttribute('viewBox', '0 0 '+size+' '+size); - e.setAttribute('style', 'shape-rendering:crispEdges'); - if (options.modulesize) { - e.setAttribute('width', size); - e.setAttribute('height', size); - } - - var svg = [ - '', - '', - ]; - - var yo = margin * modsize; - for (var y = 0; y < n; ++y) { - var xo = margin * modsize; - for (var x = 0; x < n; ++x) { - if (matrix[y][x]) - svg.push('>> 0) + (counter++ + "__"); - }; - WeakMap.prototype = { - set: function(key, value) { - var entry = key[this.name]; - if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, { - value: [ key, value ], - writable: true - }); - return this; - }, - get: function(key) { - var entry; - return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; - }, - "delete": function(key) { - var entry = key[this.name]; - if (!entry || entry[0] !== key) return false; - entry[0] = entry[1] = undefined; - return true; - }, - has: function(key) { - var entry = key[this.name]; - if (!entry) return false; - return entry[0] === key; - } - }; - window.WeakMap = WeakMap; - })(); -} - -(function(global) { - if (global.JsMutationObserver) { - return; - } - var registrationsTable = new WeakMap(); - var setImmediate; - if (/Trident|Edge/.test(navigator.userAgent)) { - setImmediate = setTimeout; - } else if (window.setImmediate) { - setImmediate = window.setImmediate; - } else { - var setImmediateQueue = []; - var sentinel = String(Math.random()); - window.addEventListener("message", function(e) { - if (e.data === sentinel) { - var queue = setImmediateQueue; - setImmediateQueue = []; - queue.forEach(function(func) { - func(); - }); - } - }); - setImmediate = function(func) { - setImmediateQueue.push(func); - window.postMessage(sentinel, "*"); - }; - } - var isScheduled = false; - var scheduledObservers = []; - function scheduleCallback(observer) { - scheduledObservers.push(observer); - if (!isScheduled) { - isScheduled = true; - setImmediate(dispatchCallbacks); - } - } - function wrapIfNeeded(node) { - return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node; - } - function dispatchCallbacks() { - isScheduled = false; - var observers = scheduledObservers; - scheduledObservers = []; - observers.sort(function(o1, o2) { - return o1.uid_ - o2.uid_; - }); - var anyNonEmpty = false; - observers.forEach(function(observer) { - var queue = observer.takeRecords(); - removeTransientObserversFor(observer); - if (queue.length) { - observer.callback_(queue, observer); - anyNonEmpty = true; - } - }); - if (anyNonEmpty) dispatchCallbacks(); - } - function removeTransientObserversFor(observer) { - observer.nodes_.forEach(function(node) { - var registrations = registrationsTable.get(node); - if (!registrations) return; - registrations.forEach(function(registration) { - if (registration.observer === observer) registration.removeTransientObservers(); - }); - }); - } - function forEachAncestorAndObserverEnqueueRecord(target, callback) { - for (var node = target; node; node = node.parentNode) { - var registrations = registrationsTable.get(node); - if (registrations) { - for (var j = 0; j < registrations.length; j++) { - var registration = registrations[j]; - var options = registration.options; - if (node !== target && !options.subtree) continue; - var record = callback(options); - if (record) registration.enqueue(record); - } - } - } - } - var uidCounter = 0; - function JsMutationObserver(callback) { - this.callback_ = callback; - this.nodes_ = []; - this.records_ = []; - this.uid_ = ++uidCounter; - } - JsMutationObserver.prototype = { - observe: function(target, options) { - target = wrapIfNeeded(target); - if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) { - throw new SyntaxError(); - } - var registrations = registrationsTable.get(target); - if (!registrations) registrationsTable.set(target, registrations = []); - var registration; - for (var i = 0; i < registrations.length; i++) { - if (registrations[i].observer === this) { - registration = registrations[i]; - registration.removeListeners(); - registration.options = options; - break; - } - } - if (!registration) { - registration = new Registration(this, target, options); - registrations.push(registration); - this.nodes_.push(target); - } - registration.addListeners(); - }, - disconnect: function() { - this.nodes_.forEach(function(node) { - var registrations = registrationsTable.get(node); - for (var i = 0; i < registrations.length; i++) { - var registration = registrations[i]; - if (registration.observer === this) { - registration.removeListeners(); - registrations.splice(i, 1); - break; - } - } - }, this); - this.records_ = []; - }, - takeRecords: function() { - var copyOfRecords = this.records_; - this.records_ = []; - return copyOfRecords; - } - }; - function MutationRecord(type, target) { - this.type = type; - this.target = target; - this.addedNodes = []; - this.removedNodes = []; - this.previousSibling = null; - this.nextSibling = null; - this.attributeName = null; - this.attributeNamespace = null; - this.oldValue = null; - } - function copyMutationRecord(original) { - var record = new MutationRecord(original.type, original.target); - record.addedNodes = original.addedNodes.slice(); - record.removedNodes = original.removedNodes.slice(); - record.previousSibling = original.previousSibling; - record.nextSibling = original.nextSibling; - record.attributeName = original.attributeName; - record.attributeNamespace = original.attributeNamespace; - record.oldValue = original.oldValue; - return record; - } - var currentRecord, recordWithOldValue; - function getRecord(type, target) { - return currentRecord = new MutationRecord(type, target); - } - function getRecordWithOldValue(oldValue) { - if (recordWithOldValue) return recordWithOldValue; - recordWithOldValue = copyMutationRecord(currentRecord); - recordWithOldValue.oldValue = oldValue; - return recordWithOldValue; - } - function clearRecords() { - currentRecord = recordWithOldValue = undefined; - } - function recordRepresentsCurrentMutation(record) { - return record === recordWithOldValue || record === currentRecord; - } - function selectRecord(lastRecord, newRecord) { - if (lastRecord === newRecord) return lastRecord; - if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue; - return null; - } - function Registration(observer, target, options) { - this.observer = observer; - this.target = target; - this.options = options; - this.transientObservedNodes = []; - } - Registration.prototype = { - enqueue: function(record) { - var records = this.observer.records_; - var length = records.length; - if (records.length > 0) { - var lastRecord = records[length - 1]; - var recordToReplaceLast = selectRecord(lastRecord, record); - if (recordToReplaceLast) { - records[length - 1] = recordToReplaceLast; - return; - } - } else { - scheduleCallback(this.observer); - } - records[length] = record; - }, - addListeners: function() { - this.addListeners_(this.target); - }, - addListeners_: function(node) { - var options = this.options; - if (options.attributes) node.addEventListener("DOMAttrModified", this, true); - if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.addEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true); - }, - removeListeners: function() { - this.removeListeners_(this.target); - }, - removeListeners_: function(node) { - var options = this.options; - if (options.attributes) node.removeEventListener("DOMAttrModified", this, true); - if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.removeEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true); - }, - addTransientObserver: function(node) { - if (node === this.target) return; - this.addListeners_(node); - this.transientObservedNodes.push(node); - var registrations = registrationsTable.get(node); - if (!registrations) registrationsTable.set(node, registrations = []); - registrations.push(this); - }, - removeTransientObservers: function() { - var transientObservedNodes = this.transientObservedNodes; - this.transientObservedNodes = []; - transientObservedNodes.forEach(function(node) { - this.removeListeners_(node); - var registrations = registrationsTable.get(node); - for (var i = 0; i < registrations.length; i++) { - if (registrations[i] === this) { - registrations.splice(i, 1); - break; - } - } - }, this); - }, - handleEvent: function(e) { - e.stopImmediatePropagation(); - switch (e.type) { - case "DOMAttrModified": - var name = e.attrName; - var namespace = e.relatedNode.namespaceURI; - var target = e.target; - var record = new getRecord("attributes", target); - record.attributeName = name; - record.attributeNamespace = namespace; - var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.attributes) return; - if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) { - return; - } - if (options.attributeOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMCharacterDataModified": - var target = e.target; - var record = getRecord("characterData", target); - var oldValue = e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.characterData) return; - if (options.characterDataOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMNodeRemoved": - this.addTransientObserver(e.target); - - case "DOMNodeInserted": - var changedNode = e.target; - var addedNodes, removedNodes; - if (e.type === "DOMNodeInserted") { - addedNodes = [ changedNode ]; - removedNodes = []; - } else { - addedNodes = []; - removedNodes = [ changedNode ]; - } - var previousSibling = changedNode.previousSibling; - var nextSibling = changedNode.nextSibling; - var record = getRecord("childList", e.target.parentNode); - record.addedNodes = addedNodes; - record.removedNodes = removedNodes; - record.previousSibling = previousSibling; - record.nextSibling = nextSibling; - forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) { - if (!options.childList) return; - return record; - }); - } - clearRecords(); - } - }; - global.JsMutationObserver = JsMutationObserver; - if (!global.MutationObserver) { - global.MutationObserver = JsMutationObserver; - JsMutationObserver._isPolyfilled = true; - } -})(self); - -(function(scope) { - "use strict"; - if (!window.performance) { - var start = Date.now(); - window.performance = { - now: function() { - return Date.now() - start; - } - }; - } - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function() { - var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; - return nativeRaf ? function(callback) { - return nativeRaf(function() { - callback(performance.now()); - }); - } : function(callback) { - return window.setTimeout(callback, 1e3 / 60); - }; - }(); - } - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function() { - return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) { - clearTimeout(id); - }; - }(); - } - var workingDefaultPrevented = function() { - var e = document.createEvent("Event"); - e.initEvent("foo", true, true); - e.preventDefault(); - return e.defaultPrevented; - }(); - if (!workingDefaultPrevented) { - var origPreventDefault = Event.prototype.preventDefault; - Event.prototype.preventDefault = function() { - if (!this.cancelable) { - return; - } - origPreventDefault.call(this); - Object.defineProperty(this, "defaultPrevented", { - get: function() { - return true; - }, - configurable: true - }); - }; - } - var isIE = /Trident/.test(navigator.userAgent); - if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") { - window.CustomEvent = function(inType, params) { - params = params || {}; - var e = document.createEvent("CustomEvent"); - e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail); - return e; - }; - window.CustomEvent.prototype = window.Event.prototype; - } - if (!window.Event || isIE && typeof window.Event !== "function") { - var origEvent = window.Event; - window.Event = function(inType, params) { - params = params || {}; - var e = document.createEvent("Event"); - e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable)); - return e; - }; - window.Event.prototype = origEvent.prototype; - } -})(window.WebComponents); - -window.CustomElements = window.CustomElements || { - flags: {} -}; - -(function(scope) { - var flags = scope.flags; - var modules = []; - var addModule = function(module) { - modules.push(module); - }; - var initializeModules = function() { - modules.forEach(function(module) { - module(scope); - }); - }; - scope.addModule = addModule; - scope.initializeModules = initializeModules; - scope.hasNative = Boolean(document.registerElement); - scope.isIE = /Trident/.test(navigator.userAgent); - scope.useNative = !flags.register && scope.hasNative && !window.ShadowDOMPolyfill && (!window.HTMLImports || window.HTMLImports.useNative); -})(window.CustomElements); - -window.CustomElements.addModule(function(scope) { - var IMPORT_LINK_TYPE = window.HTMLImports ? window.HTMLImports.IMPORT_LINK_TYPE : "none"; - function forSubtree(node, cb) { - findAllElements(node, function(e) { - if (cb(e)) { - return true; - } - forRoots(e, cb); - }); - forRoots(node, cb); - } - function findAllElements(node, find, data) { - var e = node.firstElementChild; - if (!e) { - e = node.firstChild; - while (e && e.nodeType !== Node.ELEMENT_NODE) { - e = e.nextSibling; - } - } - while (e) { - if (find(e, data) !== true) { - findAllElements(e, find, data); - } - e = e.nextElementSibling; - } - return null; - } - function forRoots(node, cb) { - var root = node.shadowRoot; - while (root) { - forSubtree(root, cb); - root = root.olderShadowRoot; - } - } - function forDocumentTree(doc, cb) { - _forDocumentTree(doc, cb, []); - } - function _forDocumentTree(doc, cb, processingDocuments) { - doc = window.wrap(doc); - if (processingDocuments.indexOf(doc) >= 0) { - return; - } - processingDocuments.push(doc); - var imports = doc.querySelectorAll("link[rel=" + IMPORT_LINK_TYPE + "]"); - for (var i = 0, l = imports.length, n; i < l && (n = imports[i]); i++) { - if (n.import) { - _forDocumentTree(n.import, cb, processingDocuments); - } - } - cb(doc); - } - scope.forDocumentTree = forDocumentTree; - scope.forSubtree = forSubtree; -}); - -window.CustomElements.addModule(function(scope) { - var flags = scope.flags; - var forSubtree = scope.forSubtree; - var forDocumentTree = scope.forDocumentTree; - function addedNode(node, isAttached) { - return added(node, isAttached) || addedSubtree(node, isAttached); - } - function added(node, isAttached) { - if (scope.upgrade(node, isAttached)) { - return true; - } - if (isAttached) { - attached(node); - } - } - function addedSubtree(node, isAttached) { - forSubtree(node, function(e) { - if (added(e, isAttached)) { - return true; - } - }); - } - var hasThrottledAttached = window.MutationObserver._isPolyfilled && flags["throttle-attached"]; - scope.hasPolyfillMutations = hasThrottledAttached; - scope.hasThrottledAttached = hasThrottledAttached; - var isPendingMutations = false; - var pendingMutations = []; - function deferMutation(fn) { - pendingMutations.push(fn); - if (!isPendingMutations) { - isPendingMutations = true; - setTimeout(takeMutations); - } - } - function takeMutations() { - isPendingMutations = false; - var $p = pendingMutations; - for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) { - p(); - } - pendingMutations = []; - } - function attached(element) { - if (hasThrottledAttached) { - deferMutation(function() { - _attached(element); - }); - } else { - _attached(element); - } - } - function _attached(element) { - if (element.__upgraded__ && !element.__attached) { - element.__attached = true; - if (element.attachedCallback) { - element.attachedCallback(); - } - } - } - function detachedNode(node) { - detached(node); - forSubtree(node, function(e) { - detached(e); - }); - } - function detached(element) { - if (hasThrottledAttached) { - deferMutation(function() { - _detached(element); - }); - } else { - _detached(element); - } - } - function _detached(element) { - if (element.__upgraded__ && element.__attached) { - element.__attached = false; - if (element.detachedCallback) { - element.detachedCallback(); - } - } - } - function inDocument(element) { - var p = element; - var doc = window.wrap(document); - while (p) { - if (p == doc) { - return true; - } - p = p.parentNode || p.nodeType === Node.DOCUMENT_FRAGMENT_NODE && p.host; - } - } - function watchShadow(node) { - if (node.shadowRoot && !node.shadowRoot.__watched) { - flags.dom && console.log("watching shadow-root for: ", node.localName); - var root = node.shadowRoot; - while (root) { - observe(root); - root = root.olderShadowRoot; - } - } - } - function handler(root, mutations) { - if (flags.dom) { - var mx = mutations[0]; - if (mx && mx.type === "childList" && mx.addedNodes) { - if (mx.addedNodes) { - var d = mx.addedNodes[0]; - while (d && d !== document && !d.host) { - d = d.parentNode; - } - var u = d && (d.URL || d._URL || d.host && d.host.localName) || ""; - u = u.split("/?").shift().split("/").pop(); - } - } - console.group("mutations (%d) [%s]", mutations.length, u || ""); - } - var isAttached = inDocument(root); - mutations.forEach(function(mx) { - if (mx.type === "childList") { - forEach(mx.addedNodes, function(n) { - if (!n.localName) { - return; - } - addedNode(n, isAttached); - }); - forEach(mx.removedNodes, function(n) { - if (!n.localName) { - return; - } - detachedNode(n); - }); - } - }); - flags.dom && console.groupEnd(); - } - function takeRecords(node) { - node = window.wrap(node); - if (!node) { - node = window.wrap(document); - } - while (node.parentNode) { - node = node.parentNode; - } - var observer = node.__observer; - if (observer) { - handler(node, observer.takeRecords()); - takeMutations(); - } - } - var forEach = Array.prototype.forEach.call.bind(Array.prototype.forEach); - function observe(inRoot) { - if (inRoot.__observer) { - return; - } - var observer = new MutationObserver(handler.bind(this, inRoot)); - observer.observe(inRoot, { - childList: true, - subtree: true - }); - inRoot.__observer = observer; - } - function upgradeDocument(doc) { - doc = window.wrap(doc); - flags.dom && console.group("upgradeDocument: ", doc.baseURI.split("/").pop()); - var isMainDocument = doc === window.wrap(document); - addedNode(doc, isMainDocument); - observe(doc); - flags.dom && console.groupEnd(); - } - function upgradeDocumentTree(doc) { - forDocumentTree(doc, upgradeDocument); - } - var originalCreateShadowRoot = Element.prototype.createShadowRoot; - if (originalCreateShadowRoot) { - Element.prototype.createShadowRoot = function() { - var root = originalCreateShadowRoot.call(this); - window.CustomElements.watchShadow(this); - return root; - }; - } - scope.watchShadow = watchShadow; - scope.upgradeDocumentTree = upgradeDocumentTree; - scope.upgradeDocument = upgradeDocument; - scope.upgradeSubtree = addedSubtree; - scope.upgradeAll = addedNode; - scope.attached = attached; - scope.takeRecords = takeRecords; -}); - -window.CustomElements.addModule(function(scope) { - var flags = scope.flags; - function upgrade(node, isAttached) { - if (node.localName === "template") { - if (window.HTMLTemplateElement && HTMLTemplateElement.decorate) { - HTMLTemplateElement.decorate(node); - } - } - if (!node.__upgraded__ && node.nodeType === Node.ELEMENT_NODE) { - var is = node.getAttribute("is"); - var definition = scope.getRegisteredDefinition(node.localName) || scope.getRegisteredDefinition(is); - if (definition) { - if (is && definition.tag == node.localName || !is && !definition.extends) { - return upgradeWithDefinition(node, definition, isAttached); - } - } - } - } - function upgradeWithDefinition(element, definition, isAttached) { - flags.upgrade && console.group("upgrade:", element.localName); - if (definition.is) { - element.setAttribute("is", definition.is); - } - implementPrototype(element, definition); - element.__upgraded__ = true; - created(element); - if (isAttached) { - scope.attached(element); - } - scope.upgradeSubtree(element, isAttached); - flags.upgrade && console.groupEnd(); - return element; - } - function implementPrototype(element, definition) { - if (Object.__proto__) { - element.__proto__ = definition.prototype; - } else { - customMixin(element, definition.prototype, definition.native); - element.__proto__ = definition.prototype; - } - } - function customMixin(inTarget, inSrc, inNative) { - var used = {}; - var p = inSrc; - while (p !== inNative && p !== HTMLElement.prototype) { - var keys = Object.getOwnPropertyNames(p); - for (var i = 0, k; k = keys[i]; i++) { - if (!used[k]) { - Object.defineProperty(inTarget, k, Object.getOwnPropertyDescriptor(p, k)); - used[k] = 1; - } - } - p = Object.getPrototypeOf(p); - } - } - function created(element) { - if (element.createdCallback) { - element.createdCallback(); - } - } - scope.upgrade = upgrade; - scope.upgradeWithDefinition = upgradeWithDefinition; - scope.implementPrototype = implementPrototype; -}); - -window.CustomElements.addModule(function(scope) { - var isIE = scope.isIE; - var upgradeDocumentTree = scope.upgradeDocumentTree; - var upgradeAll = scope.upgradeAll; - var upgradeWithDefinition = scope.upgradeWithDefinition; - var implementPrototype = scope.implementPrototype; - var useNative = scope.useNative; - function register(name, options) { - var definition = options || {}; - if (!name) { - throw new Error("document.registerElement: first argument `name` must not be empty"); - } - if (name.indexOf("-") < 0) { - throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '" + String(name) + "'."); - } - if (isReservedTag(name)) { - throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '" + String(name) + "'. The type name is invalid."); - } - if (getRegisteredDefinition(name)) { - throw new Error("DuplicateDefinitionError: a type with name '" + String(name) + "' is already registered"); - } - if (!definition.prototype) { - definition.prototype = Object.create(HTMLElement.prototype); - } - definition.__name = name.toLowerCase(); - if (definition.extends) { - definition.extends = definition.extends.toLowerCase(); - } - definition.lifecycle = definition.lifecycle || {}; - definition.ancestry = ancestry(definition.extends); - resolveTagName(definition); - resolvePrototypeChain(definition); - overrideAttributeApi(definition.prototype); - registerDefinition(definition.__name, definition); - definition.ctor = generateConstructor(definition); - definition.ctor.prototype = definition.prototype; - definition.prototype.constructor = definition.ctor; - if (scope.ready) { - upgradeDocumentTree(document); - } - return definition.ctor; - } - function overrideAttributeApi(prototype) { - if (prototype.setAttribute._polyfilled) { - return; - } - var setAttribute = prototype.setAttribute; - prototype.setAttribute = function(name, value) { - changeAttribute.call(this, name, value, setAttribute); - }; - var removeAttribute = prototype.removeAttribute; - prototype.removeAttribute = function(name) { - changeAttribute.call(this, name, null, removeAttribute); - }; - prototype.setAttribute._polyfilled = true; - } - function changeAttribute(name, value, operation) { - name = name.toLowerCase(); - var oldValue = this.getAttribute(name); - operation.apply(this, arguments); - var newValue = this.getAttribute(name); - if (this.attributeChangedCallback && newValue !== oldValue) { - this.attributeChangedCallback(name, oldValue, newValue); - } - } - function isReservedTag(name) { - for (var i = 0; i < reservedTagList.length; i++) { - if (name === reservedTagList[i]) { - return true; - } - } - } - var reservedTagList = [ "annotation-xml", "color-profile", "font-face", "font-face-src", "font-face-uri", "font-face-format", "font-face-name", "missing-glyph" ]; - function ancestry(extnds) { - var extendee = getRegisteredDefinition(extnds); - if (extendee) { - return ancestry(extendee.extends).concat([ extendee ]); - } - return []; - } - function resolveTagName(definition) { - var baseTag = definition.extends; - for (var i = 0, a; a = definition.ancestry[i]; i++) { - baseTag = a.is && a.tag; - } - definition.tag = baseTag || definition.__name; - if (baseTag) { - definition.is = definition.__name; - } - } - function resolvePrototypeChain(definition) { - if (!Object.__proto__) { - var nativePrototype = HTMLElement.prototype; - if (definition.is) { - var inst = document.createElement(definition.tag); - nativePrototype = Object.getPrototypeOf(inst); - } - var proto = definition.prototype, ancestor; - var foundPrototype = false; - while (proto) { - if (proto == nativePrototype) { - foundPrototype = true; - } - ancestor = Object.getPrototypeOf(proto); - if (ancestor) { - proto.__proto__ = ancestor; - } - proto = ancestor; - } - if (!foundPrototype) { - console.warn(definition.tag + " prototype not found in prototype chain for " + definition.is); - } - definition.native = nativePrototype; - } - } - function instantiate(definition) { - return upgradeWithDefinition(domCreateElement(definition.tag), definition); - } - var registry = {}; - function getRegisteredDefinition(name) { - if (name) { - return registry[name.toLowerCase()]; - } - } - function registerDefinition(name, definition) { - registry[name] = definition; - } - function generateConstructor(definition) { - return function() { - return instantiate(definition); - }; - } - var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml"; - function createElementNS(namespace, tag, typeExtension) { - if (namespace === HTML_NAMESPACE) { - return createElement(tag, typeExtension); - } else { - return domCreateElementNS(namespace, tag); - } - } - function createElement(tag, typeExtension) { - if (tag) { - tag = tag.toLowerCase(); - } - if (typeExtension) { - typeExtension = typeExtension.toLowerCase(); - } - var definition = getRegisteredDefinition(typeExtension || tag); - if (definition) { - if (tag == definition.tag && typeExtension == definition.is) { - return new definition.ctor(); - } - if (!typeExtension && !definition.is) { - return new definition.ctor(); - } - } - var element; - if (typeExtension) { - element = createElement(tag); - element.setAttribute("is", typeExtension); - return element; - } - element = domCreateElement(tag); - if (tag.indexOf("-") >= 0) { - implementPrototype(element, HTMLElement); - } - return element; - } - var domCreateElement = document.createElement.bind(document); - var domCreateElementNS = document.createElementNS.bind(document); - var isInstance; - if (!Object.__proto__ && !useNative) { - isInstance = function(obj, ctor) { - if (obj instanceof ctor) { - return true; - } - var p = obj; - while (p) { - if (p === ctor.prototype) { - return true; - } - p = p.__proto__; - } - return false; - }; - } else { - isInstance = function(obj, base) { - return obj instanceof base; - }; - } - function wrapDomMethodToForceUpgrade(obj, methodName) { - var orig = obj[methodName]; - obj[methodName] = function() { - var n = orig.apply(this, arguments); - upgradeAll(n); - return n; - }; - } - wrapDomMethodToForceUpgrade(Node.prototype, "cloneNode"); - wrapDomMethodToForceUpgrade(document, "importNode"); - document.registerElement = register; - document.createElement = createElement; - document.createElementNS = createElementNS; - scope.registry = registry; - scope.instanceof = isInstance; - scope.reservedTagList = reservedTagList; - scope.getRegisteredDefinition = getRegisteredDefinition; - document.register = document.registerElement; -}); - -(function(scope) { - var useNative = scope.useNative; - var initializeModules = scope.initializeModules; - var isIE = scope.isIE; - if (useNative) { - var nop = function() {}; - scope.watchShadow = nop; - scope.upgrade = nop; - scope.upgradeAll = nop; - scope.upgradeDocumentTree = nop; - scope.upgradeSubtree = nop; - scope.takeRecords = nop; - scope.instanceof = function(obj, base) { - return obj instanceof base; - }; - } else { - initializeModules(); - } - var upgradeDocumentTree = scope.upgradeDocumentTree; - var upgradeDocument = scope.upgradeDocument; - if (!window.wrap) { - if (window.ShadowDOMPolyfill) { - window.wrap = window.ShadowDOMPolyfill.wrapIfNeeded; - window.unwrap = window.ShadowDOMPolyfill.unwrapIfNeeded; - } else { - window.wrap = window.unwrap = function(node) { - return node; - }; - } - } - if (window.HTMLImports) { - window.HTMLImports.__importsParsingHook = function(elt) { - if (elt.import) { - upgradeDocument(wrap(elt.import)); - } - }; - } - function bootstrap() { - upgradeDocumentTree(window.wrap(document)); - window.CustomElements.ready = true; - var requestAnimationFrame = window.requestAnimationFrame || function(f) { - setTimeout(f, 16); - }; - requestAnimationFrame(function() { - setTimeout(function() { - window.CustomElements.readyTime = Date.now(); - if (window.HTMLImports) { - window.CustomElements.elapsed = window.CustomElements.readyTime - window.HTMLImports.readyTime; - } - document.dispatchEvent(new CustomEvent("WebComponentsReady", { - bubbles: true - })); - }); - }); - } - if (document.readyState === "complete" || scope.flags.eager) { - bootstrap(); - } else if (document.readyState === "interactive" && !window.attachEvent && (!window.HTMLImports || window.HTMLImports.ready)) { - bootstrap(); - } else { - var loadEvent = window.HTMLImports && !window.HTMLImports.ready ? "HTMLImportsLoaded" : "DOMContentLoaded"; - window.addEventListener(loadEvent, bootstrap); - } -})(window.CustomElements); \ No newline at end of file diff --git a/lib/admin/public/bower_components/webcomponentsjs/CustomElements.min.js b/lib/admin/public/bower_components/webcomponentsjs/CustomElements.min.js deleted file mode 100644 index a2761f17..00000000 --- a/lib/admin/public/bower_components/webcomponentsjs/CustomElements.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -// @version 0.7.22 -"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var o=t[this.name];return o&&o[0]===t?o[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){E.push(e),b||(b=!0,w(o))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function o(){b=!1;var e=E;E=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();r(e),n.length&&(e.callback_(n,e),t=!0)}),t&&o()}function r(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var o=v.get(n);if(o)for(var r=0;r0){var r=n[o-1],i=p(r,e);if(i)return void(n[o-1]=i)}else t(this.observer);n[o]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;n=0)){n.push(e);for(var o,r=e.querySelectorAll("link[rel="+a+"]"),d=0,s=r.length;s>d&&(o=r[d]);d++)o["import"]&&i(o["import"],t,n);t(e)}}var a=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";e.forDocumentTree=r,e.forSubtree=t}),window.CustomElements.addModule(function(e){function t(e,t){return n(e,t)||o(e,t)}function n(t,n){return e.upgrade(t,n)?!0:void(n&&a(t))}function o(e,t){b(e,function(e){return n(e,t)?!0:void 0})}function r(e){N.push(e),y||(y=!0,setTimeout(i))}function i(){y=!1;for(var e,t=N,n=0,o=t.length;o>n&&(e=t[n]);n++)e();N=[]}function a(e){_?r(function(){d(e)}):d(e)}function d(e){e.__upgraded__&&!e.__attached&&(e.__attached=!0,e.attachedCallback&&e.attachedCallback())}function s(e){u(e),b(e,function(e){u(e)})}function u(e){_?r(function(){c(e)}):c(e)}function c(e){e.__upgraded__&&e.__attached&&(e.__attached=!1,e.detachedCallback&&e.detachedCallback())}function l(e){for(var t=e,n=window.wrap(document);t;){if(t==n)return!0;t=t.parentNode||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host}}function f(e){if(e.shadowRoot&&!e.shadowRoot.__watched){g.dom&&console.log("watching shadow-root for: ",e.localName);for(var t=e.shadowRoot;t;)w(t),t=t.olderShadowRoot}}function p(e,n){if(g.dom){var o=n[0];if(o&&"childList"===o.type&&o.addedNodes&&o.addedNodes){for(var r=o.addedNodes[0];r&&r!==document&&!r.host;)r=r.parentNode;var i=r&&(r.URL||r._URL||r.host&&r.host.localName)||"";i=i.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,i||"")}var a=l(e);n.forEach(function(e){"childList"===e.type&&(M(e.addedNodes,function(e){e.localName&&t(e,a)}),M(e.removedNodes,function(e){e.localName&&s(e)}))}),g.dom&&console.groupEnd()}function m(e){for(e=window.wrap(e),e||(e=window.wrap(document));e.parentNode;)e=e.parentNode;var t=e.__observer;t&&(p(e,t.takeRecords()),i())}function w(e){if(!e.__observer){var t=new MutationObserver(p.bind(this,e));t.observe(e,{childList:!0,subtree:!0}),e.__observer=t}}function v(e){e=window.wrap(e),g.dom&&console.group("upgradeDocument: ",e.baseURI.split("/").pop());var n=e===window.wrap(document);t(e,n),w(e),g.dom&&console.groupEnd()}function h(e){E(e,v)}var g=e.flags,b=e.forSubtree,E=e.forDocumentTree,_=window.MutationObserver._isPolyfilled&&g["throttle-attached"];e.hasPolyfillMutations=_,e.hasThrottledAttached=_;var y=!1,N=[],M=Array.prototype.forEach.call.bind(Array.prototype.forEach),O=Element.prototype.createShadowRoot;O&&(Element.prototype.createShadowRoot=function(){var e=O.call(this);return window.CustomElements.watchShadow(this),e}),e.watchShadow=f,e.upgradeDocumentTree=h,e.upgradeDocument=v,e.upgradeSubtree=o,e.upgradeAll=t,e.attached=a,e.takeRecords=m}),window.CustomElements.addModule(function(e){function t(t,o){if("template"===t.localName&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t),!t.__upgraded__&&t.nodeType===Node.ELEMENT_NODE){var r=t.getAttribute("is"),i=e.getRegisteredDefinition(t.localName)||e.getRegisteredDefinition(r);if(i&&(r&&i.tag==t.localName||!r&&!i["extends"]))return n(t,i,o)}}function n(t,n,r){return a.upgrade&&console.group("upgrade:",t.localName),n.is&&t.setAttribute("is",n.is),o(t,n),t.__upgraded__=!0,i(t),r&&e.attached(t),e.upgradeSubtree(t,r),a.upgrade&&console.groupEnd(),t}function o(e,t){Object.__proto__?e.__proto__=t.prototype:(r(e,t.prototype,t["native"]),e.__proto__=t.prototype)}function r(e,t,n){for(var o={},r=t;r!==n&&r!==HTMLElement.prototype;){for(var i,a=Object.getOwnPropertyNames(r),d=0;i=a[d];d++)o[i]||(Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i)),o[i]=1);r=Object.getPrototypeOf(r)}}function i(e){e.createdCallback&&e.createdCallback()}var a=e.flags;e.upgrade=t,e.upgradeWithDefinition=n,e.implementPrototype=o}),window.CustomElements.addModule(function(e){function t(t,o){var s=o||{};if(!t)throw new Error("document.registerElement: first argument `name` must not be empty");if(t.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(t)+"'.");if(r(t))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(t)+"'. The type name is invalid.");if(u(t))throw new Error("DuplicateDefinitionError: a type with name '"+String(t)+"' is already registered");return s.prototype||(s.prototype=Object.create(HTMLElement.prototype)),s.__name=t.toLowerCase(),s["extends"]&&(s["extends"]=s["extends"].toLowerCase()),s.lifecycle=s.lifecycle||{},s.ancestry=i(s["extends"]),a(s),d(s),n(s.prototype),c(s.__name,s),s.ctor=l(s),s.ctor.prototype=s.prototype,s.prototype.constructor=s.ctor,e.ready&&v(document),s.ctor}function n(e){if(!e.setAttribute._polyfilled){var t=e.setAttribute;e.setAttribute=function(e,n){o.call(this,e,n,t)};var n=e.removeAttribute;e.removeAttribute=function(e){o.call(this,e,null,n)},e.setAttribute._polyfilled=!0}}function o(e,t,n){e=e.toLowerCase();var o=this.getAttribute(e);n.apply(this,arguments);var r=this.getAttribute(e);this.attributeChangedCallback&&r!==o&&this.attributeChangedCallback(e,o,r)}function r(e){for(var t=0;t<_.length;t++)if(e===_[t])return!0}function i(e){var t=u(e);return t?i(t["extends"]).concat([t]):[]}function a(e){for(var t,n=e["extends"],o=0;t=e.ancestry[o];o++)n=t.is&&t.tag;e.tag=n||e.__name,n&&(e.is=e.__name)}function d(e){if(!Object.__proto__){var t=HTMLElement.prototype;if(e.is){var n=document.createElement(e.tag);t=Object.getPrototypeOf(n)}for(var o,r=e.prototype,i=!1;r;)r==t&&(i=!0),o=Object.getPrototypeOf(r),o&&(r.__proto__=o),r=o;i||console.warn(e.tag+" prototype not found in prototype chain for "+e.is),e["native"]=t}}function s(e){return g(M(e.tag),e)}function u(e){return e?y[e.toLowerCase()]:void 0}function c(e,t){y[e]=t}function l(e){return function(){return s(e)}}function f(e,t,n){return e===N?p(t,n):O(e,t)}function p(e,t){e&&(e=e.toLowerCase()),t&&(t=t.toLowerCase());var n=u(t||e);if(n){if(e==n.tag&&t==n.is)return new n.ctor;if(!t&&!n.is)return new n.ctor}var o;return t?(o=p(e),o.setAttribute("is",t),o):(o=M(e),e.indexOf("-")>=0&&b(o,HTMLElement),o)}function m(e,t){var n=e[t];e[t]=function(){var e=n.apply(this,arguments);return h(e),e}}var w,v=(e.isIE,e.upgradeDocumentTree),h=e.upgradeAll,g=e.upgradeWithDefinition,b=e.implementPrototype,E=e.useNative,_=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],y={},N="http://www.w3.org/1999/xhtml",M=document.createElement.bind(document),O=document.createElementNS.bind(document);w=Object.__proto__||E?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;for(var n=e;n;){if(n===t.prototype)return!0;n=n.__proto__}return!1},m(Node.prototype,"cloneNode"),m(document,"importNode"),document.registerElement=t,document.createElement=p,document.createElementNS=f,e.registry=y,e["instanceof"]=w,e.reservedTagList=_,e.getRegisteredDefinition=u,document.register=document.registerElement}),function(e){function t(){i(window.wrap(document)),window.CustomElements.ready=!0;var e=window.requestAnimationFrame||function(e){setTimeout(e,16)};e(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=e.useNative,o=e.initializeModules;e.isIE;if(n){var r=function(){};e.watchShadow=r,e.upgrade=r,e.upgradeAll=r,e.upgradeDocumentTree=r,e.upgradeSubtree=r,e.takeRecords=r,e["instanceof"]=function(e,t){return e instanceof t}}else o();var i=e.upgradeDocumentTree,a=e.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(e){return e}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(e){e["import"]&&a(wrap(e["import"]))}),"complete"===document.readyState||e.flags.eager)t();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var d=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(d,t)}else t()}(window.CustomElements); \ No newline at end of file diff --git a/lib/admin/public/bower_components/webcomponentsjs/HTMLImports.js b/lib/admin/public/bower_components/webcomponentsjs/HTMLImports.js deleted file mode 100644 index cc8ac641..00000000 --- a/lib/admin/public/bower_components/webcomponentsjs/HTMLImports.js +++ /dev/null @@ -1,1157 +0,0 @@ -/** - * @license - * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -// @version 0.7.22 -if (typeof WeakMap === "undefined") { - (function() { - var defineProperty = Object.defineProperty; - var counter = Date.now() % 1e9; - var WeakMap = function() { - this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__"); - }; - WeakMap.prototype = { - set: function(key, value) { - var entry = key[this.name]; - if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, { - value: [ key, value ], - writable: true - }); - return this; - }, - get: function(key) { - var entry; - return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; - }, - "delete": function(key) { - var entry = key[this.name]; - if (!entry || entry[0] !== key) return false; - entry[0] = entry[1] = undefined; - return true; - }, - has: function(key) { - var entry = key[this.name]; - if (!entry) return false; - return entry[0] === key; - } - }; - window.WeakMap = WeakMap; - })(); -} - -(function(global) { - if (global.JsMutationObserver) { - return; - } - var registrationsTable = new WeakMap(); - var setImmediate; - if (/Trident|Edge/.test(navigator.userAgent)) { - setImmediate = setTimeout; - } else if (window.setImmediate) { - setImmediate = window.setImmediate; - } else { - var setImmediateQueue = []; - var sentinel = String(Math.random()); - window.addEventListener("message", function(e) { - if (e.data === sentinel) { - var queue = setImmediateQueue; - setImmediateQueue = []; - queue.forEach(function(func) { - func(); - }); - } - }); - setImmediate = function(func) { - setImmediateQueue.push(func); - window.postMessage(sentinel, "*"); - }; - } - var isScheduled = false; - var scheduledObservers = []; - function scheduleCallback(observer) { - scheduledObservers.push(observer); - if (!isScheduled) { - isScheduled = true; - setImmediate(dispatchCallbacks); - } - } - function wrapIfNeeded(node) { - return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node; - } - function dispatchCallbacks() { - isScheduled = false; - var observers = scheduledObservers; - scheduledObservers = []; - observers.sort(function(o1, o2) { - return o1.uid_ - o2.uid_; - }); - var anyNonEmpty = false; - observers.forEach(function(observer) { - var queue = observer.takeRecords(); - removeTransientObserversFor(observer); - if (queue.length) { - observer.callback_(queue, observer); - anyNonEmpty = true; - } - }); - if (anyNonEmpty) dispatchCallbacks(); - } - function removeTransientObserversFor(observer) { - observer.nodes_.forEach(function(node) { - var registrations = registrationsTable.get(node); - if (!registrations) return; - registrations.forEach(function(registration) { - if (registration.observer === observer) registration.removeTransientObservers(); - }); - }); - } - function forEachAncestorAndObserverEnqueueRecord(target, callback) { - for (var node = target; node; node = node.parentNode) { - var registrations = registrationsTable.get(node); - if (registrations) { - for (var j = 0; j < registrations.length; j++) { - var registration = registrations[j]; - var options = registration.options; - if (node !== target && !options.subtree) continue; - var record = callback(options); - if (record) registration.enqueue(record); - } - } - } - } - var uidCounter = 0; - function JsMutationObserver(callback) { - this.callback_ = callback; - this.nodes_ = []; - this.records_ = []; - this.uid_ = ++uidCounter; - } - JsMutationObserver.prototype = { - observe: function(target, options) { - target = wrapIfNeeded(target); - if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) { - throw new SyntaxError(); - } - var registrations = registrationsTable.get(target); - if (!registrations) registrationsTable.set(target, registrations = []); - var registration; - for (var i = 0; i < registrations.length; i++) { - if (registrations[i].observer === this) { - registration = registrations[i]; - registration.removeListeners(); - registration.options = options; - break; - } - } - if (!registration) { - registration = new Registration(this, target, options); - registrations.push(registration); - this.nodes_.push(target); - } - registration.addListeners(); - }, - disconnect: function() { - this.nodes_.forEach(function(node) { - var registrations = registrationsTable.get(node); - for (var i = 0; i < registrations.length; i++) { - var registration = registrations[i]; - if (registration.observer === this) { - registration.removeListeners(); - registrations.splice(i, 1); - break; - } - } - }, this); - this.records_ = []; - }, - takeRecords: function() { - var copyOfRecords = this.records_; - this.records_ = []; - return copyOfRecords; - } - }; - function MutationRecord(type, target) { - this.type = type; - this.target = target; - this.addedNodes = []; - this.removedNodes = []; - this.previousSibling = null; - this.nextSibling = null; - this.attributeName = null; - this.attributeNamespace = null; - this.oldValue = null; - } - function copyMutationRecord(original) { - var record = new MutationRecord(original.type, original.target); - record.addedNodes = original.addedNodes.slice(); - record.removedNodes = original.removedNodes.slice(); - record.previousSibling = original.previousSibling; - record.nextSibling = original.nextSibling; - record.attributeName = original.attributeName; - record.attributeNamespace = original.attributeNamespace; - record.oldValue = original.oldValue; - return record; - } - var currentRecord, recordWithOldValue; - function getRecord(type, target) { - return currentRecord = new MutationRecord(type, target); - } - function getRecordWithOldValue(oldValue) { - if (recordWithOldValue) return recordWithOldValue; - recordWithOldValue = copyMutationRecord(currentRecord); - recordWithOldValue.oldValue = oldValue; - return recordWithOldValue; - } - function clearRecords() { - currentRecord = recordWithOldValue = undefined; - } - function recordRepresentsCurrentMutation(record) { - return record === recordWithOldValue || record === currentRecord; - } - function selectRecord(lastRecord, newRecord) { - if (lastRecord === newRecord) return lastRecord; - if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue; - return null; - } - function Registration(observer, target, options) { - this.observer = observer; - this.target = target; - this.options = options; - this.transientObservedNodes = []; - } - Registration.prototype = { - enqueue: function(record) { - var records = this.observer.records_; - var length = records.length; - if (records.length > 0) { - var lastRecord = records[length - 1]; - var recordToReplaceLast = selectRecord(lastRecord, record); - if (recordToReplaceLast) { - records[length - 1] = recordToReplaceLast; - return; - } - } else { - scheduleCallback(this.observer); - } - records[length] = record; - }, - addListeners: function() { - this.addListeners_(this.target); - }, - addListeners_: function(node) { - var options = this.options; - if (options.attributes) node.addEventListener("DOMAttrModified", this, true); - if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.addEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true); - }, - removeListeners: function() { - this.removeListeners_(this.target); - }, - removeListeners_: function(node) { - var options = this.options; - if (options.attributes) node.removeEventListener("DOMAttrModified", this, true); - if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.removeEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true); - }, - addTransientObserver: function(node) { - if (node === this.target) return; - this.addListeners_(node); - this.transientObservedNodes.push(node); - var registrations = registrationsTable.get(node); - if (!registrations) registrationsTable.set(node, registrations = []); - registrations.push(this); - }, - removeTransientObservers: function() { - var transientObservedNodes = this.transientObservedNodes; - this.transientObservedNodes = []; - transientObservedNodes.forEach(function(node) { - this.removeListeners_(node); - var registrations = registrationsTable.get(node); - for (var i = 0; i < registrations.length; i++) { - if (registrations[i] === this) { - registrations.splice(i, 1); - break; - } - } - }, this); - }, - handleEvent: function(e) { - e.stopImmediatePropagation(); - switch (e.type) { - case "DOMAttrModified": - var name = e.attrName; - var namespace = e.relatedNode.namespaceURI; - var target = e.target; - var record = new getRecord("attributes", target); - record.attributeName = name; - record.attributeNamespace = namespace; - var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.attributes) return; - if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) { - return; - } - if (options.attributeOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMCharacterDataModified": - var target = e.target; - var record = getRecord("characterData", target); - var oldValue = e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.characterData) return; - if (options.characterDataOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMNodeRemoved": - this.addTransientObserver(e.target); - - case "DOMNodeInserted": - var changedNode = e.target; - var addedNodes, removedNodes; - if (e.type === "DOMNodeInserted") { - addedNodes = [ changedNode ]; - removedNodes = []; - } else { - addedNodes = []; - removedNodes = [ changedNode ]; - } - var previousSibling = changedNode.previousSibling; - var nextSibling = changedNode.nextSibling; - var record = getRecord("childList", e.target.parentNode); - record.addedNodes = addedNodes; - record.removedNodes = removedNodes; - record.previousSibling = previousSibling; - record.nextSibling = nextSibling; - forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) { - if (!options.childList) return; - return record; - }); - } - clearRecords(); - } - }; - global.JsMutationObserver = JsMutationObserver; - if (!global.MutationObserver) { - global.MutationObserver = JsMutationObserver; - JsMutationObserver._isPolyfilled = true; - } -})(self); - -(function(scope) { - "use strict"; - if (!window.performance) { - var start = Date.now(); - window.performance = { - now: function() { - return Date.now() - start; - } - }; - } - if (!window.requestAnimationFrame) { - window.requestAnimationFrame = function() { - var nativeRaf = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame; - return nativeRaf ? function(callback) { - return nativeRaf(function() { - callback(performance.now()); - }); - } : function(callback) { - return window.setTimeout(callback, 1e3 / 60); - }; - }(); - } - if (!window.cancelAnimationFrame) { - window.cancelAnimationFrame = function() { - return window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || function(id) { - clearTimeout(id); - }; - }(); - } - var workingDefaultPrevented = function() { - var e = document.createEvent("Event"); - e.initEvent("foo", true, true); - e.preventDefault(); - return e.defaultPrevented; - }(); - if (!workingDefaultPrevented) { - var origPreventDefault = Event.prototype.preventDefault; - Event.prototype.preventDefault = function() { - if (!this.cancelable) { - return; - } - origPreventDefault.call(this); - Object.defineProperty(this, "defaultPrevented", { - get: function() { - return true; - }, - configurable: true - }); - }; - } - var isIE = /Trident/.test(navigator.userAgent); - if (!window.CustomEvent || isIE && typeof window.CustomEvent !== "function") { - window.CustomEvent = function(inType, params) { - params = params || {}; - var e = document.createEvent("CustomEvent"); - e.initCustomEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable), params.detail); - return e; - }; - window.CustomEvent.prototype = window.Event.prototype; - } - if (!window.Event || isIE && typeof window.Event !== "function") { - var origEvent = window.Event; - window.Event = function(inType, params) { - params = params || {}; - var e = document.createEvent("Event"); - e.initEvent(inType, Boolean(params.bubbles), Boolean(params.cancelable)); - return e; - }; - window.Event.prototype = origEvent.prototype; - } -})(window.WebComponents); - -window.HTMLImports = window.HTMLImports || { - flags: {} -}; - -(function(scope) { - var IMPORT_LINK_TYPE = "import"; - var useNative = Boolean(IMPORT_LINK_TYPE in document.createElement("link")); - var hasShadowDOMPolyfill = Boolean(window.ShadowDOMPolyfill); - var wrap = function(node) { - return hasShadowDOMPolyfill ? window.ShadowDOMPolyfill.wrapIfNeeded(node) : node; - }; - var rootDocument = wrap(document); - var currentScriptDescriptor = { - get: function() { - var script = window.HTMLImports.currentScript || document.currentScript || (document.readyState !== "complete" ? document.scripts[document.scripts.length - 1] : null); - return wrap(script); - }, - configurable: true - }; - Object.defineProperty(document, "_currentScript", currentScriptDescriptor); - Object.defineProperty(rootDocument, "_currentScript", currentScriptDescriptor); - var isIE = /Trident/.test(navigator.userAgent); - function whenReady(callback, doc) { - doc = doc || rootDocument; - whenDocumentReady(function() { - watchImportsLoad(callback, doc); - }, doc); - } - var requiredReadyState = isIE ? "complete" : "interactive"; - var READY_EVENT = "readystatechange"; - function isDocumentReady(doc) { - return doc.readyState === "complete" || doc.readyState === requiredReadyState; - } - function whenDocumentReady(callback, doc) { - if (!isDocumentReady(doc)) { - var checkReady = function() { - if (doc.readyState === "complete" || doc.readyState === requiredReadyState) { - doc.removeEventListener(READY_EVENT, checkReady); - whenDocumentReady(callback, doc); - } - }; - doc.addEventListener(READY_EVENT, checkReady); - } else if (callback) { - callback(); - } - } - function markTargetLoaded(event) { - event.target.__loaded = true; - } - function watchImportsLoad(callback, doc) { - var imports = doc.querySelectorAll("link[rel=import]"); - var parsedCount = 0, importCount = imports.length, newImports = [], errorImports = []; - function checkDone() { - if (parsedCount == importCount && callback) { - callback({ - allImports: imports, - loadedImports: newImports, - errorImports: errorImports - }); - } - } - function loadedImport(e) { - markTargetLoaded(e); - newImports.push(this); - parsedCount++; - checkDone(); - } - function errorLoadingImport(e) { - errorImports.push(this); - parsedCount++; - checkDone(); - } - if (importCount) { - for (var i = 0, imp; i < importCount && (imp = imports[i]); i++) { - if (isImportLoaded(imp)) { - newImports.push(this); - parsedCount++; - checkDone(); - } else { - imp.addEventListener("load", loadedImport); - imp.addEventListener("error", errorLoadingImport); - } - } - } else { - checkDone(); - } - } - function isImportLoaded(link) { - return useNative ? link.__loaded || link.import && link.import.readyState !== "loading" : link.__importParsed; - } - if (useNative) { - new MutationObserver(function(mxns) { - for (var i = 0, l = mxns.length, m; i < l && (m = mxns[i]); i++) { - if (m.addedNodes) { - handleImports(m.addedNodes); - } - } - }).observe(document.head, { - childList: true - }); - function handleImports(nodes) { - for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { - if (isImport(n)) { - handleImport(n); - } - } - } - function isImport(element) { - return element.localName === "link" && element.rel === "import"; - } - function handleImport(element) { - var loaded = element.import; - if (loaded) { - markTargetLoaded({ - target: element - }); - } else { - element.addEventListener("load", markTargetLoaded); - element.addEventListener("error", markTargetLoaded); - } - } - (function() { - if (document.readyState === "loading") { - var imports = document.querySelectorAll("link[rel=import]"); - for (var i = 0, l = imports.length, imp; i < l && (imp = imports[i]); i++) { - handleImport(imp); - } - } - })(); - } - whenReady(function(detail) { - window.HTMLImports.ready = true; - window.HTMLImports.readyTime = new Date().getTime(); - var evt = rootDocument.createEvent("CustomEvent"); - evt.initCustomEvent("HTMLImportsLoaded", true, true, detail); - rootDocument.dispatchEvent(evt); - }); - scope.IMPORT_LINK_TYPE = IMPORT_LINK_TYPE; - scope.useNative = useNative; - scope.rootDocument = rootDocument; - scope.whenReady = whenReady; - scope.isIE = isIE; -})(window.HTMLImports); - -(function(scope) { - var modules = []; - var addModule = function(module) { - modules.push(module); - }; - var initializeModules = function() { - modules.forEach(function(module) { - module(scope); - }); - }; - scope.addModule = addModule; - scope.initializeModules = initializeModules; -})(window.HTMLImports); - -window.HTMLImports.addModule(function(scope) { - var CSS_URL_REGEXP = /(url\()([^)]*)(\))/g; - var CSS_IMPORT_REGEXP = /(@import[\s]+(?!url\())([^;]*)(;)/g; - var path = { - resolveUrlsInStyle: function(style, linkUrl) { - var doc = style.ownerDocument; - var resolver = doc.createElement("a"); - style.textContent = this.resolveUrlsInCssText(style.textContent, linkUrl, resolver); - return style; - }, - resolveUrlsInCssText: function(cssText, linkUrl, urlObj) { - var r = this.replaceUrls(cssText, urlObj, linkUrl, CSS_URL_REGEXP); - r = this.replaceUrls(r, urlObj, linkUrl, CSS_IMPORT_REGEXP); - return r; - }, - replaceUrls: function(text, urlObj, linkUrl, regexp) { - return text.replace(regexp, function(m, pre, url, post) { - var urlPath = url.replace(/["']/g, ""); - if (linkUrl) { - urlPath = new URL(urlPath, linkUrl).href; - } - urlObj.href = urlPath; - urlPath = urlObj.href; - return pre + "'" + urlPath + "'" + post; - }); - } - }; - scope.path = path; -}); - -window.HTMLImports.addModule(function(scope) { - var xhr = { - async: true, - ok: function(request) { - return request.status >= 200 && request.status < 300 || request.status === 304 || request.status === 0; - }, - load: function(url, next, nextContext) { - var request = new XMLHttpRequest(); - if (scope.flags.debug || scope.flags.bust) { - url += "?" + Math.random(); - } - request.open("GET", url, xhr.async); - request.addEventListener("readystatechange", function(e) { - if (request.readyState === 4) { - var redirectedUrl = null; - try { - var locationHeader = request.getResponseHeader("Location"); - if (locationHeader) { - redirectedUrl = locationHeader.substr(0, 1) === "/" ? location.origin + locationHeader : locationHeader; - } - } catch (e) { - console.error(e.message); - } - next.call(nextContext, !xhr.ok(request) && request, request.response || request.responseText, redirectedUrl); - } - }); - request.send(); - return request; - }, - loadDocument: function(url, next, nextContext) { - this.load(url, next, nextContext).responseType = "document"; - } - }; - scope.xhr = xhr; -}); - -window.HTMLImports.addModule(function(scope) { - var xhr = scope.xhr; - var flags = scope.flags; - var Loader = function(onLoad, onComplete) { - this.cache = {}; - this.onload = onLoad; - this.oncomplete = onComplete; - this.inflight = 0; - this.pending = {}; - }; - Loader.prototype = { - addNodes: function(nodes) { - this.inflight += nodes.length; - for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { - this.require(n); - } - this.checkDone(); - }, - addNode: function(node) { - this.inflight++; - this.require(node); - this.checkDone(); - }, - require: function(elt) { - var url = elt.src || elt.href; - elt.__nodeUrl = url; - if (!this.dedupe(url, elt)) { - this.fetch(url, elt); - } - }, - dedupe: function(url, elt) { - if (this.pending[url]) { - this.pending[url].push(elt); - return true; - } - var resource; - if (this.cache[url]) { - this.onload(url, elt, this.cache[url]); - this.tail(); - return true; - } - this.pending[url] = [ elt ]; - return false; - }, - fetch: function(url, elt) { - flags.load && console.log("fetch", url, elt); - if (!url) { - setTimeout(function() { - this.receive(url, elt, { - error: "href must be specified" - }, null); - }.bind(this), 0); - } else if (url.match(/^data:/)) { - var pieces = url.split(","); - var header = pieces[0]; - var body = pieces[1]; - if (header.indexOf(";base64") > -1) { - body = atob(body); - } else { - body = decodeURIComponent(body); - } - setTimeout(function() { - this.receive(url, elt, null, body); - }.bind(this), 0); - } else { - var receiveXhr = function(err, resource, redirectedUrl) { - this.receive(url, elt, err, resource, redirectedUrl); - }.bind(this); - xhr.load(url, receiveXhr); - } - }, - receive: function(url, elt, err, resource, redirectedUrl) { - this.cache[url] = resource; - var $p = this.pending[url]; - for (var i = 0, l = $p.length, p; i < l && (p = $p[i]); i++) { - this.onload(url, p, resource, err, redirectedUrl); - this.tail(); - } - this.pending[url] = null; - }, - tail: function() { - --this.inflight; - this.checkDone(); - }, - checkDone: function() { - if (!this.inflight) { - this.oncomplete(); - } - } - }; - scope.Loader = Loader; -}); - -window.HTMLImports.addModule(function(scope) { - var Observer = function(addCallback) { - this.addCallback = addCallback; - this.mo = new MutationObserver(this.handler.bind(this)); - }; - Observer.prototype = { - handler: function(mutations) { - for (var i = 0, l = mutations.length, m; i < l && (m = mutations[i]); i++) { - if (m.type === "childList" && m.addedNodes.length) { - this.addedNodes(m.addedNodes); - } - } - }, - addedNodes: function(nodes) { - if (this.addCallback) { - this.addCallback(nodes); - } - for (var i = 0, l = nodes.length, n, loading; i < l && (n = nodes[i]); i++) { - if (n.children && n.children.length) { - this.addedNodes(n.children); - } - } - }, - observe: function(root) { - this.mo.observe(root, { - childList: true, - subtree: true - }); - } - }; - scope.Observer = Observer; -}); - -window.HTMLImports.addModule(function(scope) { - var path = scope.path; - var rootDocument = scope.rootDocument; - var flags = scope.flags; - var isIE = scope.isIE; - var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE; - var IMPORT_SELECTOR = "link[rel=" + IMPORT_LINK_TYPE + "]"; - var importParser = { - documentSelectors: IMPORT_SELECTOR, - importsSelectors: [ IMPORT_SELECTOR, "link[rel=stylesheet]:not([type])", "style:not([type])", "script:not([type])", 'script[type="application/javascript"]', 'script[type="text/javascript"]' ].join(","), - map: { - link: "parseLink", - script: "parseScript", - style: "parseStyle" - }, - dynamicElements: [], - parseNext: function() { - var next = this.nextToParse(); - if (next) { - this.parse(next); - } - }, - parse: function(elt) { - if (this.isParsed(elt)) { - flags.parse && console.log("[%s] is already parsed", elt.localName); - return; - } - var fn = this[this.map[elt.localName]]; - if (fn) { - this.markParsing(elt); - fn.call(this, elt); - } - }, - parseDynamic: function(elt, quiet) { - this.dynamicElements.push(elt); - if (!quiet) { - this.parseNext(); - } - }, - markParsing: function(elt) { - flags.parse && console.log("parsing", elt); - this.parsingElement = elt; - }, - markParsingComplete: function(elt) { - elt.__importParsed = true; - this.markDynamicParsingComplete(elt); - if (elt.__importElement) { - elt.__importElement.__importParsed = true; - this.markDynamicParsingComplete(elt.__importElement); - } - this.parsingElement = null; - flags.parse && console.log("completed", elt); - }, - markDynamicParsingComplete: function(elt) { - var i = this.dynamicElements.indexOf(elt); - if (i >= 0) { - this.dynamicElements.splice(i, 1); - } - }, - parseImport: function(elt) { - elt.import = elt.__doc; - if (window.HTMLImports.__importsParsingHook) { - window.HTMLImports.__importsParsingHook(elt); - } - if (elt.import) { - elt.import.__importParsed = true; - } - this.markParsingComplete(elt); - if (elt.__resource && !elt.__error) { - elt.dispatchEvent(new CustomEvent("load", { - bubbles: false - })); - } else { - elt.dispatchEvent(new CustomEvent("error", { - bubbles: false - })); - } - if (elt.__pending) { - var fn; - while (elt.__pending.length) { - fn = elt.__pending.shift(); - if (fn) { - fn({ - target: elt - }); - } - } - } - this.parseNext(); - }, - parseLink: function(linkElt) { - if (nodeIsImport(linkElt)) { - this.parseImport(linkElt); - } else { - linkElt.href = linkElt.href; - this.parseGeneric(linkElt); - } - }, - parseStyle: function(elt) { - var src = elt; - elt = cloneStyle(elt); - src.__appliedElement = elt; - elt.__importElement = src; - this.parseGeneric(elt); - }, - parseGeneric: function(elt) { - this.trackElement(elt); - this.addElementToDocument(elt); - }, - rootImportForElement: function(elt) { - var n = elt; - while (n.ownerDocument.__importLink) { - n = n.ownerDocument.__importLink; - } - return n; - }, - addElementToDocument: function(elt) { - var port = this.rootImportForElement(elt.__importElement || elt); - port.parentNode.insertBefore(elt, port); - }, - trackElement: function(elt, callback) { - var self = this; - var done = function(e) { - elt.removeEventListener("load", done); - elt.removeEventListener("error", done); - if (callback) { - callback(e); - } - self.markParsingComplete(elt); - self.parseNext(); - }; - elt.addEventListener("load", done); - elt.addEventListener("error", done); - if (isIE && elt.localName === "style") { - var fakeLoad = false; - if (elt.textContent.indexOf("@import") == -1) { - fakeLoad = true; - } else if (elt.sheet) { - fakeLoad = true; - var csr = elt.sheet.cssRules; - var len = csr ? csr.length : 0; - for (var i = 0, r; i < len && (r = csr[i]); i++) { - if (r.type === CSSRule.IMPORT_RULE) { - fakeLoad = fakeLoad && Boolean(r.styleSheet); - } - } - } - if (fakeLoad) { - setTimeout(function() { - elt.dispatchEvent(new CustomEvent("load", { - bubbles: false - })); - }); - } - } - }, - parseScript: function(scriptElt) { - var script = document.createElement("script"); - script.__importElement = scriptElt; - script.src = scriptElt.src ? scriptElt.src : generateScriptDataUrl(scriptElt); - scope.currentScript = scriptElt; - this.trackElement(script, function(e) { - if (script.parentNode) { - script.parentNode.removeChild(script); - } - scope.currentScript = null; - }); - this.addElementToDocument(script); - }, - nextToParse: function() { - this._mayParse = []; - return !this.parsingElement && (this.nextToParseInDoc(rootDocument) || this.nextToParseDynamic()); - }, - nextToParseInDoc: function(doc, link) { - if (doc && this._mayParse.indexOf(doc) < 0) { - this._mayParse.push(doc); - var nodes = doc.querySelectorAll(this.parseSelectorsForNode(doc)); - for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { - if (!this.isParsed(n)) { - if (this.hasResource(n)) { - return nodeIsImport(n) ? this.nextToParseInDoc(n.__doc, n) : n; - } else { - return; - } - } - } - } - return link; - }, - nextToParseDynamic: function() { - return this.dynamicElements[0]; - }, - parseSelectorsForNode: function(node) { - var doc = node.ownerDocument || node; - return doc === rootDocument ? this.documentSelectors : this.importsSelectors; - }, - isParsed: function(node) { - return node.__importParsed; - }, - needsDynamicParsing: function(elt) { - return this.dynamicElements.indexOf(elt) >= 0; - }, - hasResource: function(node) { - if (nodeIsImport(node) && node.__doc === undefined) { - return false; - } - return true; - } - }; - function nodeIsImport(elt) { - return elt.localName === "link" && elt.rel === IMPORT_LINK_TYPE; - } - function generateScriptDataUrl(script) { - var scriptContent = generateScriptContent(script); - return "data:text/javascript;charset=utf-8," + encodeURIComponent(scriptContent); - } - function generateScriptContent(script) { - return script.textContent + generateSourceMapHint(script); - } - function generateSourceMapHint(script) { - var owner = script.ownerDocument; - owner.__importedScripts = owner.__importedScripts || 0; - var moniker = script.ownerDocument.baseURI; - var num = owner.__importedScripts ? "-" + owner.__importedScripts : ""; - owner.__importedScripts++; - return "\n//# sourceURL=" + moniker + num + ".js\n"; - } - function cloneStyle(style) { - var clone = style.ownerDocument.createElement("style"); - clone.textContent = style.textContent; - path.resolveUrlsInStyle(clone); - return clone; - } - scope.parser = importParser; - scope.IMPORT_SELECTOR = IMPORT_SELECTOR; -}); - -window.HTMLImports.addModule(function(scope) { - var flags = scope.flags; - var IMPORT_LINK_TYPE = scope.IMPORT_LINK_TYPE; - var IMPORT_SELECTOR = scope.IMPORT_SELECTOR; - var rootDocument = scope.rootDocument; - var Loader = scope.Loader; - var Observer = scope.Observer; - var parser = scope.parser; - var importer = { - documents: {}, - documentPreloadSelectors: IMPORT_SELECTOR, - importsPreloadSelectors: [ IMPORT_SELECTOR ].join(","), - loadNode: function(node) { - importLoader.addNode(node); - }, - loadSubtree: function(parent) { - var nodes = this.marshalNodes(parent); - importLoader.addNodes(nodes); - }, - marshalNodes: function(parent) { - return parent.querySelectorAll(this.loadSelectorsForNode(parent)); - }, - loadSelectorsForNode: function(node) { - var doc = node.ownerDocument || node; - return doc === rootDocument ? this.documentPreloadSelectors : this.importsPreloadSelectors; - }, - loaded: function(url, elt, resource, err, redirectedUrl) { - flags.load && console.log("loaded", url, elt); - elt.__resource = resource; - elt.__error = err; - if (isImportLink(elt)) { - var doc = this.documents[url]; - if (doc === undefined) { - doc = err ? null : makeDocument(resource, redirectedUrl || url); - if (doc) { - doc.__importLink = elt; - this.bootDocument(doc); - } - this.documents[url] = doc; - } - elt.__doc = doc; - } - parser.parseNext(); - }, - bootDocument: function(doc) { - this.loadSubtree(doc); - this.observer.observe(doc); - parser.parseNext(); - }, - loadedAll: function() { - parser.parseNext(); - } - }; - var importLoader = new Loader(importer.loaded.bind(importer), importer.loadedAll.bind(importer)); - importer.observer = new Observer(); - function isImportLink(elt) { - return isLinkRel(elt, IMPORT_LINK_TYPE); - } - function isLinkRel(elt, rel) { - return elt.localName === "link" && elt.getAttribute("rel") === rel; - } - function hasBaseURIAccessor(doc) { - return !!Object.getOwnPropertyDescriptor(doc, "baseURI"); - } - function makeDocument(resource, url) { - var doc = document.implementation.createHTMLDocument(IMPORT_LINK_TYPE); - doc._URL = url; - var base = doc.createElement("base"); - base.setAttribute("href", url); - if (!doc.baseURI && !hasBaseURIAccessor(doc)) { - Object.defineProperty(doc, "baseURI", { - value: url - }); - } - var meta = doc.createElement("meta"); - meta.setAttribute("charset", "utf-8"); - doc.head.appendChild(meta); - doc.head.appendChild(base); - doc.body.innerHTML = resource; - if (window.HTMLTemplateElement && HTMLTemplateElement.bootstrap) { - HTMLTemplateElement.bootstrap(doc); - } - return doc; - } - if (!document.baseURI) { - var baseURIDescriptor = { - get: function() { - var base = document.querySelector("base"); - return base ? base.href : window.location.href; - }, - configurable: true - }; - Object.defineProperty(document, "baseURI", baseURIDescriptor); - Object.defineProperty(rootDocument, "baseURI", baseURIDescriptor); - } - scope.importer = importer; - scope.importLoader = importLoader; -}); - -window.HTMLImports.addModule(function(scope) { - var parser = scope.parser; - var importer = scope.importer; - var dynamic = { - added: function(nodes) { - var owner, parsed, loading; - for (var i = 0, l = nodes.length, n; i < l && (n = nodes[i]); i++) { - if (!owner) { - owner = n.ownerDocument; - parsed = parser.isParsed(owner); - } - loading = this.shouldLoadNode(n); - if (loading) { - importer.loadNode(n); - } - if (this.shouldParseNode(n) && parsed) { - parser.parseDynamic(n, loading); - } - } - }, - shouldLoadNode: function(node) { - return node.nodeType === 1 && matches.call(node, importer.loadSelectorsForNode(node)); - }, - shouldParseNode: function(node) { - return node.nodeType === 1 && matches.call(node, parser.parseSelectorsForNode(node)); - } - }; - importer.observer.addCallback = dynamic.added.bind(dynamic); - var matches = HTMLElement.prototype.matches || HTMLElement.prototype.matchesSelector || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector; -}); - -(function(scope) { - var initializeModules = scope.initializeModules; - var isIE = scope.isIE; - if (scope.useNative) { - return; - } - initializeModules(); - var rootDocument = scope.rootDocument; - function bootstrap() { - window.HTMLImports.importer.bootDocument(rootDocument); - } - if (document.readyState === "complete" || document.readyState === "interactive" && !window.attachEvent) { - bootstrap(); - } else { - document.addEventListener("DOMContentLoaded", bootstrap); - } -})(window.HTMLImports); \ No newline at end of file diff --git a/lib/admin/public/bower_components/webcomponentsjs/HTMLImports.min.js b/lib/admin/public/bower_components/webcomponentsjs/HTMLImports.min.js deleted file mode 100644 index dd5b1175..00000000 --- a/lib/admin/public/bower_components/webcomponentsjs/HTMLImports.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -// @version 0.7.22 -"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};n.prototype={set:function(t,n){var r=t[this.name];return r&&r[0]===t?r[1]=n:e(t,this.name,{value:[t,n],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=n}(),function(e){function t(e){E.push(e),g||(g=!0,f(r))}function n(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function r(){g=!1;var e=E;E=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var n=e.takeRecords();o(e),n.length&&(e.callback_(n,e),t=!0)}),t&&r()}function o(e){e.nodes_.forEach(function(t){var n=v.get(t);n&&n.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function i(e,t){for(var n=e;n;n=n.parentNode){var r=v.get(n);if(r)for(var o=0;o0){var o=n[r-1],i=m(o,e);if(i)return void(n[r-1]=i)}else t(this.observer);n[r]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=v.get(e);t||v.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=v.get(e),n=0;nm&&(h=s[m]);m++)a(h)?(u.push(this),d++,n()):(h.addEventListener("load",r),h.addEventListener("error",i));else n()}function a(e){return l?e.__loaded||e["import"]&&"loading"!==e["import"].readyState:e.__importParsed}function s(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)d(t)&&c(t)}function d(e){return"link"===e.localName&&"import"===e.rel}function c(e){var t=e["import"];t?o({target:e}):(e.addEventListener("load",o),e.addEventListener("error",o))}var u="import",l=Boolean(u in document.createElement("link")),h=Boolean(window.ShadowDOMPolyfill),m=function(e){return h?window.ShadowDOMPolyfill.wrapIfNeeded(e):e},p=m(document),f={get:function(){var e=window.HTMLImports.currentScript||document.currentScript||("complete"!==document.readyState?document.scripts[document.scripts.length-1]:null);return m(e)},configurable:!0};Object.defineProperty(document,"_currentScript",f),Object.defineProperty(p,"_currentScript",f);var v=/Trident/.test(navigator.userAgent),w=v?"complete":"interactive",b="readystatechange";l&&(new MutationObserver(function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.addedNodes&&s(t.addedNodes)}).observe(document.head,{childList:!0}),function(){if("loading"===document.readyState)for(var e,t=document.querySelectorAll("link[rel=import]"),n=0,r=t.length;r>n&&(e=t[n]);n++)c(e)}()),t(function(e){window.HTMLImports.ready=!0,window.HTMLImports.readyTime=(new Date).getTime();var t=p.createEvent("CustomEvent");t.initCustomEvent("HTMLImportsLoaded",!0,!0,e),p.dispatchEvent(t)}),e.IMPORT_LINK_TYPE=u,e.useNative=l,e.rootDocument=p,e.whenReady=t,e.isIE=v}(window.HTMLImports),function(e){var t=[],n=function(e){t.push(e)},r=function(){t.forEach(function(t){t(e)})};e.addModule=n,e.initializeModules=r}(window.HTMLImports),window.HTMLImports.addModule(function(e){var t=/(url\()([^)]*)(\))/g,n=/(@import[\s]+(?!url\())([^;]*)(;)/g,r={resolveUrlsInStyle:function(e,t){var n=e.ownerDocument,r=n.createElement("a");return e.textContent=this.resolveUrlsInCssText(e.textContent,t,r),e},resolveUrlsInCssText:function(e,r,o){var i=this.replaceUrls(e,o,r,t);return i=this.replaceUrls(i,o,r,n)},replaceUrls:function(e,t,n,r){return e.replace(r,function(e,r,o,i){var a=o.replace(/["']/g,"");return n&&(a=new URL(a,n).href),t.href=a,a=t.href,r+"'"+a+"'"+i})}};e.path=r}),window.HTMLImports.addModule(function(e){var t={async:!0,ok:function(e){return e.status>=200&&e.status<300||304===e.status||0===e.status},load:function(n,r,o){var i=new XMLHttpRequest;return(e.flags.debug||e.flags.bust)&&(n+="?"+Math.random()),i.open("GET",n,t.async),i.addEventListener("readystatechange",function(e){if(4===i.readyState){var n=null;try{var a=i.getResponseHeader("Location");a&&(n="/"===a.substr(0,1)?location.origin+a:a)}catch(e){console.error(e.message)}r.call(o,!t.ok(i)&&i,i.response||i.responseText,n)}}),i.send(),i},loadDocument:function(e,t,n){this.load(e,t,n).responseType="document"}};e.xhr=t}),window.HTMLImports.addModule(function(e){var t=e.xhr,n=e.flags,r=function(e,t){this.cache={},this.onload=e,this.oncomplete=t,this.inflight=0,this.pending={}};r.prototype={addNodes:function(e){this.inflight+=e.length;for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)this.require(t);this.checkDone()},addNode:function(e){this.inflight++,this.require(e),this.checkDone()},require:function(e){var t=e.src||e.href;e.__nodeUrl=t,this.dedupe(t,e)||this.fetch(t,e)},dedupe:function(e,t){if(this.pending[e])return this.pending[e].push(t),!0;return this.cache[e]?(this.onload(e,t,this.cache[e]),this.tail(),!0):(this.pending[e]=[t],!1)},fetch:function(e,r){if(n.load&&console.log("fetch",e,r),e)if(e.match(/^data:/)){var o=e.split(","),i=o[0],a=o[1];a=i.indexOf(";base64")>-1?atob(a):decodeURIComponent(a),setTimeout(function(){this.receive(e,r,null,a)}.bind(this),0)}else{var s=function(t,n,o){this.receive(e,r,t,n,o)}.bind(this);t.load(e,s)}else setTimeout(function(){this.receive(e,r,{error:"href must be specified"},null)}.bind(this),0)},receive:function(e,t,n,r,o){this.cache[e]=r;for(var i,a=this.pending[e],s=0,d=a.length;d>s&&(i=a[s]);s++)this.onload(e,i,r,n,o),this.tail();this.pending[e]=null},tail:function(){--this.inflight,this.checkDone()},checkDone:function(){this.inflight||this.oncomplete()}},e.Loader=r}),window.HTMLImports.addModule(function(e){var t=function(e){this.addCallback=e,this.mo=new MutationObserver(this.handler.bind(this))};t.prototype={handler:function(e){for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)"childList"===t.type&&t.addedNodes.length&&this.addedNodes(t.addedNodes)},addedNodes:function(e){this.addCallback&&this.addCallback(e);for(var t,n=0,r=e.length;r>n&&(t=e[n]);n++)t.children&&t.children.length&&this.addedNodes(t.children)},observe:function(e){this.mo.observe(e,{childList:!0,subtree:!0})}},e.Observer=t}),window.HTMLImports.addModule(function(e){function t(e){return"link"===e.localName&&e.rel===u}function n(e){var t=r(e);return"data:text/javascript;charset=utf-8,"+encodeURIComponent(t)}function r(e){return e.textContent+o(e)}function o(e){var t=e.ownerDocument;t.__importedScripts=t.__importedScripts||0;var n=e.ownerDocument.baseURI,r=t.__importedScripts?"-"+t.__importedScripts:"";return t.__importedScripts++,"\n//# sourceURL="+n+r+".js\n"}function i(e){var t=e.ownerDocument.createElement("style");return t.textContent=e.textContent,a.resolveUrlsInStyle(t),t}var a=e.path,s=e.rootDocument,d=e.flags,c=e.isIE,u=e.IMPORT_LINK_TYPE,l="link[rel="+u+"]",h={documentSelectors:l,importsSelectors:[l,"link[rel=stylesheet]:not([type])","style:not([type])","script:not([type])",'script[type="application/javascript"]','script[type="text/javascript"]'].join(","),map:{link:"parseLink",script:"parseScript",style:"parseStyle"},dynamicElements:[],parseNext:function(){var e=this.nextToParse();e&&this.parse(e)},parse:function(e){if(this.isParsed(e))return void(d.parse&&console.log("[%s] is already parsed",e.localName));var t=this[this.map[e.localName]];t&&(this.markParsing(e),t.call(this,e))},parseDynamic:function(e,t){this.dynamicElements.push(e),t||this.parseNext()},markParsing:function(e){d.parse&&console.log("parsing",e),this.parsingElement=e},markParsingComplete:function(e){e.__importParsed=!0,this.markDynamicParsingComplete(e),e.__importElement&&(e.__importElement.__importParsed=!0,this.markDynamicParsingComplete(e.__importElement)),this.parsingElement=null,d.parse&&console.log("completed",e)},markDynamicParsingComplete:function(e){var t=this.dynamicElements.indexOf(e);t>=0&&this.dynamicElements.splice(t,1)},parseImport:function(e){if(e["import"]=e.__doc,window.HTMLImports.__importsParsingHook&&window.HTMLImports.__importsParsingHook(e),e["import"]&&(e["import"].__importParsed=!0),this.markParsingComplete(e),e.__resource&&!e.__error?e.dispatchEvent(new CustomEvent("load",{bubbles:!1})):e.dispatchEvent(new CustomEvent("error",{bubbles:!1})),e.__pending)for(var t;e.__pending.length;)t=e.__pending.shift(),t&&t({target:e});this.parseNext()},parseLink:function(e){t(e)?this.parseImport(e):(e.href=e.href,this.parseGeneric(e))},parseStyle:function(e){var t=e;e=i(e),t.__appliedElement=e,e.__importElement=t,this.parseGeneric(e)},parseGeneric:function(e){this.trackElement(e),this.addElementToDocument(e)},rootImportForElement:function(e){for(var t=e;t.ownerDocument.__importLink;)t=t.ownerDocument.__importLink;return t},addElementToDocument:function(e){var t=this.rootImportForElement(e.__importElement||e);t.parentNode.insertBefore(e,t)},trackElement:function(e,t){var n=this,r=function(o){e.removeEventListener("load",r),e.removeEventListener("error",r),t&&t(o),n.markParsingComplete(e),n.parseNext()};if(e.addEventListener("load",r),e.addEventListener("error",r),c&&"style"===e.localName){var o=!1;if(-1==e.textContent.indexOf("@import"))o=!0;else if(e.sheet){o=!0;for(var i,a=e.sheet.cssRules,s=a?a.length:0,d=0;s>d&&(i=a[d]);d++)i.type===CSSRule.IMPORT_RULE&&(o=o&&Boolean(i.styleSheet))}o&&setTimeout(function(){e.dispatchEvent(new CustomEvent("load",{bubbles:!1}))})}},parseScript:function(t){var r=document.createElement("script");r.__importElement=t,r.src=t.src?t.src:n(t),e.currentScript=t,this.trackElement(r,function(t){r.parentNode&&r.parentNode.removeChild(r),e.currentScript=null}),this.addElementToDocument(r)},nextToParse:function(){return this._mayParse=[],!this.parsingElement&&(this.nextToParseInDoc(s)||this.nextToParseDynamic())},nextToParseInDoc:function(e,n){if(e&&this._mayParse.indexOf(e)<0){this._mayParse.push(e);for(var r,o=e.querySelectorAll(this.parseSelectorsForNode(e)),i=0,a=o.length;a>i&&(r=o[i]);i++)if(!this.isParsed(r))return this.hasResource(r)?t(r)?this.nextToParseInDoc(r.__doc,r):r:void 0}return n},nextToParseDynamic:function(){return this.dynamicElements[0]},parseSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===s?this.documentSelectors:this.importsSelectors},isParsed:function(e){return e.__importParsed},needsDynamicParsing:function(e){return this.dynamicElements.indexOf(e)>=0},hasResource:function(e){return!t(e)||void 0!==e.__doc}};e.parser=h,e.IMPORT_SELECTOR=l}),window.HTMLImports.addModule(function(e){function t(e){return n(e,a)}function n(e,t){return"link"===e.localName&&e.getAttribute("rel")===t}function r(e){return!!Object.getOwnPropertyDescriptor(e,"baseURI")}function o(e,t){var n=document.implementation.createHTMLDocument(a);n._URL=t;var o=n.createElement("base");o.setAttribute("href",t),n.baseURI||r(n)||Object.defineProperty(n,"baseURI",{value:t});var i=n.createElement("meta");return i.setAttribute("charset","utf-8"),n.head.appendChild(i),n.head.appendChild(o),n.body.innerHTML=e,window.HTMLTemplateElement&&HTMLTemplateElement.bootstrap&&HTMLTemplateElement.bootstrap(n),n}var i=e.flags,a=e.IMPORT_LINK_TYPE,s=e.IMPORT_SELECTOR,d=e.rootDocument,c=e.Loader,u=e.Observer,l=e.parser,h={documents:{},documentPreloadSelectors:s,importsPreloadSelectors:[s].join(","),loadNode:function(e){m.addNode(e)},loadSubtree:function(e){var t=this.marshalNodes(e);m.addNodes(t)},marshalNodes:function(e){return e.querySelectorAll(this.loadSelectorsForNode(e))},loadSelectorsForNode:function(e){var t=e.ownerDocument||e;return t===d?this.documentPreloadSelectors:this.importsPreloadSelectors},loaded:function(e,n,r,a,s){if(i.load&&console.log("loaded",e,n),n.__resource=r,n.__error=a,t(n)){var d=this.documents[e];void 0===d&&(d=a?null:o(r,s||e),d&&(d.__importLink=n,this.bootDocument(d)),this.documents[e]=d),n.__doc=d}l.parseNext()},bootDocument:function(e){this.loadSubtree(e),this.observer.observe(e),l.parseNext()},loadedAll:function(){l.parseNext()}},m=new c(h.loaded.bind(h),h.loadedAll.bind(h));if(h.observer=new u,!document.baseURI){var p={get:function(){var e=document.querySelector("base");return e?e.href:window.location.href},configurable:!0};Object.defineProperty(document,"baseURI",p),Object.defineProperty(d,"baseURI",p)}e.importer=h,e.importLoader=m}),window.HTMLImports.addModule(function(e){var t=e.parser,n=e.importer,r={added:function(e){for(var r,o,i,a,s=0,d=e.length;d>s&&(a=e[s]);s++)r||(r=a.ownerDocument,o=t.isParsed(r)),i=this.shouldLoadNode(a),i&&n.loadNode(a),this.shouldParseNode(a)&&o&&t.parseDynamic(a,i)},shouldLoadNode:function(e){return 1===e.nodeType&&o.call(e,n.loadSelectorsForNode(e))},shouldParseNode:function(e){return 1===e.nodeType&&o.call(e,t.parseSelectorsForNode(e))}};n.observer.addCallback=r.added.bind(r);var o=HTMLElement.prototype.matches||HTMLElement.prototype.matchesSelector||HTMLElement.prototype.webkitMatchesSelector||HTMLElement.prototype.mozMatchesSelector||HTMLElement.prototype.msMatchesSelector}),function(e){function t(){window.HTMLImports.importer.bootDocument(r)}var n=e.initializeModules;e.isIE;if(!e.useNative){n();var r=e.rootDocument;"complete"===document.readyState||"interactive"===document.readyState&&!window.attachEvent?t():document.addEventListener("DOMContentLoaded",t)}}(window.HTMLImports); \ No newline at end of file diff --git a/lib/admin/public/bower_components/webcomponentsjs/MutationObserver.js b/lib/admin/public/bower_components/webcomponentsjs/MutationObserver.js deleted file mode 100644 index e58713b6..00000000 --- a/lib/admin/public/bower_components/webcomponentsjs/MutationObserver.js +++ /dev/null @@ -1,350 +0,0 @@ -/** - * @license - * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -// @version 0.7.22 -if (typeof WeakMap === "undefined") { - (function() { - var defineProperty = Object.defineProperty; - var counter = Date.now() % 1e9; - var WeakMap = function() { - this.name = "__st" + (Math.random() * 1e9 >>> 0) + (counter++ + "__"); - }; - WeakMap.prototype = { - set: function(key, value) { - var entry = key[this.name]; - if (entry && entry[0] === key) entry[1] = value; else defineProperty(key, this.name, { - value: [ key, value ], - writable: true - }); - return this; - }, - get: function(key) { - var entry; - return (entry = key[this.name]) && entry[0] === key ? entry[1] : undefined; - }, - "delete": function(key) { - var entry = key[this.name]; - if (!entry || entry[0] !== key) return false; - entry[0] = entry[1] = undefined; - return true; - }, - has: function(key) { - var entry = key[this.name]; - if (!entry) return false; - return entry[0] === key; - } - }; - window.WeakMap = WeakMap; - })(); -} - -(function(global) { - if (global.JsMutationObserver) { - return; - } - var registrationsTable = new WeakMap(); - var setImmediate; - if (/Trident|Edge/.test(navigator.userAgent)) { - setImmediate = setTimeout; - } else if (window.setImmediate) { - setImmediate = window.setImmediate; - } else { - var setImmediateQueue = []; - var sentinel = String(Math.random()); - window.addEventListener("message", function(e) { - if (e.data === sentinel) { - var queue = setImmediateQueue; - setImmediateQueue = []; - queue.forEach(function(func) { - func(); - }); - } - }); - setImmediate = function(func) { - setImmediateQueue.push(func); - window.postMessage(sentinel, "*"); - }; - } - var isScheduled = false; - var scheduledObservers = []; - function scheduleCallback(observer) { - scheduledObservers.push(observer); - if (!isScheduled) { - isScheduled = true; - setImmediate(dispatchCallbacks); - } - } - function wrapIfNeeded(node) { - return window.ShadowDOMPolyfill && window.ShadowDOMPolyfill.wrapIfNeeded(node) || node; - } - function dispatchCallbacks() { - isScheduled = false; - var observers = scheduledObservers; - scheduledObservers = []; - observers.sort(function(o1, o2) { - return o1.uid_ - o2.uid_; - }); - var anyNonEmpty = false; - observers.forEach(function(observer) { - var queue = observer.takeRecords(); - removeTransientObserversFor(observer); - if (queue.length) { - observer.callback_(queue, observer); - anyNonEmpty = true; - } - }); - if (anyNonEmpty) dispatchCallbacks(); - } - function removeTransientObserversFor(observer) { - observer.nodes_.forEach(function(node) { - var registrations = registrationsTable.get(node); - if (!registrations) return; - registrations.forEach(function(registration) { - if (registration.observer === observer) registration.removeTransientObservers(); - }); - }); - } - function forEachAncestorAndObserverEnqueueRecord(target, callback) { - for (var node = target; node; node = node.parentNode) { - var registrations = registrationsTable.get(node); - if (registrations) { - for (var j = 0; j < registrations.length; j++) { - var registration = registrations[j]; - var options = registration.options; - if (node !== target && !options.subtree) continue; - var record = callback(options); - if (record) registration.enqueue(record); - } - } - } - } - var uidCounter = 0; - function JsMutationObserver(callback) { - this.callback_ = callback; - this.nodes_ = []; - this.records_ = []; - this.uid_ = ++uidCounter; - } - JsMutationObserver.prototype = { - observe: function(target, options) { - target = wrapIfNeeded(target); - if (!options.childList && !options.attributes && !options.characterData || options.attributeOldValue && !options.attributes || options.attributeFilter && options.attributeFilter.length && !options.attributes || options.characterDataOldValue && !options.characterData) { - throw new SyntaxError(); - } - var registrations = registrationsTable.get(target); - if (!registrations) registrationsTable.set(target, registrations = []); - var registration; - for (var i = 0; i < registrations.length; i++) { - if (registrations[i].observer === this) { - registration = registrations[i]; - registration.removeListeners(); - registration.options = options; - break; - } - } - if (!registration) { - registration = new Registration(this, target, options); - registrations.push(registration); - this.nodes_.push(target); - } - registration.addListeners(); - }, - disconnect: function() { - this.nodes_.forEach(function(node) { - var registrations = registrationsTable.get(node); - for (var i = 0; i < registrations.length; i++) { - var registration = registrations[i]; - if (registration.observer === this) { - registration.removeListeners(); - registrations.splice(i, 1); - break; - } - } - }, this); - this.records_ = []; - }, - takeRecords: function() { - var copyOfRecords = this.records_; - this.records_ = []; - return copyOfRecords; - } - }; - function MutationRecord(type, target) { - this.type = type; - this.target = target; - this.addedNodes = []; - this.removedNodes = []; - this.previousSibling = null; - this.nextSibling = null; - this.attributeName = null; - this.attributeNamespace = null; - this.oldValue = null; - } - function copyMutationRecord(original) { - var record = new MutationRecord(original.type, original.target); - record.addedNodes = original.addedNodes.slice(); - record.removedNodes = original.removedNodes.slice(); - record.previousSibling = original.previousSibling; - record.nextSibling = original.nextSibling; - record.attributeName = original.attributeName; - record.attributeNamespace = original.attributeNamespace; - record.oldValue = original.oldValue; - return record; - } - var currentRecord, recordWithOldValue; - function getRecord(type, target) { - return currentRecord = new MutationRecord(type, target); - } - function getRecordWithOldValue(oldValue) { - if (recordWithOldValue) return recordWithOldValue; - recordWithOldValue = copyMutationRecord(currentRecord); - recordWithOldValue.oldValue = oldValue; - return recordWithOldValue; - } - function clearRecords() { - currentRecord = recordWithOldValue = undefined; - } - function recordRepresentsCurrentMutation(record) { - return record === recordWithOldValue || record === currentRecord; - } - function selectRecord(lastRecord, newRecord) { - if (lastRecord === newRecord) return lastRecord; - if (recordWithOldValue && recordRepresentsCurrentMutation(lastRecord)) return recordWithOldValue; - return null; - } - function Registration(observer, target, options) { - this.observer = observer; - this.target = target; - this.options = options; - this.transientObservedNodes = []; - } - Registration.prototype = { - enqueue: function(record) { - var records = this.observer.records_; - var length = records.length; - if (records.length > 0) { - var lastRecord = records[length - 1]; - var recordToReplaceLast = selectRecord(lastRecord, record); - if (recordToReplaceLast) { - records[length - 1] = recordToReplaceLast; - return; - } - } else { - scheduleCallback(this.observer); - } - records[length] = record; - }, - addListeners: function() { - this.addListeners_(this.target); - }, - addListeners_: function(node) { - var options = this.options; - if (options.attributes) node.addEventListener("DOMAttrModified", this, true); - if (options.characterData) node.addEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.addEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.addEventListener("DOMNodeRemoved", this, true); - }, - removeListeners: function() { - this.removeListeners_(this.target); - }, - removeListeners_: function(node) { - var options = this.options; - if (options.attributes) node.removeEventListener("DOMAttrModified", this, true); - if (options.characterData) node.removeEventListener("DOMCharacterDataModified", this, true); - if (options.childList) node.removeEventListener("DOMNodeInserted", this, true); - if (options.childList || options.subtree) node.removeEventListener("DOMNodeRemoved", this, true); - }, - addTransientObserver: function(node) { - if (node === this.target) return; - this.addListeners_(node); - this.transientObservedNodes.push(node); - var registrations = registrationsTable.get(node); - if (!registrations) registrationsTable.set(node, registrations = []); - registrations.push(this); - }, - removeTransientObservers: function() { - var transientObservedNodes = this.transientObservedNodes; - this.transientObservedNodes = []; - transientObservedNodes.forEach(function(node) { - this.removeListeners_(node); - var registrations = registrationsTable.get(node); - for (var i = 0; i < registrations.length; i++) { - if (registrations[i] === this) { - registrations.splice(i, 1); - break; - } - } - }, this); - }, - handleEvent: function(e) { - e.stopImmediatePropagation(); - switch (e.type) { - case "DOMAttrModified": - var name = e.attrName; - var namespace = e.relatedNode.namespaceURI; - var target = e.target; - var record = new getRecord("attributes", target); - record.attributeName = name; - record.attributeNamespace = namespace; - var oldValue = e.attrChange === MutationEvent.ADDITION ? null : e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.attributes) return; - if (options.attributeFilter && options.attributeFilter.length && options.attributeFilter.indexOf(name) === -1 && options.attributeFilter.indexOf(namespace) === -1) { - return; - } - if (options.attributeOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMCharacterDataModified": - var target = e.target; - var record = getRecord("characterData", target); - var oldValue = e.prevValue; - forEachAncestorAndObserverEnqueueRecord(target, function(options) { - if (!options.characterData) return; - if (options.characterDataOldValue) return getRecordWithOldValue(oldValue); - return record; - }); - break; - - case "DOMNodeRemoved": - this.addTransientObserver(e.target); - - case "DOMNodeInserted": - var changedNode = e.target; - var addedNodes, removedNodes; - if (e.type === "DOMNodeInserted") { - addedNodes = [ changedNode ]; - removedNodes = []; - } else { - addedNodes = []; - removedNodes = [ changedNode ]; - } - var previousSibling = changedNode.previousSibling; - var nextSibling = changedNode.nextSibling; - var record = getRecord("childList", e.target.parentNode); - record.addedNodes = addedNodes; - record.removedNodes = removedNodes; - record.previousSibling = previousSibling; - record.nextSibling = nextSibling; - forEachAncestorAndObserverEnqueueRecord(e.relatedNode, function(options) { - if (!options.childList) return; - return record; - }); - } - clearRecords(); - } - }; - global.JsMutationObserver = JsMutationObserver; - if (!global.MutationObserver) { - global.MutationObserver = JsMutationObserver; - JsMutationObserver._isPolyfilled = true; - } -})(self); \ No newline at end of file diff --git a/lib/admin/public/bower_components/webcomponentsjs/MutationObserver.min.js b/lib/admin/public/bower_components/webcomponentsjs/MutationObserver.min.js deleted file mode 100644 index 267b374e..00000000 --- a/lib/admin/public/bower_components/webcomponentsjs/MutationObserver.min.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @license - * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -// @version 0.7.22 -"undefined"==typeof WeakMap&&!function(){var e=Object.defineProperty,t=Date.now()%1e9,r=function(){this.name="__st"+(1e9*Math.random()>>>0)+(t++ +"__")};r.prototype={set:function(t,r){var i=t[this.name];return i&&i[0]===t?i[1]=r:e(t,this.name,{value:[t,r],writable:!0}),this},get:function(e){var t;return(t=e[this.name])&&t[0]===e?t[1]:void 0},"delete":function(e){var t=e[this.name];return t&&t[0]===e?(t[0]=t[1]=void 0,!0):!1},has:function(e){var t=e[this.name];return t?t[0]===e:!1}},window.WeakMap=r}(),function(e){function t(e){N.push(e),O||(O=!0,b(i))}function r(e){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(e)||e}function i(){O=!1;var e=N;N=[],e.sort(function(e,t){return e.uid_-t.uid_});var t=!1;e.forEach(function(e){var r=e.takeRecords();n(e),r.length&&(e.callback_(r,e),t=!0)}),t&&i()}function n(e){e.nodes_.forEach(function(t){var r=p.get(t);r&&r.forEach(function(t){t.observer===e&&t.removeTransientObservers()})})}function a(e,t){for(var r=e;r;r=r.parentNode){var i=p.get(r);if(i)for(var n=0;n0){var n=r[i-1],a=l(n,e);if(a)return void(r[i-1]=a)}else t(this.observer);r[i]=e},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(e){var t=this.options;t.attributes&&e.addEventListener("DOMAttrModified",this,!0),t.characterData&&e.addEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.addEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(e){var t=this.options;t.attributes&&e.removeEventListener("DOMAttrModified",this,!0),t.characterData&&e.removeEventListener("DOMCharacterDataModified",this,!0),t.childList&&e.removeEventListener("DOMNodeInserted",this,!0),(t.childList||t.subtree)&&e.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(e){if(e!==this.target){this.addListeners_(e),this.transientObservedNodes.push(e);var t=p.get(e);t||p.set(e,t=[]),t.push(this)}},removeTransientObservers:function(){var e=this.transientObservedNodes;this.transientObservedNodes=[],e.forEach(function(e){this.removeListeners_(e);for(var t=p.get(e),r=0;r` tags in the main document block the loading of such imports. This is to ensure the imports have loaded and any registered elements in them have been upgraded. - -The webcomponents.js and webcomponents-lite.js polyfills parse element definitions and handle their upgrade asynchronously. If prematurely fetching the element from the DOM before it has an opportunity to upgrade, you'll be working with an `HTMLUnknownElement`. - -For these situations (or when you need an approximate replacement for the Polymer 0.5 `polymer-ready` behavior), you can use the `WebComponentsReady` event as a signal before interacting with the element. The criteria for this event to fire is all Custom Elements with definitions registered by the time HTML Imports available at load time have loaded have upgraded. - -```js -window.addEventListener('WebComponentsReady', function(e) { - // imports are loaded and elements have been registered - console.log('Components are ready'); -}); -``` - -## Known Issues - - * [Limited CSS encapsulation](#encapsulation) - * [Element wrapping / unwrapping limitations](#wrapping) - * [Custom element's constructor property is unreliable](#constructor) - * [Contenteditable elements do not trigger MutationObserver](#contentedit) - * [ShadowCSS: :host-context(...):host(...) doesn't work](#hostcontext) - * [ShadowCSS: :host(.zot:not(.bar:nth-child(2))) doesn't work](#nestedparens) - * [HTML imports: document.currentScript doesn't work as expected](#currentscript) - * [execCommand isn't supported under Shadow DOM](#execcommand) - -### Limited CSS encapsulation -Under native Shadow DOM, CSS selectors cannot cross the shadow boundary. This means document level styles don't apply to shadow roots, and styles defined within a shadow root don't apply outside of that shadow root. [Several selectors](http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/) are provided to be able to deal with the shadow boundary. - -The Shadow DOM polyfill can't prevent document styles from leaking into shadow roots. It can, however, encapsulate styles within shadow roots to some extent. This behavior isn't automatically emulated by the Shadow DOM polyfill, but it can be achieved by manually using the included ShadowCSS shim: - -``` -WebComponents.ShadowCSS.shimStyling( shadowRoot, scope ); -``` - -... where `shadowRoot` is the shadow root of a DOM element, and `scope` is the name of the scope used to prefix the selectors. This removes all ` - - - - - - diff --git a/lib/admin/public/lamassu-elm.js b/lib/admin/public/lamassu-elm.js deleted file mode 100644 index 4f2a38b8..00000000 --- a/lib/admin/public/lamassu-elm.js +++ /dev/null @@ -1,13319 +0,0 @@ - -(function() { -'use strict'; - -function F2(fun) -{ - function wrapper(a) { return function(b) { return fun(a,b); }; } - wrapper.arity = 2; - wrapper.func = fun; - return wrapper; -} - -function F3(fun) -{ - function wrapper(a) { - return function(b) { return function(c) { return fun(a, b, c); }; }; - } - wrapper.arity = 3; - wrapper.func = fun; - return wrapper; -} - -function F4(fun) -{ - function wrapper(a) { return function(b) { return function(c) { - return function(d) { return fun(a, b, c, d); }; }; }; - } - wrapper.arity = 4; - wrapper.func = fun; - return wrapper; -} - -function F5(fun) -{ - function wrapper(a) { return function(b) { return function(c) { - return function(d) { return function(e) { return fun(a, b, c, d, e); }; }; }; }; - } - wrapper.arity = 5; - wrapper.func = fun; - return wrapper; -} - -function F6(fun) -{ - function wrapper(a) { return function(b) { return function(c) { - return function(d) { return function(e) { return function(f) { - return fun(a, b, c, d, e, f); }; }; }; }; }; - } - wrapper.arity = 6; - wrapper.func = fun; - return wrapper; -} - -function F7(fun) -{ - function wrapper(a) { return function(b) { return function(c) { - return function(d) { return function(e) { return function(f) { - return function(g) { return fun(a, b, c, d, e, f, g); }; }; }; }; }; }; - } - wrapper.arity = 7; - wrapper.func = fun; - return wrapper; -} - -function F8(fun) -{ - function wrapper(a) { return function(b) { return function(c) { - return function(d) { return function(e) { return function(f) { - return function(g) { return function(h) { - return fun(a, b, c, d, e, f, g, h); }; }; }; }; }; }; }; - } - wrapper.arity = 8; - wrapper.func = fun; - return wrapper; -} - -function F9(fun) -{ - function wrapper(a) { return function(b) { return function(c) { - return function(d) { return function(e) { return function(f) { - return function(g) { return function(h) { return function(i) { - return fun(a, b, c, d, e, f, g, h, i); }; }; }; }; }; }; }; }; - } - wrapper.arity = 9; - wrapper.func = fun; - return wrapper; -} - -function A2(fun, a, b) -{ - return fun.arity === 2 - ? fun.func(a, b) - : fun(a)(b); -} -function A3(fun, a, b, c) -{ - return fun.arity === 3 - ? fun.func(a, b, c) - : fun(a)(b)(c); -} -function A4(fun, a, b, c, d) -{ - return fun.arity === 4 - ? fun.func(a, b, c, d) - : fun(a)(b)(c)(d); -} -function A5(fun, a, b, c, d, e) -{ - return fun.arity === 5 - ? fun.func(a, b, c, d, e) - : fun(a)(b)(c)(d)(e); -} -function A6(fun, a, b, c, d, e, f) -{ - return fun.arity === 6 - ? fun.func(a, b, c, d, e, f) - : fun(a)(b)(c)(d)(e)(f); -} -function A7(fun, a, b, c, d, e, f, g) -{ - return fun.arity === 7 - ? fun.func(a, b, c, d, e, f, g) - : fun(a)(b)(c)(d)(e)(f)(g); -} -function A8(fun, a, b, c, d, e, f, g, h) -{ - return fun.arity === 8 - ? fun.func(a, b, c, d, e, f, g, h) - : fun(a)(b)(c)(d)(e)(f)(g)(h); -} -function A9(fun, a, b, c, d, e, f, g, h, i) -{ - return fun.arity === 9 - ? fun.func(a, b, c, d, e, f, g, h, i) - : fun(a)(b)(c)(d)(e)(f)(g)(h)(i); -} - -//import Native.List // - -var _elm_lang$core$Native_Array = function() { - -// A RRB-Tree has two distinct data types. -// Leaf -> "height" is always 0 -// "table" is an array of elements -// Node -> "height" is always greater than 0 -// "table" is an array of child nodes -// "lengths" is an array of accumulated lengths of the child nodes - -// M is the maximal table size. 32 seems fast. E is the allowed increase -// of search steps when concatting to find an index. Lower values will -// decrease balancing, but will increase search steps. -var M = 32; -var E = 2; - -// An empty array. -var empty = { - ctor: '_Array', - height: 0, - table: [] -}; - - -function get(i, array) -{ - if (i < 0 || i >= length(array)) - { - throw new Error( - 'Index ' + i + ' is out of range. Check the length of ' + - 'your array first or use getMaybe or getWithDefault.'); - } - return unsafeGet(i, array); -} - - -function unsafeGet(i, array) -{ - for (var x = array.height; x > 0; x--) - { - var slot = i >> (x * 5); - while (array.lengths[slot] <= i) - { - slot++; - } - if (slot > 0) - { - i -= array.lengths[slot - 1]; - } - array = array.table[slot]; - } - return array.table[i]; -} - - -// Sets the value at the index i. Only the nodes leading to i will get -// copied and updated. -function set(i, item, array) -{ - if (i < 0 || length(array) <= i) - { - return array; - } - return unsafeSet(i, item, array); -} - - -function unsafeSet(i, item, array) -{ - array = nodeCopy(array); - - if (array.height === 0) - { - array.table[i] = item; - } - else - { - var slot = getSlot(i, array); - if (slot > 0) - { - i -= array.lengths[slot - 1]; - } - array.table[slot] = unsafeSet(i, item, array.table[slot]); - } - return array; -} - - -function initialize(len, f) -{ - if (len <= 0) - { - return empty; - } - var h = Math.floor( Math.log(len) / Math.log(M) ); - return initialize_(f, h, 0, len); -} - -function initialize_(f, h, from, to) -{ - if (h === 0) - { - var table = new Array((to - from) % (M + 1)); - for (var i = 0; i < table.length; i++) - { - table[i] = f(from + i); - } - return { - ctor: '_Array', - height: 0, - table: table - }; - } - - var step = Math.pow(M, h); - var table = new Array(Math.ceil((to - from) / step)); - var lengths = new Array(table.length); - for (var i = 0; i < table.length; i++) - { - table[i] = initialize_(f, h - 1, from + (i * step), Math.min(from + ((i + 1) * step), to)); - lengths[i] = length(table[i]) + (i > 0 ? lengths[i-1] : 0); - } - return { - ctor: '_Array', - height: h, - table: table, - lengths: lengths - }; -} - -function fromList(list) -{ - if (list.ctor === '[]') - { - return empty; - } - - // Allocate M sized blocks (table) and write list elements to it. - var table = new Array(M); - var nodes = []; - var i = 0; - - while (list.ctor !== '[]') - { - table[i] = list._0; - list = list._1; - i++; - - // table is full, so we can push a leaf containing it into the - // next node. - if (i === M) - { - var leaf = { - ctor: '_Array', - height: 0, - table: table - }; - fromListPush(leaf, nodes); - table = new Array(M); - i = 0; - } - } - - // Maybe there is something left on the table. - if (i > 0) - { - var leaf = { - ctor: '_Array', - height: 0, - table: table.splice(0, i) - }; - fromListPush(leaf, nodes); - } - - // Go through all of the nodes and eventually push them into higher nodes. - for (var h = 0; h < nodes.length - 1; h++) - { - if (nodes[h].table.length > 0) - { - fromListPush(nodes[h], nodes); - } - } - - var head = nodes[nodes.length - 1]; - if (head.height > 0 && head.table.length === 1) - { - return head.table[0]; - } - else - { - return head; - } -} - -// Push a node into a higher node as a child. -function fromListPush(toPush, nodes) -{ - var h = toPush.height; - - // Maybe the node on this height does not exist. - if (nodes.length === h) - { - var node = { - ctor: '_Array', - height: h + 1, - table: [], - lengths: [] - }; - nodes.push(node); - } - - nodes[h].table.push(toPush); - var len = length(toPush); - if (nodes[h].lengths.length > 0) - { - len += nodes[h].lengths[nodes[h].lengths.length - 1]; - } - nodes[h].lengths.push(len); - - if (nodes[h].table.length === M) - { - fromListPush(nodes[h], nodes); - nodes[h] = { - ctor: '_Array', - height: h + 1, - table: [], - lengths: [] - }; - } -} - -// Pushes an item via push_ to the bottom right of a tree. -function push(item, a) -{ - var pushed = push_(item, a); - if (pushed !== null) - { - return pushed; - } - - var newTree = create(item, a.height); - return siblise(a, newTree); -} - -// Recursively tries to push an item to the bottom-right most -// tree possible. If there is no space left for the item, -// null will be returned. -function push_(item, a) -{ - // Handle resursion stop at leaf level. - if (a.height === 0) - { - if (a.table.length < M) - { - var newA = { - ctor: '_Array', - height: 0, - table: a.table.slice() - }; - newA.table.push(item); - return newA; - } - else - { - return null; - } - } - - // Recursively push - var pushed = push_(item, botRight(a)); - - // There was space in the bottom right tree, so the slot will - // be updated. - if (pushed !== null) - { - var newA = nodeCopy(a); - newA.table[newA.table.length - 1] = pushed; - newA.lengths[newA.lengths.length - 1]++; - return newA; - } - - // When there was no space left, check if there is space left - // for a new slot with a tree which contains only the item - // at the bottom. - if (a.table.length < M) - { - var newSlot = create(item, a.height - 1); - var newA = nodeCopy(a); - newA.table.push(newSlot); - newA.lengths.push(newA.lengths[newA.lengths.length - 1] + length(newSlot)); - return newA; - } - else - { - return null; - } -} - -// Converts an array into a list of elements. -function toList(a) -{ - return toList_(_elm_lang$core$Native_List.Nil, a); -} - -function toList_(list, a) -{ - for (var i = a.table.length - 1; i >= 0; i--) - { - list = - a.height === 0 - ? _elm_lang$core$Native_List.Cons(a.table[i], list) - : toList_(list, a.table[i]); - } - return list; -} - -// Maps a function over the elements of an array. -function map(f, a) -{ - var newA = { - ctor: '_Array', - height: a.height, - table: new Array(a.table.length) - }; - if (a.height > 0) - { - newA.lengths = a.lengths; - } - for (var i = 0; i < a.table.length; i++) - { - newA.table[i] = - a.height === 0 - ? f(a.table[i]) - : map(f, a.table[i]); - } - return newA; -} - -// Maps a function over the elements with their index as first argument. -function indexedMap(f, a) -{ - return indexedMap_(f, a, 0); -} - -function indexedMap_(f, a, from) -{ - var newA = { - ctor: '_Array', - height: a.height, - table: new Array(a.table.length) - }; - if (a.height > 0) - { - newA.lengths = a.lengths; - } - for (var i = 0; i < a.table.length; i++) - { - newA.table[i] = - a.height === 0 - ? A2(f, from + i, a.table[i]) - : indexedMap_(f, a.table[i], i == 0 ? from : from + a.lengths[i - 1]); - } - return newA; -} - -function foldl(f, b, a) -{ - if (a.height === 0) - { - for (var i = 0; i < a.table.length; i++) - { - b = A2(f, a.table[i], b); - } - } - else - { - for (var i = 0; i < a.table.length; i++) - { - b = foldl(f, b, a.table[i]); - } - } - return b; -} - -function foldr(f, b, a) -{ - if (a.height === 0) - { - for (var i = a.table.length; i--; ) - { - b = A2(f, a.table[i], b); - } - } - else - { - for (var i = a.table.length; i--; ) - { - b = foldr(f, b, a.table[i]); - } - } - return b; -} - -// TODO: currently, it slices the right, then the left. This can be -// optimized. -function slice(from, to, a) -{ - if (from < 0) - { - from += length(a); - } - if (to < 0) - { - to += length(a); - } - return sliceLeft(from, sliceRight(to, a)); -} - -function sliceRight(to, a) -{ - if (to === length(a)) - { - return a; - } - - // Handle leaf level. - if (a.height === 0) - { - var newA = { ctor:'_Array', height:0 }; - newA.table = a.table.slice(0, to); - return newA; - } - - // Slice the right recursively. - var right = getSlot(to, a); - var sliced = sliceRight(to - (right > 0 ? a.lengths[right - 1] : 0), a.table[right]); - - // Maybe the a node is not even needed, as sliced contains the whole slice. - if (right === 0) - { - return sliced; - } - - // Create new node. - var newA = { - ctor: '_Array', - height: a.height, - table: a.table.slice(0, right), - lengths: a.lengths.slice(0, right) - }; - if (sliced.table.length > 0) - { - newA.table[right] = sliced; - newA.lengths[right] = length(sliced) + (right > 0 ? newA.lengths[right - 1] : 0); - } - return newA; -} - -function sliceLeft(from, a) -{ - if (from === 0) - { - return a; - } - - // Handle leaf level. - if (a.height === 0) - { - var newA = { ctor:'_Array', height:0 }; - newA.table = a.table.slice(from, a.table.length + 1); - return newA; - } - - // Slice the left recursively. - var left = getSlot(from, a); - var sliced = sliceLeft(from - (left > 0 ? a.lengths[left - 1] : 0), a.table[left]); - - // Maybe the a node is not even needed, as sliced contains the whole slice. - if (left === a.table.length - 1) - { - return sliced; - } - - // Create new node. - var newA = { - ctor: '_Array', - height: a.height, - table: a.table.slice(left, a.table.length + 1), - lengths: new Array(a.table.length - left) - }; - newA.table[0] = sliced; - var len = 0; - for (var i = 0; i < newA.table.length; i++) - { - len += length(newA.table[i]); - newA.lengths[i] = len; - } - - return newA; -} - -// Appends two trees. -function append(a,b) -{ - if (a.table.length === 0) - { - return b; - } - if (b.table.length === 0) - { - return a; - } - - var c = append_(a, b); - - // Check if both nodes can be crunshed together. - if (c[0].table.length + c[1].table.length <= M) - { - if (c[0].table.length === 0) - { - return c[1]; - } - if (c[1].table.length === 0) - { - return c[0]; - } - - // Adjust .table and .lengths - c[0].table = c[0].table.concat(c[1].table); - if (c[0].height > 0) - { - var len = length(c[0]); - for (var i = 0; i < c[1].lengths.length; i++) - { - c[1].lengths[i] += len; - } - c[0].lengths = c[0].lengths.concat(c[1].lengths); - } - - return c[0]; - } - - if (c[0].height > 0) - { - var toRemove = calcToRemove(a, b); - if (toRemove > E) - { - c = shuffle(c[0], c[1], toRemove); - } - } - - return siblise(c[0], c[1]); -} - -// Returns an array of two nodes; right and left. One node _may_ be empty. -function append_(a, b) -{ - if (a.height === 0 && b.height === 0) - { - return [a, b]; - } - - if (a.height !== 1 || b.height !== 1) - { - if (a.height === b.height) - { - a = nodeCopy(a); - b = nodeCopy(b); - var appended = append_(botRight(a), botLeft(b)); - - insertRight(a, appended[1]); - insertLeft(b, appended[0]); - } - else if (a.height > b.height) - { - a = nodeCopy(a); - var appended = append_(botRight(a), b); - - insertRight(a, appended[0]); - b = parentise(appended[1], appended[1].height + 1); - } - else - { - b = nodeCopy(b); - var appended = append_(a, botLeft(b)); - - var left = appended[0].table.length === 0 ? 0 : 1; - var right = left === 0 ? 1 : 0; - insertLeft(b, appended[left]); - a = parentise(appended[right], appended[right].height + 1); - } - } - - // Check if balancing is needed and return based on that. - if (a.table.length === 0 || b.table.length === 0) - { - return [a, b]; - } - - var toRemove = calcToRemove(a, b); - if (toRemove <= E) - { - return [a, b]; - } - return shuffle(a, b, toRemove); -} - -// Helperfunctions for append_. Replaces a child node at the side of the parent. -function insertRight(parent, node) -{ - var index = parent.table.length - 1; - parent.table[index] = node; - parent.lengths[index] = length(node); - parent.lengths[index] += index > 0 ? parent.lengths[index - 1] : 0; -} - -function insertLeft(parent, node) -{ - if (node.table.length > 0) - { - parent.table[0] = node; - parent.lengths[0] = length(node); - - var len = length(parent.table[0]); - for (var i = 1; i < parent.lengths.length; i++) - { - len += length(parent.table[i]); - parent.lengths[i] = len; - } - } - else - { - parent.table.shift(); - for (var i = 1; i < parent.lengths.length; i++) - { - parent.lengths[i] = parent.lengths[i] - parent.lengths[0]; - } - parent.lengths.shift(); - } -} - -// Returns the extra search steps for E. Refer to the paper. -function calcToRemove(a, b) -{ - var subLengths = 0; - for (var i = 0; i < a.table.length; i++) - { - subLengths += a.table[i].table.length; - } - for (var i = 0; i < b.table.length; i++) - { - subLengths += b.table[i].table.length; - } - - var toRemove = a.table.length + b.table.length; - return toRemove - (Math.floor((subLengths - 1) / M) + 1); -} - -// get2, set2 and saveSlot are helpers for accessing elements over two arrays. -function get2(a, b, index) -{ - return index < a.length - ? a[index] - : b[index - a.length]; -} - -function set2(a, b, index, value) -{ - if (index < a.length) - { - a[index] = value; - } - else - { - b[index - a.length] = value; - } -} - -function saveSlot(a, b, index, slot) -{ - set2(a.table, b.table, index, slot); - - var l = (index === 0 || index === a.lengths.length) - ? 0 - : get2(a.lengths, a.lengths, index - 1); - - set2(a.lengths, b.lengths, index, l + length(slot)); -} - -// Creates a node or leaf with a given length at their arrays for perfomance. -// Is only used by shuffle. -function createNode(h, length) -{ - if (length < 0) - { - length = 0; - } - var a = { - ctor: '_Array', - height: h, - table: new Array(length) - }; - if (h > 0) - { - a.lengths = new Array(length); - } - return a; -} - -// Returns an array of two balanced nodes. -function shuffle(a, b, toRemove) -{ - var newA = createNode(a.height, Math.min(M, a.table.length + b.table.length - toRemove)); - var newB = createNode(a.height, newA.table.length - (a.table.length + b.table.length - toRemove)); - - // Skip the slots with size M. More precise: copy the slot references - // to the new node - var read = 0; - while (get2(a.table, b.table, read).table.length % M === 0) - { - set2(newA.table, newB.table, read, get2(a.table, b.table, read)); - set2(newA.lengths, newB.lengths, read, get2(a.lengths, b.lengths, read)); - read++; - } - - // Pulling items from left to right, caching in a slot before writing - // it into the new nodes. - var write = read; - var slot = new createNode(a.height - 1, 0); - var from = 0; - - // If the current slot is still containing data, then there will be at - // least one more write, so we do not break this loop yet. - while (read - write - (slot.table.length > 0 ? 1 : 0) < toRemove) - { - // Find out the max possible items for copying. - var source = get2(a.table, b.table, read); - var to = Math.min(M - slot.table.length, source.table.length); - - // Copy and adjust size table. - slot.table = slot.table.concat(source.table.slice(from, to)); - if (slot.height > 0) - { - var len = slot.lengths.length; - for (var i = len; i < len + to - from; i++) - { - slot.lengths[i] = length(slot.table[i]); - slot.lengths[i] += (i > 0 ? slot.lengths[i - 1] : 0); - } - } - - from += to; - - // Only proceed to next slots[i] if the current one was - // fully copied. - if (source.table.length <= to) - { - read++; from = 0; - } - - // Only create a new slot if the current one is filled up. - if (slot.table.length === M) - { - saveSlot(newA, newB, write, slot); - slot = createNode(a.height - 1, 0); - write++; - } - } - - // Cleanup after the loop. Copy the last slot into the new nodes. - if (slot.table.length > 0) - { - saveSlot(newA, newB, write, slot); - write++; - } - - // Shift the untouched slots to the left - while (read < a.table.length + b.table.length ) - { - saveSlot(newA, newB, write, get2(a.table, b.table, read)); - read++; - write++; - } - - return [newA, newB]; -} - -// Navigation functions -function botRight(a) -{ - return a.table[a.table.length - 1]; -} -function botLeft(a) -{ - return a.table[0]; -} - -// Copies a node for updating. Note that you should not use this if -// only updating only one of "table" or "lengths" for performance reasons. -function nodeCopy(a) -{ - var newA = { - ctor: '_Array', - height: a.height, - table: a.table.slice() - }; - if (a.height > 0) - { - newA.lengths = a.lengths.slice(); - } - return newA; -} - -// Returns how many items are in the tree. -function length(array) -{ - if (array.height === 0) - { - return array.table.length; - } - else - { - return array.lengths[array.lengths.length - 1]; - } -} - -// Calculates in which slot of "table" the item probably is, then -// find the exact slot via forward searching in "lengths". Returns the index. -function getSlot(i, a) -{ - var slot = i >> (5 * a.height); - while (a.lengths[slot] <= i) - { - slot++; - } - return slot; -} - -// Recursively creates a tree with a given height containing -// only the given item. -function create(item, h) -{ - if (h === 0) - { - return { - ctor: '_Array', - height: 0, - table: [item] - }; - } - return { - ctor: '_Array', - height: h, - table: [create(item, h - 1)], - lengths: [1] - }; -} - -// Recursively creates a tree that contains the given tree. -function parentise(tree, h) -{ - if (h === tree.height) - { - return tree; - } - - return { - ctor: '_Array', - height: h, - table: [parentise(tree, h - 1)], - lengths: [length(tree)] - }; -} - -// Emphasizes blood brotherhood beneath two trees. -function siblise(a, b) -{ - return { - ctor: '_Array', - height: a.height + 1, - table: [a, b], - lengths: [length(a), length(a) + length(b)] - }; -} - -function toJSArray(a) -{ - var jsArray = new Array(length(a)); - toJSArray_(jsArray, 0, a); - return jsArray; -} - -function toJSArray_(jsArray, i, a) -{ - for (var t = 0; t < a.table.length; t++) - { - if (a.height === 0) - { - jsArray[i + t] = a.table[t]; - } - else - { - var inc = t === 0 ? 0 : a.lengths[t - 1]; - toJSArray_(jsArray, i + inc, a.table[t]); - } - } -} - -function fromJSArray(jsArray) -{ - if (jsArray.length === 0) - { - return empty; - } - var h = Math.floor(Math.log(jsArray.length) / Math.log(M)); - return fromJSArray_(jsArray, h, 0, jsArray.length); -} - -function fromJSArray_(jsArray, h, from, to) -{ - if (h === 0) - { - return { - ctor: '_Array', - height: 0, - table: jsArray.slice(from, to) - }; - } - - var step = Math.pow(M, h); - var table = new Array(Math.ceil((to - from) / step)); - var lengths = new Array(table.length); - for (var i = 0; i < table.length; i++) - { - table[i] = fromJSArray_(jsArray, h - 1, from + (i * step), Math.min(from + ((i + 1) * step), to)); - lengths[i] = length(table[i]) + (i > 0 ? lengths[i - 1] : 0); - } - return { - ctor: '_Array', - height: h, - table: table, - lengths: lengths - }; -} - -return { - empty: empty, - fromList: fromList, - toList: toList, - initialize: F2(initialize), - append: F2(append), - push: F2(push), - slice: F3(slice), - get: F2(get), - set: F3(set), - map: F2(map), - indexedMap: F2(indexedMap), - foldl: F3(foldl), - foldr: F3(foldr), - length: length, - - toJSArray: toJSArray, - fromJSArray: fromJSArray -}; - -}(); -//import Native.Utils // - -var _elm_lang$core$Native_Basics = function() { - -function div(a, b) -{ - return (a / b) | 0; -} -function rem(a, b) -{ - return a % b; -} -function mod(a, b) -{ - if (b === 0) - { - throw new Error('Cannot perform mod 0. Division by zero error.'); - } - var r = a % b; - var m = a === 0 ? 0 : (b > 0 ? (a >= 0 ? r : r + b) : -mod(-a, -b)); - - return m === b ? 0 : m; -} -function logBase(base, n) -{ - return Math.log(n) / Math.log(base); -} -function negate(n) -{ - return -n; -} -function abs(n) -{ - return n < 0 ? -n : n; -} - -function min(a, b) -{ - return _elm_lang$core$Native_Utils.cmp(a, b) < 0 ? a : b; -} -function max(a, b) -{ - return _elm_lang$core$Native_Utils.cmp(a, b) > 0 ? a : b; -} -function clamp(lo, hi, n) -{ - return _elm_lang$core$Native_Utils.cmp(n, lo) < 0 - ? lo - : _elm_lang$core$Native_Utils.cmp(n, hi) > 0 - ? hi - : n; -} - -var ord = ['LT', 'EQ', 'GT']; - -function compare(x, y) -{ - return { ctor: ord[_elm_lang$core$Native_Utils.cmp(x, y) + 1] }; -} - -function xor(a, b) -{ - return a !== b; -} -function not(b) -{ - return !b; -} -function isInfinite(n) -{ - return n === Infinity || n === -Infinity; -} - -function truncate(n) -{ - return n | 0; -} - -function degrees(d) -{ - return d * Math.PI / 180; -} -function turns(t) -{ - return 2 * Math.PI * t; -} -function fromPolar(point) -{ - var r = point._0; - var t = point._1; - return _elm_lang$core$Native_Utils.Tuple2(r * Math.cos(t), r * Math.sin(t)); -} -function toPolar(point) -{ - var x = point._0; - var y = point._1; - return _elm_lang$core$Native_Utils.Tuple2(Math.sqrt(x * x + y * y), Math.atan2(y, x)); -} - -return { - div: F2(div), - rem: F2(rem), - mod: F2(mod), - - pi: Math.PI, - e: Math.E, - cos: Math.cos, - sin: Math.sin, - tan: Math.tan, - acos: Math.acos, - asin: Math.asin, - atan: Math.atan, - atan2: F2(Math.atan2), - - degrees: degrees, - turns: turns, - fromPolar: fromPolar, - toPolar: toPolar, - - sqrt: Math.sqrt, - logBase: F2(logBase), - negate: negate, - abs: abs, - min: F2(min), - max: F2(max), - clamp: F3(clamp), - compare: F2(compare), - - xor: F2(xor), - not: not, - - truncate: truncate, - ceiling: Math.ceil, - floor: Math.floor, - round: Math.round, - toFloat: function(x) { return x; }, - isNaN: isNaN, - isInfinite: isInfinite -}; - -}(); -//import // - -var _elm_lang$core$Native_Utils = function() { - -// COMPARISONS - -function eq(x, y) -{ - var stack = []; - var isEqual = eqHelp(x, y, 0, stack); - var pair; - while (isEqual && (pair = stack.pop())) - { - isEqual = eqHelp(pair.x, pair.y, 0, stack); - } - return isEqual; -} - - -function eqHelp(x, y, depth, stack) -{ - if (depth > 100) - { - stack.push({ x: x, y: y }); - return true; - } - - if (x === y) - { - return true; - } - - if (typeof x !== 'object') - { - if (typeof x === 'function') - { - throw new Error( - 'Trying to use `(==)` on functions. There is no way to know if functions are "the same" in the Elm sense.' - + ' Read more about this at http://package.elm-lang.org/packages/elm-lang/core/latest/Basics#==' - + ' which describes why it is this way and what the better version will look like.' - ); - } - return false; - } - - if (x === null || y === null) - { - return false - } - - if (x instanceof Date) - { - return x.getTime() === y.getTime(); - } - - if (!('ctor' in x)) - { - for (var key in x) - { - if (!eqHelp(x[key], y[key], depth + 1, stack)) - { - return false; - } - } - return true; - } - - // convert Dicts and Sets to lists - if (x.ctor === 'RBNode_elm_builtin' || x.ctor === 'RBEmpty_elm_builtin') - { - x = _elm_lang$core$Dict$toList(x); - y = _elm_lang$core$Dict$toList(y); - } - if (x.ctor === 'Set_elm_builtin') - { - x = _elm_lang$core$Set$toList(x); - y = _elm_lang$core$Set$toList(y); - } - - // check if lists are equal without recursion - if (x.ctor === '::') - { - var a = x; - var b = y; - while (a.ctor === '::' && b.ctor === '::') - { - if (!eqHelp(a._0, b._0, depth + 1, stack)) - { - return false; - } - a = a._1; - b = b._1; - } - return a.ctor === b.ctor; - } - - // check if Arrays are equal - if (x.ctor === '_Array') - { - var xs = _elm_lang$core$Native_Array.toJSArray(x); - var ys = _elm_lang$core$Native_Array.toJSArray(y); - if (xs.length !== ys.length) - { - return false; - } - for (var i = 0; i < xs.length; i++) - { - if (!eqHelp(xs[i], ys[i], depth + 1, stack)) - { - return false; - } - } - return true; - } - - if (!eqHelp(x.ctor, y.ctor, depth + 1, stack)) - { - return false; - } - - for (var key in x) - { - if (!eqHelp(x[key], y[key], depth + 1, stack)) - { - return false; - } - } - return true; -} - -// Code in Generate/JavaScript.hs, Basics.js, and List.js depends on -// the particular integer values assigned to LT, EQ, and GT. - -var LT = -1, EQ = 0, GT = 1; - -function cmp(x, y) -{ - if (typeof x !== 'object') - { - return x === y ? EQ : x < y ? LT : GT; - } - - if (x instanceof String) - { - var a = x.valueOf(); - var b = y.valueOf(); - return a === b ? EQ : a < b ? LT : GT; - } - - if (x.ctor === '::' || x.ctor === '[]') - { - while (x.ctor === '::' && y.ctor === '::') - { - var ord = cmp(x._0, y._0); - if (ord !== EQ) - { - return ord; - } - x = x._1; - y = y._1; - } - return x.ctor === y.ctor ? EQ : x.ctor === '[]' ? LT : GT; - } - - if (x.ctor.slice(0, 6) === '_Tuple') - { - var ord; - var n = x.ctor.slice(6) - 0; - var err = 'cannot compare tuples with more than 6 elements.'; - if (n === 0) return EQ; - if (n >= 1) { ord = cmp(x._0, y._0); if (ord !== EQ) return ord; - if (n >= 2) { ord = cmp(x._1, y._1); if (ord !== EQ) return ord; - if (n >= 3) { ord = cmp(x._2, y._2); if (ord !== EQ) return ord; - if (n >= 4) { ord = cmp(x._3, y._3); if (ord !== EQ) return ord; - if (n >= 5) { ord = cmp(x._4, y._4); if (ord !== EQ) return ord; - if (n >= 6) { ord = cmp(x._5, y._5); if (ord !== EQ) return ord; - if (n >= 7) throw new Error('Comparison error: ' + err); } } } } } } - return EQ; - } - - throw new Error( - 'Comparison error: comparison is only defined on ints, ' - + 'floats, times, chars, strings, lists of comparable values, ' - + 'and tuples of comparable values.' - ); -} - - -// COMMON VALUES - -var Tuple0 = { - ctor: '_Tuple0' -}; - -function Tuple2(x, y) -{ - return { - ctor: '_Tuple2', - _0: x, - _1: y - }; -} - -function chr(c) -{ - return new String(c); -} - - -// GUID - -var count = 0; -function guid(_) -{ - return count++; -} - - -// RECORDS - -function update(oldRecord, updatedFields) -{ - var newRecord = {}; - - for (var key in oldRecord) - { - newRecord[key] = oldRecord[key]; - } - - for (var key in updatedFields) - { - newRecord[key] = updatedFields[key]; - } - - return newRecord; -} - - -//// LIST STUFF //// - -var Nil = { ctor: '[]' }; - -function Cons(hd, tl) -{ - return { - ctor: '::', - _0: hd, - _1: tl - }; -} - -function append(xs, ys) -{ - // append Strings - if (typeof xs === 'string') - { - return xs + ys; - } - - // append Lists - if (xs.ctor === '[]') - { - return ys; - } - var root = Cons(xs._0, Nil); - var curr = root; - xs = xs._1; - while (xs.ctor !== '[]') - { - curr._1 = Cons(xs._0, Nil); - xs = xs._1; - curr = curr._1; - } - curr._1 = ys; - return root; -} - - -// CRASHES - -function crash(moduleName, region) -{ - return function(message) { - throw new Error( - 'Ran into a `Debug.crash` in module `' + moduleName + '` ' + regionToString(region) + '\n' - + 'The message provided by the code author is:\n\n ' - + message - ); - }; -} - -function crashCase(moduleName, region, value) -{ - return function(message) { - throw new Error( - 'Ran into a `Debug.crash` in module `' + moduleName + '`\n\n' - + 'This was caused by the `case` expression ' + regionToString(region) + '.\n' - + 'One of the branches ended with a crash and the following value got through:\n\n ' + toString(value) + '\n\n' - + 'The message provided by the code author is:\n\n ' - + message - ); - }; -} - -function regionToString(region) -{ - if (region.start.line == region.end.line) - { - return 'on line ' + region.start.line; - } - return 'between lines ' + region.start.line + ' and ' + region.end.line; -} - - -// TO STRING - -function toString(v) -{ - var type = typeof v; - if (type === 'function') - { - return ''; - } - - if (type === 'boolean') - { - return v ? 'True' : 'False'; - } - - if (type === 'number') - { - return v + ''; - } - - if (v instanceof String) - { - return '\'' + addSlashes(v, true) + '\''; - } - - if (type === 'string') - { - return '"' + addSlashes(v, false) + '"'; - } - - if (v === null) - { - return 'null'; - } - - if (type === 'object' && 'ctor' in v) - { - var ctorStarter = v.ctor.substring(0, 5); - - if (ctorStarter === '_Tupl') - { - var output = []; - for (var k in v) - { - if (k === 'ctor') continue; - output.push(toString(v[k])); - } - return '(' + output.join(',') + ')'; - } - - if (ctorStarter === '_Task') - { - return '' - } - - if (v.ctor === '_Array') - { - var list = _elm_lang$core$Array$toList(v); - return 'Array.fromList ' + toString(list); - } - - if (v.ctor === '') - { - return ''; - } - - if (v.ctor === '_Process') - { - return ''; - } - - if (v.ctor === '::') - { - var output = '[' + toString(v._0); - v = v._1; - while (v.ctor === '::') - { - output += ',' + toString(v._0); - v = v._1; - } - return output + ']'; - } - - if (v.ctor === '[]') - { - return '[]'; - } - - if (v.ctor === 'Set_elm_builtin') - { - return 'Set.fromList ' + toString(_elm_lang$core$Set$toList(v)); - } - - if (v.ctor === 'RBNode_elm_builtin' || v.ctor === 'RBEmpty_elm_builtin') - { - return 'Dict.fromList ' + toString(_elm_lang$core$Dict$toList(v)); - } - - var output = ''; - for (var i in v) - { - if (i === 'ctor') continue; - var str = toString(v[i]); - var c0 = str[0]; - var parenless = c0 === '{' || c0 === '(' || c0 === '<' || c0 === '"' || str.indexOf(' ') < 0; - output += ' ' + (parenless ? str : '(' + str + ')'); - } - return v.ctor + output; - } - - if (type === 'object') - { - if (v instanceof Date) - { - return '<' + v.toString() + '>'; - } - - if (v.elm_web_socket) - { - return ''; - } - - var output = []; - for (var k in v) - { - output.push(k + ' = ' + toString(v[k])); - } - if (output.length === 0) - { - return '{}'; - } - return '{ ' + output.join(', ') + ' }'; - } - - return ''; -} - -function addSlashes(str, isChar) -{ - var s = str.replace(/\\/g, '\\\\') - .replace(/\n/g, '\\n') - .replace(/\t/g, '\\t') - .replace(/\r/g, '\\r') - .replace(/\v/g, '\\v') - .replace(/\0/g, '\\0'); - if (isChar) - { - return s.replace(/\'/g, '\\\''); - } - else - { - return s.replace(/\"/g, '\\"'); - } -} - - -return { - eq: eq, - cmp: cmp, - Tuple0: Tuple0, - Tuple2: Tuple2, - chr: chr, - update: update, - guid: guid, - - append: F2(append), - - crash: crash, - crashCase: crashCase, - - toString: toString -}; - -}(); -var _elm_lang$core$Basics$never = function (_p0) { - never: - while (true) { - var _p1 = _p0; - var _v1 = _p1._0; - _p0 = _v1; - continue never; - } -}; -var _elm_lang$core$Basics$uncurry = F2( - function (f, _p2) { - var _p3 = _p2; - return A2(f, _p3._0, _p3._1); - }); -var _elm_lang$core$Basics$curry = F3( - function (f, a, b) { - return f( - {ctor: '_Tuple2', _0: a, _1: b}); - }); -var _elm_lang$core$Basics$flip = F3( - function (f, b, a) { - return A2(f, a, b); - }); -var _elm_lang$core$Basics$always = F2( - function (a, _p4) { - return a; - }); -var _elm_lang$core$Basics$identity = function (x) { - return x; -}; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['<|'] = F2( - function (f, x) { - return f(x); - }); -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['|>'] = F2( - function (x, f) { - return f(x); - }); -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['>>'] = F3( - function (f, g, x) { - return g( - f(x)); - }); -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['<<'] = F3( - function (g, f, x) { - return g( - f(x)); - }); -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['++'] = _elm_lang$core$Native_Utils.append; -var _elm_lang$core$Basics$toString = _elm_lang$core$Native_Utils.toString; -var _elm_lang$core$Basics$isInfinite = _elm_lang$core$Native_Basics.isInfinite; -var _elm_lang$core$Basics$isNaN = _elm_lang$core$Native_Basics.isNaN; -var _elm_lang$core$Basics$toFloat = _elm_lang$core$Native_Basics.toFloat; -var _elm_lang$core$Basics$ceiling = _elm_lang$core$Native_Basics.ceiling; -var _elm_lang$core$Basics$floor = _elm_lang$core$Native_Basics.floor; -var _elm_lang$core$Basics$truncate = _elm_lang$core$Native_Basics.truncate; -var _elm_lang$core$Basics$round = _elm_lang$core$Native_Basics.round; -var _elm_lang$core$Basics$not = _elm_lang$core$Native_Basics.not; -var _elm_lang$core$Basics$xor = _elm_lang$core$Native_Basics.xor; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['||'] = _elm_lang$core$Native_Basics.or; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['&&'] = _elm_lang$core$Native_Basics.and; -var _elm_lang$core$Basics$max = _elm_lang$core$Native_Basics.max; -var _elm_lang$core$Basics$min = _elm_lang$core$Native_Basics.min; -var _elm_lang$core$Basics$compare = _elm_lang$core$Native_Basics.compare; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['>='] = _elm_lang$core$Native_Basics.ge; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['<='] = _elm_lang$core$Native_Basics.le; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['>'] = _elm_lang$core$Native_Basics.gt; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['<'] = _elm_lang$core$Native_Basics.lt; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['/='] = _elm_lang$core$Native_Basics.neq; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['=='] = _elm_lang$core$Native_Basics.eq; -var _elm_lang$core$Basics$e = _elm_lang$core$Native_Basics.e; -var _elm_lang$core$Basics$pi = _elm_lang$core$Native_Basics.pi; -var _elm_lang$core$Basics$clamp = _elm_lang$core$Native_Basics.clamp; -var _elm_lang$core$Basics$logBase = _elm_lang$core$Native_Basics.logBase; -var _elm_lang$core$Basics$abs = _elm_lang$core$Native_Basics.abs; -var _elm_lang$core$Basics$negate = _elm_lang$core$Native_Basics.negate; -var _elm_lang$core$Basics$sqrt = _elm_lang$core$Native_Basics.sqrt; -var _elm_lang$core$Basics$atan2 = _elm_lang$core$Native_Basics.atan2; -var _elm_lang$core$Basics$atan = _elm_lang$core$Native_Basics.atan; -var _elm_lang$core$Basics$asin = _elm_lang$core$Native_Basics.asin; -var _elm_lang$core$Basics$acos = _elm_lang$core$Native_Basics.acos; -var _elm_lang$core$Basics$tan = _elm_lang$core$Native_Basics.tan; -var _elm_lang$core$Basics$sin = _elm_lang$core$Native_Basics.sin; -var _elm_lang$core$Basics$cos = _elm_lang$core$Native_Basics.cos; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['^'] = _elm_lang$core$Native_Basics.exp; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['%'] = _elm_lang$core$Native_Basics.mod; -var _elm_lang$core$Basics$rem = _elm_lang$core$Native_Basics.rem; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['//'] = _elm_lang$core$Native_Basics.div; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['/'] = _elm_lang$core$Native_Basics.floatDiv; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['*'] = _elm_lang$core$Native_Basics.mul; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['-'] = _elm_lang$core$Native_Basics.sub; -var _elm_lang$core$Basics_ops = _elm_lang$core$Basics_ops || {}; -_elm_lang$core$Basics_ops['+'] = _elm_lang$core$Native_Basics.add; -var _elm_lang$core$Basics$toPolar = _elm_lang$core$Native_Basics.toPolar; -var _elm_lang$core$Basics$fromPolar = _elm_lang$core$Native_Basics.fromPolar; -var _elm_lang$core$Basics$turns = _elm_lang$core$Native_Basics.turns; -var _elm_lang$core$Basics$degrees = _elm_lang$core$Native_Basics.degrees; -var _elm_lang$core$Basics$radians = function (t) { - return t; -}; -var _elm_lang$core$Basics$GT = {ctor: 'GT'}; -var _elm_lang$core$Basics$EQ = {ctor: 'EQ'}; -var _elm_lang$core$Basics$LT = {ctor: 'LT'}; -var _elm_lang$core$Basics$JustOneMore = function (a) { - return {ctor: 'JustOneMore', _0: a}; -}; - -var _elm_lang$core$Maybe$withDefault = F2( - function ($default, maybe) { - var _p0 = maybe; - if (_p0.ctor === 'Just') { - return _p0._0; - } else { - return $default; - } - }); -var _elm_lang$core$Maybe$Nothing = {ctor: 'Nothing'}; -var _elm_lang$core$Maybe$andThen = F2( - function (callback, maybeValue) { - var _p1 = maybeValue; - if (_p1.ctor === 'Just') { - return callback(_p1._0); - } else { - return _elm_lang$core$Maybe$Nothing; - } - }); -var _elm_lang$core$Maybe$Just = function (a) { - return {ctor: 'Just', _0: a}; -}; -var _elm_lang$core$Maybe$map = F2( - function (f, maybe) { - var _p2 = maybe; - if (_p2.ctor === 'Just') { - return _elm_lang$core$Maybe$Just( - f(_p2._0)); - } else { - return _elm_lang$core$Maybe$Nothing; - } - }); -var _elm_lang$core$Maybe$map2 = F3( - function (func, ma, mb) { - var _p3 = {ctor: '_Tuple2', _0: ma, _1: mb}; - if (((_p3.ctor === '_Tuple2') && (_p3._0.ctor === 'Just')) && (_p3._1.ctor === 'Just')) { - return _elm_lang$core$Maybe$Just( - A2(func, _p3._0._0, _p3._1._0)); - } else { - return _elm_lang$core$Maybe$Nothing; - } - }); -var _elm_lang$core$Maybe$map3 = F4( - function (func, ma, mb, mc) { - var _p4 = {ctor: '_Tuple3', _0: ma, _1: mb, _2: mc}; - if ((((_p4.ctor === '_Tuple3') && (_p4._0.ctor === 'Just')) && (_p4._1.ctor === 'Just')) && (_p4._2.ctor === 'Just')) { - return _elm_lang$core$Maybe$Just( - A3(func, _p4._0._0, _p4._1._0, _p4._2._0)); - } else { - return _elm_lang$core$Maybe$Nothing; - } - }); -var _elm_lang$core$Maybe$map4 = F5( - function (func, ma, mb, mc, md) { - var _p5 = {ctor: '_Tuple4', _0: ma, _1: mb, _2: mc, _3: md}; - if (((((_p5.ctor === '_Tuple4') && (_p5._0.ctor === 'Just')) && (_p5._1.ctor === 'Just')) && (_p5._2.ctor === 'Just')) && (_p5._3.ctor === 'Just')) { - return _elm_lang$core$Maybe$Just( - A4(func, _p5._0._0, _p5._1._0, _p5._2._0, _p5._3._0)); - } else { - return _elm_lang$core$Maybe$Nothing; - } - }); -var _elm_lang$core$Maybe$map5 = F6( - function (func, ma, mb, mc, md, me) { - var _p6 = {ctor: '_Tuple5', _0: ma, _1: mb, _2: mc, _3: md, _4: me}; - if ((((((_p6.ctor === '_Tuple5') && (_p6._0.ctor === 'Just')) && (_p6._1.ctor === 'Just')) && (_p6._2.ctor === 'Just')) && (_p6._3.ctor === 'Just')) && (_p6._4.ctor === 'Just')) { - return _elm_lang$core$Maybe$Just( - A5(func, _p6._0._0, _p6._1._0, _p6._2._0, _p6._3._0, _p6._4._0)); - } else { - return _elm_lang$core$Maybe$Nothing; - } - }); - -//import Native.Utils // - -var _elm_lang$core$Native_List = function() { - -var Nil = { ctor: '[]' }; - -function Cons(hd, tl) -{ - return { ctor: '::', _0: hd, _1: tl }; -} - -function fromArray(arr) -{ - var out = Nil; - for (var i = arr.length; i--; ) - { - out = Cons(arr[i], out); - } - return out; -} - -function toArray(xs) -{ - var out = []; - while (xs.ctor !== '[]') - { - out.push(xs._0); - xs = xs._1; - } - return out; -} - -function foldr(f, b, xs) -{ - var arr = toArray(xs); - var acc = b; - for (var i = arr.length; i--; ) - { - acc = A2(f, arr[i], acc); - } - return acc; -} - -function map2(f, xs, ys) -{ - var arr = []; - while (xs.ctor !== '[]' && ys.ctor !== '[]') - { - arr.push(A2(f, xs._0, ys._0)); - xs = xs._1; - ys = ys._1; - } - return fromArray(arr); -} - -function map3(f, xs, ys, zs) -{ - var arr = []; - while (xs.ctor !== '[]' && ys.ctor !== '[]' && zs.ctor !== '[]') - { - arr.push(A3(f, xs._0, ys._0, zs._0)); - xs = xs._1; - ys = ys._1; - zs = zs._1; - } - return fromArray(arr); -} - -function map4(f, ws, xs, ys, zs) -{ - var arr = []; - while ( ws.ctor !== '[]' - && xs.ctor !== '[]' - && ys.ctor !== '[]' - && zs.ctor !== '[]') - { - arr.push(A4(f, ws._0, xs._0, ys._0, zs._0)); - ws = ws._1; - xs = xs._1; - ys = ys._1; - zs = zs._1; - } - return fromArray(arr); -} - -function map5(f, vs, ws, xs, ys, zs) -{ - var arr = []; - while ( vs.ctor !== '[]' - && ws.ctor !== '[]' - && xs.ctor !== '[]' - && ys.ctor !== '[]' - && zs.ctor !== '[]') - { - arr.push(A5(f, vs._0, ws._0, xs._0, ys._0, zs._0)); - vs = vs._1; - ws = ws._1; - xs = xs._1; - ys = ys._1; - zs = zs._1; - } - return fromArray(arr); -} - -function sortBy(f, xs) -{ - return fromArray(toArray(xs).sort(function(a, b) { - return _elm_lang$core$Native_Utils.cmp(f(a), f(b)); - })); -} - -function sortWith(f, xs) -{ - return fromArray(toArray(xs).sort(function(a, b) { - var ord = f(a)(b).ctor; - return ord === 'EQ' ? 0 : ord === 'LT' ? -1 : 1; - })); -} - -return { - Nil: Nil, - Cons: Cons, - cons: F2(Cons), - toArray: toArray, - fromArray: fromArray, - - foldr: F3(foldr), - - map2: F3(map2), - map3: F4(map3), - map4: F5(map4), - map5: F6(map5), - sortBy: F2(sortBy), - sortWith: F2(sortWith) -}; - -}(); -var _elm_lang$core$List$sortWith = _elm_lang$core$Native_List.sortWith; -var _elm_lang$core$List$sortBy = _elm_lang$core$Native_List.sortBy; -var _elm_lang$core$List$sort = function (xs) { - return A2(_elm_lang$core$List$sortBy, _elm_lang$core$Basics$identity, xs); -}; -var _elm_lang$core$List$singleton = function (value) { - return { - ctor: '::', - _0: value, - _1: {ctor: '[]'} - }; -}; -var _elm_lang$core$List$drop = F2( - function (n, list) { - drop: - while (true) { - if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { - return list; - } else { - var _p0 = list; - if (_p0.ctor === '[]') { - return list; - } else { - var _v1 = n - 1, - _v2 = _p0._1; - n = _v1; - list = _v2; - continue drop; - } - } - } - }); -var _elm_lang$core$List$map5 = _elm_lang$core$Native_List.map5; -var _elm_lang$core$List$map4 = _elm_lang$core$Native_List.map4; -var _elm_lang$core$List$map3 = _elm_lang$core$Native_List.map3; -var _elm_lang$core$List$map2 = _elm_lang$core$Native_List.map2; -var _elm_lang$core$List$any = F2( - function (isOkay, list) { - any: - while (true) { - var _p1 = list; - if (_p1.ctor === '[]') { - return false; - } else { - if (isOkay(_p1._0)) { - return true; - } else { - var _v4 = isOkay, - _v5 = _p1._1; - isOkay = _v4; - list = _v5; - continue any; - } - } - } - }); -var _elm_lang$core$List$all = F2( - function (isOkay, list) { - return !A2( - _elm_lang$core$List$any, - function (_p2) { - return !isOkay(_p2); - }, - list); - }); -var _elm_lang$core$List$foldr = _elm_lang$core$Native_List.foldr; -var _elm_lang$core$List$foldl = F3( - function (func, acc, list) { - foldl: - while (true) { - var _p3 = list; - if (_p3.ctor === '[]') { - return acc; - } else { - var _v7 = func, - _v8 = A2(func, _p3._0, acc), - _v9 = _p3._1; - func = _v7; - acc = _v8; - list = _v9; - continue foldl; - } - } - }); -var _elm_lang$core$List$length = function (xs) { - return A3( - _elm_lang$core$List$foldl, - F2( - function (_p4, i) { - return i + 1; - }), - 0, - xs); -}; -var _elm_lang$core$List$sum = function (numbers) { - return A3( - _elm_lang$core$List$foldl, - F2( - function (x, y) { - return x + y; - }), - 0, - numbers); -}; -var _elm_lang$core$List$product = function (numbers) { - return A3( - _elm_lang$core$List$foldl, - F2( - function (x, y) { - return x * y; - }), - 1, - numbers); -}; -var _elm_lang$core$List$maximum = function (list) { - var _p5 = list; - if (_p5.ctor === '::') { - return _elm_lang$core$Maybe$Just( - A3(_elm_lang$core$List$foldl, _elm_lang$core$Basics$max, _p5._0, _p5._1)); - } else { - return _elm_lang$core$Maybe$Nothing; - } -}; -var _elm_lang$core$List$minimum = function (list) { - var _p6 = list; - if (_p6.ctor === '::') { - return _elm_lang$core$Maybe$Just( - A3(_elm_lang$core$List$foldl, _elm_lang$core$Basics$min, _p6._0, _p6._1)); - } else { - return _elm_lang$core$Maybe$Nothing; - } -}; -var _elm_lang$core$List$member = F2( - function (x, xs) { - return A2( - _elm_lang$core$List$any, - function (a) { - return _elm_lang$core$Native_Utils.eq(a, x); - }, - xs); - }); -var _elm_lang$core$List$isEmpty = function (xs) { - var _p7 = xs; - if (_p7.ctor === '[]') { - return true; - } else { - return false; - } -}; -var _elm_lang$core$List$tail = function (list) { - var _p8 = list; - if (_p8.ctor === '::') { - return _elm_lang$core$Maybe$Just(_p8._1); - } else { - return _elm_lang$core$Maybe$Nothing; - } -}; -var _elm_lang$core$List$head = function (list) { - var _p9 = list; - if (_p9.ctor === '::') { - return _elm_lang$core$Maybe$Just(_p9._0); - } else { - return _elm_lang$core$Maybe$Nothing; - } -}; -var _elm_lang$core$List_ops = _elm_lang$core$List_ops || {}; -_elm_lang$core$List_ops['::'] = _elm_lang$core$Native_List.cons; -var _elm_lang$core$List$map = F2( - function (f, xs) { - return A3( - _elm_lang$core$List$foldr, - F2( - function (x, acc) { - return { - ctor: '::', - _0: f(x), - _1: acc - }; - }), - {ctor: '[]'}, - xs); - }); -var _elm_lang$core$List$filter = F2( - function (pred, xs) { - var conditionalCons = F2( - function (front, back) { - return pred(front) ? {ctor: '::', _0: front, _1: back} : back; - }); - return A3( - _elm_lang$core$List$foldr, - conditionalCons, - {ctor: '[]'}, - xs); - }); -var _elm_lang$core$List$maybeCons = F3( - function (f, mx, xs) { - var _p10 = f(mx); - if (_p10.ctor === 'Just') { - return {ctor: '::', _0: _p10._0, _1: xs}; - } else { - return xs; - } - }); -var _elm_lang$core$List$filterMap = F2( - function (f, xs) { - return A3( - _elm_lang$core$List$foldr, - _elm_lang$core$List$maybeCons(f), - {ctor: '[]'}, - xs); - }); -var _elm_lang$core$List$reverse = function (list) { - return A3( - _elm_lang$core$List$foldl, - F2( - function (x, y) { - return {ctor: '::', _0: x, _1: y}; - }), - {ctor: '[]'}, - list); -}; -var _elm_lang$core$List$scanl = F3( - function (f, b, xs) { - var scan1 = F2( - function (x, accAcc) { - var _p11 = accAcc; - if (_p11.ctor === '::') { - return { - ctor: '::', - _0: A2(f, x, _p11._0), - _1: accAcc - }; - } else { - return {ctor: '[]'}; - } - }); - return _elm_lang$core$List$reverse( - A3( - _elm_lang$core$List$foldl, - scan1, - { - ctor: '::', - _0: b, - _1: {ctor: '[]'} - }, - xs)); - }); -var _elm_lang$core$List$append = F2( - function (xs, ys) { - var _p12 = ys; - if (_p12.ctor === '[]') { - return xs; - } else { - return A3( - _elm_lang$core$List$foldr, - F2( - function (x, y) { - return {ctor: '::', _0: x, _1: y}; - }), - ys, - xs); - } - }); -var _elm_lang$core$List$concat = function (lists) { - return A3( - _elm_lang$core$List$foldr, - _elm_lang$core$List$append, - {ctor: '[]'}, - lists); -}; -var _elm_lang$core$List$concatMap = F2( - function (f, list) { - return _elm_lang$core$List$concat( - A2(_elm_lang$core$List$map, f, list)); - }); -var _elm_lang$core$List$partition = F2( - function (pred, list) { - var step = F2( - function (x, _p13) { - var _p14 = _p13; - var _p16 = _p14._0; - var _p15 = _p14._1; - return pred(x) ? { - ctor: '_Tuple2', - _0: {ctor: '::', _0: x, _1: _p16}, - _1: _p15 - } : { - ctor: '_Tuple2', - _0: _p16, - _1: {ctor: '::', _0: x, _1: _p15} - }; - }); - return A3( - _elm_lang$core$List$foldr, - step, - { - ctor: '_Tuple2', - _0: {ctor: '[]'}, - _1: {ctor: '[]'} - }, - list); - }); -var _elm_lang$core$List$unzip = function (pairs) { - var step = F2( - function (_p18, _p17) { - var _p19 = _p18; - var _p20 = _p17; - return { - ctor: '_Tuple2', - _0: {ctor: '::', _0: _p19._0, _1: _p20._0}, - _1: {ctor: '::', _0: _p19._1, _1: _p20._1} - }; - }); - return A3( - _elm_lang$core$List$foldr, - step, - { - ctor: '_Tuple2', - _0: {ctor: '[]'}, - _1: {ctor: '[]'} - }, - pairs); -}; -var _elm_lang$core$List$intersperse = F2( - function (sep, xs) { - var _p21 = xs; - if (_p21.ctor === '[]') { - return {ctor: '[]'}; - } else { - var step = F2( - function (x, rest) { - return { - ctor: '::', - _0: sep, - _1: {ctor: '::', _0: x, _1: rest} - }; - }); - var spersed = A3( - _elm_lang$core$List$foldr, - step, - {ctor: '[]'}, - _p21._1); - return {ctor: '::', _0: _p21._0, _1: spersed}; - } - }); -var _elm_lang$core$List$takeReverse = F3( - function (n, list, taken) { - takeReverse: - while (true) { - if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { - return taken; - } else { - var _p22 = list; - if (_p22.ctor === '[]') { - return taken; - } else { - var _v23 = n - 1, - _v24 = _p22._1, - _v25 = {ctor: '::', _0: _p22._0, _1: taken}; - n = _v23; - list = _v24; - taken = _v25; - continue takeReverse; - } - } - } - }); -var _elm_lang$core$List$takeTailRec = F2( - function (n, list) { - return _elm_lang$core$List$reverse( - A3( - _elm_lang$core$List$takeReverse, - n, - list, - {ctor: '[]'})); - }); -var _elm_lang$core$List$takeFast = F3( - function (ctr, n, list) { - if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { - return {ctor: '[]'}; - } else { - var _p23 = {ctor: '_Tuple2', _0: n, _1: list}; - _v26_5: - do { - _v26_1: - do { - if (_p23.ctor === '_Tuple2') { - if (_p23._1.ctor === '[]') { - return list; - } else { - if (_p23._1._1.ctor === '::') { - switch (_p23._0) { - case 1: - break _v26_1; - case 2: - return { - ctor: '::', - _0: _p23._1._0, - _1: { - ctor: '::', - _0: _p23._1._1._0, - _1: {ctor: '[]'} - } - }; - case 3: - if (_p23._1._1._1.ctor === '::') { - return { - ctor: '::', - _0: _p23._1._0, - _1: { - ctor: '::', - _0: _p23._1._1._0, - _1: { - ctor: '::', - _0: _p23._1._1._1._0, - _1: {ctor: '[]'} - } - } - }; - } else { - break _v26_5; - } - default: - if ((_p23._1._1._1.ctor === '::') && (_p23._1._1._1._1.ctor === '::')) { - var _p28 = _p23._1._1._1._0; - var _p27 = _p23._1._1._0; - var _p26 = _p23._1._0; - var _p25 = _p23._1._1._1._1._0; - var _p24 = _p23._1._1._1._1._1; - return (_elm_lang$core$Native_Utils.cmp(ctr, 1000) > 0) ? { - ctor: '::', - _0: _p26, - _1: { - ctor: '::', - _0: _p27, - _1: { - ctor: '::', - _0: _p28, - _1: { - ctor: '::', - _0: _p25, - _1: A2(_elm_lang$core$List$takeTailRec, n - 4, _p24) - } - } - } - } : { - ctor: '::', - _0: _p26, - _1: { - ctor: '::', - _0: _p27, - _1: { - ctor: '::', - _0: _p28, - _1: { - ctor: '::', - _0: _p25, - _1: A3(_elm_lang$core$List$takeFast, ctr + 1, n - 4, _p24) - } - } - } - }; - } else { - break _v26_5; - } - } - } else { - if (_p23._0 === 1) { - break _v26_1; - } else { - break _v26_5; - } - } - } - } else { - break _v26_5; - } - } while(false); - return { - ctor: '::', - _0: _p23._1._0, - _1: {ctor: '[]'} - }; - } while(false); - return list; - } - }); -var _elm_lang$core$List$take = F2( - function (n, list) { - return A3(_elm_lang$core$List$takeFast, 0, n, list); - }); -var _elm_lang$core$List$repeatHelp = F3( - function (result, n, value) { - repeatHelp: - while (true) { - if (_elm_lang$core$Native_Utils.cmp(n, 0) < 1) { - return result; - } else { - var _v27 = {ctor: '::', _0: value, _1: result}, - _v28 = n - 1, - _v29 = value; - result = _v27; - n = _v28; - value = _v29; - continue repeatHelp; - } - } - }); -var _elm_lang$core$List$repeat = F2( - function (n, value) { - return A3( - _elm_lang$core$List$repeatHelp, - {ctor: '[]'}, - n, - value); - }); -var _elm_lang$core$List$rangeHelp = F3( - function (lo, hi, list) { - rangeHelp: - while (true) { - if (_elm_lang$core$Native_Utils.cmp(lo, hi) < 1) { - var _v30 = lo, - _v31 = hi - 1, - _v32 = {ctor: '::', _0: hi, _1: list}; - lo = _v30; - hi = _v31; - list = _v32; - continue rangeHelp; - } else { - return list; - } - } - }); -var _elm_lang$core$List$range = F2( - function (lo, hi) { - return A3( - _elm_lang$core$List$rangeHelp, - lo, - hi, - {ctor: '[]'}); - }); -var _elm_lang$core$List$indexedMap = F2( - function (f, xs) { - return A3( - _elm_lang$core$List$map2, - f, - A2( - _elm_lang$core$List$range, - 0, - _elm_lang$core$List$length(xs) - 1), - xs); - }); - -var _elm_lang$core$Array$append = _elm_lang$core$Native_Array.append; -var _elm_lang$core$Array$length = _elm_lang$core$Native_Array.length; -var _elm_lang$core$Array$isEmpty = function (array) { - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Array$length(array), - 0); -}; -var _elm_lang$core$Array$slice = _elm_lang$core$Native_Array.slice; -var _elm_lang$core$Array$set = _elm_lang$core$Native_Array.set; -var _elm_lang$core$Array$get = F2( - function (i, array) { - return ((_elm_lang$core$Native_Utils.cmp(0, i) < 1) && (_elm_lang$core$Native_Utils.cmp( - i, - _elm_lang$core$Native_Array.length(array)) < 0)) ? _elm_lang$core$Maybe$Just( - A2(_elm_lang$core$Native_Array.get, i, array)) : _elm_lang$core$Maybe$Nothing; - }); -var _elm_lang$core$Array$push = _elm_lang$core$Native_Array.push; -var _elm_lang$core$Array$empty = _elm_lang$core$Native_Array.empty; -var _elm_lang$core$Array$filter = F2( - function (isOkay, arr) { - var update = F2( - function (x, xs) { - return isOkay(x) ? A2(_elm_lang$core$Native_Array.push, x, xs) : xs; - }); - return A3(_elm_lang$core$Native_Array.foldl, update, _elm_lang$core$Native_Array.empty, arr); - }); -var _elm_lang$core$Array$foldr = _elm_lang$core$Native_Array.foldr; -var _elm_lang$core$Array$foldl = _elm_lang$core$Native_Array.foldl; -var _elm_lang$core$Array$indexedMap = _elm_lang$core$Native_Array.indexedMap; -var _elm_lang$core$Array$map = _elm_lang$core$Native_Array.map; -var _elm_lang$core$Array$toIndexedList = function (array) { - return A3( - _elm_lang$core$List$map2, - F2( - function (v0, v1) { - return {ctor: '_Tuple2', _0: v0, _1: v1}; - }), - A2( - _elm_lang$core$List$range, - 0, - _elm_lang$core$Native_Array.length(array) - 1), - _elm_lang$core$Native_Array.toList(array)); -}; -var _elm_lang$core$Array$toList = _elm_lang$core$Native_Array.toList; -var _elm_lang$core$Array$fromList = _elm_lang$core$Native_Array.fromList; -var _elm_lang$core$Array$initialize = _elm_lang$core$Native_Array.initialize; -var _elm_lang$core$Array$repeat = F2( - function (n, e) { - return A2( - _elm_lang$core$Array$initialize, - n, - _elm_lang$core$Basics$always(e)); - }); -var _elm_lang$core$Array$Array = {ctor: 'Array'}; - -//import Native.Utils // - -var _elm_lang$core$Native_Debug = function() { - -function log(tag, value) -{ - var msg = tag + ': ' + _elm_lang$core$Native_Utils.toString(value); - var process = process || {}; - if (process.stdout) - { - process.stdout.write(msg); - } - else - { - console.log(msg); - } - return value; -} - -function crash(message) -{ - throw new Error(message); -} - -return { - crash: crash, - log: F2(log) -}; - -}(); -//import Maybe, Native.List, Native.Utils, Result // - -var _elm_lang$core$Native_String = function() { - -function isEmpty(str) -{ - return str.length === 0; -} -function cons(chr, str) -{ - return chr + str; -} -function uncons(str) -{ - var hd = str[0]; - if (hd) - { - return _elm_lang$core$Maybe$Just(_elm_lang$core$Native_Utils.Tuple2(_elm_lang$core$Native_Utils.chr(hd), str.slice(1))); - } - return _elm_lang$core$Maybe$Nothing; -} -function append(a, b) -{ - return a + b; -} -function concat(strs) -{ - return _elm_lang$core$Native_List.toArray(strs).join(''); -} -function length(str) -{ - return str.length; -} -function map(f, str) -{ - var out = str.split(''); - for (var i = out.length; i--; ) - { - out[i] = f(_elm_lang$core$Native_Utils.chr(out[i])); - } - return out.join(''); -} -function filter(pred, str) -{ - return str.split('').map(_elm_lang$core$Native_Utils.chr).filter(pred).join(''); -} -function reverse(str) -{ - return str.split('').reverse().join(''); -} -function foldl(f, b, str) -{ - var len = str.length; - for (var i = 0; i < len; ++i) - { - b = A2(f, _elm_lang$core$Native_Utils.chr(str[i]), b); - } - return b; -} -function foldr(f, b, str) -{ - for (var i = str.length; i--; ) - { - b = A2(f, _elm_lang$core$Native_Utils.chr(str[i]), b); - } - return b; -} -function split(sep, str) -{ - return _elm_lang$core$Native_List.fromArray(str.split(sep)); -} -function join(sep, strs) -{ - return _elm_lang$core$Native_List.toArray(strs).join(sep); -} -function repeat(n, str) -{ - var result = ''; - while (n > 0) - { - if (n & 1) - { - result += str; - } - n >>= 1, str += str; - } - return result; -} -function slice(start, end, str) -{ - return str.slice(start, end); -} -function left(n, str) -{ - return n < 1 ? '' : str.slice(0, n); -} -function right(n, str) -{ - return n < 1 ? '' : str.slice(-n); -} -function dropLeft(n, str) -{ - return n < 1 ? str : str.slice(n); -} -function dropRight(n, str) -{ - return n < 1 ? str : str.slice(0, -n); -} -function pad(n, chr, str) -{ - var half = (n - str.length) / 2; - return repeat(Math.ceil(half), chr) + str + repeat(half | 0, chr); -} -function padRight(n, chr, str) -{ - return str + repeat(n - str.length, chr); -} -function padLeft(n, chr, str) -{ - return repeat(n - str.length, chr) + str; -} - -function trim(str) -{ - return str.trim(); -} -function trimLeft(str) -{ - return str.replace(/^\s+/, ''); -} -function trimRight(str) -{ - return str.replace(/\s+$/, ''); -} - -function words(str) -{ - return _elm_lang$core$Native_List.fromArray(str.trim().split(/\s+/g)); -} -function lines(str) -{ - return _elm_lang$core$Native_List.fromArray(str.split(/\r\n|\r|\n/g)); -} - -function toUpper(str) -{ - return str.toUpperCase(); -} -function toLower(str) -{ - return str.toLowerCase(); -} - -function any(pred, str) -{ - for (var i = str.length; i--; ) - { - if (pred(_elm_lang$core$Native_Utils.chr(str[i]))) - { - return true; - } - } - return false; -} -function all(pred, str) -{ - for (var i = str.length; i--; ) - { - if (!pred(_elm_lang$core$Native_Utils.chr(str[i]))) - { - return false; - } - } - return true; -} - -function contains(sub, str) -{ - return str.indexOf(sub) > -1; -} -function startsWith(sub, str) -{ - return str.indexOf(sub) === 0; -} -function endsWith(sub, str) -{ - return str.length >= sub.length && - str.lastIndexOf(sub) === str.length - sub.length; -} -function indexes(sub, str) -{ - var subLen = sub.length; - - if (subLen < 1) - { - return _elm_lang$core$Native_List.Nil; - } - - var i = 0; - var is = []; - - while ((i = str.indexOf(sub, i)) > -1) - { - is.push(i); - i = i + subLen; - } - - return _elm_lang$core$Native_List.fromArray(is); -} - - -function toInt(s) -{ - var len = s.length; - - // if empty - if (len === 0) - { - return intErr(s); - } - - // if hex - var c = s[0]; - if (c === '0' && s[1] === 'x') - { - for (var i = 2; i < len; ++i) - { - var c = s[i]; - if (('0' <= c && c <= '9') || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f')) - { - continue; - } - return intErr(s); - } - return _elm_lang$core$Result$Ok(parseInt(s, 16)); - } - - // is decimal - if (c > '9' || (c < '0' && c !== '-' && c !== '+')) - { - return intErr(s); - } - for (var i = 1; i < len; ++i) - { - var c = s[i]; - if (c < '0' || '9' < c) - { - return intErr(s); - } - } - - return _elm_lang$core$Result$Ok(parseInt(s, 10)); -} - -function intErr(s) -{ - return _elm_lang$core$Result$Err("could not convert string '" + s + "' to an Int"); -} - - -function toFloat(s) -{ - // check if it is a hex, octal, or binary number - if (s.length === 0 || /[\sxbo]/.test(s)) - { - return floatErr(s); - } - var n = +s; - // faster isNaN check - return n === n ? _elm_lang$core$Result$Ok(n) : floatErr(s); -} - -function floatErr(s) -{ - return _elm_lang$core$Result$Err("could not convert string '" + s + "' to a Float"); -} - - -function toList(str) -{ - return _elm_lang$core$Native_List.fromArray(str.split('').map(_elm_lang$core$Native_Utils.chr)); -} -function fromList(chars) -{ - return _elm_lang$core$Native_List.toArray(chars).join(''); -} - -return { - isEmpty: isEmpty, - cons: F2(cons), - uncons: uncons, - append: F2(append), - concat: concat, - length: length, - map: F2(map), - filter: F2(filter), - reverse: reverse, - foldl: F3(foldl), - foldr: F3(foldr), - - split: F2(split), - join: F2(join), - repeat: F2(repeat), - - slice: F3(slice), - left: F2(left), - right: F2(right), - dropLeft: F2(dropLeft), - dropRight: F2(dropRight), - - pad: F3(pad), - padLeft: F3(padLeft), - padRight: F3(padRight), - - trim: trim, - trimLeft: trimLeft, - trimRight: trimRight, - - words: words, - lines: lines, - - toUpper: toUpper, - toLower: toLower, - - any: F2(any), - all: F2(all), - - contains: F2(contains), - startsWith: F2(startsWith), - endsWith: F2(endsWith), - indexes: F2(indexes), - - toInt: toInt, - toFloat: toFloat, - toList: toList, - fromList: fromList -}; - -}(); - -//import Native.Utils // - -var _elm_lang$core$Native_Char = function() { - -return { - fromCode: function(c) { return _elm_lang$core$Native_Utils.chr(String.fromCharCode(c)); }, - toCode: function(c) { return c.charCodeAt(0); }, - toUpper: function(c) { return _elm_lang$core$Native_Utils.chr(c.toUpperCase()); }, - toLower: function(c) { return _elm_lang$core$Native_Utils.chr(c.toLowerCase()); }, - toLocaleUpper: function(c) { return _elm_lang$core$Native_Utils.chr(c.toLocaleUpperCase()); }, - toLocaleLower: function(c) { return _elm_lang$core$Native_Utils.chr(c.toLocaleLowerCase()); } -}; - -}(); -var _elm_lang$core$Char$fromCode = _elm_lang$core$Native_Char.fromCode; -var _elm_lang$core$Char$toCode = _elm_lang$core$Native_Char.toCode; -var _elm_lang$core$Char$toLocaleLower = _elm_lang$core$Native_Char.toLocaleLower; -var _elm_lang$core$Char$toLocaleUpper = _elm_lang$core$Native_Char.toLocaleUpper; -var _elm_lang$core$Char$toLower = _elm_lang$core$Native_Char.toLower; -var _elm_lang$core$Char$toUpper = _elm_lang$core$Native_Char.toUpper; -var _elm_lang$core$Char$isBetween = F3( - function (low, high, $char) { - var code = _elm_lang$core$Char$toCode($char); - return (_elm_lang$core$Native_Utils.cmp( - code, - _elm_lang$core$Char$toCode(low)) > -1) && (_elm_lang$core$Native_Utils.cmp( - code, - _elm_lang$core$Char$toCode(high)) < 1); - }); -var _elm_lang$core$Char$isUpper = A2( - _elm_lang$core$Char$isBetween, - _elm_lang$core$Native_Utils.chr('A'), - _elm_lang$core$Native_Utils.chr('Z')); -var _elm_lang$core$Char$isLower = A2( - _elm_lang$core$Char$isBetween, - _elm_lang$core$Native_Utils.chr('a'), - _elm_lang$core$Native_Utils.chr('z')); -var _elm_lang$core$Char$isDigit = A2( - _elm_lang$core$Char$isBetween, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Native_Utils.chr('9')); -var _elm_lang$core$Char$isOctDigit = A2( - _elm_lang$core$Char$isBetween, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Native_Utils.chr('7')); -var _elm_lang$core$Char$isHexDigit = function ($char) { - return _elm_lang$core$Char$isDigit($char) || (A3( - _elm_lang$core$Char$isBetween, - _elm_lang$core$Native_Utils.chr('a'), - _elm_lang$core$Native_Utils.chr('f'), - $char) || A3( - _elm_lang$core$Char$isBetween, - _elm_lang$core$Native_Utils.chr('A'), - _elm_lang$core$Native_Utils.chr('F'), - $char)); -}; - -var _elm_lang$core$Result$toMaybe = function (result) { - var _p0 = result; - if (_p0.ctor === 'Ok') { - return _elm_lang$core$Maybe$Just(_p0._0); - } else { - return _elm_lang$core$Maybe$Nothing; - } -}; -var _elm_lang$core$Result$withDefault = F2( - function (def, result) { - var _p1 = result; - if (_p1.ctor === 'Ok') { - return _p1._0; - } else { - return def; - } - }); -var _elm_lang$core$Result$Err = function (a) { - return {ctor: 'Err', _0: a}; -}; -var _elm_lang$core$Result$andThen = F2( - function (callback, result) { - var _p2 = result; - if (_p2.ctor === 'Ok') { - return callback(_p2._0); - } else { - return _elm_lang$core$Result$Err(_p2._0); - } - }); -var _elm_lang$core$Result$Ok = function (a) { - return {ctor: 'Ok', _0: a}; -}; -var _elm_lang$core$Result$map = F2( - function (func, ra) { - var _p3 = ra; - if (_p3.ctor === 'Ok') { - return _elm_lang$core$Result$Ok( - func(_p3._0)); - } else { - return _elm_lang$core$Result$Err(_p3._0); - } - }); -var _elm_lang$core$Result$map2 = F3( - function (func, ra, rb) { - var _p4 = {ctor: '_Tuple2', _0: ra, _1: rb}; - if (_p4._0.ctor === 'Ok') { - if (_p4._1.ctor === 'Ok') { - return _elm_lang$core$Result$Ok( - A2(func, _p4._0._0, _p4._1._0)); - } else { - return _elm_lang$core$Result$Err(_p4._1._0); - } - } else { - return _elm_lang$core$Result$Err(_p4._0._0); - } - }); -var _elm_lang$core$Result$map3 = F4( - function (func, ra, rb, rc) { - var _p5 = {ctor: '_Tuple3', _0: ra, _1: rb, _2: rc}; - if (_p5._0.ctor === 'Ok') { - if (_p5._1.ctor === 'Ok') { - if (_p5._2.ctor === 'Ok') { - return _elm_lang$core$Result$Ok( - A3(func, _p5._0._0, _p5._1._0, _p5._2._0)); - } else { - return _elm_lang$core$Result$Err(_p5._2._0); - } - } else { - return _elm_lang$core$Result$Err(_p5._1._0); - } - } else { - return _elm_lang$core$Result$Err(_p5._0._0); - } - }); -var _elm_lang$core$Result$map4 = F5( - function (func, ra, rb, rc, rd) { - var _p6 = {ctor: '_Tuple4', _0: ra, _1: rb, _2: rc, _3: rd}; - if (_p6._0.ctor === 'Ok') { - if (_p6._1.ctor === 'Ok') { - if (_p6._2.ctor === 'Ok') { - if (_p6._3.ctor === 'Ok') { - return _elm_lang$core$Result$Ok( - A4(func, _p6._0._0, _p6._1._0, _p6._2._0, _p6._3._0)); - } else { - return _elm_lang$core$Result$Err(_p6._3._0); - } - } else { - return _elm_lang$core$Result$Err(_p6._2._0); - } - } else { - return _elm_lang$core$Result$Err(_p6._1._0); - } - } else { - return _elm_lang$core$Result$Err(_p6._0._0); - } - }); -var _elm_lang$core$Result$map5 = F6( - function (func, ra, rb, rc, rd, re) { - var _p7 = {ctor: '_Tuple5', _0: ra, _1: rb, _2: rc, _3: rd, _4: re}; - if (_p7._0.ctor === 'Ok') { - if (_p7._1.ctor === 'Ok') { - if (_p7._2.ctor === 'Ok') { - if (_p7._3.ctor === 'Ok') { - if (_p7._4.ctor === 'Ok') { - return _elm_lang$core$Result$Ok( - A5(func, _p7._0._0, _p7._1._0, _p7._2._0, _p7._3._0, _p7._4._0)); - } else { - return _elm_lang$core$Result$Err(_p7._4._0); - } - } else { - return _elm_lang$core$Result$Err(_p7._3._0); - } - } else { - return _elm_lang$core$Result$Err(_p7._2._0); - } - } else { - return _elm_lang$core$Result$Err(_p7._1._0); - } - } else { - return _elm_lang$core$Result$Err(_p7._0._0); - } - }); -var _elm_lang$core$Result$mapError = F2( - function (f, result) { - var _p8 = result; - if (_p8.ctor === 'Ok') { - return _elm_lang$core$Result$Ok(_p8._0); - } else { - return _elm_lang$core$Result$Err( - f(_p8._0)); - } - }); -var _elm_lang$core$Result$fromMaybe = F2( - function (err, maybe) { - var _p9 = maybe; - if (_p9.ctor === 'Just') { - return _elm_lang$core$Result$Ok(_p9._0); - } else { - return _elm_lang$core$Result$Err(err); - } - }); - -var _elm_lang$core$String$fromList = _elm_lang$core$Native_String.fromList; -var _elm_lang$core$String$toList = _elm_lang$core$Native_String.toList; -var _elm_lang$core$String$toFloat = _elm_lang$core$Native_String.toFloat; -var _elm_lang$core$String$toInt = _elm_lang$core$Native_String.toInt; -var _elm_lang$core$String$indices = _elm_lang$core$Native_String.indexes; -var _elm_lang$core$String$indexes = _elm_lang$core$Native_String.indexes; -var _elm_lang$core$String$endsWith = _elm_lang$core$Native_String.endsWith; -var _elm_lang$core$String$startsWith = _elm_lang$core$Native_String.startsWith; -var _elm_lang$core$String$contains = _elm_lang$core$Native_String.contains; -var _elm_lang$core$String$all = _elm_lang$core$Native_String.all; -var _elm_lang$core$String$any = _elm_lang$core$Native_String.any; -var _elm_lang$core$String$toLower = _elm_lang$core$Native_String.toLower; -var _elm_lang$core$String$toUpper = _elm_lang$core$Native_String.toUpper; -var _elm_lang$core$String$lines = _elm_lang$core$Native_String.lines; -var _elm_lang$core$String$words = _elm_lang$core$Native_String.words; -var _elm_lang$core$String$trimRight = _elm_lang$core$Native_String.trimRight; -var _elm_lang$core$String$trimLeft = _elm_lang$core$Native_String.trimLeft; -var _elm_lang$core$String$trim = _elm_lang$core$Native_String.trim; -var _elm_lang$core$String$padRight = _elm_lang$core$Native_String.padRight; -var _elm_lang$core$String$padLeft = _elm_lang$core$Native_String.padLeft; -var _elm_lang$core$String$pad = _elm_lang$core$Native_String.pad; -var _elm_lang$core$String$dropRight = _elm_lang$core$Native_String.dropRight; -var _elm_lang$core$String$dropLeft = _elm_lang$core$Native_String.dropLeft; -var _elm_lang$core$String$right = _elm_lang$core$Native_String.right; -var _elm_lang$core$String$left = _elm_lang$core$Native_String.left; -var _elm_lang$core$String$slice = _elm_lang$core$Native_String.slice; -var _elm_lang$core$String$repeat = _elm_lang$core$Native_String.repeat; -var _elm_lang$core$String$join = _elm_lang$core$Native_String.join; -var _elm_lang$core$String$split = _elm_lang$core$Native_String.split; -var _elm_lang$core$String$foldr = _elm_lang$core$Native_String.foldr; -var _elm_lang$core$String$foldl = _elm_lang$core$Native_String.foldl; -var _elm_lang$core$String$reverse = _elm_lang$core$Native_String.reverse; -var _elm_lang$core$String$filter = _elm_lang$core$Native_String.filter; -var _elm_lang$core$String$map = _elm_lang$core$Native_String.map; -var _elm_lang$core$String$length = _elm_lang$core$Native_String.length; -var _elm_lang$core$String$concat = _elm_lang$core$Native_String.concat; -var _elm_lang$core$String$append = _elm_lang$core$Native_String.append; -var _elm_lang$core$String$uncons = _elm_lang$core$Native_String.uncons; -var _elm_lang$core$String$cons = _elm_lang$core$Native_String.cons; -var _elm_lang$core$String$fromChar = function ($char) { - return A2(_elm_lang$core$String$cons, $char, ''); -}; -var _elm_lang$core$String$isEmpty = _elm_lang$core$Native_String.isEmpty; - -var _elm_lang$core$Dict$foldr = F3( - function (f, acc, t) { - foldr: - while (true) { - var _p0 = t; - if (_p0.ctor === 'RBEmpty_elm_builtin') { - return acc; - } else { - var _v1 = f, - _v2 = A3( - f, - _p0._1, - _p0._2, - A3(_elm_lang$core$Dict$foldr, f, acc, _p0._4)), - _v3 = _p0._3; - f = _v1; - acc = _v2; - t = _v3; - continue foldr; - } - } - }); -var _elm_lang$core$Dict$keys = function (dict) { - return A3( - _elm_lang$core$Dict$foldr, - F3( - function (key, value, keyList) { - return {ctor: '::', _0: key, _1: keyList}; - }), - {ctor: '[]'}, - dict); -}; -var _elm_lang$core$Dict$values = function (dict) { - return A3( - _elm_lang$core$Dict$foldr, - F3( - function (key, value, valueList) { - return {ctor: '::', _0: value, _1: valueList}; - }), - {ctor: '[]'}, - dict); -}; -var _elm_lang$core$Dict$toList = function (dict) { - return A3( - _elm_lang$core$Dict$foldr, - F3( - function (key, value, list) { - return { - ctor: '::', - _0: {ctor: '_Tuple2', _0: key, _1: value}, - _1: list - }; - }), - {ctor: '[]'}, - dict); -}; -var _elm_lang$core$Dict$foldl = F3( - function (f, acc, dict) { - foldl: - while (true) { - var _p1 = dict; - if (_p1.ctor === 'RBEmpty_elm_builtin') { - return acc; - } else { - var _v5 = f, - _v6 = A3( - f, - _p1._1, - _p1._2, - A3(_elm_lang$core$Dict$foldl, f, acc, _p1._3)), - _v7 = _p1._4; - f = _v5; - acc = _v6; - dict = _v7; - continue foldl; - } - } - }); -var _elm_lang$core$Dict$merge = F6( - function (leftStep, bothStep, rightStep, leftDict, rightDict, initialResult) { - var stepState = F3( - function (rKey, rValue, _p2) { - stepState: - while (true) { - var _p3 = _p2; - var _p9 = _p3._1; - var _p8 = _p3._0; - var _p4 = _p8; - if (_p4.ctor === '[]') { - return { - ctor: '_Tuple2', - _0: _p8, - _1: A3(rightStep, rKey, rValue, _p9) - }; - } else { - var _p7 = _p4._1; - var _p6 = _p4._0._1; - var _p5 = _p4._0._0; - if (_elm_lang$core$Native_Utils.cmp(_p5, rKey) < 0) { - var _v10 = rKey, - _v11 = rValue, - _v12 = { - ctor: '_Tuple2', - _0: _p7, - _1: A3(leftStep, _p5, _p6, _p9) - }; - rKey = _v10; - rValue = _v11; - _p2 = _v12; - continue stepState; - } else { - if (_elm_lang$core$Native_Utils.cmp(_p5, rKey) > 0) { - return { - ctor: '_Tuple2', - _0: _p8, - _1: A3(rightStep, rKey, rValue, _p9) - }; - } else { - return { - ctor: '_Tuple2', - _0: _p7, - _1: A4(bothStep, _p5, _p6, rValue, _p9) - }; - } - } - } - } - }); - var _p10 = A3( - _elm_lang$core$Dict$foldl, - stepState, - { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$toList(leftDict), - _1: initialResult - }, - rightDict); - var leftovers = _p10._0; - var intermediateResult = _p10._1; - return A3( - _elm_lang$core$List$foldl, - F2( - function (_p11, result) { - var _p12 = _p11; - return A3(leftStep, _p12._0, _p12._1, result); - }), - intermediateResult, - leftovers); - }); -var _elm_lang$core$Dict$reportRemBug = F4( - function (msg, c, lgot, rgot) { - return _elm_lang$core$Native_Debug.crash( - _elm_lang$core$String$concat( - { - ctor: '::', - _0: 'Internal red-black tree invariant violated, expected ', - _1: { - ctor: '::', - _0: msg, - _1: { - ctor: '::', - _0: ' and got ', - _1: { - ctor: '::', - _0: _elm_lang$core$Basics$toString(c), - _1: { - ctor: '::', - _0: '/', - _1: { - ctor: '::', - _0: lgot, - _1: { - ctor: '::', - _0: '/', - _1: { - ctor: '::', - _0: rgot, - _1: { - ctor: '::', - _0: '\nPlease report this bug to ', - _1: {ctor: '[]'} - } - } - } - } - } - } - } - } - })); - }); -var _elm_lang$core$Dict$isBBlack = function (dict) { - var _p13 = dict; - _v14_2: - do { - if (_p13.ctor === 'RBNode_elm_builtin') { - if (_p13._0.ctor === 'BBlack') { - return true; - } else { - break _v14_2; - } - } else { - if (_p13._0.ctor === 'LBBlack') { - return true; - } else { - break _v14_2; - } - } - } while(false); - return false; -}; -var _elm_lang$core$Dict$sizeHelp = F2( - function (n, dict) { - sizeHelp: - while (true) { - var _p14 = dict; - if (_p14.ctor === 'RBEmpty_elm_builtin') { - return n; - } else { - var _v16 = A2(_elm_lang$core$Dict$sizeHelp, n + 1, _p14._4), - _v17 = _p14._3; - n = _v16; - dict = _v17; - continue sizeHelp; - } - } - }); -var _elm_lang$core$Dict$size = function (dict) { - return A2(_elm_lang$core$Dict$sizeHelp, 0, dict); -}; -var _elm_lang$core$Dict$get = F2( - function (targetKey, dict) { - get: - while (true) { - var _p15 = dict; - if (_p15.ctor === 'RBEmpty_elm_builtin') { - return _elm_lang$core$Maybe$Nothing; - } else { - var _p16 = A2(_elm_lang$core$Basics$compare, targetKey, _p15._1); - switch (_p16.ctor) { - case 'LT': - var _v20 = targetKey, - _v21 = _p15._3; - targetKey = _v20; - dict = _v21; - continue get; - case 'EQ': - return _elm_lang$core$Maybe$Just(_p15._2); - default: - var _v22 = targetKey, - _v23 = _p15._4; - targetKey = _v22; - dict = _v23; - continue get; - } - } - } - }); -var _elm_lang$core$Dict$member = F2( - function (key, dict) { - var _p17 = A2(_elm_lang$core$Dict$get, key, dict); - if (_p17.ctor === 'Just') { - return true; - } else { - return false; - } - }); -var _elm_lang$core$Dict$maxWithDefault = F3( - function (k, v, r) { - maxWithDefault: - while (true) { - var _p18 = r; - if (_p18.ctor === 'RBEmpty_elm_builtin') { - return {ctor: '_Tuple2', _0: k, _1: v}; - } else { - var _v26 = _p18._1, - _v27 = _p18._2, - _v28 = _p18._4; - k = _v26; - v = _v27; - r = _v28; - continue maxWithDefault; - } - } - }); -var _elm_lang$core$Dict$NBlack = {ctor: 'NBlack'}; -var _elm_lang$core$Dict$BBlack = {ctor: 'BBlack'}; -var _elm_lang$core$Dict$Black = {ctor: 'Black'}; -var _elm_lang$core$Dict$blackish = function (t) { - var _p19 = t; - if (_p19.ctor === 'RBNode_elm_builtin') { - var _p20 = _p19._0; - return _elm_lang$core$Native_Utils.eq(_p20, _elm_lang$core$Dict$Black) || _elm_lang$core$Native_Utils.eq(_p20, _elm_lang$core$Dict$BBlack); - } else { - return true; - } -}; -var _elm_lang$core$Dict$Red = {ctor: 'Red'}; -var _elm_lang$core$Dict$moreBlack = function (color) { - var _p21 = color; - switch (_p21.ctor) { - case 'Black': - return _elm_lang$core$Dict$BBlack; - case 'Red': - return _elm_lang$core$Dict$Black; - case 'NBlack': - return _elm_lang$core$Dict$Red; - default: - return _elm_lang$core$Native_Debug.crash('Can\'t make a double black node more black!'); - } -}; -var _elm_lang$core$Dict$lessBlack = function (color) { - var _p22 = color; - switch (_p22.ctor) { - case 'BBlack': - return _elm_lang$core$Dict$Black; - case 'Black': - return _elm_lang$core$Dict$Red; - case 'Red': - return _elm_lang$core$Dict$NBlack; - default: - return _elm_lang$core$Native_Debug.crash('Can\'t make a negative black node less black!'); - } -}; -var _elm_lang$core$Dict$LBBlack = {ctor: 'LBBlack'}; -var _elm_lang$core$Dict$LBlack = {ctor: 'LBlack'}; -var _elm_lang$core$Dict$RBEmpty_elm_builtin = function (a) { - return {ctor: 'RBEmpty_elm_builtin', _0: a}; -}; -var _elm_lang$core$Dict$empty = _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); -var _elm_lang$core$Dict$isEmpty = function (dict) { - return _elm_lang$core$Native_Utils.eq(dict, _elm_lang$core$Dict$empty); -}; -var _elm_lang$core$Dict$RBNode_elm_builtin = F5( - function (a, b, c, d, e) { - return {ctor: 'RBNode_elm_builtin', _0: a, _1: b, _2: c, _3: d, _4: e}; - }); -var _elm_lang$core$Dict$ensureBlackRoot = function (dict) { - var _p23 = dict; - if ((_p23.ctor === 'RBNode_elm_builtin') && (_p23._0.ctor === 'Red')) { - return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p23._1, _p23._2, _p23._3, _p23._4); - } else { - return dict; - } -}; -var _elm_lang$core$Dict$lessBlackTree = function (dict) { - var _p24 = dict; - if (_p24.ctor === 'RBNode_elm_builtin') { - return A5( - _elm_lang$core$Dict$RBNode_elm_builtin, - _elm_lang$core$Dict$lessBlack(_p24._0), - _p24._1, - _p24._2, - _p24._3, - _p24._4); - } else { - return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); - } -}; -var _elm_lang$core$Dict$balancedTree = function (col) { - return function (xk) { - return function (xv) { - return function (yk) { - return function (yv) { - return function (zk) { - return function (zv) { - return function (a) { - return function (b) { - return function (c) { - return function (d) { - return A5( - _elm_lang$core$Dict$RBNode_elm_builtin, - _elm_lang$core$Dict$lessBlack(col), - yk, - yv, - A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, xk, xv, a, b), - A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, zk, zv, c, d)); - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; -}; -var _elm_lang$core$Dict$blacken = function (t) { - var _p25 = t; - if (_p25.ctor === 'RBEmpty_elm_builtin') { - return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); - } else { - return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p25._1, _p25._2, _p25._3, _p25._4); - } -}; -var _elm_lang$core$Dict$redden = function (t) { - var _p26 = t; - if (_p26.ctor === 'RBEmpty_elm_builtin') { - return _elm_lang$core$Native_Debug.crash('can\'t make a Leaf red'); - } else { - return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Red, _p26._1, _p26._2, _p26._3, _p26._4); - } -}; -var _elm_lang$core$Dict$balanceHelp = function (tree) { - var _p27 = tree; - _v36_6: - do { - _v36_5: - do { - _v36_4: - do { - _v36_3: - do { - _v36_2: - do { - _v36_1: - do { - _v36_0: - do { - if (_p27.ctor === 'RBNode_elm_builtin') { - if (_p27._3.ctor === 'RBNode_elm_builtin') { - if (_p27._4.ctor === 'RBNode_elm_builtin') { - switch (_p27._3._0.ctor) { - case 'Red': - switch (_p27._4._0.ctor) { - case 'Red': - if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) { - break _v36_0; - } else { - if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) { - break _v36_1; - } else { - if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) { - break _v36_2; - } else { - if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) { - break _v36_3; - } else { - break _v36_6; - } - } - } - } - case 'NBlack': - if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) { - break _v36_0; - } else { - if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) { - break _v36_1; - } else { - if (((((_p27._0.ctor === 'BBlack') && (_p27._4._3.ctor === 'RBNode_elm_builtin')) && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) { - break _v36_4; - } else { - break _v36_6; - } - } - } - default: - if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) { - break _v36_0; - } else { - if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) { - break _v36_1; - } else { - break _v36_6; - } - } - } - case 'NBlack': - switch (_p27._4._0.ctor) { - case 'Red': - if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) { - break _v36_2; - } else { - if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) { - break _v36_3; - } else { - if (((((_p27._0.ctor === 'BBlack') && (_p27._3._3.ctor === 'RBNode_elm_builtin')) && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) { - break _v36_5; - } else { - break _v36_6; - } - } - } - case 'NBlack': - if (_p27._0.ctor === 'BBlack') { - if ((((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) { - break _v36_4; - } else { - if ((((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) { - break _v36_5; - } else { - break _v36_6; - } - } - } else { - break _v36_6; - } - default: - if (((((_p27._0.ctor === 'BBlack') && (_p27._3._3.ctor === 'RBNode_elm_builtin')) && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) { - break _v36_5; - } else { - break _v36_6; - } - } - default: - switch (_p27._4._0.ctor) { - case 'Red': - if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) { - break _v36_2; - } else { - if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) { - break _v36_3; - } else { - break _v36_6; - } - } - case 'NBlack': - if (((((_p27._0.ctor === 'BBlack') && (_p27._4._3.ctor === 'RBNode_elm_builtin')) && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) { - break _v36_4; - } else { - break _v36_6; - } - default: - break _v36_6; - } - } - } else { - switch (_p27._3._0.ctor) { - case 'Red': - if ((_p27._3._3.ctor === 'RBNode_elm_builtin') && (_p27._3._3._0.ctor === 'Red')) { - break _v36_0; - } else { - if ((_p27._3._4.ctor === 'RBNode_elm_builtin') && (_p27._3._4._0.ctor === 'Red')) { - break _v36_1; - } else { - break _v36_6; - } - } - case 'NBlack': - if (((((_p27._0.ctor === 'BBlack') && (_p27._3._3.ctor === 'RBNode_elm_builtin')) && (_p27._3._3._0.ctor === 'Black')) && (_p27._3._4.ctor === 'RBNode_elm_builtin')) && (_p27._3._4._0.ctor === 'Black')) { - break _v36_5; - } else { - break _v36_6; - } - default: - break _v36_6; - } - } - } else { - if (_p27._4.ctor === 'RBNode_elm_builtin') { - switch (_p27._4._0.ctor) { - case 'Red': - if ((_p27._4._3.ctor === 'RBNode_elm_builtin') && (_p27._4._3._0.ctor === 'Red')) { - break _v36_2; - } else { - if ((_p27._4._4.ctor === 'RBNode_elm_builtin') && (_p27._4._4._0.ctor === 'Red')) { - break _v36_3; - } else { - break _v36_6; - } - } - case 'NBlack': - if (((((_p27._0.ctor === 'BBlack') && (_p27._4._3.ctor === 'RBNode_elm_builtin')) && (_p27._4._3._0.ctor === 'Black')) && (_p27._4._4.ctor === 'RBNode_elm_builtin')) && (_p27._4._4._0.ctor === 'Black')) { - break _v36_4; - } else { - break _v36_6; - } - default: - break _v36_6; - } - } else { - break _v36_6; - } - } - } else { - break _v36_6; - } - } while(false); - return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._3._3._1)(_p27._3._3._2)(_p27._3._1)(_p27._3._2)(_p27._1)(_p27._2)(_p27._3._3._3)(_p27._3._3._4)(_p27._3._4)(_p27._4); - } while(false); - return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._3._1)(_p27._3._2)(_p27._3._4._1)(_p27._3._4._2)(_p27._1)(_p27._2)(_p27._3._3)(_p27._3._4._3)(_p27._3._4._4)(_p27._4); - } while(false); - return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._1)(_p27._2)(_p27._4._3._1)(_p27._4._3._2)(_p27._4._1)(_p27._4._2)(_p27._3)(_p27._4._3._3)(_p27._4._3._4)(_p27._4._4); - } while(false); - return _elm_lang$core$Dict$balancedTree(_p27._0)(_p27._1)(_p27._2)(_p27._4._1)(_p27._4._2)(_p27._4._4._1)(_p27._4._4._2)(_p27._3)(_p27._4._3)(_p27._4._4._3)(_p27._4._4._4); - } while(false); - return A5( - _elm_lang$core$Dict$RBNode_elm_builtin, - _elm_lang$core$Dict$Black, - _p27._4._3._1, - _p27._4._3._2, - A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._1, _p27._2, _p27._3, _p27._4._3._3), - A5( - _elm_lang$core$Dict$balance, - _elm_lang$core$Dict$Black, - _p27._4._1, - _p27._4._2, - _p27._4._3._4, - _elm_lang$core$Dict$redden(_p27._4._4))); - } while(false); - return A5( - _elm_lang$core$Dict$RBNode_elm_builtin, - _elm_lang$core$Dict$Black, - _p27._3._4._1, - _p27._3._4._2, - A5( - _elm_lang$core$Dict$balance, - _elm_lang$core$Dict$Black, - _p27._3._1, - _p27._3._2, - _elm_lang$core$Dict$redden(_p27._3._3), - _p27._3._4._3), - A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p27._1, _p27._2, _p27._3._4._4, _p27._4)); - } while(false); - return tree; -}; -var _elm_lang$core$Dict$balance = F5( - function (c, k, v, l, r) { - var tree = A5(_elm_lang$core$Dict$RBNode_elm_builtin, c, k, v, l, r); - return _elm_lang$core$Dict$blackish(tree) ? _elm_lang$core$Dict$balanceHelp(tree) : tree; - }); -var _elm_lang$core$Dict$bubble = F5( - function (c, k, v, l, r) { - return (_elm_lang$core$Dict$isBBlack(l) || _elm_lang$core$Dict$isBBlack(r)) ? A5( - _elm_lang$core$Dict$balance, - _elm_lang$core$Dict$moreBlack(c), - k, - v, - _elm_lang$core$Dict$lessBlackTree(l), - _elm_lang$core$Dict$lessBlackTree(r)) : A5(_elm_lang$core$Dict$RBNode_elm_builtin, c, k, v, l, r); - }); -var _elm_lang$core$Dict$removeMax = F5( - function (c, k, v, l, r) { - var _p28 = r; - if (_p28.ctor === 'RBEmpty_elm_builtin') { - return A3(_elm_lang$core$Dict$rem, c, l, r); - } else { - return A5( - _elm_lang$core$Dict$bubble, - c, - k, - v, - l, - A5(_elm_lang$core$Dict$removeMax, _p28._0, _p28._1, _p28._2, _p28._3, _p28._4)); - } - }); -var _elm_lang$core$Dict$rem = F3( - function (color, left, right) { - var _p29 = {ctor: '_Tuple2', _0: left, _1: right}; - if (_p29._0.ctor === 'RBEmpty_elm_builtin') { - if (_p29._1.ctor === 'RBEmpty_elm_builtin') { - var _p30 = color; - switch (_p30.ctor) { - case 'Red': - return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); - case 'Black': - return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBBlack); - default: - return _elm_lang$core$Native_Debug.crash('cannot have bblack or nblack nodes at this point'); - } - } else { - var _p33 = _p29._1._0; - var _p32 = _p29._0._0; - var _p31 = {ctor: '_Tuple3', _0: color, _1: _p32, _2: _p33}; - if ((((_p31.ctor === '_Tuple3') && (_p31._0.ctor === 'Black')) && (_p31._1.ctor === 'LBlack')) && (_p31._2.ctor === 'Red')) { - return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p29._1._1, _p29._1._2, _p29._1._3, _p29._1._4); - } else { - return A4( - _elm_lang$core$Dict$reportRemBug, - 'Black/LBlack/Red', - color, - _elm_lang$core$Basics$toString(_p32), - _elm_lang$core$Basics$toString(_p33)); - } - } - } else { - if (_p29._1.ctor === 'RBEmpty_elm_builtin') { - var _p36 = _p29._1._0; - var _p35 = _p29._0._0; - var _p34 = {ctor: '_Tuple3', _0: color, _1: _p35, _2: _p36}; - if ((((_p34.ctor === '_Tuple3') && (_p34._0.ctor === 'Black')) && (_p34._1.ctor === 'Red')) && (_p34._2.ctor === 'LBlack')) { - return A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Black, _p29._0._1, _p29._0._2, _p29._0._3, _p29._0._4); - } else { - return A4( - _elm_lang$core$Dict$reportRemBug, - 'Black/Red/LBlack', - color, - _elm_lang$core$Basics$toString(_p35), - _elm_lang$core$Basics$toString(_p36)); - } - } else { - var _p40 = _p29._0._2; - var _p39 = _p29._0._4; - var _p38 = _p29._0._1; - var newLeft = A5(_elm_lang$core$Dict$removeMax, _p29._0._0, _p38, _p40, _p29._0._3, _p39); - var _p37 = A3(_elm_lang$core$Dict$maxWithDefault, _p38, _p40, _p39); - var k = _p37._0; - var v = _p37._1; - return A5(_elm_lang$core$Dict$bubble, color, k, v, newLeft, right); - } - } - }); -var _elm_lang$core$Dict$map = F2( - function (f, dict) { - var _p41 = dict; - if (_p41.ctor === 'RBEmpty_elm_builtin') { - return _elm_lang$core$Dict$RBEmpty_elm_builtin(_elm_lang$core$Dict$LBlack); - } else { - var _p42 = _p41._1; - return A5( - _elm_lang$core$Dict$RBNode_elm_builtin, - _p41._0, - _p42, - A2(f, _p42, _p41._2), - A2(_elm_lang$core$Dict$map, f, _p41._3), - A2(_elm_lang$core$Dict$map, f, _p41._4)); - } - }); -var _elm_lang$core$Dict$Same = {ctor: 'Same'}; -var _elm_lang$core$Dict$Remove = {ctor: 'Remove'}; -var _elm_lang$core$Dict$Insert = {ctor: 'Insert'}; -var _elm_lang$core$Dict$update = F3( - function (k, alter, dict) { - var up = function (dict) { - var _p43 = dict; - if (_p43.ctor === 'RBEmpty_elm_builtin') { - var _p44 = alter(_elm_lang$core$Maybe$Nothing); - if (_p44.ctor === 'Nothing') { - return {ctor: '_Tuple2', _0: _elm_lang$core$Dict$Same, _1: _elm_lang$core$Dict$empty}; - } else { - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Insert, - _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _elm_lang$core$Dict$Red, k, _p44._0, _elm_lang$core$Dict$empty, _elm_lang$core$Dict$empty) - }; - } - } else { - var _p55 = _p43._2; - var _p54 = _p43._4; - var _p53 = _p43._3; - var _p52 = _p43._1; - var _p51 = _p43._0; - var _p45 = A2(_elm_lang$core$Basics$compare, k, _p52); - switch (_p45.ctor) { - case 'EQ': - var _p46 = alter( - _elm_lang$core$Maybe$Just(_p55)); - if (_p46.ctor === 'Nothing') { - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Remove, - _1: A3(_elm_lang$core$Dict$rem, _p51, _p53, _p54) - }; - } else { - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Same, - _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p46._0, _p53, _p54) - }; - } - case 'LT': - var _p47 = up(_p53); - var flag = _p47._0; - var newLeft = _p47._1; - var _p48 = flag; - switch (_p48.ctor) { - case 'Same': - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Same, - _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p55, newLeft, _p54) - }; - case 'Insert': - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Insert, - _1: A5(_elm_lang$core$Dict$balance, _p51, _p52, _p55, newLeft, _p54) - }; - default: - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Remove, - _1: A5(_elm_lang$core$Dict$bubble, _p51, _p52, _p55, newLeft, _p54) - }; - } - default: - var _p49 = up(_p54); - var flag = _p49._0; - var newRight = _p49._1; - var _p50 = flag; - switch (_p50.ctor) { - case 'Same': - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Same, - _1: A5(_elm_lang$core$Dict$RBNode_elm_builtin, _p51, _p52, _p55, _p53, newRight) - }; - case 'Insert': - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Insert, - _1: A5(_elm_lang$core$Dict$balance, _p51, _p52, _p55, _p53, newRight) - }; - default: - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Dict$Remove, - _1: A5(_elm_lang$core$Dict$bubble, _p51, _p52, _p55, _p53, newRight) - }; - } - } - } - }; - var _p56 = up(dict); - var flag = _p56._0; - var updatedDict = _p56._1; - var _p57 = flag; - switch (_p57.ctor) { - case 'Same': - return updatedDict; - case 'Insert': - return _elm_lang$core$Dict$ensureBlackRoot(updatedDict); - default: - return _elm_lang$core$Dict$blacken(updatedDict); - } - }); -var _elm_lang$core$Dict$insert = F3( - function (key, value, dict) { - return A3( - _elm_lang$core$Dict$update, - key, - _elm_lang$core$Basics$always( - _elm_lang$core$Maybe$Just(value)), - dict); - }); -var _elm_lang$core$Dict$singleton = F2( - function (key, value) { - return A3(_elm_lang$core$Dict$insert, key, value, _elm_lang$core$Dict$empty); - }); -var _elm_lang$core$Dict$union = F2( - function (t1, t2) { - return A3(_elm_lang$core$Dict$foldl, _elm_lang$core$Dict$insert, t2, t1); - }); -var _elm_lang$core$Dict$filter = F2( - function (predicate, dictionary) { - var add = F3( - function (key, value, dict) { - return A2(predicate, key, value) ? A3(_elm_lang$core$Dict$insert, key, value, dict) : dict; - }); - return A3(_elm_lang$core$Dict$foldl, add, _elm_lang$core$Dict$empty, dictionary); - }); -var _elm_lang$core$Dict$intersect = F2( - function (t1, t2) { - return A2( - _elm_lang$core$Dict$filter, - F2( - function (k, _p58) { - return A2(_elm_lang$core$Dict$member, k, t2); - }), - t1); - }); -var _elm_lang$core$Dict$partition = F2( - function (predicate, dict) { - var add = F3( - function (key, value, _p59) { - var _p60 = _p59; - var _p62 = _p60._1; - var _p61 = _p60._0; - return A2(predicate, key, value) ? { - ctor: '_Tuple2', - _0: A3(_elm_lang$core$Dict$insert, key, value, _p61), - _1: _p62 - } : { - ctor: '_Tuple2', - _0: _p61, - _1: A3(_elm_lang$core$Dict$insert, key, value, _p62) - }; - }); - return A3( - _elm_lang$core$Dict$foldl, - add, - {ctor: '_Tuple2', _0: _elm_lang$core$Dict$empty, _1: _elm_lang$core$Dict$empty}, - dict); - }); -var _elm_lang$core$Dict$fromList = function (assocs) { - return A3( - _elm_lang$core$List$foldl, - F2( - function (_p63, dict) { - var _p64 = _p63; - return A3(_elm_lang$core$Dict$insert, _p64._0, _p64._1, dict); - }), - _elm_lang$core$Dict$empty, - assocs); -}; -var _elm_lang$core$Dict$remove = F2( - function (key, dict) { - return A3( - _elm_lang$core$Dict$update, - key, - _elm_lang$core$Basics$always(_elm_lang$core$Maybe$Nothing), - dict); - }); -var _elm_lang$core$Dict$diff = F2( - function (t1, t2) { - return A3( - _elm_lang$core$Dict$foldl, - F3( - function (k, v, t) { - return A2(_elm_lang$core$Dict$remove, k, t); - }), - t1, - t2); - }); - -//import Maybe, Native.Array, Native.List, Native.Utils, Result // - -var _elm_lang$core$Native_Json = function() { - - -// CORE DECODERS - -function succeed(msg) -{ - return { - ctor: '', - tag: 'succeed', - msg: msg - }; -} - -function fail(msg) -{ - return { - ctor: '', - tag: 'fail', - msg: msg - }; -} - -function decodePrimitive(tag) -{ - return { - ctor: '', - tag: tag - }; -} - -function decodeContainer(tag, decoder) -{ - return { - ctor: '', - tag: tag, - decoder: decoder - }; -} - -function decodeNull(value) -{ - return { - ctor: '', - tag: 'null', - value: value - }; -} - -function decodeField(field, decoder) -{ - return { - ctor: '', - tag: 'field', - field: field, - decoder: decoder - }; -} - -function decodeIndex(index, decoder) -{ - return { - ctor: '', - tag: 'index', - index: index, - decoder: decoder - }; -} - -function decodeKeyValuePairs(decoder) -{ - return { - ctor: '', - tag: 'key-value', - decoder: decoder - }; -} - -function mapMany(f, decoders) -{ - return { - ctor: '', - tag: 'map-many', - func: f, - decoders: decoders - }; -} - -function andThen(callback, decoder) -{ - return { - ctor: '', - tag: 'andThen', - decoder: decoder, - callback: callback - }; -} - -function oneOf(decoders) -{ - return { - ctor: '', - tag: 'oneOf', - decoders: decoders - }; -} - - -// DECODING OBJECTS - -function map1(f, d1) -{ - return mapMany(f, [d1]); -} - -function map2(f, d1, d2) -{ - return mapMany(f, [d1, d2]); -} - -function map3(f, d1, d2, d3) -{ - return mapMany(f, [d1, d2, d3]); -} - -function map4(f, d1, d2, d3, d4) -{ - return mapMany(f, [d1, d2, d3, d4]); -} - -function map5(f, d1, d2, d3, d4, d5) -{ - return mapMany(f, [d1, d2, d3, d4, d5]); -} - -function map6(f, d1, d2, d3, d4, d5, d6) -{ - return mapMany(f, [d1, d2, d3, d4, d5, d6]); -} - -function map7(f, d1, d2, d3, d4, d5, d6, d7) -{ - return mapMany(f, [d1, d2, d3, d4, d5, d6, d7]); -} - -function map8(f, d1, d2, d3, d4, d5, d6, d7, d8) -{ - return mapMany(f, [d1, d2, d3, d4, d5, d6, d7, d8]); -} - - -// DECODE HELPERS - -function ok(value) -{ - return { tag: 'ok', value: value }; -} - -function badPrimitive(type, value) -{ - return { tag: 'primitive', type: type, value: value }; -} - -function badIndex(index, nestedProblems) -{ - return { tag: 'index', index: index, rest: nestedProblems }; -} - -function badField(field, nestedProblems) -{ - return { tag: 'field', field: field, rest: nestedProblems }; -} - -function badIndex(index, nestedProblems) -{ - return { tag: 'index', index: index, rest: nestedProblems }; -} - -function badOneOf(problems) -{ - return { tag: 'oneOf', problems: problems }; -} - -function bad(msg) -{ - return { tag: 'fail', msg: msg }; -} - -function badToString(problem) -{ - var context = '_'; - while (problem) - { - switch (problem.tag) - { - case 'primitive': - return 'Expecting ' + problem.type - + (context === '_' ? '' : ' at ' + context) - + ' but instead got: ' + jsToString(problem.value); - - case 'index': - context += '[' + problem.index + ']'; - problem = problem.rest; - break; - - case 'field': - context += '.' + problem.field; - problem = problem.rest; - break; - - case 'oneOf': - var problems = problem.problems; - for (var i = 0; i < problems.length; i++) - { - problems[i] = badToString(problems[i]); - } - return 'I ran into the following problems' - + (context === '_' ? '' : ' at ' + context) - + ':\n\n' + problems.join('\n'); - - case 'fail': - return 'I ran into a `fail` decoder' - + (context === '_' ? '' : ' at ' + context) - + ': ' + problem.msg; - } - } -} - -function jsToString(value) -{ - return value === undefined - ? 'undefined' - : JSON.stringify(value); -} - - -// DECODE - -function runOnString(decoder, string) -{ - var json; - try - { - json = JSON.parse(string); - } - catch (e) - { - return _elm_lang$core$Result$Err('Given an invalid JSON: ' + e.message); - } - return run(decoder, json); -} - -function run(decoder, value) -{ - var result = runHelp(decoder, value); - return (result.tag === 'ok') - ? _elm_lang$core$Result$Ok(result.value) - : _elm_lang$core$Result$Err(badToString(result)); -} - -function runHelp(decoder, value) -{ - switch (decoder.tag) - { - case 'bool': - return (typeof value === 'boolean') - ? ok(value) - : badPrimitive('a Bool', value); - - case 'int': - if (typeof value !== 'number') { - return badPrimitive('an Int', value); - } - - if (-2147483647 < value && value < 2147483647 && (value | 0) === value) { - return ok(value); - } - - if (isFinite(value) && !(value % 1)) { - return ok(value); - } - - return badPrimitive('an Int', value); - - case 'float': - return (typeof value === 'number') - ? ok(value) - : badPrimitive('a Float', value); - - case 'string': - return (typeof value === 'string') - ? ok(value) - : (value instanceof String) - ? ok(value + '') - : badPrimitive('a String', value); - - case 'null': - return (value === null) - ? ok(decoder.value) - : badPrimitive('null', value); - - case 'value': - return ok(value); - - case 'list': - if (!(value instanceof Array)) - { - return badPrimitive('a List', value); - } - - var list = _elm_lang$core$Native_List.Nil; - for (var i = value.length; i--; ) - { - var result = runHelp(decoder.decoder, value[i]); - if (result.tag !== 'ok') - { - return badIndex(i, result) - } - list = _elm_lang$core$Native_List.Cons(result.value, list); - } - return ok(list); - - case 'array': - if (!(value instanceof Array)) - { - return badPrimitive('an Array', value); - } - - var len = value.length; - var array = new Array(len); - for (var i = len; i--; ) - { - var result = runHelp(decoder.decoder, value[i]); - if (result.tag !== 'ok') - { - return badIndex(i, result); - } - array[i] = result.value; - } - return ok(_elm_lang$core$Native_Array.fromJSArray(array)); - - case 'maybe': - var result = runHelp(decoder.decoder, value); - return (result.tag === 'ok') - ? ok(_elm_lang$core$Maybe$Just(result.value)) - : ok(_elm_lang$core$Maybe$Nothing); - - case 'field': - var field = decoder.field; - if (typeof value !== 'object' || value === null || !(field in value)) - { - return badPrimitive('an object with a field named `' + field + '`', value); - } - - var result = runHelp(decoder.decoder, value[field]); - return (result.tag === 'ok') ? result : badField(field, result); - - case 'index': - var index = decoder.index; - if (!(value instanceof Array)) - { - return badPrimitive('an array', value); - } - if (index >= value.length) - { - return badPrimitive('a longer array. Need index ' + index + ' but there are only ' + value.length + ' entries', value); - } - - var result = runHelp(decoder.decoder, value[index]); - return (result.tag === 'ok') ? result : badIndex(index, result); - - case 'key-value': - if (typeof value !== 'object' || value === null || value instanceof Array) - { - return badPrimitive('an object', value); - } - - var keyValuePairs = _elm_lang$core$Native_List.Nil; - for (var key in value) - { - var result = runHelp(decoder.decoder, value[key]); - if (result.tag !== 'ok') - { - return badField(key, result); - } - var pair = _elm_lang$core$Native_Utils.Tuple2(key, result.value); - keyValuePairs = _elm_lang$core$Native_List.Cons(pair, keyValuePairs); - } - return ok(keyValuePairs); - - case 'map-many': - var answer = decoder.func; - var decoders = decoder.decoders; - for (var i = 0; i < decoders.length; i++) - { - var result = runHelp(decoders[i], value); - if (result.tag !== 'ok') - { - return result; - } - answer = answer(result.value); - } - return ok(answer); - - case 'andThen': - var result = runHelp(decoder.decoder, value); - return (result.tag !== 'ok') - ? result - : runHelp(decoder.callback(result.value), value); - - case 'oneOf': - var errors = []; - var temp = decoder.decoders; - while (temp.ctor !== '[]') - { - var result = runHelp(temp._0, value); - - if (result.tag === 'ok') - { - return result; - } - - errors.push(result); - - temp = temp._1; - } - return badOneOf(errors); - - case 'fail': - return bad(decoder.msg); - - case 'succeed': - return ok(decoder.msg); - } -} - - -// EQUALITY - -function equality(a, b) -{ - if (a === b) - { - return true; - } - - if (a.tag !== b.tag) - { - return false; - } - - switch (a.tag) - { - case 'succeed': - case 'fail': - return a.msg === b.msg; - - case 'bool': - case 'int': - case 'float': - case 'string': - case 'value': - return true; - - case 'null': - return a.value === b.value; - - case 'list': - case 'array': - case 'maybe': - case 'key-value': - return equality(a.decoder, b.decoder); - - case 'field': - return a.field === b.field && equality(a.decoder, b.decoder); - - case 'index': - return a.index === b.index && equality(a.decoder, b.decoder); - - case 'map-many': - if (a.func !== b.func) - { - return false; - } - return listEquality(a.decoders, b.decoders); - - case 'andThen': - return a.callback === b.callback && equality(a.decoder, b.decoder); - - case 'oneOf': - return listEquality(a.decoders, b.decoders); - } -} - -function listEquality(aDecoders, bDecoders) -{ - var len = aDecoders.length; - if (len !== bDecoders.length) - { - return false; - } - for (var i = 0; i < len; i++) - { - if (!equality(aDecoders[i], bDecoders[i])) - { - return false; - } - } - return true; -} - - -// ENCODE - -function encode(indentLevel, value) -{ - return JSON.stringify(value, null, indentLevel); -} - -function identity(value) -{ - return value; -} - -function encodeObject(keyValuePairs) -{ - var obj = {}; - while (keyValuePairs.ctor !== '[]') - { - var pair = keyValuePairs._0; - obj[pair._0] = pair._1; - keyValuePairs = keyValuePairs._1; - } - return obj; -} - -return { - encode: F2(encode), - runOnString: F2(runOnString), - run: F2(run), - - decodeNull: decodeNull, - decodePrimitive: decodePrimitive, - decodeContainer: F2(decodeContainer), - - decodeField: F2(decodeField), - decodeIndex: F2(decodeIndex), - - map1: F2(map1), - map2: F3(map2), - map3: F4(map3), - map4: F5(map4), - map5: F6(map5), - map6: F7(map6), - map7: F8(map7), - map8: F9(map8), - decodeKeyValuePairs: decodeKeyValuePairs, - - andThen: F2(andThen), - fail: fail, - succeed: succeed, - oneOf: oneOf, - - identity: identity, - encodeNull: null, - encodeArray: _elm_lang$core$Native_Array.toJSArray, - encodeList: _elm_lang$core$Native_List.toArray, - encodeObject: encodeObject, - - equality: equality -}; - -}(); - -var _elm_lang$core$Json_Encode$list = _elm_lang$core$Native_Json.encodeList; -var _elm_lang$core$Json_Encode$array = _elm_lang$core$Native_Json.encodeArray; -var _elm_lang$core$Json_Encode$object = _elm_lang$core$Native_Json.encodeObject; -var _elm_lang$core$Json_Encode$null = _elm_lang$core$Native_Json.encodeNull; -var _elm_lang$core$Json_Encode$bool = _elm_lang$core$Native_Json.identity; -var _elm_lang$core$Json_Encode$float = _elm_lang$core$Native_Json.identity; -var _elm_lang$core$Json_Encode$int = _elm_lang$core$Native_Json.identity; -var _elm_lang$core$Json_Encode$string = _elm_lang$core$Native_Json.identity; -var _elm_lang$core$Json_Encode$encode = _elm_lang$core$Native_Json.encode; -var _elm_lang$core$Json_Encode$Value = {ctor: 'Value'}; - -var _elm_lang$core$Json_Decode$null = _elm_lang$core$Native_Json.decodeNull; -var _elm_lang$core$Json_Decode$value = _elm_lang$core$Native_Json.decodePrimitive('value'); -var _elm_lang$core$Json_Decode$andThen = _elm_lang$core$Native_Json.andThen; -var _elm_lang$core$Json_Decode$fail = _elm_lang$core$Native_Json.fail; -var _elm_lang$core$Json_Decode$succeed = _elm_lang$core$Native_Json.succeed; -var _elm_lang$core$Json_Decode$lazy = function (thunk) { - return A2( - _elm_lang$core$Json_Decode$andThen, - thunk, - _elm_lang$core$Json_Decode$succeed( - {ctor: '_Tuple0'})); -}; -var _elm_lang$core$Json_Decode$decodeValue = _elm_lang$core$Native_Json.run; -var _elm_lang$core$Json_Decode$decodeString = _elm_lang$core$Native_Json.runOnString; -var _elm_lang$core$Json_Decode$map8 = _elm_lang$core$Native_Json.map8; -var _elm_lang$core$Json_Decode$map7 = _elm_lang$core$Native_Json.map7; -var _elm_lang$core$Json_Decode$map6 = _elm_lang$core$Native_Json.map6; -var _elm_lang$core$Json_Decode$map5 = _elm_lang$core$Native_Json.map5; -var _elm_lang$core$Json_Decode$map4 = _elm_lang$core$Native_Json.map4; -var _elm_lang$core$Json_Decode$map3 = _elm_lang$core$Native_Json.map3; -var _elm_lang$core$Json_Decode$map2 = _elm_lang$core$Native_Json.map2; -var _elm_lang$core$Json_Decode$map = _elm_lang$core$Native_Json.map1; -var _elm_lang$core$Json_Decode$oneOf = _elm_lang$core$Native_Json.oneOf; -var _elm_lang$core$Json_Decode$maybe = function (decoder) { - return A2(_elm_lang$core$Native_Json.decodeContainer, 'maybe', decoder); -}; -var _elm_lang$core$Json_Decode$index = _elm_lang$core$Native_Json.decodeIndex; -var _elm_lang$core$Json_Decode$field = _elm_lang$core$Native_Json.decodeField; -var _elm_lang$core$Json_Decode$at = F2( - function (fields, decoder) { - return A3(_elm_lang$core$List$foldr, _elm_lang$core$Json_Decode$field, decoder, fields); - }); -var _elm_lang$core$Json_Decode$keyValuePairs = _elm_lang$core$Native_Json.decodeKeyValuePairs; -var _elm_lang$core$Json_Decode$dict = function (decoder) { - return A2( - _elm_lang$core$Json_Decode$map, - _elm_lang$core$Dict$fromList, - _elm_lang$core$Json_Decode$keyValuePairs(decoder)); -}; -var _elm_lang$core$Json_Decode$array = function (decoder) { - return A2(_elm_lang$core$Native_Json.decodeContainer, 'array', decoder); -}; -var _elm_lang$core$Json_Decode$list = function (decoder) { - return A2(_elm_lang$core$Native_Json.decodeContainer, 'list', decoder); -}; -var _elm_lang$core$Json_Decode$nullable = function (decoder) { - return _elm_lang$core$Json_Decode$oneOf( - { - ctor: '::', - _0: _elm_lang$core$Json_Decode$null(_elm_lang$core$Maybe$Nothing), - _1: { - ctor: '::', - _0: A2(_elm_lang$core$Json_Decode$map, _elm_lang$core$Maybe$Just, decoder), - _1: {ctor: '[]'} - } - }); -}; -var _elm_lang$core$Json_Decode$float = _elm_lang$core$Native_Json.decodePrimitive('float'); -var _elm_lang$core$Json_Decode$int = _elm_lang$core$Native_Json.decodePrimitive('int'); -var _elm_lang$core$Json_Decode$bool = _elm_lang$core$Native_Json.decodePrimitive('bool'); -var _elm_lang$core$Json_Decode$string = _elm_lang$core$Native_Json.decodePrimitive('string'); -var _elm_lang$core$Json_Decode$Decoder = {ctor: 'Decoder'}; - -var _elm_lang$core$Debug$crash = _elm_lang$core$Native_Debug.crash; -var _elm_lang$core$Debug$log = _elm_lang$core$Native_Debug.log; - -var _elm_lang$core$Tuple$mapSecond = F2( - function (func, _p0) { - var _p1 = _p0; - return { - ctor: '_Tuple2', - _0: _p1._0, - _1: func(_p1._1) - }; - }); -var _elm_lang$core$Tuple$mapFirst = F2( - function (func, _p2) { - var _p3 = _p2; - return { - ctor: '_Tuple2', - _0: func(_p3._0), - _1: _p3._1 - }; - }); -var _elm_lang$core$Tuple$second = function (_p4) { - var _p5 = _p4; - return _p5._1; -}; -var _elm_lang$core$Tuple$first = function (_p6) { - var _p7 = _p6; - return _p7._0; -}; - -//import // - -var _elm_lang$core$Native_Platform = function() { - - -// PROGRAMS - -function program(impl) -{ - return function(flagDecoder) - { - return function(object, moduleName) - { - object['worker'] = function worker(flags) - { - if (typeof flags !== 'undefined') - { - throw new Error( - 'The `' + moduleName + '` module does not need flags.\n' - + 'Call ' + moduleName + '.worker() with no arguments and you should be all set!' - ); - } - - return initialize( - impl.init, - impl.update, - impl.subscriptions, - renderer - ); - }; - }; - }; -} - -function programWithFlags(impl) -{ - return function(flagDecoder) - { - return function(object, moduleName) - { - object['worker'] = function worker(flags) - { - if (typeof flagDecoder === 'undefined') - { - throw new Error( - 'Are you trying to sneak a Never value into Elm? Trickster!\n' - + 'It looks like ' + moduleName + '.main is defined with `programWithFlags` but has type `Program Never`.\n' - + 'Use `program` instead if you do not want flags.' - ); - } - - var result = A2(_elm_lang$core$Native_Json.run, flagDecoder, flags); - if (result.ctor === 'Err') - { - throw new Error( - moduleName + '.worker(...) was called with an unexpected argument.\n' - + 'I tried to convert it to an Elm value, but ran into this problem:\n\n' - + result._0 - ); - } - - return initialize( - impl.init(result._0), - impl.update, - impl.subscriptions, - renderer - ); - }; - }; - }; -} - -function renderer(enqueue, _) -{ - return function(_) {}; -} - - -// HTML TO PROGRAM - -function htmlToProgram(vnode) -{ - var emptyBag = batch(_elm_lang$core$Native_List.Nil); - var noChange = _elm_lang$core$Native_Utils.Tuple2( - _elm_lang$core$Native_Utils.Tuple0, - emptyBag - ); - - return _elm_lang$virtual_dom$VirtualDom$program({ - init: noChange, - view: function(model) { return main; }, - update: F2(function(msg, model) { return noChange; }), - subscriptions: function (model) { return emptyBag; } - }); -} - - -// INITIALIZE A PROGRAM - -function initialize(init, update, subscriptions, renderer) -{ - // ambient state - var managers = {}; - var updateView; - - // init and update state in main process - var initApp = _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) { - var model = init._0; - updateView = renderer(enqueue, model); - var cmds = init._1; - var subs = subscriptions(model); - dispatchEffects(managers, cmds, subs); - callback(_elm_lang$core$Native_Scheduler.succeed(model)); - }); - - function onMessage(msg, model) - { - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) { - var results = A2(update, msg, model); - model = results._0; - updateView(model); - var cmds = results._1; - var subs = subscriptions(model); - dispatchEffects(managers, cmds, subs); - callback(_elm_lang$core$Native_Scheduler.succeed(model)); - }); - } - - var mainProcess = spawnLoop(initApp, onMessage); - - function enqueue(msg) - { - _elm_lang$core$Native_Scheduler.rawSend(mainProcess, msg); - } - - var ports = setupEffects(managers, enqueue); - - return ports ? { ports: ports } : {}; -} - - -// EFFECT MANAGERS - -var effectManagers = {}; - -function setupEffects(managers, callback) -{ - var ports; - - // setup all necessary effect managers - for (var key in effectManagers) - { - var manager = effectManagers[key]; - - if (manager.isForeign) - { - ports = ports || {}; - ports[key] = manager.tag === 'cmd' - ? setupOutgoingPort(key) - : setupIncomingPort(key, callback); - } - - managers[key] = makeManager(manager, callback); - } - - return ports; -} - -function makeManager(info, callback) -{ - var router = { - main: callback, - self: undefined - }; - - var tag = info.tag; - var onEffects = info.onEffects; - var onSelfMsg = info.onSelfMsg; - - function onMessage(msg, state) - { - if (msg.ctor === 'self') - { - return A3(onSelfMsg, router, msg._0, state); - } - - var fx = msg._0; - switch (tag) - { - case 'cmd': - return A3(onEffects, router, fx.cmds, state); - - case 'sub': - return A3(onEffects, router, fx.subs, state); - - case 'fx': - return A4(onEffects, router, fx.cmds, fx.subs, state); - } - } - - var process = spawnLoop(info.init, onMessage); - router.self = process; - return process; -} - -function sendToApp(router, msg) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - router.main(msg); - callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); - }); -} - -function sendToSelf(router, msg) -{ - return A2(_elm_lang$core$Native_Scheduler.send, router.self, { - ctor: 'self', - _0: msg - }); -} - - -// HELPER for STATEFUL LOOPS - -function spawnLoop(init, onMessage) -{ - var andThen = _elm_lang$core$Native_Scheduler.andThen; - - function loop(state) - { - var handleMsg = _elm_lang$core$Native_Scheduler.receive(function(msg) { - return onMessage(msg, state); - }); - return A2(andThen, loop, handleMsg); - } - - var task = A2(andThen, loop, init); - - return _elm_lang$core$Native_Scheduler.rawSpawn(task); -} - - -// BAGS - -function leaf(home) -{ - return function(value) - { - return { - type: 'leaf', - home: home, - value: value - }; - }; -} - -function batch(list) -{ - return { - type: 'node', - branches: list - }; -} - -function map(tagger, bag) -{ - return { - type: 'map', - tagger: tagger, - tree: bag - } -} - - -// PIPE BAGS INTO EFFECT MANAGERS - -function dispatchEffects(managers, cmdBag, subBag) -{ - var effectsDict = {}; - gatherEffects(true, cmdBag, effectsDict, null); - gatherEffects(false, subBag, effectsDict, null); - - for (var home in managers) - { - var fx = home in effectsDict - ? effectsDict[home] - : { - cmds: _elm_lang$core$Native_List.Nil, - subs: _elm_lang$core$Native_List.Nil - }; - - _elm_lang$core$Native_Scheduler.rawSend(managers[home], { ctor: 'fx', _0: fx }); - } -} - -function gatherEffects(isCmd, bag, effectsDict, taggers) -{ - switch (bag.type) - { - case 'leaf': - var home = bag.home; - var effect = toEffect(isCmd, home, taggers, bag.value); - effectsDict[home] = insert(isCmd, effect, effectsDict[home]); - return; - - case 'node': - var list = bag.branches; - while (list.ctor !== '[]') - { - gatherEffects(isCmd, list._0, effectsDict, taggers); - list = list._1; - } - return; - - case 'map': - gatherEffects(isCmd, bag.tree, effectsDict, { - tagger: bag.tagger, - rest: taggers - }); - return; - } -} - -function toEffect(isCmd, home, taggers, value) -{ - function applyTaggers(x) - { - var temp = taggers; - while (temp) - { - x = temp.tagger(x); - temp = temp.rest; - } - return x; - } - - var map = isCmd - ? effectManagers[home].cmdMap - : effectManagers[home].subMap; - - return A2(map, applyTaggers, value) -} - -function insert(isCmd, newEffect, effects) -{ - effects = effects || { - cmds: _elm_lang$core$Native_List.Nil, - subs: _elm_lang$core$Native_List.Nil - }; - if (isCmd) - { - effects.cmds = _elm_lang$core$Native_List.Cons(newEffect, effects.cmds); - return effects; - } - effects.subs = _elm_lang$core$Native_List.Cons(newEffect, effects.subs); - return effects; -} - - -// PORTS - -function checkPortName(name) -{ - if (name in effectManagers) - { - throw new Error('There can only be one port named `' + name + '`, but your program has multiple.'); - } -} - - -// OUTGOING PORTS - -function outgoingPort(name, converter) -{ - checkPortName(name); - effectManagers[name] = { - tag: 'cmd', - cmdMap: outgoingPortMap, - converter: converter, - isForeign: true - }; - return leaf(name); -} - -var outgoingPortMap = F2(function cmdMap(tagger, value) { - return value; -}); - -function setupOutgoingPort(name) -{ - var subs = []; - var converter = effectManagers[name].converter; - - // CREATE MANAGER - - var init = _elm_lang$core$Native_Scheduler.succeed(null); - - function onEffects(router, cmdList, state) - { - while (cmdList.ctor !== '[]') - { - // grab a separate reference to subs in case unsubscribe is called - var currentSubs = subs; - var value = converter(cmdList._0); - for (var i = 0; i < currentSubs.length; i++) - { - currentSubs[i](value); - } - cmdList = cmdList._1; - } - return init; - } - - effectManagers[name].init = init; - effectManagers[name].onEffects = F3(onEffects); - - // PUBLIC API - - function subscribe(callback) - { - subs.push(callback); - } - - function unsubscribe(callback) - { - // copy subs into a new array in case unsubscribe is called within a - // subscribed callback - subs = subs.slice(); - var index = subs.indexOf(callback); - if (index >= 0) - { - subs.splice(index, 1); - } - } - - return { - subscribe: subscribe, - unsubscribe: unsubscribe - }; -} - - -// INCOMING PORTS - -function incomingPort(name, converter) -{ - checkPortName(name); - effectManagers[name] = { - tag: 'sub', - subMap: incomingPortMap, - converter: converter, - isForeign: true - }; - return leaf(name); -} - -var incomingPortMap = F2(function subMap(tagger, finalTagger) -{ - return function(value) - { - return tagger(finalTagger(value)); - }; -}); - -function setupIncomingPort(name, callback) -{ - var sentBeforeInit = []; - var subs = _elm_lang$core$Native_List.Nil; - var converter = effectManagers[name].converter; - var currentOnEffects = preInitOnEffects; - var currentSend = preInitSend; - - // CREATE MANAGER - - var init = _elm_lang$core$Native_Scheduler.succeed(null); - - function preInitOnEffects(router, subList, state) - { - var postInitResult = postInitOnEffects(router, subList, state); - - for(var i = 0; i < sentBeforeInit.length; i++) - { - postInitSend(sentBeforeInit[i]); - } - - sentBeforeInit = null; // to release objects held in queue - currentSend = postInitSend; - currentOnEffects = postInitOnEffects; - return postInitResult; - } - - function postInitOnEffects(router, subList, state) - { - subs = subList; - return init; - } - - function onEffects(router, subList, state) - { - return currentOnEffects(router, subList, state); - } - - effectManagers[name].init = init; - effectManagers[name].onEffects = F3(onEffects); - - // PUBLIC API - - function preInitSend(value) - { - sentBeforeInit.push(value); - } - - function postInitSend(value) - { - var temp = subs; - while (temp.ctor !== '[]') - { - callback(temp._0(value)); - temp = temp._1; - } - } - - function send(incomingValue) - { - var result = A2(_elm_lang$core$Json_Decode$decodeValue, converter, incomingValue); - if (result.ctor === 'Err') - { - throw new Error('Trying to send an unexpected type of value through port `' + name + '`:\n' + result._0); - } - - currentSend(result._0); - } - - return { send: send }; -} - -return { - // routers - sendToApp: F2(sendToApp), - sendToSelf: F2(sendToSelf), - - // global setup - effectManagers: effectManagers, - outgoingPort: outgoingPort, - incomingPort: incomingPort, - - htmlToProgram: htmlToProgram, - program: program, - programWithFlags: programWithFlags, - initialize: initialize, - - // effect bags - leaf: leaf, - batch: batch, - map: F2(map) -}; - -}(); - -//import Native.Utils // - -var _elm_lang$core$Native_Scheduler = function() { - -var MAX_STEPS = 10000; - - -// TASKS - -function succeed(value) -{ - return { - ctor: '_Task_succeed', - value: value - }; -} - -function fail(error) -{ - return { - ctor: '_Task_fail', - value: error - }; -} - -function nativeBinding(callback) -{ - return { - ctor: '_Task_nativeBinding', - callback: callback, - cancel: null - }; -} - -function andThen(callback, task) -{ - return { - ctor: '_Task_andThen', - callback: callback, - task: task - }; -} - -function onError(callback, task) -{ - return { - ctor: '_Task_onError', - callback: callback, - task: task - }; -} - -function receive(callback) -{ - return { - ctor: '_Task_receive', - callback: callback - }; -} - - -// PROCESSES - -function rawSpawn(task) -{ - var process = { - ctor: '_Process', - id: _elm_lang$core$Native_Utils.guid(), - root: task, - stack: null, - mailbox: [] - }; - - enqueue(process); - - return process; -} - -function spawn(task) -{ - return nativeBinding(function(callback) { - var process = rawSpawn(task); - callback(succeed(process)); - }); -} - -function rawSend(process, msg) -{ - process.mailbox.push(msg); - enqueue(process); -} - -function send(process, msg) -{ - return nativeBinding(function(callback) { - rawSend(process, msg); - callback(succeed(_elm_lang$core$Native_Utils.Tuple0)); - }); -} - -function kill(process) -{ - return nativeBinding(function(callback) { - var root = process.root; - if (root.ctor === '_Task_nativeBinding' && root.cancel) - { - root.cancel(); - } - - process.root = null; - - callback(succeed(_elm_lang$core$Native_Utils.Tuple0)); - }); -} - -function sleep(time) -{ - return nativeBinding(function(callback) { - var id = setTimeout(function() { - callback(succeed(_elm_lang$core$Native_Utils.Tuple0)); - }, time); - - return function() { clearTimeout(id); }; - }); -} - - -// STEP PROCESSES - -function step(numSteps, process) -{ - while (numSteps < MAX_STEPS) - { - var ctor = process.root.ctor; - - if (ctor === '_Task_succeed') - { - while (process.stack && process.stack.ctor === '_Task_onError') - { - process.stack = process.stack.rest; - } - if (process.stack === null) - { - break; - } - process.root = process.stack.callback(process.root.value); - process.stack = process.stack.rest; - ++numSteps; - continue; - } - - if (ctor === '_Task_fail') - { - while (process.stack && process.stack.ctor === '_Task_andThen') - { - process.stack = process.stack.rest; - } - if (process.stack === null) - { - break; - } - process.root = process.stack.callback(process.root.value); - process.stack = process.stack.rest; - ++numSteps; - continue; - } - - if (ctor === '_Task_andThen') - { - process.stack = { - ctor: '_Task_andThen', - callback: process.root.callback, - rest: process.stack - }; - process.root = process.root.task; - ++numSteps; - continue; - } - - if (ctor === '_Task_onError') - { - process.stack = { - ctor: '_Task_onError', - callback: process.root.callback, - rest: process.stack - }; - process.root = process.root.task; - ++numSteps; - continue; - } - - if (ctor === '_Task_nativeBinding') - { - process.root.cancel = process.root.callback(function(newRoot) { - process.root = newRoot; - enqueue(process); - }); - - break; - } - - if (ctor === '_Task_receive') - { - var mailbox = process.mailbox; - if (mailbox.length === 0) - { - break; - } - - process.root = process.root.callback(mailbox.shift()); - ++numSteps; - continue; - } - - throw new Error(ctor); - } - - if (numSteps < MAX_STEPS) - { - return numSteps + 1; - } - enqueue(process); - - return numSteps; -} - - -// WORK QUEUE - -var working = false; -var workQueue = []; - -function enqueue(process) -{ - workQueue.push(process); - - if (!working) - { - setTimeout(work, 0); - working = true; - } -} - -function work() -{ - var numSteps = 0; - var process; - while (numSteps < MAX_STEPS && (process = workQueue.shift())) - { - if (process.root) - { - numSteps = step(numSteps, process); - } - } - if (!process) - { - working = false; - return; - } - setTimeout(work, 0); -} - - -return { - succeed: succeed, - fail: fail, - nativeBinding: nativeBinding, - andThen: F2(andThen), - onError: F2(onError), - receive: receive, - - spawn: spawn, - kill: kill, - sleep: sleep, - send: F2(send), - - rawSpawn: rawSpawn, - rawSend: rawSend -}; - -}(); -var _elm_lang$core$Platform_Cmd$batch = _elm_lang$core$Native_Platform.batch; -var _elm_lang$core$Platform_Cmd$none = _elm_lang$core$Platform_Cmd$batch( - {ctor: '[]'}); -var _elm_lang$core$Platform_Cmd_ops = _elm_lang$core$Platform_Cmd_ops || {}; -_elm_lang$core$Platform_Cmd_ops['!'] = F2( - function (model, commands) { - return { - ctor: '_Tuple2', - _0: model, - _1: _elm_lang$core$Platform_Cmd$batch(commands) - }; - }); -var _elm_lang$core$Platform_Cmd$map = _elm_lang$core$Native_Platform.map; -var _elm_lang$core$Platform_Cmd$Cmd = {ctor: 'Cmd'}; - -var _elm_lang$core$Platform_Sub$batch = _elm_lang$core$Native_Platform.batch; -var _elm_lang$core$Platform_Sub$none = _elm_lang$core$Platform_Sub$batch( - {ctor: '[]'}); -var _elm_lang$core$Platform_Sub$map = _elm_lang$core$Native_Platform.map; -var _elm_lang$core$Platform_Sub$Sub = {ctor: 'Sub'}; - -var _elm_lang$core$Platform$hack = _elm_lang$core$Native_Scheduler.succeed; -var _elm_lang$core$Platform$sendToSelf = _elm_lang$core$Native_Platform.sendToSelf; -var _elm_lang$core$Platform$sendToApp = _elm_lang$core$Native_Platform.sendToApp; -var _elm_lang$core$Platform$programWithFlags = _elm_lang$core$Native_Platform.programWithFlags; -var _elm_lang$core$Platform$program = _elm_lang$core$Native_Platform.program; -var _elm_lang$core$Platform$Program = {ctor: 'Program'}; -var _elm_lang$core$Platform$Task = {ctor: 'Task'}; -var _elm_lang$core$Platform$ProcessId = {ctor: 'ProcessId'}; -var _elm_lang$core$Platform$Router = {ctor: 'Router'}; - -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode = _elm_lang$core$Json_Decode$succeed; -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$resolve = _elm_lang$core$Json_Decode$andThen(_elm_lang$core$Basics$identity); -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$custom = F2( - function (decoder, wrapped) { - return A3( - _elm_lang$core$Json_Decode$map2, - F2( - function (x, y) { - return x(y); - }), - wrapped, - decoder); - }); -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$hardcoded = function (_p0) { - return _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$custom( - _elm_lang$core$Json_Decode$succeed(_p0)); -}; -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$optionalDecoder = F3( - function (pathDecoder, valDecoder, fallback) { - var nullOr = function (decoder) { - return _elm_lang$core$Json_Decode$oneOf( - { - ctor: '::', - _0: decoder, - _1: { - ctor: '::', - _0: _elm_lang$core$Json_Decode$null(fallback), - _1: {ctor: '[]'} - } - }); - }; - var handleResult = function (input) { - var _p1 = A2(_elm_lang$core$Json_Decode$decodeValue, pathDecoder, input); - if (_p1.ctor === 'Ok') { - var _p2 = A2( - _elm_lang$core$Json_Decode$decodeValue, - nullOr(valDecoder), - _p1._0); - if (_p2.ctor === 'Ok') { - return _elm_lang$core$Json_Decode$succeed(_p2._0); - } else { - return _elm_lang$core$Json_Decode$fail(_p2._0); - } - } else { - var _p3 = A2( - _elm_lang$core$Json_Decode$decodeValue, - _elm_lang$core$Json_Decode$keyValuePairs(_elm_lang$core$Json_Decode$value), - input); - if (_p3.ctor === 'Ok') { - return _elm_lang$core$Json_Decode$succeed(fallback); - } else { - return _elm_lang$core$Json_Decode$fail(_p3._0); - } - } - }; - return A2(_elm_lang$core$Json_Decode$andThen, handleResult, _elm_lang$core$Json_Decode$value); - }); -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$optionalAt = F4( - function (path, valDecoder, fallback, decoder) { - return A2( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$custom, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$optionalDecoder, - A2(_elm_lang$core$Json_Decode$at, path, _elm_lang$core$Json_Decode$value), - valDecoder, - fallback), - decoder); - }); -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$optional = F4( - function (key, valDecoder, fallback, decoder) { - return A2( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$custom, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$optionalDecoder, - A2(_elm_lang$core$Json_Decode$field, key, _elm_lang$core$Json_Decode$value), - valDecoder, - fallback), - decoder); - }); -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$requiredAt = F3( - function (path, valDecoder, decoder) { - return A2( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$custom, - A2(_elm_lang$core$Json_Decode$at, path, valDecoder), - decoder); - }); -var _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required = F3( - function (key, valDecoder, decoder) { - return A2( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$custom, - A2(_elm_lang$core$Json_Decode$field, key, valDecoder), - decoder); - }); - -//import Result // - -var _elm_lang$core$Native_Date = function() { - -function fromString(str) -{ - var date = new Date(str); - return isNaN(date.getTime()) - ? _elm_lang$core$Result$Err('Unable to parse \'' + str + '\' as a date. Dates must be in the ISO 8601 format.') - : _elm_lang$core$Result$Ok(date); -} - -var dayTable = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']; -var monthTable = - ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; - - -return { - fromString: fromString, - year: function(d) { return d.getFullYear(); }, - month: function(d) { return { ctor: monthTable[d.getMonth()] }; }, - day: function(d) { return d.getDate(); }, - hour: function(d) { return d.getHours(); }, - minute: function(d) { return d.getMinutes(); }, - second: function(d) { return d.getSeconds(); }, - millisecond: function(d) { return d.getMilliseconds(); }, - toTime: function(d) { return d.getTime(); }, - fromTime: function(t) { return new Date(t); }, - dayOfWeek: function(d) { return { ctor: dayTable[d.getDay()] }; } -}; - -}(); -var _elm_lang$core$Task$onError = _elm_lang$core$Native_Scheduler.onError; -var _elm_lang$core$Task$andThen = _elm_lang$core$Native_Scheduler.andThen; -var _elm_lang$core$Task$spawnCmd = F2( - function (router, _p0) { - var _p1 = _p0; - return _elm_lang$core$Native_Scheduler.spawn( - A2( - _elm_lang$core$Task$andThen, - _elm_lang$core$Platform$sendToApp(router), - _p1._0)); - }); -var _elm_lang$core$Task$fail = _elm_lang$core$Native_Scheduler.fail; -var _elm_lang$core$Task$mapError = F2( - function (convert, task) { - return A2( - _elm_lang$core$Task$onError, - function (_p2) { - return _elm_lang$core$Task$fail( - convert(_p2)); - }, - task); - }); -var _elm_lang$core$Task$succeed = _elm_lang$core$Native_Scheduler.succeed; -var _elm_lang$core$Task$map = F2( - function (func, taskA) { - return A2( - _elm_lang$core$Task$andThen, - function (a) { - return _elm_lang$core$Task$succeed( - func(a)); - }, - taskA); - }); -var _elm_lang$core$Task$map2 = F3( - function (func, taskA, taskB) { - return A2( - _elm_lang$core$Task$andThen, - function (a) { - return A2( - _elm_lang$core$Task$andThen, - function (b) { - return _elm_lang$core$Task$succeed( - A2(func, a, b)); - }, - taskB); - }, - taskA); - }); -var _elm_lang$core$Task$map3 = F4( - function (func, taskA, taskB, taskC) { - return A2( - _elm_lang$core$Task$andThen, - function (a) { - return A2( - _elm_lang$core$Task$andThen, - function (b) { - return A2( - _elm_lang$core$Task$andThen, - function (c) { - return _elm_lang$core$Task$succeed( - A3(func, a, b, c)); - }, - taskC); - }, - taskB); - }, - taskA); - }); -var _elm_lang$core$Task$map4 = F5( - function (func, taskA, taskB, taskC, taskD) { - return A2( - _elm_lang$core$Task$andThen, - function (a) { - return A2( - _elm_lang$core$Task$andThen, - function (b) { - return A2( - _elm_lang$core$Task$andThen, - function (c) { - return A2( - _elm_lang$core$Task$andThen, - function (d) { - return _elm_lang$core$Task$succeed( - A4(func, a, b, c, d)); - }, - taskD); - }, - taskC); - }, - taskB); - }, - taskA); - }); -var _elm_lang$core$Task$map5 = F6( - function (func, taskA, taskB, taskC, taskD, taskE) { - return A2( - _elm_lang$core$Task$andThen, - function (a) { - return A2( - _elm_lang$core$Task$andThen, - function (b) { - return A2( - _elm_lang$core$Task$andThen, - function (c) { - return A2( - _elm_lang$core$Task$andThen, - function (d) { - return A2( - _elm_lang$core$Task$andThen, - function (e) { - return _elm_lang$core$Task$succeed( - A5(func, a, b, c, d, e)); - }, - taskE); - }, - taskD); - }, - taskC); - }, - taskB); - }, - taskA); - }); -var _elm_lang$core$Task$sequence = function (tasks) { - var _p3 = tasks; - if (_p3.ctor === '[]') { - return _elm_lang$core$Task$succeed( - {ctor: '[]'}); - } else { - return A3( - _elm_lang$core$Task$map2, - F2( - function (x, y) { - return {ctor: '::', _0: x, _1: y}; - }), - _p3._0, - _elm_lang$core$Task$sequence(_p3._1)); - } -}; -var _elm_lang$core$Task$onEffects = F3( - function (router, commands, state) { - return A2( - _elm_lang$core$Task$map, - function (_p4) { - return {ctor: '_Tuple0'}; - }, - _elm_lang$core$Task$sequence( - A2( - _elm_lang$core$List$map, - _elm_lang$core$Task$spawnCmd(router), - commands))); - }); -var _elm_lang$core$Task$init = _elm_lang$core$Task$succeed( - {ctor: '_Tuple0'}); -var _elm_lang$core$Task$onSelfMsg = F3( - function (_p7, _p6, _p5) { - return _elm_lang$core$Task$succeed( - {ctor: '_Tuple0'}); - }); -var _elm_lang$core$Task$command = _elm_lang$core$Native_Platform.leaf('Task'); -var _elm_lang$core$Task$Perform = function (a) { - return {ctor: 'Perform', _0: a}; -}; -var _elm_lang$core$Task$perform = F2( - function (toMessage, task) { - return _elm_lang$core$Task$command( - _elm_lang$core$Task$Perform( - A2(_elm_lang$core$Task$map, toMessage, task))); - }); -var _elm_lang$core$Task$attempt = F2( - function (resultToMessage, task) { - return _elm_lang$core$Task$command( - _elm_lang$core$Task$Perform( - A2( - _elm_lang$core$Task$onError, - function (_p8) { - return _elm_lang$core$Task$succeed( - resultToMessage( - _elm_lang$core$Result$Err(_p8))); - }, - A2( - _elm_lang$core$Task$andThen, - function (_p9) { - return _elm_lang$core$Task$succeed( - resultToMessage( - _elm_lang$core$Result$Ok(_p9))); - }, - task)))); - }); -var _elm_lang$core$Task$cmdMap = F2( - function (tagger, _p10) { - var _p11 = _p10; - return _elm_lang$core$Task$Perform( - A2(_elm_lang$core$Task$map, tagger, _p11._0)); - }); -_elm_lang$core$Native_Platform.effectManagers['Task'] = {pkg: 'elm-lang/core', init: _elm_lang$core$Task$init, onEffects: _elm_lang$core$Task$onEffects, onSelfMsg: _elm_lang$core$Task$onSelfMsg, tag: 'cmd', cmdMap: _elm_lang$core$Task$cmdMap}; - -//import Native.Scheduler // - -var _elm_lang$core$Native_Time = function() { - -var now = _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) -{ - callback(_elm_lang$core$Native_Scheduler.succeed(Date.now())); -}); - -function setInterval_(interval, task) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - var id = setInterval(function() { - _elm_lang$core$Native_Scheduler.rawSpawn(task); - }, interval); - - return function() { clearInterval(id); }; - }); -} - -return { - now: now, - setInterval_: F2(setInterval_) -}; - -}(); -var _elm_lang$core$Time$setInterval = _elm_lang$core$Native_Time.setInterval_; -var _elm_lang$core$Time$spawnHelp = F3( - function (router, intervals, processes) { - var _p0 = intervals; - if (_p0.ctor === '[]') { - return _elm_lang$core$Task$succeed(processes); - } else { - var _p1 = _p0._0; - var spawnRest = function (id) { - return A3( - _elm_lang$core$Time$spawnHelp, - router, - _p0._1, - A3(_elm_lang$core$Dict$insert, _p1, id, processes)); - }; - var spawnTimer = _elm_lang$core$Native_Scheduler.spawn( - A2( - _elm_lang$core$Time$setInterval, - _p1, - A2(_elm_lang$core$Platform$sendToSelf, router, _p1))); - return A2(_elm_lang$core$Task$andThen, spawnRest, spawnTimer); - } - }); -var _elm_lang$core$Time$addMySub = F2( - function (_p2, state) { - var _p3 = _p2; - var _p6 = _p3._1; - var _p5 = _p3._0; - var _p4 = A2(_elm_lang$core$Dict$get, _p5, state); - if (_p4.ctor === 'Nothing') { - return A3( - _elm_lang$core$Dict$insert, - _p5, - { - ctor: '::', - _0: _p6, - _1: {ctor: '[]'} - }, - state); - } else { - return A3( - _elm_lang$core$Dict$insert, - _p5, - {ctor: '::', _0: _p6, _1: _p4._0}, - state); - } - }); -var _elm_lang$core$Time$inMilliseconds = function (t) { - return t; -}; -var _elm_lang$core$Time$millisecond = 1; -var _elm_lang$core$Time$second = 1000 * _elm_lang$core$Time$millisecond; -var _elm_lang$core$Time$minute = 60 * _elm_lang$core$Time$second; -var _elm_lang$core$Time$hour = 60 * _elm_lang$core$Time$minute; -var _elm_lang$core$Time$inHours = function (t) { - return t / _elm_lang$core$Time$hour; -}; -var _elm_lang$core$Time$inMinutes = function (t) { - return t / _elm_lang$core$Time$minute; -}; -var _elm_lang$core$Time$inSeconds = function (t) { - return t / _elm_lang$core$Time$second; -}; -var _elm_lang$core$Time$now = _elm_lang$core$Native_Time.now; -var _elm_lang$core$Time$onSelfMsg = F3( - function (router, interval, state) { - var _p7 = A2(_elm_lang$core$Dict$get, interval, state.taggers); - if (_p7.ctor === 'Nothing') { - return _elm_lang$core$Task$succeed(state); - } else { - var tellTaggers = function (time) { - return _elm_lang$core$Task$sequence( - A2( - _elm_lang$core$List$map, - function (tagger) { - return A2( - _elm_lang$core$Platform$sendToApp, - router, - tagger(time)); - }, - _p7._0)); - }; - return A2( - _elm_lang$core$Task$andThen, - function (_p8) { - return _elm_lang$core$Task$succeed(state); - }, - A2(_elm_lang$core$Task$andThen, tellTaggers, _elm_lang$core$Time$now)); - } - }); -var _elm_lang$core$Time$subscription = _elm_lang$core$Native_Platform.leaf('Time'); -var _elm_lang$core$Time$State = F2( - function (a, b) { - return {taggers: a, processes: b}; - }); -var _elm_lang$core$Time$init = _elm_lang$core$Task$succeed( - A2(_elm_lang$core$Time$State, _elm_lang$core$Dict$empty, _elm_lang$core$Dict$empty)); -var _elm_lang$core$Time$onEffects = F3( - function (router, subs, _p9) { - var _p10 = _p9; - var rightStep = F3( - function (_p12, id, _p11) { - var _p13 = _p11; - return { - ctor: '_Tuple3', - _0: _p13._0, - _1: _p13._1, - _2: A2( - _elm_lang$core$Task$andThen, - function (_p14) { - return _p13._2; - }, - _elm_lang$core$Native_Scheduler.kill(id)) - }; - }); - var bothStep = F4( - function (interval, taggers, id, _p15) { - var _p16 = _p15; - return { - ctor: '_Tuple3', - _0: _p16._0, - _1: A3(_elm_lang$core$Dict$insert, interval, id, _p16._1), - _2: _p16._2 - }; - }); - var leftStep = F3( - function (interval, taggers, _p17) { - var _p18 = _p17; - return { - ctor: '_Tuple3', - _0: {ctor: '::', _0: interval, _1: _p18._0}, - _1: _p18._1, - _2: _p18._2 - }; - }); - var newTaggers = A3(_elm_lang$core$List$foldl, _elm_lang$core$Time$addMySub, _elm_lang$core$Dict$empty, subs); - var _p19 = A6( - _elm_lang$core$Dict$merge, - leftStep, - bothStep, - rightStep, - newTaggers, - _p10.processes, - { - ctor: '_Tuple3', - _0: {ctor: '[]'}, - _1: _elm_lang$core$Dict$empty, - _2: _elm_lang$core$Task$succeed( - {ctor: '_Tuple0'}) - }); - var spawnList = _p19._0; - var existingDict = _p19._1; - var killTask = _p19._2; - return A2( - _elm_lang$core$Task$andThen, - function (newProcesses) { - return _elm_lang$core$Task$succeed( - A2(_elm_lang$core$Time$State, newTaggers, newProcesses)); - }, - A2( - _elm_lang$core$Task$andThen, - function (_p20) { - return A3(_elm_lang$core$Time$spawnHelp, router, spawnList, existingDict); - }, - killTask)); - }); -var _elm_lang$core$Time$Every = F2( - function (a, b) { - return {ctor: 'Every', _0: a, _1: b}; - }); -var _elm_lang$core$Time$every = F2( - function (interval, tagger) { - return _elm_lang$core$Time$subscription( - A2(_elm_lang$core$Time$Every, interval, tagger)); - }); -var _elm_lang$core$Time$subMap = F2( - function (f, _p21) { - var _p22 = _p21; - return A2( - _elm_lang$core$Time$Every, - _p22._0, - function (_p23) { - return f( - _p22._1(_p23)); - }); - }); -_elm_lang$core$Native_Platform.effectManagers['Time'] = {pkg: 'elm-lang/core', init: _elm_lang$core$Time$init, onEffects: _elm_lang$core$Time$onEffects, onSelfMsg: _elm_lang$core$Time$onSelfMsg, tag: 'sub', subMap: _elm_lang$core$Time$subMap}; - -var _elm_lang$core$Date$millisecond = _elm_lang$core$Native_Date.millisecond; -var _elm_lang$core$Date$second = _elm_lang$core$Native_Date.second; -var _elm_lang$core$Date$minute = _elm_lang$core$Native_Date.minute; -var _elm_lang$core$Date$hour = _elm_lang$core$Native_Date.hour; -var _elm_lang$core$Date$dayOfWeek = _elm_lang$core$Native_Date.dayOfWeek; -var _elm_lang$core$Date$day = _elm_lang$core$Native_Date.day; -var _elm_lang$core$Date$month = _elm_lang$core$Native_Date.month; -var _elm_lang$core$Date$year = _elm_lang$core$Native_Date.year; -var _elm_lang$core$Date$fromTime = _elm_lang$core$Native_Date.fromTime; -var _elm_lang$core$Date$toTime = _elm_lang$core$Native_Date.toTime; -var _elm_lang$core$Date$fromString = _elm_lang$core$Native_Date.fromString; -var _elm_lang$core$Date$now = A2(_elm_lang$core$Task$map, _elm_lang$core$Date$fromTime, _elm_lang$core$Time$now); -var _elm_lang$core$Date$Date = {ctor: 'Date'}; -var _elm_lang$core$Date$Sun = {ctor: 'Sun'}; -var _elm_lang$core$Date$Sat = {ctor: 'Sat'}; -var _elm_lang$core$Date$Fri = {ctor: 'Fri'}; -var _elm_lang$core$Date$Thu = {ctor: 'Thu'}; -var _elm_lang$core$Date$Wed = {ctor: 'Wed'}; -var _elm_lang$core$Date$Tue = {ctor: 'Tue'}; -var _elm_lang$core$Date$Mon = {ctor: 'Mon'}; -var _elm_lang$core$Date$Dec = {ctor: 'Dec'}; -var _elm_lang$core$Date$Nov = {ctor: 'Nov'}; -var _elm_lang$core$Date$Oct = {ctor: 'Oct'}; -var _elm_lang$core$Date$Sep = {ctor: 'Sep'}; -var _elm_lang$core$Date$Aug = {ctor: 'Aug'}; -var _elm_lang$core$Date$Jul = {ctor: 'Jul'}; -var _elm_lang$core$Date$Jun = {ctor: 'Jun'}; -var _elm_lang$core$Date$May = {ctor: 'May'}; -var _elm_lang$core$Date$Apr = {ctor: 'Apr'}; -var _elm_lang$core$Date$Mar = {ctor: 'Mar'}; -var _elm_lang$core$Date$Feb = {ctor: 'Feb'}; -var _elm_lang$core$Date$Jan = {ctor: 'Jan'}; - -var _elm_lang$core$Set$foldr = F3( - function (f, b, _p0) { - var _p1 = _p0; - return A3( - _elm_lang$core$Dict$foldr, - F3( - function (k, _p2, b) { - return A2(f, k, b); - }), - b, - _p1._0); - }); -var _elm_lang$core$Set$foldl = F3( - function (f, b, _p3) { - var _p4 = _p3; - return A3( - _elm_lang$core$Dict$foldl, - F3( - function (k, _p5, b) { - return A2(f, k, b); - }), - b, - _p4._0); - }); -var _elm_lang$core$Set$toList = function (_p6) { - var _p7 = _p6; - return _elm_lang$core$Dict$keys(_p7._0); -}; -var _elm_lang$core$Set$size = function (_p8) { - var _p9 = _p8; - return _elm_lang$core$Dict$size(_p9._0); -}; -var _elm_lang$core$Set$member = F2( - function (k, _p10) { - var _p11 = _p10; - return A2(_elm_lang$core$Dict$member, k, _p11._0); - }); -var _elm_lang$core$Set$isEmpty = function (_p12) { - var _p13 = _p12; - return _elm_lang$core$Dict$isEmpty(_p13._0); -}; -var _elm_lang$core$Set$Set_elm_builtin = function (a) { - return {ctor: 'Set_elm_builtin', _0: a}; -}; -var _elm_lang$core$Set$empty = _elm_lang$core$Set$Set_elm_builtin(_elm_lang$core$Dict$empty); -var _elm_lang$core$Set$singleton = function (k) { - return _elm_lang$core$Set$Set_elm_builtin( - A2( - _elm_lang$core$Dict$singleton, - k, - {ctor: '_Tuple0'})); -}; -var _elm_lang$core$Set$insert = F2( - function (k, _p14) { - var _p15 = _p14; - return _elm_lang$core$Set$Set_elm_builtin( - A3( - _elm_lang$core$Dict$insert, - k, - {ctor: '_Tuple0'}, - _p15._0)); - }); -var _elm_lang$core$Set$fromList = function (xs) { - return A3(_elm_lang$core$List$foldl, _elm_lang$core$Set$insert, _elm_lang$core$Set$empty, xs); -}; -var _elm_lang$core$Set$map = F2( - function (f, s) { - return _elm_lang$core$Set$fromList( - A2( - _elm_lang$core$List$map, - f, - _elm_lang$core$Set$toList(s))); - }); -var _elm_lang$core$Set$remove = F2( - function (k, _p16) { - var _p17 = _p16; - return _elm_lang$core$Set$Set_elm_builtin( - A2(_elm_lang$core$Dict$remove, k, _p17._0)); - }); -var _elm_lang$core$Set$union = F2( - function (_p19, _p18) { - var _p20 = _p19; - var _p21 = _p18; - return _elm_lang$core$Set$Set_elm_builtin( - A2(_elm_lang$core$Dict$union, _p20._0, _p21._0)); - }); -var _elm_lang$core$Set$intersect = F2( - function (_p23, _p22) { - var _p24 = _p23; - var _p25 = _p22; - return _elm_lang$core$Set$Set_elm_builtin( - A2(_elm_lang$core$Dict$intersect, _p24._0, _p25._0)); - }); -var _elm_lang$core$Set$diff = F2( - function (_p27, _p26) { - var _p28 = _p27; - var _p29 = _p26; - return _elm_lang$core$Set$Set_elm_builtin( - A2(_elm_lang$core$Dict$diff, _p28._0, _p29._0)); - }); -var _elm_lang$core$Set$filter = F2( - function (p, _p30) { - var _p31 = _p30; - return _elm_lang$core$Set$Set_elm_builtin( - A2( - _elm_lang$core$Dict$filter, - F2( - function (k, _p32) { - return p(k); - }), - _p31._0)); - }); -var _elm_lang$core$Set$partition = F2( - function (p, _p33) { - var _p34 = _p33; - var _p35 = A2( - _elm_lang$core$Dict$partition, - F2( - function (k, _p36) { - return p(k); - }), - _p34._0); - var p1 = _p35._0; - var p2 = _p35._1; - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Set$Set_elm_builtin(p1), - _1: _elm_lang$core$Set$Set_elm_builtin(p2) - }; - }); - -var _elm_community$json_extra$Json_Decode_Extra$when = F3( - function (checkDecoder, check, passDecoder) { - return A2( - _elm_lang$core$Json_Decode$andThen, - function (checkVal) { - return check(checkVal) ? passDecoder : _elm_lang$core$Json_Decode$fail( - A2( - _elm_lang$core$Basics_ops['++'], - 'Check failed with input `', - A2( - _elm_lang$core$Basics_ops['++'], - _elm_lang$core$Basics$toString(checkVal), - '`'))); - }, - checkDecoder); - }); -var _elm_community$json_extra$Json_Decode_Extra$combine = A2( - _elm_lang$core$List$foldr, - _elm_lang$core$Json_Decode$map2( - F2( - function (x, y) { - return {ctor: '::', _0: x, _1: y}; - })), - _elm_lang$core$Json_Decode$succeed( - {ctor: '[]'})); -var _elm_community$json_extra$Json_Decode_Extra$collection = function (decoder) { - return A2( - _elm_lang$core$Json_Decode$andThen, - function (length) { - return _elm_community$json_extra$Json_Decode_Extra$combine( - A2( - _elm_lang$core$List$map, - function (index) { - return A2( - _elm_lang$core$Json_Decode$field, - _elm_lang$core$Basics$toString(index), - decoder); - }, - A2(_elm_lang$core$List$range, 0, length - 1))); - }, - A2(_elm_lang$core$Json_Decode$field, 'length', _elm_lang$core$Json_Decode$int)); -}; -var _elm_community$json_extra$Json_Decode_Extra$fromResult = function (result) { - var _p0 = result; - if (_p0.ctor === 'Ok') { - return _elm_lang$core$Json_Decode$succeed(_p0._0); - } else { - return _elm_lang$core$Json_Decode$fail(_p0._0); - } -}; -var _elm_community$json_extra$Json_Decode_Extra$parseInt = A2( - _elm_lang$core$Json_Decode$andThen, - function (_p1) { - return _elm_community$json_extra$Json_Decode_Extra$fromResult( - _elm_lang$core$String$toInt(_p1)); - }, - _elm_lang$core$Json_Decode$string); -var _elm_community$json_extra$Json_Decode_Extra$parseFloat = A2( - _elm_lang$core$Json_Decode$andThen, - function (_p2) { - return _elm_community$json_extra$Json_Decode_Extra$fromResult( - _elm_lang$core$String$toFloat(_p2)); - }, - _elm_lang$core$Json_Decode$string); -var _elm_community$json_extra$Json_Decode_Extra$doubleEncoded = function (decoder) { - return A2( - _elm_lang$core$Json_Decode$andThen, - function (_p3) { - return _elm_community$json_extra$Json_Decode_Extra$fromResult( - A2(_elm_lang$core$Json_Decode$decodeString, decoder, _p3)); - }, - _elm_lang$core$Json_Decode$string); -}; -var _elm_community$json_extra$Json_Decode_Extra$keys = A2( - _elm_lang$core$Json_Decode$map, - A2( - _elm_lang$core$List$foldl, - F2( - function (_p4, acc) { - var _p5 = _p4; - return {ctor: '::', _0: _p5._0, _1: acc}; - }), - {ctor: '[]'}), - _elm_lang$core$Json_Decode$keyValuePairs( - _elm_lang$core$Json_Decode$succeed( - {ctor: '_Tuple0'}))); -var _elm_community$json_extra$Json_Decode_Extra$sequenceHelp = F2( - function (decoders, jsonValues) { - return (!_elm_lang$core$Native_Utils.eq( - _elm_lang$core$List$length(jsonValues), - _elm_lang$core$List$length(decoders))) ? _elm_lang$core$Json_Decode$fail('Number of decoders does not match number of values') : _elm_community$json_extra$Json_Decode_Extra$fromResult( - A3( - _elm_lang$core$List$foldr, - _elm_lang$core$Result$map2( - F2( - function (x, y) { - return {ctor: '::', _0: x, _1: y}; - })), - _elm_lang$core$Result$Ok( - {ctor: '[]'}), - A3(_elm_lang$core$List$map2, _elm_lang$core$Json_Decode$decodeValue, decoders, jsonValues))); - }); -var _elm_community$json_extra$Json_Decode_Extra$sequence = function (decoders) { - return A2( - _elm_lang$core$Json_Decode$andThen, - _elm_community$json_extra$Json_Decode_Extra$sequenceHelp(decoders), - _elm_lang$core$Json_Decode$list(_elm_lang$core$Json_Decode$value)); -}; -var _elm_community$json_extra$Json_Decode_Extra$indexedList = function (indexedDecoder) { - return A2( - _elm_lang$core$Json_Decode$andThen, - function (values) { - return _elm_community$json_extra$Json_Decode_Extra$sequence( - A2( - _elm_lang$core$List$map, - indexedDecoder, - A2( - _elm_lang$core$List$range, - 0, - _elm_lang$core$List$length(values) - 1))); - }, - _elm_lang$core$Json_Decode$list(_elm_lang$core$Json_Decode$value)); -}; -var _elm_community$json_extra$Json_Decode_Extra$optionalField = F2( - function (fieldName, decoder) { - var finishDecoding = function (json) { - var _p6 = A2( - _elm_lang$core$Json_Decode$decodeValue, - A2(_elm_lang$core$Json_Decode$field, fieldName, _elm_lang$core$Json_Decode$value), - json); - if (_p6.ctor === 'Ok') { - return A2( - _elm_lang$core$Json_Decode$map, - _elm_lang$core$Maybe$Just, - A2(_elm_lang$core$Json_Decode$field, fieldName, decoder)); - } else { - return _elm_lang$core$Json_Decode$succeed(_elm_lang$core$Maybe$Nothing); - } - }; - return A2(_elm_lang$core$Json_Decode$andThen, finishDecoding, _elm_lang$core$Json_Decode$value); - }); -var _elm_community$json_extra$Json_Decode_Extra$withDefault = F2( - function (fallback, decoder) { - return A2( - _elm_lang$core$Json_Decode$map, - _elm_lang$core$Maybe$withDefault(fallback), - _elm_lang$core$Json_Decode$maybe(decoder)); - }); -var _elm_community$json_extra$Json_Decode_Extra$decodeDictFromTuples = F2( - function (keyDecoder, tuples) { - var _p7 = tuples; - if (_p7.ctor === '[]') { - return _elm_lang$core$Json_Decode$succeed(_elm_lang$core$Dict$empty); - } else { - var _p8 = A2(_elm_lang$core$Json_Decode$decodeString, keyDecoder, _p7._0._0); - if (_p8.ctor === 'Ok') { - return A2( - _elm_lang$core$Json_Decode$andThen, - function (_p9) { - return _elm_lang$core$Json_Decode$succeed( - A3(_elm_lang$core$Dict$insert, _p8._0, _p7._0._1, _p9)); - }, - A2(_elm_community$json_extra$Json_Decode_Extra$decodeDictFromTuples, keyDecoder, _p7._1)); - } else { - return _elm_lang$core$Json_Decode$fail(_p8._0); - } - } - }); -var _elm_community$json_extra$Json_Decode_Extra$dict2 = F2( - function (keyDecoder, valueDecoder) { - return A2( - _elm_lang$core$Json_Decode$andThen, - _elm_community$json_extra$Json_Decode_Extra$decodeDictFromTuples(keyDecoder), - _elm_lang$core$Json_Decode$keyValuePairs(valueDecoder)); - }); -var _elm_community$json_extra$Json_Decode_Extra$set = function (decoder) { - return A2( - _elm_lang$core$Json_Decode$map, - _elm_lang$core$Set$fromList, - _elm_lang$core$Json_Decode$list(decoder)); -}; -var _elm_community$json_extra$Json_Decode_Extra$date = A2( - _elm_lang$core$Json_Decode$andThen, - function (_p10) { - return _elm_community$json_extra$Json_Decode_Extra$fromResult( - _elm_lang$core$Date$fromString(_p10)); - }, - _elm_lang$core$Json_Decode$string); -var _elm_community$json_extra$Json_Decode_Extra$andMap = _elm_lang$core$Json_Decode$map2( - F2( - function (x, y) { - return y(x); - })); -var _elm_community$json_extra$Json_Decode_Extra_ops = _elm_community$json_extra$Json_Decode_Extra_ops || {}; -_elm_community$json_extra$Json_Decode_Extra_ops['|:'] = _elm_lang$core$Basics$flip(_elm_community$json_extra$Json_Decode_Extra$andMap); - -//import Maybe, Native.List // - -var _elm_lang$core$Native_Regex = function() { - -function escape(str) -{ - return str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); -} -function caseInsensitive(re) -{ - return new RegExp(re.source, 'gi'); -} -function regex(raw) -{ - return new RegExp(raw, 'g'); -} - -function contains(re, string) -{ - return string.match(re) !== null; -} - -function find(n, re, str) -{ - n = n.ctor === 'All' ? Infinity : n._0; - var out = []; - var number = 0; - var string = str; - var lastIndex = re.lastIndex; - var prevLastIndex = -1; - var result; - while (number++ < n && (result = re.exec(string))) - { - if (prevLastIndex === re.lastIndex) break; - var i = result.length - 1; - var subs = new Array(i); - while (i > 0) - { - var submatch = result[i]; - subs[--i] = submatch === undefined - ? _elm_lang$core$Maybe$Nothing - : _elm_lang$core$Maybe$Just(submatch); - } - out.push({ - match: result[0], - submatches: _elm_lang$core$Native_List.fromArray(subs), - index: result.index, - number: number - }); - prevLastIndex = re.lastIndex; - } - re.lastIndex = lastIndex; - return _elm_lang$core$Native_List.fromArray(out); -} - -function replace(n, re, replacer, string) -{ - n = n.ctor === 'All' ? Infinity : n._0; - var count = 0; - function jsReplacer(match) - { - if (count++ >= n) - { - return match; - } - var i = arguments.length - 3; - var submatches = new Array(i); - while (i > 0) - { - var submatch = arguments[i]; - submatches[--i] = submatch === undefined - ? _elm_lang$core$Maybe$Nothing - : _elm_lang$core$Maybe$Just(submatch); - } - return replacer({ - match: match, - submatches: _elm_lang$core$Native_List.fromArray(submatches), - index: arguments[arguments.length - 2], - number: count - }); - } - return string.replace(re, jsReplacer); -} - -function split(n, re, str) -{ - n = n.ctor === 'All' ? Infinity : n._0; - if (n === Infinity) - { - return _elm_lang$core$Native_List.fromArray(str.split(re)); - } - var string = str; - var result; - var out = []; - var start = re.lastIndex; - var restoreLastIndex = re.lastIndex; - while (n--) - { - if (!(result = re.exec(string))) break; - out.push(string.slice(start, result.index)); - start = re.lastIndex; - } - out.push(string.slice(start)); - re.lastIndex = restoreLastIndex; - return _elm_lang$core$Native_List.fromArray(out); -} - -return { - regex: regex, - caseInsensitive: caseInsensitive, - escape: escape, - - contains: F2(contains), - find: F3(find), - replace: F4(replace), - split: F3(split) -}; - -}(); - -var _elm_lang$core$Process$kill = _elm_lang$core$Native_Scheduler.kill; -var _elm_lang$core$Process$sleep = _elm_lang$core$Native_Scheduler.sleep; -var _elm_lang$core$Process$spawn = _elm_lang$core$Native_Scheduler.spawn; - -var _elm_lang$core$Regex$split = _elm_lang$core$Native_Regex.split; -var _elm_lang$core$Regex$replace = _elm_lang$core$Native_Regex.replace; -var _elm_lang$core$Regex$find = _elm_lang$core$Native_Regex.find; -var _elm_lang$core$Regex$contains = _elm_lang$core$Native_Regex.contains; -var _elm_lang$core$Regex$caseInsensitive = _elm_lang$core$Native_Regex.caseInsensitive; -var _elm_lang$core$Regex$regex = _elm_lang$core$Native_Regex.regex; -var _elm_lang$core$Regex$escape = _elm_lang$core$Native_Regex.escape; -var _elm_lang$core$Regex$Match = F4( - function (a, b, c, d) { - return {match: a, submatches: b, index: c, number: d}; - }); -var _elm_lang$core$Regex$Regex = {ctor: 'Regex'}; -var _elm_lang$core$Regex$AtMost = function (a) { - return {ctor: 'AtMost', _0: a}; -}; -var _elm_lang$core$Regex$All = {ctor: 'All'}; - -var _elm_lang$dom$Native_Dom = function() { - -var fakeNode = { - addEventListener: function() {}, - removeEventListener: function() {} -}; - -var onDocument = on(typeof document !== 'undefined' ? document : fakeNode); -var onWindow = on(typeof window !== 'undefined' ? window : fakeNode); - -function on(node) -{ - return function(eventName, decoder, toTask) - { - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) { - - function performTask(event) - { - var result = A2(_elm_lang$core$Json_Decode$decodeValue, decoder, event); - if (result.ctor === 'Ok') - { - _elm_lang$core$Native_Scheduler.rawSpawn(toTask(result._0)); - } - } - - node.addEventListener(eventName, performTask); - - return function() - { - node.removeEventListener(eventName, performTask); - }; - }); - }; -} - -var rAF = typeof requestAnimationFrame !== 'undefined' - ? requestAnimationFrame - : function(callback) { callback(); }; - -function withNode(id, doStuff) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - rAF(function() - { - var node = document.getElementById(id); - if (node === null) - { - callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'NotFound', _0: id })); - return; - } - callback(_elm_lang$core$Native_Scheduler.succeed(doStuff(node))); - }); - }); -} - - -// FOCUS - -function focus(id) -{ - return withNode(id, function(node) { - node.focus(); - return _elm_lang$core$Native_Utils.Tuple0; - }); -} - -function blur(id) -{ - return withNode(id, function(node) { - node.blur(); - return _elm_lang$core$Native_Utils.Tuple0; - }); -} - - -// SCROLLING - -function getScrollTop(id) -{ - return withNode(id, function(node) { - return node.scrollTop; - }); -} - -function setScrollTop(id, desiredScrollTop) -{ - return withNode(id, function(node) { - node.scrollTop = desiredScrollTop; - return _elm_lang$core$Native_Utils.Tuple0; - }); -} - -function toBottom(id) -{ - return withNode(id, function(node) { - node.scrollTop = node.scrollHeight; - return _elm_lang$core$Native_Utils.Tuple0; - }); -} - -function getScrollLeft(id) -{ - return withNode(id, function(node) { - return node.scrollLeft; - }); -} - -function setScrollLeft(id, desiredScrollLeft) -{ - return withNode(id, function(node) { - node.scrollLeft = desiredScrollLeft; - return _elm_lang$core$Native_Utils.Tuple0; - }); -} - -function toRight(id) -{ - return withNode(id, function(node) { - node.scrollLeft = node.scrollWidth; - return _elm_lang$core$Native_Utils.Tuple0; - }); -} - - -// SIZE - -function width(options, id) -{ - return withNode(id, function(node) { - switch (options.ctor) - { - case 'Content': - return node.scrollWidth; - case 'VisibleContent': - return node.clientWidth; - case 'VisibleContentWithBorders': - return node.offsetWidth; - case 'VisibleContentWithBordersAndMargins': - var rect = node.getBoundingClientRect(); - return rect.right - rect.left; - } - }); -} - -function height(options, id) -{ - return withNode(id, function(node) { - switch (options.ctor) - { - case 'Content': - return node.scrollHeight; - case 'VisibleContent': - return node.clientHeight; - case 'VisibleContentWithBorders': - return node.offsetHeight; - case 'VisibleContentWithBordersAndMargins': - var rect = node.getBoundingClientRect(); - return rect.bottom - rect.top; - } - }); -} - -return { - onDocument: F3(onDocument), - onWindow: F3(onWindow), - - focus: focus, - blur: blur, - - getScrollTop: getScrollTop, - setScrollTop: F2(setScrollTop), - getScrollLeft: getScrollLeft, - setScrollLeft: F2(setScrollLeft), - toBottom: toBottom, - toRight: toRight, - - height: F2(height), - width: F2(width) -}; - -}(); - -var _elm_lang$dom$Dom_LowLevel$onWindow = _elm_lang$dom$Native_Dom.onWindow; -var _elm_lang$dom$Dom_LowLevel$onDocument = _elm_lang$dom$Native_Dom.onDocument; - -var _elm_lang$virtual_dom$VirtualDom_Debug$wrap; -var _elm_lang$virtual_dom$VirtualDom_Debug$wrapWithFlags; - -var _elm_lang$virtual_dom$Native_VirtualDom = function() { - -var STYLE_KEY = 'STYLE'; -var EVENT_KEY = 'EVENT'; -var ATTR_KEY = 'ATTR'; -var ATTR_NS_KEY = 'ATTR_NS'; - -var localDoc = typeof document !== 'undefined' ? document : {}; - - -//////////// VIRTUAL DOM NODES //////////// - - -function text(string) -{ - return { - type: 'text', - text: string - }; -} - - -function node(tag) -{ - return F2(function(factList, kidList) { - return nodeHelp(tag, factList, kidList); - }); -} - - -function nodeHelp(tag, factList, kidList) -{ - var organized = organizeFacts(factList); - var namespace = organized.namespace; - var facts = organized.facts; - - var children = []; - var descendantsCount = 0; - while (kidList.ctor !== '[]') - { - var kid = kidList._0; - descendantsCount += (kid.descendantsCount || 0); - children.push(kid); - kidList = kidList._1; - } - descendantsCount += children.length; - - return { - type: 'node', - tag: tag, - facts: facts, - children: children, - namespace: namespace, - descendantsCount: descendantsCount - }; -} - - -function keyedNode(tag, factList, kidList) -{ - var organized = organizeFacts(factList); - var namespace = organized.namespace; - var facts = organized.facts; - - var children = []; - var descendantsCount = 0; - while (kidList.ctor !== '[]') - { - var kid = kidList._0; - descendantsCount += (kid._1.descendantsCount || 0); - children.push(kid); - kidList = kidList._1; - } - descendantsCount += children.length; - - return { - type: 'keyed-node', - tag: tag, - facts: facts, - children: children, - namespace: namespace, - descendantsCount: descendantsCount - }; -} - - -function custom(factList, model, impl) -{ - var facts = organizeFacts(factList).facts; - - return { - type: 'custom', - facts: facts, - model: model, - impl: impl - }; -} - - -function map(tagger, node) -{ - return { - type: 'tagger', - tagger: tagger, - node: node, - descendantsCount: 1 + (node.descendantsCount || 0) - }; -} - - -function thunk(func, args, thunk) -{ - return { - type: 'thunk', - func: func, - args: args, - thunk: thunk, - node: undefined - }; -} - -function lazy(fn, a) -{ - return thunk(fn, [a], function() { - return fn(a); - }); -} - -function lazy2(fn, a, b) -{ - return thunk(fn, [a,b], function() { - return A2(fn, a, b); - }); -} - -function lazy3(fn, a, b, c) -{ - return thunk(fn, [a,b,c], function() { - return A3(fn, a, b, c); - }); -} - - - -// FACTS - - -function organizeFacts(factList) -{ - var namespace, facts = {}; - - while (factList.ctor !== '[]') - { - var entry = factList._0; - var key = entry.key; - - if (key === ATTR_KEY || key === ATTR_NS_KEY || key === EVENT_KEY) - { - var subFacts = facts[key] || {}; - subFacts[entry.realKey] = entry.value; - facts[key] = subFacts; - } - else if (key === STYLE_KEY) - { - var styles = facts[key] || {}; - var styleList = entry.value; - while (styleList.ctor !== '[]') - { - var style = styleList._0; - styles[style._0] = style._1; - styleList = styleList._1; - } - facts[key] = styles; - } - else if (key === 'namespace') - { - namespace = entry.value; - } - else if (key === 'className') - { - var classes = facts[key]; - facts[key] = typeof classes === 'undefined' - ? entry.value - : classes + ' ' + entry.value; - } - else - { - facts[key] = entry.value; - } - factList = factList._1; - } - - return { - facts: facts, - namespace: namespace - }; -} - - - -//////////// PROPERTIES AND ATTRIBUTES //////////// - - -function style(value) -{ - return { - key: STYLE_KEY, - value: value - }; -} - - -function property(key, value) -{ - return { - key: key, - value: value - }; -} - - -function attribute(key, value) -{ - return { - key: ATTR_KEY, - realKey: key, - value: value - }; -} - - -function attributeNS(namespace, key, value) -{ - return { - key: ATTR_NS_KEY, - realKey: key, - value: { - value: value, - namespace: namespace - } - }; -} - - -function on(name, options, decoder) -{ - return { - key: EVENT_KEY, - realKey: name, - value: { - options: options, - decoder: decoder - } - }; -} - - -function equalEvents(a, b) -{ - if (a.options !== b.options) - { - if (a.options.stopPropagation !== b.options.stopPropagation || a.options.preventDefault !== b.options.preventDefault) - { - return false; - } - } - return _elm_lang$core$Native_Json.equality(a.decoder, b.decoder); -} - - -function mapProperty(func, property) -{ - if (property.key !== EVENT_KEY) - { - return property; - } - return on( - property.realKey, - property.value.options, - A2(_elm_lang$core$Json_Decode$map, func, property.value.decoder) - ); -} - - -//////////// RENDER //////////// - - -function render(vNode, eventNode) -{ - switch (vNode.type) - { - case 'thunk': - if (!vNode.node) - { - vNode.node = vNode.thunk(); - } - return render(vNode.node, eventNode); - - case 'tagger': - var subNode = vNode.node; - var tagger = vNode.tagger; - - while (subNode.type === 'tagger') - { - typeof tagger !== 'object' - ? tagger = [tagger, subNode.tagger] - : tagger.push(subNode.tagger); - - subNode = subNode.node; - } - - var subEventRoot = { tagger: tagger, parent: eventNode }; - var domNode = render(subNode, subEventRoot); - domNode.elm_event_node_ref = subEventRoot; - return domNode; - - case 'text': - return localDoc.createTextNode(vNode.text); - - case 'node': - var domNode = vNode.namespace - ? localDoc.createElementNS(vNode.namespace, vNode.tag) - : localDoc.createElement(vNode.tag); - - applyFacts(domNode, eventNode, vNode.facts); - - var children = vNode.children; - - for (var i = 0; i < children.length; i++) - { - domNode.appendChild(render(children[i], eventNode)); - } - - return domNode; - - case 'keyed-node': - var domNode = vNode.namespace - ? localDoc.createElementNS(vNode.namespace, vNode.tag) - : localDoc.createElement(vNode.tag); - - applyFacts(domNode, eventNode, vNode.facts); - - var children = vNode.children; - - for (var i = 0; i < children.length; i++) - { - domNode.appendChild(render(children[i]._1, eventNode)); - } - - return domNode; - - case 'custom': - var domNode = vNode.impl.render(vNode.model); - applyFacts(domNode, eventNode, vNode.facts); - return domNode; - } -} - - - -//////////// APPLY FACTS //////////// - - -function applyFacts(domNode, eventNode, facts) -{ - for (var key in facts) - { - var value = facts[key]; - - switch (key) - { - case STYLE_KEY: - applyStyles(domNode, value); - break; - - case EVENT_KEY: - applyEvents(domNode, eventNode, value); - break; - - case ATTR_KEY: - applyAttrs(domNode, value); - break; - - case ATTR_NS_KEY: - applyAttrsNS(domNode, value); - break; - - case 'value': - if (domNode[key] !== value) - { - domNode[key] = value; - } - break; - - default: - domNode[key] = value; - break; - } - } -} - -function applyStyles(domNode, styles) -{ - var domNodeStyle = domNode.style; - - for (var key in styles) - { - domNodeStyle[key] = styles[key]; - } -} - -function applyEvents(domNode, eventNode, events) -{ - var allHandlers = domNode.elm_handlers || {}; - - for (var key in events) - { - var handler = allHandlers[key]; - var value = events[key]; - - if (typeof value === 'undefined') - { - domNode.removeEventListener(key, handler); - allHandlers[key] = undefined; - } - else if (typeof handler === 'undefined') - { - var handler = makeEventHandler(eventNode, value); - domNode.addEventListener(key, handler); - allHandlers[key] = handler; - } - else - { - handler.info = value; - } - } - - domNode.elm_handlers = allHandlers; -} - -function makeEventHandler(eventNode, info) -{ - function eventHandler(event) - { - var info = eventHandler.info; - - var value = A2(_elm_lang$core$Native_Json.run, info.decoder, event); - - if (value.ctor === 'Ok') - { - var options = info.options; - if (options.stopPropagation) - { - event.stopPropagation(); - } - if (options.preventDefault) - { - event.preventDefault(); - } - - var message = value._0; - - var currentEventNode = eventNode; - while (currentEventNode) - { - var tagger = currentEventNode.tagger; - if (typeof tagger === 'function') - { - message = tagger(message); - } - else - { - for (var i = tagger.length; i--; ) - { - message = tagger[i](message); - } - } - currentEventNode = currentEventNode.parent; - } - } - }; - - eventHandler.info = info; - - return eventHandler; -} - -function applyAttrs(domNode, attrs) -{ - for (var key in attrs) - { - var value = attrs[key]; - if (typeof value === 'undefined') - { - domNode.removeAttribute(key); - } - else - { - domNode.setAttribute(key, value); - } - } -} - -function applyAttrsNS(domNode, nsAttrs) -{ - for (var key in nsAttrs) - { - var pair = nsAttrs[key]; - var namespace = pair.namespace; - var value = pair.value; - - if (typeof value === 'undefined') - { - domNode.removeAttributeNS(namespace, key); - } - else - { - domNode.setAttributeNS(namespace, key, value); - } - } -} - - - -//////////// DIFF //////////// - - -function diff(a, b) -{ - var patches = []; - diffHelp(a, b, patches, 0); - return patches; -} - - -function makePatch(type, index, data) -{ - return { - index: index, - type: type, - data: data, - domNode: undefined, - eventNode: undefined - }; -} - - -function diffHelp(a, b, patches, index) -{ - if (a === b) - { - return; - } - - var aType = a.type; - var bType = b.type; - - // Bail if you run into different types of nodes. Implies that the - // structure has changed significantly and it's not worth a diff. - if (aType !== bType) - { - patches.push(makePatch('p-redraw', index, b)); - return; - } - - // Now we know that both nodes are the same type. - switch (bType) - { - case 'thunk': - var aArgs = a.args; - var bArgs = b.args; - var i = aArgs.length; - var same = a.func === b.func && i === bArgs.length; - while (same && i--) - { - same = aArgs[i] === bArgs[i]; - } - if (same) - { - b.node = a.node; - return; - } - b.node = b.thunk(); - var subPatches = []; - diffHelp(a.node, b.node, subPatches, 0); - if (subPatches.length > 0) - { - patches.push(makePatch('p-thunk', index, subPatches)); - } - return; - - case 'tagger': - // gather nested taggers - var aTaggers = a.tagger; - var bTaggers = b.tagger; - var nesting = false; - - var aSubNode = a.node; - while (aSubNode.type === 'tagger') - { - nesting = true; - - typeof aTaggers !== 'object' - ? aTaggers = [aTaggers, aSubNode.tagger] - : aTaggers.push(aSubNode.tagger); - - aSubNode = aSubNode.node; - } - - var bSubNode = b.node; - while (bSubNode.type === 'tagger') - { - nesting = true; - - typeof bTaggers !== 'object' - ? bTaggers = [bTaggers, bSubNode.tagger] - : bTaggers.push(bSubNode.tagger); - - bSubNode = bSubNode.node; - } - - // Just bail if different numbers of taggers. This implies the - // structure of the virtual DOM has changed. - if (nesting && aTaggers.length !== bTaggers.length) - { - patches.push(makePatch('p-redraw', index, b)); - return; - } - - // check if taggers are "the same" - if (nesting ? !pairwiseRefEqual(aTaggers, bTaggers) : aTaggers !== bTaggers) - { - patches.push(makePatch('p-tagger', index, bTaggers)); - } - - // diff everything below the taggers - diffHelp(aSubNode, bSubNode, patches, index + 1); - return; - - case 'text': - if (a.text !== b.text) - { - patches.push(makePatch('p-text', index, b.text)); - return; - } - - return; - - case 'node': - // Bail if obvious indicators have changed. Implies more serious - // structural changes such that it's not worth it to diff. - if (a.tag !== b.tag || a.namespace !== b.namespace) - { - patches.push(makePatch('p-redraw', index, b)); - return; - } - - var factsDiff = diffFacts(a.facts, b.facts); - - if (typeof factsDiff !== 'undefined') - { - patches.push(makePatch('p-facts', index, factsDiff)); - } - - diffChildren(a, b, patches, index); - return; - - case 'keyed-node': - // Bail if obvious indicators have changed. Implies more serious - // structural changes such that it's not worth it to diff. - if (a.tag !== b.tag || a.namespace !== b.namespace) - { - patches.push(makePatch('p-redraw', index, b)); - return; - } - - var factsDiff = diffFacts(a.facts, b.facts); - - if (typeof factsDiff !== 'undefined') - { - patches.push(makePatch('p-facts', index, factsDiff)); - } - - diffKeyedChildren(a, b, patches, index); - return; - - case 'custom': - if (a.impl !== b.impl) - { - patches.push(makePatch('p-redraw', index, b)); - return; - } - - var factsDiff = diffFacts(a.facts, b.facts); - if (typeof factsDiff !== 'undefined') - { - patches.push(makePatch('p-facts', index, factsDiff)); - } - - var patch = b.impl.diff(a,b); - if (patch) - { - patches.push(makePatch('p-custom', index, patch)); - return; - } - - return; - } -} - - -// assumes the incoming arrays are the same length -function pairwiseRefEqual(as, bs) -{ - for (var i = 0; i < as.length; i++) - { - if (as[i] !== bs[i]) - { - return false; - } - } - - return true; -} - - -// TODO Instead of creating a new diff object, it's possible to just test if -// there *is* a diff. During the actual patch, do the diff again and make the -// modifications directly. This way, there's no new allocations. Worth it? -function diffFacts(a, b, category) -{ - var diff; - - // look for changes and removals - for (var aKey in a) - { - if (aKey === STYLE_KEY || aKey === EVENT_KEY || aKey === ATTR_KEY || aKey === ATTR_NS_KEY) - { - var subDiff = diffFacts(a[aKey], b[aKey] || {}, aKey); - if (subDiff) - { - diff = diff || {}; - diff[aKey] = subDiff; - } - continue; - } - - // remove if not in the new facts - if (!(aKey in b)) - { - diff = diff || {}; - diff[aKey] = - (typeof category === 'undefined') - ? (typeof a[aKey] === 'string' ? '' : null) - : - (category === STYLE_KEY) - ? '' - : - (category === EVENT_KEY || category === ATTR_KEY) - ? undefined - : - { namespace: a[aKey].namespace, value: undefined }; - - continue; - } - - var aValue = a[aKey]; - var bValue = b[aKey]; - - // reference equal, so don't worry about it - if (aValue === bValue && aKey !== 'value' - || category === EVENT_KEY && equalEvents(aValue, bValue)) - { - continue; - } - - diff = diff || {}; - diff[aKey] = bValue; - } - - // add new stuff - for (var bKey in b) - { - if (!(bKey in a)) - { - diff = diff || {}; - diff[bKey] = b[bKey]; - } - } - - return diff; -} - - -function diffChildren(aParent, bParent, patches, rootIndex) -{ - var aChildren = aParent.children; - var bChildren = bParent.children; - - var aLen = aChildren.length; - var bLen = bChildren.length; - - // FIGURE OUT IF THERE ARE INSERTS OR REMOVALS - - if (aLen > bLen) - { - patches.push(makePatch('p-remove-last', rootIndex, aLen - bLen)); - } - else if (aLen < bLen) - { - patches.push(makePatch('p-append', rootIndex, bChildren.slice(aLen))); - } - - // PAIRWISE DIFF EVERYTHING ELSE - - var index = rootIndex; - var minLen = aLen < bLen ? aLen : bLen; - for (var i = 0; i < minLen; i++) - { - index++; - var aChild = aChildren[i]; - diffHelp(aChild, bChildren[i], patches, index); - index += aChild.descendantsCount || 0; - } -} - - - -//////////// KEYED DIFF //////////// - - -function diffKeyedChildren(aParent, bParent, patches, rootIndex) -{ - var localPatches = []; - - var changes = {}; // Dict String Entry - var inserts = []; // Array { index : Int, entry : Entry } - // type Entry = { tag : String, vnode : VNode, index : Int, data : _ } - - var aChildren = aParent.children; - var bChildren = bParent.children; - var aLen = aChildren.length; - var bLen = bChildren.length; - var aIndex = 0; - var bIndex = 0; - - var index = rootIndex; - - while (aIndex < aLen && bIndex < bLen) - { - var a = aChildren[aIndex]; - var b = bChildren[bIndex]; - - var aKey = a._0; - var bKey = b._0; - var aNode = a._1; - var bNode = b._1; - - // check if keys match - - if (aKey === bKey) - { - index++; - diffHelp(aNode, bNode, localPatches, index); - index += aNode.descendantsCount || 0; - - aIndex++; - bIndex++; - continue; - } - - // look ahead 1 to detect insertions and removals. - - var aLookAhead = aIndex + 1 < aLen; - var bLookAhead = bIndex + 1 < bLen; - - if (aLookAhead) - { - var aNext = aChildren[aIndex + 1]; - var aNextKey = aNext._0; - var aNextNode = aNext._1; - var oldMatch = bKey === aNextKey; - } - - if (bLookAhead) - { - var bNext = bChildren[bIndex + 1]; - var bNextKey = bNext._0; - var bNextNode = bNext._1; - var newMatch = aKey === bNextKey; - } - - - // swap a and b - if (aLookAhead && bLookAhead && newMatch && oldMatch) - { - index++; - diffHelp(aNode, bNextNode, localPatches, index); - insertNode(changes, localPatches, aKey, bNode, bIndex, inserts); - index += aNode.descendantsCount || 0; - - index++; - removeNode(changes, localPatches, aKey, aNextNode, index); - index += aNextNode.descendantsCount || 0; - - aIndex += 2; - bIndex += 2; - continue; - } - - // insert b - if (bLookAhead && newMatch) - { - index++; - insertNode(changes, localPatches, bKey, bNode, bIndex, inserts); - diffHelp(aNode, bNextNode, localPatches, index); - index += aNode.descendantsCount || 0; - - aIndex += 1; - bIndex += 2; - continue; - } - - // remove a - if (aLookAhead && oldMatch) - { - index++; - removeNode(changes, localPatches, aKey, aNode, index); - index += aNode.descendantsCount || 0; - - index++; - diffHelp(aNextNode, bNode, localPatches, index); - index += aNextNode.descendantsCount || 0; - - aIndex += 2; - bIndex += 1; - continue; - } - - // remove a, insert b - if (aLookAhead && bLookAhead && aNextKey === bNextKey) - { - index++; - removeNode(changes, localPatches, aKey, aNode, index); - insertNode(changes, localPatches, bKey, bNode, bIndex, inserts); - index += aNode.descendantsCount || 0; - - index++; - diffHelp(aNextNode, bNextNode, localPatches, index); - index += aNextNode.descendantsCount || 0; - - aIndex += 2; - bIndex += 2; - continue; - } - - break; - } - - // eat up any remaining nodes with removeNode and insertNode - - while (aIndex < aLen) - { - index++; - var a = aChildren[aIndex]; - var aNode = a._1; - removeNode(changes, localPatches, a._0, aNode, index); - index += aNode.descendantsCount || 0; - aIndex++; - } - - var endInserts; - while (bIndex < bLen) - { - endInserts = endInserts || []; - var b = bChildren[bIndex]; - insertNode(changes, localPatches, b._0, b._1, undefined, endInserts); - bIndex++; - } - - if (localPatches.length > 0 || inserts.length > 0 || typeof endInserts !== 'undefined') - { - patches.push(makePatch('p-reorder', rootIndex, { - patches: localPatches, - inserts: inserts, - endInserts: endInserts - })); - } -} - - - -//////////// CHANGES FROM KEYED DIFF //////////// - - -var POSTFIX = '_elmW6BL'; - - -function insertNode(changes, localPatches, key, vnode, bIndex, inserts) -{ - var entry = changes[key]; - - // never seen this key before - if (typeof entry === 'undefined') - { - entry = { - tag: 'insert', - vnode: vnode, - index: bIndex, - data: undefined - }; - - inserts.push({ index: bIndex, entry: entry }); - changes[key] = entry; - - return; - } - - // this key was removed earlier, a match! - if (entry.tag === 'remove') - { - inserts.push({ index: bIndex, entry: entry }); - - entry.tag = 'move'; - var subPatches = []; - diffHelp(entry.vnode, vnode, subPatches, entry.index); - entry.index = bIndex; - entry.data.data = { - patches: subPatches, - entry: entry - }; - - return; - } - - // this key has already been inserted or moved, a duplicate! - insertNode(changes, localPatches, key + POSTFIX, vnode, bIndex, inserts); -} - - -function removeNode(changes, localPatches, key, vnode, index) -{ - var entry = changes[key]; - - // never seen this key before - if (typeof entry === 'undefined') - { - var patch = makePatch('p-remove', index, undefined); - localPatches.push(patch); - - changes[key] = { - tag: 'remove', - vnode: vnode, - index: index, - data: patch - }; - - return; - } - - // this key was inserted earlier, a match! - if (entry.tag === 'insert') - { - entry.tag = 'move'; - var subPatches = []; - diffHelp(vnode, entry.vnode, subPatches, index); - - var patch = makePatch('p-remove', index, { - patches: subPatches, - entry: entry - }); - localPatches.push(patch); - - return; - } - - // this key has already been removed or moved, a duplicate! - removeNode(changes, localPatches, key + POSTFIX, vnode, index); -} - - - -//////////// ADD DOM NODES //////////// -// -// Each DOM node has an "index" assigned in order of traversal. It is important -// to minimize our crawl over the actual DOM, so these indexes (along with the -// descendantsCount of virtual nodes) let us skip touching entire subtrees of -// the DOM if we know there are no patches there. - - -function addDomNodes(domNode, vNode, patches, eventNode) -{ - addDomNodesHelp(domNode, vNode, patches, 0, 0, vNode.descendantsCount, eventNode); -} - - -// assumes `patches` is non-empty and indexes increase monotonically. -function addDomNodesHelp(domNode, vNode, patches, i, low, high, eventNode) -{ - var patch = patches[i]; - var index = patch.index; - - while (index === low) - { - var patchType = patch.type; - - if (patchType === 'p-thunk') - { - addDomNodes(domNode, vNode.node, patch.data, eventNode); - } - else if (patchType === 'p-reorder') - { - patch.domNode = domNode; - patch.eventNode = eventNode; - - var subPatches = patch.data.patches; - if (subPatches.length > 0) - { - addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode); - } - } - else if (patchType === 'p-remove') - { - patch.domNode = domNode; - patch.eventNode = eventNode; - - var data = patch.data; - if (typeof data !== 'undefined') - { - data.entry.data = domNode; - var subPatches = data.patches; - if (subPatches.length > 0) - { - addDomNodesHelp(domNode, vNode, subPatches, 0, low, high, eventNode); - } - } - } - else - { - patch.domNode = domNode; - patch.eventNode = eventNode; - } - - i++; - - if (!(patch = patches[i]) || (index = patch.index) > high) - { - return i; - } - } - - switch (vNode.type) - { - case 'tagger': - var subNode = vNode.node; - - while (subNode.type === "tagger") - { - subNode = subNode.node; - } - - return addDomNodesHelp(domNode, subNode, patches, i, low + 1, high, domNode.elm_event_node_ref); - - case 'node': - var vChildren = vNode.children; - var childNodes = domNode.childNodes; - for (var j = 0; j < vChildren.length; j++) - { - low++; - var vChild = vChildren[j]; - var nextLow = low + (vChild.descendantsCount || 0); - if (low <= index && index <= nextLow) - { - i = addDomNodesHelp(childNodes[j], vChild, patches, i, low, nextLow, eventNode); - if (!(patch = patches[i]) || (index = patch.index) > high) - { - return i; - } - } - low = nextLow; - } - return i; - - case 'keyed-node': - var vChildren = vNode.children; - var childNodes = domNode.childNodes; - for (var j = 0; j < vChildren.length; j++) - { - low++; - var vChild = vChildren[j]._1; - var nextLow = low + (vChild.descendantsCount || 0); - if (low <= index && index <= nextLow) - { - i = addDomNodesHelp(childNodes[j], vChild, patches, i, low, nextLow, eventNode); - if (!(patch = patches[i]) || (index = patch.index) > high) - { - return i; - } - } - low = nextLow; - } - return i; - - case 'text': - case 'thunk': - throw new Error('should never traverse `text` or `thunk` nodes like this'); - } -} - - - -//////////// APPLY PATCHES //////////// - - -function applyPatches(rootDomNode, oldVirtualNode, patches, eventNode) -{ - if (patches.length === 0) - { - return rootDomNode; - } - - addDomNodes(rootDomNode, oldVirtualNode, patches, eventNode); - return applyPatchesHelp(rootDomNode, patches); -} - -function applyPatchesHelp(rootDomNode, patches) -{ - for (var i = 0; i < patches.length; i++) - { - var patch = patches[i]; - var localDomNode = patch.domNode - var newNode = applyPatch(localDomNode, patch); - if (localDomNode === rootDomNode) - { - rootDomNode = newNode; - } - } - return rootDomNode; -} - -function applyPatch(domNode, patch) -{ - switch (patch.type) - { - case 'p-redraw': - return applyPatchRedraw(domNode, patch.data, patch.eventNode); - - case 'p-facts': - applyFacts(domNode, patch.eventNode, patch.data); - return domNode; - - case 'p-text': - domNode.replaceData(0, domNode.length, patch.data); - return domNode; - - case 'p-thunk': - return applyPatchesHelp(domNode, patch.data); - - case 'p-tagger': - if (typeof domNode.elm_event_node_ref !== 'undefined') - { - domNode.elm_event_node_ref.tagger = patch.data; - } - else - { - domNode.elm_event_node_ref = { tagger: patch.data, parent: patch.eventNode }; - } - return domNode; - - case 'p-remove-last': - var i = patch.data; - while (i--) - { - domNode.removeChild(domNode.lastChild); - } - return domNode; - - case 'p-append': - var newNodes = patch.data; - for (var i = 0; i < newNodes.length; i++) - { - domNode.appendChild(render(newNodes[i], patch.eventNode)); - } - return domNode; - - case 'p-remove': - var data = patch.data; - if (typeof data === 'undefined') - { - domNode.parentNode.removeChild(domNode); - return domNode; - } - var entry = data.entry; - if (typeof entry.index !== 'undefined') - { - domNode.parentNode.removeChild(domNode); - } - entry.data = applyPatchesHelp(domNode, data.patches); - return domNode; - - case 'p-reorder': - return applyPatchReorder(domNode, patch); - - case 'p-custom': - var impl = patch.data; - return impl.applyPatch(domNode, impl.data); - - default: - throw new Error('Ran into an unknown patch!'); - } -} - - -function applyPatchRedraw(domNode, vNode, eventNode) -{ - var parentNode = domNode.parentNode; - var newNode = render(vNode, eventNode); - - if (typeof newNode.elm_event_node_ref === 'undefined') - { - newNode.elm_event_node_ref = domNode.elm_event_node_ref; - } - - if (parentNode && newNode !== domNode) - { - parentNode.replaceChild(newNode, domNode); - } - return newNode; -} - - -function applyPatchReorder(domNode, patch) -{ - var data = patch.data; - - // remove end inserts - var frag = applyPatchReorderEndInsertsHelp(data.endInserts, patch); - - // removals - domNode = applyPatchesHelp(domNode, data.patches); - - // inserts - var inserts = data.inserts; - for (var i = 0; i < inserts.length; i++) - { - var insert = inserts[i]; - var entry = insert.entry; - var node = entry.tag === 'move' - ? entry.data - : render(entry.vnode, patch.eventNode); - domNode.insertBefore(node, domNode.childNodes[insert.index]); - } - - // add end inserts - if (typeof frag !== 'undefined') - { - domNode.appendChild(frag); - } - - return domNode; -} - - -function applyPatchReorderEndInsertsHelp(endInserts, patch) -{ - if (typeof endInserts === 'undefined') - { - return; - } - - var frag = localDoc.createDocumentFragment(); - for (var i = 0; i < endInserts.length; i++) - { - var insert = endInserts[i]; - var entry = insert.entry; - frag.appendChild(entry.tag === 'move' - ? entry.data - : render(entry.vnode, patch.eventNode) - ); - } - return frag; -} - - -// PROGRAMS - -var program = makeProgram(checkNoFlags); -var programWithFlags = makeProgram(checkYesFlags); - -function makeProgram(flagChecker) -{ - return F2(function(debugWrap, impl) - { - return function(flagDecoder) - { - return function(object, moduleName, debugMetadata) - { - var checker = flagChecker(flagDecoder, moduleName); - if (typeof debugMetadata === 'undefined') - { - normalSetup(impl, object, moduleName, checker); - } - else - { - debugSetup(A2(debugWrap, debugMetadata, impl), object, moduleName, checker); - } - }; - }; - }); -} - -function staticProgram(vNode) -{ - var nothing = _elm_lang$core$Native_Utils.Tuple2( - _elm_lang$core$Native_Utils.Tuple0, - _elm_lang$core$Platform_Cmd$none - ); - return A2(program, _elm_lang$virtual_dom$VirtualDom_Debug$wrap, { - init: nothing, - view: function() { return vNode; }, - update: F2(function() { return nothing; }), - subscriptions: function() { return _elm_lang$core$Platform_Sub$none; } - })(); -} - - -// FLAG CHECKERS - -function checkNoFlags(flagDecoder, moduleName) -{ - return function(init, flags, domNode) - { - if (typeof flags === 'undefined') - { - return init; - } - - var errorMessage = - 'The `' + moduleName + '` module does not need flags.\n' - + 'Initialize it with no arguments and you should be all set!'; - - crash(errorMessage, domNode); - }; -} - -function checkYesFlags(flagDecoder, moduleName) -{ - return function(init, flags, domNode) - { - if (typeof flagDecoder === 'undefined') - { - var errorMessage = - 'Are you trying to sneak a Never value into Elm? Trickster!\n' - + 'It looks like ' + moduleName + '.main is defined with `programWithFlags` but has type `Program Never`.\n' - + 'Use `program` instead if you do not want flags.' - - crash(errorMessage, domNode); - } - - var result = A2(_elm_lang$core$Native_Json.run, flagDecoder, flags); - if (result.ctor === 'Ok') - { - return init(result._0); - } - - var errorMessage = - 'Trying to initialize the `' + moduleName + '` module with an unexpected flag.\n' - + 'I tried to convert it to an Elm value, but ran into this problem:\n\n' - + result._0; - - crash(errorMessage, domNode); - }; -} - -function crash(errorMessage, domNode) -{ - if (domNode) - { - domNode.innerHTML = - '
' - + '

Oops! Something went wrong when starting your Elm program.

' - + '
' + errorMessage + '
' - + '
'; - } - - throw new Error(errorMessage); -} - - -// NORMAL SETUP - -function normalSetup(impl, object, moduleName, flagChecker) -{ - object['embed'] = function embed(node, flags) - { - while (node.lastChild) - { - node.removeChild(node.lastChild); - } - - return _elm_lang$core$Native_Platform.initialize( - flagChecker(impl.init, flags, node), - impl.update, - impl.subscriptions, - normalRenderer(node, impl.view) - ); - }; - - object['fullscreen'] = function fullscreen(flags) - { - return _elm_lang$core$Native_Platform.initialize( - flagChecker(impl.init, flags, document.body), - impl.update, - impl.subscriptions, - normalRenderer(document.body, impl.view) - ); - }; -} - -function normalRenderer(parentNode, view) -{ - return function(tagger, initialModel) - { - var eventNode = { tagger: tagger, parent: undefined }; - var initialVirtualNode = view(initialModel); - var domNode = render(initialVirtualNode, eventNode); - parentNode.appendChild(domNode); - return makeStepper(domNode, view, initialVirtualNode, eventNode); - }; -} - - -// STEPPER - -var rAF = - typeof requestAnimationFrame !== 'undefined' - ? requestAnimationFrame - : function(callback) { setTimeout(callback, 1000 / 60); }; - -function makeStepper(domNode, view, initialVirtualNode, eventNode) -{ - var state = 'NO_REQUEST'; - var currNode = initialVirtualNode; - var nextModel; - - function updateIfNeeded() - { - switch (state) - { - case 'NO_REQUEST': - throw new Error( - 'Unexpected draw callback.\n' + - 'Please report this to .' - ); - - case 'PENDING_REQUEST': - rAF(updateIfNeeded); - state = 'EXTRA_REQUEST'; - - var nextNode = view(nextModel); - var patches = diff(currNode, nextNode); - domNode = applyPatches(domNode, currNode, patches, eventNode); - currNode = nextNode; - - return; - - case 'EXTRA_REQUEST': - state = 'NO_REQUEST'; - return; - } - } - - return function stepper(model) - { - if (state === 'NO_REQUEST') - { - rAF(updateIfNeeded); - } - state = 'PENDING_REQUEST'; - nextModel = model; - }; -} - - -// DEBUG SETUP - -function debugSetup(impl, object, moduleName, flagChecker) -{ - object['fullscreen'] = function fullscreen(flags) - { - var popoutRef = { doc: undefined }; - return _elm_lang$core$Native_Platform.initialize( - flagChecker(impl.init, flags, document.body), - impl.update(scrollTask(popoutRef)), - impl.subscriptions, - debugRenderer(moduleName, document.body, popoutRef, impl.view, impl.viewIn, impl.viewOut) - ); - }; - - object['embed'] = function fullscreen(node, flags) - { - var popoutRef = { doc: undefined }; - return _elm_lang$core$Native_Platform.initialize( - flagChecker(impl.init, flags, node), - impl.update(scrollTask(popoutRef)), - impl.subscriptions, - debugRenderer(moduleName, node, popoutRef, impl.view, impl.viewIn, impl.viewOut) - ); - }; -} - -function scrollTask(popoutRef) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - var doc = popoutRef.doc; - if (doc) - { - var msgs = doc.getElementsByClassName('debugger-sidebar-messages')[0]; - if (msgs) - { - msgs.scrollTop = msgs.scrollHeight; - } - } - callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); - }); -} - - -function debugRenderer(moduleName, parentNode, popoutRef, view, viewIn, viewOut) -{ - return function(tagger, initialModel) - { - var appEventNode = { tagger: tagger, parent: undefined }; - var eventNode = { tagger: tagger, parent: undefined }; - - // make normal stepper - var appVirtualNode = view(initialModel); - var appNode = render(appVirtualNode, appEventNode); - parentNode.appendChild(appNode); - var appStepper = makeStepper(appNode, view, appVirtualNode, appEventNode); - - // make overlay stepper - var overVirtualNode = viewIn(initialModel)._1; - var overNode = render(overVirtualNode, eventNode); - parentNode.appendChild(overNode); - var wrappedViewIn = wrapViewIn(appEventNode, overNode, viewIn); - var overStepper = makeStepper(overNode, wrappedViewIn, overVirtualNode, eventNode); - - // make debugger stepper - var debugStepper = makeDebugStepper(initialModel, viewOut, eventNode, parentNode, moduleName, popoutRef); - - return function stepper(model) - { - appStepper(model); - overStepper(model); - debugStepper(model); - } - }; -} - -function makeDebugStepper(initialModel, view, eventNode, parentNode, moduleName, popoutRef) -{ - var curr; - var domNode; - - return function stepper(model) - { - if (!model.isDebuggerOpen) - { - return; - } - - if (!popoutRef.doc) - { - curr = view(model); - domNode = openDebugWindow(moduleName, popoutRef, curr, eventNode); - return; - } - - // switch to document of popout - localDoc = popoutRef.doc; - - var next = view(model); - var patches = diff(curr, next); - domNode = applyPatches(domNode, curr, patches, eventNode); - curr = next; - - // switch back to normal document - localDoc = document; - }; -} - -function openDebugWindow(moduleName, popoutRef, virtualNode, eventNode) -{ - var w = 900; - var h = 360; - var x = screen.width - w; - var y = screen.height - h; - var debugWindow = window.open('', '', 'width=' + w + ',height=' + h + ',left=' + x + ',top=' + y); - - // switch to window document - localDoc = debugWindow.document; - - popoutRef.doc = localDoc; - localDoc.title = 'Debugger - ' + moduleName; - localDoc.body.style.margin = '0'; - localDoc.body.style.padding = '0'; - var domNode = render(virtualNode, eventNode); - localDoc.body.appendChild(domNode); - - localDoc.addEventListener('keydown', function(event) { - if (event.metaKey && event.which === 82) - { - window.location.reload(); - } - if (event.which === 38) - { - eventNode.tagger({ ctor: 'Up' }); - event.preventDefault(); - } - if (event.which === 40) - { - eventNode.tagger({ ctor: 'Down' }); - event.preventDefault(); - } - }); - - function close() - { - popoutRef.doc = undefined; - debugWindow.close(); - } - window.addEventListener('unload', close); - debugWindow.addEventListener('unload', function() { - popoutRef.doc = undefined; - window.removeEventListener('unload', close); - eventNode.tagger({ ctor: 'Close' }); - }); - - // switch back to the normal document - localDoc = document; - - return domNode; -} - - -// BLOCK EVENTS - -function wrapViewIn(appEventNode, overlayNode, viewIn) -{ - var ignorer = makeIgnorer(overlayNode); - var blocking = 'Normal'; - var overflow; - - var normalTagger = appEventNode.tagger; - var blockTagger = function() {}; - - return function(model) - { - var tuple = viewIn(model); - var newBlocking = tuple._0.ctor; - appEventNode.tagger = newBlocking === 'Normal' ? normalTagger : blockTagger; - if (blocking !== newBlocking) - { - traverse('removeEventListener', ignorer, blocking); - traverse('addEventListener', ignorer, newBlocking); - - if (blocking === 'Normal') - { - overflow = document.body.style.overflow; - document.body.style.overflow = 'hidden'; - } - - if (newBlocking === 'Normal') - { - document.body.style.overflow = overflow; - } - - blocking = newBlocking; - } - return tuple._1; - } -} - -function traverse(verbEventListener, ignorer, blocking) -{ - switch(blocking) - { - case 'Normal': - return; - - case 'Pause': - return traverseHelp(verbEventListener, ignorer, mostEvents); - - case 'Message': - return traverseHelp(verbEventListener, ignorer, allEvents); - } -} - -function traverseHelp(verbEventListener, handler, eventNames) -{ - for (var i = 0; i < eventNames.length; i++) - { - document.body[verbEventListener](eventNames[i], handler, true); - } -} - -function makeIgnorer(overlayNode) -{ - return function(event) - { - if (event.type === 'keydown' && event.metaKey && event.which === 82) - { - return; - } - - var isScroll = event.type === 'scroll' || event.type === 'wheel'; - - var node = event.target; - while (node !== null) - { - if (node.className === 'elm-overlay-message-details' && isScroll) - { - return; - } - - if (node === overlayNode && !isScroll) - { - return; - } - node = node.parentNode; - } - - event.stopPropagation(); - event.preventDefault(); - } -} - -var mostEvents = [ - 'click', 'dblclick', 'mousemove', - 'mouseup', 'mousedown', 'mouseenter', 'mouseleave', - 'touchstart', 'touchend', 'touchcancel', 'touchmove', - 'pointerdown', 'pointerup', 'pointerover', 'pointerout', - 'pointerenter', 'pointerleave', 'pointermove', 'pointercancel', - 'dragstart', 'drag', 'dragend', 'dragenter', 'dragover', 'dragleave', 'drop', - 'keyup', 'keydown', 'keypress', - 'input', 'change', - 'focus', 'blur' -]; - -var allEvents = mostEvents.concat('wheel', 'scroll'); - - -return { - node: node, - text: text, - custom: custom, - map: F2(map), - - on: F3(on), - style: style, - property: F2(property), - attribute: F2(attribute), - attributeNS: F3(attributeNS), - mapProperty: F2(mapProperty), - - lazy: F2(lazy), - lazy2: F3(lazy2), - lazy3: F4(lazy3), - keyedNode: F3(keyedNode), - - program: program, - programWithFlags: programWithFlags, - staticProgram: staticProgram -}; - -}(); - -var _elm_lang$virtual_dom$VirtualDom$programWithFlags = function (impl) { - return A2(_elm_lang$virtual_dom$Native_VirtualDom.programWithFlags, _elm_lang$virtual_dom$VirtualDom_Debug$wrapWithFlags, impl); -}; -var _elm_lang$virtual_dom$VirtualDom$program = function (impl) { - return A2(_elm_lang$virtual_dom$Native_VirtualDom.program, _elm_lang$virtual_dom$VirtualDom_Debug$wrap, impl); -}; -var _elm_lang$virtual_dom$VirtualDom$keyedNode = _elm_lang$virtual_dom$Native_VirtualDom.keyedNode; -var _elm_lang$virtual_dom$VirtualDom$lazy3 = _elm_lang$virtual_dom$Native_VirtualDom.lazy3; -var _elm_lang$virtual_dom$VirtualDom$lazy2 = _elm_lang$virtual_dom$Native_VirtualDom.lazy2; -var _elm_lang$virtual_dom$VirtualDom$lazy = _elm_lang$virtual_dom$Native_VirtualDom.lazy; -var _elm_lang$virtual_dom$VirtualDom$defaultOptions = {stopPropagation: false, preventDefault: false}; -var _elm_lang$virtual_dom$VirtualDom$onWithOptions = _elm_lang$virtual_dom$Native_VirtualDom.on; -var _elm_lang$virtual_dom$VirtualDom$on = F2( - function (eventName, decoder) { - return A3(_elm_lang$virtual_dom$VirtualDom$onWithOptions, eventName, _elm_lang$virtual_dom$VirtualDom$defaultOptions, decoder); - }); -var _elm_lang$virtual_dom$VirtualDom$style = _elm_lang$virtual_dom$Native_VirtualDom.style; -var _elm_lang$virtual_dom$VirtualDom$mapProperty = _elm_lang$virtual_dom$Native_VirtualDom.mapProperty; -var _elm_lang$virtual_dom$VirtualDom$attributeNS = _elm_lang$virtual_dom$Native_VirtualDom.attributeNS; -var _elm_lang$virtual_dom$VirtualDom$attribute = _elm_lang$virtual_dom$Native_VirtualDom.attribute; -var _elm_lang$virtual_dom$VirtualDom$property = _elm_lang$virtual_dom$Native_VirtualDom.property; -var _elm_lang$virtual_dom$VirtualDom$map = _elm_lang$virtual_dom$Native_VirtualDom.map; -var _elm_lang$virtual_dom$VirtualDom$text = _elm_lang$virtual_dom$Native_VirtualDom.text; -var _elm_lang$virtual_dom$VirtualDom$node = _elm_lang$virtual_dom$Native_VirtualDom.node; -var _elm_lang$virtual_dom$VirtualDom$Options = F2( - function (a, b) { - return {stopPropagation: a, preventDefault: b}; - }); -var _elm_lang$virtual_dom$VirtualDom$Node = {ctor: 'Node'}; -var _elm_lang$virtual_dom$VirtualDom$Property = {ctor: 'Property'}; - -var _elm_lang$html$Html$programWithFlags = _elm_lang$virtual_dom$VirtualDom$programWithFlags; -var _elm_lang$html$Html$program = _elm_lang$virtual_dom$VirtualDom$program; -var _elm_lang$html$Html$beginnerProgram = function (_p0) { - var _p1 = _p0; - return _elm_lang$html$Html$program( - { - init: A2( - _elm_lang$core$Platform_Cmd_ops['!'], - _p1.model, - {ctor: '[]'}), - update: F2( - function (msg, model) { - return A2( - _elm_lang$core$Platform_Cmd_ops['!'], - A2(_p1.update, msg, model), - {ctor: '[]'}); - }), - view: _p1.view, - subscriptions: function (_p2) { - return _elm_lang$core$Platform_Sub$none; - } - }); -}; -var _elm_lang$html$Html$map = _elm_lang$virtual_dom$VirtualDom$map; -var _elm_lang$html$Html$text = _elm_lang$virtual_dom$VirtualDom$text; -var _elm_lang$html$Html$node = _elm_lang$virtual_dom$VirtualDom$node; -var _elm_lang$html$Html$body = _elm_lang$html$Html$node('body'); -var _elm_lang$html$Html$section = _elm_lang$html$Html$node('section'); -var _elm_lang$html$Html$nav = _elm_lang$html$Html$node('nav'); -var _elm_lang$html$Html$article = _elm_lang$html$Html$node('article'); -var _elm_lang$html$Html$aside = _elm_lang$html$Html$node('aside'); -var _elm_lang$html$Html$h1 = _elm_lang$html$Html$node('h1'); -var _elm_lang$html$Html$h2 = _elm_lang$html$Html$node('h2'); -var _elm_lang$html$Html$h3 = _elm_lang$html$Html$node('h3'); -var _elm_lang$html$Html$h4 = _elm_lang$html$Html$node('h4'); -var _elm_lang$html$Html$h5 = _elm_lang$html$Html$node('h5'); -var _elm_lang$html$Html$h6 = _elm_lang$html$Html$node('h6'); -var _elm_lang$html$Html$header = _elm_lang$html$Html$node('header'); -var _elm_lang$html$Html$footer = _elm_lang$html$Html$node('footer'); -var _elm_lang$html$Html$address = _elm_lang$html$Html$node('address'); -var _elm_lang$html$Html$main_ = _elm_lang$html$Html$node('main'); -var _elm_lang$html$Html$p = _elm_lang$html$Html$node('p'); -var _elm_lang$html$Html$hr = _elm_lang$html$Html$node('hr'); -var _elm_lang$html$Html$pre = _elm_lang$html$Html$node('pre'); -var _elm_lang$html$Html$blockquote = _elm_lang$html$Html$node('blockquote'); -var _elm_lang$html$Html$ol = _elm_lang$html$Html$node('ol'); -var _elm_lang$html$Html$ul = _elm_lang$html$Html$node('ul'); -var _elm_lang$html$Html$li = _elm_lang$html$Html$node('li'); -var _elm_lang$html$Html$dl = _elm_lang$html$Html$node('dl'); -var _elm_lang$html$Html$dt = _elm_lang$html$Html$node('dt'); -var _elm_lang$html$Html$dd = _elm_lang$html$Html$node('dd'); -var _elm_lang$html$Html$figure = _elm_lang$html$Html$node('figure'); -var _elm_lang$html$Html$figcaption = _elm_lang$html$Html$node('figcaption'); -var _elm_lang$html$Html$div = _elm_lang$html$Html$node('div'); -var _elm_lang$html$Html$a = _elm_lang$html$Html$node('a'); -var _elm_lang$html$Html$em = _elm_lang$html$Html$node('em'); -var _elm_lang$html$Html$strong = _elm_lang$html$Html$node('strong'); -var _elm_lang$html$Html$small = _elm_lang$html$Html$node('small'); -var _elm_lang$html$Html$s = _elm_lang$html$Html$node('s'); -var _elm_lang$html$Html$cite = _elm_lang$html$Html$node('cite'); -var _elm_lang$html$Html$q = _elm_lang$html$Html$node('q'); -var _elm_lang$html$Html$dfn = _elm_lang$html$Html$node('dfn'); -var _elm_lang$html$Html$abbr = _elm_lang$html$Html$node('abbr'); -var _elm_lang$html$Html$time = _elm_lang$html$Html$node('time'); -var _elm_lang$html$Html$code = _elm_lang$html$Html$node('code'); -var _elm_lang$html$Html$var = _elm_lang$html$Html$node('var'); -var _elm_lang$html$Html$samp = _elm_lang$html$Html$node('samp'); -var _elm_lang$html$Html$kbd = _elm_lang$html$Html$node('kbd'); -var _elm_lang$html$Html$sub = _elm_lang$html$Html$node('sub'); -var _elm_lang$html$Html$sup = _elm_lang$html$Html$node('sup'); -var _elm_lang$html$Html$i = _elm_lang$html$Html$node('i'); -var _elm_lang$html$Html$b = _elm_lang$html$Html$node('b'); -var _elm_lang$html$Html$u = _elm_lang$html$Html$node('u'); -var _elm_lang$html$Html$mark = _elm_lang$html$Html$node('mark'); -var _elm_lang$html$Html$ruby = _elm_lang$html$Html$node('ruby'); -var _elm_lang$html$Html$rt = _elm_lang$html$Html$node('rt'); -var _elm_lang$html$Html$rp = _elm_lang$html$Html$node('rp'); -var _elm_lang$html$Html$bdi = _elm_lang$html$Html$node('bdi'); -var _elm_lang$html$Html$bdo = _elm_lang$html$Html$node('bdo'); -var _elm_lang$html$Html$span = _elm_lang$html$Html$node('span'); -var _elm_lang$html$Html$br = _elm_lang$html$Html$node('br'); -var _elm_lang$html$Html$wbr = _elm_lang$html$Html$node('wbr'); -var _elm_lang$html$Html$ins = _elm_lang$html$Html$node('ins'); -var _elm_lang$html$Html$del = _elm_lang$html$Html$node('del'); -var _elm_lang$html$Html$img = _elm_lang$html$Html$node('img'); -var _elm_lang$html$Html$iframe = _elm_lang$html$Html$node('iframe'); -var _elm_lang$html$Html$embed = _elm_lang$html$Html$node('embed'); -var _elm_lang$html$Html$object = _elm_lang$html$Html$node('object'); -var _elm_lang$html$Html$param = _elm_lang$html$Html$node('param'); -var _elm_lang$html$Html$video = _elm_lang$html$Html$node('video'); -var _elm_lang$html$Html$audio = _elm_lang$html$Html$node('audio'); -var _elm_lang$html$Html$source = _elm_lang$html$Html$node('source'); -var _elm_lang$html$Html$track = _elm_lang$html$Html$node('track'); -var _elm_lang$html$Html$canvas = _elm_lang$html$Html$node('canvas'); -var _elm_lang$html$Html$math = _elm_lang$html$Html$node('math'); -var _elm_lang$html$Html$table = _elm_lang$html$Html$node('table'); -var _elm_lang$html$Html$caption = _elm_lang$html$Html$node('caption'); -var _elm_lang$html$Html$colgroup = _elm_lang$html$Html$node('colgroup'); -var _elm_lang$html$Html$col = _elm_lang$html$Html$node('col'); -var _elm_lang$html$Html$tbody = _elm_lang$html$Html$node('tbody'); -var _elm_lang$html$Html$thead = _elm_lang$html$Html$node('thead'); -var _elm_lang$html$Html$tfoot = _elm_lang$html$Html$node('tfoot'); -var _elm_lang$html$Html$tr = _elm_lang$html$Html$node('tr'); -var _elm_lang$html$Html$td = _elm_lang$html$Html$node('td'); -var _elm_lang$html$Html$th = _elm_lang$html$Html$node('th'); -var _elm_lang$html$Html$form = _elm_lang$html$Html$node('form'); -var _elm_lang$html$Html$fieldset = _elm_lang$html$Html$node('fieldset'); -var _elm_lang$html$Html$legend = _elm_lang$html$Html$node('legend'); -var _elm_lang$html$Html$label = _elm_lang$html$Html$node('label'); -var _elm_lang$html$Html$input = _elm_lang$html$Html$node('input'); -var _elm_lang$html$Html$button = _elm_lang$html$Html$node('button'); -var _elm_lang$html$Html$select = _elm_lang$html$Html$node('select'); -var _elm_lang$html$Html$datalist = _elm_lang$html$Html$node('datalist'); -var _elm_lang$html$Html$optgroup = _elm_lang$html$Html$node('optgroup'); -var _elm_lang$html$Html$option = _elm_lang$html$Html$node('option'); -var _elm_lang$html$Html$textarea = _elm_lang$html$Html$node('textarea'); -var _elm_lang$html$Html$keygen = _elm_lang$html$Html$node('keygen'); -var _elm_lang$html$Html$output = _elm_lang$html$Html$node('output'); -var _elm_lang$html$Html$progress = _elm_lang$html$Html$node('progress'); -var _elm_lang$html$Html$meter = _elm_lang$html$Html$node('meter'); -var _elm_lang$html$Html$details = _elm_lang$html$Html$node('details'); -var _elm_lang$html$Html$summary = _elm_lang$html$Html$node('summary'); -var _elm_lang$html$Html$menuitem = _elm_lang$html$Html$node('menuitem'); -var _elm_lang$html$Html$menu = _elm_lang$html$Html$node('menu'); - -var _elm_lang$html$Html_Attributes$map = _elm_lang$virtual_dom$VirtualDom$mapProperty; -var _elm_lang$html$Html_Attributes$attribute = _elm_lang$virtual_dom$VirtualDom$attribute; -var _elm_lang$html$Html_Attributes$contextmenu = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'contextmenu', value); -}; -var _elm_lang$html$Html_Attributes$draggable = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'draggable', value); -}; -var _elm_lang$html$Html_Attributes$itemprop = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'itemprop', value); -}; -var _elm_lang$html$Html_Attributes$tabindex = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'tabIndex', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$charset = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'charset', value); -}; -var _elm_lang$html$Html_Attributes$height = function (value) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'height', - _elm_lang$core$Basics$toString(value)); -}; -var _elm_lang$html$Html_Attributes$width = function (value) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'width', - _elm_lang$core$Basics$toString(value)); -}; -var _elm_lang$html$Html_Attributes$formaction = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'formAction', value); -}; -var _elm_lang$html$Html_Attributes$list = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'list', value); -}; -var _elm_lang$html$Html_Attributes$minlength = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'minLength', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$maxlength = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'maxlength', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$size = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'size', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$form = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'form', value); -}; -var _elm_lang$html$Html_Attributes$cols = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'cols', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$rows = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'rows', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$challenge = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'challenge', value); -}; -var _elm_lang$html$Html_Attributes$media = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'media', value); -}; -var _elm_lang$html$Html_Attributes$rel = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'rel', value); -}; -var _elm_lang$html$Html_Attributes$datetime = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'datetime', value); -}; -var _elm_lang$html$Html_Attributes$pubdate = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'pubdate', value); -}; -var _elm_lang$html$Html_Attributes$colspan = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'colspan', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$rowspan = function (n) { - return A2( - _elm_lang$html$Html_Attributes$attribute, - 'rowspan', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$manifest = function (value) { - return A2(_elm_lang$html$Html_Attributes$attribute, 'manifest', value); -}; -var _elm_lang$html$Html_Attributes$property = _elm_lang$virtual_dom$VirtualDom$property; -var _elm_lang$html$Html_Attributes$stringProperty = F2( - function (name, string) { - return A2( - _elm_lang$html$Html_Attributes$property, - name, - _elm_lang$core$Json_Encode$string(string)); - }); -var _elm_lang$html$Html_Attributes$class = function (name) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'className', name); -}; -var _elm_lang$html$Html_Attributes$id = function (name) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'id', name); -}; -var _elm_lang$html$Html_Attributes$title = function (name) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'title', name); -}; -var _elm_lang$html$Html_Attributes$accesskey = function ($char) { - return A2( - _elm_lang$html$Html_Attributes$stringProperty, - 'accessKey', - _elm_lang$core$String$fromChar($char)); -}; -var _elm_lang$html$Html_Attributes$dir = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'dir', value); -}; -var _elm_lang$html$Html_Attributes$dropzone = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'dropzone', value); -}; -var _elm_lang$html$Html_Attributes$lang = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'lang', value); -}; -var _elm_lang$html$Html_Attributes$content = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'content', value); -}; -var _elm_lang$html$Html_Attributes$httpEquiv = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'httpEquiv', value); -}; -var _elm_lang$html$Html_Attributes$language = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'language', value); -}; -var _elm_lang$html$Html_Attributes$src = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'src', value); -}; -var _elm_lang$html$Html_Attributes$alt = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'alt', value); -}; -var _elm_lang$html$Html_Attributes$preload = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'preload', value); -}; -var _elm_lang$html$Html_Attributes$poster = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'poster', value); -}; -var _elm_lang$html$Html_Attributes$kind = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'kind', value); -}; -var _elm_lang$html$Html_Attributes$srclang = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'srclang', value); -}; -var _elm_lang$html$Html_Attributes$sandbox = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'sandbox', value); -}; -var _elm_lang$html$Html_Attributes$srcdoc = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'srcdoc', value); -}; -var _elm_lang$html$Html_Attributes$type_ = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'type', value); -}; -var _elm_lang$html$Html_Attributes$value = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'value', value); -}; -var _elm_lang$html$Html_Attributes$defaultValue = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'defaultValue', value); -}; -var _elm_lang$html$Html_Attributes$placeholder = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'placeholder', value); -}; -var _elm_lang$html$Html_Attributes$accept = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'accept', value); -}; -var _elm_lang$html$Html_Attributes$acceptCharset = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'acceptCharset', value); -}; -var _elm_lang$html$Html_Attributes$action = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'action', value); -}; -var _elm_lang$html$Html_Attributes$autocomplete = function (bool) { - return A2( - _elm_lang$html$Html_Attributes$stringProperty, - 'autocomplete', - bool ? 'on' : 'off'); -}; -var _elm_lang$html$Html_Attributes$enctype = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'enctype', value); -}; -var _elm_lang$html$Html_Attributes$method = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'method', value); -}; -var _elm_lang$html$Html_Attributes$name = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'name', value); -}; -var _elm_lang$html$Html_Attributes$pattern = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'pattern', value); -}; -var _elm_lang$html$Html_Attributes$for = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'htmlFor', value); -}; -var _elm_lang$html$Html_Attributes$max = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'max', value); -}; -var _elm_lang$html$Html_Attributes$min = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'min', value); -}; -var _elm_lang$html$Html_Attributes$step = function (n) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'step', n); -}; -var _elm_lang$html$Html_Attributes$wrap = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'wrap', value); -}; -var _elm_lang$html$Html_Attributes$usemap = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'useMap', value); -}; -var _elm_lang$html$Html_Attributes$shape = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'shape', value); -}; -var _elm_lang$html$Html_Attributes$coords = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'coords', value); -}; -var _elm_lang$html$Html_Attributes$keytype = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'keytype', value); -}; -var _elm_lang$html$Html_Attributes$align = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'align', value); -}; -var _elm_lang$html$Html_Attributes$cite = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'cite', value); -}; -var _elm_lang$html$Html_Attributes$href = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'href', value); -}; -var _elm_lang$html$Html_Attributes$target = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'target', value); -}; -var _elm_lang$html$Html_Attributes$downloadAs = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'download', value); -}; -var _elm_lang$html$Html_Attributes$hreflang = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'hreflang', value); -}; -var _elm_lang$html$Html_Attributes$ping = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'ping', value); -}; -var _elm_lang$html$Html_Attributes$start = function (n) { - return A2( - _elm_lang$html$Html_Attributes$stringProperty, - 'start', - _elm_lang$core$Basics$toString(n)); -}; -var _elm_lang$html$Html_Attributes$headers = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'headers', value); -}; -var _elm_lang$html$Html_Attributes$scope = function (value) { - return A2(_elm_lang$html$Html_Attributes$stringProperty, 'scope', value); -}; -var _elm_lang$html$Html_Attributes$boolProperty = F2( - function (name, bool) { - return A2( - _elm_lang$html$Html_Attributes$property, - name, - _elm_lang$core$Json_Encode$bool(bool)); - }); -var _elm_lang$html$Html_Attributes$hidden = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'hidden', bool); -}; -var _elm_lang$html$Html_Attributes$contenteditable = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'contentEditable', bool); -}; -var _elm_lang$html$Html_Attributes$spellcheck = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'spellcheck', bool); -}; -var _elm_lang$html$Html_Attributes$async = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'async', bool); -}; -var _elm_lang$html$Html_Attributes$defer = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'defer', bool); -}; -var _elm_lang$html$Html_Attributes$scoped = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'scoped', bool); -}; -var _elm_lang$html$Html_Attributes$autoplay = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'autoplay', bool); -}; -var _elm_lang$html$Html_Attributes$controls = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'controls', bool); -}; -var _elm_lang$html$Html_Attributes$loop = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'loop', bool); -}; -var _elm_lang$html$Html_Attributes$default = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'default', bool); -}; -var _elm_lang$html$Html_Attributes$seamless = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'seamless', bool); -}; -var _elm_lang$html$Html_Attributes$checked = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'checked', bool); -}; -var _elm_lang$html$Html_Attributes$selected = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'selected', bool); -}; -var _elm_lang$html$Html_Attributes$autofocus = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'autofocus', bool); -}; -var _elm_lang$html$Html_Attributes$disabled = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'disabled', bool); -}; -var _elm_lang$html$Html_Attributes$multiple = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'multiple', bool); -}; -var _elm_lang$html$Html_Attributes$novalidate = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'noValidate', bool); -}; -var _elm_lang$html$Html_Attributes$readonly = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'readOnly', bool); -}; -var _elm_lang$html$Html_Attributes$required = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'required', bool); -}; -var _elm_lang$html$Html_Attributes$ismap = function (value) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'isMap', value); -}; -var _elm_lang$html$Html_Attributes$download = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'download', bool); -}; -var _elm_lang$html$Html_Attributes$reversed = function (bool) { - return A2(_elm_lang$html$Html_Attributes$boolProperty, 'reversed', bool); -}; -var _elm_lang$html$Html_Attributes$classList = function (list) { - return _elm_lang$html$Html_Attributes$class( - A2( - _elm_lang$core$String$join, - ' ', - A2( - _elm_lang$core$List$map, - _elm_lang$core$Tuple$first, - A2(_elm_lang$core$List$filter, _elm_lang$core$Tuple$second, list)))); -}; -var _elm_lang$html$Html_Attributes$style = _elm_lang$virtual_dom$VirtualDom$style; - -var _elm_lang$http$Native_Http = function() { - - -// ENCODING AND DECODING - -function encodeUri(string) -{ - return encodeURIComponent(string); -} - -function decodeUri(string) -{ - try - { - return _elm_lang$core$Maybe$Just(decodeURIComponent(string)); - } - catch(e) - { - return _elm_lang$core$Maybe$Nothing; - } -} - - -// SEND REQUEST - -function toTask(request, maybeProgress) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - var xhr = new XMLHttpRequest(); - - configureProgress(xhr, maybeProgress); - - xhr.addEventListener('error', function() { - callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'NetworkError' })); - }); - xhr.addEventListener('timeout', function() { - callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'Timeout' })); - }); - xhr.addEventListener('load', function() { - callback(handleResponse(xhr, request.expect.responseToResult)); - }); - - try - { - xhr.open(request.method, request.url, true); - } - catch (e) - { - return callback(_elm_lang$core$Native_Scheduler.fail({ ctor: 'BadUrl', _0: request.url })); - } - - configureRequest(xhr, request); - send(xhr, request.body); - - return function() { xhr.abort(); }; - }); -} - -function configureProgress(xhr, maybeProgress) -{ - if (maybeProgress.ctor === 'Nothing') - { - return; - } - - xhr.addEventListener('progress', function(event) { - if (!event.lengthComputable) - { - return; - } - _elm_lang$core$Native_Scheduler.rawSpawn(maybeProgress._0({ - bytes: event.loaded, - bytesExpected: event.total - })); - }); -} - -function configureRequest(xhr, request) -{ - function setHeader(pair) - { - xhr.setRequestHeader(pair._0, pair._1); - } - - A2(_elm_lang$core$List$map, setHeader, request.headers); - xhr.responseType = request.expect.responseType; - xhr.withCredentials = request.withCredentials; - - if (request.timeout.ctor === 'Just') - { - xhr.timeout = request.timeout._0; - } -} - -function send(xhr, body) -{ - switch (body.ctor) - { - case 'EmptyBody': - xhr.send(); - return; - - case 'StringBody': - xhr.setRequestHeader('Content-Type', body._0); - xhr.send(body._1); - return; - - case 'FormDataBody': - xhr.send(body._0); - return; - } -} - - -// RESPONSES - -function handleResponse(xhr, responseToResult) -{ - var response = toResponse(xhr); - - if (xhr.status < 200 || 300 <= xhr.status) - { - response.body = xhr.responseText; - return _elm_lang$core$Native_Scheduler.fail({ - ctor: 'BadStatus', - _0: response - }); - } - - var result = responseToResult(response); - - if (result.ctor === 'Ok') - { - return _elm_lang$core$Native_Scheduler.succeed(result._0); - } - else - { - response.body = xhr.responseText; - return _elm_lang$core$Native_Scheduler.fail({ - ctor: 'BadPayload', - _0: result._0, - _1: response - }); - } -} - -function toResponse(xhr) -{ - return { - status: { code: xhr.status, message: xhr.statusText }, - headers: parseHeaders(xhr.getAllResponseHeaders()), - url: xhr.responseURL, - body: xhr.response - }; -} - -function parseHeaders(rawHeaders) -{ - var headers = _elm_lang$core$Dict$empty; - - if (!rawHeaders) - { - return headers; - } - - var headerPairs = rawHeaders.split('\u000d\u000a'); - for (var i = headerPairs.length; i--; ) - { - var headerPair = headerPairs[i]; - var index = headerPair.indexOf('\u003a\u0020'); - if (index > 0) - { - var key = headerPair.substring(0, index); - var value = headerPair.substring(index + 2); - - headers = A3(_elm_lang$core$Dict$update, key, function(oldValue) { - if (oldValue.ctor === 'Just') - { - return _elm_lang$core$Maybe$Just(value + ', ' + oldValue._0); - } - return _elm_lang$core$Maybe$Just(value); - }, headers); - } - } - - return headers; -} - - -// EXPECTORS - -function expectStringResponse(responseToResult) -{ - return { - responseType: 'text', - responseToResult: responseToResult - }; -} - -function mapExpect(func, expect) -{ - return { - responseType: expect.responseType, - responseToResult: function(response) { - var convertedResponse = expect.responseToResult(response); - return A2(_elm_lang$core$Result$map, func, convertedResponse); - } - }; -} - - -// BODY - -function multipart(parts) -{ - var formData = new FormData(); - - while (parts.ctor !== '[]') - { - var part = parts._0; - formData.append(part._0, part._1); - parts = parts._1; - } - - return { ctor: 'FormDataBody', _0: formData }; -} - -return { - toTask: F2(toTask), - expectStringResponse: expectStringResponse, - mapExpect: F2(mapExpect), - multipart: multipart, - encodeUri: encodeUri, - decodeUri: decodeUri -}; - -}(); - -var _elm_lang$http$Http_Internal$map = F2( - function (func, request) { - return _elm_lang$core$Native_Utils.update( - request, - { - expect: A2(_elm_lang$http$Native_Http.mapExpect, func, request.expect) - }); - }); -var _elm_lang$http$Http_Internal$RawRequest = F7( - function (a, b, c, d, e, f, g) { - return {method: a, headers: b, url: c, body: d, expect: e, timeout: f, withCredentials: g}; - }); -var _elm_lang$http$Http_Internal$Request = function (a) { - return {ctor: 'Request', _0: a}; -}; -var _elm_lang$http$Http_Internal$Expect = {ctor: 'Expect'}; -var _elm_lang$http$Http_Internal$FormDataBody = {ctor: 'FormDataBody'}; -var _elm_lang$http$Http_Internal$StringBody = F2( - function (a, b) { - return {ctor: 'StringBody', _0: a, _1: b}; - }); -var _elm_lang$http$Http_Internal$EmptyBody = {ctor: 'EmptyBody'}; -var _elm_lang$http$Http_Internal$Header = F2( - function (a, b) { - return {ctor: 'Header', _0: a, _1: b}; - }); - -var _elm_lang$http$Http$decodeUri = _elm_lang$http$Native_Http.decodeUri; -var _elm_lang$http$Http$encodeUri = _elm_lang$http$Native_Http.encodeUri; -var _elm_lang$http$Http$expectStringResponse = _elm_lang$http$Native_Http.expectStringResponse; -var _elm_lang$http$Http$expectJson = function (decoder) { - return _elm_lang$http$Http$expectStringResponse( - function (response) { - return A2(_elm_lang$core$Json_Decode$decodeString, decoder, response.body); - }); -}; -var _elm_lang$http$Http$expectString = _elm_lang$http$Http$expectStringResponse( - function (response) { - return _elm_lang$core$Result$Ok(response.body); - }); -var _elm_lang$http$Http$multipartBody = _elm_lang$http$Native_Http.multipart; -var _elm_lang$http$Http$stringBody = _elm_lang$http$Http_Internal$StringBody; -var _elm_lang$http$Http$jsonBody = function (value) { - return A2( - _elm_lang$http$Http_Internal$StringBody, - 'application/json', - A2(_elm_lang$core$Json_Encode$encode, 0, value)); -}; -var _elm_lang$http$Http$emptyBody = _elm_lang$http$Http_Internal$EmptyBody; -var _elm_lang$http$Http$header = _elm_lang$http$Http_Internal$Header; -var _elm_lang$http$Http$request = _elm_lang$http$Http_Internal$Request; -var _elm_lang$http$Http$post = F3( - function (url, body, decoder) { - return _elm_lang$http$Http$request( - { - method: 'POST', - headers: {ctor: '[]'}, - url: url, - body: body, - expect: _elm_lang$http$Http$expectJson(decoder), - timeout: _elm_lang$core$Maybe$Nothing, - withCredentials: false - }); - }); -var _elm_lang$http$Http$get = F2( - function (url, decoder) { - return _elm_lang$http$Http$request( - { - method: 'GET', - headers: {ctor: '[]'}, - url: url, - body: _elm_lang$http$Http$emptyBody, - expect: _elm_lang$http$Http$expectJson(decoder), - timeout: _elm_lang$core$Maybe$Nothing, - withCredentials: false - }); - }); -var _elm_lang$http$Http$getString = function (url) { - return _elm_lang$http$Http$request( - { - method: 'GET', - headers: {ctor: '[]'}, - url: url, - body: _elm_lang$http$Http$emptyBody, - expect: _elm_lang$http$Http$expectString, - timeout: _elm_lang$core$Maybe$Nothing, - withCredentials: false - }); -}; -var _elm_lang$http$Http$toTask = function (_p0) { - var _p1 = _p0; - return A2(_elm_lang$http$Native_Http.toTask, _p1._0, _elm_lang$core$Maybe$Nothing); -}; -var _elm_lang$http$Http$send = F2( - function (resultToMessage, request) { - return A2( - _elm_lang$core$Task$attempt, - resultToMessage, - _elm_lang$http$Http$toTask(request)); - }); -var _elm_lang$http$Http$Response = F4( - function (a, b, c, d) { - return {url: a, status: b, headers: c, body: d}; - }); -var _elm_lang$http$Http$BadPayload = F2( - function (a, b) { - return {ctor: 'BadPayload', _0: a, _1: b}; - }); -var _elm_lang$http$Http$BadStatus = function (a) { - return {ctor: 'BadStatus', _0: a}; -}; -var _elm_lang$http$Http$NetworkError = {ctor: 'NetworkError'}; -var _elm_lang$http$Http$Timeout = {ctor: 'Timeout'}; -var _elm_lang$http$Http$BadUrl = function (a) { - return {ctor: 'BadUrl', _0: a}; -}; -var _elm_lang$http$Http$StringPart = F2( - function (a, b) { - return {ctor: 'StringPart', _0: a, _1: b}; - }); -var _elm_lang$http$Http$stringPart = _elm_lang$http$Http$StringPart; - -var _elm_lang$navigation$Native_Navigation = function() { - - -// FAKE NAVIGATION - -function go(n) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - if (n !== 0) - { - history.go(n); - } - callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); - }); -} - -function pushState(url) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - history.pushState({}, '', url); - callback(_elm_lang$core$Native_Scheduler.succeed(getLocation())); - }); -} - -function replaceState(url) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - history.replaceState({}, '', url); - callback(_elm_lang$core$Native_Scheduler.succeed(getLocation())); - }); -} - - -// REAL NAVIGATION - -function reloadPage(skipCache) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - document.location.reload(skipCache); - callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); - }); -} - -function setLocation(url) -{ - return _elm_lang$core$Native_Scheduler.nativeBinding(function(callback) - { - try - { - window.location = url; - } - catch(err) - { - // Only Firefox can throw a NS_ERROR_MALFORMED_URI exception here. - // Other browsers reload the page, so let's be consistent about that. - document.location.reload(false); - } - callback(_elm_lang$core$Native_Scheduler.succeed(_elm_lang$core$Native_Utils.Tuple0)); - }); -} - - -// GET LOCATION - -function getLocation() -{ - var location = document.location; - - return { - href: location.href, - host: location.host, - hostname: location.hostname, - protocol: location.protocol, - origin: location.origin, - port_: location.port, - pathname: location.pathname, - search: location.search, - hash: location.hash, - username: location.username, - password: location.password - }; -} - - -// DETECT IE11 PROBLEMS - -function isInternetExplorer11() -{ - return window.navigator.userAgent.indexOf('Trident') !== -1; -} - - -return { - go: go, - setLocation: setLocation, - reloadPage: reloadPage, - pushState: pushState, - replaceState: replaceState, - getLocation: getLocation, - isInternetExplorer11: isInternetExplorer11 -}; - -}(); - -var _elm_lang$navigation$Navigation$replaceState = _elm_lang$navigation$Native_Navigation.replaceState; -var _elm_lang$navigation$Navigation$pushState = _elm_lang$navigation$Native_Navigation.pushState; -var _elm_lang$navigation$Navigation$go = _elm_lang$navigation$Native_Navigation.go; -var _elm_lang$navigation$Navigation$reloadPage = _elm_lang$navigation$Native_Navigation.reloadPage; -var _elm_lang$navigation$Navigation$setLocation = _elm_lang$navigation$Native_Navigation.setLocation; -var _elm_lang$navigation$Navigation_ops = _elm_lang$navigation$Navigation_ops || {}; -_elm_lang$navigation$Navigation_ops['&>'] = F2( - function (task1, task2) { - return A2( - _elm_lang$core$Task$andThen, - function (_p0) { - return task2; - }, - task1); - }); -var _elm_lang$navigation$Navigation$notify = F3( - function (router, subs, location) { - var send = function (_p1) { - var _p2 = _p1; - return A2( - _elm_lang$core$Platform$sendToApp, - router, - _p2._0(location)); - }; - return A2( - _elm_lang$navigation$Navigation_ops['&>'], - _elm_lang$core$Task$sequence( - A2(_elm_lang$core$List$map, send, subs)), - _elm_lang$core$Task$succeed( - {ctor: '_Tuple0'})); - }); -var _elm_lang$navigation$Navigation$cmdHelp = F3( - function (router, subs, cmd) { - var _p3 = cmd; - switch (_p3.ctor) { - case 'Jump': - return _elm_lang$navigation$Navigation$go(_p3._0); - case 'New': - return A2( - _elm_lang$core$Task$andThen, - A2(_elm_lang$navigation$Navigation$notify, router, subs), - _elm_lang$navigation$Navigation$pushState(_p3._0)); - case 'Modify': - return A2( - _elm_lang$core$Task$andThen, - A2(_elm_lang$navigation$Navigation$notify, router, subs), - _elm_lang$navigation$Navigation$replaceState(_p3._0)); - case 'Visit': - return _elm_lang$navigation$Navigation$setLocation(_p3._0); - default: - return _elm_lang$navigation$Navigation$reloadPage(_p3._0); - } - }); -var _elm_lang$navigation$Navigation$killPopWatcher = function (popWatcher) { - var _p4 = popWatcher; - if (_p4.ctor === 'Normal') { - return _elm_lang$core$Process$kill(_p4._0); - } else { - return A2( - _elm_lang$navigation$Navigation_ops['&>'], - _elm_lang$core$Process$kill(_p4._0), - _elm_lang$core$Process$kill(_p4._1)); - } -}; -var _elm_lang$navigation$Navigation$onSelfMsg = F3( - function (router, location, state) { - return A2( - _elm_lang$navigation$Navigation_ops['&>'], - A3(_elm_lang$navigation$Navigation$notify, router, state.subs, location), - _elm_lang$core$Task$succeed(state)); - }); -var _elm_lang$navigation$Navigation$subscription = _elm_lang$core$Native_Platform.leaf('Navigation'); -var _elm_lang$navigation$Navigation$command = _elm_lang$core$Native_Platform.leaf('Navigation'); -var _elm_lang$navigation$Navigation$Location = function (a) { - return function (b) { - return function (c) { - return function (d) { - return function (e) { - return function (f) { - return function (g) { - return function (h) { - return function (i) { - return function (j) { - return function (k) { - return {href: a, host: b, hostname: c, protocol: d, origin: e, port_: f, pathname: g, search: h, hash: i, username: j, password: k}; - }; - }; - }; - }; - }; - }; - }; - }; - }; - }; -}; -var _elm_lang$navigation$Navigation$State = F2( - function (a, b) { - return {subs: a, popWatcher: b}; - }); -var _elm_lang$navigation$Navigation$init = _elm_lang$core$Task$succeed( - A2( - _elm_lang$navigation$Navigation$State, - {ctor: '[]'}, - _elm_lang$core$Maybe$Nothing)); -var _elm_lang$navigation$Navigation$Reload = function (a) { - return {ctor: 'Reload', _0: a}; -}; -var _elm_lang$navigation$Navigation$reload = _elm_lang$navigation$Navigation$command( - _elm_lang$navigation$Navigation$Reload(false)); -var _elm_lang$navigation$Navigation$reloadAndSkipCache = _elm_lang$navigation$Navigation$command( - _elm_lang$navigation$Navigation$Reload(true)); -var _elm_lang$navigation$Navigation$Visit = function (a) { - return {ctor: 'Visit', _0: a}; -}; -var _elm_lang$navigation$Navigation$load = function (url) { - return _elm_lang$navigation$Navigation$command( - _elm_lang$navigation$Navigation$Visit(url)); -}; -var _elm_lang$navigation$Navigation$Modify = function (a) { - return {ctor: 'Modify', _0: a}; -}; -var _elm_lang$navigation$Navigation$modifyUrl = function (url) { - return _elm_lang$navigation$Navigation$command( - _elm_lang$navigation$Navigation$Modify(url)); -}; -var _elm_lang$navigation$Navigation$New = function (a) { - return {ctor: 'New', _0: a}; -}; -var _elm_lang$navigation$Navigation$newUrl = function (url) { - return _elm_lang$navigation$Navigation$command( - _elm_lang$navigation$Navigation$New(url)); -}; -var _elm_lang$navigation$Navigation$Jump = function (a) { - return {ctor: 'Jump', _0: a}; -}; -var _elm_lang$navigation$Navigation$back = function (n) { - return _elm_lang$navigation$Navigation$command( - _elm_lang$navigation$Navigation$Jump(0 - n)); -}; -var _elm_lang$navigation$Navigation$forward = function (n) { - return _elm_lang$navigation$Navigation$command( - _elm_lang$navigation$Navigation$Jump(n)); -}; -var _elm_lang$navigation$Navigation$cmdMap = F2( - function (_p5, myCmd) { - var _p6 = myCmd; - switch (_p6.ctor) { - case 'Jump': - return _elm_lang$navigation$Navigation$Jump(_p6._0); - case 'New': - return _elm_lang$navigation$Navigation$New(_p6._0); - case 'Modify': - return _elm_lang$navigation$Navigation$Modify(_p6._0); - case 'Visit': - return _elm_lang$navigation$Navigation$Visit(_p6._0); - default: - return _elm_lang$navigation$Navigation$Reload(_p6._0); - } - }); -var _elm_lang$navigation$Navigation$Monitor = function (a) { - return {ctor: 'Monitor', _0: a}; -}; -var _elm_lang$navigation$Navigation$program = F2( - function (locationToMessage, stuff) { - var init = stuff.init( - _elm_lang$navigation$Native_Navigation.getLocation( - {ctor: '_Tuple0'})); - var subs = function (model) { - return _elm_lang$core$Platform_Sub$batch( - { - ctor: '::', - _0: _elm_lang$navigation$Navigation$subscription( - _elm_lang$navigation$Navigation$Monitor(locationToMessage)), - _1: { - ctor: '::', - _0: stuff.subscriptions(model), - _1: {ctor: '[]'} - } - }); - }; - return _elm_lang$html$Html$program( - {init: init, view: stuff.view, update: stuff.update, subscriptions: subs}); - }); -var _elm_lang$navigation$Navigation$programWithFlags = F2( - function (locationToMessage, stuff) { - var init = function (flags) { - return A2( - stuff.init, - flags, - _elm_lang$navigation$Native_Navigation.getLocation( - {ctor: '_Tuple0'})); - }; - var subs = function (model) { - return _elm_lang$core$Platform_Sub$batch( - { - ctor: '::', - _0: _elm_lang$navigation$Navigation$subscription( - _elm_lang$navigation$Navigation$Monitor(locationToMessage)), - _1: { - ctor: '::', - _0: stuff.subscriptions(model), - _1: {ctor: '[]'} - } - }); - }; - return _elm_lang$html$Html$programWithFlags( - {init: init, view: stuff.view, update: stuff.update, subscriptions: subs}); - }); -var _elm_lang$navigation$Navigation$subMap = F2( - function (func, _p7) { - var _p8 = _p7; - return _elm_lang$navigation$Navigation$Monitor( - function (_p9) { - return func( - _p8._0(_p9)); - }); - }); -var _elm_lang$navigation$Navigation$InternetExplorer = F2( - function (a, b) { - return {ctor: 'InternetExplorer', _0: a, _1: b}; - }); -var _elm_lang$navigation$Navigation$Normal = function (a) { - return {ctor: 'Normal', _0: a}; -}; -var _elm_lang$navigation$Navigation$spawnPopWatcher = function (router) { - var reportLocation = function (_p10) { - return A2( - _elm_lang$core$Platform$sendToSelf, - router, - _elm_lang$navigation$Native_Navigation.getLocation( - {ctor: '_Tuple0'})); - }; - return _elm_lang$navigation$Native_Navigation.isInternetExplorer11( - {ctor: '_Tuple0'}) ? A3( - _elm_lang$core$Task$map2, - _elm_lang$navigation$Navigation$InternetExplorer, - _elm_lang$core$Process$spawn( - A3(_elm_lang$dom$Dom_LowLevel$onWindow, 'popstate', _elm_lang$core$Json_Decode$value, reportLocation)), - _elm_lang$core$Process$spawn( - A3(_elm_lang$dom$Dom_LowLevel$onWindow, 'hashchange', _elm_lang$core$Json_Decode$value, reportLocation))) : A2( - _elm_lang$core$Task$map, - _elm_lang$navigation$Navigation$Normal, - _elm_lang$core$Process$spawn( - A3(_elm_lang$dom$Dom_LowLevel$onWindow, 'popstate', _elm_lang$core$Json_Decode$value, reportLocation))); -}; -var _elm_lang$navigation$Navigation$onEffects = F4( - function (router, cmds, subs, _p11) { - var _p12 = _p11; - var _p15 = _p12.popWatcher; - var stepState = function () { - var _p13 = {ctor: '_Tuple2', _0: subs, _1: _p15}; - _v6_2: - do { - if (_p13._0.ctor === '[]') { - if (_p13._1.ctor === 'Just') { - return A2( - _elm_lang$navigation$Navigation_ops['&>'], - _elm_lang$navigation$Navigation$killPopWatcher(_p13._1._0), - _elm_lang$core$Task$succeed( - A2(_elm_lang$navigation$Navigation$State, subs, _elm_lang$core$Maybe$Nothing))); - } else { - break _v6_2; - } - } else { - if (_p13._1.ctor === 'Nothing') { - return A2( - _elm_lang$core$Task$map, - function (_p14) { - return A2( - _elm_lang$navigation$Navigation$State, - subs, - _elm_lang$core$Maybe$Just(_p14)); - }, - _elm_lang$navigation$Navigation$spawnPopWatcher(router)); - } else { - break _v6_2; - } - } - } while(false); - return _elm_lang$core$Task$succeed( - A2(_elm_lang$navigation$Navigation$State, subs, _p15)); - }(); - return A2( - _elm_lang$navigation$Navigation_ops['&>'], - _elm_lang$core$Task$sequence( - A2( - _elm_lang$core$List$map, - A2(_elm_lang$navigation$Navigation$cmdHelp, router, subs), - cmds)), - stepState); - }); -_elm_lang$core$Native_Platform.effectManagers['Navigation'] = {pkg: 'elm-lang/navigation', init: _elm_lang$navigation$Navigation$init, onEffects: _elm_lang$navigation$Navigation$onEffects, onSelfMsg: _elm_lang$navigation$Navigation$onSelfMsg, tag: 'fx', cmdMap: _elm_lang$navigation$Navigation$cmdMap, subMap: _elm_lang$navigation$Navigation$subMap}; - -var _evancz$url_parser$UrlParser$toKeyValuePair = function (segment) { - var _p0 = A2(_elm_lang$core$String$split, '=', segment); - if (((_p0.ctor === '::') && (_p0._1.ctor === '::')) && (_p0._1._1.ctor === '[]')) { - return A3( - _elm_lang$core$Maybe$map2, - F2( - function (v0, v1) { - return {ctor: '_Tuple2', _0: v0, _1: v1}; - }), - _elm_lang$http$Http$decodeUri(_p0._0), - _elm_lang$http$Http$decodeUri(_p0._1._0)); - } else { - return _elm_lang$core$Maybe$Nothing; - } -}; -var _evancz$url_parser$UrlParser$parseParams = function (queryString) { - return _elm_lang$core$Dict$fromList( - A2( - _elm_lang$core$List$filterMap, - _evancz$url_parser$UrlParser$toKeyValuePair, - A2( - _elm_lang$core$String$split, - '&', - A2(_elm_lang$core$String$dropLeft, 1, queryString)))); -}; -var _evancz$url_parser$UrlParser$splitUrl = function (url) { - var _p1 = A2(_elm_lang$core$String$split, '/', url); - if ((_p1.ctor === '::') && (_p1._0 === '')) { - return _p1._1; - } else { - return _p1; - } -}; -var _evancz$url_parser$UrlParser$parseHelp = function (states) { - parseHelp: - while (true) { - var _p2 = states; - if (_p2.ctor === '[]') { - return _elm_lang$core$Maybe$Nothing; - } else { - var _p4 = _p2._0; - var _p3 = _p4.unvisited; - if (_p3.ctor === '[]') { - return _elm_lang$core$Maybe$Just(_p4.value); - } else { - if ((_p3._0 === '') && (_p3._1.ctor === '[]')) { - return _elm_lang$core$Maybe$Just(_p4.value); - } else { - var _v4 = _p2._1; - states = _v4; - continue parseHelp; - } - } - } - } -}; -var _evancz$url_parser$UrlParser$parse = F3( - function (_p5, url, params) { - var _p6 = _p5; - return _evancz$url_parser$UrlParser$parseHelp( - _p6._0( - { - visited: {ctor: '[]'}, - unvisited: _evancz$url_parser$UrlParser$splitUrl(url), - params: params, - value: _elm_lang$core$Basics$identity - })); - }); -var _evancz$url_parser$UrlParser$parseHash = F2( - function (parser, location) { - return A3( - _evancz$url_parser$UrlParser$parse, - parser, - A2(_elm_lang$core$String$dropLeft, 1, location.hash), - _evancz$url_parser$UrlParser$parseParams(location.search)); - }); -var _evancz$url_parser$UrlParser$parsePath = F2( - function (parser, location) { - return A3( - _evancz$url_parser$UrlParser$parse, - parser, - location.pathname, - _evancz$url_parser$UrlParser$parseParams(location.search)); - }); -var _evancz$url_parser$UrlParser$intParamHelp = function (maybeValue) { - var _p7 = maybeValue; - if (_p7.ctor === 'Nothing') { - return _elm_lang$core$Maybe$Nothing; - } else { - return _elm_lang$core$Result$toMaybe( - _elm_lang$core$String$toInt(_p7._0)); - } -}; -var _evancz$url_parser$UrlParser$mapHelp = F2( - function (func, _p8) { - var _p9 = _p8; - return { - visited: _p9.visited, - unvisited: _p9.unvisited, - params: _p9.params, - value: func(_p9.value) - }; - }); -var _evancz$url_parser$UrlParser$State = F4( - function (a, b, c, d) { - return {visited: a, unvisited: b, params: c, value: d}; - }); -var _evancz$url_parser$UrlParser$Parser = function (a) { - return {ctor: 'Parser', _0: a}; -}; -var _evancz$url_parser$UrlParser$s = function (str) { - return _evancz$url_parser$UrlParser$Parser( - function (_p10) { - var _p11 = _p10; - var _p12 = _p11.unvisited; - if (_p12.ctor === '[]') { - return {ctor: '[]'}; - } else { - var _p13 = _p12._0; - return _elm_lang$core$Native_Utils.eq(_p13, str) ? { - ctor: '::', - _0: A4( - _evancz$url_parser$UrlParser$State, - {ctor: '::', _0: _p13, _1: _p11.visited}, - _p12._1, - _p11.params, - _p11.value), - _1: {ctor: '[]'} - } : {ctor: '[]'}; - } - }); -}; -var _evancz$url_parser$UrlParser$custom = F2( - function (tipe, stringToSomething) { - return _evancz$url_parser$UrlParser$Parser( - function (_p14) { - var _p15 = _p14; - var _p16 = _p15.unvisited; - if (_p16.ctor === '[]') { - return {ctor: '[]'}; - } else { - var _p18 = _p16._0; - var _p17 = stringToSomething(_p18); - if (_p17.ctor === 'Ok') { - return { - ctor: '::', - _0: A4( - _evancz$url_parser$UrlParser$State, - {ctor: '::', _0: _p18, _1: _p15.visited}, - _p16._1, - _p15.params, - _p15.value(_p17._0)), - _1: {ctor: '[]'} - }; - } else { - return {ctor: '[]'}; - } - } - }); - }); -var _evancz$url_parser$UrlParser$string = A2(_evancz$url_parser$UrlParser$custom, 'STRING', _elm_lang$core$Result$Ok); -var _evancz$url_parser$UrlParser$int = A2(_evancz$url_parser$UrlParser$custom, 'NUMBER', _elm_lang$core$String$toInt); -var _evancz$url_parser$UrlParser_ops = _evancz$url_parser$UrlParser_ops || {}; -_evancz$url_parser$UrlParser_ops[''] = F2( - function (_p20, _p19) { - var _p21 = _p20; - var _p22 = _p19; - return _evancz$url_parser$UrlParser$Parser( - function (state) { - return A2( - _elm_lang$core$List$concatMap, - _p22._0, - _p21._0(state)); - }); - }); -var _evancz$url_parser$UrlParser$map = F2( - function (subValue, _p23) { - var _p24 = _p23; - return _evancz$url_parser$UrlParser$Parser( - function (_p25) { - var _p26 = _p25; - return A2( - _elm_lang$core$List$map, - _evancz$url_parser$UrlParser$mapHelp(_p26.value), - _p24._0( - {visited: _p26.visited, unvisited: _p26.unvisited, params: _p26.params, value: subValue})); - }); - }); -var _evancz$url_parser$UrlParser$oneOf = function (parsers) { - return _evancz$url_parser$UrlParser$Parser( - function (state) { - return A2( - _elm_lang$core$List$concatMap, - function (_p27) { - var _p28 = _p27; - return _p28._0(state); - }, - parsers); - }); -}; -var _evancz$url_parser$UrlParser$top = _evancz$url_parser$UrlParser$Parser( - function (state) { - return { - ctor: '::', - _0: state, - _1: {ctor: '[]'} - }; - }); -var _evancz$url_parser$UrlParser_ops = _evancz$url_parser$UrlParser_ops || {}; -_evancz$url_parser$UrlParser_ops[''] = F2( - function (_p30, _p29) { - var _p31 = _p30; - var _p32 = _p29; - return _evancz$url_parser$UrlParser$Parser( - function (state) { - return A2( - _elm_lang$core$List$concatMap, - _p32._0, - _p31._0(state)); - }); - }); -var _evancz$url_parser$UrlParser$QueryParser = function (a) { - return {ctor: 'QueryParser', _0: a}; -}; -var _evancz$url_parser$UrlParser$customParam = F2( - function (key, func) { - return _evancz$url_parser$UrlParser$QueryParser( - function (_p33) { - var _p34 = _p33; - var _p35 = _p34.params; - return { - ctor: '::', - _0: A4( - _evancz$url_parser$UrlParser$State, - _p34.visited, - _p34.unvisited, - _p35, - _p34.value( - func( - A2(_elm_lang$core$Dict$get, key, _p35)))), - _1: {ctor: '[]'} - }; - }); - }); -var _evancz$url_parser$UrlParser$stringParam = function (name) { - return A2(_evancz$url_parser$UrlParser$customParam, name, _elm_lang$core$Basics$identity); -}; -var _evancz$url_parser$UrlParser$intParam = function (name) { - return A2(_evancz$url_parser$UrlParser$customParam, name, _evancz$url_parser$UrlParser$intParamHelp); -}; - -var _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerSecond = 1000; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute = 60 * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerSecond; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerHour = 60 * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerDay = 24 * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerHour; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$dayOfWeekFromWeekdayNumber = function (n) { - var _p0 = n; - switch (_p0) { - case 1: - return _elm_lang$core$Date$Mon; - case 2: - return _elm_lang$core$Date$Tue; - case 3: - return _elm_lang$core$Date$Wed; - case 4: - return _elm_lang$core$Date$Thu; - case 5: - return _elm_lang$core$Date$Fri; - case 6: - return _elm_lang$core$Date$Sat; - default: - return _elm_lang$core$Date$Sun; - } -}; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$weekdayNumberFromDayOfWeek = function (d) { - var _p1 = d; - switch (_p1.ctor) { - case 'Mon': - return 1; - case 'Tue': - return 2; - case 'Wed': - return 3; - case 'Thu': - return 4; - case 'Fri': - return 5; - case 'Sat': - return 6; - default: - return 7; - } -}; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$monthFromMonthNumber = function (n) { - var _p2 = n; - switch (_p2) { - case 1: - return _elm_lang$core$Date$Jan; - case 2: - return _elm_lang$core$Date$Feb; - case 3: - return _elm_lang$core$Date$Mar; - case 4: - return _elm_lang$core$Date$Apr; - case 5: - return _elm_lang$core$Date$May; - case 6: - return _elm_lang$core$Date$Jun; - case 7: - return _elm_lang$core$Date$Jul; - case 8: - return _elm_lang$core$Date$Aug; - case 9: - return _elm_lang$core$Date$Sep; - case 10: - return _elm_lang$core$Date$Oct; - case 11: - return _elm_lang$core$Date$Nov; - default: - return _elm_lang$core$Date$Dec; - } -}; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$monthNumberFromMonth = function (m) { - var _p3 = m; - switch (_p3.ctor) { - case 'Jan': - return 1; - case 'Feb': - return 2; - case 'Mar': - return 3; - case 'Apr': - return 4; - case 'May': - return 5; - case 'Jun': - return 6; - case 'Jul': - return 7; - case 'Aug': - return 8; - case 'Sep': - return 9; - case 'Oct': - return 10; - case 'Nov': - return 11; - default: - return 12; - } -}; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$months = { - ctor: '::', - _0: _elm_lang$core$Date$Jan, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Feb, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Mar, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Apr, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$May, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Jun, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Jul, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Aug, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Sep, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Oct, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Nov, - _1: { - ctor: '::', - _0: _elm_lang$core$Date$Dec, - _1: {ctor: '[]'} - } - } - } - } - } - } - } - } - } - } - } -}; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear = function (y) { - return (_elm_lang$core$Native_Utils.eq( - A2(_elm_lang$core$Basics_ops['%'], y, 4), - 0) && (!_elm_lang$core$Native_Utils.eq( - A2(_elm_lang$core$Basics_ops['%'], y, 100), - 0))) || _elm_lang$core$Native_Utils.eq( - A2(_elm_lang$core$Basics_ops['%'], y, 400), - 0); -}; -var _justinmimbs$elm_date_extra$Date_Extra_Facts$daysInMonth = F2( - function (y, m) { - var _p4 = m; - switch (_p4.ctor) { - case 'Jan': - return 31; - case 'Feb': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 29 : 28; - case 'Mar': - return 31; - case 'Apr': - return 30; - case 'May': - return 31; - case 'Jun': - return 30; - case 'Jul': - return 31; - case 'Aug': - return 31; - case 'Sep': - return 30; - case 'Oct': - return 31; - case 'Nov': - return 30; - default: - return 31; - } - }); -var _justinmimbs$elm_date_extra$Date_Extra_Facts$daysBeforeStartOfMonth = F2( - function (y, m) { - var _p5 = m; - switch (_p5.ctor) { - case 'Jan': - return 0; - case 'Feb': - return 31; - case 'Mar': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 60 : 59; - case 'Apr': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 91 : 90; - case 'May': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 121 : 120; - case 'Jun': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 152 : 151; - case 'Jul': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 182 : 181; - case 'Aug': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 213 : 212; - case 'Sep': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 244 : 243; - case 'Oct': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 274 : 273; - case 'Nov': - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 305 : 304; - default: - return _justinmimbs$elm_date_extra$Date_Extra_Facts$isLeapYear(y) ? 335 : 334; - } - }); - -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$divideInt = F2( - function (a, b) { - return { - ctor: '_Tuple2', - _0: (a / b) | 0, - _1: A2(_elm_lang$core$Basics$rem, a, b) - }; - }); -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$year = function (rd) { - var _p0 = A2(_justinmimbs$elm_date_extra$Date_Internal_RataDie$divideInt, rd, 146097); - var n400 = _p0._0; - var r400 = _p0._1; - var _p1 = A2(_justinmimbs$elm_date_extra$Date_Internal_RataDie$divideInt, r400, 36524); - var n100 = _p1._0; - var r100 = _p1._1; - var _p2 = A2(_justinmimbs$elm_date_extra$Date_Internal_RataDie$divideInt, r100, 1461); - var n4 = _p2._0; - var r4 = _p2._1; - var _p3 = A2(_justinmimbs$elm_date_extra$Date_Internal_RataDie$divideInt, r4, 365); - var n1 = _p3._0; - var r1 = _p3._1; - var n = _elm_lang$core$Native_Utils.eq(r1, 0) ? 0 : 1; - return ((((n400 * 400) + (n100 * 100)) + (n4 * 4)) + n1) + n; -}; -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekdayNumber = function (rd) { - var _p4 = A2(_elm_lang$core$Basics_ops['%'], rd, 7); - if (_p4 === 0) { - return 7; - } else { - return _p4; - } -}; -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$daysBeforeYear = function (y1) { - var y = y1 - 1; - var leapYears = (((y / 4) | 0) - ((y / 100) | 0)) + ((y / 400) | 0); - return (365 * y) + leapYears; -}; -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$daysBeforeWeekYear = function (y) { - var jan4 = _justinmimbs$elm_date_extra$Date_Internal_RataDie$daysBeforeYear(y) + 4; - return jan4 - _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekdayNumber(jan4); -}; -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekYear = function (rd) { - return _justinmimbs$elm_date_extra$Date_Internal_RataDie$year( - rd + (4 - _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekdayNumber(rd))); -}; -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekNumber = function (rd) { - var week1Day1 = _justinmimbs$elm_date_extra$Date_Internal_RataDie$daysBeforeWeekYear( - _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekYear(rd)) + 1; - return (((rd - week1Day1) / 7) | 0) + 1; -}; -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$fromWeekDate = F3( - function (wy, wn, wdn) { - return (_justinmimbs$elm_date_extra$Date_Internal_RataDie$daysBeforeWeekYear(wy) + ((wn - 1) * 7)) + wdn; - }); -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$fromCalendarDate = F3( - function (y, m, d) { - return (_justinmimbs$elm_date_extra$Date_Internal_RataDie$daysBeforeYear(y) + A2(_justinmimbs$elm_date_extra$Date_Extra_Facts$daysBeforeStartOfMonth, y, m)) + d; - }); -var _justinmimbs$elm_date_extra$Date_Internal_RataDie$fromOrdinalDate = F2( - function (y, od) { - return _justinmimbs$elm_date_extra$Date_Internal_RataDie$daysBeforeYear(y) + od; - }); - -var _justinmimbs$elm_date_extra$Date_Internal_Core$msFromTimeParts = F4( - function (hh, mm, ss, ms) { - return (((_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerHour * hh) + (_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute * mm)) + (_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerSecond * ss)) + ms; - }); -var _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromRataDie = function (rd) { - return (rd - 719163) * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerDay; -}; -var _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromOrdinalDate = F2( - function (y, d) { - return _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromRataDie( - A2(_justinmimbs$elm_date_extra$Date_Internal_RataDie$fromOrdinalDate, y, d)); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromCalendarDate = F3( - function (y, m, d) { - return _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromRataDie( - A3(_justinmimbs$elm_date_extra$Date_Internal_RataDie$fromCalendarDate, y, m, d)); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromParts = F7( - function (y, m, d, hh, mm, ss, ms) { - return A3(_justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromCalendarDate, y, m, d) + A4(_justinmimbs$elm_date_extra$Date_Internal_Core$msFromTimeParts, hh, mm, ss, ms); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromWeekDate = F3( - function (y, w, d) { - return _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromRataDie( - A3(_justinmimbs$elm_date_extra$Date_Internal_RataDie$fromWeekDate, y, w, d)); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Core$weekNumberFromCalendarDate = F3( - function (y, m, d) { - return _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekNumber( - A3(_justinmimbs$elm_date_extra$Date_Internal_RataDie$fromCalendarDate, y, m, d)); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Core$weekYearFromCalendarDate = F3( - function (y, m, d) { - return _justinmimbs$elm_date_extra$Date_Internal_RataDie$weekYear( - A3(_justinmimbs$elm_date_extra$Date_Internal_RataDie$fromCalendarDate, y, m, d)); - }); - -var _justinmimbs$elm_date_extra$Date_Internal_Extract$msOffsetFromUtc = function (date) { - var utcTime = _elm_lang$core$Date$toTime(date); - var localTime = _elm_lang$core$Basics$toFloat( - A7( - _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromParts, - _elm_lang$core$Date$year(date), - _elm_lang$core$Date$month(date), - _elm_lang$core$Date$day(date), - _elm_lang$core$Date$hour(date), - _elm_lang$core$Date$minute(date), - _elm_lang$core$Date$second(date), - _elm_lang$core$Date$millisecond(date))); - return _elm_lang$core$Basics$floor(localTime - utcTime); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$offsetFromUtc = function (date) { - return (_justinmimbs$elm_date_extra$Date_Internal_Extract$msOffsetFromUtc(date) / _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute) | 0; -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$weekYear = function (date) { - return A3( - _justinmimbs$elm_date_extra$Date_Internal_Core$weekYearFromCalendarDate, - _elm_lang$core$Date$year(date), - _elm_lang$core$Date$month(date), - _elm_lang$core$Date$day(date)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$weekNumber = function (date) { - return A3( - _justinmimbs$elm_date_extra$Date_Internal_Core$weekNumberFromCalendarDate, - _elm_lang$core$Date$year(date), - _elm_lang$core$Date$month(date), - _elm_lang$core$Date$day(date)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$weekdayNumber = function (_p0) { - return _justinmimbs$elm_date_extra$Date_Extra_Facts$weekdayNumberFromDayOfWeek( - _elm_lang$core$Date$dayOfWeek(_p0)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$fractionalDay = function (date) { - var timeOfDayMS = A4( - _justinmimbs$elm_date_extra$Date_Internal_Core$msFromTimeParts, - _elm_lang$core$Date$hour(date), - _elm_lang$core$Date$minute(date), - _elm_lang$core$Date$second(date), - _elm_lang$core$Date$millisecond(date)); - return _elm_lang$core$Basics$toFloat(timeOfDayMS) / _elm_lang$core$Basics$toFloat(_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerDay); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$ordinalDay = function (date) { - return A2( - _justinmimbs$elm_date_extra$Date_Extra_Facts$daysBeforeStartOfMonth, - _elm_lang$core$Date$year(date), - _elm_lang$core$Date$month(date)) + _elm_lang$core$Date$day(date); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$monthNumber = function (_p1) { - return _justinmimbs$elm_date_extra$Date_Extra_Facts$monthNumberFromMonth( - _elm_lang$core$Date$month(_p1)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Extract$quarter = function (date) { - return _elm_lang$core$Basics$ceiling( - function (n) { - return n / 3; - }( - _elm_lang$core$Basics$toFloat( - _justinmimbs$elm_date_extra$Date_Internal_Extract$monthNumber(date)))); -}; - -var _justinmimbs$elm_date_extra$Date_Internal_Format$toUtc = function (date) { - return _elm_lang$core$Date$fromTime( - _elm_lang$core$Date$toTime(date) - _elm_lang$core$Basics$toFloat( - _justinmimbs$elm_date_extra$Date_Internal_Extract$offsetFromUtc(date) * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$nameForm = function (length) { - var _p0 = length; - switch (_p0) { - case 1: - return 'abbreviated'; - case 2: - return 'abbreviated'; - case 3: - return 'abbreviated'; - case 4: - return 'full'; - case 5: - return 'narrow'; - case 6: - return 'short'; - default: - return 'invalid'; - } -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$patternMatches = _elm_lang$core$Regex$regex('([yYQMwdDEeabhHmsSXx])\\1*|\'(?:[^\']|\'\')*?\'(?!\')'); -var _justinmimbs$elm_date_extra$Date_Internal_Format$formatTimeOffset = F3( - function (separator, minutesOptional, offset) { - var mm = A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - A2( - _elm_lang$core$Basics_ops['%'], - _elm_lang$core$Basics$abs(offset), - 60))); - var hh = A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - (_elm_lang$core$Basics$abs(offset) / 60) | 0)); - var sign = (_elm_lang$core$Native_Utils.cmp(offset, 0) > -1) ? '+' : '-'; - return (minutesOptional && _elm_lang$core$Native_Utils.eq(mm, '00')) ? A2(_elm_lang$core$Basics_ops['++'], sign, hh) : A2( - _elm_lang$core$Basics_ops['++'], - sign, - A2( - _elm_lang$core$Basics_ops['++'], - hh, - A2(_elm_lang$core$Basics_ops['++'], separator, mm))); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Format$ordinalSuffix = function (n) { - var nn = A2(_elm_lang$core$Basics_ops['%'], n, 100); - var _p1 = A2( - _elm_lang$core$Basics$min, - (_elm_lang$core$Native_Utils.cmp(nn, 20) < 0) ? nn : A2(_elm_lang$core$Basics_ops['%'], nn, 10), - 4); - switch (_p1) { - case 0: - return 'th'; - case 1: - return 'st'; - case 2: - return 'nd'; - case 3: - return 'rd'; - case 4: - return 'th'; - default: - return ''; - } -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$withOrdinalSuffix = function (n) { - return A2( - _elm_lang$core$Basics_ops['++'], - _elm_lang$core$Basics$toString(n), - _justinmimbs$elm_date_extra$Date_Internal_Format$ordinalSuffix(n)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$hour12 = function (date) { - var _p2 = A2( - _elm_lang$core$Basics_ops['%'], - _elm_lang$core$Date$hour(date), - 12); - if (_p2 === 0) { - return 12; - } else { - return _p2; - } -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$dayOfWeekName = function (d) { - var _p3 = d; - switch (_p3.ctor) { - case 'Mon': - return 'Monday'; - case 'Tue': - return 'Tuesday'; - case 'Wed': - return 'Wednesday'; - case 'Thu': - return 'Thursday'; - case 'Fri': - return 'Friday'; - case 'Sat': - return 'Saturday'; - default: - return 'Sunday'; - } -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$monthName = function (m) { - var _p4 = m; - switch (_p4.ctor) { - case 'Jan': - return 'January'; - case 'Feb': - return 'February'; - case 'Mar': - return 'March'; - case 'Apr': - return 'April'; - case 'May': - return 'May'; - case 'Jun': - return 'June'; - case 'Jul': - return 'July'; - case 'Aug': - return 'August'; - case 'Sep': - return 'September'; - case 'Oct': - return 'October'; - case 'Nov': - return 'November'; - default: - return 'December'; - } -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$PM = {ctor: 'PM'}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$Noon = {ctor: 'Noon'}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$AM = {ctor: 'AM'}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$Midnight = {ctor: 'Midnight'}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$dayPeriod = function (date) { - var onTheHour = _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$minute(date), - 0) && (_elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$second(date), - 0) && _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$millisecond(date), - 0)); - var hh = _elm_lang$core$Date$hour(date); - return (_elm_lang$core$Native_Utils.eq(hh, 0) && onTheHour) ? _justinmimbs$elm_date_extra$Date_Internal_Format$Midnight : ((_elm_lang$core$Native_Utils.cmp(hh, 12) < 0) ? _justinmimbs$elm_date_extra$Date_Internal_Format$AM : ((_elm_lang$core$Native_Utils.eq(hh, 12) && onTheHour) ? _justinmimbs$elm_date_extra$Date_Internal_Format$Noon : _justinmimbs$elm_date_extra$Date_Internal_Format$PM)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Format$format = F3( - function (asUtc, date, match) { - format: - while (true) { - var length = _elm_lang$core$String$length(match); - var $char = A2(_elm_lang$core$String$left, 1, match); - var _p5 = $char; - switch (_p5) { - case 'y': - var _p6 = length; - if (_p6 === 2) { - return A2( - _elm_lang$core$String$right, - 2, - A3( - _elm_lang$core$String$padLeft, - length, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _elm_lang$core$Date$year(date)))); - } else { - return A3( - _elm_lang$core$String$padLeft, - length, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _elm_lang$core$Date$year(date))); - } - case 'Y': - var _p7 = length; - if (_p7 === 2) { - return A2( - _elm_lang$core$String$right, - 2, - A3( - _elm_lang$core$String$padLeft, - length, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$weekYear(date)))); - } else { - return A3( - _elm_lang$core$String$padLeft, - length, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$weekYear(date))); - } - case 'Q': - var _p8 = length; - switch (_p8) { - case 1: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$quarter(date)); - case 2: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$quarter(date)); - case 3: - return A2( - F2( - function (x, y) { - return A2(_elm_lang$core$Basics_ops['++'], x, y); - }), - 'Q', - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$quarter(date))); - case 4: - return _justinmimbs$elm_date_extra$Date_Internal_Format$withOrdinalSuffix( - _justinmimbs$elm_date_extra$Date_Internal_Extract$quarter(date)); - case 5: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$quarter(date)); - default: - return ''; - } - case 'M': - var _p9 = length; - switch (_p9) { - case 1: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$monthNumber(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$monthNumber(date))); - case 3: - return A2( - _elm_lang$core$String$left, - 3, - _justinmimbs$elm_date_extra$Date_Internal_Format$monthName( - _elm_lang$core$Date$month(date))); - case 4: - return _justinmimbs$elm_date_extra$Date_Internal_Format$monthName( - _elm_lang$core$Date$month(date)); - case 5: - return A2( - _elm_lang$core$String$left, - 1, - _justinmimbs$elm_date_extra$Date_Internal_Format$monthName( - _elm_lang$core$Date$month(date))); - default: - return ''; - } - case 'w': - var _p10 = length; - switch (_p10) { - case 1: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$weekNumber(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$weekNumber(date))); - default: - return ''; - } - case 'd': - var _p11 = length; - switch (_p11) { - case 1: - return _elm_lang$core$Basics$toString( - _elm_lang$core$Date$day(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _elm_lang$core$Date$day(date))); - case 3: - return _justinmimbs$elm_date_extra$Date_Internal_Format$withOrdinalSuffix( - _elm_lang$core$Date$day(date)); - default: - return ''; - } - case 'D': - var _p12 = length; - switch (_p12) { - case 1: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$ordinalDay(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$ordinalDay(date))); - case 3: - return A3( - _elm_lang$core$String$padLeft, - 3, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$ordinalDay(date))); - default: - return ''; - } - case 'E': - var _p13 = _justinmimbs$elm_date_extra$Date_Internal_Format$nameForm(length); - switch (_p13) { - case 'abbreviated': - return A2( - _elm_lang$core$String$left, - 3, - _justinmimbs$elm_date_extra$Date_Internal_Format$dayOfWeekName( - _elm_lang$core$Date$dayOfWeek(date))); - case 'full': - return _justinmimbs$elm_date_extra$Date_Internal_Format$dayOfWeekName( - _elm_lang$core$Date$dayOfWeek(date)); - case 'narrow': - return A2( - _elm_lang$core$String$left, - 1, - _justinmimbs$elm_date_extra$Date_Internal_Format$dayOfWeekName( - _elm_lang$core$Date$dayOfWeek(date))); - case 'short': - return A2( - _elm_lang$core$String$left, - 2, - _justinmimbs$elm_date_extra$Date_Internal_Format$dayOfWeekName( - _elm_lang$core$Date$dayOfWeek(date))); - default: - return ''; - } - case 'e': - var _p14 = length; - switch (_p14) { - case 1: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$weekdayNumber(date)); - case 2: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Extract$weekdayNumber(date)); - default: - var _v15 = asUtc, - _v16 = date, - _v17 = _elm_lang$core$String$toUpper(match); - asUtc = _v15; - date = _v16; - match = _v17; - continue format; - } - case 'a': - var p = _justinmimbs$elm_date_extra$Date_Internal_Format$dayPeriod(date); - var m = (_elm_lang$core$Native_Utils.eq(p, _justinmimbs$elm_date_extra$Date_Internal_Format$Midnight) || _elm_lang$core$Native_Utils.eq(p, _justinmimbs$elm_date_extra$Date_Internal_Format$AM)) ? 'A' : 'P'; - var _p15 = _justinmimbs$elm_date_extra$Date_Internal_Format$nameForm(length); - switch (_p15) { - case 'abbreviated': - return A2(_elm_lang$core$Basics_ops['++'], m, 'M'); - case 'full': - return A2(_elm_lang$core$Basics_ops['++'], m, '.M.'); - case 'narrow': - return m; - default: - return ''; - } - case 'b': - var _p16 = _justinmimbs$elm_date_extra$Date_Internal_Format$nameForm(length); - switch (_p16) { - case 'abbreviated': - var _p17 = _justinmimbs$elm_date_extra$Date_Internal_Format$dayPeriod(date); - switch (_p17.ctor) { - case 'Midnight': - return 'mid.'; - case 'AM': - return 'am'; - case 'Noon': - return 'noon'; - default: - return 'pm'; - } - case 'full': - var _p18 = _justinmimbs$elm_date_extra$Date_Internal_Format$dayPeriod(date); - switch (_p18.ctor) { - case 'Midnight': - return 'midnight'; - case 'AM': - return 'a.m.'; - case 'Noon': - return 'noon'; - default: - return 'p.m.'; - } - case 'narrow': - var _p19 = _justinmimbs$elm_date_extra$Date_Internal_Format$dayPeriod(date); - switch (_p19.ctor) { - case 'Midnight': - return 'md'; - case 'AM': - return 'a'; - case 'Noon': - return 'nn'; - default: - return 'p'; - } - default: - return ''; - } - case 'h': - var _p20 = length; - switch (_p20) { - case 1: - return _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Format$hour12(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _justinmimbs$elm_date_extra$Date_Internal_Format$hour12(date))); - default: - return ''; - } - case 'H': - var _p21 = length; - switch (_p21) { - case 1: - return _elm_lang$core$Basics$toString( - _elm_lang$core$Date$hour(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _elm_lang$core$Date$hour(date))); - default: - return ''; - } - case 'm': - var _p22 = length; - switch (_p22) { - case 1: - return _elm_lang$core$Basics$toString( - _elm_lang$core$Date$minute(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _elm_lang$core$Date$minute(date))); - default: - return ''; - } - case 's': - var _p23 = length; - switch (_p23) { - case 1: - return _elm_lang$core$Basics$toString( - _elm_lang$core$Date$second(date)); - case 2: - return A3( - _elm_lang$core$String$padLeft, - 2, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _elm_lang$core$Date$second(date))); - default: - return ''; - } - case 'S': - return A3( - _elm_lang$core$String$padRight, - length, - _elm_lang$core$Native_Utils.chr('0'), - A2( - _elm_lang$core$String$left, - length, - A3( - _elm_lang$core$String$padLeft, - 3, - _elm_lang$core$Native_Utils.chr('0'), - _elm_lang$core$Basics$toString( - _elm_lang$core$Date$millisecond(date))))); - case 'X': - if ((_elm_lang$core$Native_Utils.cmp(length, 4) < 0) && (asUtc || _elm_lang$core$Native_Utils.eq( - _justinmimbs$elm_date_extra$Date_Internal_Extract$offsetFromUtc(date), - 0))) { - return 'Z'; - } else { - var _v27 = asUtc, - _v28 = date, - _v29 = _elm_lang$core$String$toLower(match); - asUtc = _v27; - date = _v28; - match = _v29; - continue format; - } - case 'x': - var offset = asUtc ? 0 : _justinmimbs$elm_date_extra$Date_Internal_Extract$offsetFromUtc(date); - var _p24 = length; - switch (_p24) { - case 1: - return A3(_justinmimbs$elm_date_extra$Date_Internal_Format$formatTimeOffset, '', true, offset); - case 2: - return A3(_justinmimbs$elm_date_extra$Date_Internal_Format$formatTimeOffset, '', false, offset); - case 3: - return A3(_justinmimbs$elm_date_extra$Date_Internal_Format$formatTimeOffset, ':', false, offset); - default: - return ''; - } - case '\'': - return _elm_lang$core$Native_Utils.eq(match, '\'\'') ? '\'' : A4( - _elm_lang$core$Regex$replace, - _elm_lang$core$Regex$All, - _elm_lang$core$Regex$regex('\'\''), - function (_p25) { - return '\''; - }, - A3(_elm_lang$core$String$slice, 1, -1, match)); - default: - return ''; - } - } - }); -var _justinmimbs$elm_date_extra$Date_Internal_Format$toFormattedString = F3( - function (asUtc, pattern, date) { - var date_ = asUtc ? _justinmimbs$elm_date_extra$Date_Internal_Format$toUtc(date) : date; - return A4( - _elm_lang$core$Regex$replace, - _elm_lang$core$Regex$All, - _justinmimbs$elm_date_extra$Date_Internal_Format$patternMatches, - function (_p26) { - return A3( - _justinmimbs$elm_date_extra$Date_Internal_Format$format, - asUtc, - date_, - function (_) { - return _.match; - }(_p26)); - }, - pattern); - }); - -var _justinmimbs$elm_date_extra$Date_Internal_Parse$isoDateRegex = function () { - var time = 'T(\\d{2})(?:(\\:)?(\\d{2})(?:\\10(\\d{2}))?)?(\\.\\d+)?(?:(Z)|(?:([+\\-])(\\d{2})(?:\\:?(\\d{2}))?))?'; - var ord = '\\-?(\\d{3})'; - var week = '(\\-)?W(\\d{2})(?:\\5(\\d))?'; - var cal = '(\\-)?(\\d{2})(?:\\2(\\d{2}))?'; - var year = '(\\d{4})'; - return _elm_lang$core$Regex$regex( - A2( - _elm_lang$core$Basics_ops['++'], - '^', - A2( - _elm_lang$core$Basics_ops['++'], - year, - A2( - _elm_lang$core$Basics_ops['++'], - '(?:', - A2( - _elm_lang$core$Basics_ops['++'], - cal, - A2( - _elm_lang$core$Basics_ops['++'], - '|', - A2( - _elm_lang$core$Basics_ops['++'], - week, - A2( - _elm_lang$core$Basics_ops['++'], - '|', - A2( - _elm_lang$core$Basics_ops['++'], - ord, - A2( - _elm_lang$core$Basics_ops['++'], - ')?', - A2( - _elm_lang$core$Basics_ops['++'], - '(?:', - A2(_elm_lang$core$Basics_ops['++'], time, ')?$')))))))))))); -}(); -var _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToFloat = function (_p0) { - return _elm_lang$core$Result$toMaybe( - _elm_lang$core$String$toFloat(_p0)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Parse$msFromMatches = F4( - function (timeHH, timeMM, timeSS, timeF) { - var fractional = A2( - _elm_lang$core$Maybe$withDefault, - 0.0, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToFloat, timeF)); - var _p1 = function () { - var _p2 = A2( - _elm_lang$core$List$map, - _elm_lang$core$Maybe$andThen(_justinmimbs$elm_date_extra$Date_Internal_Parse$stringToFloat), - { - ctor: '::', - _0: timeHH, - _1: { - ctor: '::', - _0: timeMM, - _1: { - ctor: '::', - _0: timeSS, - _1: {ctor: '[]'} - } - } - }); - _v0_3: - do { - if (((_p2.ctor === '::') && (_p2._0.ctor === 'Just')) && (_p2._1.ctor === '::')) { - if (_p2._1._0.ctor === 'Just') { - if (_p2._1._1.ctor === '::') { - if (_p2._1._1._0.ctor === 'Just') { - if (_p2._1._1._1.ctor === '[]') { - return {ctor: '_Tuple3', _0: _p2._0._0, _1: _p2._1._0._0, _2: _p2._1._1._0._0 + fractional}; - } else { - break _v0_3; - } - } else { - if (_p2._1._1._1.ctor === '[]') { - return {ctor: '_Tuple3', _0: _p2._0._0, _1: _p2._1._0._0 + fractional, _2: 0.0}; - } else { - break _v0_3; - } - } - } else { - break _v0_3; - } - } else { - if (((_p2._1._1.ctor === '::') && (_p2._1._1._0.ctor === 'Nothing')) && (_p2._1._1._1.ctor === '[]')) { - return {ctor: '_Tuple3', _0: _p2._0._0 + fractional, _1: 0.0, _2: 0.0}; - } else { - break _v0_3; - } - } - } else { - break _v0_3; - } - } while(false); - return {ctor: '_Tuple3', _0: 0.0, _1: 0.0, _2: 0.0}; - }(); - var hh = _p1._0; - var mm = _p1._1; - var ss = _p1._2; - return _elm_lang$core$Basics$round( - ((hh * _elm_lang$core$Basics$toFloat(_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerHour)) + (mm * _elm_lang$core$Basics$toFloat(_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute))) + (ss * _elm_lang$core$Basics$toFloat(_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerSecond))); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt = function (_p3) { - return _elm_lang$core$Result$toMaybe( - _elm_lang$core$String$toInt(_p3)); -}; -var _justinmimbs$elm_date_extra$Date_Internal_Parse$unixTimeFromMatches = F6( - function (yyyy, calMM, calDD, weekWW, weekD, ordDDD) { - var y = A2( - _elm_lang$core$Maybe$withDefault, - 1, - _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt(yyyy)); - var _p4 = {ctor: '_Tuple2', _0: calMM, _1: weekWW}; - _v1_2: - do { - if (_p4.ctor === '_Tuple2') { - if (_p4._0.ctor === 'Just') { - if (_p4._1.ctor === 'Nothing') { - return A3( - _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromCalendarDate, - y, - _justinmimbs$elm_date_extra$Date_Extra_Facts$monthFromMonthNumber( - A2( - _elm_lang$core$Maybe$withDefault, - 1, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt, calMM))), - A2( - _elm_lang$core$Maybe$withDefault, - 1, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt, calDD))); - } else { - break _v1_2; - } - } else { - if (_p4._1.ctor === 'Just') { - return A3( - _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromWeekDate, - y, - A2( - _elm_lang$core$Maybe$withDefault, - 1, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt, weekWW)), - A2( - _elm_lang$core$Maybe$withDefault, - 1, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt, weekD))); - } else { - break _v1_2; - } - } - } else { - break _v1_2; - } - } while(false); - return A2( - _justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromOrdinalDate, - y, - A2( - _elm_lang$core$Maybe$withDefault, - 1, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt, ordDDD))); - }); -var _justinmimbs$elm_date_extra$Date_Internal_Parse$offsetFromMatches = F4( - function (tzZ, tzSign, tzHH, tzMM) { - var _p5 = {ctor: '_Tuple2', _0: tzZ, _1: tzSign}; - _v2_2: - do { - if (_p5.ctor === '_Tuple2') { - if (_p5._0.ctor === 'Just') { - if ((_p5._0._0 === 'Z') && (_p5._1.ctor === 'Nothing')) { - return _elm_lang$core$Maybe$Just(0); - } else { - break _v2_2; - } - } else { - if (_p5._1.ctor === 'Just') { - var mm = A2( - _elm_lang$core$Maybe$withDefault, - 0, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt, tzMM)); - var hh = A2( - _elm_lang$core$Maybe$withDefault, - 0, - A2(_elm_lang$core$Maybe$andThen, _justinmimbs$elm_date_extra$Date_Internal_Parse$stringToInt, tzHH)); - return _elm_lang$core$Maybe$Just( - (_elm_lang$core$Native_Utils.eq(_p5._1._0, '+') ? 1 : -1) * ((hh * 60) + mm)); - } else { - break _v2_2; - } - } - } else { - break _v2_2; - } - } while(false); - return _elm_lang$core$Maybe$Nothing; - }); -var _justinmimbs$elm_date_extra$Date_Internal_Parse$offsetTimeFromMatches = function (matches) { - var _p6 = matches; - if (((((((((((((((((((_p6.ctor === '::') && (_p6._0.ctor === 'Just')) && (_p6._1.ctor === '::')) && (_p6._1._1.ctor === '::')) && (_p6._1._1._1.ctor === '::')) && (_p6._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.ctor === '::')) && (_p6._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1.ctor === '[]')) { - var offset = A4(_justinmimbs$elm_date_extra$Date_Internal_Parse$offsetFromMatches, _p6._1._1._1._1._1._1._1._1._1._1._1._1._1._0, _p6._1._1._1._1._1._1._1._1._1._1._1._1._1._1._0, _p6._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._0, _p6._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._1._0); - var timeMS = A4(_justinmimbs$elm_date_extra$Date_Internal_Parse$msFromMatches, _p6._1._1._1._1._1._1._1._1._0, _p6._1._1._1._1._1._1._1._1._1._1._0, _p6._1._1._1._1._1._1._1._1._1._1._1._0, _p6._1._1._1._1._1._1._1._1._1._1._1._1._0); - var dateMS = A6(_justinmimbs$elm_date_extra$Date_Internal_Parse$unixTimeFromMatches, _p6._0._0, _p6._1._1._0, _p6._1._1._1._0, _p6._1._1._1._1._1._0, _p6._1._1._1._1._1._1._0, _p6._1._1._1._1._1._1._1._0); - return _elm_lang$core$Maybe$Just( - {ctor: '_Tuple2', _0: offset, _1: dateMS + timeMS}); - } else { - return _elm_lang$core$Maybe$Nothing; - } -}; -var _justinmimbs$elm_date_extra$Date_Internal_Parse$offsetTimeFromIsoString = function (s) { - return A2( - _elm_lang$core$Maybe$andThen, - _justinmimbs$elm_date_extra$Date_Internal_Parse$offsetTimeFromMatches, - A2( - _elm_lang$core$Maybe$map, - function (_) { - return _.submatches; - }, - _elm_lang$core$List$head( - A3( - _elm_lang$core$Regex$find, - _elm_lang$core$Regex$AtMost(1), - _justinmimbs$elm_date_extra$Date_Internal_Parse$isoDateRegex, - s)))); -}; - -var _justinmimbs$elm_date_extra$Date_Extra$toRataDie = function (date) { - return A3( - _justinmimbs$elm_date_extra$Date_Internal_RataDie$fromCalendarDate, - _elm_lang$core$Date$year(date), - _elm_lang$core$Date$month(date), - _elm_lang$core$Date$day(date)); -}; -var _justinmimbs$elm_date_extra$Date_Extra$toParts = function (date) { - return { - ctor: '_Tuple7', - _0: _elm_lang$core$Date$year(date), - _1: _elm_lang$core$Date$month(date), - _2: _elm_lang$core$Date$day(date), - _3: _elm_lang$core$Date$hour(date), - _4: _elm_lang$core$Date$minute(date), - _5: _elm_lang$core$Date$second(date), - _6: _elm_lang$core$Date$millisecond(date) - }; -}; -var _justinmimbs$elm_date_extra$Date_Extra$monthFromQuarter = function (q) { - var _p0 = q; - switch (_p0) { - case 1: - return _elm_lang$core$Date$Jan; - case 2: - return _elm_lang$core$Date$Apr; - case 3: - return _elm_lang$core$Date$Jul; - default: - return _elm_lang$core$Date$Oct; - } -}; -var _justinmimbs$elm_date_extra$Date_Extra$clamp = F3( - function (min, max, date) { - return (_elm_lang$core$Native_Utils.cmp( - _elm_lang$core$Date$toTime(date), - _elm_lang$core$Date$toTime(min)) < 0) ? min : ((_elm_lang$core$Native_Utils.cmp( - _elm_lang$core$Date$toTime(date), - _elm_lang$core$Date$toTime(max)) > 0) ? max : date); - }); -var _justinmimbs$elm_date_extra$Date_Extra$comparableIsBetween = F3( - function (a, b, x) { - return ((_elm_lang$core$Native_Utils.cmp(a, x) < 1) && (_elm_lang$core$Native_Utils.cmp(x, b) < 1)) || ((_elm_lang$core$Native_Utils.cmp(b, x) < 1) && (_elm_lang$core$Native_Utils.cmp(x, a) < 1)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$isBetween = F3( - function (date1, date2, date) { - return A3( - _justinmimbs$elm_date_extra$Date_Extra$comparableIsBetween, - _elm_lang$core$Date$toTime(date1), - _elm_lang$core$Date$toTime(date2), - _elm_lang$core$Date$toTime(date)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$compare = F2( - function (a, b) { - return A2( - _elm_lang$core$Basics$compare, - _elm_lang$core$Date$toTime(a), - _elm_lang$core$Date$toTime(b)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$equal = F2( - function (a, b) { - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$toTime(a), - _elm_lang$core$Date$toTime(b)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$offsetFromUtc = _justinmimbs$elm_date_extra$Date_Internal_Extract$offsetFromUtc; -var _justinmimbs$elm_date_extra$Date_Extra$weekYear = _justinmimbs$elm_date_extra$Date_Internal_Extract$weekYear; -var _justinmimbs$elm_date_extra$Date_Extra$weekNumber = _justinmimbs$elm_date_extra$Date_Internal_Extract$weekNumber; -var _justinmimbs$elm_date_extra$Date_Extra$weekdayNumber = _justinmimbs$elm_date_extra$Date_Internal_Extract$weekdayNumber; -var _justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek = F2( - function (d, date) { - return _elm_lang$core$Basics$negate( - A2( - _elm_lang$core$Basics_ops['%'], - (_justinmimbs$elm_date_extra$Date_Extra$weekdayNumber(date) - _justinmimbs$elm_date_extra$Date_Extra_Facts$weekdayNumberFromDayOfWeek(d)) + 7, - 7)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$fractionalDay = _justinmimbs$elm_date_extra$Date_Internal_Extract$fractionalDay; -var _justinmimbs$elm_date_extra$Date_Extra$ordinalDay = _justinmimbs$elm_date_extra$Date_Internal_Extract$ordinalDay; -var _justinmimbs$elm_date_extra$Date_Extra$quarter = _justinmimbs$elm_date_extra$Date_Internal_Extract$quarter; -var _justinmimbs$elm_date_extra$Date_Extra$monthNumber = _justinmimbs$elm_date_extra$Date_Internal_Extract$monthNumber; -var _justinmimbs$elm_date_extra$Date_Extra$ordinalMonth = function (date) { - return (_elm_lang$core$Date$year(date) * 12) + _justinmimbs$elm_date_extra$Date_Extra$monthNumber(date); -}; -var _justinmimbs$elm_date_extra$Date_Extra$diffMonth = F2( - function (date1, date2) { - var fractionalMonth = function (date) { - return (_elm_lang$core$Basics$toFloat( - _elm_lang$core$Date$day(date) - 1) + _justinmimbs$elm_date_extra$Date_Extra$fractionalDay(date)) / 31; - }; - var ordinalMonthFloat = function (date) { - return _elm_lang$core$Basics$toFloat( - _justinmimbs$elm_date_extra$Date_Extra$ordinalMonth(date)) + fractionalMonth(date); - }; - return _elm_lang$core$Basics$truncate( - ordinalMonthFloat(date2) - ordinalMonthFloat(date1)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$toUtcFormattedString = _justinmimbs$elm_date_extra$Date_Internal_Format$toFormattedString(true); -var _justinmimbs$elm_date_extra$Date_Extra$toUtcIsoString = _justinmimbs$elm_date_extra$Date_Extra$toUtcFormattedString('yyyy-MM-dd\'T\'HH:mm:ss.SSSXXX'); -var _justinmimbs$elm_date_extra$Date_Extra$toFormattedString = _justinmimbs$elm_date_extra$Date_Internal_Format$toFormattedString(false); -var _justinmimbs$elm_date_extra$Date_Extra$toIsoString = _justinmimbs$elm_date_extra$Date_Extra$toFormattedString('yyyy-MM-dd\'T\'HH:mm:ss.SSSxxx'); -var _justinmimbs$elm_date_extra$Date_Extra$fromTime = function (_p1) { - return _elm_lang$core$Date$fromTime( - _elm_lang$core$Basics$toFloat(_p1)); -}; -var _justinmimbs$elm_date_extra$Date_Extra$fromOffsetTime = function (_p2) { - var _p3 = _p2; - var _p5 = _p3._1; - var _p4 = _p3._0; - if (_p4.ctor === 'Just') { - return _justinmimbs$elm_date_extra$Date_Extra$fromTime(_p5 - (_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute * _p4._0)); - } else { - var offset0 = _justinmimbs$elm_date_extra$Date_Extra$offsetFromUtc( - _justinmimbs$elm_date_extra$Date_Extra$fromTime(_p5)); - var date1 = _justinmimbs$elm_date_extra$Date_Extra$fromTime(_p5 - (_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute * offset0)); - var offset1 = _justinmimbs$elm_date_extra$Date_Extra$offsetFromUtc(date1); - if (_elm_lang$core$Native_Utils.eq(offset0, offset1)) { - return date1; - } else { - var date2 = _justinmimbs$elm_date_extra$Date_Extra$fromTime(_p5 - (_justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute * offset1)); - var offset2 = _justinmimbs$elm_date_extra$Date_Extra$offsetFromUtc(date2); - return _elm_lang$core$Native_Utils.eq(offset1, offset2) ? date2 : date1; - } - } -}; -var _justinmimbs$elm_date_extra$Date_Extra$fromParts = F7( - function (y, m, d, hh, mm, ss, ms) { - return _justinmimbs$elm_date_extra$Date_Extra$fromOffsetTime( - { - ctor: '_Tuple2', - _0: _elm_lang$core$Maybe$Nothing, - _1: A7(_justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromParts, y, m, d, hh, mm, ss, ms) - }); - }); -var _justinmimbs$elm_date_extra$Date_Extra$addMonths = F2( - function (n, date) { - var om = (_justinmimbs$elm_date_extra$Date_Extra$ordinalMonth(date) + n) + -1; - var y_ = (om / 12) | 0; - var m_ = _justinmimbs$elm_date_extra$Date_Extra_Facts$monthFromMonthNumber( - A2(_elm_lang$core$Basics_ops['%'], om, 12) + 1); - var _p6 = _justinmimbs$elm_date_extra$Date_Extra$toParts(date); - var y = _p6._0; - var m = _p6._1; - var d = _p6._2; - var hh = _p6._3; - var mm = _p6._4; - var ss = _p6._5; - var ms = _p6._6; - var d_ = A2( - _elm_lang$core$Basics$min, - d, - A2(_justinmimbs$elm_date_extra$Date_Extra_Facts$daysInMonth, y_, m_)); - return A7(_justinmimbs$elm_date_extra$Date_Extra$fromParts, y_, m_, d_, hh, mm, ss, ms); - }); -var _justinmimbs$elm_date_extra$Date_Extra$add = F3( - function (interval, n, date) { - var _p7 = _justinmimbs$elm_date_extra$Date_Extra$toParts(date); - var y = _p7._0; - var m = _p7._1; - var d = _p7._2; - var hh = _p7._3; - var mm = _p7._4; - var ss = _p7._5; - var ms = _p7._6; - var _p8 = interval; - switch (_p8.ctor) { - case 'Millisecond': - return _elm_lang$core$Date$fromTime( - _elm_lang$core$Date$toTime(date) + _elm_lang$core$Basics$toFloat(n)); - case 'Second': - return _elm_lang$core$Date$fromTime( - _elm_lang$core$Date$toTime(date) + _elm_lang$core$Basics$toFloat(n * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerSecond)); - case 'Minute': - return _elm_lang$core$Date$fromTime( - _elm_lang$core$Date$toTime(date) + _elm_lang$core$Basics$toFloat(n * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute)); - case 'Hour': - return _elm_lang$core$Date$fromTime( - _elm_lang$core$Date$toTime(date) + _elm_lang$core$Basics$toFloat(n * _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerHour)); - case 'Day': - return A7(_justinmimbs$elm_date_extra$Date_Extra$fromParts, y, m, d + n, hh, mm, ss, ms); - case 'Month': - return A2(_justinmimbs$elm_date_extra$Date_Extra$addMonths, n, date); - case 'Year': - return A2(_justinmimbs$elm_date_extra$Date_Extra$addMonths, n * 12, date); - case 'Quarter': - return A2(_justinmimbs$elm_date_extra$Date_Extra$addMonths, n * 3, date); - case 'Week': - return A7(_justinmimbs$elm_date_extra$Date_Extra$fromParts, y, m, d + (n * 7), hh, mm, ss, ms); - default: - return A7(_justinmimbs$elm_date_extra$Date_Extra$fromParts, y, m, d + (n * 7), hh, mm, ss, ms); - } - }); -var _justinmimbs$elm_date_extra$Date_Extra$rangeHelp = F5( - function (interval, step, end, revList, date) { - rangeHelp: - while (true) { - if (_elm_lang$core$Native_Utils.cmp( - _elm_lang$core$Date$toTime(date), - _elm_lang$core$Date$toTime(end)) < 0) { - var _v4 = interval, - _v5 = step, - _v6 = end, - _v7 = {ctor: '::', _0: date, _1: revList}, - _v8 = A3(_justinmimbs$elm_date_extra$Date_Extra$add, interval, step, date); - interval = _v4; - step = _v5; - end = _v6; - revList = _v7; - date = _v8; - continue rangeHelp; - } else { - return _elm_lang$core$List$reverse(revList); - } - } - }); -var _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate = F3( - function (y, m, d) { - return _justinmimbs$elm_date_extra$Date_Extra$fromOffsetTime( - { - ctor: '_Tuple2', - _0: _elm_lang$core$Maybe$Nothing, - _1: A3(_justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromCalendarDate, y, m, d) - }); - }); -var _justinmimbs$elm_date_extra$Date_Extra$floor = F2( - function (interval, date) { - var _p9 = _justinmimbs$elm_date_extra$Date_Extra$toParts(date); - var y = _p9._0; - var m = _p9._1; - var d = _p9._2; - var hh = _p9._3; - var mm = _p9._4; - var ss = _p9._5; - var _p10 = interval; - switch (_p10.ctor) { - case 'Millisecond': - return date; - case 'Second': - return A7(_justinmimbs$elm_date_extra$Date_Extra$fromParts, y, m, d, hh, mm, ss, 0); - case 'Minute': - return A7(_justinmimbs$elm_date_extra$Date_Extra$fromParts, y, m, d, hh, mm, 0, 0); - case 'Hour': - return A7(_justinmimbs$elm_date_extra$Date_Extra$fromParts, y, m, d, hh, 0, 0, 0); - case 'Day': - return A3(_justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, y, m, d); - case 'Month': - return A3(_justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, y, m, 1); - case 'Year': - return A3(_justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, y, _elm_lang$core$Date$Jan, 1); - case 'Quarter': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - _justinmimbs$elm_date_extra$Date_Extra$monthFromQuarter( - _justinmimbs$elm_date_extra$Date_Extra$quarter(date)), - 1); - case 'Week': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Mon, date)); - case 'Monday': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Mon, date)); - case 'Tuesday': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Tue, date)); - case 'Wednesday': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Wed, date)); - case 'Thursday': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Thu, date)); - case 'Friday': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Fri, date)); - case 'Saturday': - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Sat, date)); - default: - return A3( - _justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, - y, - m, - d + A2(_justinmimbs$elm_date_extra$Date_Extra$daysToPreviousDayOfWeek, _elm_lang$core$Date$Sun, date)); - } - }); -var _justinmimbs$elm_date_extra$Date_Extra$ceiling = F2( - function (interval, date) { - var floored = A2(_justinmimbs$elm_date_extra$Date_Extra$floor, interval, date); - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$toTime(date), - _elm_lang$core$Date$toTime(floored)) ? date : A3(_justinmimbs$elm_date_extra$Date_Extra$add, interval, 1, floored); - }); -var _justinmimbs$elm_date_extra$Date_Extra$range = F4( - function (interval, step, start, end) { - var first = A2(_justinmimbs$elm_date_extra$Date_Extra$ceiling, interval, start); - return (_elm_lang$core$Native_Utils.cmp( - _elm_lang$core$Date$toTime(first), - _elm_lang$core$Date$toTime(end)) < 0) ? A5( - _justinmimbs$elm_date_extra$Date_Extra$rangeHelp, - interval, - A2(_elm_lang$core$Basics$max, 1, step), - end, - {ctor: '[]'}, - first) : {ctor: '[]'}; - }); -var _justinmimbs$elm_date_extra$Date_Extra$fromIsoString = function (_p11) { - return A2( - _elm_lang$core$Maybe$map, - _justinmimbs$elm_date_extra$Date_Extra$fromOffsetTime, - _justinmimbs$elm_date_extra$Date_Internal_Parse$offsetTimeFromIsoString(_p11)); -}; -var _justinmimbs$elm_date_extra$Date_Extra$fromSpec = F3( - function (_p14, _p13, _p12) { - var _p15 = _p14; - var _p16 = _p13; - var _p17 = _p12; - return _justinmimbs$elm_date_extra$Date_Extra$fromOffsetTime( - {ctor: '_Tuple2', _0: _p15._0, _1: _p17._0 + _p16._0}); - }); -var _justinmimbs$elm_date_extra$Date_Extra$Offset = function (a) { - return {ctor: 'Offset', _0: a}; -}; -var _justinmimbs$elm_date_extra$Date_Extra$utc = _justinmimbs$elm_date_extra$Date_Extra$Offset( - _elm_lang$core$Maybe$Just(0)); -var _justinmimbs$elm_date_extra$Date_Extra$offset = function (minutes) { - return _justinmimbs$elm_date_extra$Date_Extra$Offset( - _elm_lang$core$Maybe$Just(minutes)); -}; -var _justinmimbs$elm_date_extra$Date_Extra$local = _justinmimbs$elm_date_extra$Date_Extra$Offset(_elm_lang$core$Maybe$Nothing); -var _justinmimbs$elm_date_extra$Date_Extra$TimeMS = function (a) { - return {ctor: 'TimeMS', _0: a}; -}; -var _justinmimbs$elm_date_extra$Date_Extra$noTime = _justinmimbs$elm_date_extra$Date_Extra$TimeMS(0); -var _justinmimbs$elm_date_extra$Date_Extra$atTime = F4( - function (hh, mm, ss, ms) { - return _justinmimbs$elm_date_extra$Date_Extra$TimeMS( - A4(_justinmimbs$elm_date_extra$Date_Internal_Core$msFromTimeParts, hh, mm, ss, ms)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$DateMS = function (a) { - return {ctor: 'DateMS', _0: a}; -}; -var _justinmimbs$elm_date_extra$Date_Extra$calendarDate = F3( - function (y, m, d) { - return _justinmimbs$elm_date_extra$Date_Extra$DateMS( - A3(_justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromCalendarDate, y, m, d)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$ordinalDate = F2( - function (y, d) { - return _justinmimbs$elm_date_extra$Date_Extra$DateMS( - A2(_justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromOrdinalDate, y, d)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$weekDate = F3( - function (y, w, d) { - return _justinmimbs$elm_date_extra$Date_Extra$DateMS( - A3(_justinmimbs$elm_date_extra$Date_Internal_Core$unixTimeFromWeekDate, y, w, d)); - }); -var _justinmimbs$elm_date_extra$Date_Extra$Sunday = {ctor: 'Sunday'}; -var _justinmimbs$elm_date_extra$Date_Extra$Saturday = {ctor: 'Saturday'}; -var _justinmimbs$elm_date_extra$Date_Extra$Friday = {ctor: 'Friday'}; -var _justinmimbs$elm_date_extra$Date_Extra$Thursday = {ctor: 'Thursday'}; -var _justinmimbs$elm_date_extra$Date_Extra$Wednesday = {ctor: 'Wednesday'}; -var _justinmimbs$elm_date_extra$Date_Extra$Tuesday = {ctor: 'Tuesday'}; -var _justinmimbs$elm_date_extra$Date_Extra$Monday = {ctor: 'Monday'}; -var _justinmimbs$elm_date_extra$Date_Extra$Week = {ctor: 'Week'}; -var _justinmimbs$elm_date_extra$Date_Extra$Quarter = {ctor: 'Quarter'}; -var _justinmimbs$elm_date_extra$Date_Extra$Year = {ctor: 'Year'}; -var _justinmimbs$elm_date_extra$Date_Extra$Month = {ctor: 'Month'}; -var _justinmimbs$elm_date_extra$Date_Extra$Day = {ctor: 'Day'}; -var _justinmimbs$elm_date_extra$Date_Extra$diff = F3( - function (interval, date1, date2) { - var diffMS = _elm_lang$core$Basics$floor( - _elm_lang$core$Date$toTime(date2) - _elm_lang$core$Date$toTime(date1)); - var _p18 = interval; - switch (_p18.ctor) { - case 'Millisecond': - return diffMS; - case 'Second': - return (diffMS / _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerSecond) | 0; - case 'Minute': - return (diffMS / _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerMinute) | 0; - case 'Hour': - return (diffMS / _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerHour) | 0; - case 'Day': - return (diffMS / _justinmimbs$elm_date_extra$Date_Extra_Facts$msPerDay) | 0; - case 'Month': - return A2(_justinmimbs$elm_date_extra$Date_Extra$diffMonth, date1, date2); - case 'Year': - return (A2(_justinmimbs$elm_date_extra$Date_Extra$diffMonth, date1, date2) / 12) | 0; - case 'Quarter': - return (A2(_justinmimbs$elm_date_extra$Date_Extra$diffMonth, date1, date2) / 3) | 0; - case 'Week': - return (A3(_justinmimbs$elm_date_extra$Date_Extra$diff, _justinmimbs$elm_date_extra$Date_Extra$Day, date1, date2) / 7) | 0; - default: - var _p19 = _p18; - return (A3( - _justinmimbs$elm_date_extra$Date_Extra$diff, - _justinmimbs$elm_date_extra$Date_Extra$Day, - A2(_justinmimbs$elm_date_extra$Date_Extra$floor, _p19, date1), - A2(_justinmimbs$elm_date_extra$Date_Extra$floor, _p19, date2)) / 7) | 0; - } - }); -var _justinmimbs$elm_date_extra$Date_Extra$fromRataDie = function (rd) { - return A3( - _justinmimbs$elm_date_extra$Date_Extra$add, - _justinmimbs$elm_date_extra$Date_Extra$Day, - rd - 719163, - A3(_justinmimbs$elm_date_extra$Date_Extra$fromCalendarDate, 1970, _elm_lang$core$Date$Jan, 1)); -}; -var _justinmimbs$elm_date_extra$Date_Extra$Hour = {ctor: 'Hour'}; -var _justinmimbs$elm_date_extra$Date_Extra$Minute = {ctor: 'Minute'}; -var _justinmimbs$elm_date_extra$Date_Extra$equalBy = F3( - function (interval, date1, date2) { - equalBy: - while (true) { - var _p20 = interval; - switch (_p20.ctor) { - case 'Millisecond': - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$toTime(date1), - _elm_lang$core$Date$toTime(date2)); - case 'Second': - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$second(date1), - _elm_lang$core$Date$second(date2)) && A3(_justinmimbs$elm_date_extra$Date_Extra$equalBy, _justinmimbs$elm_date_extra$Date_Extra$Minute, date1, date2); - case 'Minute': - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$minute(date1), - _elm_lang$core$Date$minute(date2)) && A3(_justinmimbs$elm_date_extra$Date_Extra$equalBy, _justinmimbs$elm_date_extra$Date_Extra$Hour, date1, date2); - case 'Hour': - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$hour(date1), - _elm_lang$core$Date$hour(date2)) && A3(_justinmimbs$elm_date_extra$Date_Extra$equalBy, _justinmimbs$elm_date_extra$Date_Extra$Day, date1, date2); - case 'Day': - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$day(date1), - _elm_lang$core$Date$day(date2)) && A3(_justinmimbs$elm_date_extra$Date_Extra$equalBy, _justinmimbs$elm_date_extra$Date_Extra$Month, date1, date2); - case 'Month': - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$month(date1), - _elm_lang$core$Date$month(date2)) && A3(_justinmimbs$elm_date_extra$Date_Extra$equalBy, _justinmimbs$elm_date_extra$Date_Extra$Year, date1, date2); - case 'Year': - return _elm_lang$core$Native_Utils.eq( - _elm_lang$core$Date$year(date1), - _elm_lang$core$Date$year(date2)); - case 'Quarter': - return _elm_lang$core$Native_Utils.eq( - _justinmimbs$elm_date_extra$Date_Extra$quarter(date1), - _justinmimbs$elm_date_extra$Date_Extra$quarter(date2)) && A3(_justinmimbs$elm_date_extra$Date_Extra$equalBy, _justinmimbs$elm_date_extra$Date_Extra$Year, date1, date2); - case 'Week': - return _elm_lang$core$Native_Utils.eq( - _justinmimbs$elm_date_extra$Date_Extra$weekNumber(date1), - _justinmimbs$elm_date_extra$Date_Extra$weekNumber(date2)) && _elm_lang$core$Native_Utils.eq( - _justinmimbs$elm_date_extra$Date_Extra$weekYear(date1), - _justinmimbs$elm_date_extra$Date_Extra$weekYear(date2)); - default: - var _p21 = _p20; - var _v15 = _justinmimbs$elm_date_extra$Date_Extra$Day, - _v16 = A2(_justinmimbs$elm_date_extra$Date_Extra$floor, _p21, date1), - _v17 = A2(_justinmimbs$elm_date_extra$Date_Extra$floor, _p21, date2); - interval = _v15; - date1 = _v16; - date2 = _v17; - continue equalBy; - } - } - }); -var _justinmimbs$elm_date_extra$Date_Extra$Second = {ctor: 'Second'}; -var _justinmimbs$elm_date_extra$Date_Extra$Millisecond = {ctor: 'Millisecond'}; - -var _krisajenkins$remotedata$RemoteData$isNotAsked = function (data) { - var _p0 = data; - if (_p0.ctor === 'NotAsked') { - return true; - } else { - return false; - } -}; -var _krisajenkins$remotedata$RemoteData$isLoading = function (data) { - var _p1 = data; - if (_p1.ctor === 'Loading') { - return true; - } else { - return false; - } -}; -var _krisajenkins$remotedata$RemoteData$isFailure = function (data) { - var _p2 = data; - if (_p2.ctor === 'Failure') { - return true; - } else { - return false; - } -}; -var _krisajenkins$remotedata$RemoteData$isSuccess = function (data) { - var _p3 = data; - if (_p3.ctor === 'Success') { - return true; - } else { - return false; - } -}; -var _krisajenkins$remotedata$RemoteData$withDefault = F2( - function ($default, data) { - var _p4 = data; - if (_p4.ctor === 'Success') { - return _p4._0; - } else { - return $default; - } - }); -var _krisajenkins$remotedata$RemoteData$Success = function (a) { - return {ctor: 'Success', _0: a}; -}; -var _krisajenkins$remotedata$RemoteData$succeed = _krisajenkins$remotedata$RemoteData$Success; -var _krisajenkins$remotedata$RemoteData$prism = { - reverseGet: _krisajenkins$remotedata$RemoteData$Success, - getOption: function (data) { - var _p5 = data; - if (_p5.ctor === 'Success') { - return _elm_lang$core$Maybe$Just(_p5._0); - } else { - return _elm_lang$core$Maybe$Nothing; - } - } -}; -var _krisajenkins$remotedata$RemoteData$Failure = function (a) { - return {ctor: 'Failure', _0: a}; -}; -var _krisajenkins$remotedata$RemoteData$fromMaybe = F2( - function (error, maybe) { - var _p6 = maybe; - if (_p6.ctor === 'Nothing') { - return _krisajenkins$remotedata$RemoteData$Failure(error); - } else { - return _krisajenkins$remotedata$RemoteData$Success(_p6._0); - } - }); -var _krisajenkins$remotedata$RemoteData$fromResult = function (result) { - var _p7 = result; - if (_p7.ctor === 'Err') { - return _krisajenkins$remotedata$RemoteData$Failure(_p7._0); - } else { - return _krisajenkins$remotedata$RemoteData$Success(_p7._0); - } -}; -var _krisajenkins$remotedata$RemoteData$asCmd = _elm_lang$core$Task$attempt(_krisajenkins$remotedata$RemoteData$fromResult); -var _krisajenkins$remotedata$RemoteData$sendRequest = _elm_lang$http$Http$send(_krisajenkins$remotedata$RemoteData$fromResult); -var _krisajenkins$remotedata$RemoteData$fromTask = function (_p8) { - return A2( - _elm_lang$core$Task$onError, - function (_p9) { - return _elm_lang$core$Task$succeed( - _krisajenkins$remotedata$RemoteData$Failure(_p9)); - }, - A2(_elm_lang$core$Task$map, _krisajenkins$remotedata$RemoteData$Success, _p8)); -}; -var _krisajenkins$remotedata$RemoteData$Loading = {ctor: 'Loading'}; -var _krisajenkins$remotedata$RemoteData$NotAsked = {ctor: 'NotAsked'}; -var _krisajenkins$remotedata$RemoteData$map = F2( - function (f, data) { - var _p10 = data; - switch (_p10.ctor) { - case 'Success': - return _krisajenkins$remotedata$RemoteData$Success( - f(_p10._0)); - case 'Loading': - return _krisajenkins$remotedata$RemoteData$Loading; - case 'NotAsked': - return _krisajenkins$remotedata$RemoteData$NotAsked; - default: - return _krisajenkins$remotedata$RemoteData$Failure(_p10._0); - } - }); -var _krisajenkins$remotedata$RemoteData$toMaybe = function (_p11) { - return A2( - _krisajenkins$remotedata$RemoteData$withDefault, - _elm_lang$core$Maybe$Nothing, - A2(_krisajenkins$remotedata$RemoteData$map, _elm_lang$core$Maybe$Just, _p11)); -}; -var _krisajenkins$remotedata$RemoteData$mapError = F2( - function (f, data) { - var _p12 = data; - switch (_p12.ctor) { - case 'Success': - return _krisajenkins$remotedata$RemoteData$Success(_p12._0); - case 'Failure': - return _krisajenkins$remotedata$RemoteData$Failure( - f(_p12._0)); - case 'Loading': - return _krisajenkins$remotedata$RemoteData$Loading; - default: - return _krisajenkins$remotedata$RemoteData$NotAsked; - } - }); -var _krisajenkins$remotedata$RemoteData$mapBoth = F2( - function (successFn, errorFn) { - return function (_p13) { - return A2( - _krisajenkins$remotedata$RemoteData$mapError, - errorFn, - A2(_krisajenkins$remotedata$RemoteData$map, successFn, _p13)); - }; - }); -var _krisajenkins$remotedata$RemoteData$andThen = F2( - function (f, data) { - var _p14 = data; - switch (_p14.ctor) { - case 'Success': - return f(_p14._0); - case 'Failure': - return _krisajenkins$remotedata$RemoteData$Failure(_p14._0); - case 'NotAsked': - return _krisajenkins$remotedata$RemoteData$NotAsked; - default: - return _krisajenkins$remotedata$RemoteData$Loading; - } - }); -var _krisajenkins$remotedata$RemoteData$andMap = F2( - function (wrappedValue, wrappedFunction) { - var _p15 = {ctor: '_Tuple2', _0: wrappedFunction, _1: wrappedValue}; - _v11_5: - do { - _v11_4: - do { - _v11_3: - do { - _v11_2: - do { - switch (_p15._0.ctor) { - case 'Success': - switch (_p15._1.ctor) { - case 'Success': - return _krisajenkins$remotedata$RemoteData$Success( - _p15._0._0(_p15._1._0)); - case 'Failure': - break _v11_2; - case 'Loading': - break _v11_4; - default: - return _krisajenkins$remotedata$RemoteData$NotAsked; - } - case 'Failure': - return _krisajenkins$remotedata$RemoteData$Failure(_p15._0._0); - case 'Loading': - switch (_p15._1.ctor) { - case 'Failure': - break _v11_2; - case 'Loading': - break _v11_3; - case 'NotAsked': - break _v11_3; - default: - break _v11_3; - } - default: - switch (_p15._1.ctor) { - case 'Failure': - break _v11_2; - case 'Loading': - break _v11_4; - case 'NotAsked': - break _v11_5; - default: - break _v11_5; - } - } - } while(false); - return _krisajenkins$remotedata$RemoteData$Failure(_p15._1._0); - } while(false); - return _krisajenkins$remotedata$RemoteData$Loading; - } while(false); - return _krisajenkins$remotedata$RemoteData$Loading; - } while(false); - return _krisajenkins$remotedata$RemoteData$NotAsked; - }); -var _krisajenkins$remotedata$RemoteData$map2 = F3( - function (f, a, b) { - return A2( - _krisajenkins$remotedata$RemoteData$andMap, - b, - A2(_krisajenkins$remotedata$RemoteData$map, f, a)); - }); -var _krisajenkins$remotedata$RemoteData$fromList = A2( - _elm_lang$core$List$foldr, - _krisajenkins$remotedata$RemoteData$map2( - F2( - function (x, y) { - return {ctor: '::', _0: x, _1: y}; - })), - _krisajenkins$remotedata$RemoteData$Success( - {ctor: '[]'})); -var _krisajenkins$remotedata$RemoteData$map3 = F4( - function (f, a, b, c) { - return A2( - _krisajenkins$remotedata$RemoteData$andMap, - c, - A2( - _krisajenkins$remotedata$RemoteData$andMap, - b, - A2(_krisajenkins$remotedata$RemoteData$map, f, a))); - }); -var _krisajenkins$remotedata$RemoteData$append = F2( - function (a, b) { - return A2( - _krisajenkins$remotedata$RemoteData$andMap, - b, - A2( - _krisajenkins$remotedata$RemoteData$map, - F2( - function (v0, v1) { - return {ctor: '_Tuple2', _0: v0, _1: v1}; - }), - a)); - }); -var _krisajenkins$remotedata$RemoteData$update = F2( - function (f, remoteData) { - var _p16 = remoteData; - switch (_p16.ctor) { - case 'Success': - var _p17 = f(_p16._0); - var first = _p17._0; - var second = _p17._1; - return { - ctor: '_Tuple2', - _0: _krisajenkins$remotedata$RemoteData$Success(first), - _1: second - }; - case 'NotAsked': - return {ctor: '_Tuple2', _0: _krisajenkins$remotedata$RemoteData$NotAsked, _1: _elm_lang$core$Platform_Cmd$none}; - case 'Loading': - return {ctor: '_Tuple2', _0: _krisajenkins$remotedata$RemoteData$Loading, _1: _elm_lang$core$Platform_Cmd$none}; - default: - return { - ctor: '_Tuple2', - _0: _krisajenkins$remotedata$RemoteData$Failure(_p16._0), - _1: _elm_lang$core$Platform_Cmd$none - }; - } - }); - -var _rtfeldman$elm_css_util$Css_Helpers$toCssIdentifier = function (identifier) { - return A4( - _elm_lang$core$Regex$replace, - _elm_lang$core$Regex$All, - _elm_lang$core$Regex$regex('[^a-zA-Z0-9_-]'), - function (_p0) { - return ''; - }, - A4( - _elm_lang$core$Regex$replace, - _elm_lang$core$Regex$All, - _elm_lang$core$Regex$regex('\\s+'), - function (_p1) { - return '-'; - }, - _elm_lang$core$String$trim( - _elm_lang$core$Basics$toString(identifier)))); -}; -var _rtfeldman$elm_css_util$Css_Helpers$identifierToString = F2( - function (name, identifier) { - return A2( - _elm_lang$core$Basics_ops['++'], - _rtfeldman$elm_css_util$Css_Helpers$toCssIdentifier(name), - _rtfeldman$elm_css_util$Css_Helpers$toCssIdentifier(identifier)); - }); - -var _rtfeldman$elm_css_helpers$Html_CssHelpers$stylesheetLink = function (url) { - return A3( - _elm_lang$html$Html$node, - 'link', - { - ctor: '::', - _0: A2( - _elm_lang$html$Html_Attributes$property, - 'rel', - _elm_lang$core$Json_Encode$string('stylesheet')), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html_Attributes$property, - 'type', - _elm_lang$core$Json_Encode$string('text/css')), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html_Attributes$property, - 'href', - _elm_lang$core$Json_Encode$string(url)), - _1: {ctor: '[]'} - } - } - }, - {ctor: '[]'}); -}; -var _rtfeldman$elm_css_helpers$Html_CssHelpers$style = function (text) { - return A3( - _elm_lang$html$Html$node, - 'style', - { - ctor: '::', - _0: A2( - _elm_lang$html$Html_Attributes$property, - 'textContent', - _elm_lang$core$Json_Encode$string(text)), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html_Attributes$property, - 'type', - _elm_lang$core$Json_Encode$string('text/css')), - _1: {ctor: '[]'} - } - }, - {ctor: '[]'}); -}; -var _rtfeldman$elm_css_helpers$Html_CssHelpers$namespacedClass = F2( - function (name, list) { - return _elm_lang$html$Html_Attributes$class( - A2( - _elm_lang$core$String$join, - ' ', - A2( - _elm_lang$core$List$map, - _rtfeldman$elm_css_util$Css_Helpers$identifierToString(name), - list))); - }); -var _rtfeldman$elm_css_helpers$Html_CssHelpers$class = _rtfeldman$elm_css_helpers$Html_CssHelpers$namespacedClass(''); -var _rtfeldman$elm_css_helpers$Html_CssHelpers$classList = function (list) { - return _rtfeldman$elm_css_helpers$Html_CssHelpers$class( - A2( - _elm_lang$core$List$map, - _elm_lang$core$Tuple$first, - A2(_elm_lang$core$List$filter, _elm_lang$core$Tuple$second, list))); -}; -var _rtfeldman$elm_css_helpers$Html_CssHelpers$namespacedClassList = F2( - function (name, list) { - return A2( - _rtfeldman$elm_css_helpers$Html_CssHelpers$namespacedClass, - name, - A2( - _elm_lang$core$List$map, - _elm_lang$core$Tuple$first, - A2(_elm_lang$core$List$filter, _elm_lang$core$Tuple$second, list))); - }); -var _rtfeldman$elm_css_helpers$Html_CssHelpers$helpers = { - $class: _rtfeldman$elm_css_helpers$Html_CssHelpers$class, - classList: _rtfeldman$elm_css_helpers$Html_CssHelpers$classList, - id: function (_p0) { - return _elm_lang$html$Html_Attributes$id( - _rtfeldman$elm_css_util$Css_Helpers$toCssIdentifier(_p0)); - } -}; -var _rtfeldman$elm_css_helpers$Html_CssHelpers$withNamespace = function (name) { - return { - $class: _rtfeldman$elm_css_helpers$Html_CssHelpers$namespacedClass(name), - classList: _rtfeldman$elm_css_helpers$Html_CssHelpers$namespacedClassList(name), - id: function (_p1) { - return _elm_lang$html$Html_Attributes$id( - _rtfeldman$elm_css_util$Css_Helpers$toCssIdentifier(_p1)); - }, - name: name - }; -}; -var _rtfeldman$elm_css_helpers$Html_CssHelpers$withClass = F3( - function (className, makeElem, attrs) { - return makeElem( - { - ctor: '::', - _0: _elm_lang$html$Html_Attributes$class(className), - _1: attrs - }); - }); -var _rtfeldman$elm_css_helpers$Html_CssHelpers$Helpers = F3( - function (a, b, c) { - return {$class: a, classList: b, id: c}; - }); -var _rtfeldman$elm_css_helpers$Html_CssHelpers$Namespace = F4( - function (a, b, c, d) { - return {$class: a, classList: b, id: c, name: d}; - }); - -var _user$project$Common_Logs_Types$Machine = F2( - function (a, b) { - return {deviceId: a, name: b}; - }); -var _user$project$Common_Logs_Types$Log = F4( - function (a, b, c, d) { - return {id: a, timestamp: b, logLevel: c, message: d}; - }); -var _user$project$Common_Logs_Types$SupportLogSnapshot = F2( - function (a, b) { - return {deviceId: a, timestamp: b}; - }); -var _user$project$Common_Logs_Types$SupportLog = F4( - function (a, b, c, d) { - return {id: a, deviceId: b, timestamp: c, name: d}; - }); -var _user$project$Common_Logs_Types$Logs = F2( - function (a, b) { - return {logs: a, currentMachine: b}; - }); - -var _user$project$Common_Logs_Decoder$machineDecoder = A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'name', - _elm_lang$core$Json_Decode$string, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'deviceId', - _elm_lang$core$Json_Decode$string, - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Common_Logs_Types$Machine))); -var _user$project$Common_Logs_Decoder$machinesDecoder = A2( - _elm_lang$core$Json_Decode$field, - 'machines', - _elm_lang$core$Json_Decode$list(_user$project$Common_Logs_Decoder$machineDecoder)); -var _user$project$Common_Logs_Decoder$supportLogDecoder = A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'name', - _elm_lang$core$Json_Decode$string, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'timestamp', - _elm_community$json_extra$Json_Decode_Extra$date, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'deviceId', - _elm_lang$core$Json_Decode$string, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'id', - _elm_lang$core$Json_Decode$string, - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Common_Logs_Types$SupportLog))))); -var _user$project$Common_Logs_Decoder$latestLogSnapshotDecoder = A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'timestamp', - _elm_community$json_extra$Json_Decode_Extra$date, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'deviceId', - _elm_lang$core$Json_Decode$string, - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Common_Logs_Types$SupportLogSnapshot))); -var _user$project$Common_Logs_Decoder$supportLogsDecoder = A2( - _elm_lang$core$Json_Decode$field, - 'supportLogs', - _elm_lang$core$Json_Decode$list(_user$project$Common_Logs_Decoder$supportLogDecoder)); -var _user$project$Common_Logs_Decoder$logDecoder = A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'message', - _elm_lang$core$Json_Decode$string, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'logLevel', - _elm_lang$core$Json_Decode$string, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'timestamp', - _elm_community$json_extra$Json_Decode_Extra$date, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'id', - _elm_lang$core$Json_Decode$string, - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Common_Logs_Types$Log))))); -var _user$project$Common_Logs_Decoder$logsDecoder = A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'currentMachine', - _user$project$Common_Logs_Decoder$machineDecoder, - A3( - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$required, - 'logs', - _elm_lang$core$Json_Decode$list(_user$project$Common_Logs_Decoder$logDecoder), - _NoRedInk$elm_decode_pipeline$Json_Decode_Pipeline$decode(_user$project$Common_Logs_Types$Logs))); - -var _user$project$Css_Admin$name = 'lamassuAdmin'; -var _user$project$Css_Admin$helpers = _rtfeldman$elm_css_helpers$Html_CssHelpers$withNamespace(_user$project$Css_Admin$name); -var _user$project$Css_Admin$class = _user$project$Css_Admin$helpers.$class; -var _user$project$Css_Admin$classList = _user$project$Css_Admin$helpers.classList; -var _user$project$Css_Admin$id = _user$project$Css_Admin$helpers.id; -var _user$project$Css_Admin$className = function ($class) { - return A2(_rtfeldman$elm_css_util$Css_Helpers$identifierToString, _user$project$Css_Admin$name, $class); -}; - -var _user$project$Css_Classes$SelectizeOnOff = {ctor: 'SelectizeOnOff'}; -var _user$project$Css_Classes$SelectizeCountry = {ctor: 'SelectizeCountry'}; -var _user$project$Css_Classes$SelectizeLanguage = {ctor: 'SelectizeLanguage'}; -var _user$project$Css_Classes$SelectizeCryptoCurrency = {ctor: 'SelectizeCryptoCurrency'}; -var _user$project$Css_Classes$SelectizeFiatCurrency = {ctor: 'SelectizeFiatCurrency'}; -var _user$project$Css_Classes$SelectizeAccount = {ctor: 'SelectizeAccount'}; -var _user$project$Css_Classes$Textarea = {ctor: 'Textarea'}; -var _user$project$Css_Classes$BalanceSection = {ctor: 'BalanceSection'}; -var _user$project$Css_Classes$CryptoAddress = {ctor: 'CryptoAddress'}; -var _user$project$Css_Classes$ReadOnly = {ctor: 'ReadOnly'}; -var _user$project$Css_Classes$CashIn = {ctor: 'CashIn'}; -var _user$project$Css_Classes$CashOut = {ctor: 'CashOut'}; -var _user$project$Css_Classes$QrCode = {ctor: 'QrCode'}; -var _user$project$Css_Classes$TxCancelled = {ctor: 'TxCancelled'}; -var _user$project$Css_Classes$TxAddress = {ctor: 'TxAddress'}; -var _user$project$Css_Classes$TxPhone = {ctor: 'TxPhone'}; -var _user$project$Css_Classes$TxCrypto = {ctor: 'TxCrypto'}; -var _user$project$Css_Classes$TxFiat = {ctor: 'TxFiat'}; -var _user$project$Css_Classes$TxAmount = {ctor: 'TxAmount'}; -var _user$project$Css_Classes$TxMachine = {ctor: 'TxMachine'}; -var _user$project$Css_Classes$TxDate = {ctor: 'TxDate'}; -var _user$project$Css_Classes$TxId = {ctor: 'TxId'}; -var _user$project$Css_Classes$Disabled = {ctor: 'Disabled'}; -var _user$project$Css_Classes$Enabled = {ctor: 'Enabled'}; -var _user$project$Css_Classes$Saving = {ctor: 'Saving'}; -var _user$project$Css_Classes$EmptyTable = {ctor: 'EmptyTable'}; -var _user$project$Css_Classes$UnitDisplay = {ctor: 'UnitDisplay'}; -var _user$project$Css_Classes$InputContainer = {ctor: 'InputContainer'}; -var _user$project$Css_Classes$TxTable = {ctor: 'TxTable'}; -var _user$project$Css_Classes$DateColumn = {ctor: 'DateColumn'}; -var _user$project$Css_Classes$TruncatedColumn = {ctor: 'TruncatedColumn'}; -var _user$project$Css_Classes$DirectionColumn = {ctor: 'DirectionColumn'}; -var _user$project$Css_Classes$NumberColumn = {ctor: 'NumberColumn'}; -var _user$project$Css_Classes$InvalidGroup = {ctor: 'InvalidGroup'}; -var _user$project$Css_Classes$StatusBar = {ctor: 'StatusBar'}; -var _user$project$Css_Classes$Success = {ctor: 'Success'}; -var _user$project$Css_Classes$Fail = {ctor: 'Fail'}; -var _user$project$Css_Classes$TableButton = {ctor: 'TableButton'}; -var _user$project$Css_Classes$InvalidComponent = {ctor: 'InvalidComponent'}; -var _user$project$Css_Classes$FocusedComponent = {ctor: 'FocusedComponent'}; -var _user$project$Css_Classes$Component = {ctor: 'Component'}; -var _user$project$Css_Classes$NoInput = {ctor: 'NoInput'}; -var _user$project$Css_Classes$CellDisabled = {ctor: 'CellDisabled'}; -var _user$project$Css_Classes$BasicInputReadOnly = {ctor: 'BasicInputReadOnly'}; -var _user$project$Css_Classes$BasicInputDisabled = {ctor: 'BasicInputDisabled'}; -var _user$project$Css_Classes$BasicInput = {ctor: 'BasicInput'}; -var _user$project$Css_Classes$Active = {ctor: 'Active'}; -var _user$project$Css_Classes$ButtonRow = {ctor: 'ButtonRow'}; -var _user$project$Css_Classes$Button = {ctor: 'Button'}; -var _user$project$Css_Classes$FormRow = {ctor: 'FormRow'}; -var _user$project$Css_Classes$TextCell = {ctor: 'TextCell'}; -var _user$project$Css_Classes$LongCell = {ctor: 'LongCell'}; -var _user$project$Css_Classes$MediumCell = {ctor: 'MediumCell'}; -var _user$project$Css_Classes$ShortCell = {ctor: 'ShortCell'}; -var _user$project$Css_Classes$MultiDisplay = {ctor: 'MultiDisplay'}; -var _user$project$Css_Classes$BottomDisplay = {ctor: 'BottomDisplay'}; -var _user$project$Css_Classes$TopDisplay = {ctor: 'TopDisplay'}; -var _user$project$Css_Classes$ConfigContainer = {ctor: 'ConfigContainer'}; -var _user$project$Css_Classes$ConfigTableGlobalRow = {ctor: 'ConfigTableGlobalRow'}; -var _user$project$Css_Classes$ConfigTable = {ctor: 'ConfigTable'}; -var _user$project$Css_Classes$SectionLabel = {ctor: 'SectionLabel'}; -var _user$project$Css_Classes$CryptoTabsActive = {ctor: 'CryptoTabsActive'}; -var _user$project$Css_Classes$CryptoTab = {ctor: 'CryptoTab'}; -var _user$project$Css_Classes$CryptoTabs = {ctor: 'CryptoTabs'}; -var _user$project$Css_Classes$Content = {ctor: 'Content'}; -var _user$project$Css_Classes$Container = {ctor: 'Container'}; -var _user$project$Css_Classes$NavBarRoute = {ctor: 'NavBarRoute'}; -var _user$project$Css_Classes$NavBarCategory = {ctor: 'NavBarCategory'}; -var _user$project$Css_Classes$NavBarCategoryContainer = {ctor: 'NavBarCategoryContainer'}; -var _user$project$Css_Classes$NavBarItemActive = {ctor: 'NavBarItemActive'}; -var _user$project$Css_Classes$MainRight = {ctor: 'MainRight'}; -var _user$project$Css_Classes$MainLeft = {ctor: 'MainLeft'}; -var _user$project$Css_Classes$NavBar = {ctor: 'NavBar'}; -var _user$project$Css_Classes$ContentPane = {ctor: 'ContentPane'}; -var _user$project$Css_Classes$LeftPane = {ctor: 'LeftPane'}; -var _user$project$Css_Classes$PaneWrapper = {ctor: 'PaneWrapper'}; -var _user$project$Css_Classes$Main = {ctor: 'Main'}; -var _user$project$Css_Classes$Layout = {ctor: 'Layout'}; - -var _user$project$SupportLogs_Types$Model = F2( - function (a, b) { - return {logs: a, supportLogs: b}; - }); -var _user$project$SupportLogs_Types$LoadSupportLogs = function (a) { - return {ctor: 'LoadSupportLogs', _0: a}; -}; -var _user$project$SupportLogs_Types$LoadLogs = function (a) { - return {ctor: 'LoadLogs', _0: a}; -}; - -var _user$project$SupportLogs_Rest$getSupportLogs = A2( - _elm_lang$core$Platform_Cmd$map, - _user$project$SupportLogs_Types$LoadSupportLogs, - _krisajenkins$remotedata$RemoteData$sendRequest( - A2(_elm_lang$http$Http$get, '/api/support_logs/', _user$project$Common_Logs_Decoder$supportLogsDecoder))); -var _user$project$SupportLogs_Rest$getAllLogs = function (maybeId) { - return A2( - _elm_lang$core$Platform_Cmd$map, - _user$project$SupportLogs_Types$LoadLogs, - _krisajenkins$remotedata$RemoteData$sendRequest( - A2( - _elm_lang$http$Http$get, - A2( - _elm_lang$core$Basics_ops['++'], - '/api/support_logs/logs?supportLogId=', - A2(_elm_lang$core$Maybe$withDefault, '', maybeId)), - _user$project$Common_Logs_Decoder$logsDecoder))); -}; - -var _user$project$SupportLogs_State$update = F2( - function (msg, model) { - var _p0 = msg; - if (_p0.ctor === 'LoadLogs') { - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Native_Utils.update( - model, - {logs: _p0._0}), - _1: _elm_lang$core$Platform_Cmd$none - }; - } else { - return { - ctor: '_Tuple2', - _0: _elm_lang$core$Native_Utils.update( - model, - {supportLogs: _p0._0}), - _1: _elm_lang$core$Platform_Cmd$none - }; - } - }); -var _user$project$SupportLogs_State$getSupportData = function (maybeId) { - return _elm_lang$core$Platform_Cmd$batch( - { - ctor: '::', - _0: _user$project$SupportLogs_Rest$getAllLogs(maybeId), - _1: { - ctor: '::', - _0: _user$project$SupportLogs_Rest$getSupportLogs, - _1: {ctor: '[]'} - } - }); -}; -var _user$project$SupportLogs_State$load = function (maybeId) { - return { - ctor: '_Tuple2', - _0: {logs: _krisajenkins$remotedata$RemoteData$Loading, supportLogs: _krisajenkins$remotedata$RemoteData$Loading}, - _1: _user$project$SupportLogs_State$getSupportData(maybeId) - }; -}; -var _user$project$SupportLogs_State$init = {logs: _krisajenkins$remotedata$RemoteData$NotAsked, supportLogs: _krisajenkins$remotedata$RemoteData$NotAsked}; - -var _user$project$SupportLogs_View$formatDate = function (date) { - return A2(_justinmimbs$elm_date_extra$Date_Extra$toFormattedString, 'yyyy-MM-dd HH:mm', date); -}; -var _user$project$SupportLogs_View$rowView = function (log) { - return A2( - _elm_lang$html$Html$tr, - { - ctor: '::', - _0: _user$project$Css_Admin$class( - {ctor: '[]'}), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$td, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text( - _user$project$SupportLogs_View$formatDate(log.timestamp)), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html$td, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text(log.logLevel), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html$td, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text(log.message), - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - } - } - }); -}; -var _user$project$SupportLogs_View$logsView = function (logs) { - return _elm_lang$core$List$isEmpty(logs.logs) ? A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('No logs yet.'), - _1: {ctor: '[]'} - }) : A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$table, - { - ctor: '::', - _0: _user$project$Css_Admin$class( - { - ctor: '::', - _0: _user$project$Css_Classes$TxTable, - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$thead, - {ctor: '[]'}, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$tr, - {ctor: '[]'}, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$td, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Date'), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html$td, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Level'), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html$td, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Message'), - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - } - } - }), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html$tbody, - {ctor: '[]'}, - A2(_elm_lang$core$List$map, _user$project$SupportLogs_View$rowView, logs.logs)), - _1: {ctor: '[]'} - } - }), - _1: {ctor: '[]'} - }); -}; -var _user$project$SupportLogs_View$logs = function (model) { - var _p0 = model.logs; - switch (_p0.ctor) { - case 'NotAsked': - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - {ctor: '[]'}); - case 'Loading': - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Loading logs...'), - _1: {ctor: '[]'} - }); - case 'Failure': - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('No logs yet.'), - _1: {ctor: '[]'} - }); - default: - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _user$project$SupportLogs_View$logsView(_p0._0), - _1: {ctor: '[]'} - }); - } -}; -var _user$project$SupportLogs_View$supportLogText = function (supportLog) { - return _elm_lang$html$Html$text( - A2( - _elm_lang$core$Basics_ops['++'], - supportLog.name, - A2( - _elm_lang$core$Basics_ops['++'], - ' ', - A2(_justinmimbs$elm_date_extra$Date_Extra$toFormattedString, 'yyyy-MM-dd HH:mm', supportLog.timestamp)))); -}; -var _user$project$SupportLogs_View$supportLogLink = function (supportLog) { - return A2( - _elm_lang$html$Html$a, - { - ctor: '::', - _0: _elm_lang$html$Html_Attributes$href( - A2(_elm_lang$core$Basics_ops['++'], '/#support_logs/', supportLog.id)), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: _user$project$SupportLogs_View$supportLogText(supportLog), - _1: {ctor: '[]'} - }); -}; -var _user$project$SupportLogs_View$supportLogItemView = function (supportLog) { - return A2( - _elm_lang$html$Html$li, - {ctor: '[]'}, - { - ctor: '::', - _0: _user$project$SupportLogs_View$supportLogLink(supportLog), - _1: {ctor: '[]'} - }); -}; -var _user$project$SupportLogs_View$supportLogsView = function (supportLogs) { - return _elm_lang$core$List$isEmpty(supportLogs) ? A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _user$project$Css_Admin$class( - { - ctor: '::', - _0: _user$project$Css_Classes$EmptyTable, - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: _elm_lang$html$Html$text('No shared logs'), - _1: {ctor: '[]'} - }) : A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _user$project$Css_Admin$class( - { - ctor: '::', - _0: _user$project$Css_Classes$TxTable, - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$ul, - {ctor: '[]'}, - A2(_elm_lang$core$List$map, _user$project$SupportLogs_View$supportLogItemView, supportLogs)), - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }); -}; -var _user$project$SupportLogs_View$supportLogs = function (model) { - var _p1 = model.supportLogs; - switch (_p1.ctor) { - case 'NotAsked': - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - {ctor: '[]'}); - case 'Loading': - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Loading snapshots ...'), - _1: {ctor: '[]'} - }); - case 'Failure': - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text( - _elm_lang$core$Basics$toString(_p1._0)), - _1: {ctor: '[]'} - }); - default: - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _user$project$SupportLogs_View$supportLogsView(_p1._0), - _1: {ctor: '[]'} - }); - } -}; -var _user$project$SupportLogs_View$view = function (model) { - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$h1, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Lamassu support logs'), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _user$project$Css_Admin$class( - { - ctor: '::', - _0: _user$project$Css_Classes$PaneWrapper, - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _user$project$Css_Admin$class( - { - ctor: '::', - _0: _user$project$Css_Classes$LeftPane, - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$h2, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Shared snapshots'), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: _user$project$SupportLogs_View$supportLogs(model), - _1: {ctor: '[]'} - } - }), - _1: { - ctor: '::', - _0: A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _user$project$Css_Admin$class( - { - ctor: '::', - _0: _user$project$Css_Classes$ContentPane, - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$h2, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('Logs'), - _1: {ctor: '[]'} - }), - _1: { - ctor: '::', - _0: _user$project$SupportLogs_View$logs(model), - _1: {ctor: '[]'} - } - }), - _1: {ctor: '[]'} - } - }), - _1: {ctor: '[]'} - } - }); -}; - -var _user$project$StatusTypes$Rate = F3( - function (a, b, c) { - return {crypto: a, bid: b, ask: c}; - }); -var _user$project$StatusTypes$ServerRec = F5( - function (a, b, c, d, e) { - return {up: a, lastPing: b, rates: c, machineStatus: d, wasConfigured: e}; - }); -var _user$project$StatusTypes$StatusRec = F2( - function (a, b) { - return {server: a, invalidConfigGroups: b}; - }); - -var _user$project$Main$subscriptions = function (model) { - return _elm_lang$core$Platform_Sub$batch( - {ctor: '[]'}); -}; -var _user$project$Main$Model = F4( - function (a, b, c, d) { - return {location: a, supportLogs: b, status: c, err: d}; - }); -var _user$project$Main$MaintenanceCat = {ctor: 'MaintenanceCat'}; -var _user$project$Main$GlobalSettingsCat = {ctor: 'GlobalSettingsCat'}; -var _user$project$Main$MachineSettingsCat = {ctor: 'MachineSettingsCat'}; -var _user$project$Main$AccountCat = {ctor: 'AccountCat'}; -var _user$project$Main$NotFoundRoute = {ctor: 'NotFoundRoute'}; -var _user$project$Main$SupportLogsRoute = function (a) { - return {ctor: 'SupportLogsRoute', _0: a}; -}; -var _user$project$Main$parseRoute = _evancz$url_parser$UrlParser$oneOf( - { - ctor: '::', - _0: A2( - _evancz$url_parser$UrlParser$map, - function (id) { - return _user$project$Main$SupportLogsRoute( - _elm_lang$core$Maybe$Just(id)); - }, - A2( - _evancz$url_parser$UrlParser_ops[''], - _evancz$url_parser$UrlParser$s('support_logs'), - _evancz$url_parser$UrlParser$string)), - _1: { - ctor: '::', - _0: A2( - _evancz$url_parser$UrlParser$map, - _user$project$Main$SupportLogsRoute(_elm_lang$core$Maybe$Nothing), - _evancz$url_parser$UrlParser$s('support_logs')), - _1: {ctor: '[]'} - } - }); -var _user$project$Main$UrlChange = function (a) { - return {ctor: 'UrlChange', _0: a}; -}; -var _user$project$Main$SupportLogsMsg = function (a) { - return {ctor: 'SupportLogsMsg', _0: a}; -}; -var _user$project$Main$content = F2( - function (model, route) { - var _p0 = route; - if (_p0.ctor === 'SupportLogsRoute') { - return A2( - _elm_lang$html$Html$map, - _user$project$Main$SupportLogsMsg, - _user$project$SupportLogs_View$view(model.supportLogs)); - } else { - return A2( - _elm_lang$html$Html$div, - {ctor: '[]'}, - { - ctor: '::', - _0: _elm_lang$html$Html$text('No such route'), - _1: {ctor: '[]'} - }); - } - }); -var _user$project$Main$view = function (model) { - var invalidConfigGroups = A2( - _elm_lang$core$Maybe$withDefault, - {ctor: '[]'}, - A2( - _elm_lang$core$Maybe$map, - function (_) { - return _.invalidConfigGroups; - }, - model.status)); - var route = A2( - _elm_lang$core$Maybe$withDefault, - _user$project$Main$NotFoundRoute, - A2(_evancz$url_parser$UrlParser$parseHash, _user$project$Main$parseRoute, model.location)); - return A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _elm_lang$html$Html_Attributes$class('lamassuAdminLayout'), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _elm_lang$html$Html_Attributes$class('lamassuAdminMain'), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2( - _elm_lang$html$Html$div, - { - ctor: '::', - _0: _elm_lang$html$Html_Attributes$class('lamassuAdminContent'), - _1: {ctor: '[]'} - }, - { - ctor: '::', - _0: A2(_user$project$Main$content, model, route), - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }), - _1: {ctor: '[]'} - }); -}; -var _user$project$Main$urlUpdate = F2( - function (location, model) { - var route = A2( - _elm_lang$core$Maybe$withDefault, - _user$project$Main$NotFoundRoute, - A2(_evancz$url_parser$UrlParser$parseHash, _user$project$Main$parseRoute, location)); - var _p1 = route; - if (_p1.ctor === 'SupportLogsRoute') { - var _p2 = _user$project$SupportLogs_State$load(_p1._0); - var supportLogsModel = _p2._0; - var cmd = _p2._1; - return A2( - _elm_lang$core$Platform_Cmd_ops['!'], - _elm_lang$core$Native_Utils.update( - model, - {location: location, supportLogs: supportLogsModel}), - { - ctor: '::', - _0: A2(_elm_lang$core$Platform_Cmd$map, _user$project$Main$SupportLogsMsg, cmd), - _1: {ctor: '[]'} - }); - } else { - return A2( - _elm_lang$core$Platform_Cmd_ops['!'], - _elm_lang$core$Native_Utils.update( - model, - {location: location}), - {ctor: '[]'}); - } - }); -var _user$project$Main$init = function (location) { - var model = {location: location, supportLogs: _user$project$SupportLogs_State$init, status: _elm_lang$core$Maybe$Nothing, err: _elm_lang$core$Maybe$Nothing}; - var _p3 = A2(_user$project$Main$urlUpdate, location, model); - var newModel = _p3._0; - var newCmd = _p3._1; - return A2( - _elm_lang$core$Platform_Cmd_ops['!'], - newModel, - { - ctor: '::', - _0: newCmd, - _1: {ctor: '[]'} - }); -}; -var _user$project$Main$update = F2( - function (msg, model) { - var _p4 = msg; - if (_p4.ctor === 'SupportLogsMsg') { - var _p5 = A2(_user$project$SupportLogs_State$update, _p4._0, model.supportLogs); - var supportLogsModel = _p5._0; - var cmd = _p5._1; - return A2( - _elm_lang$core$Platform_Cmd_ops['!'], - _elm_lang$core$Native_Utils.update( - model, - {supportLogs: supportLogsModel}), - { - ctor: '::', - _0: A2(_elm_lang$core$Platform_Cmd$map, _user$project$Main$SupportLogsMsg, cmd), - _1: {ctor: '[]'} - }); - } else { - return A2(_user$project$Main$urlUpdate, _p4._0, model); - } - }); -var _user$project$Main$main = A2( - _elm_lang$navigation$Navigation$program, - _user$project$Main$UrlChange, - {init: _user$project$Main$init, update: _user$project$Main$update, view: _user$project$Main$view, subscriptions: _user$project$Main$subscriptions})(); - -var Elm = {}; -Elm['Main'] = Elm['Main'] || {}; -if (typeof _user$project$Main$main !== 'undefined') { - _user$project$Main$main(Elm['Main'], 'Main', undefined); -} - -if (typeof define === "function" && define['amd']) -{ - define([], function() { return Elm; }); - return; -} - -if (typeof module === "object") -{ - module['exports'] = Elm; - return; -} - -var globalElm = this['Elm']; -if (typeof globalElm === "undefined") -{ - this['Elm'] = Elm; - return; -} - -for (var publicModule in Elm) -{ - if (publicModule in globalElm) - { - throw new Error('There are two Elm modules called `' + publicModule + '` on this page! Rename one of them.'); - } - globalElm[publicModule] = Elm[publicModule]; -} - -}).call(this); - diff --git a/lib/admin/public/styles.css b/lib/admin/public/styles.css deleted file mode 100644 index 376ae9d2..00000000 --- a/lib/admin/public/styles.css +++ /dev/null @@ -1,631 +0,0 @@ -body { - font-family: Nunito, sans-serif; - margin: 0; -} - -p { - margin: 0; -} - -.lamassuAdminQrCode { - background-color: #f6f6f4; - padding: 10px; - margin-bottom: 20px; - border-radius: 6px; -} - -.lamassuAdminQrCode svg { - height: 400px; - width: 400px; -} - -.lamassuAdminMain { - display: flex; - height: 100%; - margin-bottom: 40px; -} - -.lamassuAdminPaneWrapper { - display: flex; -} - -.lamassuAdminLeftPane { - min-width: 270px; -} - -.lamassuAdminContentPane { - max-height: 100%; -} - -.lamassuAdminStatusBar { - position: fixed; - bottom: 0; - padding: 10px 20px; - background-color: #5f5f56; - color: #ffffff; - width: 100%; -} - -.lamassuAdminCashOut { - background-color: #f6f6f4; -} - -.lamassuAdminFormRow { - margin: 20px 0; -} - -.lamassuAdminFormRow:first-child { - margin: 0; -} - -.lamassuAdminFormRow label { - font-size: 11px; - font-weight: bold; -} - -.lamassuAdminFormRow label > div { - margin: 0 0 5px; - color: #5f5f56; -} - -.lamassuAdminFormRow input { - border: 0; - background-color: #ffffff; - border-radius: 3px; - padding: 6px; - text-align: left; - font-family: Inconsolata, monospace; - font-size: 14px; - font-weight: 600; - width: 90%; - outline: none; -} - -.lamassuAdminButtonRow { - text-align: right; -} - -.lamassuAdminButton { - color: #ffffff; - font-weight: bold; - cursor: pointer; - background-color: #004062; - padding: 10px 15px; - display: inline-block; - border-radius: 5px; -} - -.lamassuAdminButton:hover { - background-color: #042c47; -} - -.lamassuAdminButton:active { - color: #37e8d7; -} - -.lamassuAdminButton.lamassuAdminActive { - color: #37e8d7; - background-color: #042c47; -} - -.lamassuAdminButton.lamassuAdminDisabled { - background-color: #E6E6E3; - color: #ffffff; - cursor: default; -} - -.lamassuAdminMainLeft { - background-color: #2d2d2d; - height: 100%; -} - -.lamassuAdminMainRight { - background-color: #f6f6f4; - height: 100%; -} - -.lamassuAdminContent { - margin: 20px; - background-color: #ffffff; - border-radius: 5px; -} - -.lamassuAdminContainer { - padding: 30px; - background-color: #f6f6f4; - border-radius: 0px 5px 5px 5px; - width: 30em; -} - -.lamassuAdminCryptoAddress { - font-family: Inconsolata, monospace; -} - -.lamassuAdminBalanceSection { - margin-top: 2em; -} - -.lamassuAdminBalanceSection h2 { - font-size: 1.2em; - margin-bottom: 0.2em; -} - -.lamassuAdminTextarea { - width: 100%; - border: 0px; - background-color: transparent; -} - -.lamassuAdminCryptoTabs { - display: flex; -} - -.lamassuAdminCryptoTabs > .lamassuAdminCryptoTab { - padding: 10px 15px; - color: #5f5f56; - font-weight: bold; - cursor: pointer; - background-color: #E6E6E3; - text-decoration: none; -} - -.lamassuAdminCryptoTabs > .lamassuAdminCryptoTab:hover { - background-color: #fcfcfa; -} - -.lamassuAdminCryptoTabs > .lamassuAdminCryptoTab:active { - color: #5f5f56; -} - -.lamassuAdminCryptoTabs > .lamassuAdminCryptoTab.lamassuAdminActive { - color: #5f5f56; - background-color: #f6f6f4; -} - -.lamassuAdminCryptoTabs > .lamassuAdminCryptoTab:first-child { - border-radius: 5px 0px 0px 0px; -} - -.lamassuAdminCryptoTabs > .lamassuAdminCryptoTab:last-child { - border-radius: 0px 5px 0px 0px; -} - -.lamassuAdminSectionLabel { - font-weight: bold; - font-size: 30px; - margin-bottom: 10px; -} - -.lamassuAdminConfigContainer { - padding: 20px 60px; - border-radius: 0px 7px 7px 7px; - background-color: #f6f6f4; - margin: 0 0 10px; - animation: fadein 0.8s; - overflow: hidden; - min-height: 15em; - min-width: 20em; -} - -.lamassuAdminNoInput { - font-family: Inconsolata, monospace; - color: #5f5f56; - font-weight: normal; - text-align: left !important; -} - -.lamassuAdminTxTable { - border-radius: 7px; - margin: 20px 0; - border-collapse: collapse; - font-size: 14px; - width: 100%; - background-color: #ffffff; -} - -.lamassuAdminTxTable a { - text-decoration: none; - color: #5f5f56; - border-bottom: 1px solid #37e8d7; -} - -.lamassuAdminTxTable .lamassuAdminNumberColumn { - text-align: right; - width: 10em; -} - -.lamassuAdminTxTable .lamassuAdminDirectionColumn { - text-align: left; - font-weight: bold; - font-size: 90%; -} - -.lamassuAdminTxTable .lamassuAdminTxCancelled { - background-color: #efd1d2; -} - -.lamassuAdminTxTable tbody { - font-family: Inconsolata, monospace; - color: #5f5f56; -} - -.lamassuAdminTxTable tbody td { - padding: 2px 14px; - border-bottom: 1px solid #f6f6f4; - white-space: nowrap; -} - -.lamassuAdminTxTable tbody .lamassuAdminTruncatedColumn { - max-width: 0; - overflow: hidden; - width: 300px; - text-overflow: ellipsis; -} - -.lamassuAdminTxTable tbody .lamassuAdminTxDate { - width: 10em; -} - -.lamassuAdminTxTable tbody .lamassuAdminTxAddress { - width: 25em; -} - -.lamassuAdminTxTable thead { - font-size: 14px; - text-align: center; - color: #5f5f56; -} - -.lamassuAdminTxTable thead td { - border-bottom: 2px solid #f6f6f4; - padding: 5px; -} - -.lamassuAdminEmptyTable { - font-size: 20px; - font-weight: normal; -} - -.lamassuAdminConfigTable { - font-size: 14px; - font-weight: bold; - border-radius: 7px; - margin: 20px 0; - border-collapse: collapse; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer { - border-radius: 3px; - position: relative; - margin: 0; - border: 2px solid #E6E6E3; - border-radius: 3px; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminNoOptions { - background-color: #fcfcfa; - font-size: 14px; - font-weight: 500; - color: #5f5f56; - padding: 5px; - text-align: center; - cursor: default; - -webkit-user-select: none; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminSelectBox { - display: flex; - align-items: center; - padding: 0 5px; - background-color: inherit; - width: 60px; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminBoxContainer { - position: absolute; - z-index: 100; - left: -3px; - background-color: #ffffff; - text-align: left; - font-weight: 500; - font-size: 80%; - border-radius: 3px; - background-color: #ffffff; - border: 2px solid #E6E6E3; - border-top: 0; - color: #5f5f56; - width: 15em; - cursor: pointer; - padding: 5px; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminBoxItemActive { - color: #004062; - font-weight: 900; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminBoxItem { - padding: 3px 6px; - overflow: hidden; - text-overflow: ellipsis; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminInfo { - padding: 3px 6px; - color: #2d2d2d; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminMultiItemContainer .lamassuAdminSelectedItem { - background-color: #004062; - color: #ffffff; - padding: 2px; - margin: 0 1px; - font-family: Inconsolata, monospace; - font-size: 70%; - font-weight: normal; - border-radius: 3px; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminMultiItemContainer .lamassuAdminFallbackItem { - background-color: #37e8d7; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminSingleItemContainer .lamassuAdminSelectedItem { - font-family: Inconsolata, monospace; - font-size: 14px; - padding: 0; - border-radius: 0; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminSingleItemContainer .lamassuAdminFallbackItem { - color: #5f5f56; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminSelectizeLanguage .lamassuAdminSelectBox { - width: 140px; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer .lamassuAdminSelectizeCryptoCurrency .lamassuAdminSelectBox { - width: 150px; -} - -.lamassuAdminConfigTable .lamassuAdminSelectizeContainer input { - text-align: left; - background-color: inherit; - padding: 6px 2px; - width: 6em; - cursor: default; -} - -.lamassuAdminConfigTable .lamassuAdminInputContainer { - display: flex; - justify-content: flex-end; - border: 2px solid #E6E6E3; - border-radius: 3px; -} - -.lamassuAdminConfigTable .lamassuAdminUnitDisplay { - background-color: #E6E6E3; - color: #5f5f56; - padding: 0 5px; - font-weight: 700; - font-size: 80%; - line-height: 25px; - cursor: default; - font-family: Nunito, sans-serif; -} - -.lamassuAdminConfigTable input { - border: 0; - border-radius: 3px; - padding: 6px; - text-align: right; - width: 100%; - font-family: Inconsolata, monospace; - font-weight: 600; - font-size: 14px; - outline: none; - background-color: #ffffff; -} - -.lamassuAdminConfigTable .lamassuAdminCellDisabled { - background: repeating-linear-gradient(45deg,#dfdfdc,#dfdfdc 2px,#e6e6e3 5px); -} - -.lamassuAdminConfigTable .lamassuAdminBasicInput::placeholder { - color: #37e8d7; - opacity: 1; -} - -.lamassuAdminConfigTable .lamassuAdminBasicInputDisabled { - height: 25px; - line-height: 25px; - font-size: 14px; - font-weight: 500; - color: #5f5f56; - opacity: 0.7; - text-align: left; - padding: 0 1em; - background: repeating-linear-gradient(45deg,#dfdfdc,#dfdfdc 2px,#e6e6e3 5px); -} - -.lamassuAdminConfigTable .lamassuAdminReadOnly { - line-height: 25px; - background-color: #f6f6f4; - font-family: Inconsolata, monospace; - font-size: 14px; - font-weight: 600; - color: #5f5f56; - cursor: default; -} - -.lamassuAdminConfigTable .lamassuAdminReadOnly > .lamassuAdminBasicInputReadOnly { - padding: 0 5px; -} - -.lamassuAdminConfigTable td { - padding: 3px 4px; - text-align: center; - vertical-align: middle; - width: 5em; -} - -.lamassuAdminConfigTable .lamassuAdminComponent { - border-radius: 3px; - border: 2px solid #f6f6f4; - background-color: #ffffff; -} - -.lamassuAdminConfigTable .lamassuAdminFocusedComponent > .lamassuAdminInputContainer { - border-color: #37e8d7; -} - -.lamassuAdminConfigTable .lamassuAdminInvalidComponent input { - color: #eb6b6e; -} - -.lamassuAdminConfigTable .lamassuAdminInvalidComponent > .lamassuAdminInputContainer { - border-color: #eb6b6e; -} - -.lamassuAdminConfigTable .lamassuAdminInvalidComponent > .lamassuAdminSelectizeContainer { - border-color: #eb6b6e; -} - -.lamassuAdminConfigTable tbody td { - text-align: right; - white-space: nowrap; -} - -.lamassuAdminConfigTable tbody td:first-child { - font-weight: normal; -} - -.lamassuAdminConfigTable thead { - font-weight: bold; - text-align: left; -} - -.lamassuAdminConfigTable .lamassuAdminMultiDisplay { - background-color: #E6E6E3; - border-left: 3px solid #f6f6f4; - border-right: 3px solid #f6f6f4; - border-radius: 3px; -} - -.lamassuAdminConfigTable th { - padding: 3px 4px; - text-align: center; -} - -.lamassuAdminConfigTable .lamassuAdminConfigTableGlobalRow td:first-child { - font-weight: bold; -} - -.lamassuAdminConfigTable .lamassuAdminTextCell { - text-align: left; -} - -.lamassuAdminConfigTable .lamassuAdminShortCell { - min-width: 5em; -} - -.lamassuAdminConfigTable .lamassuAdminMediumCell { - min-width: 10em; -} - -.lamassuAdminConfigTable .lamassuAdminLongCell { - min-width: 20em; -} - -.lamassuAdminSaving { - font-size: 18px; - font-weight: normal; - text-align: right; -} - -.lamassuAdminNavBar { - margin: 0; - padding: 0 0 110px 0; - background-color: #2d2d2d; - font-size: 18px; - width: 15em; - max-width: 15em; - min-width: 15em; - height: 100%; -} - -.lamassuAdminNavBar .lamassuAdminNavBarRoute { - height: 60px; - display: block; - line-height: 60px; - padding: 0px 20px; - color: #5f5f56; - font-weight: bold; - cursor: pointer; - background-color: #2d2d2d; -} - -.lamassuAdminNavBar .lamassuAdminNavBarRoute:hover { - background-color: #282828; -} - -.lamassuAdminNavBar .lamassuAdminNavBarRoute:active { - color: #37e8d7; -} - -.lamassuAdminNavBar .lamassuAdminNavBarRoute.lamassuAdminActive { - color: #37e8d7; - background-color: #282828; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategory { - height: 60px; - display: block; - line-height: 60px; - padding: 0px 20px; - color: #5f5f56; - font-weight: bold; - cursor: pointer; - background-color: #2d2d2d; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategory:hover { - background-color: #282828; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategory:active { - color: #37e8d7; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategory.lamassuAdminActive { - color: #37e8d7; - background-color: #282828; -} - -.lamassuAdminNavBar .lamassuAdminInvalidGroup { - color: #eb6b6e !important; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategoryContainer .lamassuAdminNavBarRoute { - color: #5f5f56; - font-weight: bold; - cursor: pointer; - background-color: #2d2d2d; - padding: 0 20px 0 30px; - font-weight: 500; - animation: fadein 0.8s; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategoryContainer .lamassuAdminNavBarRoute:hover { - background-color: #282828; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategoryContainer .lamassuAdminNavBarRoute:active { - color: #37e8d7; -} - -.lamassuAdminNavBar .lamassuAdminNavBarCategoryContainer .lamassuAdminNavBarRoute.lamassuAdminActive { - color: #37e8d7; - background-color: #282828; -} diff --git a/lib/admin/public/support-index.html b/lib/admin/public/support-index.html deleted file mode 100644 index 3e4fa6ff..00000000 --- a/lib/admin/public/support-index.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - diff --git a/lib/admin/schemas/bitgo.json b/lib/admin/schemas/bitgo.json deleted file mode 100644 index 4e0fa00f..00000000 --- a/lib/admin/schemas/bitgo.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "code": "bitgo", - "display": "BitGo", - "fields": [ - { - "code": "token", - "display": "API token", - "fieldType": "string", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "BTCWalletId", - "display": "BTC Wallet ID", - "fieldType": "string", - "secret": false, - "required": true, - "value": "" - }, - { - "code": "BTCWalletPassphrase", - "display": "BTC Wallet passphrase", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "LTCWalletId", - "display": "LTC Wallet ID", - "fieldType": "string", - "secret": false, - "required": true, - "value": "" - }, - { - "code": "LTCWalletPassphrase", - "display": "LTC Wallet passphrase", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "ZECWalletId", - "display": "ZEC Wallet ID", - "fieldType": "string", - "secret": false, - "required": true, - "value": "" - }, - { - "code": "ZECWalletPassphrase", - "display": "ZEC Wallet passphrase", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "BCHWalletId", - "display": "BCH Wallet ID", - "fieldType": "string", - "secret": false, - "required": true, - "value": "" - }, - { - "code": "BCHWalletPassphrase", - "display": "BCH Wallet passphrase", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "DASHWalletId", - "display": "DASH Wallet ID", - "fieldType": "string", - "secret": false, - "required": true, - "value": "" - }, - { - "code": "DASHWalletPassphrase", - "display": "DASH Wallet passphrase", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "environment", - "display": "Environment (prod or test)", - "fieldType": "string", - "secret": false, - "required": false, - "placeholder": "prod", - "value": "" - } - ] -} diff --git a/lib/admin/schemas/bitstamp.json b/lib/admin/schemas/bitstamp.json deleted file mode 100644 index 6cd43a81..00000000 --- a/lib/admin/schemas/bitstamp.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "code": "bitstamp", - "display": "Bitstamp", - "fields": [ - { - "code": "clientId", - "display": "Client ID", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "key", - "display": "API key", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "secret", - "display": "API secret", - "fieldType": "password", - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/schemas/blockcypher.json b/lib/admin/schemas/blockcypher.json deleted file mode 100644 index 716f4f1c..00000000 --- a/lib/admin/schemas/blockcypher.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "code": "blockcypher", - "display": "Blockcypher", - "fields": [ - { - "code": "token", - "display": "API token", - "fieldType": "password", - "required": true, - "value": "" - }, - { - "code": "confidenceFactor", - "display": "Confidence Factor", - "fieldType": "integer", - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/schemas/infura.json b/lib/admin/schemas/infura.json deleted file mode 100644 index 1c58f6f1..00000000 --- a/lib/admin/schemas/infura.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "code": "infura", - "display": "Infura", - "fields": [ - { - "code": "apiKey", - "display": "Project ID", - "fieldType": "string", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "apiSecret", - "display": "Project secret", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "endpoint", - "display": "Endpoint", - "fieldType": "string", - "secret": true, - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/schemas/itbit.json b/lib/admin/schemas/itbit.json deleted file mode 100644 index 0713b741..00000000 --- a/lib/admin/schemas/itbit.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "code": "itbit", - "display": "itBit", - "fields": [ - { - "code": "userId", - "display": "User ID", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "walletId", - "display": "Wallet ID", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "clientKey", - "display": "Client key", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "clientSecret", - "display": "Client secret", - "fieldType": "password", - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/schemas/kraken.json b/lib/admin/schemas/kraken.json deleted file mode 100644 index da99418c..00000000 --- a/lib/admin/schemas/kraken.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "code": "kraken", - "display": "Kraken", - "fields": [ - { - "code": "apiKey", - "display": "API Key", - "fieldType": "string", - "secret": true, - "required": true, - "value": "" - }, - { - "code": "privateKey", - "display": "Private Key", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/schemas/mailgun.json b/lib/admin/schemas/mailgun.json deleted file mode 100644 index d79f8786..00000000 --- a/lib/admin/schemas/mailgun.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "code": "mailgun", - "display": "Mailgun", - "fields": [ - { - "code": "apiKey", - "display": "API key", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "domain", - "display": "Domain", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "fromEmail", - "display": "From email", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "toEmail", - "display": "To email", - "fieldType": "string", - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/schemas/strike.json b/lib/admin/schemas/strike.json deleted file mode 100644 index 4052fe1f..00000000 --- a/lib/admin/schemas/strike.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "code": "strike", - "display": "Strike", - "fields": [ - { - "code": "token", - "display": "API Token", - "fieldType": "password", - "secret": true, - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/schemas/twilio.json b/lib/admin/schemas/twilio.json deleted file mode 100644 index d4a86632..00000000 --- a/lib/admin/schemas/twilio.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "code": "twilio", - "display": "Twilio", - "fields": [ - { - "code": "accountSid", - "display": "Account SID", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "authToken", - "display": "Auth token", - "fieldType": "password", - "required": true, - "value": "" - }, - { - "code": "fromNumber", - "display": "Twilio number (international format)", - "fieldType": "string", - "required": true, - "value": "" - }, - { - "code": "toNumber", - "display": "Notifications number (international format)", - "fieldType": "string", - "required": true, - "value": "" - } - ] -} diff --git a/lib/admin/server.js b/lib/admin/server.js deleted file mode 100644 index cc5d5415..00000000 --- a/lib/admin/server.js +++ /dev/null @@ -1,84 +0,0 @@ -const { intervalToDuration, secondsToMilliseconds, formatDuration } = require('date-fns/fp') -const _ = require('lodash/fp') - -const ticker = require('../ticker') -const settingsLoader = require('./settings-loader') - -const db = require('../db') -const machineLoader = require('../machine-loader') - -const CONSIDERED_UP_SECS = 30 - -function checkWasConfigured () { - return settingsLoader.loadLatest() - .then(() => true) - .catch(() => false) -} - -function machinesLastPing () { - const sql = `select min(extract(epoch from (now() - created))) as age - from machine_events - group by device_id` - - return Promise.all([machineLoader.getMachineNames(), db.any(sql)]) - .then(([machines, events]) => { - if (machines.length === 0) return 'No paired machines' - - const addName = event => { - const machine = _.find(['deviceId', event.deviceId], machines) - if (!machine) return null - return _.set('name', machine.name, event) - } - - const mapper = _.flow(_.filter(row => row.age > CONSIDERED_UP_SECS), _.map(addName), _.compact) - const downRows = mapper(events) - - if (downRows.length === 0) return 'All machines are up' - - if (downRows.length === 1) { - const row = downRows[0] - const age = intervalToDuration({ start: 0, end: secondsToMilliseconds(row.age) }) - return `${row.name} down for ${formatDuration(age)}` - } - - return 'Multiple machines down' - }) -} - -function status () { - const sql = `select extract(epoch from (now() - created)) as age - from server_events - where event_type=$1 - order by created desc - limit 1` - - return Promise.all([checkWasConfigured(), db.oneOrNone(sql, ['ping']), machinesLastPing()]) - .then(([wasConfigured, statusRow, machineStatus]) => { - const age = statusRow && intervalToDuration({ start: 0, end: secondsToMilliseconds(statusRow.age) }) - const up = statusRow ? statusRow.age < CONSIDERED_UP_SECS : false - const lastPing = statusRow && formatDuration(age) - - return settingsLoader.loadLatest() - .catch(() => null) - .then(settings => { - return getRates(settings) - .then(rates => ({wasConfigured, up, lastPing, rates, machineStatus})) - }) - }) -} - -function getRates (settings) { - if (!settings) return Promise.resolve([]) - - return ticker.getRates(settings, 'USD', 'BTC') - .then(ratesRec => { - return [{ - crypto: 'BTC', - bid: parseFloat(ratesRec.rates.bid), - ask: parseFloat(ratesRec.rates.ask) - }] - }) - .catch(() => []) -} - -module.exports = {status} diff --git a/lib/admin/transactions.js b/lib/admin/transactions.js deleted file mode 100644 index f565bada..00000000 --- a/lib/admin/transactions.js +++ /dev/null @@ -1,72 +0,0 @@ -const _ = require('lodash/fp') - -const db = require('../db') -const machineLoader = require('../machine-loader') -const tx = require('../tx') -const cashInTx = require('../cash-in/cash-in-tx') -const { REDEEMABLE_AGE } = require('../cash-out/cash-out-helper') - -const NUM_RESULTS = 1000 - -function addNames (txs) { - return machineLoader.getMachineNames() - .then(machines => { - const addName = tx => { - const machine = _.find(['deviceId', tx.deviceId], machines) - const name = machine ? machine.name : 'Unpaired' - return _.set('machineName', name, tx) - } - - return _.map(addName, txs) - }) -} - -const camelize = _.mapKeys(_.camelCase) - -function batch () { - const packager = _.flow(_.flatten, _.orderBy(_.property('created'), ['desc']), - _.take(NUM_RESULTS), _.map(camelize), addNames) - - const cashInSql = `select 'cashIn' as tx_class, cash_in_txs.*, - ((not send_confirmed) and (created <= now() - interval $1)) as expired - from cash_in_txs - order by created desc limit $2` - - const cashOutSql = `select 'cashOut' as tx_class, cash_out_txs.*, - (NOT dispense AND extract(epoch from (now() - greatest(created, confirmed_at))) >= $2) as expired - from cash_out_txs - order by created desc limit $1` - - return Promise.all([db.any(cashInSql, [cashInTx.PENDING_INTERVAL, NUM_RESULTS]), db.any(cashOutSql, [NUM_RESULTS, REDEEMABLE_AGE])]) - .then(packager) -} - -function single (txId) { - const packager = _.flow(_.compact, _.map(camelize), addNames) - - const cashInSql = `select 'cashIn' as tx_class, - ((not send_confirmed) and (created <= now() - interval $1)) as expired, - cash_in_txs.* - from cash_in_txs - where id=$2` - - const cashOutSql = `select 'cashOut' as tx_class, - (NOT dispense AND extract(epoch from (now() - greatest(created, confirmed_at))) >= $2) as expired, - cash_out_txs.* - from cash_out_txs - where id=$1` - - return Promise.all([ - db.oneOrNone(cashInSql, [cashInTx.PENDING_INTERVAL, txId]), - db.oneOrNone(cashOutSql, [txId, REDEEMABLE_AGE]) - ]) - .then(packager) - .then(_.head) -} - -function cancel (txId) { - return tx.cancel(txId) - .then(() => single(txId)) -} - -module.exports = {batch, single, cancel} diff --git a/lib/new-admin/README.md b/lib/new-admin/README.md deleted file mode 100644 index 8de065dd..00000000 --- a/lib/new-admin/README.md +++ /dev/null @@ -1,6 +0,0 @@ -## Running - -Differences from main lamassu-admin: - -- `bin/new-lamassu-register ` to add a user -- `bin/insecure-dev.sh` to run the server diff --git a/package-lock.json b/package-lock.json index 95e48023..c86f2277 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1418,23 +1418,6 @@ "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==" }, - "@concordance/react": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@concordance/react/-/react-2.0.0.tgz", - "integrity": "sha512-huLSkUuM2/P+U0uy2WwlKuixMsTODD8p4JVQBI4VKeopkiN0C7M3N9XYVawb4M+4spN5RrO/eLhk7KoQX6nsfA==", - "dev": true, - "requires": { - "arrify": "^1.0.1" - }, - "dependencies": { - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", - "dev": true - } - } - }, "@ethereumjs/common": { "version": "2.6.5", "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", @@ -2511,32 +2494,6 @@ "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.6.3.tgz", "integrity": "sha512-T04e4iTurVy7I8Sw4+c5OSN9/RkPlo1uKxAomtxQNLq8j1uPAqnsqG1bqvY3Jv7c13gyr6dui0zmh/I3+f/JaQ==" }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, "@otplib/core": { "version": "12.0.1", "resolved": "https://registry.npmjs.org/@otplib/core/-/core-12.0.1.tgz", @@ -2962,16 +2919,6 @@ "@types/node": "*" } }, - "@types/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", - "dev": true, - "requires": { - "@types/minimatch": "*", - "@types/node": "*" - } - }, "@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -3071,12 +3018,6 @@ "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, - "@types/minimatch": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", - "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", - "dev": true - }, "@types/node": { "version": "20.12.4", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.4.tgz", @@ -3397,23 +3338,6 @@ "acorn-walk": "^7.1.1" } }, - "acorn-jsx": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", - "integrity": "sha512-AU7pnZkguthwBjKgCg6998ByQNIMjbuDQZ8bb78QAFZwPfmKia8AIzgY/gWgqCjnht8JLdXmB4YxA0KaV60ncQ==", - "dev": true, - "requires": { - "acorn": "^3.0.4" - }, - "dependencies": { - "acorn": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", - "integrity": "sha512-OLUyIIZ7mF5oaAUT1w0TFqQS81q3saT46x8t7ukpPjMNk+nbs4ZHhs7ToV8EWnLYLepjETXd4XaCE4uxkMeqUw==", - "dev": true - } - } - }, "acorn-walk": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", @@ -3448,16 +3372,6 @@ } } }, - "aggregate-error": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", - "dev": true, - "requires": { - "clean-stack": "^2.0.0", - "indent-string": "^4.0.0" - } - }, "ajv": { "version": "6.12.6", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", @@ -3469,21 +3383,6 @@ "uri-js": "^4.2.2" } }, - "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha512-ZFztHzVRdGLAzJmpUT9LNFLe1YiVOEylcaNpEutM26PVTCtOD919IMfD01CgbRouB42Dd9atjx1HseC15DgOZA==", - "dev": true - }, - "ansi-align": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", - "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", - "dev": true, - "requires": { - "string-width": "^4.1.0" - } - }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -3807,12 +3706,6 @@ "is-array-buffer": "^3.0.4" } }, - "array-find-index": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", - "integrity": "sha512-M1HQyIXcBGtVywBt8WVdim+lrNaK7VHp99Qt5pSNziXznKHViIBbXWtfRTpEFpF/c4FdfxNAsCCwPp5phBYJtw==", - "dev": true - }, "array-flatten": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", @@ -3832,12 +3725,6 @@ "is-string": "^1.0.7" } }, - "array-union": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true - }, "array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -3873,18 +3760,6 @@ "is-shared-array-buffer": "^1.0.2" } }, - "arrgv": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/arrgv/-/arrgv-1.0.2.tgz", - "integrity": "sha512-a4eg4yhp7mmruZDQFqVMlxNRFGi/i1r87pt8SDHy0/I8PqSXoUTlWZRdAZo0VXgvEARcujbtTk8kiZRi1uDGRw==", - "dev": true - }, - "arrify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", - "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", - "dev": true - }, "asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -3950,12 +3825,6 @@ "tslib": "^2.0.1" } }, - "astral-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", - "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", - "dev": true - }, "async": { "version": "2.6.4", "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", @@ -3988,240 +3857,6 @@ "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, - "ava": { - "version": "3.8.2", - "resolved": "https://registry.npmjs.org/ava/-/ava-3.8.2.tgz", - "integrity": "sha512-sph3oUsVTGsq4qbgeWys03QKCmXjkZUO3oPnFWXEW6g1SReCY9vuONGghMgw1G6VOzkg1k+niqJsOzwfO8h9Ng==", - "dev": true, - "requires": { - "@concordance/react": "^2.0.0", - "acorn": "^7.1.1", - "acorn-walk": "^7.1.1", - "ansi-styles": "^4.2.1", - "arrgv": "^1.0.2", - "arrify": "^2.0.1", - "callsites": "^3.1.0", - "chalk": "^4.0.0", - "chokidar": "^3.4.0", - "chunkd": "^2.0.1", - "ci-info": "^2.0.0", - "ci-parallel-vars": "^1.0.0", - "clean-yaml-object": "^0.1.0", - "cli-cursor": "^3.1.0", - "cli-truncate": "^2.1.0", - "code-excerpt": "^2.1.1", - "common-path-prefix": "^3.0.0", - "concordance": "^4.0.0", - "convert-source-map": "^1.7.0", - "currently-unhandled": "^0.4.1", - "debug": "^4.1.1", - "del": "^5.1.0", - "emittery": "^0.6.0", - "equal-length": "^1.0.0", - "figures": "^3.2.0", - "globby": "^11.0.0", - "ignore-by-default": "^1.0.0", - "import-local": "^3.0.2", - "indent-string": "^4.0.0", - "is-error": "^2.2.2", - "is-plain-object": "^3.0.0", - "is-promise": "^4.0.0", - "lodash": "^4.17.15", - "matcher": "^3.0.0", - "md5-hex": "^3.0.1", - "mem": "^6.1.0", - "ms": "^2.1.2", - "ora": "^4.0.4", - "p-map": "^4.0.0", - "picomatch": "^2.2.2", - "pkg-conf": "^3.1.0", - "plur": "^4.0.0", - "pretty-ms": "^7.0.0", - "read-pkg": "^5.2.0", - "resolve-cwd": "^3.0.0", - "slash": "^3.0.0", - "source-map-support": "^0.5.19", - "stack-utils": "^2.0.2", - "strip-ansi": "^6.0.0", - "supertap": "^1.0.0", - "temp-dir": "^2.0.0", - "trim-off-newlines": "^1.0.1", - "update-notifier": "^4.1.0", - "write-file-atomic": "^3.0.3", - "yargs": "^15.3.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "figures": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", - "dev": true, - "requires": { - "escape-string-regexp": "^1.0.5" - } - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "is-plain-object": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.1.tgz", - "integrity": "sha512-Xnpx182SBMrr/aBik8y+GuR4U1L9FqMSojwDQwPMmxyC6bvEqly9UBCxhauBF5vNh2gwWJNX6oDV7O+OM4z34g==", - "dev": true - }, - "mem": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/mem/-/mem-6.1.1.tgz", - "integrity": "sha512-Ci6bIfq/UgcxPTYa8dQQ5FY3BzKkT894bwXWXxC/zqs0XgMO2cT20CGkOqda7gZNkmK5VP4x89IGZ6K7hfbn3Q==", - "dev": true, - "requires": { - "map-age-cleaner": "^0.1.3", - "mimic-fn": "^3.0.0" - }, - "dependencies": { - "mimic-fn": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-3.1.0.tgz", - "integrity": "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ==", - "dev": true - } - } - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "parse-ms": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", - "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", - "dev": true - }, - "plur": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/plur/-/plur-4.0.0.tgz", - "integrity": "sha512-4UGewrYgqDFw9vV6zNV+ADmPAUAfJPKtGvb/VdpQAx25X5f3xXdGdyOEVFwkl8Hl/tl7+xbeHqSEM+D5/TirUg==", - "dev": true, - "requires": { - "irregular-plurals": "^3.2.0" - } - }, - "pretty-ms": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-7.0.1.tgz", - "integrity": "sha512-973driJZvxiGOQ5ONsFhOF/DtzPMOMtgC11kCpUrPGMTgqp2q/1gwzCquocrN33is0VZ5GFHXZYMM9l6h67v2Q==", - "dev": true, - "requires": { - "parse-ms": "^2.1.0" - } - }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "available-typed-arrays": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", @@ -4793,12 +4428,6 @@ "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" }, - "blueimp-md5": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.19.0.tgz", - "integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w==", - "dev": true - }, "bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -4950,79 +4579,6 @@ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.9.0.tgz", "integrity": "sha512-2ld76tuLBNFekRgmJfT2+3j5MIrP6bFict8WAIT3beq+srz1gcKNAdNKMqHqauQt63NmAa88HfP1/Ypa9Er3HA==" }, - "boxen": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-4.2.0.tgz", - "integrity": "sha512-eB4uT9RGzg2odpER62bBwSLvUeGC+WbRjjyyFhGsKnc8wp/m0+hQsMUvUe3H2V0D5vw0nBdO1hCJoZo5mKeuIQ==", - "dev": true, - "requires": { - "ansi-align": "^3.0.0", - "camelcase": "^5.3.1", - "chalk": "^3.0.0", - "cli-boxes": "^2.2.0", - "string-width": "^4.1.0", - "term-size": "^2.1.0", - "type-fest": "^0.8.1", - "widest-line": "^3.1.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", - "dev": true - } - } - }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -5057,12 +4613,6 @@ "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", "dev": true }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, "browserify-aes": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", @@ -5495,24 +5045,12 @@ "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==" }, - "chunkd": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/chunkd/-/chunkd-2.0.1.tgz", - "integrity": "sha512-7d58XsFmOq0j6el67Ug9mHf9ELUXsQXYJBkyxhH/k+6Ke0qXRnv0kbemx+Twc6fRJ07C49lcbdgm9FL1Ei/6SQ==", - "dev": true - }, "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", "dev": true }, - "ci-parallel-vars": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ci-parallel-vars/-/ci-parallel-vars-1.0.1.tgz", - "integrity": "sha512-uvzpYrpmidaoxvIQHM+rKSrigjOe9feHYbw4uOI2gdfe1C3xIlxO+kVXq83WQWNniTf8bAxVpy+cQeFQsMERKg==", - "dev": true - }, "cids": { "version": "0.7.5", "resolved": "https://registry.npmjs.org/cids/-/cids-0.7.5.tgz", @@ -5600,24 +5138,6 @@ } } }, - "clean-stack": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", - "dev": true - }, - "clean-yaml-object": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", - "integrity": "sha512-3yONmlN9CSAkzNwnRCiJQ7Q2xK5mWuEfL3PuTZcAUzhObbXsfsnMptJzXwz93nc5zn9V9TwCVMmV7w4xsm43dw==", - "dev": true - }, - "cli-boxes": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true - }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -5626,22 +5146,6 @@ "restore-cursor": "^2.0.0" } }, - "cli-spinners": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", - "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", - "dev": true - }, - "cli-truncate": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", - "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", - "dev": true, - "requires": { - "slice-ansi": "^3.0.0", - "string-width": "^4.2.0" - } - }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -5676,15 +5180,6 @@ "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==" }, - "code-excerpt": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", - "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", - "dev": true, - "requires": { - "convert-to-spaces": "^1.0.1" - } - }, "collect-v8-coverage": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz", @@ -5737,12 +5232,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "common-path-prefix": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", - "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", - "dev": true - }, "component-emitter": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", @@ -5795,86 +5284,6 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", - "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } - } - }, - "concordance": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/concordance/-/concordance-4.0.0.tgz", - "integrity": "sha512-l0RFuB8RLfCS0Pt2Id39/oCPykE01pyxgAFypWTlaGRgvLkZrtczZ8atEHpTeEIW+zYWXTBuA9cCSeEOScxReQ==", - "dev": true, - "requires": { - "date-time": "^2.1.0", - "esutils": "^2.0.2", - "fast-diff": "^1.1.2", - "js-string-escape": "^1.0.1", - "lodash.clonedeep": "^4.5.0", - "lodash.flattendeep": "^4.4.0", - "lodash.islength": "^4.0.1", - "lodash.merge": "^4.6.1", - "md5-hex": "^2.0.0", - "semver": "^5.5.1", - "well-known-symbols": "^2.0.0" - }, - "dependencies": { - "md5-hex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", - "integrity": "sha512-0HLfzJTZ7707VBNM1ydr5sTb+IZLhmU4u2TVA+Eenfn/Ed42/gn10smbAPiuEm/jNgjvWKUiMNihqJQ6flus9w==", - "dev": true, - "requires": { - "md5-o-matic": "^0.1.1" - } - }, - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true - } - } - }, "concurrently": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-5.3.0.tgz", @@ -6051,37 +5460,6 @@ } } }, - "configstore": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", - "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", - "dev": true, - "requires": { - "dot-prop": "^5.2.0", - "graceful-fs": "^4.1.2", - "make-dir": "^3.0.0", - "unique-string": "^2.0.0", - "write-file-atomic": "^3.0.0", - "xdg-basedir": "^4.0.0" - }, - "dependencies": { - "make-dir": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, - "requires": { - "semver": "^6.0.0" - } - }, - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, "connect-pg-simple": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/connect-pg-simple/-/connect-pg-simple-6.2.1.tgz", @@ -6148,12 +5526,6 @@ "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", "dev": true }, - "convert-to-spaces": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", - "integrity": "sha512-cj09EBuObp9gZNQCzc7hByQyrs6jVGE+o9kSJmeUoj+GiPiJvi5LYqEH/Hmme4+MTLHM+Ejtq+FChpjjEnsPdQ==", - "dev": true - }, "cookie": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", @@ -6300,12 +5672,6 @@ "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz", "integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q==" }, - "crypto-random-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "dev": true - }, "cssfilter": { "version": "0.0.10", "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", @@ -6334,15 +5700,6 @@ } } }, - "currently-unhandled": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", - "integrity": "sha512-/fITjgjGU50vjQ4FH6eUoYu+iUoUKIXws2hL15JJpIR+BbTxaXQsMuuyjtNh2WqsSBS5nsaZHFsFecyw5CCAng==", - "dev": true, - "requires": { - "array-find-index": "^1.0.1" - } - }, "cycle": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz", @@ -6462,15 +5819,6 @@ "resolved": "https://registry.npmjs.org/date-fns-tz/-/date-fns-tz-1.3.8.tgz", "integrity": "sha512-qwNXUFtMHTTU6CFSFjoJ80W8Fzzp24LntbjFFBgL/faqds4e5mo9mftoRLgr3Vi1trISsg4awSpYVsOQCRnapQ==" }, - "date-time": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", - "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", - "dev": true, - "requires": { - "time-zone": "^1.0.0" - } - }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", @@ -6520,12 +5868,6 @@ "mimic-response": "^1.0.0" } }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, "deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", @@ -6536,23 +5878,6 @@ "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==" }, - "defaults": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", - "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", - "dev": true, - "requires": { - "clone": "^1.0.2" - }, - "dependencies": { - "clone": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", - "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", - "dev": true - } - } - }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -6638,49 +5963,6 @@ } } }, - "del": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/del/-/del-5.1.0.tgz", - "integrity": "sha512-wH9xOVHnczo9jN2IW68BabcecVPxacIA3g/7z6vhSU/4stOKQzeCRK0yD0A24WiAAUJmmVpWqrERcTxnLo3AnA==", - "dev": true, - "requires": { - "globby": "^10.0.1", - "graceful-fs": "^4.2.2", - "is-glob": "^4.0.1", - "is-path-cwd": "^2.2.0", - "is-path-inside": "^3.0.1", - "p-map": "^3.0.0", - "rimraf": "^3.0.0", - "slash": "^3.0.0" - }, - "dependencies": { - "globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", - "dev": true, - "requires": { - "@types/glob": "^7.1.1", - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", - "slash": "^3.0.0" - } - }, - "p-map": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - } - } - }, "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -6743,12 +6025,6 @@ "streamsearch": "0.1.2" } }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, "diff-sequences": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", @@ -6772,15 +6048,6 @@ } } }, - "dir-glob": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", - "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, - "requires": { - "path-type": "^4.0.0" - } - }, "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", @@ -6850,15 +6117,6 @@ "resolved": "https://registry.npmjs.org/dont-sniff-mimetype/-/dont-sniff-mimetype-1.1.0.tgz", "integrity": "sha512-ZjI4zqTaxveH2/tTlzS1wFp+7ncxNZaIEWYg3lzZRHkKf5zPT/MnEG6WL0BhHMJUabkh8GeU5NL5j+rEUCb7Ug==" }, - "dot-prop": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", - "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, - "requires": { - "is-obj": "^2.0.0" - } - }, "dotenv": { "version": "16.4.5", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", @@ -6944,12 +6202,6 @@ } } }, - "emittery": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.6.0.tgz", - "integrity": "sha512-6EMRGr9KzYWp8DzHFZsKVZBsMO6QhAeHMeHND8rhyBNCHKMLpgW9tZv40bwN3rAIKRS5CxcK8oLRKUJSB9h7yQ==", - "dev": true - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -6978,12 +6230,6 @@ "resolved": "https://registry.npmjs.org/eol/-/eol-0.5.1.tgz", "integrity": "sha512-mlG6+lv5G7pXnSK/k7jh7B++h3nIxoNdevctYQWfd14UUvowwseRWpYdqXdYeumDwPAp69DorsnK/eWK9lm4AA==" }, - "equal-length": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", - "integrity": "sha512-TK2m7MvWPt/v3dan0BCNp99pytIE5UGrUj7F0KZirNX8xz8fDFUAZfgm8uB5FuQq9u0sMeDocYBfEhsd1nwGoA==", - "dev": true - }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -7141,12 +6387,6 @@ "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true }, - "escape-goat": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true - }, "escape-html": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", @@ -7168,179 +6408,6 @@ "source-map": "~0.6.1" } }, - "eslint": { - "version": "4.19.1", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", - "dev": true, - "requires": { - "ajv": "^5.3.0", - "babel-code-frame": "^6.22.0", - "chalk": "^2.1.0", - "concat-stream": "^1.6.0", - "cross-spawn": "^5.1.0", - "debug": "^3.1.0", - "doctrine": "^2.1.0", - "eslint-scope": "^3.7.1", - "eslint-visitor-keys": "^1.0.0", - "espree": "^3.5.4", - "esquery": "^1.0.0", - "esutils": "^2.0.2", - "file-entry-cache": "^2.0.0", - "functional-red-black-tree": "^1.0.1", - "glob": "^7.1.2", - "globals": "^11.0.1", - "ignore": "^3.3.3", - "imurmurhash": "^0.1.4", - "inquirer": "^3.0.6", - "is-resolvable": "^1.0.0", - "js-yaml": "^3.9.1", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.3.0", - "lodash": "^4.17.4", - "minimatch": "^3.0.2", - "mkdirp": "^0.5.1", - "natural-compare": "^1.4.0", - "optionator": "^0.8.2", - "path-is-inside": "^1.0.2", - "pluralize": "^7.0.0", - "progress": "^2.0.0", - "regexpp": "^1.0.1", - "require-uncached": "^1.0.3", - "semver": "^5.3.0", - "strip-ansi": "^4.0.0", - "strip-json-comments": "~2.0.1", - "table": "4.0.2", - "text-table": "~0.2.0" - }, - "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", - "dev": true, - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "cross-spawn": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", - "integrity": "sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==", - "dev": true, - "requires": { - "lru-cache": "^4.0.1", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha512-fueX787WZKCV0Is4/T2cyAdM4+x1S3MXXOAhavE1ys/W42SHAPacLTQhucja22QBYrfGw50M2sRiXPtTGv9Ymw==", - "dev": true - }, - "ignore": { - "version": "3.3.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz", - "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==", - "dev": true - }, - "inquirer": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", - "dev": true, - "requires": { - "ansi-escapes": "^3.0.0", - "chalk": "^2.0.0", - "cli-cursor": "^2.1.0", - "cli-width": "^2.0.0", - "external-editor": "^2.0.4", - "figures": "^2.0.0", - "lodash": "^4.3.0", - "mute-stream": "0.0.7", - "run-async": "^2.2.0", - "rx-lite": "^4.0.8", - "rx-lite-aggregates": "^4.0.8", - "string-width": "^2.1.0", - "strip-ansi": "^4.0.0", - "through": "^2.3.6" - } - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha512-4JD/Ivzg7PoW8NzdrBSr3UFwC9mHgvI7Z6z3QGBsSHgKaRTUDmyZAAKJo2UbG1kUVfS9WS8bi36N49U1xw43DA==", - "dev": true - }, - "lru-cache": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", - "dev": true, - "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" - } - }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "dev": true, - "requires": { - "minimist": "^1.2.6" - } - }, - "semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, - "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==", - "dev": true - } - } - }, "eslint-config-standard": { "version": "12.0.0", "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-12.0.0.tgz", @@ -7623,24 +6690,6 @@ "integrity": "sha512-nKptN8l7jksXkwFk++PhJB3cCDTcXOEyhISIN86Ue2feJ1LFyY3PrY3/xT2keXlJSY5bpmbiTG0f885/YKAvTA==", "dev": true }, - "eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==", - "dev": true, - "requires": { - "esrecurse": "^4.1.0", - "estraverse": "^4.1.1" - }, - "dependencies": { - "estraverse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true - } - } - }, "eslint-utils": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz", @@ -7667,24 +6716,6 @@ "type": "^2.7.2" } }, - "espree": { - "version": "3.5.4", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", - "dev": true, - "requires": { - "acorn": "^5.5.0", - "acorn-jsx": "^3.0.0" - }, - "dependencies": { - "acorn": { - "version": "5.7.4", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", - "dev": true - } - } - }, "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -8412,25 +7443,6 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" }, - "fast-diff": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz", - "integrity": "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==", - "dev": true - }, - "fast-glob": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", - "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "^2.0.2", - "@nodelib/fs.walk": "^1.2.3", - "glob-parent": "^5.1.2", - "merge2": "^1.3.0", - "micromatch": "^4.0.4" - } - }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", @@ -8451,15 +7463,6 @@ "resolved": "https://registry.npmjs.org/fastpriorityqueue/-/fastpriorityqueue-0.7.5.tgz", "integrity": "sha512-3Pa0n9gwy8yIbEsT3m2j/E9DXgWvvjfiZjjqcJ+AdNKTAlVMIuFYrYG5Y3RHEM8O6cwv9hOpOWY/NaMfywoQVA==" }, - "fastq": { - "version": "1.17.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", - "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, "fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -8899,15 +7902,6 @@ "process": "^0.11.10" } }, - "global-dirs": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-2.1.0.tgz", - "integrity": "sha512-MG6kdOUh/xBnyo9cJFeIKkLEc1AyFq42QTU4XiX51i2NEdxLxLWXIjEjmqKeSuKR7pAZjTqUVoT2b2huxVLgYQ==", - "dev": true, - "requires": { - "ini": "1.3.7" - } - }, "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", @@ -8922,20 +7916,6 @@ "define-properties": "^1.1.3" } }, - "globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dev": true, - "requires": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - } - }, "gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -9061,12 +8041,6 @@ } } }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -9225,12 +8199,6 @@ } } }, - "has-yarn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true - }, "hash-base": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", @@ -9258,12 +8226,6 @@ "function-bind": "^1.1.2" } }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA==", - "dev": true - }, "helmet": { "version": "3.23.3", "resolved": "https://registry.npmjs.org/helmet/-/helmet-3.23.3.tgz", @@ -9514,24 +8476,12 @@ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, - "ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", - "dev": true - }, "ignore-by-default": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", "integrity": "sha512-Ius2VYcGNk7T90CppJqcIkS5ooHUZyIQK+ClZfMfMNFEF9VSE73Fq+906u/CWu92x4gzZMWOwfFYckPObzdEbA==", "dev": true }, - "import-lazy": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha512-m7ZEHgtw69qOGw+jwxXkHlrlIPdTGkyh66zXZ1ajZbxkDBNjSY/LGbmjc7h0s2ELsUDTAhFr55TrPSSqJGPG0A==", - "dev": true - }, "import-local": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", @@ -9548,12 +8498,6 @@ "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", "dev": true }, - "indent-string": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", - "dev": true - }, "inflection": { "version": "1.12.0", "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.12.0.tgz", @@ -9573,12 +8517,6 @@ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, - "ini": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz", - "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ==", - "dev": true - }, "injectpromise": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/injectpromise/-/injectpromise-1.0.0.tgz", @@ -9672,12 +8610,6 @@ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.1.0.tgz", "integrity": "sha512-LlbxQ7xKzfBusov6UMi4MFpEg0m+mAm9xyNGEduwXMEDuf4WfzB/RZwMVYEd7IKGvh4IUkEXYxtAVu9T3OelJQ==" }, - "irregular-plurals": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-3.5.0.tgz", - "integrity": "sha512-1ANGLZ+Nkv1ptFb2pa8oG8Lem4krflKuX/gINiHJHjJUKaJHk/SXk5x6K3J+39/p0h1RQ2saROclJJ+QLvETCQ==", - "dev": true - }, "is-accessor-descriptor": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.1.tgz", @@ -9808,12 +8740,6 @@ "dev": true, "optional": true }, - "is-error": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.2.tgz", - "integrity": "sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==", - "dev": true - }, "is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -9869,33 +8795,11 @@ "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==" }, - "is-installed-globally": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.3.2.tgz", - "integrity": "sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g==", - "dev": true, - "requires": { - "global-dirs": "^2.0.1", - "is-path-inside": "^3.0.1" - } - }, - "is-interactive": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", - "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", - "dev": true - }, "is-negative-zero": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==" }, - "is-npm": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", - "integrity": "sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==", - "dev": true - }, "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -9910,29 +8814,11 @@ "has-tostringtag": "^1.0.0" } }, - "is-obj": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true - }, "is-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-object/-/is-object-1.0.2.tgz", "integrity": "sha512-2rRIahhZr2UWb45fIOuvZGpFtz0TyOZLf32KxBbSoUCeZR495zCKlWUKKUByk3geS2eAs7ZAABt0Y/Rx0GiQGA==" }, - "is-path-cwd": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", - "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", - "dev": true - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true - }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -9949,12 +8835,6 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, - "is-promise": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", - "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", - "dev": true - }, "is-regex": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", @@ -10041,12 +8921,6 @@ "is-docker": "^2.0.0" } }, - "is-yarn-global": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -11481,12 +10355,6 @@ "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" }, - "js-string-escape": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", - "integrity": "sha512-Smw4xcfIQ5LVjAOuJCvN/zIodzA/BBSsluuoSykP+lUvScIi4U6RJLfwHet5cxFnCswUjISV8oAXaqaJDY3chg==", - "dev": true - }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -11857,15 +10725,6 @@ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true }, - "latest-version": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", - "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, - "requires": { - "package-json": "^6.3.0" - } - }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", @@ -11914,27 +10773,6 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "load-json-file": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", - "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", - "dev": true, - "requires": { - "graceful-fs": "^4.1.15", - "parse-json": "^4.0.0", - "pify": "^4.0.1", - "strip-bom": "^3.0.0", - "type-fest": "^0.3.0" - }, - "dependencies": { - "pify": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", - "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", - "dev": true - } - } - }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -11959,18 +10797,6 @@ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==" }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true - }, - "lodash.flattendeep": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha512-uHaJFihxmJcEX3kT4I23ABqKKalJ/zDrDg0lsFtc1h+3uw49SIJ5beyhx5ExVRti3AvKoOJngIj7xz3oylPdWQ==", - "dev": true - }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", @@ -11991,12 +10817,6 @@ "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==" }, - "lodash.islength": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/lodash.islength/-/lodash.islength-4.0.1.tgz", - "integrity": "sha512-FlJtdcHNU8YEXbzZXYWMEHLkQOpvmlnGr5o2N1iQKB7hNyr6qPkWAe+Ceczz6JYlIzD4AlTD2igvt/2/0Pb3Zw==", - "dev": true - }, "lodash.isnumber": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", @@ -12022,11 +10842,6 @@ "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==" }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==" - }, "lodash.once": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", @@ -12047,15 +10862,6 @@ "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" }, - "log-symbols": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", - "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", - "dev": true, - "requires": { - "chalk": "^2.4.2" - } - }, "logform": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz", @@ -12395,15 +11201,6 @@ "tmpl": "1.0.5" } }, - "map-age-cleaner": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", - "dev": true, - "requires": { - "p-defer": "^1.0.0" - } - }, "map-cache": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", @@ -12419,30 +11216,6 @@ "object-visit": "^1.0.0" } }, - "matcher": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/matcher/-/matcher-3.0.0.tgz", - "integrity": "sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==", - "dev": true, - "requires": { - "escape-string-regexp": "^4.0.0" - } - }, - "md5-hex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", - "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", - "dev": true, - "requires": { - "blueimp-md5": "^2.10.0" - } - }, - "md5-o-matic": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", - "integrity": "sha512-QBJSFpsedXUl/Lgs4ySdB2XCzUEcJ3ujpbagdZCkRaYIaC0kFnID8jhc84KEiVv6dNFtIrmW7bqow0lDxgJi6A==", - "dev": true - }, "md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -12477,12 +11250,6 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, - "merge2": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", - "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true - }, "merkle-lib": { "version": "2.0.10", "resolved": "https://registry.npmjs.org/merkle-lib/-/merkle-lib-2.0.10.tgz", @@ -12700,86 +11467,6 @@ "obliterator": "^1.2.1" } }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", - "dev": true - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true - }, - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q==", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } - } - }, "mock-fs": { "version": "4.14.0", "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz", @@ -13392,113 +12079,6 @@ "word-wrap": "~1.2.3" } }, - "ora": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ora/-/ora-4.1.1.tgz", - "integrity": "sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A==", - "dev": true, - "requires": { - "chalk": "^3.0.0", - "cli-cursor": "^3.1.0", - "cli-spinners": "^2.2.0", - "is-interactive": "^1.0.0", - "log-symbols": "^3.0.0", - "mute-stream": "0.0.8", - "strip-ansi": "^6.0.0", - "wcwidth": "^1.0.1" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "cli-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", - "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", - "dev": true, - "requires": { - "restore-cursor": "^3.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "mimic-fn": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", - "dev": true - }, - "mute-stream": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", - "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", - "dev": true - }, - "onetime": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", - "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", - "dev": true, - "requires": { - "mimic-fn": "^2.1.0" - } - }, - "restore-cursor": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", - "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", - "dev": true, - "requires": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - } - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -13519,12 +12099,6 @@ "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-0.3.0.tgz", "integrity": "sha512-RVbZPLso8+jFeq1MfNvgXtCRED2raz/dKpacfTNxsx6pLEpEomM7gah6VeHSYV3+vo0OAi4MkArtQcWWXuQoyw==" }, - "p-defer": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==", - "dev": true - }, "p-each-series": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz", @@ -13556,15 +12130,6 @@ "p-limit": "^2.2.0" } }, - "p-map": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", - "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", - "dev": true, - "requires": { - "aggregate-error": "^3.0.0" - } - }, "p-queue": { "version": "6.6.2", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-6.6.2.tgz", @@ -13656,75 +12221,6 @@ "netmask": "^2.0.2" } }, - "package-json": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", - "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, - "requires": { - "got": "^9.6.0", - "registry-auth-token": "^4.0.0", - "registry-url": "^5.0.0", - "semver": "^6.2.0" - }, - "dependencies": { - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, - "requires": { - "pump": "^3.0.0" - } - }, - "got": { - "version": "9.6.0", - "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", - "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, - "requires": { - "@sindresorhus/is": "^0.14.0", - "@szmarczak/http-timer": "^1.1.2", - "cacheable-request": "^6.0.0", - "decompress-response": "^3.3.0", - "duplexer3": "^0.1.4", - "get-stream": "^4.1.0", - "lowercase-keys": "^1.0.1", - "mimic-response": "^1.0.1", - "p-cancelable": "^1.0.0", - "to-readable-stream": "^1.0.0", - "url-parse-lax": "^3.0.0" - } - }, - "p-cancelable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true - }, - "prepend-http": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha512-ravE6m9Atw9Z/jjttRUZ+clIXogdghyZAuWJ3qEzjT+jI/dL1ifAqhZeC5VHzQp1MSt1+jxKkFNemj/iO7tVUA==", - "dev": true - }, - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - }, - "url-parse-lax": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", - "integrity": "sha512-NjFKA0DidqPa5ciFcSrXnAltTtzz84ogy+NebPvfEgAck0+TNg4UJ4IN+fB7zRZfbgUf0syOo9MDxFkDSMuFaQ==", - "dev": true, - "requires": { - "prepend-http": "^2.0.0" - } - } - } - }, "packet-reader": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-1.0.0.tgz", @@ -13873,12 +12369,6 @@ "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" }, - "path-type": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true - }, "pbkdf2": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", @@ -14059,52 +12549,6 @@ "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==", "dev": true }, - "pkg-conf": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", - "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", - "dev": true, - "requires": { - "find-up": "^3.0.0", - "load-json-file": "^5.2.0" - }, - "dependencies": { - "find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", - "dev": true, - "requires": { - "locate-path": "^3.0.0" - } - }, - "locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", - "dev": true, - "requires": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" - } - }, - "p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "requires": { - "p-limit": "^2.0.0" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true - } - } - }, "pkg-config": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz", @@ -14357,12 +12801,6 @@ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, - "pseudomap": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==", - "dev": true - }, "psl": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", @@ -14408,15 +12846,6 @@ "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" }, - "pupa": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", - "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", - "dev": true, - "requires": { - "escape-goat": "^2.0.0" - } - }, "pushdata-bitcoin": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/pushdata-bitcoin/-/pushdata-bitcoin-1.0.1.tgz", @@ -14554,18 +12983,6 @@ } } }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - } - }, "react-is": { "version": "17.0.2", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", @@ -14673,30 +13090,6 @@ "set-function-name": "^2.0.1" } }, - "regexpp": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", - "dev": true - }, - "registry-auth-token": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.2.tgz", - "integrity": "sha512-PC5ZysNb42zpFME6D/XlIgtNGdTl8bBOCw90xQLVMpzuuubJKYDWFAEuUNc+Cn8Z8724tg2SDhDRrkVEsqfDMg==", - "dev": true, - "requires": { - "rc": "1.2.8" - } - }, - "registry-url": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", - "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, - "requires": { - "rc": "^1.2.8" - } - }, "remove-trailing-separator": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", @@ -14883,21 +13276,6 @@ "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==" }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rewire": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/rewire/-/rewire-4.0.1.tgz", - "integrity": "sha512-+7RQ/BYwTieHVXetpKhT11UbfF6v1kGhKFrtZN7UDL2PybMsSt/rpLWeEUGF5Ndsl1D5BxiCB14VDJyoX+noYw==", - "dev": true, - "requires": { - "eslint": "^4.19.1" - } - }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -14948,21 +13326,6 @@ "queue-microtask": "^1.2.2" } }, - "rx-lite": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", - "integrity": "sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA==", - "dev": true - }, - "rx-lite-aggregates": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", - "integrity": "sha512-3xPNZGW93oCjiO7PtKxRK6iOVYBWBvtf9QHDfU23Oc+dLIQmAV//UnyXV/yihv81VS/UqoQPk4NegS8EFi55Hg==", - "dev": true, - "requires": { - "rx-lite": "*" - } - }, "rxjs": { "version": "5.5.12", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", @@ -15262,23 +13625,6 @@ } } }, - "semver-diff": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", - "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, - "requires": { - "semver": "^6.3.0" - }, - "dependencies": { - "semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true - } - } - }, "send": { "version": "0.17.1", "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", @@ -15356,12 +13702,6 @@ } } }, - "serialize-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", - "integrity": "sha512-ghgmKt5o4Tly5yEG/UJp8qTd0AN7Xalw4XBtDEKP655B699qMEtra1WlXeE6WIvdEG481JvRxULKsInq/iNysw==", - "dev": true - }, "serve-static": { "version": "1.15.0", "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", @@ -15617,43 +13957,6 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, - "slice-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", - "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "astral-regex": "^2.0.0", - "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - } - } - }, "slug": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/slug/-/slug-5.3.0.tgz", @@ -16442,48 +14745,6 @@ } } }, - "supertap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", - "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", - "dev": true, - "requires": { - "arrify": "^1.0.1", - "indent-string": "^3.2.0", - "js-yaml": "^3.10.0", - "serialize-error": "^2.1.0", - "strip-ansi": "^4.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==", - "dev": true - }, - "indent-string": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", - "integrity": "sha512-BYqTHXTGUIvg7t1r4sJNKcbDZkL92nkXA8YtRpbjFHRHGDL/NtUeiBJMeE60kIFN/Mg8ESaWQvftaYMGJzQZCQ==", - "dev": true - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -16752,86 +15013,6 @@ "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", "dev": true }, - "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", - "dev": true, - "requires": { - "ajv": "^5.2.3", - "ajv-keywords": "^2.1.0", - "chalk": "^2.1.0", - "lodash": "^4.17.4", - "slice-ansi": "1.0.0", - "string-width": "^2.1.1" - }, - "dependencies": { - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha512-Ajr4IcMXq/2QmMkEmSvxqfLN5zGmJ92gHXAeOXq1OekoH2rfDNsgdDoL2f7QaRCy7G/E6TpxBVdRuNraMztGHw==", - "dev": true, - "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" - } - }, - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha512-fueX787WZKCV0Is4/T2cyAdM4+x1S3MXXOAhavE1ys/W42SHAPacLTQhucja22QBYrfGw50M2sRiXPtTGv9Ymw==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", - "dev": true - }, - "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha512-4JD/Ivzg7PoW8NzdrBSr3UFwC9mHgvI7Z6z3QGBsSHgKaRTUDmyZAAKJo2UbG1kUVfS9WS8bi36N49U1xw43DA==", - "dev": true - }, - "slice-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0" - } - }, - "string-width": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", - "dev": true, - "requires": { - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^4.0.0" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - } - } - }, "talisman": { "version": "0.20.0", "resolved": "https://registry.npmjs.org/talisman/-/talisman-0.20.0.tgz", @@ -16889,18 +15070,6 @@ } } }, - "temp-dir": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/temp-dir/-/temp-dir-2.0.0.tgz", - "integrity": "sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg==", - "dev": true - }, - "term-size": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/term-size/-/term-size-2.2.1.tgz", - "integrity": "sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==", - "dev": true - }, "terminal-link": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", @@ -17004,12 +15173,6 @@ "resolved": "https://registry.npmjs.org/thunkify/-/thunkify-2.1.2.tgz", "integrity": "sha512-w9foI80XcGImrhMQ19pxunaEC5Rp2uzxZZg4XBAFRfiLOplk3F0l7wo+bO16vC2/nlQfR/mXZxcduo0MF2GWLg==" }, - "time-zone": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", - "integrity": "sha512-TIsDdtKo6+XrPtiTm1ssmMngN1sAhyKnTO2kunQWqNPWIVvCm15Wmw4SWInwTVgJ5u/Tr04+8Ei9TNcw4x4ONA==", - "dev": true - }, "timed-out": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/timed-out/-/timed-out-4.0.1.tgz", @@ -17150,12 +15313,6 @@ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true }, - "trim-off-newlines": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.3.tgz", - "integrity": "sha512-kh6Tu6GbeSNMGfrrZh6Bb/4ZEHV1QlB4xNDBeog8Y9/QwFlKTRyWvY3Fs9tRDAMZliVUwieMgEdIeL/FtqjkJg==", - "dev": true - }, "triple-beam": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", @@ -17361,12 +15518,6 @@ "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, - "type-fest": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", - "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", - "dev": true - }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", @@ -17424,12 +15575,6 @@ "possible-typed-array-names": "^1.0.0" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", - "dev": true - }, "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -17496,15 +15641,6 @@ "integrity": "sha512-Gw+zz50YNKPDKXs+9d+aKAjVwpjNwqzvNpLigIruT4HA9lMZNdMqs9x07kKHB/L9WRzqp4+DlTU5s4wG2esdoA==", "dev": true }, - "unique-string": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", - "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, - "requires": { - "crypto-random-string": "^2.0.0" - } - }, "universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -17576,78 +15712,6 @@ "picocolors": "^1.0.0" } }, - "update-notifier": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-4.1.3.tgz", - "integrity": "sha512-Yld6Z0RyCYGB6ckIjffGOSOmHXj1gMeE7aROz4MG+XMkmixBX4jUngrGXNYz7wPKBmtoD4MnBa2Anu7RSKht/A==", - "dev": true, - "requires": { - "boxen": "^4.2.0", - "chalk": "^3.0.0", - "configstore": "^5.0.1", - "has-yarn": "^2.1.0", - "import-lazy": "^2.1.0", - "is-ci": "^2.0.0", - "is-installed-globally": "^0.3.1", - "is-npm": "^4.0.0", - "is-yarn-global": "^0.3.0", - "latest-version": "^5.0.0", - "pupa": "^2.0.1", - "semver-diff": "^3.1.1", - "xdg-basedir": "^4.0.0" - }, - "dependencies": { - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - } - } - }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -17850,15 +15914,6 @@ "makeerror": "1.0.12" } }, - "wcwidth": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", - "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", - "dev": true, - "requires": { - "defaults": "^1.0.3" - } - }, "weak-map": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/weak-map/-/weak-map-1.0.8.tgz", @@ -18337,12 +16392,6 @@ } } }, - "well-known-symbols": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", - "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", - "dev": true - }, "whatwg-encoding": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", @@ -18414,15 +16463,6 @@ "string-width": "^1.0.2 || 2 || 3 || 4" } }, - "widest-line": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", - "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, - "requires": { - "string-width": "^4.0.0" - } - }, "wif": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/wif/-/wif-2.0.6.tgz", @@ -18548,12 +16588,6 @@ "resolved": "https://registry.npmjs.org/x-xss-protection/-/x-xss-protection-1.3.0.tgz", "integrity": "sha512-kpyBI9TlVipZO4diReZMAHWtS0MMa/7Kgx8hwG/EuZLiA6sg4Ah/4TRdASHhRRN3boobzcYgFRUFSgHRge6Qhg==" }, - "xdg-basedir": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true - }, "xhr": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/xhr/-/xhr-2.6.0.tgz", diff --git a/package.json b/package.json index fbc13130..85a95d18 100644 --- a/package.json +++ b/package.json @@ -131,7 +131,7 @@ "admin-server": "nodemon bin/lamassu-admin-server --dev --logLevel silly", "graphql-server": "nodemon bin/new-graphql-dev-insecure", "watch": "concurrently \"npm:server\" \"npm:admin-server\" \"npm:graphql-server\"", - "stress-test": "cd ./test/stress/ && node index.js 50 -v" + "stress-test": "cd tests/stress/ && node index.js 50 -v" }, "nodemonConfig": { "ignore": [ @@ -139,12 +139,9 @@ ] }, "devDependencies": { - "ava": "3.8.2", "concurrently": "^5.3.0", "jest": "^26.6.3", - "mocha": "^5.0.1", "nodemon": "^2.0.6", - "rewire": "^4.0.1", "standard": "^12.0.1" }, "standard": { diff --git a/public/asset-manifest.json b/public/asset-manifest.json deleted file mode 100644 index ea75982a..00000000 --- a/public/asset-manifest.json +++ /dev/null @@ -1,159 +0,0 @@ -{ - "files": { - "main.js": "/static/js/main.900511f9.chunk.js", - "main.js.map": "/static/js/main.900511f9.chunk.js.map", - "runtime-main.js": "/static/js/runtime-main.5b925903.js", - "runtime-main.js.map": "/static/js/runtime-main.5b925903.js.map", - "static/js/2.01291e3c.chunk.js": "/static/js/2.01291e3c.chunk.js", - "static/js/2.01291e3c.chunk.js.map": "/static/js/2.01291e3c.chunk.js.map", - "index.html": "/index.html", - "static/js/2.01291e3c.chunk.js.LICENSE.txt": "/static/js/2.01291e3c.chunk.js.LICENSE.txt", - "static/media/3-cassettes-open-1-left.d6d9aa73.svg": "/static/media/3-cassettes-open-1-left.d6d9aa73.svg", - "static/media/3-cassettes-open-2-left.a9ee8d4c.svg": "/static/media/3-cassettes-open-2-left.a9ee8d4c.svg", - "static/media/3-cassettes-open-3-left.08fed660.svg": "/static/media/3-cassettes-open-3-left.08fed660.svg", - "static/media/4-cassettes-open-1-left.7b00c51f.svg": "/static/media/4-cassettes-open-1-left.7b00c51f.svg", - "static/media/4-cassettes-open-2-left.b3d9541c.svg": "/static/media/4-cassettes-open-2-left.b3d9541c.svg", - "static/media/4-cassettes-open-3-left.e8f1667c.svg": "/static/media/4-cassettes-open-3-left.e8f1667c.svg", - "static/media/4-cassettes-open-4-left.bc1a9829.svg": "/static/media/4-cassettes-open-4-left.bc1a9829.svg", - "static/media/acceptor-left.f37bcb1a.svg": "/static/media/acceptor-left.f37bcb1a.svg", - "static/media/both-filled.7af80d5f.svg": "/static/media/both-filled.7af80d5f.svg", - "static/media/carousel-left-arrow.c6575d9d.svg": "/static/media/carousel-left-arrow.c6575d9d.svg", - "static/media/carousel-right-arrow.1d5e04d1.svg": "/static/media/carousel-right-arrow.1d5e04d1.svg", - "static/media/cash-in.c06970a7.svg": "/static/media/cash-in.c06970a7.svg", - "static/media/cash-out.f029ae96.svg": "/static/media/cash-out.f029ae96.svg", - "static/media/cashbox-empty.828bd3b9.svg": "/static/media/cashbox-empty.828bd3b9.svg", - "static/media/cashout-cassette-1.fac6c691.svg": "/static/media/cashout-cassette-1.fac6c691.svg", - "static/media/cashout-cassette-2.34a98cfa.svg": "/static/media/cashout-cassette-2.34a98cfa.svg", - "static/media/closed.b853a619.svg": "/static/media/closed.b853a619.svg", - "static/media/comet.0a722656.svg": "/static/media/comet.0a722656.svg", - "static/media/comet.431ab3d7.svg": "/static/media/comet.431ab3d7.svg", - "static/media/comet.56af080c.svg": "/static/media/comet.56af080c.svg", - "static/media/comet.77ebaba5.svg": "/static/media/comet.77ebaba5.svg", - "static/media/comet.8877f6c3.svg": "/static/media/comet.8877f6c3.svg", - "static/media/comet.8aef4281.svg": "/static/media/comet.8aef4281.svg", - "static/media/comet.9dc291f2.svg": "/static/media/comet.9dc291f2.svg", - "static/media/comet.aaf93613.svg": "/static/media/comet.aaf93613.svg", - "static/media/comet.c4eaa20d.svg": "/static/media/comet.c4eaa20d.svg", - "static/media/complete.99ba27f3.svg": "/static/media/complete.99ba27f3.svg", - "static/media/complete.d94d5045.svg": "/static/media/complete.d94d5045.svg", - "static/media/copy.f4cea549.svg": "/static/media/copy.f4cea549.svg", - "static/media/crossed-camera.28e8f7eb.svg": "/static/media/crossed-camera.28e8f7eb.svg", - "static/media/current.68045777.svg": "/static/media/current.68045777.svg", - "static/media/current.9bbfa93f.svg": "/static/media/current.9bbfa93f.svg", - "static/media/custom-requirement.38819635.svg": "/static/media/custom-requirement.38819635.svg", - "static/media/disabled.347e2b5e.svg": "/static/media/disabled.347e2b5e.svg", - "static/media/disabled.aede2073.svg": "/static/media/disabled.aede2073.svg", - "static/media/dispenser-1.e4200f4e.svg": "/static/media/dispenser-1.e4200f4e.svg", - "static/media/dispenser-2.9f7807a5.svg": "/static/media/dispenser-2.9f7807a5.svg", - "static/media/down.919a0c2a.svg": "/static/media/down.919a0c2a.svg", - "static/media/download_logs.219c88ac.svg": "/static/media/download_logs.219c88ac.svg", - "static/media/empty-table.250884a9.svg": "/static/media/empty-table.250884a9.svg", - "static/media/empty.631601f2.svg": "/static/media/empty.631601f2.svg", - "static/media/empty.862ae4bb.svg": "/static/media/empty.862ae4bb.svg", - "static/media/enabled.5aae4510.svg": "/static/media/enabled.5aae4510.svg", - "static/media/enabled.a058fdfc.svg": "/static/media/enabled.a058fdfc.svg", - "static/media/equal.f4103789.svg": "/static/media/equal.f4103789.svg", - "static/media/false.347e5864.svg": "/static/media/false.347e5864.svg", - "static/media/full.67b8cd67.svg": "/static/media/full.67b8cd67.svg", - "static/media/icon-bitcoin-colour.bd8da481.svg": "/static/media/icon-bitcoin-colour.bd8da481.svg", - "static/media/icon-bitcoincash-colour.ed917caa.svg": "/static/media/icon-bitcoincash-colour.ed917caa.svg", - "static/media/icon-dash-colour.e01c021b.svg": "/static/media/icon-dash-colour.e01c021b.svg", - "static/media/icon-ethereum-colour.761723a2.svg": "/static/media/icon-ethereum-colour.761723a2.svg", - "static/media/icon-litecoin-colour.bd861b5e.svg": "/static/media/icon-litecoin-colour.bd861b5e.svg", - "static/media/icon-monero-colour.650b7bd1.svg": "/static/media/icon-monero-colour.650b7bd1.svg", - "static/media/icon-tether-colour.92d7fda4.svg": "/static/media/icon-tether-colour.92d7fda4.svg", - "static/media/icon-zcash-colour.68b1c20b.svg": "/static/media/icon-zcash-colour.68b1c20b.svg", - "static/media/keyboard.cc22b859.svg": "/static/media/keyboard.cc22b859.svg", - "static/media/keypad.dfb6094e.svg": "/static/media/keypad.dfb6094e.svg", - "static/media/list.65e6f8cb.svg": "/static/media/list.65e6f8cb.svg", - "static/media/logo-white.d997c674.svg": "/static/media/logo-white.d997c674.svg", - "static/media/logo.8ee79eab.svg": "/static/media/logo.8ee79eab.svg", - "static/media/month_change.58940268.svg": "/static/media/month_change.58940268.svg", - "static/media/month_change_right.0c3eb9a1.svg": "/static/media/month_change_right.0c3eb9a1.svg", - "static/media/notification-zodiac.e2897b39.svg": "/static/media/notification-zodiac.e2897b39.svg", - "static/media/notification.a9712ffd.svg": "/static/media/notification.a9712ffd.svg", - "static/media/open.7196c113.svg": "/static/media/open.7196c113.svg", - "static/media/pumpkin.877c3432.svg": "/static/media/pumpkin.877c3432.svg", - "static/media/regular.3140e691.svg": "/static/media/regular.3140e691.svg", - "static/media/right.d3dd4af6.svg": "/static/media/right.d3dd4af6.svg", - "static/media/right_white.3e1a2119.svg": "/static/media/right_white.3e1a2119.svg", - "static/media/spring2.9f3bb2f7.svg": "/static/media/spring2.9f3bb2f7.svg", - "static/media/stripes.876e4081.svg": "/static/media/stripes.876e4081.svg", - "static/media/tomato.4b561f6f.svg": "/static/media/tomato.4b561f6f.svg", - "static/media/tomato.b3903800.svg": "/static/media/tomato.b3903800.svg", - "static/media/transaction.d1309f34.svg": "/static/media/transaction.d1309f34.svg", - "static/media/true.b3b76849.svg": "/static/media/true.b3b76849.svg", - "static/media/up.bcdf0fc7.svg": "/static/media/up.bcdf0fc7.svg", - "static/media/white.144118ff.svg": "/static/media/white.144118ff.svg", - "static/media/white.158a991b.svg": "/static/media/white.158a991b.svg", - "static/media/white.16f4b162.svg": "/static/media/white.16f4b162.svg", - "static/media/white.1ca0dea7.svg": "/static/media/white.1ca0dea7.svg", - "static/media/white.20ca66ec.svg": "/static/media/white.20ca66ec.svg", - "static/media/white.341f0eae.svg": "/static/media/white.341f0eae.svg", - "static/media/white.41439910.svg": "/static/media/white.41439910.svg", - "static/media/white.4532ac56.svg": "/static/media/white.4532ac56.svg", - "static/media/white.460daa02.svg": "/static/media/white.460daa02.svg", - "static/media/white.4676bf59.svg": "/static/media/white.4676bf59.svg", - "static/media/white.47196e40.svg": "/static/media/white.47196e40.svg", - "static/media/white.51296906.svg": "/static/media/white.51296906.svg", - "static/media/white.5750bfd1.svg": "/static/media/white.5750bfd1.svg", - "static/media/white.5a37327b.svg": "/static/media/white.5a37327b.svg", - "static/media/white.5f161f2c.svg": "/static/media/white.5f161f2c.svg", - "static/media/white.636f4cd1.svg": "/static/media/white.636f4cd1.svg", - "static/media/white.6dd4c28a.svg": "/static/media/white.6dd4c28a.svg", - "static/media/white.81edd31f.svg": "/static/media/white.81edd31f.svg", - "static/media/white.8406a3ba.svg": "/static/media/white.8406a3ba.svg", - "static/media/white.87f75e06.svg": "/static/media/white.87f75e06.svg", - "static/media/white.8c4085b7.svg": "/static/media/white.8c4085b7.svg", - "static/media/white.8ccc4767.svg": "/static/media/white.8ccc4767.svg", - "static/media/white.958fe55d.svg": "/static/media/white.958fe55d.svg", - "static/media/white.9814829c.svg": "/static/media/white.9814829c.svg", - "static/media/white.9f2c5216.svg": "/static/media/white.9f2c5216.svg", - "static/media/white.b7754662.svg": "/static/media/white.b7754662.svg", - "static/media/white.bd0d7dca.svg": "/static/media/white.bd0d7dca.svg", - "static/media/white.cc7667ff.svg": "/static/media/white.cc7667ff.svg", - "static/media/white.e53d9d4a.svg": "/static/media/white.e53d9d4a.svg", - "static/media/white.e72682b5.svg": "/static/media/white.e72682b5.svg", - "static/media/white.e8851a0a.svg": "/static/media/white.e8851a0a.svg", - "static/media/white.f97c75d2.svg": "/static/media/white.f97c75d2.svg", - "static/media/white.fa4681e8.svg": "/static/media/white.fa4681e8.svg", - "static/media/white.fe6ed797.svg": "/static/media/white.fe6ed797.svg", - "static/media/zodiac-resized.70523fd1.svg": "/static/media/zodiac-resized.70523fd1.svg", - "static/media/zodiac-resized.c4907e4b.svg": "/static/media/zodiac-resized.c4907e4b.svg", - "static/media/zodiac.088002a2.svg": "/static/media/zodiac.088002a2.svg", - "static/media/zodiac.13543418.svg": "/static/media/zodiac.13543418.svg", - "static/media/zodiac.1806a875.svg": "/static/media/zodiac.1806a875.svg", - "static/media/zodiac.1bc04c23.svg": "/static/media/zodiac.1bc04c23.svg", - "static/media/zodiac.1bd00dea.svg": "/static/media/zodiac.1bd00dea.svg", - "static/media/zodiac.2fe856d5.svg": "/static/media/zodiac.2fe856d5.svg", - "static/media/zodiac.3b13c0b7.svg": "/static/media/zodiac.3b13c0b7.svg", - "static/media/zodiac.5547e32c.svg": "/static/media/zodiac.5547e32c.svg", - "static/media/zodiac.594ae9e7.svg": "/static/media/zodiac.594ae9e7.svg", - "static/media/zodiac.6cff3051.svg": "/static/media/zodiac.6cff3051.svg", - "static/media/zodiac.71910a69.svg": "/static/media/zodiac.71910a69.svg", - "static/media/zodiac.74570495.svg": "/static/media/zodiac.74570495.svg", - "static/media/zodiac.779a5bbc.svg": "/static/media/zodiac.779a5bbc.svg", - "static/media/zodiac.84e03611.svg": "/static/media/zodiac.84e03611.svg", - "static/media/zodiac.8bc58042.svg": "/static/media/zodiac.8bc58042.svg", - "static/media/zodiac.8c3f113c.svg": "/static/media/zodiac.8c3f113c.svg", - "static/media/zodiac.8c7b512b.svg": "/static/media/zodiac.8c7b512b.svg", - "static/media/zodiac.9be6e999.svg": "/static/media/zodiac.9be6e999.svg", - "static/media/zodiac.9cfc97dd.svg": "/static/media/zodiac.9cfc97dd.svg", - "static/media/zodiac.a976fef2.svg": "/static/media/zodiac.a976fef2.svg", - "static/media/zodiac.aa028a2c.svg": "/static/media/zodiac.aa028a2c.svg", - "static/media/zodiac.b27733af.svg": "/static/media/zodiac.b27733af.svg", - "static/media/zodiac.bb7722c5.svg": "/static/media/zodiac.bb7722c5.svg", - "static/media/zodiac.ce4a1545.svg": "/static/media/zodiac.ce4a1545.svg", - "static/media/zodiac.cfe5467c.svg": "/static/media/zodiac.cfe5467c.svg", - "static/media/zodiac.e161cf6b.svg": "/static/media/zodiac.e161cf6b.svg", - "static/media/zodiac.e181d06a.svg": "/static/media/zodiac.e181d06a.svg", - "static/media/zodiac.e42149ea.svg": "/static/media/zodiac.e42149ea.svg", - "static/media/zodiac.eea12e4f.svg": "/static/media/zodiac.eea12e4f.svg", - "static/media/zodiac.f3536991.svg": "/static/media/zodiac.f3536991.svg" - }, - "entrypoints": [ - "static/js/runtime-main.5b925903.js", - "static/js/2.4b3df17b.chunk.js", - "static/js/main.900511f9.chunk.js" - ] -} \ No newline at end of file diff --git a/public/assets/wizard/fullexample.commissions.png b/public/assets/wizard/fullexample.commissions.png deleted file mode 100644 index 92fbf325..00000000 Binary files a/public/assets/wizard/fullexample.commissions.png and /dev/null differ diff --git a/public/assets/wizard/fullexample.locale.png b/public/assets/wizard/fullexample.locale.png deleted file mode 100644 index 629c2bd2..00000000 Binary files a/public/assets/wizard/fullexample.locale.png and /dev/null differ diff --git a/public/assets/wizard/fullexample.twilio.png b/public/assets/wizard/fullexample.twilio.png deleted file mode 100644 index a8d44125..00000000 Binary files a/public/assets/wizard/fullexample.twilio.png and /dev/null differ diff --git a/public/assets/wizard/fullexample.wallet.png b/public/assets/wizard/fullexample.wallet.png deleted file mode 100644 index 328e7917..00000000 Binary files a/public/assets/wizard/fullexample.wallet.png and /dev/null differ diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index 762aa9c1..00000000 Binary files a/public/favicon.ico and /dev/null differ diff --git a/public/fonts/BPmono/BPmono.ttf b/public/fonts/BPmono/BPmono.ttf deleted file mode 100644 index 8b2ada92..00000000 Binary files a/public/fonts/BPmono/BPmono.ttf and /dev/null differ diff --git a/public/fonts/BPmono/BPmonoBold.ttf b/public/fonts/BPmono/BPmonoBold.ttf deleted file mode 100644 index c34b2976..00000000 Binary files a/public/fonts/BPmono/BPmonoBold.ttf and /dev/null differ diff --git a/public/fonts/BPmono/BPmonoItalic.ttf b/public/fonts/BPmono/BPmonoItalic.ttf deleted file mode 100644 index b158e12b..00000000 Binary files a/public/fonts/BPmono/BPmonoItalic.ttf and /dev/null differ diff --git a/public/fonts/MontHeavy/mont-bold-webfont.woff b/public/fonts/MontHeavy/mont-bold-webfont.woff deleted file mode 100644 index 85e11fa7..00000000 Binary files a/public/fonts/MontHeavy/mont-bold-webfont.woff and /dev/null differ diff --git a/public/fonts/MontHeavy/mont-bold-webfont.woff2 b/public/fonts/MontHeavy/mont-bold-webfont.woff2 deleted file mode 100644 index ddf8442d..00000000 Binary files a/public/fonts/MontHeavy/mont-bold-webfont.woff2 and /dev/null differ diff --git a/public/fonts/MontHeavy/mont-heavy-webfont.woff b/public/fonts/MontHeavy/mont-heavy-webfont.woff deleted file mode 100644 index f76db646..00000000 Binary files a/public/fonts/MontHeavy/mont-heavy-webfont.woff and /dev/null differ diff --git a/public/fonts/MontHeavy/mont-heavy-webfont.woff2 b/public/fonts/MontHeavy/mont-heavy-webfont.woff2 deleted file mode 100644 index 669b6671..00000000 Binary files a/public/fonts/MontHeavy/mont-heavy-webfont.woff2 and /dev/null differ diff --git a/public/fonts/MuseoSans/MuseoSans_500-webfont.woff b/public/fonts/MuseoSans/MuseoSans_500-webfont.woff deleted file mode 100644 index 02917c46..00000000 Binary files a/public/fonts/MuseoSans/MuseoSans_500-webfont.woff and /dev/null differ diff --git a/public/fonts/MuseoSans/MuseoSans_500-webfont.woff2 b/public/fonts/MuseoSans/MuseoSans_500-webfont.woff2 deleted file mode 100644 index c83e38a0..00000000 Binary files a/public/fonts/MuseoSans/MuseoSans_500-webfont.woff2 and /dev/null differ diff --git a/public/fonts/MuseoSans/MuseoSans_700-webfont.woff b/public/fonts/MuseoSans/MuseoSans_700-webfont.woff deleted file mode 100644 index e4d24406..00000000 Binary files a/public/fonts/MuseoSans/MuseoSans_700-webfont.woff and /dev/null differ diff --git a/public/fonts/MuseoSans/MuseoSans_700-webfont.woff2 b/public/fonts/MuseoSans/MuseoSans_700-webfont.woff2 deleted file mode 100644 index 1fda7253..00000000 Binary files a/public/fonts/MuseoSans/MuseoSans_700-webfont.woff2 and /dev/null differ diff --git a/public/fonts/Rubik/Rubik-Black.otf b/public/fonts/Rubik/Rubik-Black.otf deleted file mode 100644 index 9ec62f21..00000000 Binary files a/public/fonts/Rubik/Rubik-Black.otf and /dev/null differ diff --git a/public/fonts/Rubik/Rubik-Bold.otf b/public/fonts/Rubik/Rubik-Bold.otf deleted file mode 100644 index 4d7fc637..00000000 Binary files a/public/fonts/Rubik/Rubik-Bold.otf and /dev/null differ diff --git a/public/fonts/Rubik/Rubik-Medium.otf b/public/fonts/Rubik/Rubik-Medium.otf deleted file mode 100644 index 35c50c7c..00000000 Binary files a/public/fonts/Rubik/Rubik-Medium.otf and /dev/null differ diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 1199da1b..00000000 --- a/public/index.html +++ /dev/null @@ -1 +0,0 @@ -Lamassu Admin
diff --git a/public/manifest.json b/public/manifest.json deleted file mode 100644 index 1f2f141f..00000000 --- a/public/manifest.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} diff --git a/public/static/js/2.01291e3c.chunk.js b/public/static/js/2.01291e3c.chunk.js deleted file mode 100644 index 7fa7d2b2..00000000 --- a/public/static/js/2.01291e3c.chunk.js +++ /dev/null @@ -1,3 +0,0 @@ -/*! For license information please see 2.01291e3c.chunk.js.LICENSE.txt */ -(this["webpackJsonplamassu-admin"]=this["webpackJsonplamassu-admin"]||[]).push([[2],[function(t,e,n){"use strict";t.exports=n(607)},function(t,e,n){"use strict";t.exports=n(603)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(209);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}}(t,e)||Object(r.a)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(t,e,n){"use strict";n.d(e,"d",(function(){return ft})),n.d(e,"b",(function(){return dt})),n.d(e,"h",(function(){return wt})),n.d(e,"e",(function(){return Ot})),n.d(e,"f",(function(){return qt})),n.d(e,"a",(function(){return Gt})),n.d(e,"g",(function(){return H})),n.d(e,"c",(function(){return Yt}));var r,i,o=n(47),a=n(45),u=n(46);try{r=Map}catch(Qt){}try{i=Set}catch(Qt){}function s(t,e,n){if(!t||"object"!==typeof t||"function"===typeof t)return t;if(t.nodeType&&"cloneNode"in t)return t.cloneNode(!0);if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t);if(Array.isArray(t))return t.map(c);if(r&&t instanceof r)return new Map(Array.from(t.entries()));if(i&&t instanceof i)return new Set(Array.from(t.values()));if(t instanceof Object){e.push(t);var o=Object.create(t);for(var a in n.push(o),t){var u=e.findIndex((function(e){return e===t[a]}));o[a]=u>-1?n[u]:s(t[a],e,n)}return o}return t}function c(t){return s(t,[],[])}var f=Object.prototype.toString,l=Error.prototype.toString,d=RegExp.prototype.toString,h="undefined"!==typeof Symbol?Symbol.prototype.toString:function(){return""},p=/^Symbol\((.*)\)(.*)$/;function g(t){return t!=+t?"NaN":0===t&&1/t<0?"-0":""+t}function m(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null==t||!0===t||!1===t)return""+t;var n=typeof t;if("number"===n)return g(t);if("string"===n)return e?'"'.concat(t,'"'):t;if("function"===n)return"[Function "+(t.name||"anonymous")+"]";if("symbol"===n)return h.call(t).replace(p,"Symbol($1)");var r=f.call(t).slice(8,-1);return"Date"===r?isNaN(t.getTime())?""+t:t.toISOString(t):"Error"===r||t instanceof Error?"["+l.call(t)+"]":"RegExp"===r?d.call(t):null}function b(t,e){var n=m(t,e);return null!==n?n:JSON.stringify(t,(function(t,n){var r=m(this[t],e);return null!==r?r:n}),2)}var v={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:function(t){var e=t.path,n=t.type,r=t.value,i=t.originalValue,o=null!=i&&i!==r,a="".concat(e," must be a `").concat(n,"` type, ")+"but the final value was: `".concat(b(r,!0),"`")+(o?" (cast from the value `".concat(b(i,!0),"`)."):".");return null===r&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},y={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},_={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},w={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},S={isValue:"${path} field must be ${value}"},O={noUnknown:"${path} field has unspecified keys: ${unknown}"},x={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"},E=(Object.assign(Object.create(null),{mixed:v,string:y,number:_,date:w,object:O,array:x,boolean:S}),n(189)),M=n.n(E),T=function(t){return t&&t.__isYupSchema__},$=function(){function t(e,n){if(Object(a.a)(this,t),this.refs=e,this.refs=e,"function"!==typeof n){if(!M()(n,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");var r=n.is,i=n.then,o=n.otherwise,u="function"===typeof r?r:function(){for(var t=arguments.length,e=new Array(t),n=0;n1?"".concat(s.errors.length," errors occurred"):s.errors[0],Error.captureStackTrace&&Error.captureStackTrace(Object(A.a)(s),n),s}return Object(u.a)(n,null,[{key:"formatError",value:function(t,e){var n=e.label||e.path||"this";return n!==e.path&&(e=N({},e,{path:n})),"string"===typeof t?t.replace(R,(function(t,n){return b(e[n])})):"function"===typeof t?t(e):t}},{key:"isError",value:function(t){return t&&"ValidationError"===t.name}}]),n}(Object(I.a)(Error));function D(t,e){var n=t.endEarly,r=t.tests,i=t.args,a=t.value,u=t.errors,s=t.sort,c=t.path,f=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(e),l=r.length,d=[];if(u=u||[],!l)return u.length?f(new j(u,a,c)):f(null,a);for(var h=0;h1&&void 0!==arguments[1]?arguments[1]:{};if(Object(a.a)(this,t),"string"!==typeof e)throw new TypeError("ref must be a string, got: "+e);if(this.key=e.trim(),""===e)throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===U,this.isValue=this.key[0]===z,this.isSibling=!this.isContext&&!this.isValue;var r=this.isContext?U:this.isValue?z:"";this.path=this.key.slice(r.length),this.getter=this.path&&Object(B.getter)(this.path,!0),this.map=n.map}return Object(u.a)(t,[{key:"getValue",value:function(t,e,n){var r=this.isContext?n:this.isValue?t:e;return this.getter&&(r=this.getter(r||{})),this.map&&(r=this.map(r)),r}},{key:"cast",value:function(t,e){return this.getValue(t,null==e?void 0:e.parent,null==e?void 0:e.context)}},{key:"resolve",value:function(){return this}},{key:"describe",value:function(){return{type:"ref",key:this.key}}},{key:"toString",value:function(){return"Ref(".concat(this.key,")")}}],[{key:"isRef",value:function(t){return t&&t.__isYupRef}}]),t}();function q(){return(q=Object.assign||function(t){for(var e=1;e=0||(i[n]=t[n]);return i}(e,["value","path","label","options","originalValue","sync"]),l=t.name,d=t.test,h=t.params,p=t.message,g=u.parent,m=u.context;function b(t){return V.isRef(t)?t.getValue(r,g,m):t}function v(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=F()(q({value:r,originalValue:s,label:a,path:t.path||o},h,t.params),b),n=new j(j.formatError(t.message||p,e),r,e.path,t.type||l);return n.params=e,n}var y=q({path:o,parent:g,type:l,createError:v,resolve:b,options:u,originalValue:s},f);if(c){var _;try{var w;if("function"===typeof(null==(w=_=d.call(y,r,y))?void 0:w.then))throw new Error('Validation test of type: "'.concat(y.type,'" returned a Promise during a synchronous validate. ')+"This test will finish after the validate call has returned")}catch(S){return void n(S)}j.isError(_)?n(_):_?n(null,_):n(v())}else try{Promise.resolve(d.call(y,r,y)).then((function(t){j.isError(t)?n(t):t?n(null,t):n(v())}))}catch(S){n(S)}}return e.OPTIONS=t,e}V.prototype.__isYupRef=!0;var G=function(t){return t.substr(0,t.length-1).substr(1)};function K(t,e,n){var r,i,o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n;return e?(Object(B.forEach)(e,(function(u,s,c){var f=s?G(u):u;if((t=t.resolve({context:a,parent:r,value:n})).innerType){var l=c?parseInt(f,10):0;if(n&&l>=n.length)throw new Error("Yup.reach cannot resolve an array item at index: ".concat(u,", in the path: ").concat(e,". ")+"because there is no value at that index. ");r=n,n=n&&n[l],t=t.innerType}if(!c){if(!t.fields||!t.fields[f])throw new Error("The schema does not contain the path: ".concat(e,". ")+"(failed at: ".concat(o,' which is a type: "').concat(t._type,'")'));r=n,n=n&&n[f],t=t.fields[f]}i=f,o=s?"["+u+"]":"."+u})),{schema:t,parent:r,parentPath:i}):{parent:r,parentPath:e,schema:t}}var Y=n(2),Z=n(23),Q=function(){function t(){Object(a.a)(this,t),this.list=new Set,this.refs=new Map}return Object(u.a)(t,[{key:"size",get:function(){return this.list.size+this.refs.size}},{key:"describe",value:function(){var t,e=[],n=Object(Z.a)(this.list);try{for(n.s();!(t=n.n()).done;){var r=t.value;e.push(r)}}catch(u){n.e(u)}finally{n.f()}var i,o=Object(Z.a)(this.refs);try{for(o.s();!(i=o.n()).done;){var a=Object(Y.a)(i.value,2)[1];e.push(a.describe())}}catch(u){o.e(u)}finally{o.f()}return e}},{key:"toArray",value:function(){return Array.from(this.list).concat(Array.from(this.refs.values()))}},{key:"add",value:function(t){V.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}},{key:"delete",value:function(t){V.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}},{key:"has",value:function(t,e){if(this.list.has(t))return!0;for(var n,r=this.refs.values();!(n=r.next()).done;)if(e(n.value)===t)return!0;return!1}},{key:"clone",value:function(){var e=new t;return e.list=new Set(this.list),e.refs=new Map(this.refs),e}},{key:"merge",value:function(t,e){var n=this.clone();return t.list.forEach((function(t){return n.add(t)})),t.refs.forEach((function(t){return n.add(t)})),e.list.forEach((function(t){return n.delete(t)})),e.refs.forEach((function(t){return n.delete(t)})),n}}]),t}();function X(){return(X=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},n=this.resolve(X({value:t},e)),r=n._cast(t,e);if(void 0!==t&&!1!==e.assert&&!0!==n.isType(r)){var i=b(t),o=b(r);throw new TypeError("The value of ".concat(e.path||"field"," could not be cast to a value ")+'that satisfies the schema type: "'.concat(n._type,'". \n\n')+"attempted value: ".concat(i," \n")+(o!==i?"result of cast: ".concat(o):""))}return r}},{key:"_cast",value:function(t,e){var n=this,r=void 0===t?t:this.transforms.reduce((function(e,r){return r.call(n,e,t,n)}),t);return void 0===r&&(r=this.getDefault()),r}},{key:"_validate",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,i=n.sync,o=n.path,a=n.from,u=void 0===a?[]:a,s=n.originalValue,c=void 0===s?t:s,f=n.strict,l=void 0===f?this.spec.strict:f,d=n.abortEarly,h=void 0===d?this.spec.abortEarly:d,p=t;l||(p=this._cast(p,X({assert:!1},n)));var g={value:p,path:o,options:n,originalValue:c,schema:this,label:this.spec.label,sync:i,from:u},m=[];this._typeError&&m.push(this._typeError),this._whitelistError&&m.push(this._whitelistError),this._blacklistError&&m.push(this._blacklistError),D({args:g,value:p,path:o,sync:i,tests:m,endEarly:h},(function(t){t?r(t,p):D({tests:e.tests,args:g,path:o,sync:i,value:p,endEarly:h},r)}))}},{key:"validate",value:function(t,e,n){var r=this.resolve(X({},e,{value:t}));return"function"===typeof n?r._validate(t,e,n):new Promise((function(n,i){return r._validate(t,e,(function(t,e){t?i(t):n(e)}))}))}},{key:"validateSync",value:function(t,e){var n;return this.resolve(X({},e,{value:t}))._validate(t,X({},e,{sync:!0}),(function(t,e){if(t)throw t;n=e})),n}},{key:"isValid",value:function(t,e){return this.validate(t,e).then((function(){return!0}),(function(t){if(j.isError(t))return!1;throw t}))}},{key:"isValidSync",value:function(t,e){try{return this.validateSync(t,e),!0}catch(n){if(j.isError(n))return!1;throw n}}},{key:"_getDefault",value:function(){var t=this.spec.default;return null==t?t:"function"===typeof t?t.call(this):c(t)}},{key:"getDefault",value:function(t){return this.resolve(t||{})._getDefault()}},{key:"default",value:function(t){if(0===arguments.length)return this._getDefault();var e=this.clone({default:t});return e}},{key:"strict",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.clone();return e.spec.strict=t,e}},{key:"_isPresent",value:function(t){return null!=t}},{key:"defined",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.defined;return this.test({message:t,name:"defined",exclusive:!0,test:function(t){return void 0!==t}})}},{key:"required",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v.required;return this.clone({presence:"required"}).withMutation((function(e){return e.test({message:t,name:"required",exclusive:!0,test:function(t){return this.schema._isPresent(t)}})}))}},{key:"notRequired",value:function(){var t=this.clone({presence:"optional"});return t.tests=t.tests.filter((function(t){return"required"!==t.OPTIONS.name})),t}},{key:"nullable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.clone({nullable:!1!==t});return e}},{key:"transform",value:function(t){var e=this.clone();return e.transforms.push(t),e}},{key:"test",value:function(){var t;if(void 0===(t=1===arguments.length?"function"===typeof(arguments.length<=0?void 0:arguments[0])?{test:arguments.length<=0?void 0:arguments[0]}:arguments.length<=0?void 0:arguments[0]:2===arguments.length?{name:arguments.length<=0?void 0:arguments[0],test:arguments.length<=1?void 0:arguments[1]}:{name:arguments.length<=0?void 0:arguments[0],message:arguments.length<=1?void 0:arguments[1],test:arguments.length<=2?void 0:arguments[2]}).message&&(t.message=v.default),"function"!==typeof t.test)throw new TypeError("`test` is a required parameters");var e=this.clone(),n=W(t),r=t.exclusive||t.name&&!0===e.exclusiveTests[t.name];if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(e.exclusiveTests[t.name]=!!t.exclusive),e.tests=e.tests.filter((function(e){if(e.OPTIONS.name===t.name){if(r)return!1;if(e.OPTIONS.test===n.OPTIONS.test)return!1}return!0})),e.tests.push(n),e}},{key:"when",value:function(t,e){Array.isArray(t)||"string"===typeof t||(e=t,t=".");var n=this.clone(),r=P(t).map((function(t){return new V(t)}));return r.forEach((function(t){t.isSibling&&n.deps.push(t.key)})),n.conditions.push(new $(r,e)),n}},{key:"typeError",value:function(t){var e=this.clone();return e._typeError=W({message:t,name:"typeError",test:function(t){return!(void 0!==t&&!this.schema.isType(t))||this.createError({params:{type:this.schema._type}})}}),e}},{key:"oneOf",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v.oneOf,n=this.clone();return t.forEach((function(t){n._whitelist.add(t),n._blacklist.delete(t)})),n._whitelistError=W({message:e,name:"oneOf",test:function(t){if(void 0===t)return!0;var e=this.schema._whitelist;return!!e.has(t,this.resolve)||this.createError({params:{values:e.toArray().join(", ")}})}}),n}},{key:"notOneOf",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v.notOneOf,n=this.clone();return t.forEach((function(t){n._blacklist.add(t),n._whitelist.delete(t)})),n._blacklistError=W({message:e,name:"notOneOf",test:function(t){var e=this.schema._blacklist;return!e.has(t,this.resolve)||this.createError({params:{values:e.toArray().join(", ")}})}}),n}},{key:"strip",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=this.clone();return e.spec.strip=t,e}},{key:"describe",value:function(){var t=this.clone(),e=t.spec,n=e.label;return{meta:e.meta,label:n,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map((function(t){return{name:t.OPTIONS.name,params:t.OPTIONS.params}})).filter((function(t,e,n){return n.findIndex((function(e){return e.name===t.name}))===e}))}}}]),t}();J.prototype.__isYupSchema__=!0;for(var tt=function(){var t=nt[et];J.prototype["".concat(t,"At")]=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=K(this,e,n,r.context),o=i.parent,a=i.parentPath,u=i.schema;return u[t](o&&o[a],X({},r,{parent:o,path:e}))}},et=0,nt=["validate","validateSync"];et0&&void 0!==arguments[0]?arguments[0]:S.isValue;return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"true"},test:function(t){return lt(t)||!0===t}})}},{key:"isFalse",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:S.isValue;return this.test({message:t,name:"is-value",exclusive:!0,params:{value:"false"},test:function(t){return lt(t)||!1===t}})}}]),n}(J);dt.prototype=ht.prototype;var pt=n(62),gt=n(51),mt=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,bt=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,vt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,yt=function(t){return lt(t)||t===t.trim()},_t={}.toString();function wt(){return new St}var St=function(t){Object(k.a)(n,t);var e=Object(C.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.call(this,{type:"string"})).withMutation((function(){t.transform((function(t){if(this.isType(t))return t;if(Array.isArray(t))return t;var e=null!=t&&t.toString?t.toString():t;return e===_t?t:e}))})),t}return Object(u.a)(n,[{key:"_typeCheck",value:function(t){return t instanceof String&&(t=t.valueOf()),"string"===typeof t}},{key:"_isPresent",value:function(t){return Object(pt.a)(Object(gt.a)(n.prototype),"_isPresent",this).call(this,t)&&!!t.length}},{key:"length",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.length;return this.test({message:e,name:"length",exclusive:!0,params:{length:t},test:function(e){return lt(e)||e.length===this.resolve(t)}})}},{key:"min",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.min;return this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(e){return lt(e)||e.length>=this.resolve(t)}})}},{key:"max",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:y.max;return this.test({name:"max",exclusive:!0,message:e,params:{max:t},test:function(e){return lt(e)||e.length<=this.resolve(t)}})}},{key:"matches",value:function(t,e){var n,r,i=!1;if(e)if("object"===typeof e){var o=e.excludeEmptyString;i=void 0!==o&&o,n=e.message,r=e.name}else n=e;return this.test({name:r||"matches",message:n||y.matches,params:{regex:t},test:function(e){return lt(e)||""===e&&i||-1!==e.search(t)}})}},{key:"email",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.email;return this.matches(mt,{name:"email",message:t,excludeEmptyString:!0})}},{key:"url",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.url;return this.matches(bt,{name:"url",message:t,excludeEmptyString:!0})}},{key:"uuid",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.uuid;return this.matches(vt,{name:"uuid",message:t,excludeEmptyString:!1})}},{key:"ensure",value:function(){return this.default("").transform((function(t){return null===t?"":t}))}},{key:"trim",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.trim;return this.transform((function(t){return null!=t?t.trim():t})).test({message:t,name:"trim",test:yt})}},{key:"lowercase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.lowercase;return this.transform((function(t){return lt(t)?t:t.toLowerCase()})).test({message:t,name:"string_case",exclusive:!0,test:function(t){return lt(t)||t===t.toLowerCase()}})}},{key:"uppercase",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y.uppercase;return this.transform((function(t){return lt(t)?t:t.toUpperCase()})).test({message:t,name:"string_case",exclusive:!0,test:function(t){return lt(t)||t===t.toUpperCase()}})}}]),n}(J);wt.prototype=St.prototype;function Ot(){return new xt}var xt=function(t){Object(k.a)(n,t);var e=Object(C.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.call(this,{type:"number"})).withMutation((function(){t.transform((function(t){var e=t;if("string"===typeof e){if(""===(e=e.replace(/\s/g,"")))return NaN;e=+e}return this.isType(e)?e:parseFloat(e)}))})),t}return Object(u.a)(n,[{key:"_typeCheck",value:function(t){return t instanceof Number&&(t=t.valueOf()),"number"===typeof t&&!function(t){return t!=+t}(t)}},{key:"min",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_.min;return this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(e){return lt(e)||e>=this.resolve(t)}})}},{key:"max",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_.max;return this.test({message:e,name:"max",exclusive:!0,params:{max:t},test:function(e){return lt(e)||e<=this.resolve(t)}})}},{key:"lessThan",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_.lessThan;return this.test({message:e,name:"max",exclusive:!0,params:{less:t},test:function(e){return lt(e)||e1&&void 0!==arguments[1]?arguments[1]:_.moreThan;return this.test({message:e,name:"min",exclusive:!0,params:{more:t},test:function(e){return lt(e)||e>this.resolve(t)}})}},{key:"positive",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.positive;return this.moreThan(0,t)}},{key:"negative",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.negative;return this.lessThan(0,t)}},{key:"integer",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_.integer;return this.test({name:"integer",message:t,test:function(t){return lt(t)||Number.isInteger(t)}})}},{key:"truncate",value:function(){return this.transform((function(t){return lt(t)?t:0|t}))}},{key:"round",value:function(t){var e,n=["ceil","floor","round","trunc"];if("trunc"===(t=(null==(e=t)?void 0:e.toLowerCase())||"round"))return this.truncate();if(-1===n.indexOf(t.toLowerCase()))throw new TypeError("Only valid options for round() are: "+n.join(", "));return this.transform((function(e){return lt(e)?e:Math[t](e)}))}}]),n}(J);Ot.prototype=xt.prototype;var Et=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;var Mt=new Date("");function Tt(){return new $t}var $t=function(t){Object(k.a)(n,t);var e=Object(C.a)(n);function n(){var t;return Object(a.a)(this,n),(t=e.call(this,{type:"date"})).withMutation((function(){t.transform((function(t){return this.isType(t)?t:(t=function(t){var e,n,r=[1,4,5,6,7,10,11],i=0;if(n=Et.exec(t)){for(var o,a=0;o=r[a];++a)n[o]=+n[o]||0;n[2]=(+n[2]||1)-1,n[3]=+n[3]||1,n[7]=n[7]?String(n[7]).substr(0,3):0,void 0!==n[8]&&""!==n[8]||void 0!==n[9]&&""!==n[9]?("Z"!==n[8]&&void 0!==n[9]&&(i=60*n[10]+n[11],"+"===n[9]&&(i=0-i)),e=Date.UTC(n[1],n[2],n[3],n[4],n[5]+i,n[6],n[7])):e=+new Date(n[1],n[2],n[3],n[4],n[5],n[6],n[7])}else e=Date.parse?Date.parse(t):NaN;return e}(t),isNaN(t)?Mt:new Date(t))}))})),t}return Object(u.a)(n,[{key:"_typeCheck",value:function(t){return e=t,"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(t.getTime());var e}},{key:"prepareParam",value:function(t,e){var n;if(V.isRef(t))n=t;else{var r=this.cast(t);if(!this._typeCheck(r))throw new TypeError("`".concat(e,"` must be a Date or a value that can be `cast()` to a Date"));n=r}return n}},{key:"min",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w.min,n=this.prepareParam(t,"min");return this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(t){return lt(t)||t>=this.resolve(n)}})}},{key:"max",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:w.max,n=this.prepareParam(t,"max");return this.test({message:e,name:"max",exclusive:!0,params:{max:t},test:function(t){return lt(t)||t<=this.resolve(n)}})}}]),n}(J);$t.INVALID_DATE=Mt,Tt.prototype=$t.prototype,Tt.INVALID_DATE=Mt;var At=n(397),kt=n.n(At),Ct=n(539),It=n.n(Ct),Pt=n(540),Nt=n.n(Pt),Rt=n(541),jt=n.n(Rt);function Dt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=[];function i(t,i){var o=Object(B.split)(t)[0];~r.indexOf(o)||r.push(o),~e.indexOf("".concat(i,"-").concat(o))||n.push([i,o])}var o=function(e){if(M()(t,e)){var n=t[e];~r.indexOf(e)||r.push(e),V.isRef(n)&&n.isSibling?i(n.path,e):T(n)&&"deps"in n&&n.deps.forEach((function(t){return i(t,e)}))}};for(var a in t)o(a);return jt.a.array(r,n).reverse()}function Lt(t,e){var n=1/0;return t.some((function(t,r){var i;if(-1!==(null==(i=e.path)?void 0:i.indexOf(t)))return n=r,!0})),n}function Ft(t){return function(e,n){return Lt(t,e)-Lt(t,n)}}function Bt(){return(Bt=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},o=Object(pt.a)(Object(gt.a)(n.prototype),"_cast",this).call(this,t,i);if(void 0===o)return this.getDefault();if(!this._typeCheck(o))return o;var a,u=this.fields,s=null!=(e=i.stripUnknown)?e:this.spec.noUnknown,c=this._nodes.concat(Object.keys(o).filter((function(t){return-1===r._nodes.indexOf(t)}))),f={},l=Bt({},i,{parent:f,__validating:i.__validating||!1}),d=!1,h=Object(Z.a)(c);try{for(h.s();!(a=h.n()).done;){var p=a.value,g=u[p],m=M()(o,p);if(g){var b=void 0,v=o[p];l.path=(i.path?"".concat(i.path,"."):"")+p;var y="spec"in(g=g.resolve({value:v,context:i.context,parent:f}))?g.spec:void 0,_=null==y?void 0:y.strict;if(null==y?void 0:y.strip){d=d||p in o;continue}void 0!==(b=i.__validating&&_?o[p]:g.cast(o[p],l))&&(f[p]=b)}else m&&!s&&(f[p]=o[p]);f[p]!==o[p]&&(d=!0)}}catch(w){h.e(w)}finally{h.f()}return d?f:o}},{key:"_validate",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0,a=[],u=r.sync,s=r.from,c=void 0===s?[]:s,f=r.originalValue,l=void 0===f?t:f,d=r.abortEarly,h=void 0===d?this.spec.abortEarly:d,p=r.recursive,g=void 0===p?this.spec.recursive:p;c=[{schema:this,value:l}].concat(Object(o.a)(c)),r.__validating=!0,r.originalValue=l,r.from=c,Object(pt.a)(Object(gt.a)(n.prototype),"_validate",this).call(this,t,r,(function(t,n){if(t){if(!j.isError(t)||h)return void i(t,n);a.push(t)}if(g&&Ut(n)){l=l||n;var o=e._nodes.map((function(t){return function(i,o){var a=-1===t.indexOf(".")?(r.path?"".concat(r.path,"."):"")+t:"".concat(r.path||"",'["').concat(t,'"]'),u=e.fields[t];u&&"validate"in u?u.validate(n[t],Bt({},r,{path:a,from:c,strict:!0,parent:n,originalValue:l[t]}),o):o(null)}}));D({sync:u,tests:o,value:n,errors:a,endEarly:h,sort:e._sortErrors,path:r.path},i)}else i(a[0]||null,n)}))}},{key:"clone",value:function(t){var e=Object(pt.a)(Object(gt.a)(n.prototype),"clone",this).call(this,t);return e.fields=Bt({},this.fields),e._nodes=this._nodes,e._excludedEdges=this._excludedEdges,e._sortErrors=this._sortErrors,e}},{key:"concat",value:function(t){for(var e=Object(pt.a)(Object(gt.a)(n.prototype),"concat",this).call(this,t),r=e.fields,i=0,o=Object.entries(this.fields);i1&&void 0!==arguments[1]?arguments[1]:[],n=this.clone(),r=Object.assign(n.fields,t);if(n.fields=r,n._sortErrors=Ft(Object.keys(r)),e.length){Array.isArray(e[0])||(e=[e]);var i=e.map((function(t){var e=Object(Y.a)(t,2),n=e[0],r=e[1];return"".concat(n,"-").concat(r)}));n._excludedEdges=n._excludedEdges.concat(i)}return n._nodes=Dt(r,n._excludedEdges),n}},{key:"pick",value:function(t){var e,n={},r=Object(Z.a)(t);try{for(r.s();!(e=r.n()).done;){var i=e.value;this.fields[i]&&(n[i]=this.fields[i])}}catch(o){r.e(o)}finally{r.f()}return this.clone().withMutation((function(t){return t.fields={},t.shape(n)}))}},{key:"omit",value:function(t){var e=this.clone(),n=e.fields;e.fields={};var r,i=Object(Z.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;delete n[o]}}catch(a){i.e(a)}finally{i.f()}return e.withMutation((function(){return e.shape(n)}))}},{key:"from",value:function(t,e,n){var r=Object(B.getter)(t,!0);return this.transform((function(i){if(null==i)return i;var o=i;return M()(i,t)&&(o=Bt({},i),n||delete o[t],o[e]=r(i)),o}))}},{key:"noUnknown",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:O.noUnknown;"string"===typeof t&&(e=t,t=!0);var n=this.test({name:"noUnknown",exclusive:!0,message:e,test:function(e){if(null==e)return!0;var n=zt(this.schema,e);return!t||0===n.length||this.createError({params:{unknown:n.join(", ")}})}});return n.spec.noUnknown=t,n}},{key:"unknown",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:O.noUnknown;return this.noUnknown(!t,e)}},{key:"transformKeys",value:function(t){return this.transform((function(e){return e&&Nt()(e,(function(e,n){return t(n)}))}))}},{key:"camelCase",value:function(){return this.transformKeys(It.a)}},{key:"snakeCase",value:function(){return this.transformKeys(kt.a)}},{key:"constantCase",value:function(){return this.transformKeys((function(t){return kt()(t).toUpperCase()}))}},{key:"describe",value:function(){var t=Object(pt.a)(Object(gt.a)(n.prototype),"describe",this).call(this);return t.fields=F()(this.fields,(function(t){return t.describe()})),t}}]),n}(J);function qt(t){return new Vt(t)}function Wt(){return(Wt=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2?arguments[2]:void 0,u=[],s=o.sync,c=o.path,f=this.innerType,l=null!=(e=o.abortEarly)?e:this.spec.abortEarly,d=null!=(r=o.recursive)?r:this.spec.recursive,h=null!=o.originalValue?o.originalValue:t;Object(pt.a)(Object(gt.a)(n.prototype),"_validate",this).call(this,t,o,(function(t,e){if(t){if(!j.isError(t)||l)return void a(t,e);u.push(t)}if(d&&f&&i._typeCheck(e)){h=h||e;for(var n=new Array(e.length),r=function(t){var r=e[t],i="".concat(o.path||"","[").concat(t,"]"),a=Wt({},o,{path:i,strict:!0,parent:e,index:t,originalValue:h[t]});n[t]=function(t,e){return f.validate(r,a,e)}},p=0;p1&&void 0!==arguments[1]?arguments[1]:x.length;return this.test({message:e,name:"length",exclusive:!0,params:{length:t},test:function(e){return lt(e)||e.length===this.resolve(t)}})}},{key:"min",value:function(t,e){return e=e||x.min,this.test({message:e,name:"min",exclusive:!0,params:{min:t},test:function(e){return lt(e)||e.length>=this.resolve(t)}})}},{key:"max",value:function(t,e){return e=e||x.max,this.test({message:e,name:"max",exclusive:!0,params:{max:t},test:function(e){return lt(e)||e.length<=this.resolve(t)}})}},{key:"ensure",value:function(){var t=this;return this.default((function(){return[]})).transform((function(e,n){return t._typeCheck(e)?e:null==n?[]:[].concat(n)}))}},{key:"compact",value:function(t){var e=t?function(e,n,r){return!t(e,n,r)}:function(t){return!!t};return this.transform((function(t){return null!=t?t.filter(e):t}))}},{key:"describe",value:function(){var t=Object(pt.a)(Object(gt.a)(n.prototype),"describe",this).call(this);return this.innerType&&(t.innerType=this.innerType.describe()),t}},{key:"nullable",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Object(pt.a)(Object(gt.a)(n.prototype),"nullable",this).call(this,t)}},{key:"defined",value:function(){return Object(pt.a)(Object(gt.a)(n.prototype),"defined",this).call(this)}},{key:"required",value:function(t){return Object(pt.a)(Object(gt.a)(n.prototype),"required",this).call(this,t)}}]),n}(J);function Yt(t){return new Zt(t)}Gt.prototype=Kt.prototype;var Zt=function(){function t(e){var n=this;Object(a.a)(this,t),this.type="lazy",this.__isYupSchema__=!0,this._resolve=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.builder(t,e);if(!T(r))throw new TypeError("lazy() functions must return a valid schema");return r.resolve(e)},this.builder=e}return Object(u.a)(t,[{key:"resolve",value:function(t){return this._resolve(t.value,t)}},{key:"cast",value:function(t,e){return this._resolve(t,e).cast(t,e)}},{key:"validate",value:function(t,e,n){return this._resolve(t,e).validate(t,e,n)}},{key:"validateSync",value:function(t,e){return this._resolve(t,e).validateSync(t,e)}},{key:"validateAt",value:function(t,e,n){return this._resolve(e,n).validateAt(t,e,n)}},{key:"validateSyncAt",value:function(t,e,n){return this._resolve(e,n).validateSyncAt(t,e,n)}},{key:"describe",value:function(){return null}},{key:"isValid",value:function(t,e){return this._resolve(t,e).isValid(t,e)}},{key:"isValidSync",value:function(t,e){return this._resolve(t,e).isValidSync(t,e)}}]),t}()},function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e0&&(c=new a.b({graphQLErrors:s})),t=Object(i.a)(Object(i.a)({},t),{loading:r,networkStatus:u,error:c,called:!0}),r){var l=this.previousData.result&&this.previousData.result.data;t.data=l&&f?Object(i.a)(Object(i.a)({},l),f):l||f}else if(c)Object.assign(t,{data:(this.currentObservable.query.getLastResult()||{}).data});else{var d=this.currentObservable.query.options.fetchPolicy;if(e.partialRefetch&&!f&&o&&"cache-only"!==d)return Object.assign(t,{loading:!0,networkStatus:a.c.loading}),t.refetch(),t;t.data=f}}return t.client=this.client,this.previousData.loading=this.previousData.result&&this.previousData.result.loading||!1,this.previousData.result=t,this.currentObservable.query&&this.currentObservable.query.resetQueryStoreErrors(),t},e.prototype.handleErrorOrCompleted=function(){if(this.currentObservable.query&&this.previousData.result){var t=this.previousData.result,e=t.data,n=t.loading,r=t.error;if(!n){var i=this.getOptions(),o=i.query,a=i.variables,s=i.onCompleted,c=i.onError;if(this.previousOptions&&!this.previousData.loading&&Object(u.a)(this.previousOptions.query,o)&&Object(u.a)(this.previousOptions.variables,a))return;s&&!r?s(e):c&&r&&c(r)}}},e.prototype.removeQuerySubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)},e.prototype.observableQueryFields=function(){return{variables:this.currentObservable.query.variables,refetch:this.obsRefetch,fetchMore:this.obsFetchMore,updateQuery:this.obsUpdateQuery,startPolling:this.obsStartPolling,stopPolling:this.obsStopPolling,subscribeToMore:this.obsSubscribeToMore}},e}(c);function l(t,e,n){void 0===n&&(n=!1);var a=Object(o.useContext)(Object(r.c)()),s=Object(o.useReducer)((function(t){return t+1}),0),c=s[0],l=s[1],d=e?Object(i.a)(Object(i.a)({},e),{query:t}):{query:t},h=Object(o.useRef)(),p=h.current||new f({options:d,context:a,onNewData:function(){p.ssrInitiated()?l():Promise.resolve().then(l)}});p.setOptions(d),p.context=a,p.ssrInitiated()&&!h.current&&(h.current=p);var g=function(t,e){var n=Object(o.useRef)();return n.current&&Object(u.a)(e,n.current.key)||(n.current={key:e,value:t()}),n.current.value}((function(){return n?p.executeLazy():p.execute()}),{options:Object(i.a)(Object(i.a)({},d),{onError:void 0,onCompleted:void 0}),context:a,tick:c}),m=n?g[1]:g;return Object(o.useEffect)((function(){return h.current||(h.current=p),function(){return p.cleanup()}}),[]),Object(o.useEffect)((function(){return p.afterExecute({lazy:n})}),[m.loading,m.networkStatus,m.error,m.data]),g}function d(t,e){return l(t,e,!1)}function h(t,e){return l(t,e,!0)}var p=function(t){function e(e){var n=e.options,i=e.context,o=e.result,a=e.setResult,u=t.call(this,n,i)||this;return u.runMutation=function(t){void 0===t&&(t={}),u.onMutationStart();var e=u.generateNewMutationId();return u.mutate(t).then((function(t){return u.onMutationCompleted(t,e),t})).catch((function(t){if(u.onMutationError(t,e),!u.getOptions().onError)throw t}))},u.verifyDocumentType(n.mutation,r.b.Mutation),u.result=o,u.setResult=a,u.mostRecentMutationId=0,u}return Object(i.c)(e,t),e.prototype.execute=function(t){return this.isMounted=!0,this.verifyDocumentType(this.getOptions().mutation,r.b.Mutation),t.client=this.refreshClient().client,[this.runMutation,t]},e.prototype.afterExecute=function(){return this.isMounted=!0,this.unmount.bind(this)},e.prototype.cleanup=function(){},e.prototype.mutate=function(t){var e=this.getOptions(),n=e.mutation,r=e.variables,o=e.optimisticResponse,a=e.update,u=e.context,s=void 0===u?{}:u,c=e.awaitRefetchQueries,f=void 0!==c&&c,l=e.fetchPolicy,d=Object(i.a)({},t),h=Object.assign({},r,d.variables);return delete d.variables,this.refreshClient().client.mutate(Object(i.a)({mutation:n,optimisticResponse:o,refetchQueries:d.refetchQueries||this.getOptions().refetchQueries,awaitRefetchQueries:f,update:a,context:s,fetchPolicy:l,variables:h},d))},e.prototype.onMutationStart=function(){this.result.loading||this.getOptions().ignoreResults||this.updateResult({loading:!0,error:void 0,data:void 0,called:!0})},e.prototype.onMutationCompleted=function(t,e){var n=this.getOptions(),r=n.onCompleted,i=n.ignoreResults,o=t.data,u=t.errors,s=u&&u.length>0?new a.b({graphQLErrors:u}):void 0;this.isMostRecentMutation(e)&&!i&&this.updateResult({called:!0,loading:!1,data:o,error:s}),r&&r(o)},e.prototype.onMutationError=function(t,e){var n=this.getOptions().onError;this.isMostRecentMutation(e)&&this.updateResult({loading:!1,error:t,data:void 0,called:!0}),n&&n(t)},e.prototype.generateNewMutationId=function(){return++this.mostRecentMutationId},e.prototype.isMostRecentMutation=function(t){return this.mostRecentMutationId===t},e.prototype.updateResult=function(t){!this.isMounted||this.previousResult&&Object(u.a)(this.previousResult,t)||(this.setResult(t),this.previousResult=t)},e}(c);function g(t,e){var n=Object(o.useContext)(Object(r.c)()),a=Object(o.useState)({called:!1,loading:!1}),u=a[0],s=a[1],c=e?Object(i.a)(Object(i.a)({},e),{mutation:t}):{mutation:t},f=Object(o.useRef)();var l=(f.current||(f.current=new p({options:c,context:n,result:u,setResult:s})),f.current);return l.setOptions(c),l.context=n,Object(o.useEffect)((function(){return l.afterExecute()})),l.execute(u)}!function(t){function e(e){var n=e.options,r=e.context,i=e.setResult,o=t.call(this,n,r)||this;return o.currentObservable={},o.setResult=i,o.initialize(n),o}Object(i.c)(e,t),e.prototype.execute=function(t){if(!0===this.getOptions().skip)return this.cleanup(),{loading:!1,error:void 0,data:void 0,variables:this.getOptions().variables};var e=t;this.refreshClient().isNew&&(e=this.getLoadingResult());var n=this.getOptions().shouldResubscribe;return"function"===typeof n&&(n=!!n(this.getOptions())),!1!==n&&this.previousOptions&&Object.keys(this.previousOptions).length>0&&(this.previousOptions.subscription!==this.getOptions().subscription||!Object(u.a)(this.previousOptions.variables,this.getOptions().variables)||this.previousOptions.skip!==this.getOptions().skip)&&(this.cleanup(),e=this.getLoadingResult()),this.initialize(this.getOptions()),this.startSubscription(),this.previousOptions=this.getOptions(),Object(i.a)(Object(i.a)({},e),{variables:this.getOptions().variables})},e.prototype.afterExecute=function(){this.isMounted=!0},e.prototype.cleanup=function(){this.endSubscription(),delete this.currentObservable.query},e.prototype.initialize=function(t){this.currentObservable.query||!0===this.getOptions().skip||(this.currentObservable.query=this.refreshClient().client.subscribe({query:t.subscription,variables:t.variables,fetchPolicy:t.fetchPolicy}))},e.prototype.startSubscription=function(){this.currentObservable.subscription||(this.currentObservable.subscription=this.currentObservable.query.subscribe({next:this.updateCurrentData.bind(this),error:this.updateError.bind(this),complete:this.completeSubscription.bind(this)}))},e.prototype.getLoadingResult=function(){return{loading:!0,error:void 0,data:void 0}},e.prototype.updateResult=function(t){this.isMounted&&this.setResult(t)},e.prototype.updateCurrentData=function(t){var e=this.getOptions().onSubscriptionData;this.updateResult({data:t.data,loading:!1,error:void 0}),e&&e({client:this.refreshClient().client,subscriptionData:t})},e.prototype.updateError=function(t){this.updateResult({error:t,loading:!1})},e.prototype.completeSubscription=function(){var t=this.getOptions().onSubscriptionComplete;t&&t(),this.endSubscription()},e.prototype.endSubscription=function(){this.currentObservable.subscription&&(this.currentObservable.subscription.unsubscribe(),delete this.currentObservable.subscription)}}(c);!function(){function t(){this.queryPromises=new Map,this.queryInfoTrie=new Map}t.prototype.registerSSRObservable=function(t,e){this.lookupQueryInfo(e).observable=t},t.prototype.getSSRObservable=function(t){return this.lookupQueryInfo(t).observable},t.prototype.addQueryPromise=function(t,e){return this.lookupQueryInfo(t.getOptions()).seen?e():(this.queryPromises.set(t.getOptions(),new Promise((function(e){e(t.fetchData())}))),null)},t.prototype.hasPromises=function(){return this.queryPromises.size>0},t.prototype.consumeAndAwaitPromises=function(){var t=this,e=[];return this.queryPromises.forEach((function(n,r){t.lookupQueryInfo(r).seen=!0,e.push(n)})),this.queryPromises.clear(),Promise.all(e)},t.prototype.lookupQueryInfo=function(t){var e=this.queryInfoTrie,n=t.query,r=t.variables,i=e.get(n)||new Map;e.has(n)||e.set(n,i);var o=JSON.stringify(r),a=i.get(o)||{seen:!1,observable:null};return i.has(o)||i.set(o,a),a}}()},function(t,e,n){"use strict";function r(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}n.d(e,"a",(function(){return r}))},function(t,e,n){var r=n(970).parse;function i(t){return t.replace(/[\s,]+/g," ").trim()}var o={},a={};var u=!0;function s(t,e){var n=Object.prototype.toString.call(t);if("[object Array]"===n)return t.map((function(t){return s(t,e)}));if("[object Object]"!==n)throw new Error("Unexpected input.");e&&t.loc&&delete t.loc,t.loc&&(delete t.loc.startToken,delete t.loc.endToken);var r,i,o,a=Object.keys(t);for(r in a)a.hasOwnProperty(r)&&(i=t[a[r]],"[object Object]"!==(o=Object.prototype.toString.call(i))&&"[object Array]"!==o||(t[a[r]]=s(i,!0)));return t}var c=!1;function f(t){var e=i(t);if(o[e])return o[e];var n=r(t,{experimentalFragmentVariables:c});if(!n||"Document"!==n.kind)throw new Error("Not a valid GraphQL document.");return n=s(n=function(t){for(var e,n={},r=[],o=0;o-1};var F=function(t,e){var n=this.__data__,r=N(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};function B(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t-1&&t%1==0&&t<=9007199254740991},Kt={};Kt["[object Float32Array]"]=Kt["[object Float64Array]"]=Kt["[object Int8Array]"]=Kt["[object Int16Array]"]=Kt["[object Int32Array]"]=Kt["[object Uint8Array]"]=Kt["[object Uint8ClampedArray]"]=Kt["[object Uint16Array]"]=Kt["[object Uint32Array]"]=!0,Kt["[object Arguments]"]=Kt["[object Array]"]=Kt["[object ArrayBuffer]"]=Kt["[object Boolean]"]=Kt["[object DataView]"]=Kt["[object Date]"]=Kt["[object Error]"]=Kt["[object Function]"]=Kt["[object Map]"]=Kt["[object Number]"]=Kt["[object Object]"]=Kt["[object RegExp]"]=Kt["[object Set]"]=Kt["[object String]"]=Kt["[object WeakMap]"]=!1;var Yt=function(t){return E(t)&&Gt(t.length)&&!!Kt[S(t)]};var Zt=function(t){return function(e){return t(e)}},Qt=n(154),Xt=Qt.a&&Qt.a.isTypedArray,Jt=Xt?Zt(Xt):Yt,te=Object.prototype.hasOwnProperty;var ee=function(t,e){var n=Ht(t),r=!n&&zt(t),i=!n&&!r&&Object(Vt.a)(t),o=!n&&!r&&!i&&Jt(t),a=n||r||i||o,u=a?Dt(t.length,String):[],s=u.length;for(var c in t)!e&&!te.call(t,c)||a&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Wt(c,s))||u.push(c);return u},ne=Object.prototype;var re=function(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ne)},ie=O(Object.keys,Object),oe=Object.prototype.hasOwnProperty;var ae=function(t){if(!re(t))return ie(t);var e=[];for(var n in Object(t))oe.call(t,n)&&"constructor"!=n&&e.push(n);return e};var ue=function(t){return null!=t&&Gt(t.length)&&!G(t)};var se=function(t){return ue(t)?ee(t):ae(t)};var ce=function(t,e){return t&&jt(e,se(e),t)};var fe=function(t){var e=[];if(null!=t)for(var n in Object(t))e.push(n);return e},le=Object.prototype.hasOwnProperty;var de=function(t){if(!W(t))return fe(t);var e=re(t),n=[];for(var r in t)("constructor"!=r||!e&&le.call(t,r))&&n.push(r);return n};var he=function(t){return ue(t)?ee(t,!0):de(t)};var pe=function(t,e){return t&&jt(e,he(e),t)},ge=n(538);var me=function(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n=0||(i[n]=t[n]);return i}function Bn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Un=function(t){return Array.isArray(t)&&0===t.length},zn=function(t){return"function"===typeof t},Hn=function(t){return null!==t&&"object"===typeof t},Vn=function(t){return String(Math.floor(Number(t)))===t},qn=function(t){return"[object String]"===Object.prototype.toString.call(t)},Wn=function(t){return 0===r.Children.count(t)},Gn=function(t){return Hn(t)&&zn(t.then)};function Kn(t,e,n,r){void 0===r&&(r=0);for(var i=Cn(e);t&&r=0?[]:{}}}return(0===o?t:i)[a[o]]===n?t:(void 0===n?delete i[a[o]]:i[a[o]]=n,0===o&&void 0===n&&delete r[a[o]],r)}function Zn(t,e,n,r){void 0===n&&(n=new WeakMap),void 0===r&&(r={});for(var i=0,o=Object.keys(t);i=n.length)break;o=n[i++]}else{if((i=n.next()).done)break;o=i.value}var a=o;Kn(e,a.path)||(e=Yn(e,a.path,a.message))}}return e}(n)):e(n)}))}))}),[g.validationSchema]),T=Object(r.useCallback)((function(t,e){return new Promise((function(n){return n(w.current[t].validate(e))}))}),[]),$=Object(r.useCallback)((function(t){var e=Object.keys(w.current).filter((function(t){return zn(w.current[t].validate)})),n=e.length>0?e.map((function(e){return T(e,Kn(t,e))})):[Promise.resolve("DO_NOT_DELETE_YOU_WILL_BE_FIRED")];return Promise.all(n).then((function(t){return t.reduce((function(t,n,r){return"DO_NOT_DELETE_YOU_WILL_BE_FIRED"===n||n&&(t=Yn(t,e[r],n)),t}),{})}))}),[T]),A=Object(r.useCallback)((function(t){return Promise.all([$(t),g.validationSchema?M(t):{},g.validate?E(t):{}]).then((function(t){var e=t[0],n=t[1],r=t[2];return l.all([e,n,r],{arrayMerge:ur})}))}),[g.validate,g.validationSchema,$,E,M]),k=cr((function(t){return void 0===t&&(t=O.values),Object(Pn.unstable_runWithPriority)(Pn.unstable_LowPriority,(function(){return A(t).then((function(t){return _.current&&x({type:"SET_ERRORS",payload:t}),t})).catch((function(t){0}))}))})),C=cr((function(t){return void 0===t&&(t=O.values),x({type:"SET_ISVALIDATING",payload:!0}),A(t).then((function(t){return _.current&&(x({type:"SET_ISVALIDATING",payload:!1}),o()(O.errors,t)||x({type:"SET_ERRORS",payload:t})),t}))}));Object(r.useEffect)((function(){s&&!0===_.current&&o()(m.current,g.initialValues)&&k(m.current)}),[s,k]);var I=Object(r.useCallback)((function(t){var e=t&&t.values?t.values:m.current,n=t&&t.errors?t.errors:b.current?b.current:g.initialErrors||{},r=t&&t.touched?t.touched:v.current?v.current:g.initialTouched||{},i=t&&t.status?t.status:y.current?y.current:g.initialStatus;m.current=e,b.current=n,v.current=r,y.current=i;var o=function(){x({type:"RESET_FORM",payload:{isSubmitting:!!t&&!!t.isSubmitting,errors:n,touched:r,status:i,values:e,isValidating:!!t&&!!t.isValidating,submitCount:t&&t.submitCount&&"number"===typeof t.submitCount?t.submitCount:0}})};if(g.onReset){var a=g.onReset(O.values,Q);Gn(a)?a.then(o):o()}else o()}),[g.initialErrors,g.initialStatus,g.initialTouched]);Object(r.useEffect)((function(){!0!==_.current||o()(m.current,g.initialValues)||(d&&(m.current=g.initialValues,I()),s&&k(m.current))}),[d,g.initialValues,I,s,k]),Object(r.useEffect)((function(){d&&!0===_.current&&!o()(b.current,g.initialErrors)&&(b.current=g.initialErrors||nr,x({type:"SET_ERRORS",payload:g.initialErrors||nr}))}),[d,g.initialErrors]),Object(r.useEffect)((function(){d&&!0===_.current&&!o()(v.current,g.initialTouched)&&(v.current=g.initialTouched||rr,x({type:"SET_TOUCHED",payload:g.initialTouched||rr}))}),[d,g.initialTouched]),Object(r.useEffect)((function(){d&&!0===_.current&&!o()(y.current,g.initialStatus)&&(y.current=g.initialStatus,x({type:"SET_STATUS",payload:g.initialStatus}))}),[d,g.initialStatus,g.initialTouched]);var P=cr((function(t){if(w.current[t]&&zn(w.current[t].validate)){var e=Kn(O.values,t),n=w.current[t].validate(e);return Gn(n)?(x({type:"SET_ISVALIDATING",payload:!0}),n.then((function(t){return t})).then((function(e){x({type:"SET_FIELD_ERROR",payload:{field:t,value:e}}),x({type:"SET_ISVALIDATING",payload:!1})}))):(x({type:"SET_FIELD_ERROR",payload:{field:t,value:n}}),Promise.resolve(n))}return g.validationSchema?(x({type:"SET_ISVALIDATING",payload:!0}),M(O.values,t).then((function(t){return t})).then((function(e){x({type:"SET_FIELD_ERROR",payload:{field:t,value:e[t]}}),x({type:"SET_ISVALIDATING",payload:!1})}))):Promise.resolve()})),N=Object(r.useCallback)((function(t,e){var n=e.validate;w.current[t]={validate:n}}),[]),R=Object(r.useCallback)((function(t){delete w.current[t]}),[]),j=cr((function(t,e){return x({type:"SET_TOUCHED",payload:t}),(void 0===e?a:e)?k(O.values):Promise.resolve()})),D=Object(r.useCallback)((function(t){x({type:"SET_ERRORS",payload:t})}),[]),L=cr((function(t,e){var r=zn(t)?t(O.values):t;return x({type:"SET_VALUES",payload:r}),(void 0===e?n:e)?k(r):Promise.resolve()})),F=Object(r.useCallback)((function(t,e){x({type:"SET_FIELD_ERROR",payload:{field:t,value:e}})}),[]),B=cr((function(t,e,r){return x({type:"SET_FIELD_VALUE",payload:{field:t,value:e}}),(void 0===r?n:r)?k(Yn(O.values,t,e)):Promise.resolve()})),U=Object(r.useCallback)((function(t,e){var n,r=e,i=t;if(!qn(t)){t.persist&&t.persist();var o=t.target?t.target:t.currentTarget,a=o.type,u=o.name,s=o.id,c=o.value,f=o.checked,l=(o.outerHTML,o.options),d=o.multiple;r=e||(u||s),i=/number|range/.test(a)?(n=parseFloat(c),isNaN(n)?"":n):/checkbox/.test(a)?function(t,e,n){if("boolean"===typeof t)return Boolean(e);var r=[],i=!1,o=-1;if(Array.isArray(t))r=t,i=(o=t.indexOf(n))>=0;else if(!n||"true"==n||"false"==n)return Boolean(e);if(e&&n&&!i)return r.concat(n);if(!i)return r;return r.slice(0,o).concat(r.slice(o+1))}(Kn(O.values,r),f,c):d?function(t){return Array.from(t).filter((function(t){return t.selected})).map((function(t){return t.value}))}(l):c}r&&B(r,i)}),[B,O.values]),z=cr((function(t){if(qn(t))return function(e){return U(e,t)};U(t)})),H=cr((function(t,e,n){return void 0===e&&(e=!0),x({type:"SET_FIELD_TOUCHED",payload:{field:t,value:e}}),(void 0===n?a:n)?k(O.values):Promise.resolve()})),V=Object(r.useCallback)((function(t,e){t.persist&&t.persist();var n=t.target,r=n.name,i=n.id,o=(n.outerHTML,e||(r||i));H(o,!0)}),[H]),q=cr((function(t){if(qn(t))return function(e){return V(e,t)};V(t)})),W=Object(r.useCallback)((function(t){zn(t)?x({type:"SET_FORMIK_STATE",payload:t}):x({type:"SET_FORMIK_STATE",payload:function(){return t}})}),[]),G=Object(r.useCallback)((function(t){x({type:"SET_STATUS",payload:t})}),[]),K=Object(r.useCallback)((function(t){x({type:"SET_ISSUBMITTING",payload:t})}),[]),Y=cr((function(){return x({type:"SUBMIT_ATTEMPT"}),C().then((function(t){var e=t instanceof Error;if(!e&&0===Object.keys(t).length){var n;try{if(void 0===(n=X()))return}catch(r){throw r}return Promise.resolve(n).then((function(t){return _.current&&x({type:"SUBMIT_SUCCESS"}),t})).catch((function(t){if(_.current)throw x({type:"SUBMIT_FAILURE"}),t}))}if(_.current&&(x({type:"SUBMIT_FAILURE"}),e))throw t}))})),Z=cr((function(t){t&&t.preventDefault&&zn(t.preventDefault)&&t.preventDefault(),t&&t.stopPropagation&&zn(t.stopPropagation)&&t.stopPropagation(),Y().catch((function(t){console.warn("Warning: An unhandled error was caught from submitForm()",t)}))})),Q={resetForm:I,validateForm:C,validateField:P,setErrors:D,setFieldError:F,setFieldTouched:H,setFieldValue:B,setStatus:G,setSubmitting:K,setTouched:j,setValues:L,setFormikState:W,submitForm:Y},X=cr((function(){return h(O.values,Q)})),J=cr((function(t){t&&t.preventDefault&&zn(t.preventDefault)&&t.preventDefault(),t&&t.stopPropagation&&zn(t.stopPropagation)&&t.stopPropagation(),I()})),tt=Object(r.useCallback)((function(t){return{value:Kn(O.values,t),error:Kn(O.errors,t),touched:!!Kn(O.touched,t),initialValue:Kn(m.current,t),initialTouched:!!Kn(v.current,t),initialError:Kn(b.current,t)}}),[O.errors,O.touched,O.values]),et=Object(r.useCallback)((function(t){return{setValue:function(e,n){return B(t,e,n)},setTouched:function(e,n){return H(t,e,n)},setError:function(e){return F(t,e)}}}),[B,H,F]),nt=Object(r.useCallback)((function(t){var e=Hn(t),n=e?t.name:t,r=Kn(O.values,n),i={name:n,value:r,onChange:z,onBlur:q};if(e){var o=t.type,a=t.value,u=t.as,s=t.multiple;"checkbox"===o?void 0===a?i.checked=!!r:(i.checked=!(!Array.isArray(r)||!~r.indexOf(a)),i.value=a):"radio"===o?(i.checked=r===a,i.value=a):"select"===u&&s&&(i.value=i.value||[],i.multiple=!0)}return i}),[q,z,O.values]),rt=Object(r.useMemo)((function(){return!o()(m.current,O.values)}),[m.current,O.values]),it=Object(r.useMemo)((function(){return"undefined"!==typeof c?rt?O.errors&&0===Object.keys(O.errors).length:!1!==c&&zn(c)?c(g):c:O.errors&&0===Object.keys(O.errors).length}),[c,rt,O.errors,g]);return Dn({},O,{initialValues:m.current,initialErrors:b.current,initialTouched:v.current,initialStatus:y.current,handleBlur:q,handleChange:z,handleReset:J,handleSubmit:Z,resetForm:I,setErrors:D,setFormikState:W,setFieldTouched:H,setFieldValue:B,setFieldError:F,setStatus:G,setSubmitting:K,setTouched:j,setValues:L,submitForm:Y,validateForm:C,validateField:P,isValid:it,dirty:rt,unregisterField:R,registerField:N,getFieldProps:nt,getFieldMeta:tt,getFieldHelpers:et,validateOnBlur:a,validateOnChange:n,validateOnMount:s})}function or(t){var e=ir(t),n=t.component,i=t.children,o=t.render,a=t.innerRef;return Object(r.useImperativeHandle)(a,(function(){return e})),Object(r.createElement)(Xn,{value:e},n?Object(r.createElement)(n,e):o?o(e):i?zn(i)?i(e):Wn(i)?null:r.Children.only(i):null)}function ar(t){var e=Array.isArray(t)?[]:{};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var r=String(n);!0===Array.isArray(t[r])?e[r]=t[r].map((function(t){return!0===Array.isArray(t)||C(t)?ar(t):""!==t?t:void 0})):C(t[r])?e[r]=ar(t[r]):e[r]=""!==t[r]?t[r]:void 0}return e}function ur(t,e,n){var r=t.slice();return e.forEach((function(e,i){if("undefined"===typeof r[i]){var o=!1!==n.clone&&n.isMergeableObject(e);r[i]=o?l(Array.isArray(e)?[]:{},e,n):e}else n.isMergeableObject(e)?r[i]=l(t[i],e,n):-1===t.indexOf(e)&&r.push(e)})),r}var sr="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?r.useLayoutEffect:r.useEffect;function cr(t){var e=Object(r.useRef)(t);return sr((function(){e.current=t})),Object(r.useCallback)((function(){for(var t=arguments.length,n=new Array(t),r=0;rt?e:t}),0);return Array.from(Dn({},t,{length:e+1}))}return[]},gr=function(t){function e(e){var n;return(n=t.call(this,e)||this).updateArrayField=function(t,e,r){var i=n.props,o=i.name;(0,i.formik.setFormikState)((function(n){var i="function"===typeof r?r:t,a="function"===typeof e?e:t,u=Yn(n.values,o,t(Kn(n.values,o))),s=r?i(Kn(n.errors,o)):void 0,c=e?a(Kn(n.touched,o)):void 0;return Un(s)&&(s=void 0),Un(c)&&(c=void 0),Dn({},n,{values:u,errors:r?Yn(n.errors,o,s):n.errors,touched:e?Yn(n.touched,o,c):n.touched})}))},n.push=function(t){return n.updateArrayField((function(e){return[].concat(pr(e),[jn(t)])}),!1,!1)},n.handlePush=function(t){return function(){return n.push(t)}},n.swap=function(t,e){return n.updateArrayField((function(n){return function(t,e,n){var r=pr(t),i=r[e];return r[e]=r[n],r[n]=i,r}(n,t,e)}),!0,!0)},n.handleSwap=function(t,e){return function(){return n.swap(t,e)}},n.move=function(t,e){return n.updateArrayField((function(n){return function(t,e,n){var r=pr(t),i=r[e];return r.splice(e,1),r.splice(n,0,i),r}(n,t,e)}),!0,!0)},n.handleMove=function(t,e){return function(){return n.move(t,e)}},n.insert=function(t,e){return n.updateArrayField((function(n){return hr(n,t,e)}),(function(e){return hr(e,t,null)}),(function(e){return hr(e,t,null)}))},n.handleInsert=function(t,e){return function(){return n.insert(t,e)}},n.replace=function(t,e){return n.updateArrayField((function(n){return function(t,e,n){var r=pr(t);return r[e]=n,r}(n,t,e)}),!1,!1)},n.handleReplace=function(t,e){return function(){return n.replace(t,e)}},n.unshift=function(t){var e=-1;return n.updateArrayField((function(n){var r=n?[t].concat(n):[t];return e<0&&(e=r.length),r}),(function(t){var n=t?[null].concat(t):[null];return e<0&&(e=n.length),n}),(function(t){var n=t?[null].concat(t):[null];return e<0&&(e=n.length),n})),e},n.handleUnshift=function(t){return function(){return n.unshift(t)}},n.handleRemove=function(t){return function(){return n.remove(t)}},n.handlePop=function(){return function(){return n.pop()}},n.remove=n.remove.bind(Bn(n)),n.pop=n.pop.bind(Bn(n)),n}Ln(e,t);var n=e.prototype;return n.componentDidUpdate=function(t){this.props.validateOnChange&&this.props.formik.validateOnChange&&!o()(Kn(t.formik.values,t.name),Kn(this.props.formik.values,this.props.name))&&this.props.formik.validateForm(this.props.formik.values)},n.remove=function(t){var e;return this.updateArrayField((function(n){var r=n?pr(n):[];return e||(e=r[t]),zn(r.splice)&&r.splice(t,1),r}),!0,!0),e},n.pop=function(){var t;return this.updateArrayField((function(e){var n=e;return t||(t=n&&n.pop&&n.pop()),n}),!0,!0),t},n.render=function(){var t={push:this.push,pop:this.pop,swap:this.swap,move:this.move,insert:this.insert,replace:this.replace,unshift:this.unshift,remove:this.remove,handlePush:this.handlePush,handlePop:this.handlePop,handleSwap:this.handleSwap,handleMove:this.handleMove,handleInsert:this.handleInsert,handleReplace:this.handleReplace,handleUnshift:this.handleUnshift,handleRemove:this.handleRemove},e=this.props,n=e.component,i=e.render,o=e.children,a=e.name,u=Dn({},t,{form:Fn(e.formik,["validate","validationSchema"]),name:a});return n?Object(r.createElement)(n,u):i?i(u):o?"function"===typeof o?o(u):Wn(o)?null:r.Children.only(o):null},e}(r.Component);gr.defaultProps={validateOnChange:!0};var mr=dr(gr),br=(r.Component,dr(function(t){function e(e){var n;n=t.call(this,e)||this;var r=e.render,i=e.children,o=e.component,a=e.as;e.name;return r&&Object(In.a)(!1),o&&r&&Object(In.a)(!1),a&&i&&zn(i)&&Object(In.a)(!1),o&&i&&zn(i)&&Object(In.a)(!1),r&&i&&!Wn(i)&&Object(In.a)(!1),n}Ln(e,t);var n=e.prototype;return n.shouldComponentUpdate=function(t){return this.props.shouldUpdate?this.props.shouldUpdate(t,this.props):t.name!==this.props.name||Kn(t.formik.values,this.props.name)!==Kn(this.props.formik.values,this.props.name)||Kn(t.formik.errors,this.props.name)!==Kn(this.props.formik.errors,this.props.name)||Kn(t.formik.touched,this.props.name)!==Kn(this.props.formik.touched,this.props.name)||Object.keys(this.props).length!==Object.keys(t).length||t.formik.isSubmitting!==this.props.formik.isSubmitting},n.componentDidMount=function(){this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentDidUpdate=function(t){this.props.name!==t.name&&(this.props.formik.unregisterField(t.name),this.props.formik.registerField(this.props.name,{validate:this.props.validate})),this.props.validate!==t.validate&&this.props.formik.registerField(this.props.name,{validate:this.props.validate})},n.componentWillUnmount=function(){this.props.formik.unregisterField(this.props.name)},n.render=function(){var t=this.props,e=t.name,n=t.render,i=t.as,o=t.children,a=t.component,u=t.formik,s=Fn(t,["validate","name","render","as","children","component","shouldUpdate","formik"]),c=Fn(u,["validate","validationSchema"]),f={value:"radio"===s.type||"checkbox"===s.type?s.value:Kn(u.values,e),name:e,onChange:u.handleChange,onBlur:u.handleBlur},l={field:f,meta:{value:Kn(u.values,e),error:Kn(u.errors,e),touched:!!Kn(u.touched,e),initialValue:Kn(u.initialValues,e),initialTouched:!!Kn(u.initialTouched,e),initialError:Kn(u.initialErrors,e)},form:c};if(n)return n(l);if(zn(o))return o(l);if(a){if("string"===typeof a){var d=s.innerRef,h=Fn(s,["innerRef"]);return Object(r.createElement)(a,Dn({ref:d},f,h),o)}return Object(r.createElement)(a,Dn({field:f,form:u},s),o)}var p=i||"input";if("string"===typeof p){var g=s.innerRef,m=Fn(s,["innerRef"]);return Object(r.createElement)(p,Dn({ref:g},f,m),o)}return Object(r.createElement)(p,Dn({},f,s),o)},e}(r.Component)))},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},function(t,e,n){t.exports=n(608)()},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a})),n.d(e,"d",(function(){return u})),n.d(e,"e",(function(){return s}));var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function i(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}},,function(t,e){t.exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}n.d(e,"a",(function(){return r}))},,function(t,e,n){"use strict";function r(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(209);function i(t,e){var n;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=Object(r.a)(t))||e&&t&&"number"===typeof t.length){n&&(t=n);var i=0,o=function(){};return{s:o,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,u=!0,s=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return u=t.done,t},e:function(t){s=!0,a=t},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw a}}}}},function(t,e,n){"use strict";var r=n(4),i=n(17),o=n(1),a=n.n(o),u=(n(13),n(126)),s=n.n(u),c=n(976),f=n(1014),l=n(401),d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function(n){var o=e.defaultTheme,u=e.withTheme,d=void 0!==u&&u,h=e.name,p=Object(i.a)(e,["defaultTheme","withTheme","name"]);var g=h,m=Object(c.a)(t,Object(r.a)({defaultTheme:o,Component:n,name:h||n.displayName,classNamePrefix:g},p)),b=a.a.forwardRef((function(t,e){t.classes;var u,s=t.innerRef,c=Object(i.a)(t,["classes","innerRef"]),p=m(Object(r.a)({},n.defaultProps,t)),g=c;return("string"===typeof h||d)&&(u=Object(l.a)()||o,h&&(g=Object(f.a)({theme:u,name:h,props:c})),d&&!g.theme&&(g.theme=u)),a.a.createElement(n,Object(r.a)({ref:s||e,classes:p},g))}));return s()(b,n),b}},h=n(136);e.a=function(t,e){return d(t,Object(r.a)({defaultTheme:h.a},e))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(22);function i(t){Object(r.a)(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===typeof t&&"[object Date]"===e?new Date(t.getTime()):"number"===typeof t||"[object Number]"===e?new Date(t):("string"!==typeof t&&"[object String]"!==e||"undefined"===typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}},function(t,e,n){"use strict";n.r(e),n.d(e,"hexToRgb",(function(){return r.g})),n.d(e,"rgbToHex",(function(){return r.k})),n.d(e,"hslToRgb",(function(){return r.h})),n.d(e,"decomposeColor",(function(){return r.b})),n.d(e,"recomposeColor",(function(){return r.j})),n.d(e,"getContrastRatio",(function(){return r.e})),n.d(e,"getLuminance",(function(){return r.f})),n.d(e,"emphasize",(function(){return r.c})),n.d(e,"fade",(function(){return r.d})),n.d(e,"darken",(function(){return r.a})),n.d(e,"lighten",(function(){return r.i})),n.d(e,"createMuiTheme",(function(){return i.a})),n.d(e,"unstable_createMuiStrictModeTheme",(function(){return a})),n.d(e,"createStyles",(function(){return u})),n.d(e,"makeStyles",(function(){return s.a})),n.d(e,"responsiveFontSizes",(function(){return v})),n.d(e,"styled",(function(){return y.a})),n.d(e,"easing",(function(){return _.c})),n.d(e,"duration",(function(){return _.b})),n.d(e,"useTheme",(function(){return w.a})),n.d(e,"withStyles",(function(){return S.a})),n.d(e,"withTheme",(function(){return k})),n.d(e,"createGenerateClassName",(function(){return C.a})),n.d(e,"jssPreset",(function(){return I.a})),n.d(e,"ServerStyleSheets",(function(){return D})),n.d(e,"StylesProvider",(function(){return j.b})),n.d(e,"MuiThemeProvider",(function(){return L.a})),n.d(e,"ThemeProvider",(function(){return L.a}));var r=n(36),i=n(208),o=n(393);function a(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{},n=e.breakpoints,r=void 0===n?["sm","md","lg"]:n,i=e.disableAlign,o=void 0!==i&&i,a=e.factor,u=void 0===a?2:a,s=e.variants,l=void 0===s?["h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","caption","button","overline"]:s,h=Object(c.a)({},t);h.typography=Object(c.a)({},h.typography);var v=h.typography,y=p(v.htmlFontSize),_=r.map((function(t){return h.breakpoints.values[t]}));return l.forEach((function(t){var e=v[t],n=parseFloat(y(e.fontSize,"rem"));if(!(n<=1)){var r=n,i=1+(r-1)/u,a=e.lineHeight;if(!d(a)&&!o)throw new Error(Object(f.a)(6));d(a)||(a=parseFloat(y(a,"rem"))/parseFloat(n));var s=null;o||(s=function(t){return g({size:t,grid:m({pixels:4,lineHeight:a,htmlFontSize:v.htmlFontSize})})}),v[t]=Object(c.a)({},e,b({cssProperty:"fontSize",min:i,max:r,unit:"rem",breakpoints:_,transform:s}))}})),h}var y=n(280),_=n(90),w=n(96),S=n(24),O=n(17),x=n(1),E=n.n(x),M=(n(13),n(126)),T=n.n(M),$=n(401);function A(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.defaultTheme,n=function(t){var n=E.a.forwardRef((function(n,r){var i=n.innerRef,o=Object(O.a)(n,["innerRef"]),a=Object($.a)()||e;return E.a.createElement(t,Object(c.a)({theme:a,ref:i||r},o))}));return T()(n,t),n};return n}A();var k=A({defaultTheme:n(136).a}),C=n(972),I=n(575),P=n(297),N=n(171),R=n(72),j=n(1009),D=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object(P.a)(this,t),this.options=e}return Object(N.a)(t,[{key:"collect",value:function(t){var e=new Map;this.sheetsRegistry=new R.b;var n=Object(C.a)();return E.a.createElement(j.b,Object(c.a)({sheetsManager:e,serverGenerateClassName:n,sheetsRegistry:this.sheetsRegistry},this.options),t)}},{key:"toString",value:function(){return this.sheetsRegistry?this.sheetsRegistry.toString():""}},{key:"getStyleElement",value:function(t){return E.a.createElement("style",Object(c.a)({id:"jss-server-side",key:"jss-server-side",dangerouslySetInnerHTML:{__html:this.toString()}},t))}}]),t}(),L=n(1098)},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return B})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return E})),n.d(e,"d",(function(){return V})),n.d(e,"e",(function(){return W})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return I})),n.d(e,"h",(function(){return P})),n.d(e,"i",(function(){return y})),n.d(e,"j",(function(){return A})),n.d(e,"k",(function(){return x})),n.d(e,"l",(function(){return C})),n.d(e,"m",(function(){return T})),n.d(e,"n",(function(){return $})),n.d(e,"o",(function(){return k})),n.d(e,"p",(function(){return l})),n.d(e,"q",(function(){return tt})),n.d(e,"r",(function(){return S})),n.d(e,"s",(function(){return w})),n.d(e,"t",(function(){return p})),n.d(e,"u",(function(){return m})),n.d(e,"v",(function(){return g})),n.d(e,"w",(function(){return v})),n.d(e,"x",(function(){return Q})),n.d(e,"y",(function(){return X})),n.d(e,"z",(function(){return nt})),n.d(e,"A",(function(){return it})),n.d(e,"B",(function(){return ot})),n.d(e,"C",(function(){return q})),n.d(e,"D",(function(){return z})),n.d(e,"E",(function(){return h})),n.d(e,"F",(function(){return _})),n.d(e,"G",(function(){return c})),n.d(e,"H",(function(){return b})),n.d(e,"I",(function(){return J}));var r=n(99),i=n(31),o=n(14),a=n(532),u=n.n(a);n(76);function s(t,e,n,r){if(function(t){return"IntValue"===t.kind}(n)||function(t){return"FloatValue"===t.kind}(n))t[e.value]=Number(n.value);else if(function(t){return"BooleanValue"===t.kind}(n)||function(t){return"StringValue"===t.kind}(n))t[e.value]=n.value;else if(function(t){return"ObjectValue"===t.kind}(n)){var o={};n.fields.map((function(t){return s(o,t.name,t.value,r)})),t[e.value]=o}else if(function(t){return"Variable"===t.kind}(n)){var a=(r||{})[n.name.value];t[e.value]=a}else if(function(t){return"ListValue"===t.kind}(n))t[e.value]=n.values.map((function(t){var n={};return s(n,e,t,r),n[e.value]}));else if(function(t){return"EnumValue"===t.kind}(n))t[e.value]=n.value;else{if(!function(t){return"NullValue"===t.kind}(n))throw new i.a(17);t[e.value]=null}}function c(t,e){var n=null;t.directives&&(n={},t.directives.forEach((function(t){n[t.name.value]={},t.arguments&&t.arguments.forEach((function(r){var i=r.name,o=r.value;return s(n[t.name.value],i,o,e)}))})));var r=null;return t.arguments&&t.arguments.length&&(r={},t.arguments.forEach((function(t){var n=t.name,i=t.value;return s(r,n,i,e)}))),l(t.name.value,r,n)}var f=["connection","include","skip","client","rest","export"];function l(t,e,n){if(n&&n.connection&&n.connection.key){if(n.connection.filter&&n.connection.filter.length>0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i=e,o={};return r.forEach((function(t){o[t]=i[t]})),n.connection.key+"("+JSON.stringify(o)+")"}return n.connection.key}var a=t;if(e){var s=u()(e);a+="("+s+")"}return n&&Object.keys(n).forEach((function(t){-1===f.indexOf(t)&&(n[t]&&Object.keys(n[t]).length?a+="@"+t+"("+JSON.stringify(n[t])+")":a+="@"+t)})),a}function d(t,e){if(t.arguments&&t.arguments.length){var n={};return t.arguments.forEach((function(t){var r=t.name,i=t.value;return s(n,r,i,e)})),n}return null}function h(t){return t.alias?t.alias.value:t.name.value}function p(t){return"Field"===t.kind}function g(t){return"InlineFragment"===t.kind}function m(t){return t&&"id"===t.type&&"boolean"===typeof t.generated}function b(t,e){return void 0===e&&(e=!1),Object(o.a)({type:"id",generated:e},"string"===typeof t?{id:t,typename:void 0}:t)}function v(t){return null!=t&&"object"===typeof t&&"json"===t.type}function y(t,e){if(t.directives&&t.directives.length){var n={};return t.directives.forEach((function(t){n[t.name.value]=d(t,e)})),n}return null}function _(t,e){return void 0===e&&(e={}),(n=t.directives,n?n.filter(O).map((function(t){var e=t.arguments;t.name.value,Object(i.b)(e&&1===e.length,14);var n=e[0];Object(i.b)(n.name&&"if"===n.name.value,15);var r=n.value;return Object(i.b)(r&&("Variable"===r.kind||"BooleanValue"===r.kind),16),{directive:t,ifArgument:n}})):[]).every((function(t){var n=t.directive,r=t.ifArgument,o=!1;return"Variable"===r.value.kind?(o=e[r.value.name.value],Object(i.b)(void 0!==o,13)):o=r.value.value,"skip"===n.name.value?!o:o}));var n}function w(t,e){return function(t){var e=[];return Object(r.b)(t,{Directive:function(t){e.push(t.name.value)}}),e}(e).some((function(e){return t.indexOf(e)>-1}))}function S(t){return t&&w(["client"],t)&&w(["export"],t)}function O(t){var e=t.name.value;return"skip"===e||"include"===e}function x(t,e){var n=e,r=[];return t.definitions.forEach((function(t){if("OperationDefinition"===t.kind)throw new i.a(11);"FragmentDefinition"===t.kind&&r.push(t)})),"undefined"===typeof n&&(Object(i.b)(1===r.length,12),n=r[0].name.value),Object(o.a)(Object(o.a)({},t),{definitions:Object(o.e)([{kind:"OperationDefinition",operation:"query",selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:n}}]}}],t.definitions)})}function E(t){for(var e=[],n=1;n1){var r=[];e=st(e,r);for(var i=1;ie?1:t>=e?0:NaN},o=function(t){var e=t,n=t;function r(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;n(t[o],e)<0?r=o+1:i=o}return r}return 1===t.length&&(e=function(e,n){return t(e)-n},n=function(t){return function(e,n){return i(t(e),n)}}(t)),{left:r,center:function(t,n,i,o){null==i&&(i=0),null==o&&(o=t.length);var a=r(t,n,i,o-1);return a>i&&e(t[a-1],n)>-e(t[a],n)?a-1:a},right:function(t,e,r,i){for(null==r&&(r=0),null==i&&(i=t.length);r>>1;n(t[o],e)>0?i=o:r=o+1}return r}}};var a=n(35),u=n.n(a),s=n(23),c=u.a.mark(l),f=function(t){return null===t?NaN:+t};function l(t,e){var n,r,i,o,a,f,l;return u.a.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:if(void 0!==e){u.next=21;break}n=Object(s.a)(t),u.prev=2,n.s();case 4:if((r=n.n()).done){u.next=11;break}if(!(null!=(i=r.value)&&(i=+i)>=i)){u.next=9;break}return u.next=9,i;case 9:u.next=4;break;case 11:u.next=16;break;case 13:u.prev=13,u.t0=u.catch(2),n.e(u.t0);case 16:return u.prev=16,n.f(),u.finish(16);case 19:u.next=40;break;case 21:o=-1,a=Object(s.a)(t),u.prev=23,a.s();case 25:if((f=a.n()).done){u.next=32;break}if(l=f.value,!(null!=(l=e(l,++o,t))&&(l=+l)>=l)){u.next=30;break}return u.next=30,l;case 30:u.next=25;break;case 32:u.next=37;break;case 34:u.prev=34,u.t1=u.catch(23),a.e(u.t1);case 37:return u.prev=37,a.f(),u.finish(37);case 40:case"end":return u.stop()}}),c,null,[[2,13,16,19],[23,34,37,40]])}var d=o(i),h=d.right,p=d.left,g=o(f).center,m=h;function b(t,e){var n=0;if(void 0===e){var r,i=Object(s.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(o=+o)>=o&&++n}}catch(l){i.e(l)}finally{i.f()}}else{var a,u=-1,c=Object(s.a)(t);try{for(c.s();!(a=c.n()).done;){var f=a.value;null!=(f=e(f,++u,t))&&(f=+f)>=f&&++n}}catch(l){c.e(l)}finally{c.f()}}return n}var v=n(47);function y(t){return 0|t.length}function _(t){return!(t>0)}function w(t){return"object"!==typeof t||"length"in t?t:Array.from(t)}function S(t){return function(e){return t.apply(void 0,Object(v.a)(e))}}function O(){for(var t=arguments.length,e=new Array(t),n=0;nt?1:e>=t?0:NaN};function M(t,e){var n,r=0,i=0,o=0;if(void 0===e){var a,u=Object(s.a)(t);try{for(u.s();!(a=u.n()).done;){var c=a.value;null!=c&&(c=+c)>=c&&(o+=(n=c-i)*(c-(i+=n/++r)))}}catch(p){u.e(p)}finally{u.f()}}else{var f,l=-1,d=Object(s.a)(t);try{for(d.s();!(f=d.n()).done;){var h=f.value;null!=(h=e(h,++l,t))&&(h=+h)>=h&&(o+=(n=h-i)*(h-(i+=n/++r)))}}catch(p){d.e(p)}finally{d.f()}}if(r>1)return o/(r-1)}function T(t,e){var n=M(t,e);return n?Math.sqrt(n):n}var $=function(t,e){var n,r;if(void 0===e){var i,o=Object(s.a)(t);try{for(o.s();!(i=o.n()).done;){var a=i.value;null!=a&&(void 0===n?a>=a&&(n=r=a):(n>a&&(n=a),r=l&&(n=r=l):(n>l&&(n=l),r0){for(o=r[--i];i>0&&(t=o,!(n=(e=r[--i])-((o=t+e)-t))););i>0&&(n<0&&r[i-1]<0||n>0&&r[i-1]>0)&&(e=2*n)==(t=o+e)-o&&(o=t)}return o}}]),t}(),I=function(t,e){var n=new C;if(void 0===e){var r,i=Object(s.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;(o=+o)&&n.add(o)}}catch(l){i.e(l)}finally{i.f()}}else{var a,u=-1,c=Object(s.a)(t);try{for(c.s();!(a=c.n()).done;){var f=a.value;(f=+e(f,++u,t))&&n.add(f)}}catch(l){c.e(l)}finally{c.f()}}return+n},P=n(2),N=n(190),R=n(62),j=n(51),D=n(86),L=n(87),F=n(250),B=function(t){Object(D.a)(n,t);var e=Object(L.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q;Object(A.a)(this,n),t=e.call(this),Object.defineProperties(Object(N.a)(t),{_intern:{value:new Map},_key:{value:i}});var o,a=Object(s.a)(r);try{for(a.s();!(o=a.n()).done;){var u=Object(P.a)(o.value,2),c=u[0],f=u[1];t.set(c,f)}}catch(l){a.e(l)}finally{a.f()}return t}return Object(k.a)(n,[{key:"get",value:function(t){return Object(R.a)(Object(j.a)(n.prototype),"get",this).call(this,z(this,t))}},{key:"has",value:function(t){return Object(R.a)(Object(j.a)(n.prototype),"has",this).call(this,z(this,t))}},{key:"set",value:function(t,e){return Object(R.a)(Object(j.a)(n.prototype),"set",this).call(this,H(this,t),e)}},{key:"delete",value:function(t){return Object(R.a)(Object(j.a)(n.prototype),"delete",this).call(this,V(this,t))}}]),n}(Object(F.a)(Map)),U=function(t){Object(D.a)(n,t);var e=Object(L.a)(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q;Object(A.a)(this,n),t=e.call(this),Object.defineProperties(Object(N.a)(t),{_intern:{value:new Map},_key:{value:i}});var o,a=Object(s.a)(r);try{for(a.s();!(o=a.n()).done;){var u=o.value;t.add(u)}}catch(c){a.e(c)}finally{a.f()}return t}return Object(k.a)(n,[{key:"has",value:function(t){return Object(R.a)(Object(j.a)(n.prototype),"has",this).call(this,z(this,t))}},{key:"add",value:function(t){return Object(R.a)(Object(j.a)(n.prototype),"add",this).call(this,H(this,t))}},{key:"delete",value:function(t){return Object(R.a)(Object(j.a)(n.prototype),"delete",this).call(this,V(this,t))}}]),n}(Object(F.a)(Set));function z(t,e){var n=t._intern,r=(0,t._key)(e);return n.has(r)?n.get(r):e}function H(t,e){var n=t._intern,r=(0,t._key)(e);return n.has(r)?n.get(r):(n.set(r,e),e)}function V(t,e){var n=t._intern,r=(0,t._key)(e);return n.has(r)&&(e=n.get(e),n.delete(r)),e}function q(t){return null!==t&&"object"===typeof t?t.valueOf():t}var W=function(t){return t};function G(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1?e-1:0),r=1;r2?n-2:0),i=2;i2?n-2:0),i=2;i1?e-1:0),r=1;r1?e-1:0),r=1;r=r.length)return n(i);var a,u=new B,c=r[o++],f=-1,l=Object(s.a)(i);try{for(l.s();!(a=l.n()).done;){var d=a.value,h=c(d,++f,i),p=u.get(h);p?p.push(d):u.set(h,[d])}}catch(_){l.e(_)}finally{l.f()}var g,m=Object(s.a)(u);try{for(m.s();!(g=m.n()).done;){var b=Object(P.a)(g.value,2),v=b[0],y=b[1];u.set(v,t(y,o))}}catch(_){m.e(_)}finally{m.f()}return e(u)}(t,0)}var et=function(t,e){return Array.from(e,(function(e){return t[e]}))};function nt(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r1){var f=Uint32Array.from(t,(function(t,e){return e}));return n.length>1?(n=n.map((function(e){return t.map(e)})),f.sort((function(t,e){var r,o=Object(s.a)(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,u=i(a[t],a[e]);if(u)return u}}catch(c){o.e(c)}finally{o.f()}}))):(c=t.map(c),f.sort((function(t,e){return i(c[t],c[e])}))),et(t,f)}return t.sort(c)}function rt(t,e,n){return(1===e.length?nt(Y(t,e,n),(function(t,e){var n=Object(P.a)(t,2),r=n[0],o=n[1],a=Object(P.a)(e,2),u=a[0],s=a[1];return i(o,s)||i(r,u)})):nt(G(t,n),(function(t,n){var r=Object(P.a)(t,2),o=r[0],a=r[1],u=Object(P.a)(n,2),s=u[0],c=u[1];return e(a,c)||i(o,s)}))).map((function(t){return Object(P.a)(t,1)[0]}))}var it=Array.prototype,ot=it.slice,at=(it.map,function(t){return function(){return t}}),ut=Math.sqrt(50),st=Math.sqrt(10),ct=Math.sqrt(2),ft=function(t,e,n){var r,i,o,a,u=-1;if(n=+n,(t=+t)===(e=+e)&&n>0)return[t];if((r=e0)for(t=Math.ceil(t/a),e=Math.floor(e/a),o=new Array(i=Math.ceil(e-t+1));++u=0?(o>=ut?10:o>=st?5:o>=ct?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(o>=ut?10:o>=st?5:o>=ct?2:1)}function dt(t,e,n){var r=Math.abs(e-t)/Math.max(0,n),i=Math.pow(10,Math.floor(Math.log(r)/Math.LN10)),o=r/i;return o>=ut?i*=10:o>=st?i*=5:o>=ct&&(i*=2),e0?(t=Math.floor(t/i)*i,e=Math.ceil(e/i)*i):i<0&&(t=Math.ceil(t*i)/i,e=Math.floor(e*i)/i),r=i}}var pt=function(t){return Math.ceil(Math.log(b(t))/Math.LN2)+1},gt=function(){var t=W,e=$,n=pt;function r(r){Array.isArray(r)||(r=Array.from(r));var i,o,a=r.length,u=new Array(a);for(i=0;i=f)if(d>=f&&e===$){var b=lt(c,f,h);isFinite(b)&&(b>0?f=(Math.floor(f/b)+1)*b:b<0&&(f=(Math.ceil(f*-b)+1)/-b))}else l.pop()}for(var v=l.length;l[0]<=c;)l.shift(),--v;for(;l[v-1]>f;)l.pop(),--v;var y,_=new Array(v+1);for(i=0;i<=v;++i)(y=_[i]=[]).x0=i>0?l[i-1]:c,y.x1=i=o)&&(n=o)}}catch(l){i.e(l)}finally{i.f()}}else{var a,u=-1,c=Object(s.a)(t);try{for(c.s();!(a=c.n()).done;){var f=a.value;null!=(f=e(f,++u,t))&&(n=f)&&(n=f)}}catch(l){c.e(l)}finally{c.f()}}return n}function bt(t,e){var n;if(void 0===e){var r,i=Object(s.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;null!=o&&(n>o||void 0===n&&o>=o)&&(n=o)}}catch(l){i.e(l)}finally{i.f()}}else{var a,u=-1,c=Object(s.a)(t);try{for(c.s();!(a=c.n()).done;){var f=a.value;null!=(f=e(f,++u,t))&&(n>f||void 0===n&&f>=f)&&(n=f)}}catch(l){c.e(l)}finally{c.f()}}return n}function vt(t,e){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length-1,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:i;r>n;){if(r-n>600){var a=r-n+1,u=e-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),f=.5*Math.sqrt(s*c*(a-c)/a)*(u-a/2<0?-1:1),l=Math.max(n,Math.floor(e-u*c/a+f)),d=Math.min(r,Math.floor(e+(a-u)*c/a+f));vt(t,e,l,d,o)}var h=t[e],p=n,g=r;for(yt(t,n,e),o(t[r],h)>0&&yt(t,n,r);p0;)--g}0===o(t[n],h)?yt(t,n,g):yt(t,++g,r),g<=e&&(n=g+1),e<=g&&(r=g-1)}return t}function yt(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function _t(t,e,n){if(r=(t=Float64Array.from(l(t,n))).length){if((e=+e)<=0||r<2)return bt(t);if(e>=1)return mt(t);var r,i=(r-1)*e,o=Math.floor(i),a=mt(vt(t,o).subarray(0,o+1));return a+(bt(t.subarray(o+1))-a)*(i-o)}}function wt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f;if(r=t.length){if((e=+e)<=0||r<2)return+n(t[0],0,t);if(e>=1)return+n(t[r-1],r-1,t);var r,i=(r-1)*e,o=Math.floor(i),a=+n(t[o],o,t),u=+n(t[o+1],o+1,t);return a+(u-a)*(i-o)}}var St=function(t,e,n){return Math.ceil((n-e)/(2*(_t(t,.75)-_t(t,.25))*Math.pow(b(t),-1/3)))},Ot=function(t,e,n){return Math.ceil((n-e)/(3.5*T(t)*Math.pow(b(t),-1/3)))};function xt(t,e){var n,r=-1,i=-1;if(void 0===e){var o,a=Object(s.a)(t);try{for(a.s();!(o=a.n()).done;){var u=o.value;++i,null!=u&&(n=u)&&(n=u,r=i)}}catch(d){a.e(d)}finally{a.f()}}else{var c,f=Object(s.a)(t);try{for(f.s();!(c=f.n()).done;){var l=c.value;null!=(l=e(l,++i,t))&&(n=l)&&(n=l,r=i)}}catch(d){f.e(d)}finally{f.f()}}return r}function Et(t,e){var n=0,r=0;if(void 0===e){var i,o=Object(s.a)(t);try{for(o.s();!(i=o.n()).done;){var a=i.value;null!=a&&(a=+a)>=a&&(++n,r+=a)}}catch(d){o.e(d)}finally{o.f()}}else{var u,c=-1,f=Object(s.a)(t);try{for(f.s();!(u=f.n()).done;){var l=u.value;null!=(l=e(l,++c,t))&&(l=+l)>=l&&(++n,r+=l)}}catch(d){f.e(d)}finally{f.f()}}if(n)return r/n}var Mt=function(t,e){return _t(t,.5,e)},Tt=u.a.mark($t);function $t(t){var e,n,r;return u.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:e=Object(s.a)(t),i.prev=1,e.s();case 3:if((n=e.n()).done){i.next=8;break}return r=n.value,i.delegateYield(r,"t0",6);case 6:i.next=3;break;case 8:i.next=13;break;case 10:i.prev=10,i.t1=i.catch(1),e.e(i.t1);case 13:return i.prev=13,e.f(),i.finish(13);case 16:case"end":return i.stop()}}),Tt,null,[[1,10,13,16]])}function At(t){return Array.from($t(t))}function kt(t,e){var n,r=-1,i=-1;if(void 0===e){var o,a=Object(s.a)(t);try{for(a.s();!(o=a.n()).done;){var u=o.value;++i,null!=u&&(n>u||void 0===n&&u>=u)&&(n=u,r=i)}}catch(d){a.e(d)}finally{a.f()}}else{var c,f=Object(s.a)(t);try{for(f.s();!(c=f.n()).done;){var l=c.value;null!=(l=e(l,++i,t))&&(n>l||void 0===n&&l>=l)&&(n=l,r=i)}}catch(d){f.e(d)}finally{f.f()}}return r}function Ct(t){var e,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:It,i=[],o=!1,a=Object(s.a)(t);try{for(a.s();!(n=a.n()).done;){var u=n.value;o&&i.push(r(e,u)),e=u,o=!0}}catch(c){a.e(c)}finally{a.f()}return i}function It(t,e){return[t,e]}var Pt=function(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),o=new Array(i);++r1&&void 0!==arguments[1]?arguments[1]:i,r=!1;if(1===n.length){var o,a,u=Object(s.a)(t);try{for(u.s();!(a=u.n()).done;){var c=a.value,f=n(c);(r?i(f,o)<0:0===i(f,f))&&(e=c,o=f,r=!0)}}catch(p){u.e(p)}finally{u.f()}}else{var l,d=Object(s.a)(t);try{for(d.s();!(l=d.n()).done;){var h=l.value;(r?n(h,e)<0:0===n(h,h))&&(e=h,r=!0)}}catch(p){d.e(p)}finally{d.f()}}return e}function Rt(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;if(1===n.length)return kt(t,n);var r,o=-1,a=-1,u=Object(s.a)(t);try{for(u.s();!(r=u.n()).done;){var c=r.value;++a,(o<0?0===n(c,c):n(c,e)<0)&&(e=c,o=a)}}catch(f){u.e(f)}finally{u.f()}return o}function jt(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i,r=!1;if(1===n.length){var o,a,u=Object(s.a)(t);try{for(u.s();!(a=u.n()).done;){var c=a.value,f=n(c);(r?i(f,o)>0:0===i(f,f))&&(e=c,o=f,r=!0)}}catch(p){u.e(p)}finally{u.f()}}else{var l,d=Object(s.a)(t);try{for(d.s();!(l=d.n()).done;){var h=l.value;(r?n(h,e)>0:0===n(h,h))&&(e=h,r=!0)}}catch(p){d.e(p)}finally{d.f()}}return e}function Dt(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;if(1===n.length)return xt(t,n);var r,o=-1,a=-1,u=Object(s.a)(t);try{for(u.s();!(r=u.n()).done;){var c=r.value;++a,(o<0?0===n(c,c):n(c,e)>0)&&(e=c,o=a)}}catch(f){u.e(f)}finally{u.f()}return o}function Lt(t,e){var n=Rt(t,e);return n<0?void 0:n}var Ft=Bt(Math.random);function Bt(t){return function(e){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.length,i=r-(n=+n);i;){var o=t()*i--|0,a=e[i+n];e[i+n]=e[o+n],e[o+n]=a}return e}}function Ut(t,e){var n=0;if(void 0===e){var r,i=Object(s.a)(t);try{for(i.s();!(r=i.n()).done;){var o=r.value;(o=+o)&&(n+=o)}}catch(l){i.e(l)}finally{i.f()}}else{var a,u=-1,c=Object(s.a)(t);try{for(c.s();!(a=c.n()).done;){var f=a.value;(f=+e(f,++u,t))&&(n+=f)}}catch(l){c.e(l)}finally{c.f()}}return n}var zt=function(t){if(!(i=t.length))return[];for(var e=-1,n=bt(t,Ht),r=new Array(n);++e1?e-1:0),r=1;r1?e-1:0),r=1;r=0&&(n=t.slice(r+1),t=t.slice(0,r)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}}))}function we(t,e){for(var n,r=0,i=t.length;r0)for(var n,r,i=new Array(n),o=0;oe?1:t>=e?0:NaN}var He="http://www.w3.org/1999/xhtml",Ve={svg:"http://www.w3.org/2000/svg",xhtml:He,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qe=function(t){var e=t+="",n=e.indexOf(":");return n>=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),Ve.hasOwnProperty(e)?{space:Ve[e],local:t}:t};function We(t){return function(){this.removeAttribute(t)}}function Ge(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ke(t,e){return function(){this.setAttribute(t,e)}}function Ye(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function Ze(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function Qe(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}var Xe=function(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView};function Je(t){return function(){this.style.removeProperty(t)}}function tn(t,e,n){return function(){this.style.setProperty(t,e,n)}}function en(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function nn(t,e){return t.style.getPropertyValue(e)||Xe(t).getComputedStyle(t,null).getPropertyValue(e)}function rn(t){return function(){delete this[t]}}function on(t,e){return function(){this[t]=e}}function an(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function un(t){return t.trim().split(/^|\s+/)}function sn(t){return t.classList||new cn(t)}function cn(t){this._node=t,this._names=un(t.getAttribute("class")||"")}function fn(t,e){for(var n=sn(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function gn(){this.textContent=""}function mn(t){return function(){this.textContent=t}}function bn(t){return function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}}function vn(){this.innerHTML=""}function yn(t){return function(){this.innerHTML=t}}function _n(t){return function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}}function wn(){this.nextSibling&&this.parentNode.appendChild(this)}function Sn(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function On(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===He&&e.documentElement.namespaceURI===He?e.createElement(t):e.createElementNS(n,t)}}function xn(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}var En=function(t){var e=qe(t);return(e.local?xn:On)(e)};function Mn(){return null}function Tn(){var t=this.parentNode;t&&t.removeChild(this)}function $n(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function An(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function kn(t){return t.trim().split(/^|\s+/).map((function(t){var e="",n=t.indexOf(".");return n>=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}function Cn(t){return function(){var e=this.__on;if(e){for(var n,r=0,i=-1,o=e.length;r=w&&(w=_+1);!(y=m[w])&&++w=0;)(r=i[o])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ze);for(var n=this._groups,r=n.length,i=new Array(r),o=0;o1?this.each((null==e?Je:"function"===typeof e?en:tn)(t,e,null==n?"":n)):nn(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?rn:"function"===typeof e?an:on)(t,e)):this.node()[t]},classed:function(t,e){var n=un(t+"");if(arguments.length<2){for(var r=sn(this.node()),i=-1,o=n.length;++i>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?hr(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?hr(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=nr.exec(t))?new mr(e[1],e[2],e[3],1):(e=rr.exec(t))?new mr(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=ir.exec(t))?hr(e[1],e[2],e[3],e[4]):(e=or.exec(t))?hr(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ar.exec(t))?_r(e[1],e[2]/100,e[3]/100,1):(e=ur.exec(t))?_r(e[1],e[2]/100,e[3]/100,e[4]):sr.hasOwnProperty(t)?dr(sr[t]):"transparent"===t?new mr(NaN,NaN,NaN,0):null}function dr(t){return new mr(t>>16&255,t>>8&255,255&t,1)}function hr(t,e,n,r){return r<=0&&(t=e=n=NaN),new mr(t,e,n,r)}function pr(t){return t instanceof Yn||(t=lr(t)),t?new mr((t=t.rgb()).r,t.g,t.b,t.opacity):new mr}function gr(t,e,n,r){return 1===arguments.length?pr(t):new mr(t,e,n,null==r?1:r)}function mr(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function br(){return"#"+yr(this.r)+yr(this.g)+yr(this.b)}function vr(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function yr(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function _r(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Or(t,e,n,r)}function wr(t){if(t instanceof Or)return new Or(t.h,t.s,t.l,t.opacity);if(t instanceof Yn||(t=lr(t)),!t)return new Or;if(t instanceof Or)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,u=o-i,s=(o+i)/2;return u?(a=e===o?(n-r)/u+6*(n0&&s<1?0:a,new Or(a,u,s,t.opacity)}function Sr(t,e,n,r){return 1===arguments.length?wr(t):new Or(t,e,n,null==r?1:r)}function Or(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function xr(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function Er(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}Gn(Yn,lr,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:cr,formatHex:cr,formatHsl:function(){return wr(this).formatHsl()},formatRgb:fr,toString:fr}),Gn(mr,gr,Kn(Yn,{brighter:function(t){return t=null==t?Qn:Math.pow(Qn,t),new mr(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Zn:Math.pow(Zn,t),new mr(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:br,formatHex:br,formatRgb:vr,toString:vr})),Gn(Or,Sr,Kn(Yn,{brighter:function(t){return t=null==t?Qn:Math.pow(Qn,t),new Or(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Zn:Math.pow(Zn,t),new Or(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new mr(xr(t>=240?t-240:t+120,i,r),xr(t,i,r),xr(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Mr=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,u=r180||n<-180?n-360*Math.round(n/360):n):$r(isNaN(t)?e:t)}function Cr(t){return 1===(t=+t)?Ir:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):$r(isNaN(e)?n:e)}}function Ir(t,e){var n=e-t;return n?Ar(t,n):$r(isNaN(t)?e:t)}var Pr=function t(e){var n=Cr(e);function r(t,e){var r=n((t=gr(t)).r,(e=gr(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Ir(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Nr(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),u=new Array(i);for(n=0;no&&(i=e.slice(o,i),u[a]?u[a]+=i:u[++a]=i),(n=n[0])===(r=r[0])?u[a]?u[a]+=r:u[++a]=r:(u[++a]=null,s.push({i:a,x:zr(n,r)})),o=qr.lastIndex;return o=0&&e._call.call(null,t),e=e._next;--Xr}function li(){ni=(ei=ii.now())+ri,Xr=Jr=0;try{fi()}finally{Xr=0,function(){var t,e,n=Wr,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:Wr=e);Gr=t,hi(r)}(),ni=0}}function di(){var t=ii.now(),e=t-ei;e>1e3&&(ri-=e,ei=t)}function hi(t){Xr||(Jr&&(Jr=clearTimeout(Jr)),t-ni>24?(t<1/0&&(Jr=setTimeout(li,t-ii.now()-ri)),ti&&(ti=clearInterval(ti))):(ti||(ei=ii.now(),ti=setInterval(di,1e3)),Xr=1,oi(li)))}si.prototype=ci.prototype={constructor:si,restart:function(t,e,n){if("function"!==typeof t)throw new TypeError("callback is not a function");n=(null==n?ai():+n)+(null==e?0:+e),this._next||Gr===this||(Gr?Gr._next=this:Wr=this,Gr=this),this._call=t,this._time=n,hi()},stop:function(){this._call&&(this._call=null,this._time=1/0,hi())}};var pi=function(t,e,n){var r=new si;return e=null==e?0:+e,r.restart((function(n){r.stop(),t(n+e)}),e,n),r},gi=Oe("start","end","cancel","interrupt"),mi=[],bi=function(t,e,n,r,i,o){var a=t.__transition;if(a){if(n in a)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function o(t){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=t&&a(t-n.delay)}function a(o){var c,f,l,d;if(1!==n.state)return s();for(c in i)if((d=i[c]).name===n.name){if(3===d.state)return pi(a);4===d.state?(d.state=6,d.timer.stop(),d.on.call("interrupt",t,t.__data__,d.index,d.group),delete i[c]):+c0)throw new Error("too late; already scheduled");return n}function yi(t,e){var n=_i(t,e);if(n.state>3)throw new Error("too late; already running");return n}function _i(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}var wi,Si=function(t,e){var n,r,i,o=t.__transition,a=!0;if(o){for(i in e=null==e?null:e+"",o)(n=o[i]).name===e?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete o[i]):a=!1;a&&delete t.__transition}},Oi=180/Math.PI,xi={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1},Ei=function(t,e,n,r,i,o){var a,u,s;return(a=Math.sqrt(t*t+e*e))&&(t/=a,e/=a),(s=t*n+e*r)&&(n-=t*s,r-=e*s),(u=Math.sqrt(n*n+r*r))&&(n/=u,r/=u,s/=u),t*r180?e+=360:e-t>180&&(t+=360),o.push({i:n.push(i(n)+"rotate(",null,r)-2,x:zr(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(o.rotate,a.rotate,u,s),function(t,e,n,o){t!==e?o.push({i:n.push(i(n)+"skewX(",null,r)-2,x:zr(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(o.skewX,a.skewX,u,s),function(t,e,n,r,o,a){if(t!==n||e!==r){var u=o.push(i(o)+"scale(",null,",",null,")");a.push({i:u-4,x:zr(t,n)},{i:u-2,x:zr(e,r)})}else 1===n&&1===r||o.push(i(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,a.scaleX,a.scaleY,u,s),o=a=null,function(t){for(var e,n=-1,r=s.length;++n=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?vi:yi;return function(){var a=o(this,t),u=a.on;u!==r&&(i=(r=u).copy()).on(e,n),a.on=i}}var Yi=Un.prototype.constructor;function Zi(t){return function(){this.style.removeProperty(t)}}function Qi(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Xi(t,e,n){var r,i;function o(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Qi(t,o,n)),r}return o._value=e,o}function Ji(t){return function(e){this.textContent=t.call(this,e)}}function to(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&Ji(r)),e}return r._value=t,r}var eo=0;function no(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function ro(t){return Un().transition(t)}function io(){return++eo}var oo=Un.prototype;function ao(t){return t*t*t}function uo(t){return--t*t*t+1}function so(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}no.prototype=ro.prototype=Object(xe.a)({constructor:no,select:function(t){var e=this._name,n=this._id;"function"!==typeof t&&(t=Me(t));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a1&&n.name===e)return new no([[t]],lo,e,+r);return null},po=function(t){return function(){return t}};function go(t,e){var n=e.sourceEvent,r=e.target,i=e.selection,o=e.mode,a=e.dispatch;Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:o,enumerable:!0,configurable:!0},_:{value:a}})}function mo(t){t.stopImmediatePropagation()}var bo=function(t){t.preventDefault(),t.stopImmediatePropagation()},vo={name:"drag"},yo={name:"space"},_o={name:"handle"},wo={name:"center"},So=Math.abs,Oo=Math.max,xo=Math.min;function Eo(t){return[+t[0],+t[1]]}function Mo(t){return[Eo(t[0]),Eo(t[1])]}var To={name:"x",handles:["w","e"].map(Ro),input:function(t,e){return null==t?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},$o={name:"y",handles:["n","s"].map(Ro),input:function(t,e){return null==t?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},Ao={name:"xy",handles:["n","w","e","s","nw","ne","sw","se"].map(Ro),input:function(t){return null==t?null:Mo(t)},output:function(t){return t}},ko={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Co={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},Io={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Po={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},No={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Ro(t){return{type:t}}function jo(t){return!t.ctrlKey&&!t.button}function Do(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?[[(t=t.viewBox.baseVal).x,t.y],[t.x+t.width,t.y+t.height]]:[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Lo(){return navigator.maxTouchPoints||"ontouchstart"in this}function Fo(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Bo(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function Uo(t){var e=t.__brush;return e?e.dim.output(e.selection):null}function zo(){return qo(To)}function Ho(){return qo($o)}var Vo=function(){return qo(Ao)};function qo(t){var e,n=Do,r=jo,i=Lo,o=!0,a=Oe("start","brush","end"),u=6;function c(e){var n=e.property("__brush",m).selectAll(".overlay").data([Ro("overlay")]);n.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",ko.overlay).merge(n).each((function(){var t=Fo(this).extent;zn(this).attr("x",t[0][0]).attr("y",t[0][1]).attr("width",t[1][0]-t[0][0]).attr("height",t[1][1]-t[0][1])})),e.selectAll(".selection").data([Ro("selection")]).enter().append("rect").attr("class","selection").attr("cursor",ko.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var r=e.selectAll(".handle").data(t.handles,(function(t){return t.type}));r.exit().remove(),r.enter().append("rect").attr("class",(function(t){return"handle handle--"+t.type})).attr("cursor",(function(t){return ko[t.type]})),e.each(f).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",h).filter(i).on("touchstart.brush",h).on("touchmove.brush",p).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(){var t=zn(this),e=Fo(this).selection;e?(t.selectAll(".selection").style("display",null).attr("x",e[0][0]).attr("y",e[0][1]).attr("width",e[1][0]-e[0][0]).attr("height",e[1][1]-e[0][1]),t.selectAll(".handle").style("display",null).attr("x",(function(t){return"e"===t.type[t.type.length-1]?e[1][0]-u/2:e[0][0]-u/2})).attr("y",(function(t){return"s"===t.type[0]?e[1][1]-u/2:e[0][1]-u/2})).attr("width",(function(t){return"n"===t.type||"s"===t.type?e[1][0]-e[0][0]+u:u})).attr("height",(function(t){return"e"===t.type||"w"===t.type?e[1][1]-e[0][1]+u:u}))):t.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function l(t,e,n){var r=t.__brush.emitter;return!r||n&&r.clean?new d(t,e,n):r}function d(t,e,n){this.that=t,this.args=e,this.state=t.__brush,this.active=0,this.clean=n}function h(n){if((!e||n.touches)&&r.apply(this,arguments)){var i,a,u,c,d,h,p,g,m,b,v,y=this,_=n.target.__data__.type,w="selection"===(o&&n.metaKey?_="overlay":_)?vo:o&&n.altKey?wo:_o,S=t===$o?null:Po[_],O=t===To?null:No[_],x=Fo(y),E=x.extent,M=x.selection,T=E[0][0],$=E[0][1],A=E[1][0],k=E[1][1],C=0,I=0,P=S&&O&&o&&n.shiftKey,N=Array.from(n.touches||[n],(function(t){var e=t.identifier;return(t=Qr(t,y)).point0=t.slice(),t.identifier=e,t}));if("overlay"===_){M&&(m=!0);var R=[N[0],N[1]||N[0]];x.selection=M=[[i=t===$o?T:xo(R[0][0],R[1][0]),u=t===To?$:xo(R[0][1],R[1][1])],[d=t===$o?A:Oo(R[0][0],R[1][0]),p=t===To?k:Oo(R[0][1],R[1][1])]],N.length>1&&U()}else i=M[0][0],u=M[0][1],d=M[1][0],p=M[1][1];a=i,c=u,h=d,g=p;var j=zn(y).attr("pointer-events","none"),D=j.selectAll(".overlay").attr("cursor",ko[_]);Si(y);var L=l(y,arguments,!0).beforestart();if(n.touches)L.moved=B,L.ended=z;else{var F=zn(n.view).on("mousemove.brush",B,!0).on("mouseup.brush",z,!0);o&&F.on("keydown.brush",H,!0).on("keyup.brush",V,!0),qn(n.view)}f.call(y),L.start(n,w.name)}function B(t){var e,n=Object(s.a)(t.changedTouches||[t]);try{for(n.s();!(e=n.n()).done;){var r,i=e.value,o=Object(s.a)(N);try{for(o.s();!(r=o.n()).done;){var a=r.value;a.identifier===i.identifier&&(a.cur=Qr(i,y))}}catch(d){o.e(d)}finally{o.f()}}}catch(d){n.e(d)}finally{n.f()}if(P&&!b&&!v&&1===N.length){var u=N[0];So(u.cur[0]-u[0])>So(u.cur[1]-u[1])?v=!0:b=!0}var c,f=Object(s.a)(N);try{for(f.s();!(c=f.n()).done;){var l=c.value;l.cur&&(l[0]=l.cur[0],l[1]=l.cur[1])}}catch(d){f.e(d)}finally{f.f()}m=!0,bo(t),U(t)}function U(t){var e,n=N[0],r=n.point0;switch(C=n[0]-r[0],I=n[1]-r[1],w){case yo:case vo:S&&(C=Oo(T-i,xo(A-d,C)),a=i+C,h=d+C),O&&(I=Oo($-u,xo(k-p,I)),c=u+I,g=p+I);break;case _o:N[1]?(S&&(a=Oo(T,xo(A,N[0][0])),h=Oo(T,xo(A,N[1][0])),S=1),O&&(c=Oo($,xo(k,N[0][1])),g=Oo($,xo(k,N[1][1])),O=1)):(S<0?(C=Oo(T-i,xo(A-i,C)),a=i+C,h=d):S>0&&(C=Oo(T-d,xo(A-d,C)),a=i,h=d+C),O<0?(I=Oo($-u,xo(k-u,I)),c=u+I,g=p):O>0&&(I=Oo($-p,xo(k-p,I)),c=u,g=p+I));break;case wo:S&&(a=Oo(T,xo(A,i-C*S)),h=Oo(T,xo(A,d+C*S))),O&&(c=Oo($,xo(k,u-I*O)),g=Oo($,xo(k,p+I*O)))}h0&&(i=a-C),O<0?p=g-I:O>0&&(u=c-I),w=yo,D.attr("cursor",ko.selection),U());break;default:return}bo(t)}function V(t){switch(t.keyCode){case 16:P&&(b=v=P=!1,U());break;case 18:w===wo&&(S<0?d=h:S>0&&(i=a),O<0?p=g:O>0&&(u=c),w=_o,U());break;case 32:w===yo&&(t.altKey?(S&&(d=h-C*S,i=a+C*S),O&&(p=g-I*O,u=c+I*O),w=wo):(S<0?d=h:S>0&&(i=a),O<0?p=g:O>0&&(u=c),w=_o),D.attr("cursor",ko[_]),U());break;default:return}bo(t)}}function p(t){l(this,arguments).moved(t)}function g(t){l(this,arguments).ended(t)}function m(){var e=this.__brush||{selection:null};return e.extent=Mo(n.apply(this,arguments)),e.dim=t,e}return c.move=function(e,n){e.tween?e.on("start.brush",(function(t){l(this,arguments).beforestart().start(t)})).on("interrupt.brush end.brush",(function(t){l(this,arguments).end(t)})).tween("brush",(function(){var e=this,r=e.__brush,i=l(e,arguments),o=r.selection,a=t.input("function"===typeof n?n.apply(this,arguments):n,r.extent),u=Yr(o,a);function s(t){r.selection=1===t&&null===a?null:u(t),f.call(e),i.brush()}return null!==o&&null!==a?s:s(1)})):e.each((function(){var e=this,r=arguments,i=e.__brush,o=t.input("function"===typeof n?n.apply(e,r):n,i.extent),a=l(e,r).beforestart();Si(e),i.selection=null===o?null:o,f.call(e),a.start().brush().end()}))},c.clear=function(t){c.move(t,null)},d.prototype={beforestart:function(){return 1===++this.active&&(this.state.emitter=this,this.starting=!0),this},start:function(t,e){return this.starting?(this.starting=!1,this.emit("start",t,e)):this.emit("brush",t),this},brush:function(t,e){return this.emit("brush",t,e),this},end:function(t,e){return 0===--this.active&&(delete this.state.emitter,this.emit("end",t,e)),this},emit:function(e,n,r){var i=zn(this.that).datum();a.call(e,this.that,new go(e,{sourceEvent:n,target:c,selection:t.output(this.state.selection),mode:r,dispatch:a}),i)}},c.extent=function(t){return arguments.length?(n="function"===typeof t?t:po(Mo(t)),c):n},c.filter=function(t){return arguments.length?(r="function"===typeof t?t:po(!!t),c):r},c.touchable=function(t){return arguments.length?(i="function"===typeof t?t:po(!!t),c):i},c.handleSize=function(t){return arguments.length?(u=+t,c):u},c.keyModifiers=function(t){return arguments.length?(o=!!t,c):o},c.on=function(){var t=a.on.apply(a,arguments);return t===a?c:t},c}var Wo=Math.abs,Go=Math.cos,Ko=Math.sin,Yo=Math.PI,Zo=Yo/2,Qo=2*Yo,Xo=Math.max,Jo=1e-12;function ta(t,e){return Array.from({length:e-t},(function(e,n){return t+n}))}function ea(t){return function(e,n){return t(e.source.value+e.target.value,n.source.value+n.target.value)}}var na=function(){return oa(!1,!1)};function ra(){return oa(!1,!0)}function ia(){return oa(!0,!1)}function oa(t,e){var n=0,r=null,i=null,o=null;function a(a){var u,c=a.length,f=new Array(c),l=ta(0,c),d=new Array(c*c),h=new Array(c),p=0;a=Float64Array.from({length:c*c},e?function(t,e){return a[e%c][e/c|0]}:function(t,e){return a[e/c|0][e%c]});for(var g=0;gsa)if(Math.abs(f*u-s*c)>sa&&i){var d=n-o,h=r-a,p=u*u+s*s,g=d*d+h*h,m=Math.sqrt(p),b=Math.sqrt(l),v=i*Math.tan((aa-Math.acos((p+l-g)/(2*m*b)))/2),y=v/b,_=v/m;Math.abs(y-1)>sa&&(this._+="L"+(t+y*c)+","+(e+y*f)),this._+="A"+i+","+i+",0,0,"+ +(f*d>c*h)+","+(this._x1=t+_*u)+","+(this._y1=e+_*s)}else this._+="L"+(this._x1=t)+","+(this._y1=e);else;},arc:function(t,e,n,r,i,o){t=+t,e=+e,o=!!o;var a=(n=+n)*Math.cos(r),u=n*Math.sin(r),s=t+a,c=e+u,f=1^o,l=o?r-i:i-r;if(n<0)throw new Error("negative radius: "+n);null===this._x1?this._+="M"+s+","+c:(Math.abs(this._x1-s)>sa||Math.abs(this._y1-c)>sa)&&(this._+="L"+s+","+c),n&&(l<0&&(l=l%ua+ua),l>ca?this._+="A"+n+","+n+",0,1,"+f+","+(t-a)+","+(e-u)+"A"+n+","+n+",0,1,"+f+","+(this._x1=s)+","+(this._y1=c):l>sa&&(this._+="A"+n+","+n+",0,"+ +(l>=aa)+","+f+","+(this._x1=t+n*Math.cos(i))+","+(this._y1=e+n*Math.sin(i))))},rect:function(t,e,n,r){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var da=la,ha=Array.prototype.slice,pa=function(t){return function(){return t}};function ga(t){return t.source}function ma(t){return t.target}function ba(t){return t.radius}function va(t){return t.startAngle}function ya(t){return t.endAngle}function _a(){return 0}function wa(){return 10}function Sa(t){var e=ga,n=ma,r=ba,i=ba,o=va,a=ya,u=_a,s=null;function c(){var c,f=e.apply(this,arguments),l=n.apply(this,arguments),d=u.apply(this,arguments)/2,h=ha.call(arguments),p=+r.apply(this,(h[0]=f,h)),g=o.apply(this,h)-Zo,m=a.apply(this,h)-Zo,b=+i.apply(this,(h[0]=l,h)),v=o.apply(this,h)-Zo,y=a.apply(this,h)-Zo;if(s||(s=c=da()),d>Jo&&(Wo(m-g)>2*d+Jo?m>g?(g+=d,m-=d):(g-=d,m+=d):g=m=(g+m)/2,Wo(y-v)>2*d+Jo?y>v?(v+=d,y-=d):(v-=d,y+=d):v=y=(v+y)/2),s.moveTo(p*Go(g),p*Ko(g)),s.arc(0,0,p,g,m),g!==v||m!==y)if(t){var _=+t.apply(this,arguments),w=b-_,S=(v+y)/2;s.quadraticCurveTo(0,0,w*Go(v),w*Ko(v)),s.lineTo(b*Go(S),b*Ko(S)),s.lineTo(w*Go(y),w*Ko(y))}else s.quadraticCurveTo(0,0,b*Go(v),b*Ko(v)),s.arc(0,0,b,v,y);if(s.quadraticCurveTo(0,0,p*Go(g),p*Ko(g)),s.closePath(),c)return s=null,c+""||null}return t&&(c.headRadius=function(e){return arguments.length?(t="function"===typeof e?e:pa(+e),c):t}),c.radius=function(t){return arguments.length?(r=i="function"===typeof t?t:pa(+t),c):r},c.sourceRadius=function(t){return arguments.length?(r="function"===typeof t?t:pa(+t),c):r},c.targetRadius=function(t){return arguments.length?(i="function"===typeof t?t:pa(+t),c):i},c.startAngle=function(t){return arguments.length?(o="function"===typeof t?t:pa(+t),c):o},c.endAngle=function(t){return arguments.length?(a="function"===typeof t?t:pa(+t),c):a},c.padAngle=function(t){return arguments.length?(u="function"===typeof t?t:pa(+t),c):u},c.source=function(t){return arguments.length?(e=t,c):e},c.target=function(t){return arguments.length?(n=t,c):n},c.context=function(t){return arguments.length?(s=null==t?null:t,c):s},c}var Oa=function(){return Sa()};function xa(){return Sa(wa)}var Ea=Math.PI/180,Ma=180/Math.PI,Ta=.96422,$a=.82521,Aa=4/29,ka=6/29,Ca=3*ka*ka;function Ia(t){if(t instanceof Ra)return new Ra(t.l,t.a,t.b,t.opacity);if(t instanceof Ha)return Va(t);t instanceof mr||(t=pr(t));var e,n,r=Fa(t.r),i=Fa(t.g),o=Fa(t.b),a=ja((.2225045*r+.7168786*i+.0606169*o)/1);return r===i&&i===o?e=n=a:(e=ja((.4360747*r+.3850649*i+.1430804*o)/Ta),n=ja((.0139322*r+.0971045*i+.7141733*o)/$a)),new Ra(116*a-16,500*(e-a),200*(a-n),t.opacity)}function Pa(t,e){return new Ra(t,0,0,null==e?1:e)}function Na(t,e,n,r){return 1===arguments.length?Ia(t):new Ra(t,e,n,null==r?1:r)}function Ra(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function ja(t){return t>.008856451679035631?Math.pow(t,1/3):t/Ca+Aa}function Da(t){return t>ka?t*t*t:Ca*(t-Aa)}function La(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Fa(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ba(t){if(t instanceof Ha)return new Ha(t.h,t.c,t.l,t.opacity);if(t instanceof Ra||(t=Ia(t)),0===t.a&&0===t.b)return new Ha(NaN,0r!==h>r&&n<(d-c)*(r-f)/(h-f)+c&&(i=-i)}return i}function uu(t,e,n){var r,i,o,a;return function(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}(t,e,n)&&(i=t[r=+(t[0]===e[0])],o=n[r],a=e[r],i<=o&&o<=a||a<=o&&o<=i)}var su=function(){},cu=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]],fu=function(){var t=1,e=1,n=pt,r=u;function i(t){var e=n(t);if(Array.isArray(e))e=e.slice().sort(ru);else{var r=$(t),i=r[0],a=r[1];e=dt(i,a,e),e=Pt(Math.floor(i/e)*e,Math.floor(a/e)*e,e)}return e.map((function(e){return o(t,e)}))}function o(n,i){var o=[],u=[];return function(n,r,i){var o,u,s,c,f,l,d=new Array,h=new Array;o=u=-1,c=n[0]>=r,cu[c<<1].forEach(p);for(;++o=r,cu[s|c<<1].forEach(p);cu[c<<0].forEach(p);for(;++u=r,f=n[u*t]>=r,cu[c<<1|f<<2].forEach(p);++o=r,l=f,f=n[u*t+o+1]>=r,cu[s|c<<1|f<<2|l<<3].forEach(p);cu[c|f<<3].forEach(p)}o=-1,f=n[u*t]>=r,cu[f<<2].forEach(p);for(;++o=r,cu[f<<2|l<<3].forEach(p);function p(t){var e,n,r=[t[0][0]+o,t[0][1]+u],s=[t[1][0]+o,t[1][1]+u],c=a(r),f=a(s);(e=h[c])?(n=d[f])?(delete h[e.end],delete d[n.start],e===n?(e.ring.push(s),i(e.ring)):d[e.start]=h[n.end]={start:e.start,end:n.end,ring:e.ring.concat(n.ring)}):(delete h[e.end],e.ring.push(s),h[e.end=f]=e):(e=d[f])?(n=h[c])?(delete d[e.start],delete h[n.end],e===n?(e.ring.push(s),i(e.ring)):d[n.start]=h[e.end]={start:n.start,end:e.end,ring:n.ring.concat(e.ring)}):(delete d[e.start],e.ring.unshift(r),d[e.start=c]=e):d[c]=h[f]={start:c,end:f,ring:[r,s]}}cu[f<<3].forEach(p)}(n,i,(function(t){r(t,n,i),function(t){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e0?o.push([t]):u.push(t)})),u.forEach((function(t){for(var e,n=0,r=o.length;n0&&a0&&u=0&&o>=0))throw new Error("invalid size");return t=r,e=o,i},i.thresholds=function(t){return arguments.length?(n="function"===typeof t?t:Array.isArray(t)?iu(nu.call(t)):iu(t),i):n},i.smooth=function(t){return arguments.length?(r=t?u:su,i):r===u},i};function lu(t,e,n){for(var r=t.width,i=t.height,o=1+(n<<1),a=0;a=n&&(u>=o&&(s-=t.data[u-o+a*r]),e.data[u-n+a*r]=s/Math.min(u+1,r-1+o-u,o))}function du(t,e,n){for(var r=t.width,i=t.height,o=1+(n<<1),a=0;a=n&&(u>=o&&(s-=t.data[a+(u-o)*r]),e.data[a+(u-n)*r]=s/Math.min(u+1,i-1+o-u,o))}function hu(t){return t[0]}function pu(t){return t[1]}function gu(){return 1}var mu=function(){var t=hu,e=pu,n=gu,r=960,i=500,o=20,a=2,u=3*o,s=r+2*u>>a,c=i+2*u>>a,f=iu(20);function l(r){var i=new Float32Array(s*c),l=new Float32Array(s*c);r.forEach((function(r,o,f){var l=+t(r,o,f)+u>>a,d=+e(r,o,f)+u>>a,h=+n(r,o,f);l>=0&&l=0&&d>a),du({width:s,height:c,data:l},{width:s,height:c,data:i},o>>a),lu({width:s,height:c,data:i},{width:s,height:c,data:l},o>>a),du({width:s,height:c,data:l},{width:s,height:c,data:i},o>>a),lu({width:s,height:c,data:i},{width:s,height:c,data:l},o>>a),du({width:s,height:c,data:l},{width:s,height:c,data:i},o>>a);var h=f(i);if(!Array.isArray(h)){var p=mt(i);h=dt(0,p,h),(h=Pt(0,Math.floor(p/h)*h,h)).shift()}return fu().thresholds(h).size([s,c])(i).map(d)}function d(t){return t.value*=Math.pow(2,-2*a),t.coordinates.forEach(h),t}function h(t){t.forEach(p)}function p(t){t.forEach(g)}function g(t){t[0]=t[0]*Math.pow(2,a)-u,t[1]=t[1]*Math.pow(2,a)-u}function m(){return s=r+2*(u=3*o)>>a,c=i+2*u>>a,l}return l.x=function(e){return arguments.length?(t="function"===typeof e?e:iu(+e),l):t},l.y=function(t){return arguments.length?(e="function"===typeof t?t:iu(+t),l):e},l.weight=function(t){return arguments.length?(n="function"===typeof t?t:iu(+t),l):n},l.size=function(t){if(!arguments.length)return[r,i];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))throw new Error("invalid size");return r=e,i=n,m()},l.cellSize=function(t){if(!arguments.length)return 1<=1))throw new Error("invalid cell size");return a=Math.floor(Math.log(t)/Math.LN2),m()},l.thresholds=function(t){return arguments.length?(f="function"===typeof t?t:Array.isArray(t)?iu(nu.call(t)):iu(t),l):f},l.bandwidth=function(t){if(!arguments.length)return Math.sqrt(o*(o+1));if(!((t=+t)>=0))throw new Error("invalid bandwidth");return o=Math.round((Math.sqrt(4*t*t+1)-1)/2),m()},l},bu=Math.pow(2,-52),vu=new Uint32Array(512),yu=function(){function t(e){Object(A.a)(this,t);var n=e.length>>1;if(n>0&&"number"!==typeof e[0])throw new Error("Expected coords to contain numbers.");this.coords=e;var r=Math.max(2*n-5,0);this._triangles=new Uint32Array(3*r),this._halfedges=new Int32Array(3*r),this._hashSize=Math.ceil(Math.sqrt(n)),this._hullPrev=new Uint32Array(n),this._hullNext=new Uint32Array(n),this._hullTri=new Uint32Array(n),this._hullHash=new Int32Array(this._hashSize).fill(-1),this._ids=new Uint32Array(n),this._dists=new Float64Array(n),this.update()}return Object(k.a)(t,[{key:"update",value:function(){for(var t=this.coords,e=this._hullPrev,n=this._hullNext,r=this._hullTri,i=this._hullHash,o=t.length>>1,a=1/0,u=1/0,s=-1/0,c=-1/0,f=0;fs&&(s=l),d>c&&(c=d),this._ids[f]=f}for(var h,p,g,m=(a+s)/2,b=(u+c)/2,v=1/0,y=0;y0&&(p=O,v=x)}for(var E=t[2*p],M=t[2*p+1],T=1/0,$=0;$j&&(P[N++]=D,j=this._dists[D])}return this.hull=P.subarray(0,N),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}if(Su(w,S,E,M,k,C)){var L=p,F=E,B=M;p=g,E=k,M=C,g=L,k=F,C=B}var U=function(t,e,n,r,i,o){var a=n-t,u=r-e,s=i-t,c=o-e,f=a*a+u*u,l=s*s+c*c,d=.5/(a*c-u*s);return{x:t+(c*f-u*l)*d,y:e+(a*l-s*f)*d}}(w,S,E,M,k,C);this._cx=U.x,this._cy=U.y;for(var z=0;z0&&Math.abs(K-V)<=bu&&Math.abs(Y-q)<=bu)&&(V=K,q=Y,G!==h&&G!==p&&G!==g)){for(var Z=0,Q=0,X=this._hashKey(K,Y);Q0?3-n:1+n)/4}(t-this._cx,e-this._cy)*this._hashSize)%this._hashSize}},{key:"_legalize",value:function(t){for(var e=this._triangles,n=this._halfedges,r=this.coords,i=0,o=0;;){var a=n[t],u=t-t%3;if(o=u+(t+2)%3,-1!==a){var s=a-a%3,c=u+(t+1)%3,f=s+(a+2)%3,l=e[o],d=e[t],h=e[c],p=e[f];if(Ou(r[2*l],r[2*l+1],r[2*d],r[2*d+1],r[2*h],r[2*h+1],r[2*p],r[2*p+1])){e[t]=p,e[a]=l;var g=n[f];if(-1===g){var m=this._hullStart;do{if(this._hullTri[m]===f){this._hullTri[m]=t;break}m=this._hullPrev[m]}while(m!==this._hullStart)}this._link(t,g),this._link(a,n[o]),this._link(o,f);var b=s+(a+1)%3;i1&&void 0!==arguments[1]?arguments[1]:Tu,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$u,i=e.length,o=new Float64Array(2*i),a=0;a=33306690738754716e-32*Math.abs(a+u)?a-u:0}function Su(t,e,n,r,i,o){return(wu(i,o,t,e,n,r)||wu(t,e,n,r,i,o)||wu(n,r,i,o,t,e))<0}function Ou(t,e,n,r,i,o,a,u){var s=t-a,c=e-u,f=n-a,l=r-u,d=i-a,h=o-u,p=f*f+l*l,g=d*d+h*h;return s*(l*g-p*h)-c*(f*g-p*d)+(s*s+c*c)*(f*h-l*d)<0}function xu(t,e,n,r,i,o){var a=n-t,u=r-e,s=i-t,c=o-e,f=a*a+u*u,l=s*s+c*c,d=.5/(a*c-u*s),h=(c*f-u*l)*d,p=(a*l-s*f)*d;return h*h+p*p}function Eu(t,e,n,r){if(r-n<=20)for(var i=n+1;i<=r;i++){for(var o=t[i],a=e[o],u=i-1;u>=n&&e[t[u]]>a;)t[u+1]=t[u--];t[u+1]=o}else{var s=n+1,c=r;Mu(t,n+r>>1,s),e[t[n]]>e[t[r]]&&Mu(t,n,r),e[t[s]]>e[t[r]]&&Mu(t,s,r),e[t[n]]>e[t[s]]&&Mu(t,n,s);for(var f=t[s],l=e[f];;){do{s++}while(e[t[s]]l);if(c=c-n?(Eu(t,e,s,r),Eu(t,e,n,c-1)):(Eu(t,e,n,c-1),Eu(t,e,s,r))}}function Mu(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Tu(t){return t[0]}function $u(t){return t[1]}var Au=1e-6,ku=function(){function t(){Object(A.a)(this,t),this._x0=this._y0=this._x1=this._y1=null,this._=""}return Object(k.a)(t,[{key:"moveTo",value:function(t,e){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e)}},{key:"closePath",value:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}},{key:"lineTo",value:function(t,e){this._+="L".concat(this._x1=+t,",").concat(this._y1=+e)}},{key:"arc",value:function(t,e,n){var r=(t=+t)+(n=+n),i=e=+e;if(n<0)throw new Error("negative radius");null===this._x1?this._+="M".concat(r,",").concat(i):(Math.abs(this._x1-r)>Au||Math.abs(this._y1-i)>Au)&&(this._+="L"+r+","+i),n&&(this._+="A".concat(n,",").concat(n,",0,1,1,").concat(t-n,",").concat(e,"A").concat(n,",").concat(n,",0,1,1,").concat(this._x1=r,",").concat(this._y1=i))}},{key:"rect",value:function(t,e,n,r){this._+="M".concat(this._x0=this._x1=+t,",").concat(this._y0=this._y1=+e,"h").concat(+n,"v").concat(+r,"h").concat(-n,"Z")}},{key:"value",value:function(){return this._||null}}]),t}(),Cu=function(){function t(){Object(A.a)(this,t),this._=[]}return Object(k.a)(t,[{key:"moveTo",value:function(t,e){this._.push([t,e])}},{key:"closePath",value:function(){this._.push(this._[0].slice())}},{key:"lineTo",value:function(t,e){this._.push([t,e])}},{key:"value",value:function(){return this._.length?this._:null}}]),t}(),Iu=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,960,500],r=Object(P.a)(n,4),i=r[0],o=r[1],a=r[2],u=r[3];if(Object(A.a)(this,t),!((a=+a)>=(i=+i))||!((u=+u)>=(o=+o)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=a,this.xmin=i,this.ymax=u,this.ymin=o,this._init()}return Object(k.a)(t,[{key:"update",value:function(){return this.delaunay.update(),this._init(),this}},{key:"_init",value:function(){for(var t,e,n=this.delaunay,r=n.points,i=n.hull,o=n.triangles,a=this.vectors,u=this.circumcenters=this._circumcenters.subarray(0,o.length/3*2),s=0,c=0,f=o.length;s1;)i-=2;for(var o=2;o4)for(var u=0;u0){if(e>=this.ymax)return null;(i=(this.ymax-e)/r)0){if(t>=this.xmax)return null;(i=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}}]),t}(),Pu=u.a.mark(Uu),Nu=2*Math.PI,Ru=Math.pow;function ju(t){return t[0]}function Du(t){return t[1]}function Lu(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}var Fu=function(){function t(e){Object(A.a)(this,t),this._delaunator=new yu(e),this.inedges=new Int32Array(e.length/2),this._hullIndex=new Int32Array(e.length/2),this.points=this._delaunator.coords,this._init()}return Object(k.a)(t,[{key:"update",value:function(){return this._delaunator.update(),this._init(),this}},{key:"_init",value:function(){var t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&function(t){for(var e=t.triangles,n=t.coords,r=0;r1e-10)return!1}return!0}(t)){this.collinear=Int32Array.from({length:e.length/2},(function(t,e){return e})).sort((function(t,n){return e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]}));for(var n=this.collinear[0],r=this.collinear[this.collinear.length-1],i=[e[2*n],e[2*n+1],e[2*r],e[2*r+1]],o=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]),a=0,u=e.length/2;a0&&(this.triangles=new Int32Array(3).fill(-1),this.halfedges=new Int32Array(3).fill(-1),this.triangles[0]=f[0],this.triangles[1]=f[1],this.triangles[2]=f[1],d[f[0]]=1,2===f.length&&(d[f[1]]=0))}},{key:"voronoi",value:function(t){return new Iu(this,t)}},{key:"neighbors",value:u.a.mark((function t(e){var n,r,i,o,a,s,c,f,l,d,h;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.inedges,r=this.hull,i=this._hullIndex,o=this.halfedges,a=this.triangles,!(s=this.collinear)){t.next=10;break}if(!((c=s.indexOf(e))>0)){t.next=6;break}return t.next=6,s[c-1];case 6:if(!(c2&&void 0!==arguments[2]?arguments[2]:0;if((t=+t)!==t||(e=+e)!==e)return-1;for(var r,i=n;(r=this._step(n,t,e))>=0&&r!==n&&r!==i;)n=r;return r}},{key:"_step",value:function(t,e,n){var r=this.inedges,i=this.hull,o=this._hullIndex,a=this.halfedges,u=this.triangles,s=this.points;if(-1===r[t]||!s.length)return(t+1)%(s.length>>1);var c=t,f=Ru(e-s[2*t],2)+Ru(n-s[2*t+1],2),l=r[t],d=l;do{var h=u[d],p=Ru(e-s[2*h],2)+Ru(n-s[2*h+1],2);if(p1&&void 0!==arguments[1]?arguments[1]:2,n=null==t?t=new ku:void 0,r=this.points,i=0,o=r.length;i1&&void 0!==arguments[1]?arguments[1]:ju,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Du,i=arguments.length>3?arguments[3]:void 0;return new t("length"in e?Bu(e,n,r,i):Float64Array.from(Uu(e,n,r,i)))}}]),t}();function Bu(t,e,n,r){for(var i=t.length,o=new Float64Array(2*i),a=0;al}s.mouse("drag",r)}function g(t){zn(t.view).on("mousemove.drag mouseup.drag",null),Wn(t.view,n),Vn(t),s.mouse("end",t)}function m(t,e){if(i.call(this,t,e)){var n,r,a=t.changedTouches,u=o.call(this,t,e),s=a.length;for(n=0;n9999?"+"+Ju(e,6):Ju(e,4))+"-"+Ju(t.getUTCMonth()+1,2)+"-"+Ju(t.getUTCDate(),2)+(o?"T"+Ju(n,2)+":"+Ju(r,2)+":"+Ju(i,2)+"."+Ju(o,3)+"Z":i?"T"+Ju(n,2)+":"+Ju(r,2)+":"+Ju(i,2)+"Z":r||n?"T"+Ju(n,2)+":"+Ju(r,2)+"Z":"")}var es=function(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function r(t,e){var r,i=[],o=t.length,a=0,u=0,s=o<=0,c=!1;function f(){if(s)return Zu;if(c)return c=!1,Yu;var e,r,i=a;if(34===t.charCodeAt(i)){for(;a++=o?s=!0:10===(r=t.charCodeAt(a++))?c=!0:13===r&&(c=!0,10===t.charCodeAt(a)&&++a),t.slice(i+1,e-1).replace(/""/g,'"')}for(;a=(o=(g+b)/2))?g=o:b=o,(f=n>=(a=(m+v)/2))?m=a:v=a,i=h,!(h=h[l=f<<1|c]))return i[l]=p,t;if(u=+t._x.call(null,h.data),s=+t._y.call(null,h.data),e===u&&n===s)return p.next=h,i?i[l]=p:t._root=p,t;do{i=i?i[l]=new Array(4):t._root=new Array(4),(c=e>=(o=(g+b)/2))?g=o:b=o,(f=n>=(a=(m+v)/2))?m=a:v=a}while((l=f<<1|c)===(d=(s>=a)<<1|u>=o));return i[d]=h,i[l]=p,t}var bc=function(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i};function vc(t){return t[0]}function yc(t){return t[1]}function _c(t,e,n){var r=new wc(null==e?vc:e,null==n?yc:n,NaN,NaN,NaN,NaN);return null==t?r:r.addAll(t)}function wc(t,e,n,r,i,o){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=o,this._root=void 0}function Sc(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var Oc=_c.prototype=wc.prototype;Oc.copy=function(){var t,e,n=new wc(this._x,this._y,this._x0,this._y0,this._x1,this._y1),r=this._root;if(!r)return n;if(!r.length)return n._root=Sc(r),n;for(t=[{source:r,target:n._root=new Array(4)}];r=t.pop();)for(var i=0;i<4;++i)(e=r.source[i])&&(e.length?t.push({source:e,target:r.target[i]=new Array(4)}):r.target[i]=Sc(e));return n},Oc.add=function(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return mc(this.cover(e,n),e,n,t)},Oc.addAll=function(t){var e,n,r,i,o=t.length,a=new Array(o),u=new Array(o),s=1/0,c=1/0,f=-1/0,l=-1/0;for(n=0;nf&&(f=r),il&&(l=i));if(s>f||c>l)return this;for(this.cover(s,c).cover(f,l),n=0;nt||t>=i||r>e||e>=o;)switch(u=(ed||(o=s.y0)>h||(a=s.x1)=b)<<1|t>=m)&&(s=p[p.length-1],p[p.length-1]=p[p.length-1-c],p[p.length-1-c]=s)}else{var v=t-+this._x.call(null,g.data),y=e-+this._y.call(null,g.data),_=v*v+y*y;if(_=(u=(p+m)/2))?p=u:m=u,(f=a>=(s=(g+b)/2))?g=s:b=s,e=h,!(h=h[l=f<<1|c]))return this;if(!h.length)break;(e[l+1&3]||e[l+2&3]||e[l+3&3])&&(n=e,d=l)}for(;h.data!==t;)if(r=h,!(h=h.next))return this;return(i=h.next)&&delete h.next,r?(i?r.next=i:delete r.next,this):e?(i?e[l]=i:delete e[l],(h=e[0]||e[1]||e[2]||e[3])&&h===(e[3]||e[2]||e[1]||e[0])&&!h.length&&(n?n[d]=h:this._root=h),this):(this._root=i,this)},Oc.removeAll=function(t){for(var e=0,n=t.length;ec+p||of+p||as.index){var g=c-u.x-u.vx,m=f-u.y-u.vy,b=g*g+m*m;bt.r&&(t.r=t[e].r)}function s(){if(e){var r,i,o=e.length;for(n=new Array(o),r=0;r1?(null==n?u.delete(t):u.set(t,p(n)),e):u.get(t)},find:function(e,n,r){var i,o,a,u,s,c=0,f=t.length;for(null==r?r=1/0:r*=r,c=0;c1?(c.on(t,n),e):c.on(t)}}},Dc=function(){var t,e,n,r,i,o=xc(-30),a=1,u=1/0,s=.81;function c(n){var i,o=t.length,a=_c(t,Pc,Nc).visitAfter(l);for(r=n,i=0;i=u)){(t.data!==e||t.next)&&(0===l&&(p+=(l=Ec(n))*l),0===d&&(p+=(d=Ec(n))*d),p1?r[0]+r.slice(2):r,+t.slice(n+1)]}var zc=function(t){return(t=Uc(Math.abs(t)))?t[1]:NaN},Hc=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Vc(t){if(!(e=Hc.exec(t)))throw new Error("invalid format: "+t);var e;return new qc({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function qc(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}Vc.prototype=qc.prototype,qc.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Wc,Gc,Kc,Yc,Zc=function(t,e){var n=Uc(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")},Qc={"%":function(t,e){return(100*t).toFixed(e)},b:function(t){return Math.round(t).toString(2)},c:function(t){return t+""},d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},g:function(t,e){return t.toPrecision(e)},o:function(t){return Math.round(t).toString(8)},p:function(t,e){return Zc(100*t,e)},r:Zc,s:function(t,e){var n=Uc(t,e);if(!n)return t+"";var r=n[0],i=n[1],o=i-(Wc=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,a=r.length;return o===a?r:o>a?r+new Array(o-a+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+Uc(t,Math.max(0,e+o-1))[0]},X:function(t){return Math.round(t).toString(16).toUpperCase()},x:function(t){return Math.round(t).toString(16)}},Xc=function(t){return t},Jc=Array.prototype.map,tf=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"],ef=function(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?Xc:(e=Jc.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,o=[],a=0,u=e[0],s=0;i>0&&u>0&&(s+u+1>r&&(u=Math.max(1,r-s)),o.push(t.substring(i-=u,i+u)),!((s+=u+1)>r));)u=e[a=(a+1)%e.length];return o.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",o=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",u=void 0===t.numerals?Xc:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Jc.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",c=void 0===t.minus?"\u2212":t.minus+"",f=void 0===t.nan?"NaN":t.nan+"";function l(t){var e=(t=Vc(t)).fill,n=t.align,l=t.sign,d=t.symbol,h=t.zero,p=t.width,g=t.comma,m=t.precision,b=t.trim,v=t.type;"n"===v?(g=!0,v="g"):Qc[v]||(void 0===m&&(m=12),b=!0,v="g"),(h||"0"===e&&"="===n)&&(h=!0,e="0",n="=");var y="$"===d?i:"#"===d&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",_="$"===d?o:/[%p]/.test(v)?s:"",w=Qc[v],S=/[defgprs%]/.test(v);function O(t){var i,o,s,d=y,O=_;if("c"===v)O=w(t)+O,t="";else{var x=(t=+t)<0||1/t<0;if(t=isNaN(t)?f:w(Math.abs(t),m),b&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),x&&0===+t&&"+"!==l&&(x=!1),d=(x?"("===l?l:c:"-"===l||"("===l?"":l)+d,O=("s"===v?tf[8+Wc/3]:"")+O+(x&&"("===l?")":""),S)for(i=-1,o=t.length;++i(s=t.charCodeAt(i))||s>57){O=(46===s?a+t.slice(i+1):t.slice(i))+O,t=t.slice(0,i);break}}g&&!h&&(t=r(t,1/0));var E=d.length+t.length+O.length,M=E>1)+d+t+O+M.slice(E);break;default:t=M+d+t+O}return u(t)}return m=void 0===m?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m)),O.toString=function(){return t+""},O}return{format:l,formatPrefix:function(t,e){var n=l(((t=Vc(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(zc(e)/3))),i=Math.pow(10,-r),o=tf[8+r/3];return function(t){return n(i*t)+o}}}};function nf(t){return Gc=ef(t),Kc=Gc.format,Yc=Gc.formatPrefix,Gc}nf({thousands:",",grouping:[3],currency:["$",""]});var rf=function(t){return Math.max(0,-zc(Math.abs(t)))},of=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(zc(e)/3)))-zc(Math.abs(t)))},af=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,zc(e)-zc(t))+1},uf=1e-6,sf=1e-12,cf=Math.PI,ff=cf/2,lf=cf/4,df=2*cf,hf=180/cf,pf=cf/180,gf=Math.abs,mf=Math.atan,bf=Math.atan2,vf=Math.cos,yf=Math.ceil,_f=Math.exp,wf=(Math.floor,Math.hypot),Sf=Math.log,Of=Math.pow,xf=Math.sin,Ef=Math.sign||function(t){return t>0?1:t<0?-1:0},Mf=Math.sqrt,Tf=Math.tan;function $f(t){return t>1?0:t<-1?cf:Math.acos(t)}function Af(t){return t>1?ff:t<-1?-ff:Math.asin(t)}function kf(t){return(t=xf(t/2))*t}function Cf(){}function If(t,e){t&&Nf.hasOwnProperty(t.type)&&Nf[t.type](t,e)}var Pf={Feature:function(t,e){If(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r=0?1:-1,i=r*n,o=vf(e=(e*=pf)/2+lf),a=xf(e),u=Uf*a,s=Bf*o+u*vf(i),c=u*r*xf(i);Hf.add(bf(c,s)),Ff=t,Bf=o,Uf=a}var Zf,Qf,Xf,Jf,tl,el,nl,rl,il,ol,al,ul=function(t){return Vf=new C,zf(t,qf),2*Vf};function sl(t){return[bf(t[1],t[0]),Af(t[2])]}function cl(t){var e=t[0],n=t[1],r=vf(n);return[r*vf(e),r*xf(e),xf(n)]}function fl(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ll(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function dl(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function hl(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function pl(t){var e=Mf(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}var gl={point:ml,lineStart:vl,lineEnd:yl,polygonStart:function(){gl.point=_l,gl.lineStart=wl,gl.lineEnd=Sl,il=new C,qf.polygonStart()},polygonEnd:function(){qf.polygonEnd(),gl.point=ml,gl.lineStart=vl,gl.lineEnd=yl,Hf<0?(Zf=-(Xf=180),Qf=-(Jf=90)):il>uf?Jf=90:il<-1e-6&&(Qf=-90),al[0]=Zf,al[1]=Xf},sphere:function(){Zf=-(Xf=180),Qf=-(Jf=90)}};function ml(t,e){ol.push(al=[Zf=t,Xf=t]),eJf&&(Jf=e)}function bl(t,e){var n=cl([t*pf,e*pf]);if(rl){var r=ll(rl,n),i=ll([r[1],-r[0],0],r);pl(i),i=sl(i);var o,a=t-tl,u=a>0?1:-1,s=i[0]*hf*u,c=gf(a)>180;c^(u*tlJf&&(Jf=o):c^(u*tl<(s=(s+360)%360-180)&&sJf&&(Jf=e)),c?tOl(Zf,Xf)&&(Xf=t):Ol(t,Xf)>Ol(Zf,Xf)&&(Zf=t):Xf>=Zf?(tXf&&(Xf=t)):t>tl?Ol(Zf,t)>Ol(Zf,Xf)&&(Xf=t):Ol(t,Xf)>Ol(Zf,Xf)&&(Zf=t)}else ol.push(al=[Zf=t,Xf=t]);eJf&&(Jf=e),rl=n,tl=t}function vl(){gl.point=bl}function yl(){al[0]=Zf,al[1]=Xf,gl.point=ml,rl=null}function _l(t,e){if(rl){var n=t-tl;il.add(gf(n)>180?n+(n>0?360:-360):n)}else el=t,nl=e;qf.point(t,e),bl(t,e)}function wl(){qf.lineStart()}function Sl(){_l(el,nl),qf.lineEnd(),gf(il)>uf&&(Zf=-(Xf=180)),al[0]=Zf,al[1]=Xf,rl=null}function Ol(t,e){return(e-=t)<0?e+360:e}function xl(t,e){return t[0]-e[0]}function El(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:eOl(r[0],r[1])&&(r[1]=i[1]),Ol(i[0],r[1])>Ol(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,e=0,r=o[n=o.length-1];e<=n;r=i,++e)i=o[e],(u=Ol(r[1],i[0]))>a&&(a=u,Zf=i[0],Xf=r[1])}return ol=al=null,Zf===1/0||Qf===1/0?[[NaN,NaN],[NaN,NaN]]:[[Zf,Qf],[Xf,Jf]]},Hl={sphere:Cf,point:Vl,lineStart:Wl,lineEnd:Yl,polygonStart:function(){Hl.lineStart=Zl,Hl.lineEnd=Ql},polygonEnd:function(){Hl.lineStart=Wl,Hl.lineEnd=Yl}};function Vl(t,e){t*=pf;var n=vf(e*=pf);ql(n*vf(t),n*xf(t),xf(e))}function ql(t,e,n){++Ml,$l+=(t-$l)/Ml,Al+=(e-Al)/Ml,kl+=(n-kl)/Ml}function Wl(){Hl.point=Gl}function Gl(t,e){t*=pf;var n=vf(e*=pf);Fl=n*vf(t),Bl=n*xf(t),Ul=xf(e),Hl.point=Kl,ql(Fl,Bl,Ul)}function Kl(t,e){t*=pf;var n=vf(e*=pf),r=n*vf(t),i=n*xf(t),o=xf(e),a=bf(Mf((a=Bl*o-Ul*i)*a+(a=Ul*r-Fl*o)*a+(a=Fl*i-Bl*r)*a),Fl*r+Bl*i+Ul*o);Tl+=a,Cl+=a*(Fl+(Fl=r)),Il+=a*(Bl+(Bl=i)),Pl+=a*(Ul+(Ul=o)),ql(Fl,Bl,Ul)}function Yl(){Hl.point=Vl}function Zl(){Hl.point=Xl}function Ql(){Jl(Dl,Ll),Hl.point=Vl}function Xl(t,e){Dl=t,Ll=e,t*=pf,e*=pf,Hl.point=Jl;var n=vf(e);Fl=n*vf(t),Bl=n*xf(t),Ul=xf(e),ql(Fl,Bl,Ul)}function Jl(t,e){t*=pf;var n=vf(e*=pf),r=n*vf(t),i=n*xf(t),o=xf(e),a=Bl*o-Ul*i,u=Ul*r-Fl*o,s=Fl*i-Bl*r,c=wf(a,u,s),f=Af(c),l=c&&-f/c;Nl.add(l*a),Rl.add(l*u),jl.add(l*s),Tl+=f,Cl+=f*(Fl+(Fl=r)),Il+=f*(Bl+(Bl=i)),Pl+=f*(Ul+(Ul=o)),ql(Fl,Bl,Ul)}var td=function(t){Ml=Tl=$l=Al=kl=Cl=Il=Pl=0,Nl=new C,Rl=new C,jl=new C,zf(t,Hl);var e=+Nl,n=+Rl,r=+jl,i=wf(e,n,r);return icf?t+Math.round(-t/df)*df:t,e]}function id(t,e,n){return(t%=df)?e||n?nd(ad(t),ud(e,n)):ad(t):e||n?ud(e,n):rd}function od(t){return function(e,n){return[(e+=t)>cf?e-df:e<-cf?e+df:e,n]}}function ad(t){var e=od(t);return e.invert=od(-t),e}function ud(t,e){var n=vf(t),r=xf(t),i=vf(e),o=xf(e);function a(t,e){var a=vf(e),u=vf(t)*a,s=xf(t)*a,c=xf(e),f=c*n+u*r;return[bf(s*i-f*o,u*n-c*r),Af(f*i+s*o)]}return a.invert=function(t,e){var a=vf(e),u=vf(t)*a,s=xf(t)*a,c=xf(e),f=c*i-s*o;return[bf(s*i+c*o,u*n+f*r),Af(f*n-u*r)]},a}rd.invert=rd;var sd=function(t){function e(e){return(e=t(e[0]*pf,e[1]*pf))[0]*=hf,e[1]*=hf,e}return t=id(t[0]*pf,t[1]*pf,t.length>2?t[2]*pf:0),e.invert=function(e){return(e=t.invert(e[0]*pf,e[1]*pf))[0]*=hf,e[1]*=hf,e},e};function cd(t,e,n,r,i,o){if(n){var a=vf(e),u=xf(e),s=r*n;null==i?(i=e+r*df,o=e-s/2):(i=fd(a,i),o=fd(a,o),(r>0?io)&&(i+=r*df));for(var c,f=i;r>0?f>o:f1&&e.push(e.pop().concat(e.shift()))},result:function(){var n=e;return e=[],t=null,n}}},hd=function(t,e){return gf(t[0]-e[0])=0;--o)i.point((f=c[o])[0],f[1]);else r(d.x,d.p.x,-1,i);d=d.p}c=(d=d.o).z,h=!h}while(!d.v);i.lineEnd()}}};function md(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r=0?1:-1,M=E*x,T=M>cf,$=m*S;if(s.add(bf($*E*xf(M),b*O+$*vf(M))),a+=T?x+E*df:x,T^p>=n^_>=n){var A=ll(cl(h),cl(y));pl(A);var k=ll(o,A);pl(k);var I=(T^x>=0?-1:1)*Af(k[2]);(r>I||r===I&&(A[0]||A[1]))&&(u+=T^x>=0?1:-1)}}return(a<-1e-6||a0){for(l||(i.polygonStart(),l=!0),i.lineStart(),t=0;t1&&2&s&&d.push(d.pop().concat(d.shift())),a.push(d.filter(_d))}return d}};function _d(t){return t.length>1}function wd(t,e){return((t=t.x)[0]<0?t[1]-ff-uf:ff-t[1])-((e=e.x)[0]<0?e[1]-ff-uf:ff-e[1])}var Sd=yd((function(){return!0}),(function(t){var e,n=NaN,r=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var u=o>0?cf:-cf,s=gf(o-n);gf(s-cf)0?ff:-ff),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),t.point(o,r),e=0):i!==u&&s>=cf&&(gf(n-i)uf?mf((xf(e)*(o=vf(r))*xf(n)-xf(r)*(i=vf(e))*xf(t))/(i*o*a)):(e+r)/2}(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(u,r),e=0),t.point(n=o,r=a),i=u},lineEnd:function(){t.lineEnd(),n=r=NaN},clean:function(){return 2-e}}}),(function(t,e,n,r){var i;if(null==t)i=n*ff,r.point(-cf,i),r.point(0,i),r.point(cf,i),r.point(cf,0),r.point(cf,-i),r.point(0,-i),r.point(-cf,-i),r.point(-cf,0),r.point(-cf,i);else if(gf(t[0]-e[0])>uf){var o=t[0]0,i=gf(e)>uf;function o(t,n){return vf(t)*vf(n)>e}function a(t,n,r){var i=[1,0,0],o=ll(cl(t),cl(n)),a=fl(o,o),u=o[0],s=a-u*u;if(!s)return!r&&t;var c=e*a/s,f=-e*u/s,l=ll(i,o),d=hl(i,c);dl(d,hl(o,f));var h=l,p=fl(d,h),g=fl(h,h),m=p*p-g*(fl(d,d)-1);if(!(m<0)){var b=Mf(m),v=hl(h,(-p-b)/g);if(dl(v,d),v=sl(v),!r)return v;var y,_=t[0],w=n[0],S=t[1],O=n[1];w<_&&(y=_,_=w,w=y);var x=w-_,E=gf(x-cf)0^v[1]<(gf(v[0]-_)cf^(_<=v[0]&&v[0]<=w)){var M=hl(h,(-p+b)/g);return dl(M,d),[v,sl(M)]}}}function u(e,n){var i=r?t:cf-t,o=0;return e<-i?o|=1:e>i&&(o|=2),n<-i?o|=4:n>i&&(o|=8),o}return yd(o,(function(t){var e,n,s,c,f;return{lineStart:function(){c=s=!1,f=1},point:function(l,d){var h,p=[l,d],g=o(l,d),m=r?g?0:u(l,d):g?u(l+(l<0?cf:-cf),d):0;if(!e&&(c=s=g)&&t.lineStart(),g!==s&&(!(h=a(e,p))||hd(e,h)||hd(p,h))&&(p[2]=1),g!==s)f=0,g?(t.lineStart(),h=a(p,e),t.point(h[0],h[1])):(h=a(e,p),t.point(h[0],h[1],2),t.lineEnd()),e=h;else if(i&&e&&r^g){var b;m&n||!(b=a(p,e,!0))||(f=0,r?(t.lineStart(),t.point(b[0][0],b[0][1]),t.point(b[1][0],b[1][1]),t.lineEnd()):(t.point(b[1][0],b[1][1]),t.lineEnd(),t.lineStart(),t.point(b[0][0],b[0][1],3)))}!g||e&&hd(e,p)||t.point(p[0],p[1]),e=p,s=g,n=m},lineEnd:function(){s&&t.lineEnd(),e=null},clean:function(){return f|(c&&s)<<1}}}),(function(e,r,i,o){cd(o,t,n,i,e,r)}),r?[0,-t]:[-cf,t-cf])},xd=1e9,Ed=-xd;function Md(t,e,n,r){function i(i,o){return t<=i&&i<=n&&e<=o&&o<=r}function o(i,o,u,c){var f=0,l=0;if(null==i||(f=a(i,u))!==(l=a(o,u))||s(i,o)<0^u>0)do{c.point(0===f||3===f?t:n,f>1?r:e)}while((f=(f+u+4)%4)!==l);else c.point(o[0],o[1])}function a(r,i){return gf(r[0]-t)0?0:3:gf(r[0]-n)0?2:1:gf(r[1]-e)0?1:0:i>0?3:2}function u(t,e){return s(t.x,e.x)}function s(t,e){var n=a(t,1),r=a(e,1);return n!==r?n-r:0===n?e[1]-t[1]:1===n?t[0]-e[0]:2===n?t[1]-e[1]:e[0]-t[0]}return function(a){var s,c,f,l,d,h,p,g,m,b,v,y=a,_=dd(),w={point:S,lineStart:function(){w.point=O,c&&c.push(f=[]);b=!0,m=!1,p=g=NaN},lineEnd:function(){s&&(O(l,d),h&&m&&_.rejoin(),s.push(_.result()));w.point=S,m&&y.lineEnd()},polygonStart:function(){y=_,s=[],c=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,n=0,i=c.length;nr&&(d-o)*(r-a)>(h-a)*(t-o)&&++e:h<=r&&(d-o)*(r-a)<(h-a)*(t-o)&&--e;return e}(),n=v&&e,i=(s=At(s)).length;(n||i)&&(a.polygonStart(),n&&(a.lineStart(),o(null,null,1,a),a.lineEnd()),i&&gd(s,u,e,o,a),a.polygonEnd());y=a,s=c=f=null}};function S(t,e){i(t,e)&&y.point(t,e)}function O(o,a){var u=i(o,a);if(c&&f.push([o,a]),b)l=o,d=a,h=u,b=!1,u&&(y.lineStart(),y.point(o,a));else if(u&&m)y.point(o,a);else{var s=[p=Math.max(Ed,Math.min(xd,p)),g=Math.max(Ed,Math.min(xd,g))],_=[o=Math.max(Ed,Math.min(xd,o)),a=Math.max(Ed,Math.min(xd,a))];!function(t,e,n,r,i,o){var a,u=t[0],s=t[1],c=0,f=1,l=e[0]-u,d=e[1]-s;if(a=n-u,l||!(a>0)){if(a/=l,l<0){if(a0){if(a>f)return;a>c&&(c=a)}if(a=i-u,l||!(a<0)){if(a/=l,l<0){if(a>f)return;a>c&&(c=a)}else if(l>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>c&&(c=a)}if(a=o-s,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>c&&(c=a)}else if(d>0){if(a0&&(t[0]=u+c*l,t[1]=s+c*d),f<1&&(e[0]=u+f*l,e[1]=s+f*d),!0}}}}}(s,_,t,e,n,r)?u&&(y.lineStart(),y.point(o,a),v=!1):(m||(y.lineStart(),y.point(s[0],s[1])),y.point(_[0],_[1]),u||y.lineEnd(),v=!1)}p=o,g=a,m=u}return w}}var Td,$d,Ad,kd,Cd=function(){var t,e,n,r=0,i=0,o=960,a=500;return n={stream:function(n){return t&&e===n?t:t=Md(r,i,o,a)(e=n)},extent:function(u){return arguments.length?(r=+u[0][0],i=+u[0][1],o=+u[1][0],a=+u[1][1],t=e=null,n):[[r,i],[o,a]]}}},Id={sphere:Cf,point:Cf,lineStart:function(){Id.point=Nd,Id.lineEnd=Pd},lineEnd:Cf,polygonStart:Cf,polygonEnd:Cf};function Pd(){Id.point=Id.lineEnd=Cf}function Nd(t,e){$d=t*=pf,Ad=xf(e*=pf),kd=vf(e),Id.point=Rd}function Rd(t,e){t*=pf;var n=xf(e*=pf),r=vf(e),i=gf(t-$d),o=vf(i),a=r*xf(i),u=kd*n-Ad*r*o,s=Ad*n+kd*r*o;Td.add(bf(Mf(a*a+u*u),s)),$d=t,Ad=n,kd=r}var jd=function(t){return Td=new C,zf(t,Id),+Td},Dd=[null,null],Ld={type:"LineString",coordinates:Dd},Fd=function(t,e){return Dd[0]=t,Dd[1]=e,jd(Ld)},Bd={Feature:function(t,e){return zd(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r0&&(i=Fd(t[o],t[o-1]))>0&&n<=i&&r<=i&&(n+r-i)*(1-Math.pow((n-r)/i,2))uf})).map(s)).concat(Pt(yf(o/h)*h,i,h).filter((function(t){return gf(t%g)>uf})).map(c))}return b.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))},b.outline=function(){return{type:"Polygon",coordinates:[f(r).concat(l(a).slice(1),f(n).reverse().slice(1),l(u).reverse().slice(1))]}},b.extent=function(t){return arguments.length?b.extentMajor(t).extentMinor(t):b.extentMinor()},b.extentMajor=function(t){return arguments.length?(r=+t[0][0],n=+t[1][0],u=+t[0][1],a=+t[1][1],r>n&&(t=r,r=n,n=t),u>a&&(t=u,u=a,a=t),b.precision(m)):[[r,u],[n,a]]},b.extentMinor=function(n){return arguments.length?(e=+n[0][0],t=+n[1][0],o=+n[0][1],i=+n[1][1],e>t&&(n=e,e=t,t=n),o>i&&(n=o,o=i,i=n),b.precision(m)):[[e,o],[t,i]]},b.step=function(t){return arguments.length?b.stepMajor(t).stepMinor(t):b.stepMinor()},b.stepMajor=function(t){return arguments.length?(p=+t[0],g=+t[1],b):[p,g]},b.stepMinor=function(t){return arguments.length?(d=+t[0],h=+t[1],b):[d,h]},b.precision=function(d){return arguments.length?(m=+d,s=Yd(o,i,90),c=Zd(e,t,m),f=Yd(u,a,90),l=Zd(r,n,m),b):m},b.extentMajor([[-180,-89.999999],[180,89.999999]]).extentMinor([[-180,-80.000001],[180,80.000001]])}function Xd(){return Qd()()}var Jd,th,eh,nh,rh=function(t,e){var n=t[0]*pf,r=t[1]*pf,i=e[0]*pf,o=e[1]*pf,a=vf(r),u=xf(r),s=vf(o),c=xf(o),f=a*vf(n),l=a*xf(n),d=s*vf(i),h=s*xf(i),p=2*Af(Mf(kf(o-r)+a*s*kf(i-n))),g=xf(p),m=p?function(t){var e=xf(t*=p)/g,n=xf(p-t)/g,r=n*f+e*d,i=n*l+e*h,o=n*u+e*c;return[bf(i,r)*hf,bf(o,Mf(r*r+i*i))*hf]}:function(){return[n*hf,r*hf]};return m.distance=p,m},ih=function(t){return t},oh=new C,ah=new C,uh={point:Cf,lineStart:Cf,lineEnd:Cf,polygonStart:function(){uh.lineStart=sh,uh.lineEnd=lh},polygonEnd:function(){uh.lineStart=uh.lineEnd=uh.point=Cf,oh.add(gf(ah)),ah=new C},result:function(){var t=oh/2;return oh=new C,t}};function sh(){uh.point=ch}function ch(t,e){uh.point=fh,Jd=eh=t,th=nh=e}function fh(t,e){ah.add(nh*t-eh*e),eh=t,nh=e}function lh(){fh(Jd,th)}var dh=uh,hh=1/0,ph=hh,gh=-hh,mh=gh;var bh,vh,yh,_h,wh={point:function(t,e){tgh&&(gh=t);emh&&(mh=e)},lineStart:Cf,lineEnd:Cf,polygonStart:Cf,polygonEnd:Cf,result:function(){var t=[[hh,ph],[gh,mh]];return gh=mh=-(ph=hh=1/0),t}},Sh=0,Oh=0,xh=0,Eh=0,Mh=0,Th=0,$h=0,Ah=0,kh=0,Ch={point:Ih,lineStart:Ph,lineEnd:jh,polygonStart:function(){Ch.lineStart=Dh,Ch.lineEnd=Lh},polygonEnd:function(){Ch.point=Ih,Ch.lineStart=Ph,Ch.lineEnd=jh},result:function(){var t=kh?[$h/kh,Ah/kh]:Th?[Eh/Th,Mh/Th]:xh?[Sh/xh,Oh/xh]:[NaN,NaN];return Sh=Oh=xh=Eh=Mh=Th=$h=Ah=kh=0,t}};function Ih(t,e){Sh+=t,Oh+=e,++xh}function Ph(){Ch.point=Nh}function Nh(t,e){Ch.point=Rh,Ih(yh=t,_h=e)}function Rh(t,e){var n=t-yh,r=e-_h,i=Mf(n*n+r*r);Eh+=i*(yh+t)/2,Mh+=i*(_h+e)/2,Th+=i,Ih(yh=t,_h=e)}function jh(){Ch.point=Ih}function Dh(){Ch.point=Fh}function Lh(){Bh(bh,vh)}function Fh(t,e){Ch.point=Bh,Ih(bh=yh=t,vh=_h=e)}function Bh(t,e){var n=t-yh,r=e-_h,i=Mf(n*n+r*r);Eh+=i*(yh+t)/2,Mh+=i*(_h+e)/2,Th+=i,$h+=(i=_h*t-yh*e)*(yh+t),Ah+=i*(_h+e),kh+=3*i,Ih(yh=t,_h=e)}var Uh=Ch;function zh(t){this._context=t}zh.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,df)}},result:Cf};var Hh,Vh,qh,Wh,Gh,Kh=new C,Yh={point:Cf,lineStart:function(){Yh.point=Zh},lineEnd:function(){Hh&&Qh(Vh,qh),Yh.point=Cf},polygonStart:function(){Hh=!0},polygonEnd:function(){Hh=null},result:function(){var t=+Kh;return Kh=new C,t}};function Zh(t,e){Yh.point=Qh,Vh=Wh=t,qh=Gh=e}function Qh(t,e){Wh-=t,Gh-=e,Kh.add(Mf(Wh*Wh+Gh*Gh)),Wh=t,Gh=e}var Xh=Yh;function Jh(){this._string=[]}function tp(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}Jh.prototype={_radius:4.5,_circle:tp(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=tp(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var ep=function(t,e){var n,r,i=4.5;function o(t){return t&&("function"===typeof i&&r.pointRadius(+i.apply(this,arguments)),zf(t,n(r))),r.result()}return o.area=function(t){return zf(t,n(dh)),dh.result()},o.measure=function(t){return zf(t,n(Xh)),Xh.result()},o.bounds=function(t){return zf(t,n(wh)),wh.result()},o.centroid=function(t){return zf(t,n(Uh)),Uh.result()},o.projection=function(e){return arguments.length?(n=null==e?(t=null,ih):(t=e).stream,o):t},o.context=function(t){return arguments.length?(r=null==t?(e=null,new Jh):new zh(e=t),"function"!==typeof i&&r.pointRadius(i),o):e},o.pointRadius=function(t){return arguments.length?(i="function"===typeof t?t:(r.pointRadius(+t),+t),o):i},o.projection(t).context(e)},np=function(t){return{stream:rp(t)}};function rp(t){return function(e){var n=new ip;for(var r in t)n[r]=t[r];return n.stream=e,n}}function ip(){}function op(t,e,n){var r=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=r&&t.clipExtent(null),zf(n,t.stream(wh)),e(wh.result()),null!=r&&t.clipExtent(r),t}function ap(t,e,n){return op(t,(function(n){var r=e[1][0]-e[0][0],i=e[1][1]-e[0][1],o=Math.min(r/(n[1][0]-n[0][0]),i/(n[1][1]-n[0][1])),a=+e[0][0]+(r-o*(n[1][0]+n[0][0]))/2,u=+e[0][1]+(i-o*(n[1][1]+n[0][1]))/2;t.scale(150*o).translate([a,u])}),n)}function up(t,e,n){return ap(t,[[0,0],e],n)}function sp(t,e,n){return op(t,(function(n){var r=+e,i=r/(n[1][0]-n[0][0]),o=(r-i*(n[1][0]+n[0][0]))/2,a=-i*n[0][1];t.scale(150*i).translate([o,a])}),n)}function cp(t,e,n){return op(t,(function(n){var r=+e,i=r/(n[1][1]-n[0][1]),o=-i*n[0][0],a=(r-i*(n[1][1]+n[0][1]))/2;t.scale(150*i).translate([o,a])}),n)}ip.prototype={constructor:ip,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var fp=vf(30*pf),lp=function(t,e){return+e?function(t,e){function n(r,i,o,a,u,s,c,f,l,d,h,p,g,m){var b=c-r,v=f-i,y=b*b+v*v;if(y>4*e&&g--){var _=a+d,w=u+h,S=s+p,O=Mf(_*_+w*w+S*S),x=Af(S/=O),E=gf(gf(S)-1)e||gf((b*A+v*k)/y-.5)>.3||a*d+u*h+s*p2?t[2]%360*pf:0,A()):[m*hf,b*hf,v*hf]},T.angle=function(t){return arguments.length?(y=t%360*pf,A()):y*hf},T.reflectX=function(t){return arguments.length?(_=t?-1:1,A()):_<0},T.reflectY=function(t){return arguments.length?(w=t?-1:1,A()):w<0},T.precision=function(t){return arguments.length?(a=lp(u,M=t*t),k()):Mf(M)},T.fitExtent=function(t,e){return ap(T,t,e)},T.fitSize=function(t,e){return up(T,t,e)},T.fitWidth=function(t,e){return sp(T,t,e)},T.fitHeight=function(t,e){return cp(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&$,A()}}function mp(t){var e=0,n=cf/3,r=gp(t),i=r(e,n);return i.parallels=function(t){return arguments.length?r(e=t[0]*pf,n=t[1]*pf):[e*hf,n*hf]},i}function bp(t,e){var n=xf(t),r=(n+xf(e))/2;if(gf(r)=.12&&i<.234&&r>=-.425&&r<-.214?u:i>=.166&&i<.234&&r>=-.214&&r<-.115?s:a).invert(t)},f.stream=function(n){return t&&e===n?t:t=function(t){var e=t.length;return{point:function(n,r){for(var i=-1;++i0?e<-ff+uf&&(e=-ff+uf):e>ff-uf&&(e=ff-uf);var n=i/Of(kp(e),r);return[n*xf(r*t),i-n*vf(r*t)]}return o.invert=function(t,e){var n=i-e,o=Ef(r)*Mf(t*t+n*n),a=bf(t,gf(n))*Ef(n);return n*r<0&&(a-=cf*Ef(t)*Ef(n)),[a/r,2*mf(Of(i/o,1/r))-ff]},o}var Ip=function(){return mp(Cp).scale(109.5).parallels([30,30])};function Pp(t,e){return[t,e]}Pp.invert=Pp;var Np=function(){return pp(Pp).scale(152.63)};function Rp(t,e){var n=vf(t),r=t===e?xf(t):(n-vf(e))/(e-t),i=n/r+t;if(gf(r)uf&&--i>0);return[t/(.8707+(o=r*r)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),r]};var Kp=function(){return pp(Gp).scale(175.295)};function Yp(t,e){return[vf(e)*xf(t),xf(e)]}Yp.invert=Sp(Af);var Zp=function(){return pp(Yp).scale(249.5).clipAngle(90.000001)};function Qp(t,e){var n=vf(e),r=1+vf(t)*n;return[n*xf(t)/r,xf(e)/r]}Qp.invert=Sp((function(t){return 2*mf(t)}));var Xp=function(){return pp(Qp).scale(250).clipAngle(142)};function Jp(t,e){return[Sf(Tf((ff+e)/2)),-t]}Jp.invert=function(t,e){return[-e,2*mf(_f(t))-ff]};var tg=function(){var t=Ap(Jp),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):[(t=e())[1],-t[0]]},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):[(t=n())[0],t[1],t[2]-90]},n([0,0,90]).scale(159.155)};function eg(t,e){return t.parent===e.parent?1:2}function ng(t,e){return t+e.x}function rg(t,e){return Math.max(t,e.y)}var ig=function(){var t=eg,e=1,n=1,r=!1;function i(i){var o,a=0;i.eachAfter((function(e){var n=e.children;n?(e.x=function(t){return t.reduce(ng,0)/t.length}(n),e.y=function(t){return 1+t.reduce(rg,0)}(n)):(e.x=o?a+=t(e,o):0,e.y=0,o=e)}));var u=function(t){for(var e;e=t.children;)t=e[0];return t}(i),s=function(t){for(var e;e=t.children;)t=e[e.length-1];return t}(i),c=u.x-t(u,s)/2,f=s.x+t(s,u)/2;return i.eachAfter(r?function(t){t.x=(t.x-i.x)*e,t.y=(i.y-t.y)*n}:function(t){t.x=(t.x-c)/(f-c)*e,t.y=(1-(i.y?t.y/i.y:1))*n})}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i};function og(t){var e=0,n=t.children,r=n&&n.length;if(r)for(;--r>=0;)e+=n[r].value;else e=1;t.value=e}var ag=u.a.mark(ug);function ug(){var t,e,n,r,i,o;return u.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n=[t=this];case 1:e=n.reverse(),n=[];case 2:if(!(t=e.pop())){a.next=8;break}return a.next=5,t;case 5:if(r=t.children)for(i=0,o=r.length;i=0;--o)s.push(r=i[o]=new hg(i[o])),r.parent=n,r.depth=n.depth+1;return u.eachBefore(dg)}function cg(t){return t.children}function fg(t){return Array.isArray(t)?t[1]:null}function lg(t){void 0!==t.data.value&&(t.value=t.data.value),t.data=t.data.data}function dg(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function hg(t){this.data=t,this.depth=this.height=0,this.parent=null}hg.prototype=sg.prototype=Object(xe.a)({constructor:hg,count:function(){return this.eachAfter(og)},each:function(t,e){var n,r=-1,i=Object(s.a)(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.call(e,o,++r,this)}}catch(a){i.e(a)}finally{i.f()}return this},eachAfter:function(t,e){for(var n,r,i,o=this,a=[o],u=[],s=-1;o=a.pop();)if(u.push(o),n=o.children)for(r=0,i=n.length;r=0;--r)o.push(n[r]);return this},find:function(t,e){var n,r=-1,i=Object(s.a)(this);try{for(i.s();!(n=i.n()).done;){var o=n.value;if(t.call(e,o,++r,this))return o}}catch(a){i.e(a)}finally{i.f()}},sum:function(t){return this.eachAfter((function(e){for(var n=+t(e.data)||0,r=e.children,i=r&&r.length;--i>=0;)n+=r[i].value;e.value=n}))},sort:function(t){return this.eachBefore((function(e){e.children&&e.children.sort(t)}))},path:function(t){for(var e=this,n=function(t,e){if(t===e)return t;var n=t.ancestors(),r=e.ancestors(),i=null;t=n.pop(),e=r.pop();for(;t===e;)i=t,t=n.pop(),e=r.pop();return i}(e,t),r=[e];e!==n;)e=e.parent,r.push(e);for(var i=r.length;t!==n;)r.splice(i,0,t),t=t.parent;return r},ancestors:function(){for(var t=this,e=[t];t=t.parent;)e.push(t);return e},descendants:function(){return Array.from(this)},leaves:function(){var t=[];return this.eachBefore((function(e){e.children||t.push(e)})),t},links:function(){var t=this,e=[];return t.each((function(n){n!==t&&e.push({source:n.parent,target:n})})),e},copy:function(){return sg(this).eachBefore(lg)}},Symbol.iterator,ug);var pg=function(t){for(var e,n,r=0,i=(t=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t}(Array.from(t))).length,o=[];r0&&n*n>r*r+i*i}function vg(t,e){for(var n=0;n(a*=a)?(r=(c+a-i)/(2*c),o=Math.sqrt(Math.max(0,a/c-r*r)),n.x=t.x-r*u-o*s,n.y=t.y-r*s+o*u):(r=(c+i-a)/(2*c),o=Math.sqrt(Math.max(0,i/c-r*r)),n.x=e.x+r*u-o*s,n.y=e.y+r*s+o*u)):(n.x=e.x+n.r,n.y=e.y)}function Og(t,e){var n=t.r+e.r-1e-6,r=e.x-t.x,i=e.y-t.y;return n>0&&n*n>r*r+i*i}function xg(t){var e=t._,n=t.next._,r=e.r+n.r,i=(e.x*n.r+n.x*e.r)/r,o=(e.y*n.r+n.y*e.r)/r;return i*i+o*o}function Eg(t){this._=t,this.next=null,this.previous=null}function Mg(t){if(!(o=(e=t,t="object"===typeof e&&"length"in e?e:Array.from(e)).length))return 0;var e,n,r,i,o,a,u,s,c,f,l,d;if((n=t[0]).x=0,n.y=0,!(o>1))return n.r;if(r=t[1],n.x=-r.r,r.x=n.r,r.y=0,!(o>2))return n.r+r.r;Sg(r,n,i=t[2]),n=new Eg(n),r=new Eg(r),i=new Eg(i),n.next=i.previous=r,r.next=n.previous=i,i.next=r.previous=n;t:for(s=3;s0)throw new Error("cycle");return o}return n.id=function(e){return arguments.length?(t=Ag(e),n):t},n.parentId=function(t){return arguments.length?(e=Ag(t),n):e},n};function qg(t,e){return t.parent===e.parent?1:2}function Wg(t){var e=t.children;return e?e[0]:t.t}function Gg(t){var e=t.children;return e?e[e.length-1]:t.t}function Kg(t,e,n){var r=n/(e.i-t.i);e.c-=r,e.s+=n,t.c+=r,e.z+=n,e.m+=n}function Yg(t,e,n){return t.a.parent===e.parent?t.a:n}function Zg(t,e){this._=t,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Zg.prototype=Object.create(hg.prototype);var Qg=function(){var t=qg,e=1,n=1,r=null;function i(i){var s=function(t){for(var e,n,r,i,o,a=new Zg(t,0),u=[a];e=u.pop();)if(r=e._.children)for(e.children=new Array(o=r.length),i=o-1;i>=0;--i)u.push(n=e.children[i]=new Zg(r[i],i)),n.parent=e;return(a.parent=new Zg(null,0)).children=[a],a}(i);if(s.eachAfter(o),s.parent.m=-s.z,s.eachBefore(a),r)i.eachBefore(u);else{var c=i,f=i,l=i;i.eachBefore((function(t){t.xf.x&&(f=t),t.depth>l.depth&&(l=t)}));var d=c===f?1:t(c,f)/2,h=d-c.x,p=e/(f.x+d+h),g=n/(l.depth||1);i.eachBefore((function(t){t.x=(t.x+h)*p,t.y=t.depth*g}))}return i}function o(e){var n=e.children,r=e.parent.children,i=e.i?r[e.i-1]:null;if(n){!function(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)(e=i[o]).z+=n,e.m+=n,n+=e.s+(r+=e.c)}(e);var o=(n[0].z+n[n.length-1].z)/2;i?(e.z=i.z+t(e._,i._),e.m=e.z-o):e.z=o}else i&&(e.z=i.z+t(e._,i._));e.parent.A=function(e,n,r){if(n){for(var i,o=e,a=e,u=n,s=o.parent.children[0],c=o.m,f=a.m,l=u.m,d=s.m;u=Gg(u),o=Wg(o),u&&o;)s=Wg(s),(a=Gg(a)).a=e,(i=u.z+l-o.z-c+t(u._,o._))>0&&(Kg(Yg(u,e,r),e,i),c+=i,f+=i),l+=u.m,c+=o.m,d+=s.m,f+=a.m;u&&!Gg(a)&&(a.t=u,a.m+=l-f),o&&!Wg(s)&&(s.t=o,s.m+=c-d,r=e)}return r}(e,i,e.parent.A||r[0])}function a(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function u(t){t.x*=e,t.y=t.depth*n}return i.separation=function(e){return arguments.length?(t=e,i):t},i.size=function(t){return arguments.length?(r=!1,e=+t[0],n=+t[1],i):r?null:[e,n]},i.nodeSize=function(t){return arguments.length?(r=!0,e=+t[0],n=+t[1],i):r?[e,n]:null},i},Xg=function(t,e,n,r,i){for(var o,a=t.children,u=-1,s=a.length,c=t.value&&(i-n)/t.value;++ud&&(d=u),m=f*f*g,(h=Math.max(d/m,m/l))>p){f-=u;break}p=h}b.push(a={value:f,dice:s1?e:1)},n}(Jg),nm=function(){var t=em,e=!1,n=1,r=1,i=[0],o=kg,a=kg,u=kg,s=kg,c=kg;function f(t){return t.x0=t.y0=0,t.x1=n,t.y1=r,t.eachBefore(l),i=[0],e&&t.eachBefore(Dg),t}function l(e){var n=i[e.depth],r=e.x0+n,f=e.y0+n,l=e.x1-n,d=e.y1-n;l=n-1){var f=u[e];return f.x0=i,f.y0=o,f.x1=a,void(f.y1=s)}var l=c[e],d=r/2+l,h=e+1,p=n-1;for(;h>>1;c[g]s-o){var v=r?(i*b+a*m)/r:a;t(e,h,m,i,o,v,s),t(h,n,b,v,o,a,s)}else{var y=r?(o*b+s*m)/r:s;t(e,h,m,i,o,a,y),t(h,n,b,i,y,a,s)}}(0,s,t.value,e,n,r,i)},im=function(t,e,n,r,i){(1&t.depth?Xg:Lg)(t,e,n,r,i)},om=function t(e){function n(t,n,r,i,o){if((a=t._squarify)&&a.ratio===e)for(var a,u,s,c,f,l=-1,d=a.length,h=t.value;++l1?e:1)},n}(Jg),am=function(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}},um=function(t,e){var n=kr(+t,+e);return function(t){var e=n(t);return e-360*Math.floor(e/360)}},sm=function(t,e){return t=+t,e=+e,function(n){return Math.round(t*(1-n)+e*n)}};function cm(t){return((t=Math.exp(t))+1/t)/2}var fm=function t(e,n,r){function i(t,i){var o,a,u=t[0],s=t[1],c=t[2],f=i[0],l=i[1],d=i[2],h=f-u,p=l-s,g=h*h+p*p;if(g<1e-12)a=Math.log(d/c)/e,o=function(t){return[u+t*h,s+t*p,c*Math.exp(e*t*a)]};else{var m=Math.sqrt(g),b=(d*d-c*c+r*g)/(2*c*n*m),v=(d*d-c*c-r*g)/(2*d*n*m),y=Math.log(Math.sqrt(b*b+1)-b),_=Math.log(Math.sqrt(v*v+1)-v);a=(_-y)/e,o=function(t){var r,i=t*a,o=cm(y),f=c/(n*m)*(o*(r=e*i+y,((r=Math.exp(2*r))-1)/(r+1))-function(t){return((t=Math.exp(t))-1/t)/2}(y));return[u+f*h,s+f*p,c*o/cm(e*i+y)]}}return o.duration=1e3*a*e/Math.SQRT2,o}return i.rho=function(e){var n=Math.max(.001,+e),r=n*n;return t(n,r,r*r)},i}(Math.SQRT2,2,4);function lm(t){return function(e,n){var r=t((e=Sr(e)).h,(n=Sr(n)).h),i=Ir(e.s,n.s),o=Ir(e.l,n.l),a=Ir(e.opacity,n.opacity);return function(t){return e.h=r(t),e.s=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var dm=lm(kr),hm=lm(Ir);function pm(t,e){var n=Ir((t=Na(t)).l,(e=Na(e)).l),r=Ir(t.a,e.a),i=Ir(t.b,e.b),o=Ir(t.opacity,e.opacity);return function(e){return t.l=n(e),t.a=r(e),t.b=i(e),t.opacity=o(e),t+""}}function gm(t){return function(e,n){var r=t((e=za(e)).h,(n=za(n)).h),i=Ir(e.c,n.c),o=Ir(e.l,n.l),a=Ir(e.opacity,n.opacity);return function(t){return e.h=r(t),e.c=i(t),e.l=o(t),e.opacity=a(t),e+""}}}var mm=gm(kr),bm=gm(Ir);function vm(t){return function e(n){function r(e,r){var i=t((e=tu(e)).h,(r=tu(r)).h),o=Ir(e.s,r.s),a=Ir(e.l,r.l),u=Ir(e.opacity,r.opacity);return function(t){return e.h=i(t),e.s=o(t),e.l=a(Math.pow(t,n)),e.opacity=u(t),e+""}}return n=+n,r.gamma=e,r}(1)}var ym=vm(kr),_m=vm(Ir);function wm(t,e){void 0===e&&(e=t,t=Yr);for(var n=0,r=e.length-1,i=e[0],o=new Array(r<0?0:r);n1&&(n=t[a[u-2]],r=t[a[u-1]],i=t[e],(r[0]-n[0])*(i[1]-n[1])-(r[1]-n[1])*(i[0]-n[0])<=0);)--u;a[u++]=e}return a.slice(0,u)}var Tm=function(t){if((n=t.length)<3)return null;var e,n,r=new Array(n),i=new Array(n);for(e=0;e=0;--e)c.push(t[r[o[e]][2]]);for(e=+u;eu!==c>u&&a<(s-n)*(u-r)/(c-r)+n&&(f=!f),s=n,c=r;return f},Am=function(t){for(var e,n,r=-1,i=t.length,o=t[i-1],a=o[0],u=o[1],s=0;++r1);return t+n*o*Math.sqrt(-2*Math.log(i)/i)}}return n.source=t,n}(km),Nm=function t(e){var n=Pm.source(e);function r(){var t=n.apply(this,arguments);return function(){return Math.exp(t())}}return r.source=t,r}(km),Rm=function t(e){function n(t){return(t=+t)<=0?function(){return 0}:function(){for(var n=0,r=t;r>1;--r)n+=e();return n+r*e()}}return n.source=t,n}(km),jm=function t(e){var n=Rm.source(e);function r(t){if(0===(t=+t))return e;var r=n(t);return function(){return r()/t}}return r.source=t,r}(km),Dm=function t(e){function n(t){return function(){return-Math.log1p(-e())/t}}return n.source=t,n}(km),Lm=function t(e){function n(t){if((t=+t)<0)throw new RangeError("invalid alpha");return t=1/-t,function(){return Math.pow(1-e(),t)}}return n.source=t,n}(km),Fm=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return function(){return Math.floor(e()+t)}}return n.source=t,n}(km),Bm=function t(e){function n(t){if((t=+t)<0||t>1)throw new RangeError("invalid p");return 0===t?function(){return 1/0}:1===t?function(){return 1}:(t=Math.log1p(-t),function(){return 1+Math.floor(Math.log1p(-e())/t)})}return n.source=t,n}(km),Um=function t(e){var n=Pm.source(e)();function r(t,r){if((t=+t)<0)throw new RangeError("invalid k");if(0===t)return function(){return 0};if(r=null==r?1:+r,1===t)return function(){return-Math.log1p(-e())*r};var i=(t<1?t+1:t)-1/3,o=1/(3*Math.sqrt(i)),a=t<1?function(){return Math.pow(e(),1/t)}:function(){return 1};return function(){do{do{var t=n(),u=1+o*t}while(u<=0);u*=u*u;var s=1-e()}while(s>=1-.0331*t*t*t*t&&Math.log(s)>=.5*t*t+i*(1-u+Math.log(u)));return i*u*a()*r}}return r.source=t,r}(km),zm=function t(e){var n=Um.source(e);function r(t,e){var r=n(t),i=n(e);return function(){var t=r();return 0===t?0:t/(t+i())}}return r.source=t,r}(km),Hm=function t(e){var n=Bm.source(e),r=zm.source(e);function i(t,e){return t=+t,(e=+e)>=1?function(){return t}:e<=0?function(){return 0}:function(){for(var i=0,o=t,a=e;o*a>16&&o*(1-a)>16;){var u=Math.floor((o+1)*a),s=r(u,o-u+1)();s<=a?(i+=u,o-=u,a=(a-s)/(1-s)):(o=u-1,a/=s)}for(var c=a<.5,f=n(c?a:1-a),l=f(),d=0;l<=o;++d)l+=f();return i+(c?d:o-d)}}return i.source=t,i}(km),Vm=function t(e){function n(t,n,r){var i;return 0===(t=+t)?i=function(t){return-Math.log(t)}:(t=1/t,i=function(e){return Math.pow(e,t)}),n=null==n?0:+n,r=null==r?1:+r,function(){return n+r*i(-Math.log1p(-e()))}}return n.source=t,n}(km),qm=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){return t+n*Math.tan(Math.PI*e())}}return n.source=t,n}(km),Wm=function t(e){function n(t,n){return t=null==t?0:+t,n=null==n?1:+n,function(){var r=e();return t+n*Math.log(r/(1-r))}}return n.source=t,n}(km),Gm=function t(e){var n=Um.source(e),r=Hm.source(e);function i(t){return function(){for(var i=0,o=t;o>16;){var a=Math.floor(.875*o),u=n(a)();if(u>o)return i+r(a-1,o/u)();i+=a,o-=u}for(var s=-Math.log1p(-e()),c=0;s<=o;++c)s-=Math.log1p(-e());return i+c}}return i.source=t,i}(km),Km=1664525,Ym=1013904223,Zm=1/4294967296;function Qm(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Math.random(),e=0|(0<=t&&t<1?t/Zm:Math.abs(t));return function(){return Zm*((e=Km*e+Ym|0)>>>0)}}function Xm(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}function Jm(t,e){switch(arguments.length){case 0:break;case 1:"function"===typeof t?this.interpolator(t):this.range(t);break;default:this.domain(t),"function"===typeof e?this.interpolator(e):this.range(e)}return this}var tb=Symbol("implicit");function eb(){var t=new Map,e=[],n=[],r=tb;function i(i){var o=i+"",a=t.get(o);if(!a){if(r!==tb)return r;t.set(o,a=e.push(i))}return n[(a-1)%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new Map;var r,o=Object(s.a)(n);try{for(o.s();!(r=o.n()).done;){var a=r.value,u=a+"";t.has(u)||t.set(u,e.push(a))}}catch(c){o.e(c)}finally{o.f()}return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return eb(e,n).unknown(r)},Xm.apply(i,arguments),i}function nb(){var t,e,n=eb().unknown(void 0),r=n.domain,i=n.range,o=0,a=1,u=!1,s=0,c=0,f=.5;function l(){var n=r().length,l=ae&&(n=t,t=e,e=n),function(n){return Math.max(t,Math.min(e,n))}}(a[0],a[t-1])),r=t>2?fb:cb,i=o=null,l}function l(e){return isNaN(e=+e)?n:(i||(i=r(a.map(t),u,s)))(t(c(e)))}return l.invert=function(n){return c(e((o||(o=r(u,a.map(t),zr)))(n)))},l.domain=function(t){return arguments.length?(a=Array.from(t,ob),f()):a.slice()},l.range=function(t){return arguments.length?(u=Array.from(t),f()):u.slice()},l.rangeRound=function(t){return u=Array.from(t),s=sm,f()},l.clamp=function(t){return arguments.length?(c=!!t||ub,f()):c!==ub},l.interpolate=function(t){return arguments.length?(s=t,f()):s},l.unknown=function(t){return arguments.length?(n=t,l):n},function(n,r){return t=n,e=r,f()}}function hb(){return db()(ub,ub)}function pb(t,e,n,r){var i,o=dt(t,e,n);switch((r=Vc(null==r?",f":r)).type){case"s":var a=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=of(o,a))||(r.precision=i),Yc(r,a);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=af(o,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=rf(o))||(r.precision=i-2*("%"===r.type))}return Kc(r)}function gb(t){var e=t.domain;return t.ticks=function(t){var n=e();return ft(n[0],n[n.length-1],null==t?10:t)},t.tickFormat=function(t,n){var r=e();return pb(r[0],r[r.length-1],null==t?10:t,n)},t.nice=function(n){null==n&&(n=10);var r,i,o=e(),a=0,u=o.length-1,s=o[a],c=o[u],f=10;for(c0;){if((i=lt(s,c,n))===r)return o[a]=s,o[u]=c,e(o);if(i>0)s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i}r=i}return t},t}function mb(){var t=hb();return t.copy=function(){return lb(t,mb())},Xm.apply(t,arguments),gb(t)}function bb(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,ob),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return bb(t).unknown(e)},t=arguments.length?Array.from(t,ob):[0,1],gb(n)}function vb(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return a0){for(;d<=h;++d)for(f=1,c=n(d);fs)break;g.push(l)}}else for(;d<=h;++d)for(f=o-1,c=n(d);f>=1;--f)if(!((l=c*f)s)break;g.push(l)}2*g.length0?r[i-1]:e[0],i=r?[i[r-1],n]:[i[a-1],i[a]]},a.unknown=function(e){return arguments.length?(t=e,a):a},a.thresholds=function(){return i.slice()},a.copy=function(){return Ub().domain([e,n]).range(o).unknown(t)},Xm.apply(gb(a),arguments)}function zb(){var t,e=[.5],n=[0,1],r=1;function i(i){return i<=i?n[m(e,i,0,r)]:t}return i.domain=function(t){return arguments.length?(e=Array.from(t),r=Math.min(e.length,n.length-1),i):e.slice()},i.range=function(t){return arguments.length?(n=Array.from(t),r=Math.min(e.length,n.length-1),i):n.slice()},i.invertExtent=function(t){var r=n.indexOf(t);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(t=e,i):t},i.copy=function(){return zb().domain(e).range(n).unknown(t)},Xm.apply(i,arguments)}var Hb=new Date,Vb=new Date;function qb(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=function(e){return t(e=new Date(+e)),e},i.ceil=function(n){return t(n=new Date(n-1)),e(n,1),t(n),n},i.round=function(t){var e=i(t),n=i.ceil(t);return t-e0))return u;do{u.push(a=new Date(+n)),e(n,o),t(n)}while(a=e)for(;t(e),!n(e);)e.setTime(e-1)}),(function(t,r){if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););}))},n&&(i.count=function(e,r){return Hb.setTime(+e),Vb.setTime(+r),t(Hb),t(Vb),Math.floor(n(Hb,Vb))},i.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?function(e){return r(e)%t===0}:function(e){return i.count(0,e)%t===0}):i:null}),i}var Wb=qb((function(t){t.setMonth(0,1),t.setHours(0,0,0,0)}),(function(t,e){t.setFullYear(t.getFullYear()+e)}),(function(t,e){return e.getFullYear()-t.getFullYear()}),(function(t){return t.getFullYear()}));Wb.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qb((function(e){e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),(function(e,n){e.setFullYear(e.getFullYear()+n*t)})):null};var Gb=Wb,Kb=Wb.range,Yb=qb((function(t){t.setDate(1),t.setHours(0,0,0,0)}),(function(t,e){t.setMonth(t.getMonth()+e)}),(function(t,e){return e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())}),(function(t){return t.getMonth()})),Zb=Yb,Qb=Yb.range,Xb=1e3,Jb=6e4,tv=36e5,ev=864e5,nv=6048e5;function rv(t){return qb((function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),(function(t,e){t.setDate(t.getDate()+7*e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Jb)/nv}))}var iv=rv(0),ov=rv(1),av=rv(2),uv=rv(3),sv=rv(4),cv=rv(5),fv=rv(6),lv=iv.range,dv=ov.range,hv=av.range,pv=uv.range,gv=sv.range,mv=cv.range,bv=fv.range,vv=qb((function(t){return t.setHours(0,0,0,0)}),(function(t,e){return t.setDate(t.getDate()+e)}),(function(t,e){return(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Jb)/ev}),(function(t){return t.getDate()-1})),yv=vv,_v=vv.range,wv=qb((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Xb-t.getMinutes()*Jb)}),(function(t,e){t.setTime(+t+e*tv)}),(function(t,e){return(e-t)/tv}),(function(t){return t.getHours()})),Sv=wv,Ov=wv.range,xv=qb((function(t){t.setTime(t-t.getMilliseconds()-t.getSeconds()*Xb)}),(function(t,e){t.setTime(+t+e*Jb)}),(function(t,e){return(e-t)/Jb}),(function(t){return t.getMinutes()})),Ev=xv,Mv=xv.range,Tv=qb((function(t){t.setTime(t-t.getMilliseconds())}),(function(t,e){t.setTime(+t+e*Xb)}),(function(t,e){return(e-t)/Xb}),(function(t){return t.getUTCSeconds()})),$v=Tv,Av=Tv.range,kv=qb((function(){}),(function(t,e){t.setTime(+t+e)}),(function(t,e){return e-t}));kv.every=function(t){return t=Math.floor(t),isFinite(t)&&t>0?t>1?qb((function(e){e.setTime(Math.floor(e/t)*t)}),(function(e,n){e.setTime(+e+n*t)}),(function(e,n){return(n-e)/t})):kv:null};var Cv=kv,Iv=kv.range;function Pv(t){return qb((function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+7*e)}),(function(t,e){return(e-t)/nv}))}var Nv=Pv(0),Rv=Pv(1),jv=Pv(2),Dv=Pv(3),Lv=Pv(4),Fv=Pv(5),Bv=Pv(6),Uv=Nv.range,zv=Rv.range,Hv=jv.range,Vv=Dv.range,qv=Lv.range,Wv=Fv.range,Gv=Bv.range,Kv=qb((function(t){t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCDate(t.getUTCDate()+e)}),(function(t,e){return(e-t)/ev}),(function(t){return t.getUTCDate()-1})),Yv=Kv,Zv=Kv.range,Qv=qb((function(t){t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),(function(t,e){t.setUTCFullYear(t.getUTCFullYear()+e)}),(function(t,e){return e.getUTCFullYear()-t.getUTCFullYear()}),(function(t){return t.getUTCFullYear()}));Qv.every=function(t){return isFinite(t=Math.floor(t))&&t>0?qb((function(e){e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),(function(e,n){e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null};var Xv=Qv,Jv=Qv.range;function ty(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function ey(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function ny(t,e,n){return{y:t,m:e,d:n,H:0,M:0,S:0,L:0}}function ry(t){var e=t.dateTime,n=t.date,r=t.time,i=t.periods,o=t.days,a=t.shortDays,u=t.months,s=t.shortMonths,c=gy(i),f=my(i),l=gy(o),d=my(o),h=gy(a),p=my(a),g=gy(u),m=my(u),b=gy(s),v=my(s),y={a:function(t){return a[t.getDay()]},A:function(t){return o[t.getDay()]},b:function(t){return s[t.getMonth()]},B:function(t){return u[t.getMonth()]},c:null,d:Dy,e:Dy,f:zy,g:Jy,G:e_,H:Ly,I:Fy,j:By,L:Uy,m:Hy,M:Vy,p:function(t){return i[+(t.getHours()>=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:x_,s:E_,S:qy,u:Wy,U:Gy,V:Yy,w:Zy,W:Qy,x:null,X:null,y:Xy,Y:t_,Z:n_,"%":O_},_={a:function(t){return a[t.getUTCDay()]},A:function(t){return o[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return u[t.getUTCMonth()]},c:null,d:r_,e:r_,f:s_,g:y_,G:w_,H:i_,I:o_,j:a_,L:u_,m:c_,M:f_,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:x_,s:E_,S:l_,u:d_,U:h_,V:g_,w:m_,W:b_,x:null,X:null,y:v_,Y:__,Z:S_,"%":O_},w={a:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=l.exec(e.slice(n));return r?(t.w=d.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=b.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=g.exec(e.slice(n));return r?(t.m=m.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return x(t,e,n,r)},d:Ty,e:Ty,f:Py,g:Oy,G:Sy,H:Ay,I:Ay,j:$y,L:Iy,m:My,M:ky,p:function(t,e,n){var r=c.exec(e.slice(n));return r?(t.p=f.get(r[0].toLowerCase()),n+r[0].length):-1},q:Ey,Q:Ry,s:jy,S:Cy,u:vy,U:yy,V:_y,w:by,W:wy,x:function(t,e,r){return x(t,n,e,r)},X:function(t,e,n){return x(t,r,e,n)},y:Oy,Y:Sy,Z:xy,"%":Ny};function S(t,e){return function(n){var r,i,o,a=[],u=-1,s=0,c=t.length;for(n instanceof Date||(n=new Date(+n));++u53)return null;"w"in o||(o.w=1),"Z"in o?(i=(r=ey(ny(o.y,0,1))).getUTCDay(),r=i>4||0===i?Rv.ceil(r):Rv(r),r=Yv.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(i=(r=ty(ny(o.y,0,1))).getDay(),r=i>4||0===i?ov.ceil(r):ov(r),r=yv.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),i="Z"in o?ey(ny(o.y,0,1)).getUTCDay():ty(ny(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(i+5)%7:o.w+7*o.U-(i+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,ey(o)):ty(o)}}function x(t,e,n,r){for(var i,o,a=0,u=e.length,s=n.length;a=s)return-1;if(37===(i=e.charCodeAt(a++))){if(i=e.charAt(a++),!(o=w[i in cy?e.charAt(a++):i])||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return y.x=S(n,y),y.X=S(r,y),y.c=S(e,y),_.x=S(n,_),_.X=S(r,_),_.c=S(e,_),{format:function(t){var e=S(t+="",y);return e.toString=function(){return t},e},parse:function(t){var e=O(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=S(t+="",_);return e.toString=function(){return t},e},utcParse:function(t){var e=O(t+="",!0);return e.toString=function(){return t},e}}}var iy,oy,ay,uy,sy,cy={"-":"",_:" ",0:"0"},fy=/^\s*\d+/,ly=/^%/,dy=/[\\^$*+?|[\]().{}]/g;function hy(t,e,n){var r=t<0?"-":"",i=(r?-t:t)+"",o=i.length;return r+(o68?1900:2e3),n+r[0].length):-1}function xy(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Ey(t,e,n){var r=fy.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function My(t,e,n){var r=fy.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function Ty(t,e,n){var r=fy.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function $y(t,e,n){var r=fy.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function Ay(t,e,n){var r=fy.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function ky(t,e,n){var r=fy.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function Cy(t,e,n){var r=fy.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function Iy(t,e,n){var r=fy.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function Py(t,e,n){var r=fy.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Ny(t,e,n){var r=ly.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function Ry(t,e,n){var r=fy.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function jy(t,e,n){var r=fy.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function Dy(t,e){return hy(t.getDate(),e,2)}function Ly(t,e){return hy(t.getHours(),e,2)}function Fy(t,e){return hy(t.getHours()%12||12,e,2)}function By(t,e){return hy(1+yv.count(Gb(t),t),e,3)}function Uy(t,e){return hy(t.getMilliseconds(),e,3)}function zy(t,e){return Uy(t,e)+"000"}function Hy(t,e){return hy(t.getMonth()+1,e,2)}function Vy(t,e){return hy(t.getMinutes(),e,2)}function qy(t,e){return hy(t.getSeconds(),e,2)}function Wy(t){var e=t.getDay();return 0===e?7:e}function Gy(t,e){return hy(iv.count(Gb(t)-1,t),e,2)}function Ky(t){var e=t.getDay();return e>=4||0===e?sv(t):sv.ceil(t)}function Yy(t,e){return t=Ky(t),hy(sv.count(Gb(t),t)+(4===Gb(t).getDay()),e,2)}function Zy(t){return t.getDay()}function Qy(t,e){return hy(ov.count(Gb(t)-1,t),e,2)}function Xy(t,e){return hy(t.getFullYear()%100,e,2)}function Jy(t,e){return hy((t=Ky(t)).getFullYear()%100,e,2)}function t_(t,e){return hy(t.getFullYear()%1e4,e,4)}function e_(t,e){var n=t.getDay();return hy((t=n>=4||0===n?sv(t):sv.ceil(t)).getFullYear()%1e4,e,4)}function n_(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+hy(e/60|0,"0",2)+hy(e%60,"0",2)}function r_(t,e){return hy(t.getUTCDate(),e,2)}function i_(t,e){return hy(t.getUTCHours(),e,2)}function o_(t,e){return hy(t.getUTCHours()%12||12,e,2)}function a_(t,e){return hy(1+Yv.count(Xv(t),t),e,3)}function u_(t,e){return hy(t.getUTCMilliseconds(),e,3)}function s_(t,e){return u_(t,e)+"000"}function c_(t,e){return hy(t.getUTCMonth()+1,e,2)}function f_(t,e){return hy(t.getUTCMinutes(),e,2)}function l_(t,e){return hy(t.getUTCSeconds(),e,2)}function d_(t){var e=t.getUTCDay();return 0===e?7:e}function h_(t,e){return hy(Nv.count(Xv(t)-1,t),e,2)}function p_(t){var e=t.getUTCDay();return e>=4||0===e?Lv(t):Lv.ceil(t)}function g_(t,e){return t=p_(t),hy(Lv.count(Xv(t),t)+(4===Xv(t).getUTCDay()),e,2)}function m_(t){return t.getUTCDay()}function b_(t,e){return hy(Rv.count(Xv(t)-1,t),e,2)}function v_(t,e){return hy(t.getUTCFullYear()%100,e,2)}function y_(t,e){return hy((t=p_(t)).getUTCFullYear()%100,e,2)}function __(t,e){return hy(t.getUTCFullYear()%1e4,e,4)}function w_(t,e){var n=t.getUTCDay();return hy((t=n>=4||0===n?Lv(t):Lv.ceil(t)).getUTCFullYear()%1e4,e,4)}function S_(){return"+0000"}function O_(){return"%"}function x_(t){return+t}function E_(t){return Math.floor(+t/1e3)}function M_(t){return iy=ry(t),oy=iy.format,ay=iy.parse,uy=iy.utcFormat,sy=iy.utcParse,iy}M_({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var T_=1e3,$_=6e4,A_=36e5,k_=864e5,C_=2592e6,I_=31536e6;function P_(t){return new Date(t)}function N_(t){return t instanceof Date?+t:+new Date(+t)}function R_(t,e,n,r,i,a,u,s,c){var f=hb(),l=f.invert,d=f.domain,h=c(".%L"),p=c(":%S"),g=c("%I:%M"),m=c("%I %p"),b=c("%a %d"),v=c("%b %d"),y=c("%B"),_=c("%Y"),w=[[u,1,T_],[u,5,5e3],[u,15,15e3],[u,30,3e4],[a,1,$_],[a,5,3e5],[a,15,9e5],[a,30,18e5],[i,1,A_],[i,3,108e5],[i,6,216e5],[i,12,432e5],[r,1,k_],[r,2,1728e5],[n,1,6048e5],[e,1,C_],[e,3,7776e6],[t,1,I_]];function S(o){return(u(o)1)&&(t-=Math.floor(t));var e=Math.abs(t-.5);return OS.h=360*t-100,OS.s=1.5-1.5*e,OS.l=.8-.9*e,OS+""},ES=gr(),MS=Math.PI/3,TS=2*Math.PI/3,$S=function(t){var e;return t=(.5-t)*Math.PI,ES.r=255*(e=Math.sin(t))*e,ES.g=255*(e=Math.sin(t+MS))*e,ES.b=255*(e=Math.sin(t+TS))*e,ES+""},AS=function(t){return t=Math.max(0,Math.min(1,t)),"rgb("+Math.max(0,Math.min(255,Math.round(34.61+t*(1172.33-t*(10793.56-t*(33300.12-t*(38394.49-14825.05*t)))))))+", "+Math.max(0,Math.min(255,Math.round(23.31+t*(557.33+t*(1225.33-t*(3574.96-t*(1073.77+707.56*t)))))))+", "+Math.max(0,Math.min(255,Math.round(27.2+t*(3211.1-t*(15327.97-t*(27814-t*(22569.18-6838.66*t)))))))+")"};function kS(t){var e=t.length;return function(n){return t[Math.max(0,Math.min(e-1,Math.floor(n*e)))]}}var CS=kS(uw("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725")),IS=kS(uw("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),PS=kS(uw("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),NS=kS(uw("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),RS=function(t){return zn(En(t).call(document.documentElement))},jS=0;function DS(){return new LS}function LS(){this._="@"+(++jS).toString(36)}LS.prototype=DS.prototype={constructor:LS,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var FS=function(t,e){return t.target&&(t=Zr(t),void 0===e&&(e=t.currentTarget),t=t.touches||[t]),Array.from(t,(function(t){return Qr(t,e)}))},BS=function(t){return"string"===typeof t?new Fn([document.querySelectorAll(t)],[document.documentElement]):new Fn([null==t?[]:Te(t)],Ln)},US=function(t){return function(){return t}},zS=Math.abs,HS=Math.atan2,VS=Math.cos,qS=Math.max,WS=Math.min,GS=Math.sin,KS=Math.sqrt,YS=1e-12,ZS=Math.PI,QS=ZS/2,XS=2*ZS;function JS(t){return t>1?0:t<-1?ZS:Math.acos(t)}function tO(t){return t>=1?QS:t<=-1?-QS:Math.asin(t)}function eO(t){return t.innerRadius}function nO(t){return t.outerRadius}function rO(t){return t.startAngle}function iO(t){return t.endAngle}function oO(t){return t&&t.padAngle}function aO(t,e,n,r,i,o,a,u){var s=n-t,c=r-e,f=a-i,l=u-o,d=l*s-f*c;if(!(d*dk*k+C*C&&(x=M,E=T),{cx:x,cy:E,x01:-f,y01:-l,x11:x*(i/w-1),y11:E*(i/w-1)}}var sO=function(){var t=eO,e=nO,n=US(0),r=null,i=rO,o=iO,a=oO,u=null;function s(){var s,c,f=+t.apply(this,arguments),l=+e.apply(this,arguments),d=i.apply(this,arguments)-QS,h=o.apply(this,arguments)-QS,p=zS(h-d),g=h>d;if(u||(u=s=da()),lYS)if(p>XS-YS)u.moveTo(l*VS(d),l*GS(d)),u.arc(0,0,l,d,h,!g),f>YS&&(u.moveTo(f*VS(h),f*GS(h)),u.arc(0,0,f,h,d,g));else{var m,b,v=d,y=h,_=d,w=h,S=p,O=p,x=a.apply(this,arguments)/2,E=x>YS&&(r?+r.apply(this,arguments):KS(f*f+l*l)),M=WS(zS(l-f)/2,+n.apply(this,arguments)),T=M,$=M;if(E>YS){var A=tO(E/f*GS(x)),k=tO(E/l*GS(x));(S-=2*A)>YS?(_+=A*=g?1:-1,w-=A):(S=0,_=w=(d+h)/2),(O-=2*k)>YS?(v+=k*=g?1:-1,y-=k):(O=0,v=y=(d+h)/2)}var C=l*VS(v),I=l*GS(v),P=f*VS(w),N=f*GS(w);if(M>YS){var R,j=l*VS(y),D=l*GS(y),L=f*VS(_),F=f*GS(_);if(pYS?$>YS?(m=uO(L,F,C,I,l,$,g),b=uO(j,D,P,N,l,$,g),u.moveTo(m.cx+m.x01,m.cy+m.y01),$YS&&S>YS?T>YS?(m=uO(P,N,j,D,f,-T,g),b=uO(C,I,L,F,f,-T,g),u.lineTo(m.cx+m.x01,m.cy+m.y01),T=f;--l)u.point(m[l],b[l]);u.lineEnd(),u.areaEnd()}g&&(m[c]=+t(d,c,s),b[c]=+e(d,c,s),u.point(r?+r(d,c,s):m[c],n?+n(d,c,s):b[c]))}if(h)return u=null,h+""||null}function c(){return gO().defined(i).curve(a).context(o)}return t="function"===typeof t?t:void 0===t?hO:US(+t),e="function"===typeof e?e:US(void 0===e?0:+e),n="function"===typeof n?n:void 0===n?pO:US(+n),s.x=function(e){return arguments.length?(t="function"===typeof e?e:US(+e),r=null,s):t},s.x0=function(e){return arguments.length?(t="function"===typeof e?e:US(+e),s):t},s.x1=function(t){return arguments.length?(r=null==t?null:"function"===typeof t?t:US(+t),s):r},s.y=function(t){return arguments.length?(e="function"===typeof t?t:US(+t),n=null,s):e},s.y0=function(t){return arguments.length?(e="function"===typeof t?t:US(+t),s):e},s.y1=function(t){return arguments.length?(n=null==t?null:"function"===typeof t?t:US(+t),s):n},s.lineX0=s.lineY0=function(){return c().x(t).y(e)},s.lineY1=function(){return c().x(t).y(n)},s.lineX1=function(){return c().x(r).y(e)},s.defined=function(t){return arguments.length?(i="function"===typeof t?t:US(!!t),s):i},s.curve=function(t){return arguments.length?(a=t,null!=o&&(u=a(o)),s):a},s.context=function(t){return arguments.length?(null==t?o=u=null:u=a(o=t),s):o},s},bO=function(t,e){return et?1:e>=t?0:NaN},vO=function(t){return t},yO=function(){var t=vO,e=bO,n=null,r=US(0),i=US(XS),o=US(0);function a(a){var u,s,c,f,l,d=(a=fO(a)).length,h=0,p=new Array(d),g=new Array(d),m=+r.apply(this,arguments),b=Math.min(XS,Math.max(-XS,i.apply(this,arguments)-m)),v=Math.min(Math.abs(b)/d,o.apply(this,arguments)),y=v*(b<0?-1:1);for(u=0;u0&&(h+=l);for(null!=e?p.sort((function(t,n){return e(g[t],g[n])})):null!=n&&p.sort((function(t,e){return n(a[t],a[e])})),u=0,c=h?(b-d*y)/h:0;u0?l*c:0)+y,g[s]={data:a[s],index:u,value:l,startAngle:m,endAngle:f,padAngle:v};return g}return a.value=function(e){return arguments.length?(t="function"===typeof e?e:US(+e),a):t},a.sortValues=function(t){return arguments.length?(e=t,n=null,a):e},a.sort=function(t){return arguments.length?(n=t,e=null,a):n},a.startAngle=function(t){return arguments.length?(r="function"===typeof t?t:US(+t),a):r},a.endAngle=function(t){return arguments.length?(i="function"===typeof t?t:US(+t),a):i},a.padAngle=function(t){return arguments.length?(o="function"===typeof t?t:US(+t),a):o},a},_O=SO(dO);function wO(t){this._curve=t}function SO(t){function e(e){return new wO(t(e))}return e._curve=t,e}function OO(t){var e=t.curve;return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t.curve=function(t){return arguments.length?e(SO(t)):e()._curve},t}wO.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(t,e){this._curve.point(e*Math.sin(t),e*-Math.cos(t))}};var xO=function(){return OO(gO().curve(_O))},EO=function(){var t=mO().curve(_O),e=t.curve,n=t.lineX0,r=t.lineX1,i=t.lineY0,o=t.lineY1;return t.angle=t.x,delete t.x,t.startAngle=t.x0,delete t.x0,t.endAngle=t.x1,delete t.x1,t.radius=t.y,delete t.y,t.innerRadius=t.y0,delete t.y0,t.outerRadius=t.y1,delete t.y1,t.lineStartAngle=function(){return OO(n())},delete t.lineX0,t.lineEndAngle=function(){return OO(r())},delete t.lineX1,t.lineInnerRadius=function(){return OO(i())},delete t.lineY0,t.lineOuterRadius=function(){return OO(o())},delete t.lineY1,t.curve=function(t){return arguments.length?e(SO(t)):e()._curve},t},MO=function(t,e){return[(e=+e)*Math.cos(t-=Math.PI/2),e*Math.sin(t)]};function TO(t){return t.source}function $O(t){return t.target}function AO(t){var e=TO,n=$O,r=hO,i=pO,o=null;function a(){var a,u=cO.call(arguments),s=e.apply(this,u),c=n.apply(this,u);if(o||(o=a=da()),t(o,+r.apply(this,(u[0]=s,u)),+i.apply(this,u),+r.apply(this,(u[0]=c,u)),+i.apply(this,u)),a)return o=null,a+""||null}return a.source=function(t){return arguments.length?(e=t,a):e},a.target=function(t){return arguments.length?(n=t,a):n},a.x=function(t){return arguments.length?(r="function"===typeof t?t:US(+t),a):r},a.y=function(t){return arguments.length?(i="function"===typeof t?t:US(+t),a):i},a.context=function(t){return arguments.length?(o=null==t?null:t,a):o},a}function kO(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e=(e+r)/2,n,e,i,r,i)}function CO(t,e,n,r,i){t.moveTo(e,n),t.bezierCurveTo(e,n=(n+i)/2,r,n,r,i)}function IO(t,e,n,r,i){var o=MO(e,n),a=MO(e,n=(n+i)/2),u=MO(r,n),s=MO(r,i);t.moveTo(o[0],o[1]),t.bezierCurveTo(a[0],a[1],u[0],u[1],s[0],s[1])}function PO(){return AO(kO)}function NO(){return AO(CO)}function RO(){var t=AO(IO);return t.angle=t.x,delete t.x,t.radius=t.y,delete t.y,t}var jO={draw:function(t,e){var n=Math.sqrt(e/ZS);t.moveTo(n,0),t.arc(0,0,n,0,XS)}},DO={draw:function(t,e){var n=Math.sqrt(e/5)/2;t.moveTo(-3*n,-n),t.lineTo(-n,-n),t.lineTo(-n,-3*n),t.lineTo(n,-3*n),t.lineTo(n,-n),t.lineTo(3*n,-n),t.lineTo(3*n,n),t.lineTo(n,n),t.lineTo(n,3*n),t.lineTo(-n,3*n),t.lineTo(-n,n),t.lineTo(-3*n,n),t.closePath()}},LO=Math.sqrt(1/3),FO=2*LO,BO={draw:function(t,e){var n=Math.sqrt(e/FO),r=n*LO;t.moveTo(0,-n),t.lineTo(r,0),t.lineTo(0,n),t.lineTo(-r,0),t.closePath()}},UO=Math.sin(ZS/10)/Math.sin(7*ZS/10),zO=Math.sin(XS/10)*UO,HO=-Math.cos(XS/10)*UO,VO={draw:function(t,e){var n=Math.sqrt(.8908130915292852*e),r=zO*n,i=HO*n;t.moveTo(0,-n),t.lineTo(r,i);for(var o=1;o<5;++o){var a=XS*o/5,u=Math.cos(a),s=Math.sin(a);t.lineTo(s*n,-u*n),t.lineTo(u*r-s*i,s*r+u*i)}t.closePath()}},qO={draw:function(t,e){var n=Math.sqrt(e),r=-n/2;t.rect(r,r,n,n)}},WO=Math.sqrt(3),GO={draw:function(t,e){var n=-Math.sqrt(e/(3*WO));t.moveTo(0,2*n),t.lineTo(-WO*n,-n),t.lineTo(WO*n,-n),t.closePath()}},KO=-.5,YO=Math.sqrt(3)/2,ZO=1/Math.sqrt(12),QO=3*(ZO/2+1),XO={draw:function(t,e){var n=Math.sqrt(e/QO),r=n/2,i=n*ZO,o=r,a=n*ZO+n,u=-o,s=a;t.moveTo(r,i),t.lineTo(o,a),t.lineTo(u,s),t.lineTo(KO*r-YO*i,YO*r+KO*i),t.lineTo(KO*o-YO*a,YO*o+KO*a),t.lineTo(KO*u-YO*s,YO*u+KO*s),t.lineTo(KO*r+YO*i,KO*i-YO*r),t.lineTo(KO*o+YO*a,KO*a-YO*o),t.lineTo(KO*u+YO*s,KO*s-YO*u),t.closePath()}},JO=[jO,DO,BO,qO,VO,GO,XO],tx=function(t,e){var n=null;function r(){var r;if(n||(n=r=da()),t.apply(this,arguments).draw(n,+e.apply(this,arguments)),r)return n=null,r+""||null}return t="function"===typeof t?t:US(t||jO),e="function"===typeof e?e:US(void 0===e?64:+e),r.type=function(e){return arguments.length?(t="function"===typeof e?e:US(e),r):t},r.size=function(t){return arguments.length?(e="function"===typeof t?t:US(+t),r):e},r.context=function(t){return arguments.length?(n=null==t?null:t,r):n},r},ex=function(){};function nx(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function rx(t){this._context=t}rx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nx(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nx(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var ix=function(t){return new rx(t)};function ox(t){this._context=t}ox.prototype={areaStart:ex,areaEnd:ex,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:nx(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var ax=function(t){return new ox(t)};function ux(t){this._context=t}ux.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:nx(this,t,e)}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};var sx=function(t){return new ux(t)};function cx(t,e){this._basis=new rx(t),this._beta=e}cx.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var r,i=t[0],o=e[0],a=t[n]-i,u=e[n]-o,s=-1;++s<=n;)r=s/n,this._basis.point(this._beta*t[s]+(1-this._beta)*(i+r*a),this._beta*e[s]+(1-this._beta)*(o+r*u));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};var fx=function t(e){function n(t){return 1===e?new rx(t):new cx(t,e)}return n.beta=function(e){return t(+e)},n}(.85);function lx(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function dx(t,e){this._context=t,this._k=(1-e)/6}dx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:lx(this,this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:lx(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var hx=function t(e){function n(t){return new dx(t,e)}return n.tension=function(e){return t(+e)},n}(0);function px(t,e){this._context=t,this._k=(1-e)/6}px.prototype={areaStart:ex,areaEnd:ex,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:lx(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var gx=function t(e){function n(t){return new px(t,e)}return n.tension=function(e){return t(+e)},n}(0);function mx(t,e){this._context=t,this._k=(1-e)/6}mx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:lx(this,t,e)}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var bx=function t(e){function n(t){return new mx(t,e)}return n.tension=function(e){return t(+e)},n}(0);function vx(t,e,n){var r=t._x1,i=t._y1,o=t._x2,a=t._y2;if(t._l01_a>YS){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,s=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/s,i=(i*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/s}if(t._l23_a>YS){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*c+t._x1*t._l23_2a-e*t._l12_2a)/f,a=(a*c+t._y1*t._l23_2a-n*t._l12_2a)/f}t._context.bezierCurveTo(r,i,o,a,t._x2,t._y2)}function yx(t,e){this._context=t,this._alpha=e}yx.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:vx(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var _x=function t(e){function n(t){return e?new yx(t,e):new dx(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function wx(t,e){this._context=t,this._alpha=e}wx.prototype={areaStart:ex,areaEnd:ex,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:vx(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var Sx=function t(e){function n(t){return e?new wx(t,e):new px(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ox(t,e){this._context=t,this._alpha=e}Ox.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,r=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:vx(this,t,e)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};var xx=function t(e){function n(t){return e?new Ox(t,e):new mx(t,0)}return n.alpha=function(e){return t(+e)},n}(.5);function Ex(t){this._context=t}Ex.prototype={areaStart:ex,areaEnd:ex,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};var Mx=function(t){return new Ex(t)};function Tx(t){return t<0?-1:1}function $x(t,e,n){var r=t._x1-t._x0,i=e-t._x1,o=(t._y1-t._y0)/(r||i<0&&-0),a=(n-t._y1)/(i||r<0&&-0),u=(o*i+a*r)/(r+i);return(Tx(o)+Tx(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(u))||0}function Ax(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function kx(t,e,n){var r=t._x0,i=t._y0,o=t._x1,a=t._y1,u=(o-r)/3;t._context.bezierCurveTo(r+u,i+u*e,o-u,a-u*n,o,a)}function Cx(t){this._context=t}function Ix(t){this._context=new Px(t)}function Px(t){this._context=t}function Nx(t){return new Cx(t)}function Rx(t){return new Ix(t)}function jx(t){this._context=t}function Dx(t){var e,n,r=t.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(i[0]=0,o[0]=2,a[0]=t[0]+2*t[1],e=1;e=0;--e)i[e]=(a[e]-i[e+1])/o[e];for(o[r-1]=(t[r]+i[r-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}}this._x=t,this._y=e}};var Bx=function(t){return new Fx(t,.5)};function Ux(t){return new Fx(t,0)}function zx(t){return new Fx(t,1)}var Hx=function(t,e){if((i=t.length)>1)for(var n,r,i,o=1,a=t[e[0]],u=a.length;o=0;)n[e]=e;return n};function qx(t,e){return t[e]}function Wx(t){var e=[];return e.key=t,e}var Gx=function(){var t=US([]),e=Vx,n=Hx,r=qx;function i(i){var o,a,u,c=Array.from(t.apply(this,arguments),Wx),f=c.length,l=-1,d=Object(s.a)(i);try{for(d.s();!(u=d.n()).done;){var h=u.value;for(o=0,++l;o0){for(var n,r,i,o=0,a=t[0].length;o0)for(var n,r,i,o,a,u,s=0,c=t[e[0]].length;s0?(r[0]=o,r[1]=o+=i):i<0?(r[1]=a,r[0]=a+=i):(r[0]=0,r[1]=i)},Zx=function(t,e){if((n=t.length)>0){for(var n,r=0,i=t[e[0]],o=i.length;r0&&(r=(n=t[e[0]]).length)>0){for(var n,r,i,o=0,a=1;ao&&(o=e,r=n);return r}var tE=function(t){var e=t.map(eE);return Vx(t).sort((function(t,n){return e[t]-e[n]}))};function eE(t){for(var e,n=0,r=-1,i=t.length;++rr?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}var SE=function(){var t,e,n,r=mE,i=bE,o=wE,a=yE,u=_E,s=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],f=250,l=fm,d=Oe("start","zoom","end"),h=500,p=0,g=10;function m(t){t.property("__zoom",vE).on("wheel.zoom",O).on("mousedown.zoom",x).on("dblclick.zoom",E).filter(u).on("touchstart.zoom",M).on("touchmove.zoom",T).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(t,e){return(e=Math.max(s[0],Math.min(s[1],e)))===t.k?t:new lE(e,t.x,t.y)}function v(t,e,n){var r=e[0]-n[0]*t.k,i=e[1]-n[1]*t.k;return r===t.x&&i===t.y?t:new lE(t.k,r,i)}function y(t){return[(+t[0][0]+ +t[1][0])/2,(+t[0][1]+ +t[1][1])/2]}function _(t,e,n,r){t.on("start.zoom",(function(){w(this,arguments).event(r).start()})).on("interrupt.zoom end.zoom",(function(){w(this,arguments).event(r).end()})).tween("zoom",(function(){var t=this,o=arguments,a=w(t,o).event(r),u=i.apply(t,o),s=null==n?y(u):"function"===typeof n?n.apply(t,o):n,c=Math.max(u[1][0]-u[0][0],u[1][1]-u[0][1]),f=t.__zoom,d="function"===typeof e?e.apply(t,o):e,h=l(f.invert(s).concat(c/f.k),d.invert(s).concat(c/d.k));return function(t){if(1===t)t=d;else{var e=h(t),n=c/e[2];t=new lE(n,s[0]-e[0]*n,s[1]-e[1]*n)}a.zoom(null,t)}}))}function w(t,e,n){return!n&&t.__zooming||new S(t,e)}function S(t,e){this.that=t,this.args=e,this.active=0,this.sourceEvent=null,this.extent=i.apply(t,e),this.taps=0}function O(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?e-1:0),a=1;ap}u.event(t).zoom("mouse",o(v(u.that.__zoom,u.mouse[0]=Qr(t,l),u.mouse[1]),u.extent,c))}function m(t){s.on("mousemove.zoom mouseup.zoom",null),Wn(t.view,u.moved),gE(t),u.event(t).end()}}function E(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),a=1;a0?zn(this).transition().duration(f).call(_,h,s,t):zn(this).call(m.transform,h,s,t)}}function M(n){for(var i=arguments.length,o=new Array(i>1?i-1:0),a=1;a1?e-1:0),r=1;r1?r-1:0),o=1;o=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(t).length;default:if(r)return U(t).length;e=(""+e).toLowerCase(),r=!0}}function g(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,e,n);case"utf8":case"utf-8":return M(this,e,n);case"ascii":return $(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return E(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function m(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function b(t,e,n,r,i){if(0===t.length)return-1;if("string"===typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"===typeof e&&(e=s.from(e,r)),s.isBuffer(e))return 0===e.length?-1:v(t,e,n,r,i);if("number"===typeof e)return e&=255,s.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):v(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,n,r,i){var o,a=1,u=t.length,s=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,u/=2,s/=2,n/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=n;ou&&(n=u-s),o=n;o>=0;o--){for(var l=!0,d=0;di&&(r=i):r=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function E(t,e,n){return 0===e&&n===t.length?r.fromByteArray(t):r.fromByteArray(t.slice(e,n))}function M(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+l<=n)switch(l){case 1:c<128&&(f=c);break;case 2:128===(192&(o=t[i+1]))&&(s=(31&c)<<6|63&o)>127&&(f=s);break;case 3:o=t[i+1],a=t[i+2],128===(192&o)&&128===(192&a)&&(s=(15&c)<<12|(63&o)<<6|63&a)>2047&&(s<55296||s>57343)&&(f=s);break;case 4:o=t[i+1],a=t[i+2],u=t[i+3],128===(192&o)&&128===(192&a)&&128===(192&u)&&(s=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&u)>65535&&s<1114112&&(f=s)}null===f?(f=65533,l=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=l}return function(t){var e=t.length;if(e<=T)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},s.prototype.compare=function(t,e,n,r,i){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),u=Math.min(o,a),c=this.slice(r,i),f=t.slice(e,n),l=0;li)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return y(this,t,e,n);case"utf8":case"utf-8":return _(this,t,e,n);case"ascii":return w(this,t,e,n);case"latin1":case"binary":return S(this,t,e,n);case"base64":return O(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var T=4096;function $(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;ir)&&(n=r);for(var i="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,n,r,i,o){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function N(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function R(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function j(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function D(t,e,n,r,o){return o||j(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function L(t,e,n,r,o){return o||j(t,0,n,8),i.write(t,e,n,r,52,8),n+8}s.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e0&&(i*=256);)r+=this[t+--e]*i;return r},s.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=this[t],i=1,o=0;++o=(i*=128)&&(r-=Math.pow(2,8*e)),r},s.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||I(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},s.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||P(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+n},s.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},s.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},s.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},s.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},s.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},s.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=0,a=1,u=0;for(this[e]=255&t;++o>0)-u&255;return e+n},s.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);P(this,t,e,n,i-1,-i)}var o=n-1,a=1,u=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/a>>0)-u&255;return e+n},s.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):N(this,t,e,!0),e+2},s.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):N(this,t,e,!1),e+2},s.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},s.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},s.prototype.writeFloatLE=function(t,e,n){return D(this,t,e,!0,n)},s.prototype.writeFloatBE=function(t,e,n){return D(this,t,e,!1,n)},s.prototype.writeDoubleLE=function(t,e,n){return L(this,t,e,!0,n)},s.prototype.writeDoubleBE=function(t,e,n){return L(this,t,e,!1,n)},s.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--i)t[i+e]=this[i+n];else if(o<1e3||!s.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"===typeof t)for(o=e;o55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function z(t){return r.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(F,"")).length<2)return"";for(;t.length%4!==0;)t+="=";return t}(t))}function H(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(59))},function(t,e,n){"use strict";function r(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return s}));var r=n(14),i="Invariant Violation",o=Object.setPrototypeOf,a=void 0===o?function(t,e){return t.__proto__=e,t}:o,u=function(t){function e(n){void 0===n&&(n=i);var r=t.call(this,"number"===typeof n?i+": "+n+" (see https://github.com/apollographql/invariant-packages)":n)||this;return r.framesToPop=1,r.name=i,a(r,e.prototype),r}return Object(r.c)(e,t),e}(Error);function s(t,e){if(!t)throw new u(e)}function c(t){return function(){return console[t].apply(console,arguments)}}!function(t){t.warn=c("warn"),t.error=c("error")}(s||(s={}));var f={env:{}};if("object"===typeof t)f=t;else try{Function("stub","process = stub")(f)}catch(l){}}).call(this,n(69))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(57);function i(t){return function e(n){return 0===arguments.length||Object(r.a)(n)?e:t.apply(this,arguments)}}},function(t,e,n){var r;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,u=Math.ceil,s=Math.floor,c="[BigNumber Error] ",f=c+"Number primitive has more than 15 significant digits: ",l=1e14,d=14,h=9007199254740991,p=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],g=1e7,m=1e9;function b(t){var e=0|t;return t>0||t===e?e:e-1}function v(t){for(var e,n,r=1,i=t.length,o=t[0]+"";rc^n?1:-1;for(u=(s=i.length)<(c=o.length)?s:c,a=0;ao[a]^n?1:-1;return s==c?0:s>c^n?1:-1}function _(t,e,n,r){if(tn||t!==s(t))throw Error(c+(r||"Argument")+("number"==typeof t?tn?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function w(t){var e=t.c.length-1;return b(t.e/d)==e&&t.c[e]%2!=0}function S(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function O(t,e,n){var r,i;if(e<0){for(i=n+".";++e;i+=n);t=i+t}else if(++e>(r=t.length)){for(i=n,e-=r;--e;i+=n);t+=i}else ek?b.c=b.e=null:t.e=10;l/=10,c++);return void(c>k?b.c=b.e=null:(b.e=c,b.c=[t]))}m=String(t)}else{if(!a.test(m=String(t)))return i(b,m,p);b.s=45==m.charCodeAt(0)?(m=m.slice(1),-1):1}(c=m.indexOf("."))>-1&&(m=m.replace(".","")),(l=m.search(/e/i))>0?(c<0&&(c=l),c+=+m.slice(l+1),m=m.substring(0,l)):c<0&&(c=m.length)}else{if(_(e,2,R.length,"Base"),10==e)return B(b=new j(t),E+b.e+1,M);if(m=String(t),p="number"==typeof t){if(0*t!=0)return i(b,m,p,e);if(b.s=1/t<0?(m=m.slice(1),-1):1,j.DEBUG&&m.replace(/^0\.0*|\./,"").length>15)throw Error(f+t)}else b.s=45===m.charCodeAt(0)?(m=m.slice(1),-1):1;for(n=R.slice(0,e),c=l=0,g=m.length;lc){c=g;continue}}else if(!u&&(m==m.toUpperCase()&&(m=m.toLowerCase())||m==m.toLowerCase()&&(m=m.toUpperCase()))){u=!0,l=-1,c=0;continue}return i(b,String(t),p,e)}p=!1,(c=(m=r(m,e,10,b.s)).indexOf("."))>-1?m=m.replace(".",""):c=m.length}for(l=0;48===m.charCodeAt(l);l++);for(g=m.length;48===m.charCodeAt(--g););if(m=m.slice(l,++g)){if(g-=l,p&&j.DEBUG&&g>15&&(t>h||t!==s(t)))throw Error(f+b.s*t);if((c=c-l-1)>k)b.c=b.e=null;else if(c=$)?S(s,a):O(s,a,"0");else if(o=(t=B(new j(t),e,n)).e,u=(s=v(t.c)).length,1==r||2==r&&(e<=o||o<=T)){for(;uu){if(--e>0)for(s+=".";e--;s+="0");}else if((e+=o-u)>0)for(o+1==u&&(s+=".");e--;s+="0");return t.s<0&&i?"-"+s:s}function L(t,e){for(var n,r=1,i=new j(t[0]);r=10;i/=10,r++);return(n=r+n*d-1)>k?t.c=t.e=null:n=10;c/=10,i++);if((o=e-i)<0)o+=d,a=e,g=(f=m[h=0])/b[i-a-1]%10|0;else if((h=u((o+1)/d))>=m.length){if(!r)break t;for(;m.length<=h;m.push(0));f=g=0,i=1,a=(o%=d)-d+1}else{for(f=c=m[h],i=1;c>=10;c/=10,i++);g=(a=(o%=d)-d+i)<0?0:f/b[i-a-1]%10|0}if(r=r||e<0||null!=m[h+1]||(a<0?f:f%b[i-a-1]),r=n<4?(g||r)&&(0==n||n==(t.s<0?3:2)):g>5||5==g&&(4==n||r||6==n&&(o>0?a>0?f/b[i-a]:0:m[h-1])%10&1||n==(t.s<0?8:7)),e<1||!m[0])return m.length=0,r?(e-=t.e+1,m[0]=b[(d-e%d)%d],t.e=-e||0):m[0]=t.e=0,t;if(0==o?(m.length=h,c=1,h--):(m.length=h+1,c=b[d-o],m[h]=a>0?s(f/b[i-a]%b[a])*c:0),r)for(;;){if(0==h){for(o=1,a=m[0];a>=10;a/=10,o++);for(a=m[0]+=c,c=1;a>=10;a/=10,c++);o!=c&&(t.e++,m[0]==l&&(m[0]=1));break}if(m[h]+=c,m[h]!=l)break;m[h--]=0,c=1}for(o=m.length;0===m[--o];m.pop());}t.e>k?t.c=t.e=null:t.e=$?S(e,n):O(e,n,"0"),t.s<0?"-"+e:e)}return j.clone=t,j.ROUND_UP=0,j.ROUND_DOWN=1,j.ROUND_CEIL=2,j.ROUND_FLOOR=3,j.ROUND_HALF_UP=4,j.ROUND_HALF_DOWN=5,j.ROUND_HALF_EVEN=6,j.ROUND_HALF_CEIL=7,j.ROUND_HALF_FLOOR=8,j.EUCLID=9,j.config=j.set=function(t){var e,n;if(null!=t){if("object"!=typeof t)throw Error(c+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(_(n=t[e],0,m,e),E=n),t.hasOwnProperty(e="ROUNDING_MODE")&&(_(n=t[e],0,8,e),M=n),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((n=t[e])&&n.pop?(_(n[0],-m,0,e),_(n[1],0,m,e),T=n[0],$=n[1]):(_(n,-m,m,e),T=-($=n<0?-n:n))),t.hasOwnProperty(e="RANGE"))if((n=t[e])&&n.pop)_(n[0],-m,-1,e),_(n[1],1,m,e),A=n[0],k=n[1];else{if(_(n,-m,m,e),!n)throw Error(c+e+" cannot be zero: "+n);A=-(k=n<0?-n:n)}if(t.hasOwnProperty(e="CRYPTO")){if((n=t[e])!==!!n)throw Error(c+e+" not true or false: "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw C=!n,Error(c+"crypto unavailable");C=n}else C=n}if(t.hasOwnProperty(e="MODULO_MODE")&&(_(n=t[e],0,9,e),I=n),t.hasOwnProperty(e="POW_PRECISION")&&(_(n=t[e],0,m,e),P=n),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(n=t[e]))throw Error(c+e+" not an object: "+n);N=n}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(n=t[e])||/^.$|[+-.\s]|(.).*\1/.test(n))throw Error(c+e+" invalid: "+n);R=n}}return{DECIMAL_PLACES:E,ROUNDING_MODE:M,EXPONENTIAL_AT:[T,$],RANGE:[A,k],CRYPTO:C,MODULO_MODE:I,POW_PRECISION:P,FORMAT:N,ALPHABET:R}},j.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!j.DEBUG)return!0;var e,n,r=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(r)){if((1===o||-1===o)&&i>=-m&&i<=m&&i===s(i)){if(0===r[0]){if(0===i&&1===r.length)return!0;break t}if((e=(i+1)%d)<1&&(e+=d),String(r[0]).length==e){for(e=0;e=l||n!==s(n))break t;if(0!==n)return!0}}}else if(null===r&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+t)},j.maximum=j.max=function(){return L(arguments,o.lt)},j.minimum=j.min=function(){return L(arguments,o.gt)},j.random=function(){var t=9007199254740992,e=Math.random()*t&2097151?function(){return s(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var n,r,i,o,a,f=0,l=[],h=new j(x);if(null==t?t=E:_(t,0,m),o=u(t/d),C)if(crypto.getRandomValues){for(n=crypto.getRandomValues(new Uint32Array(o*=2));f>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),n[f]=r[0],n[f+1]=r[1]):(l.push(a%1e14),f+=2);f=o/2}else{if(!crypto.randomBytes)throw C=!1,Error(c+"crypto unavailable");for(n=crypto.randomBytes(o*=7);f=9e15?crypto.randomBytes(7).copy(n,f):(l.push(a%1e14),f+=7);f=o/7}if(!C)for(;f=10;a/=10,f++);fn-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/n|0,a[i]%=n)}return a.reverse()}return function(r,i,o,a,u){var s,c,f,l,d,h,p,g,m=r.indexOf("."),b=E,y=M;for(m>=0&&(l=P,P=0,r=r.replace(".",""),h=(g=new j(i)).pow(r.length-m),P=l,g.c=e(O(v(h.c),h.e,"0"),10,o,t),g.e=g.c.length),f=l=(p=e(r,i,o,u?(s=R,t):(s=t,R))).length;0==p[--l];p.pop());if(!p[0])return s.charAt(0);if(m<0?--f:(h.c=p,h.e=f,h.s=a,p=(h=n(h,g,b,y,o)).c,d=h.r,f=h.e),m=p[c=f+b+1],l=o/2,d=d||c<0||null!=p[c+1],d=y<4?(null!=m||d)&&(0==y||y==(h.s<0?3:2)):m>l||m==l&&(4==y||d||6==y&&1&p[c-1]||y==(h.s<0?8:7)),c<1||!p[0])r=d?O(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else{if(p.length=c,d)for(--o;++p[--c]>o;)p[c]=0,c||(++f,p=[1].concat(p));for(l=p.length;!p[--l];);for(m=0,r="";m<=l;r+=s.charAt(p[m++]));r=O(r,f,s.charAt(0))}return r}}(),n=function(){function t(t,e,n){var r,i,o,a,u=0,s=t.length,c=e%g,f=e/g|0;for(t=t.slice();s--;)u=((i=c*(o=t[s]%g)+(r=f*o+(a=t[s]/g|0)*c)%g*g+u)/n|0)+(r/g|0)+f*a,t[s]=i%n;return u&&(t=[u].concat(t)),t}function e(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;ie[i]?1:-1;break}return o}function n(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;t.splice(0,1));}return function(r,i,o,a,u){var c,f,h,p,g,m,v,y,_,w,S,O,x,E,M,T,$,A=r.s==i.s?1:-1,k=r.c,C=i.c;if(!k||!k[0]||!C||!C[0])return new j(r.s&&i.s&&(k?!C||k[0]!=C[0]:C)?k&&0==k[0]||!C?0*A:A/0:NaN);for(_=(y=new j(A)).c=[],A=o+(f=r.e-i.e)+1,u||(u=l,f=b(r.e/d)-b(i.e/d),A=A/d|0),h=0;C[h]==(k[h]||0);h++);if(C[h]>(k[h]||0)&&f--,A<0)_.push(1),p=!0;else{for(E=k.length,T=C.length,h=0,A+=2,(g=s(u/(C[0]+1)))>1&&(C=t(C,g,u),k=t(k,g,u),T=C.length,E=k.length),x=T,S=(w=k.slice(0,T)).length;S=u/2&&M++;do{if(g=0,(c=e(C,w,T,S))<0){if(O=w[0],T!=S&&(O=O*u+(w[1]||0)),(g=s(O/M))>1)for(g>=u&&(g=u-1),v=(m=t(C,g,u)).length,S=w.length;1==e(m,w,v,S);)g--,n(m,T=10;A/=10,h++);B(y,o+(y.e=h+f*d-1)+1,a,p)}else y.e=f,y.r=+p;return y}}(),i=function(){var t=/^(-?)0([xbo])(?=\w[\w.]*$)/i,e=/^([^.]+)\.$/,n=/^\.([^.]+)$/,r=/^-?(Infinity|NaN)$/,i=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(o,a,u,s){var f,l=u?a:a.replace(i,"");if(r.test(l))o.s=isNaN(l)?null:l<0?-1:1;else{if(!u&&(l=l.replace(t,(function(t,e,n){return f="x"==(n=n.toLowerCase())?16:"b"==n?2:8,s&&s!=f?t:e})),s&&(f=s,l=l.replace(e,"$1").replace(n,"0.$1")),a!=l))return new j(l,f);if(j.DEBUG)throw Error(c+"Not a"+(s?" base "+s:"")+" number: "+a);o.s=null}o.c=o.e=null}}(),o.absoluteValue=o.abs=function(){var t=new j(this);return t.s<0&&(t.s=1),t},o.comparedTo=function(t,e){return y(this,new j(t,e))},o.decimalPlaces=o.dp=function(t,e){var n,r,i,o=this;if(null!=t)return _(t,0,m),null==e?e=M:_(e,0,8),B(new j(o),t+o.e+1,e);if(!(n=o.c))return null;if(r=((i=n.length-1)-b(this.e/d))*d,i=n[i])for(;i%10==0;i/=10,r--);return r<0&&(r=0),r},o.dividedBy=o.div=function(t,e){return n(this,new j(t,e),E,M)},o.dividedToIntegerBy=o.idiv=function(t,e){return n(this,new j(t,e),0,1)},o.exponentiatedBy=o.pow=function(t,e){var n,r,i,o,a,f,l,h,p=this;if((t=new j(t)).c&&!t.isInteger())throw Error(c+"Exponent not an integer: "+U(t));if(null!=e&&(e=new j(e)),a=t.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!t.c||!t.c[0])return h=new j(Math.pow(+U(p),a?2-w(t):+U(t))),e?h.mod(e):h;if(f=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new j(NaN);(r=!f&&p.isInteger()&&e.isInteger())&&(p=p.mod(e))}else{if(t.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||a&&p.c[1]>=24e7:p.c[0]<8e13||a&&p.c[0]<=9999975e7)))return o=p.s<0&&w(t)?-0:0,p.e>-1&&(o=1/o),new j(f?1/o:o);P&&(o=u(P/d+2))}for(a?(n=new j(.5),f&&(t.s=1),l=w(t)):l=(i=Math.abs(+U(t)))%2,h=new j(x);;){if(l){if(!(h=h.times(p)).c)break;o?h.c.length>o&&(h.c.length=o):r&&(h=h.mod(e))}if(i){if(0===(i=s(i/2)))break;l=i%2}else if(B(t=t.times(n),t.e+1,1),t.e>14)l=w(t);else{if(0===(i=+U(t)))break;l=i%2}p=p.times(p),o?p.c&&p.c.length>o&&(p.c.length=o):r&&(p=p.mod(e))}return r?h:(f&&(h=x.div(h)),e?h.mod(e):o?B(h,P,M,undefined):h)},o.integerValue=function(t){var e=new j(this);return null==t?t=M:_(t,0,8),B(e,e.e+1,t)},o.isEqualTo=o.eq=function(t,e){return 0===y(this,new j(t,e))},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(t,e){return y(this,new j(t,e))>0},o.isGreaterThanOrEqualTo=o.gte=function(t,e){return 1===(e=y(this,new j(t,e)))||0===e},o.isInteger=function(){return!!this.c&&b(this.e/d)>this.c.length-2},o.isLessThan=o.lt=function(t,e){return y(this,new j(t,e))<0},o.isLessThanOrEqualTo=o.lte=function(t,e){return-1===(e=y(this,new j(t,e)))||0===e},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&0==this.c[0]},o.minus=function(t,e){var n,r,i,o,a=this,u=a.s;if(e=(t=new j(t,e)).s,!u||!e)return new j(NaN);if(u!=e)return t.s=-e,a.plus(t);var s=a.e/d,c=t.e/d,f=a.c,h=t.c;if(!s||!c){if(!f||!h)return f?(t.s=-e,t):new j(h?a:NaN);if(!f[0]||!h[0])return h[0]?(t.s=-e,t):new j(f[0]?a:3==M?-0:0)}if(s=b(s),c=b(c),f=f.slice(),u=s-c){for((o=u<0)?(u=-u,i=f):(c=s,i=h),i.reverse(),e=u;e--;i.push(0));i.reverse()}else for(r=(o=(u=f.length)<(e=h.length))?u:e,u=e=0;e0)for(;e--;f[n++]=0);for(e=l-1;r>u;){if(f[--r]=0;){for(n=0,p=O[i]%_,m=O[i]/_|0,o=i+(a=s);o>i;)n=((c=p*(c=S[--a]%_)+(u=m*c+(f=S[a]/_|0)*p)%_*_+v[o]+n)/y|0)+(u/_|0)+m*f,v[o--]=c%y;v[o]=n}return n?++r:v.splice(0,1),F(t,v,r)},o.negated=function(){var t=new j(this);return t.s=-t.s||null,t},o.plus=function(t,e){var n,r=this,i=r.s;if(e=(t=new j(t,e)).s,!i||!e)return new j(NaN);if(i!=e)return t.s=-e,r.minus(t);var o=r.e/d,a=t.e/d,u=r.c,s=t.c;if(!o||!a){if(!u||!s)return new j(i/0);if(!u[0]||!s[0])return s[0]?t:new j(u[0]?r:0*i)}if(o=b(o),a=b(a),u=u.slice(),i=o-a){for(i>0?(a=o,n=s):(i=-i,n=u),n.reverse();i--;n.push(0));n.reverse()}for((i=u.length)-(e=s.length)<0&&(n=s,s=u,u=n,e=i),i=0;e;)i=(u[--e]=u[e]+s[e]+i)/l|0,u[e]=l===u[e]?0:u[e]%l;return i&&(u=[i].concat(u),++a),F(t,u,a)},o.precision=o.sd=function(t,e){var n,r,i,o=this;if(null!=t&&t!==!!t)return _(t,1,m),null==e?e=M:_(e,0,8),B(new j(o),t,e);if(!(n=o.c))return null;if(r=(i=n.length-1)*d+1,i=n[i]){for(;i%10==0;i/=10,r--);for(i=n[0];i>=10;i/=10,r++);}return t&&o.e+1>r&&(r=o.e+1),r},o.shiftedBy=function(t){return _(t,-9007199254740991,h),this.times("1e"+t)},o.squareRoot=o.sqrt=function(){var t,e,r,i,o,a=this,u=a.c,s=a.s,c=a.e,f=E+4,l=new j("0.5");if(1!==s||!u||!u[0])return new j(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+U(a)))||s==1/0?(((e=v(u)).length+c)%2==0&&(e+="0"),s=Math.sqrt(+e),c=b((c+1)/2)-(c<0||c%2),r=new j(e=s==1/0?"1e"+c:(e=s.toExponential()).slice(0,e.indexOf("e")+1)+c)):r=new j(s+""),r.c[0])for((s=(c=r.e)+f)<3&&(s=0);;)if(o=r,r=l.times(o.plus(n(a,o,f,1))),v(o.c).slice(0,s)===(e=v(r.c)).slice(0,s)){if(r.e0&&g>0){for(o=g%u||u,l=p.substr(0,o);o0&&(l+=f+p.slice(o)),h&&(l="-"+l)}r=d?l+(n.decimalSeparator||"")+((s=+n.fractionGroupSize)?d.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(n.fractionGroupSeparator||"")):d):l}return(n.prefix||"")+r+(n.suffix||"")},o.toFraction=function(t){var e,r,i,o,a,u,s,f,l,h,g,m,b=this,y=b.c;if(null!=t&&(!(s=new j(t)).isInteger()&&(s.c||1!==s.s)||s.lt(x)))throw Error(c+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+U(s));if(!y)return new j(b);for(e=new j(x),l=r=new j(x),i=f=new j(x),m=v(y),a=e.e=m.length-b.e-1,e.c[0]=p[(u=a%d)<0?d+u:u],t=!t||s.comparedTo(e)>0?a>0?e:l:s,u=k,k=1/0,s=new j(m),f.c[0]=0;h=n(s,e,0,1),1!=(o=r.plus(h.times(i))).comparedTo(t);)r=i,i=o,l=f.plus(h.times(o=l)),f=o,e=s.minus(h.times(o=e)),s=o;return o=n(t.minus(r),i,0,1),f=f.plus(o.times(l)),r=r.plus(o.times(i)),f.s=l.s=b.s,g=n(l,i,a*=2,M).minus(b).abs().comparedTo(n(f,r,a,M).minus(b).abs())<1?[l,i]:[f,r],k=u,g},o.toNumber=function(){return+U(this)},o.toPrecision=function(t,e){return null!=t&&_(t,1,m),D(this,t,e,2)},o.toString=function(t){var e,n=this,i=n.s,o=n.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=T||o>=$?S(v(n.c),o):O(v(n.c),o,"0"):10===t?e=O(v((n=B(new j(n),E+o+1,M)).c),n.e,"0"):(_(t,2,R.length,"Base"),e=r(O(v(n.c),o,"0"),10,t,i,!0)),i<0&&n.c[0]&&(e="-"+e)),e},o.valueOf=o.toJSON=function(){return U(this)},o._isBigNumber=!0,null!=e&&j.set(e),j}()).default=o.BigNumber=o,void 0===(r=function(){return o}.call(e,n,e,t))||(t.exports=r)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(284);function i(t){if("string"!==typeof t)throw new Error(Object(r.a)(7));return t.charAt(0).toUpperCase()+t.slice(1)}},function(t,e,n){t.exports=n(720)},function(t,e,n){"use strict";n.d(e,"g",(function(){return o})),n.d(e,"k",(function(){return a})),n.d(e,"h",(function(){return u})),n.d(e,"b",(function(){return s})),n.d(e,"j",(function(){return c})),n.d(e,"e",(function(){return f})),n.d(e,"f",(function(){return l})),n.d(e,"c",(function(){return d})),n.d(e,"d",(function(){return h})),n.d(e,"a",(function(){return p})),n.d(e,"i",(function(){return g}));var r=n(284);function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(e,t),n)}function o(t){t=t.substr(1);var e=new RegExp(".{1,".concat(t.length>=6?2:1,"}"),"g"),n=t.match(e);return n&&1===n[0].length&&(n=n.map((function(t){return t+t}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(t,e){return e<3?parseInt(t,16):Math.round(parseInt(t,16)/255*1e3)/1e3})).join(", "),")"):""}function a(t){if(0===t.indexOf("#"))return t;var e=s(t).values;return"#".concat(e.map((function(t){return function(t){var e=t.toString(16);return 1===e.length?"0".concat(e):e}(t)})).join(""))}function u(t){var e=(t=s(t)).values,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+n/30)%12;return i-o*Math.max(Math.min(e-3,9-e,1),-1)},u="rgb",f=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===t.type&&(u+="a",f.push(e[3])),c({type:u,values:f})}function s(t){if(t.type)return t;if("#"===t.charAt(0))return s(o(t));var e=t.indexOf("("),n=t.substring(0,e);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error(Object(r.a)(3,t));var i=t.substring(e+1,t.length-1).split(",");return{type:n,values:i=i.map((function(t){return parseFloat(t)}))}}function c(t){var e=t.type,n=t.values;return-1!==e.indexOf("rgb")?n=n.map((function(t,e){return e<3?parseInt(t,10):t})):-1!==e.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(e,"(").concat(n.join(", "),")")}function f(t,e){var n=l(t),r=l(e);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function l(t){var e="hsl"===(t=s(t)).type?s(u(t)).values:t.values;return e=e.map((function(t){return(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function d(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.15;return l(t)>.5?p(t,e):g(t,e)}function h(t,e){return t=s(t),e=i(e),"rgb"!==t.type&&"hsl"!==t.type||(t.type+="a"),t.values[3]=e,c(t)}function p(t,e){if(t=s(t),e=i(e),-1!==t.type.indexOf("hsl"))t.values[2]*=1-e;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]*=1-e;return c(t)}function g(t,e){if(t=s(t),e=i(e),-1!==t.type.indexOf("hsl"))t.values[2]+=(100-t.values[2])*e;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;return c(t)}},function(t,e,n){var r=n(29),i=r.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function a(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(t,e,n){if("number"===typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},a.alloc=function(t,e,n){if("number"!==typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"===typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e){"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},function(t,e,n){"use strict";function r(t,e,n){return(n=n||[]).length>=e?t.apply(null,n.slice(0,e).reverse()):function(){var i=Array.prototype.slice.call(arguments);return r(t,e,n.concat(i))}}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e){return function(){return null}}n.r(e),n.d(e,"chainPropTypes",(function(){return r})),n.d(e,"deepmerge",(function(){return i.a})),n.d(e,"elementAcceptingRef",(function(){return s})),n.d(e,"elementTypeAcceptingRef",(function(){return c})),n.d(e,"exactProp",(function(){return f})),n.d(e,"formatMuiErrorMessage",(function(){return l.a})),n.d(e,"getDisplayName",(function(){return v})),n.d(e,"HTMLElementType",(function(){return y})),n.d(e,"ponyfillGlobal",(function(){return _})),n.d(e,"refType",(function(){return w}));var i=n(393),o=n(13),a=n.n(o);var u=(a.a.element,function(){return null});u.isRequired=(a.a.element.isRequired,function(){return null});var s=u;var c=(o.elementType,function(){return null});n(58),n(4);function f(t){return t}var l=n(284),d=n(135),h=n(103),p=/^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;function g(t){var e="".concat(t).match(p);return e&&e[1]||""}function m(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t.displayName||t.name||g(t)||e}function b(t,e,n){var r=m(e);return t.displayName||(""!==r?"".concat(n,"(").concat(r,")"):n)}function v(t){if(null!=t){if("string"===typeof t)return t;if("function"===typeof t)return m(t,"Component");if("object"===Object(d.a)(t))switch(t.$$typeof){case h.ForwardRef:return b(t,t.render,"ForwardRef");case h.Memo:return b(t,t.type,"memo");default:return}}}function y(t,e,n,r,i){return null}var _="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),w=a.a.oneOfType([a.a.func,a.a.object])},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(32),i=n(16),o=n(57);function a(t){return function e(n,a,u){switch(arguments.length){case 0:return e;case 1:return Object(o.a)(n)?e:Object(i.a)((function(e,r){return t(n,e,r)}));case 2:return Object(o.a)(n)&&Object(o.a)(a)?e:Object(o.a)(n)?Object(i.a)((function(e,n){return t(e,a,n)})):Object(o.a)(a)?Object(i.a)((function(e,r){return t(n,e,r)})):Object(r.a)((function(e){return t(n,a,e)}));default:return Object(o.a)(n)&&Object(o.a)(a)&&Object(o.a)(u)?e:Object(o.a)(n)&&Object(o.a)(a)?Object(i.a)((function(e,n){return t(e,n,u)})):Object(o.a)(n)&&Object(o.a)(u)?Object(i.a)((function(e,n){return t(e,a,n)})):Object(o.a)(a)&&Object(o.a)(u)?Object(i.a)((function(e,r){return t(n,e,r)})):Object(o.a)(n)?Object(r.a)((function(e){return t(e,a,u)})):Object(o.a)(a)?Object(r.a)((function(e){return t(n,e,u)})):Object(o.a)(u)?Object(r.a)((function(e){return t(n,a,e)})):t(n,a,u)}}}},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e){function n(t,e){for(var n=0;n"']/g,Q=RegExp(Y.source),X=RegExp(Z.source),J=/<%-([\s\S]+?)%>/g,tt=/<%([\s\S]+?)%>/g,et=/<%=([\s\S]+?)%>/g,nt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,rt=/^\w*$/,it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/[\\^$.*+?()[\]{}|]/g,at=RegExp(ot.source),ut=/^\s+|\s+$/g,st=/^\s+/,ct=/\s+$/,ft=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,lt=/\{\n\/\* \[wrapped with (.+)\] \*/,dt=/,? & /,ht=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pt=/\\(\\)?/g,gt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,mt=/\w*$/,bt=/^[-+]0x[0-9a-f]+$/i,vt=/^0b[01]+$/i,yt=/^\[object .+?Constructor\]$/,_t=/^0o[0-7]+$/i,wt=/^(?:0|[1-9]\d*)$/,St=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ot=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,Et="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Mt="\\u2700-\\u27bf",Tt="a-z\\xdf-\\xf6\\xf8-\\xff",$t="A-Z\\xc0-\\xd6\\xd8-\\xde",At="\\ufe0e\\ufe0f",kt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ct="['\u2019]",It="[\\ud800-\\udfff]",Pt="["+kt+"]",Nt="["+Et+"]",Rt="\\d+",jt="[\\u2700-\\u27bf]",Dt="["+Tt+"]",Lt="[^\\ud800-\\udfff"+kt+Rt+Mt+Tt+$t+"]",Ft="\\ud83c[\\udffb-\\udfff]",Bt="[^\\ud800-\\udfff]",Ut="(?:\\ud83c[\\udde6-\\uddff]){2}",zt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ht="["+$t+"]",Vt="(?:"+Dt+"|"+Lt+")",qt="(?:"+Ht+"|"+Lt+")",Wt="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Gt="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Kt="(?:"+Nt+"|"+Ft+")"+"?",Yt="[\\ufe0e\\ufe0f]?",Zt=Yt+Kt+("(?:\\u200d(?:"+[Bt,Ut,zt].join("|")+")"+Yt+Kt+")*"),Qt="(?:"+[jt,Ut,zt].join("|")+")"+Zt,Xt="(?:"+[Bt+Nt+"?",Nt,Ut,zt,It].join("|")+")",Jt=RegExp(Ct,"g"),te=RegExp(Nt,"g"),ee=RegExp(Ft+"(?="+Ft+")|"+Xt+Zt,"g"),ne=RegExp([Ht+"?"+Dt+"+"+Wt+"(?="+[Pt,Ht,"$"].join("|")+")",qt+"+"+Gt+"(?="+[Pt,Ht+Vt,"$"].join("|")+")",Ht+"?"+Vt+"+"+Wt,Ht+"+"+Gt,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Rt,Qt].join("|"),"g"),re=RegExp("[\\u200d\\ud800-\\udfff"+Et+At+"]"),ie=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,oe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ae=-1,ue={};ue[D]=ue[L]=ue[F]=ue[B]=ue[U]=ue[z]=ue[H]=ue[V]=ue[q]=!0,ue[y]=ue[_]=ue[R]=ue[w]=ue[j]=ue[S]=ue[O]=ue[x]=ue[M]=ue[T]=ue[$]=ue[k]=ue[C]=ue[I]=ue[N]=!1;var se={};se[y]=se[_]=se[R]=se[j]=se[w]=se[S]=se[D]=se[L]=se[F]=se[B]=se[U]=se[M]=se[T]=se[$]=se[k]=se[C]=se[I]=se[P]=se[z]=se[H]=se[V]=se[q]=!0,se[O]=se[x]=se[N]=!1;var ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},fe=parseFloat,le=parseInt,de="object"==typeof t&&t&&t.Object===Object&&t,he="object"==typeof self&&self&&self.Object===Object&&self,pe=de||he||Function("return this")(),ge=e&&!e.nodeType&&e,me=ge&&"object"==typeof r&&r&&!r.nodeType&&r,be=me&&me.exports===ge,ve=be&&de.process,ye=function(){try{var t=me&&me.require&&me.require("util").types;return t||ve&&ve.binding&&ve.binding("util")}catch(e){}}(),_e=ye&&ye.isArrayBuffer,we=ye&&ye.isDate,Se=ye&&ye.isMap,Oe=ye&&ye.isRegExp,xe=ye&&ye.isSet,Ee=ye&&ye.isTypedArray;function Me(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Te(t,e,n,r){for(var i=-1,o=null==t?0:t.length;++i-1}function Pe(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function en(t,e){for(var n=t.length;n--&&ze(e,t[n],0)>-1;);return n}function nn(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var rn=Ge({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),on=Ge({"&":"&","<":"<",">":">",'"':""","'":"'"});function an(t){return"\\"+ce[t]}function un(t){return re.test(t)}function sn(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function cn(t,e){return function(n){return t(e(n))}}function fn(t,e){for(var n=-1,r=t.length,i=0,o=[];++n",""":'"',"'":"'"});var mn=function t(e){var n=(e=null==e?pe:mn.defaults(pe.Object(),e,mn.pick(pe,oe))).Array,r=e.Date,i=e.Error,Et=e.Function,Mt=e.Math,Tt=e.Object,$t=e.RegExp,At=e.String,kt=e.TypeError,Ct=n.prototype,It=Et.prototype,Pt=Tt.prototype,Nt=e["__core-js_shared__"],Rt=It.toString,jt=Pt.hasOwnProperty,Dt=0,Lt=function(){var t=/[^.]+$/.exec(Nt&&Nt.keys&&Nt.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ft=Pt.toString,Bt=Rt.call(Tt),Ut=pe._,zt=$t("^"+Rt.call(jt).replace(ot,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ht=be?e.Buffer:o,Vt=e.Symbol,qt=e.Uint8Array,Wt=Ht?Ht.allocUnsafe:o,Gt=cn(Tt.getPrototypeOf,Tt),Kt=Tt.create,Yt=Pt.propertyIsEnumerable,Zt=Ct.splice,Qt=Vt?Vt.isConcatSpreadable:o,Xt=Vt?Vt.iterator:o,ee=Vt?Vt.toStringTag:o,re=function(){try{var t=lo(Tt,"defineProperty");return t({},"",{}),t}catch(e){}}(),ce=e.clearTimeout!==pe.clearTimeout&&e.clearTimeout,de=r&&r.now!==pe.Date.now&&r.now,he=e.setTimeout!==pe.setTimeout&&e.setTimeout,ge=Mt.ceil,me=Mt.floor,ve=Tt.getOwnPropertySymbols,ye=Ht?Ht.isBuffer:o,Fe=e.isFinite,Ge=Ct.join,bn=cn(Tt.keys,Tt),vn=Mt.max,yn=Mt.min,_n=r.now,wn=e.parseInt,Sn=Mt.random,On=Ct.reverse,xn=lo(e,"DataView"),En=lo(e,"Map"),Mn=lo(e,"Promise"),Tn=lo(e,"Set"),$n=lo(e,"WeakMap"),An=lo(Tt,"create"),kn=$n&&new $n,Cn={},In=Fo(xn),Pn=Fo(En),Nn=Fo(Mn),Rn=Fo(Tn),jn=Fo($n),Dn=Vt?Vt.prototype:o,Ln=Dn?Dn.valueOf:o,Fn=Dn?Dn.toString:o;function Bn(t){if(nu(t)&&!qa(t)&&!(t instanceof Vn)){if(t instanceof Hn)return t;if(jt.call(t,"__wrapped__"))return Bo(t)}return new Hn(t)}var Un=function(){function t(){}return function(e){if(!eu(e))return{};if(Kt)return Kt(e);t.prototype=e;var n=new t;return t.prototype=o,n}}();function zn(){}function Hn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=o}function Vn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=b,this.__views__=[]}function qn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function sr(t,e,n,r,i,a){var u,s=1&e,c=2&e,f=4&e;if(n&&(u=i?n(t,r,i,a):n(t)),u!==o)return u;if(!eu(t))return t;var l=qa(t);if(l){if(u=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&jt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!s)return Ai(t,u)}else{var d=go(t),h=d==x||d==E;if(Ya(t))return Oi(t,s);if(d==$||d==y||h&&!i){if(u=c||h?{}:bo(t),!s)return c?function(t,e){return ki(t,po(t),e)}(t,function(t,e){return t&&ki(e,Pu(e),t)}(u,t)):function(t,e){return ki(t,ho(t),e)}(t,ir(u,t))}else{if(!se[d])return i?t:{};u=function(t,e,n){var r=t.constructor;switch(e){case R:return xi(t);case w:case S:return new r(+t);case j:return function(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case D:case L:case F:case B:case U:case z:case H:case V:case q:return Ei(t,n);case M:return new r;case T:case I:return new r(t);case k:return function(t){var e=new t.constructor(t.source,mt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case C:return new r;case P:return i=t,Ln?Tt(Ln.call(i)):{}}var i}(t,d,s)}}a||(a=new Yn);var p=a.get(t);if(p)return p;a.set(t,u),uu(t)?t.forEach((function(r){u.add(sr(r,e,n,r,t,a))})):ru(t)&&t.forEach((function(r,i){u.set(i,sr(r,e,n,i,t,a))}));var g=l?o:(f?c?io:ro:c?Pu:Iu)(t);return $e(g||t,(function(r,i){g&&(r=t[i=r]),er(u,i,sr(r,e,n,i,t,a))})),u}function cr(t,e,n){var r=n.length;if(null==t)return!r;for(t=Tt(t);r--;){var i=n[r],a=e[i],u=t[i];if(u===o&&!(i in t)||!a(u))return!1}return!0}function fr(t,e,n){if("function"!=typeof t)throw new kt(a);return Io((function(){t.apply(o,n)}),e)}function lr(t,e,n,r){var i=-1,o=Ie,a=!0,u=t.length,s=[],c=e.length;if(!u)return s;n&&(e=Ne(e,Qe(n))),r?(o=Pe,a=!1):e.length>=200&&(o=Je,a=!1,e=new Kn(e));t:for(;++i-1},Wn.prototype.set=function(t,e){var n=this.__data__,r=nr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new qn,map:new(En||Wn),string:new qn}},Gn.prototype.delete=function(t){var e=co(this,t).delete(t);return this.size-=e?1:0,e},Gn.prototype.get=function(t){return co(this,t).get(t)},Gn.prototype.has=function(t){return co(this,t).has(t)},Gn.prototype.set=function(t,e){var n=co(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(t){return this.__data__.set(t,u),this},Kn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.clear=function(){this.__data__=new Wn,this.size=0},Yn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Yn.prototype.get=function(t){return this.__data__.get(t)},Yn.prototype.has=function(t){return this.__data__.has(t)},Yn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Wn){var r=n.__data__;if(!En||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(t,e),this.size=n.size,this};var dr=Pi(_r),hr=Pi(wr,!0);function pr(t,e){var n=!0;return dr(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function gr(t,e,n){for(var r=-1,i=t.length;++r0&&n(u)?e>1?br(u,e-1,n,r,i):Re(i,u):r||(i[i.length]=u)}return i}var vr=Ni(),yr=Ni(!0);function _r(t,e){return t&&vr(t,e,Iu)}function wr(t,e){return t&&yr(t,e,Iu)}function Sr(t,e){return Ce(e,(function(e){return Xa(t[e])}))}function Or(t,e){for(var n=0,r=(e=yi(e,t)).length;null!=t&&ne}function Tr(t,e){return null!=t&&jt.call(t,e)}function $r(t,e){return null!=t&&e in Tt(t)}function Ar(t,e,r){for(var i=r?Pe:Ie,a=t[0].length,u=t.length,s=u,c=n(u),f=1/0,l=[];s--;){var d=t[s];s&&e&&(d=Ne(d,Qe(e))),f=yn(d.length,f),c[s]=!r&&(e||a>=120&&d.length>=120)?new Kn(s&&d):o}d=t[0];var h=-1,p=c[0];t:for(;++h=u?s:s*("desc"==n[r]?-1:1)}return t.index-e.index}(t,e,n)}))}function qr(t,e,n){for(var r=-1,i=e.length,o={};++r-1;)u!==t&&Zt.call(u,s,1),Zt.call(t,s,1);return t}function Gr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==o){var o=i;yo(i)?Zt.call(t,i,1):li(t,i)}}return t}function Kr(t,e){return t+me(Sn()*(e-t+1))}function Yr(t,e){var n="";if(!t||e<1||e>g)return n;do{e%2&&(n+=t),(e=me(e/2))&&(t+=t)}while(e);return n}function Zr(t,e){return Po(To(t,e,is),t+"")}function Qr(t){return Qn(Uu(t))}function Xr(t,e){var n=Uu(t);return jo(n,ur(e,0,n.length))}function Jr(t,e,n,r){if(!eu(t))return t;for(var i=-1,a=(e=yi(e,t)).length,u=a-1,s=t;null!=s&&++io?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var a=n(o);++i>>1,a=t[o];null!==a&&!cu(a)&&(n?a<=e:a=200){var c=e?null:Yi(t);if(c)return ln(c);a=!1,i=Je,s=new Kn}else s=e?[]:u;t:for(;++r=r?t:ri(t,e,n)}var Si=ce||function(t){return pe.clearTimeout(t)};function Oi(t,e){if(e)return t.slice();var n=t.length,r=Wt?Wt(n):new t.constructor(n);return t.copy(r),r}function xi(t){var e=new t.constructor(t.byteLength);return new qt(e).set(new qt(t)),e}function Ei(t,e){var n=e?xi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Mi(t,e){if(t!==e){var n=t!==o,r=null===t,i=t===t,a=cu(t),u=e!==o,s=null===e,c=e===e,f=cu(e);if(!s&&!f&&!a&&t>e||a&&u&&c&&!s&&!f||r&&u&&c||!n&&c||!i)return 1;if(!r&&!a&&!f&&t1?n[i-1]:o,u=i>2?n[2]:o;for(a=t.length>3&&"function"==typeof a?(i--,a):o,u&&_o(n[0],n[1],u)&&(a=i<3?o:a,i=1),e=Tt(e);++r-1?i[a?e[u]:u]:o}}function Fi(t){return no((function(e){var n=e.length,r=n,i=Hn.prototype.thru;for(t&&e.reverse();r--;){var u=e[r];if("function"!=typeof u)throw new kt(a);if(i&&!s&&"wrapper"==ao(u))var s=new Hn([],!0)}for(r=s?r:n;++r1&&y.reverse(),h&&fs))return!1;var f=a.get(t),l=a.get(e);if(f&&l)return f==e&&l==t;var d=-1,h=!0,p=2&n?new Kn:o;for(a.set(t,e),a.set(e,t);++d-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(ft,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return $e(v,(function(n){var r="_."+n[0];e&n[1]&&!Ie(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(lt);return e?e[1].split(dt):[]}(r),n)))}function Ro(t){var e=0,n=0;return function(){var r=_n(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(o,arguments)}}function jo(t,e){var n=-1,r=t.length,i=r-1;for(e=e===o?r:e;++n1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,aa(t,n)}));function ha(t){var e=Bn(t);return e.__chain__=!0,e}function pa(t,e){return e(t)}var ga=no((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return ar(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Vn&&yo(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:pa,args:[i],thisArg:o}),new Hn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)}));var ma=Ci((function(t,e,n){jt.call(t,n)?++t[n]:or(t,n,1)}));var ba=Li(Vo),va=Li(qo);function ya(t,e){return(qa(t)?$e:dr)(t,so(e,3))}function _a(t,e){return(qa(t)?Ae:hr)(t,so(e,3))}var wa=Ci((function(t,e,n){jt.call(t,n)?t[n].push(e):or(t,n,[e])}));var Sa=Zr((function(t,e,r){var i=-1,o="function"==typeof e,a=Ga(t)?n(t.length):[];return dr(t,(function(t){a[++i]=o?Me(e,t,r):kr(t,e,r)})),a})),Oa=Ci((function(t,e,n){or(t,n,e)}));function xa(t,e){return(qa(t)?Ne:Fr)(t,so(e,3))}var Ea=Ci((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var Ma=Zr((function(t,e){if(null==t)return[];var n=e.length;return n>1&&_o(t,e[0],e[1])?e=[]:n>2&&_o(e[0],e[1],e[2])&&(e=[e[0]]),Vr(t,br(e,1),[])})),Ta=de||function(){return pe.Date.now()};function $a(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,Qi(t,d,o,o,o,o,e)}function Aa(t,e){var n;if("function"!=typeof e)throw new kt(a);return t=gu(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var ka=Zr((function(t,e,n){var r=1;if(n.length){var i=fn(n,uo(ka));r|=f}return Qi(t,r,e,n,i)})),Ca=Zr((function(t,e,n){var r=3;if(n.length){var i=fn(n,uo(Ca));r|=f}return Qi(e,r,t,n,i)}));function Ia(t,e,n){var r,i,u,s,c,f,l=0,d=!1,h=!1,p=!0;if("function"!=typeof t)throw new kt(a);function g(e){var n=r,a=i;return r=i=o,l=e,s=t.apply(a,n)}function m(t){return l=t,c=Io(v,e),d?g(t):s}function b(t){var n=t-f;return f===o||n>=e||n<0||h&&t-l>=u}function v(){var t=Ta();if(b(t))return y(t);c=Io(v,function(t){var n=e-(t-f);return h?yn(n,u-(t-l)):n}(t))}function y(t){return c=o,p&&r?g(t):(r=i=o,s)}function _(){var t=Ta(),n=b(t);if(r=arguments,i=this,f=t,n){if(c===o)return m(f);if(h)return Si(c),c=Io(v,e),g(f)}return c===o&&(c=Io(v,e)),s}return e=bu(e)||0,eu(n)&&(d=!!n.leading,u=(h="maxWait"in n)?vn(bu(n.maxWait)||0,e):u,p="trailing"in n?!!n.trailing:p),_.cancel=function(){c!==o&&Si(c),l=0,r=f=i=c=o},_.flush=function(){return c===o?s:y(Ta())},_}var Pa=Zr((function(t,e){return fr(t,1,e)})),Na=Zr((function(t,e,n){return fr(t,bu(e)||0,n)}));function Ra(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new kt(a);var n=function n(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=t.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Ra.Cache||Gn),n}function ja(t){if("function"!=typeof t)throw new kt(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}Ra.Cache=Gn;var Da=_i((function(t,e){var n=(e=1==e.length&&qa(e[0])?Ne(e[0],Qe(so())):Ne(br(e,1),Qe(so()))).length;return Zr((function(r){for(var i=-1,o=yn(r.length,n);++i=e})),Va=Cr(function(){return arguments}())?Cr:function(t){return nu(t)&&jt.call(t,"callee")&&!Yt.call(t,"callee")},qa=n.isArray,Wa=_e?Qe(_e):function(t){return nu(t)&&Er(t)==R};function Ga(t){return null!=t&&tu(t.length)&&!Xa(t)}function Ka(t){return nu(t)&&Ga(t)}var Ya=ye||bs,Za=we?Qe(we):function(t){return nu(t)&&Er(t)==S};function Qa(t){if(!nu(t))return!1;var e=Er(t);return e==O||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!ou(t)}function Xa(t){if(!eu(t))return!1;var e=Er(t);return e==x||e==E||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Ja(t){return"number"==typeof t&&t==gu(t)}function tu(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=g}function eu(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function nu(t){return null!=t&&"object"==typeof t}var ru=Se?Qe(Se):function(t){return nu(t)&&go(t)==M};function iu(t){return"number"==typeof t||nu(t)&&Er(t)==T}function ou(t){if(!nu(t)||Er(t)!=$)return!1;var e=Gt(t);if(null===e)return!0;var n=jt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&Rt.call(n)==Bt}var au=Oe?Qe(Oe):function(t){return nu(t)&&Er(t)==k};var uu=xe?Qe(xe):function(t){return nu(t)&&go(t)==C};function su(t){return"string"==typeof t||!qa(t)&&nu(t)&&Er(t)==I}function cu(t){return"symbol"==typeof t||nu(t)&&Er(t)==P}var fu=Ee?Qe(Ee):function(t){return nu(t)&&tu(t.length)&&!!ue[Er(t)]};var lu=Wi(Lr),du=Wi((function(t,e){return t<=e}));function hu(t){if(!t)return[];if(Ga(t))return su(t)?pn(t):Ai(t);if(Xt&&t[Xt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Xt]());var e=go(t);return(e==M?sn:e==C?ln:Uu)(t)}function pu(t){return t?(t=bu(t))===p||t===-1/0?17976931348623157e292*(t<0?-1:1):t===t?t:0:0===t?t:0}function gu(t){var e=pu(t),n=e%1;return e===e?n?e-n:e:0}function mu(t){return t?ur(gu(t),0,b):0}function bu(t){if("number"==typeof t)return t;if(cu(t))return m;if(eu(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=eu(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(ut,"");var n=vt.test(t);return n||_t.test(t)?le(t.slice(2),n?2:8):bt.test(t)?m:+t}function vu(t){return ki(t,Pu(t))}function yu(t){return null==t?"":ci(t)}var _u=Ii((function(t,e){if(xo(e)||Ga(e))ki(e,Iu(e),t);else for(var n in e)jt.call(e,n)&&er(t,n,e[n])})),wu=Ii((function(t,e){ki(e,Pu(e),t)})),Su=Ii((function(t,e,n,r){ki(e,Pu(e),t,r)})),Ou=Ii((function(t,e,n,r){ki(e,Iu(e),t,r)})),xu=no(ar);var Eu=Zr((function(t,e){t=Tt(t);var n=-1,r=e.length,i=r>2?e[2]:o;for(i&&_o(e[0],e[1],i)&&(r=1);++n1),e})),ki(t,io(t),n),r&&(n=sr(n,7,to));for(var i=e.length;i--;)li(n,e[i]);return n}));var Du=no((function(t,e){return null==t?{}:function(t,e){return qr(t,e,(function(e,n){return $u(t,n)}))}(t,e)}));function Lu(t,e){if(null==t)return{};var n=Ne(io(t),(function(t){return[t]}));return e=so(e),qr(t,n,(function(t,n){return e(t,n[0])}))}var Fu=Zi(Iu),Bu=Zi(Pu);function Uu(t){return null==t?[]:Xe(t,Iu(t))}var zu=ji((function(t,e,n){return e=e.toLowerCase(),t+(n?Hu(e):e)}));function Hu(t){return Qu(yu(t).toLowerCase())}function Vu(t){return(t=yu(t))&&t.replace(St,rn).replace(te,"")}var qu=ji((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Wu=ji((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Gu=Ri("toLowerCase");var Ku=ji((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Yu=ji((function(t,e,n){return t+(n?" ":"")+Qu(e)}));var Zu=ji((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Qu=Ri("toUpperCase");function Xu(t,e,n){return t=yu(t),(e=n?o:e)===o?function(t){return ie.test(t)}(t)?function(t){return t.match(ne)||[]}(t):function(t){return t.match(ht)||[]}(t):t.match(e)||[]}var Ju=Zr((function(t,e){try{return Me(t,o,e)}catch(n){return Qa(n)?n:new i(n)}})),ts=no((function(t,e){return $e(e,(function(e){e=Lo(e),or(t,e,ka(t[e],t))})),t}));function es(t){return function(){return t}}var ns=Fi(),rs=Fi(!0);function is(t){return t}function os(t){return Rr("function"==typeof t?t:sr(t,1))}var as=Zr((function(t,e){return function(n){return kr(n,t,e)}})),us=Zr((function(t,e){return function(n){return kr(t,n,e)}}));function ss(t,e,n){var r=Iu(e),i=Sr(e,r);null!=n||eu(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Sr(e,Iu(e)));var o=!(eu(n)&&"chain"in n)||!!n.chain,a=Xa(t);return $e(i,(function(n){var r=e[n];t[n]=r,a&&(t.prototype[n]=function(){var e=this.__chain__;if(o||e){var n=t(this.__wrapped__),i=n.__actions__=Ai(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,Re([this.value()],arguments))})})),t}function cs(){}var fs=Hi(Ne),ls=Hi(ke),ds=Hi(Le);function hs(t){return wo(t)?We(Lo(t)):function(t){return function(e){return Or(e,t)}}(t)}var ps=qi(),gs=qi(!0);function ms(){return[]}function bs(){return!1}var vs=zi((function(t,e){return t+e}),0),ys=Ki("ceil"),_s=zi((function(t,e){return t/e}),1),ws=Ki("floor");var Ss=zi((function(t,e){return t*e}),1),Os=Ki("round"),xs=zi((function(t,e){return t-e}),0);return Bn.after=function(t,e){if("function"!=typeof e)throw new kt(a);return t=gu(t),function(){if(--t<1)return e.apply(this,arguments)}},Bn.ary=$a,Bn.assign=_u,Bn.assignIn=wu,Bn.assignInWith=Su,Bn.assignWith=Ou,Bn.at=xu,Bn.before=Aa,Bn.bind=ka,Bn.bindAll=ts,Bn.bindKey=Ca,Bn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return qa(t)?t:[t]},Bn.chain=ha,Bn.chunk=function(t,e,r){e=(r?_o(t,e,r):e===o)?1:vn(gu(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,u=0,s=n(ge(i/e));ai?0:i+n),(r=r===o||r>i?i:gu(r))<0&&(r+=i),r=n>r?0:mu(r);n>>0)?(t=yu(t))&&("string"==typeof e||null!=e&&!au(e))&&!(e=ci(e))&&un(t)?wi(pn(t),0,n):t.split(e,n):[]},Bn.spread=function(t,e){if("function"!=typeof t)throw new kt(a);return e=null==e?0:vn(gu(e),0),Zr((function(n){var r=n[e],i=wi(n,0,e);return r&&Re(i,r),Me(t,this,i)}))},Bn.tail=function(t){var e=null==t?0:t.length;return e?ri(t,1,e):[]},Bn.take=function(t,e,n){return t&&t.length?ri(t,0,(e=n||e===o?1:gu(e))<0?0:e):[]},Bn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?ri(t,(e=r-(e=n||e===o?1:gu(e)))<0?0:e,r):[]},Bn.takeRightWhile=function(t,e){return t&&t.length?hi(t,so(e,3),!1,!0):[]},Bn.takeWhile=function(t,e){return t&&t.length?hi(t,so(e,3)):[]},Bn.tap=function(t,e){return e(t),t},Bn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new kt(a);return eu(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),Ia(t,e,{leading:r,maxWait:e,trailing:i})},Bn.thru=pa,Bn.toArray=hu,Bn.toPairs=Fu,Bn.toPairsIn=Bu,Bn.toPath=function(t){return qa(t)?Ne(t,Lo):cu(t)?[t]:Ai(Do(yu(t)))},Bn.toPlainObject=vu,Bn.transform=function(t,e,n){var r=qa(t),i=r||Ya(t)||fu(t);if(e=so(e,4),null==n){var o=t&&t.constructor;n=i?r?new o:[]:eu(t)&&Xa(o)?Un(Gt(t)):{}}return(i?$e:_r)(t,(function(t,r,i){return e(n,t,r,i)})),n},Bn.unary=function(t){return $a(t,1)},Bn.union=na,Bn.unionBy=ra,Bn.unionWith=ia,Bn.uniq=function(t){return t&&t.length?fi(t):[]},Bn.uniqBy=function(t,e){return t&&t.length?fi(t,so(e,2)):[]},Bn.uniqWith=function(t,e){return e="function"==typeof e?e:o,t&&t.length?fi(t,o,e):[]},Bn.unset=function(t,e){return null==t||li(t,e)},Bn.unzip=oa,Bn.unzipWith=aa,Bn.update=function(t,e,n){return null==t?t:di(t,e,vi(n))},Bn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:o,null==t?t:di(t,e,vi(n),r)},Bn.values=Uu,Bn.valuesIn=function(t){return null==t?[]:Xe(t,Pu(t))},Bn.without=ua,Bn.words=Xu,Bn.wrap=function(t,e){return La(vi(e),t)},Bn.xor=sa,Bn.xorBy=ca,Bn.xorWith=fa,Bn.zip=la,Bn.zipObject=function(t,e){return mi(t||[],e||[],er)},Bn.zipObjectDeep=function(t,e){return mi(t||[],e||[],Jr)},Bn.zipWith=da,Bn.entries=Fu,Bn.entriesIn=Bu,Bn.extend=wu,Bn.extendWith=Su,ss(Bn,Bn),Bn.add=vs,Bn.attempt=Ju,Bn.camelCase=zu,Bn.capitalize=Hu,Bn.ceil=ys,Bn.clamp=function(t,e,n){return n===o&&(n=e,e=o),n!==o&&(n=(n=bu(n))===n?n:0),e!==o&&(e=(e=bu(e))===e?e:0),ur(bu(t),e,n)},Bn.clone=function(t){return sr(t,4)},Bn.cloneDeep=function(t){return sr(t,5)},Bn.cloneDeepWith=function(t,e){return sr(t,5,e="function"==typeof e?e:o)},Bn.cloneWith=function(t,e){return sr(t,4,e="function"==typeof e?e:o)},Bn.conformsTo=function(t,e){return null==e||cr(t,e,Iu(e))},Bn.deburr=Vu,Bn.defaultTo=function(t,e){return null==t||t!==t?e:t},Bn.divide=_s,Bn.endsWith=function(t,e,n){t=yu(t),e=ci(e);var r=t.length,i=n=n===o?r:ur(gu(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Bn.eq=Ua,Bn.escape=function(t){return(t=yu(t))&&X.test(t)?t.replace(Z,on):t},Bn.escapeRegExp=function(t){return(t=yu(t))&&at.test(t)?t.replace(ot,"\\$&"):t},Bn.every=function(t,e,n){var r=qa(t)?ke:pr;return n&&_o(t,e,n)&&(e=o),r(t,so(e,3))},Bn.find=ba,Bn.findIndex=Vo,Bn.findKey=function(t,e){return Be(t,so(e,3),_r)},Bn.findLast=va,Bn.findLastIndex=qo,Bn.findLastKey=function(t,e){return Be(t,so(e,3),wr)},Bn.floor=ws,Bn.forEach=ya,Bn.forEachRight=_a,Bn.forIn=function(t,e){return null==t?t:vr(t,so(e,3),Pu)},Bn.forInRight=function(t,e){return null==t?t:yr(t,so(e,3),Pu)},Bn.forOwn=function(t,e){return t&&_r(t,so(e,3))},Bn.forOwnRight=function(t,e){return t&&wr(t,so(e,3))},Bn.get=Tu,Bn.gt=za,Bn.gte=Ha,Bn.has=function(t,e){return null!=t&&mo(t,e,Tr)},Bn.hasIn=$u,Bn.head=Go,Bn.identity=is,Bn.includes=function(t,e,n,r){t=Ga(t)?t:Uu(t),n=n&&!r?gu(n):0;var i=t.length;return n<0&&(n=vn(i+n,0)),su(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&ze(t,e,n)>-1},Bn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:gu(n);return i<0&&(i=vn(r+i,0)),ze(t,e,i)},Bn.inRange=function(t,e,n){return e=pu(e),n===o?(n=e,e=0):n=pu(n),function(t,e,n){return t>=yn(e,n)&&t=-9007199254740991&&t<=g},Bn.isSet=uu,Bn.isString=su,Bn.isSymbol=cu,Bn.isTypedArray=fu,Bn.isUndefined=function(t){return t===o},Bn.isWeakMap=function(t){return nu(t)&&go(t)==N},Bn.isWeakSet=function(t){return nu(t)&&"[object WeakSet]"==Er(t)},Bn.join=function(t,e){return null==t?"":Ge.call(t,e)},Bn.kebabCase=qu,Bn.last=Qo,Bn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==o&&(i=(i=gu(n))<0?vn(r+i,0):yn(i,r-1)),e===e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):Ue(t,Ve,i,!0)},Bn.lowerCase=Wu,Bn.lowerFirst=Gu,Bn.lt=lu,Bn.lte=du,Bn.max=function(t){return t&&t.length?gr(t,is,Mr):o},Bn.maxBy=function(t,e){return t&&t.length?gr(t,so(e,2),Mr):o},Bn.mean=function(t){return qe(t,is)},Bn.meanBy=function(t,e){return qe(t,so(e,2))},Bn.min=function(t){return t&&t.length?gr(t,is,Lr):o},Bn.minBy=function(t,e){return t&&t.length?gr(t,so(e,2),Lr):o},Bn.stubArray=ms,Bn.stubFalse=bs,Bn.stubObject=function(){return{}},Bn.stubString=function(){return""},Bn.stubTrue=function(){return!0},Bn.multiply=Ss,Bn.nth=function(t,e){return t&&t.length?Hr(t,gu(e)):o},Bn.noConflict=function(){return pe._===this&&(pe._=Ut),this},Bn.noop=cs,Bn.now=Ta,Bn.pad=function(t,e,n){t=yu(t);var r=(e=gu(e))?hn(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Vi(me(i),n)+t+Vi(ge(i),n)},Bn.padEnd=function(t,e,n){t=yu(t);var r=(e=gu(e))?hn(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Sn();return yn(t+i*(e-t+fe("1e-"+((i+"").length-1))),e)}return Kr(t,e)},Bn.reduce=function(t,e,n){var r=qa(t)?je:Ke,i=arguments.length<3;return r(t,so(e,4),n,i,dr)},Bn.reduceRight=function(t,e,n){var r=qa(t)?De:Ke,i=arguments.length<3;return r(t,so(e,4),n,i,hr)},Bn.repeat=function(t,e,n){return e=(n?_o(t,e,n):e===o)?1:gu(e),Yr(yu(t),e)},Bn.replace=function(){var t=arguments,e=yu(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Bn.result=function(t,e,n){var r=-1,i=(e=yi(e,t)).length;for(i||(i=1,t=o);++rg)return[];var n=b,r=yn(t,b);e=so(e),t-=b;for(var i=Ze(r,e);++n=a)return t;var s=n-hn(r);if(s<1)return r;var c=u?wi(u,0,s).join(""):t.slice(0,s);if(i===o)return c+r;if(u&&(s+=c.length-s),au(i)){if(t.slice(s).search(i)){var f,l=c;for(i.global||(i=$t(i.source,yu(mt.exec(i))+"g")),i.lastIndex=0;f=i.exec(l);)var d=f.index;c=c.slice(0,d===o?s:d)}}else if(t.indexOf(ci(i),s)!=s){var h=c.lastIndexOf(i);h>-1&&(c=c.slice(0,h))}return c+r},Bn.unescape=function(t){return(t=yu(t))&&Q.test(t)?t.replace(Y,gn):t},Bn.uniqueId=function(t){var e=++Dt;return yu(t)+e},Bn.upperCase=Zu,Bn.upperFirst=Qu,Bn.each=ya,Bn.eachRight=_a,Bn.first=Go,ss(Bn,function(){var t={};return _r(Bn,(function(e,n){jt.call(Bn.prototype,n)||(t[n]=e)})),t}(),{chain:!1}),Bn.VERSION="4.17.20",$e(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Bn[t].placeholder=Bn})),$e(["drop","take"],(function(t,e){Vn.prototype[t]=function(n){n=n===o?1:vn(gu(n),0);var r=this.__filtered__&&!e?new Vn(this):this.clone();return r.__filtered__?r.__takeCount__=yn(n,r.__takeCount__):r.__views__.push({size:yn(n,b),type:t+(r.__dir__<0?"Right":"")}),r},Vn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),$e(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Vn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:so(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),$e(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Vn.prototype[t]=function(){return this[n](1).value()[0]}})),$e(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Vn.prototype[t]=function(){return this.__filtered__?new Vn(this):this[n](1)}})),Vn.prototype.compact=function(){return this.filter(is)},Vn.prototype.find=function(t){return this.filter(t).head()},Vn.prototype.findLast=function(t){return this.reverse().find(t)},Vn.prototype.invokeMap=Zr((function(t,e){return"function"==typeof t?new Vn(this):this.map((function(n){return kr(n,t,e)}))})),Vn.prototype.reject=function(t){return this.filter(ja(so(t)))},Vn.prototype.slice=function(t,e){t=gu(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Vn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(n=(e=gu(e))<0?n.dropRight(-e):n.take(e-t)),n)},Vn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Vn.prototype.toArray=function(){return this.take(b)},_r(Vn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Bn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);i&&(Bn.prototype[e]=function(){var e=this.__wrapped__,u=r?[1]:arguments,s=e instanceof Vn,c=u[0],f=s||qa(e),l=function(t){var e=i.apply(Bn,Re([t],u));return r&&d?e[0]:e};f&&n&&"function"==typeof c&&1!=c.length&&(s=f=!1);var d=this.__chain__,h=!!this.__actions__.length,p=a&&!d,g=s&&!h;if(!a&&f){e=g?e:new Vn(this);var m=t.apply(e,u);return m.__actions__.push({func:pa,args:[l],thisArg:o}),new Hn(m,d)}return p&&g?t.apply(this,u):(m=this.thru(l),p?r?m.value()[0]:m.value():m)})})),$e(["pop","push","shift","sort","splice","unshift"],(function(t){var e=Ct[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Bn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(qa(i)?i:[],t)}return this[n]((function(n){return e.apply(qa(n)?n:[],t)}))}})),_r(Vn.prototype,(function(t,e){var n=Bn[e];if(n){var r=n.name+"";jt.call(Cn,r)||(Cn[r]=[]),Cn[r].push({name:e,func:n})}})),Cn[Bi(o,2).name]=[{name:"wrapper",func:o}],Vn.prototype.clone=function(){var t=new Vn(this.__wrapped__);return t.__actions__=Ai(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ai(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ai(this.__views__),t},Vn.prototype.reverse=function(){if(this.__filtered__){var t=new Vn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Vn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=qa(t),r=e<0,i=n?t.length:0,o=function(t,e,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:t,value:t?o:this.__values__[this.__index__++]}},Bn.prototype.plant=function(t){for(var e,n=this;n instanceof zn;){var r=Bo(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Bn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Vn){var e=t;return this.__actions__.length&&(e=new Vn(this)),(e=e.reverse()).__actions__.push({func:pa,args:[ea],thisArg:o}),new Hn(e,this.__chain__)}return this.thru(ea)},Bn.prototype.toJSON=Bn.prototype.valueOf=Bn.prototype.value=function(){return pi(this.__wrapped__,this.__actions__)},Bn.prototype.first=Bn.prototype.head,Xt&&(Bn.prototype[Xt]=function(){return this}),Bn}();pe._=mn,(i=function(){return mn}.call(e,n,e,r))===o||(r.exports=i)}).call(this)}).call(this,n(59),n(94)(t))},function(t,e,n){t.exports=function(){var t=t||function(t,e){var n=Object.create||function(){function t(){}return function(e){var n;return t.prototype=e,n=new t,t.prototype=null,n}}(),r={},i=r.lib={},o=i.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(t,n){t=this.words=t||[],this.sigBytes=n!=e?n:4*t.length},toString:function(t){return(t||s).stringify(this)},concat:function(t){var e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var t=o.clone.call(this);return t.words=this.words.slice(0),t},random:function(e){for(var n,r=[],i=function(e){e=e;var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(e=18e3*(65535&e)+(e>>16)&r)&r;return i/=4294967296,(i+=.5)*(t.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new a.init(n,e/2)}},c=u.Latin1={stringify:function(t){for(var e=t.words,n=t.sigBytes,r=[],i=0;i>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(t){for(var e=t.length,n=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new a.init(n,e)}},f=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(c.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return c.parse(unescape(encodeURIComponent(t)))}},l=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=f.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var n=this._data,r=n.words,i=n.sigBytes,o=this.blockSize,u=i/(4*o),s=(u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*o,c=t.min(4*s,i);if(s){for(var f=0;f=f.OP_1&&t<=f.OP_16||t===f.OP_1NEGATE)}(t)}function p(t){return s.Array(t)&&t.every(h)}function g(t){return 0===t.length?f.OP_0:1===t.length?t[0]>=1&&t[0]<=16?d+t[0]:129===t[0]?f.OP_1NEGATE:void 0:void 0}function m(t){if(r.isBuffer(t))return t;u(s.Array,t);var e=t.reduce((function(t,e){return r.isBuffer(e)?1===e.length&&void 0!==g(e)?t+1:t+a.encodingLength(e.length)+e.length:t+1}),0),n=r.allocUnsafe(e),i=0;if(t.forEach((function(t){if(r.isBuffer(t)){var e=g(t);if(void 0!==e)return n.writeUInt8(e,i),void(i+=1);i+=a.encode(n,t.length,i),t.copy(n,i),i+=t.length}else n.writeUInt8(t,i),i+=1})),i!==n.length)throw new Error("Could not decode chunks");return n}function b(t){if(s.Array(t))return t;u(s.Buffer,t);for(var e=[],n=0;nf.OP_0&&r<=f.OP_PUSHDATA4){var i=a.decode(t,n);if(null===i)return null;if((n+=i.size)+i.number>t.length)return null;var o=t.slice(n,n+i.number);n+=i.number;var c=g(o);void 0!==c?e.push(c):e.push(o)}else e.push(r),n+=1}return e}function v(t){var e=-129&t;return e>0&&e<4}t.exports={compile:m,decompile:b,fromASM:function(t){return u(s.String,t),m(t.split(" ").map((function(t){return void 0!==f[t]?f[t]:(u(s.Hex,t),r.from(t,"hex"))})))},toASM:function(t){return r.isBuffer(t)&&(t=b(t)),t.map((function(t){if(r.isBuffer(t)){var e=g(t);if(void 0===e)return t.toString("hex");t=e}return l[t]})).join(" ")},toStack:function(t){return t=b(t),u(p,t),t.map((function(t){return r.isBuffer(t)?t:t===f.OP_0?r.allocUnsafe(0):c.encode(t-d)}))},number:n(461),signature:n(783),isCanonicalPubKey:function(t){return o.isPoint(t)},isCanonicalScriptSignature:function(t){return!!r.isBuffer(t)&&(!!v(t[t.length-1])&&i.check(t.slice(0,-1)))},isPushOnly:p,isDefinedHashType:v}},function(t,e,n){"use strict";function r(t,e){return Object.prototype.hasOwnProperty.call(e,t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(51);function i(t,e,n){return(i="undefined"!==typeof Reflect&&Reflect.get?Reflect.get:function(t,e,n){var i=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Object(r.a)(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(n):o.value}})(t,e,n||t)}},function(t,e,n){"use strict";(function(e){var r=n(29),i=(n(267),n(79),n(52));function o(t,e){if(t.length!==e.length)return!1;for(var n=t.length,r=0;r>24&255),n.push(t>>16&255),n.push(t>>8&255),n.push(255&t),e.from(n)},integerFromBuffer:function(t){return i.checkArgumentType(t,"Buffer","buffer"),t[0]<<24|t[1]<<16|t[2]<<8|t[3]},integerFromSingleByteBuffer:function(t){return i.checkArgumentType(t,"Buffer","buffer"),t[0]},bufferToHex:function(t){return i.checkArgumentType(t,"Buffer","buffer"),t.toString("hex")},reverse:function(t){return e.from(t).reverse()}},t.exports.NULL_HASH=t.exports.fill(e.alloc(32),0),t.exports.EMPTY_BUFFER=e.alloc(0)}).call(this,n(29).Buffer)},function(t,e,n){"use strict";e.a={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}}},function(t,e,n){"use strict";function r(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r=0||(i[n]=t[n]);return i}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";function r(t,e,n,r,i,o,a){try{var u=t[o](a),s=u.value}catch(c){return void n(c)}u.done?e(s):Promise.resolve(s).then(r,i)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(i,o){var a=t.apply(e,n);function u(t){r(a,i,o,u,s,"next",t)}function s(t){r(a,i,o,u,s,"throw",t)}u(void 0)}))}}n.d(e,"a",(function(){return i}))},function(t){t.exports=JSON.parse('{"OP_FALSE":0,"OP_0":0,"OP_PUSHDATA1":76,"OP_PUSHDATA2":77,"OP_PUSHDATA4":78,"OP_1NEGATE":79,"OP_RESERVED":80,"OP_TRUE":81,"OP_1":81,"OP_2":82,"OP_3":83,"OP_4":84,"OP_5":85,"OP_6":86,"OP_7":87,"OP_8":88,"OP_9":89,"OP_10":90,"OP_11":91,"OP_12":92,"OP_13":93,"OP_14":94,"OP_15":95,"OP_16":96,"OP_NOP":97,"OP_VER":98,"OP_IF":99,"OP_NOTIF":100,"OP_VERIF":101,"OP_VERNOTIF":102,"OP_ELSE":103,"OP_ENDIF":104,"OP_VERIFY":105,"OP_RETURN":106,"OP_TOALTSTACK":107,"OP_FROMALTSTACK":108,"OP_2DROP":109,"OP_2DUP":110,"OP_3DUP":111,"OP_2OVER":112,"OP_2ROT":113,"OP_2SWAP":114,"OP_IFDUP":115,"OP_DEPTH":116,"OP_DROP":117,"OP_DUP":118,"OP_NIP":119,"OP_OVER":120,"OP_PICK":121,"OP_ROLL":122,"OP_ROT":123,"OP_SWAP":124,"OP_TUCK":125,"OP_CAT":126,"OP_SUBSTR":127,"OP_LEFT":128,"OP_RIGHT":129,"OP_SIZE":130,"OP_INVERT":131,"OP_AND":132,"OP_OR":133,"OP_XOR":134,"OP_EQUAL":135,"OP_EQUALVERIFY":136,"OP_RESERVED1":137,"OP_RESERVED2":138,"OP_1ADD":139,"OP_1SUB":140,"OP_2MUL":141,"OP_2DIV":142,"OP_NEGATE":143,"OP_ABS":144,"OP_NOT":145,"OP_0NOTEQUAL":146,"OP_ADD":147,"OP_SUB":148,"OP_MUL":149,"OP_DIV":150,"OP_MOD":151,"OP_LSHIFT":152,"OP_RSHIFT":153,"OP_BOOLAND":154,"OP_BOOLOR":155,"OP_NUMEQUAL":156,"OP_NUMEQUALVERIFY":157,"OP_NUMNOTEQUAL":158,"OP_LESSTHAN":159,"OP_GREATERTHAN":160,"OP_LESSTHANOREQUAL":161,"OP_GREATERTHANOREQUAL":162,"OP_MIN":163,"OP_MAX":164,"OP_WITHIN":165,"OP_RIPEMD160":166,"OP_SHA1":167,"OP_SHA256":168,"OP_HASH160":169,"OP_HASH256":170,"OP_CODESEPARATOR":171,"OP_CHECKSIG":172,"OP_CHECKSIGVERIFY":173,"OP_CHECKMULTISIG":174,"OP_CHECKMULTISIGVERIFY":175,"OP_NOP1":176,"OP_NOP2":177,"OP_CHECKLOCKTIMEVERIFY":177,"OP_NOP3":178,"OP_CHECKSEQUENCEVERIFY":178,"OP_NOP4":179,"OP_NOP5":180,"OP_NOP6":181,"OP_NOP7":182,"OP_NOP8":183,"OP_NOP9":184,"OP_NOP10":185,"OP_PUBKEYHASH":253,"OP_PUBKEY":254,"OP_INVALIDOPCODE":255}')},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(523);function i(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Object(r.a)(t,e)}},function(t,e){var n,r,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"===typeof setTimeout?setTimeout:o}catch(t){n=o}try{r="function"===typeof clearTimeout?clearTimeout:a}catch(t){r=a}}();var s,c=[],f=!1,l=-1;function d(){f&&s&&(f=!1,s.length?c=s.concat(c):l=-1,c.length&&h())}function h(){if(!f){var t=u(d);f=!0;for(var e=c.length;e;){for(s=c,c=[];++l1)for(var n=1;n<+~=|^:(),"'`\s])/g,b="undefined"!==typeof CSS&&CSS.escape,v=function(t){return b?b(t):t.replace(m,"\\$1")},y=function(){function t(t,e,n){this.type="style",this.key=void 0,this.isProcessed=!1,this.style=void 0,this.renderer=void 0,this.renderable=void 0,this.options=void 0;var r=n.sheet,i=n.Renderer;this.key=t,this.options=n,this.style=e,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return t.prototype.prop=function(t,e,n){if(void 0===e)return this.style[t];var r=!!n&&n.force;if(!r&&this.style[t]===e)return this;var i=e;n&&!1===n.process||(i=this.options.jss.plugins.onChangeValue(e,t,this));var o=null==i||!1===i,a=t in this.style;if(o&&!a&&!r)return this;var u=o&&a;if(u?delete this.style[t]:this.style[t]=i,this.renderable&&this.renderer)return u?this.renderer.removeProperty(this.renderable,t):this.renderer.setProperty(this.renderable,t,i),this;var s=this.options.sheet;return s&&s.attached,this},t}(),_=function(t){function e(e,n,r){var i;(i=t.call(this,e,n,r)||this).selectorText=void 0,i.id=void 0,i.renderable=void 0;var o=r.selector,a=r.scoped,s=r.sheet,c=r.generateId;return o?i.selectorText=o:!1!==a&&(i.id=c(Object(u.a)(Object(u.a)(i)),s),i.selectorText="."+v(i.id)),i}Object(a.a)(e,t);var n=e.prototype;return n.applyTo=function(t){var e=this.renderer;if(e){var n=this.toJSON();for(var r in n)e.setProperty(t,r,n[r])}return this},n.toJSON=function(){var t={};for(var e in this.style){var n=this.style[e];"object"!==typeof n?t[e]=n:Array.isArray(n)&&(t[e]=h(n))}return t},n.toString=function(t){var e=this.options.sheet,n=!!e&&e.options.link?Object(r.a)({},t,{allowEmpty:!0}):t;return g(this.selectorText,this.style,n)},Object(o.a)(e,[{key:"selector",set:function(t){if(t!==this.selectorText){this.selectorText=t;var e=this.renderer,n=this.renderable;if(n&&e)e.setSelector(n,t)||e.replaceRule(n,this)}},get:function(){return this.selectorText}}]),e}(y),w={onCreateRule:function(t,e,n){return"@"===t[0]||n.parent&&"keyframes"===n.parent.type?null:new _(t,e,n)}},S={indent:1,children:!0},O=/@([\w-]+)/,x=function(){function t(t,e,n){this.type="conditional",this.at=void 0,this.key=void 0,this.query=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0,this.key=t;var i=t.match(O);for(var o in this.at=i?i[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new G(Object(r.a)({},n,{parent:this})),e)this.rules.add(o,e[o]);this.rules.process()}var e=t.prototype;return e.getRule=function(t){return this.rules.get(t)},e.indexOf=function(t){return this.rules.indexOf(t)},e.addRule=function(t,e,n){var r=this.rules.add(t,e,n);return r?(this.options.jss.plugins.onProcessRule(r),r):null},e.toString=function(t){if(void 0===t&&(t=S),null==t.indent&&(t.indent=S.indent),null==t.children&&(t.children=S.children),!1===t.children)return this.query+" {}";var e=this.rules.toString(t);return e?this.query+" {\n"+e+"\n}":""},t}(),E=/@media|@supports\s+/,M={onCreateRule:function(t,e,n){return E.test(t)?new x(t,e,n):null}},T={indent:1,children:!0},$=/@keyframes\s+([\w-]+)/,A=function(){function t(t,e,n){this.type="keyframes",this.at="@keyframes",this.key=void 0,this.name=void 0,this.id=void 0,this.rules=void 0,this.options=void 0,this.isProcessed=!1,this.renderable=void 0;var i=t.match($);i&&i[1]?this.name=i[1]:this.name="noname",this.key=this.type+"-"+this.name,this.options=n;var o=n.scoped,a=n.sheet,u=n.generateId;for(var s in this.id=!1===o?this.name:v(u(this,a)),this.rules=new G(Object(r.a)({},n,{parent:this})),e)this.rules.add(s,e[s],Object(r.a)({},n,{parent:this}));this.rules.process()}return t.prototype.toString=function(t){if(void 0===t&&(t=T),null==t.indent&&(t.indent=T.indent),null==t.children&&(t.children=T.children),!1===t.children)return this.at+" "+this.id+" {}";var e=this.rules.toString(t);return e&&(e="\n"+e+"\n"),this.at+" "+this.id+" {"+e+"}"},t}(),k=/@keyframes\s+/,C=/\$([\w-]+)/g,I=function(t,e){return"string"===typeof t?t.replace(C,(function(t,n){return n in e?e[n]:t})):t},P=function(t,e,n){var r=t[e],i=I(r,n);i!==r&&(t[e]=i)},N={onCreateRule:function(t,e,n){return"string"===typeof t&&k.test(t)?new A(t,e,n):null},onProcessStyle:function(t,e,n){return"style"===e.type&&n?("animation-name"in t&&P(t,"animation-name",n.keyframes),"animation"in t&&P(t,"animation",n.keyframes),t):t},onChangeValue:function(t,e,n){var r=n.options.sheet;if(!r)return t;switch(e){case"animation":case"animation-name":return I(t,r.keyframes);default:return t}}},R=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;i=this.index)e.push(t);else for(var r=0;rn)return void e.splice(r,0,t)},e.reset=function(){this.registry=[]},e.remove=function(t){var e=this.registry.indexOf(t);this.registry.splice(e,1)},e.toString=function(t){for(var e=void 0===t?{}:t,n=e.attached,r=Object(s.a)(e,["attached"]),i="",o=0;o0){var n=function(t,e){for(var n=0;ne.index&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function(t,e){for(var n=t.length-1;n>=0;n--){var r=t[n];if(r.attached&&r.options.insertionPoint===e.insertionPoint)return r}return null}(e,t))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}var r=t.insertionPoint;if(r&&"string"===typeof r){var i=function(t){for(var e=ut(),n=0;nn?n:e},dt=function(){function t(t){this.getPropertyValue=rt,this.setProperty=it,this.removeProperty=ot,this.setSelector=at,this.element=void 0,this.sheet=void 0,this.hasInsertedRules=!1,this.cssRules=[],t&&Q.add(t),this.sheet=t;var e=this.sheet?this.sheet.options:{},n=e.media,r=e.meta,i=e.element;this.element=i||function(){var t=document.createElement("style");return t.textContent="\n",t}(),this.element.setAttribute("data-jss",""),n&&this.element.setAttribute("media",n),r&&this.element.setAttribute("data-meta",r);var o=ct();o&&this.element.setAttribute("nonce",o)}var e=t.prototype;return e.attach=function(){if(!this.element.parentNode&&this.sheet){!function(t,e){var n=e.insertionPoint,r=st(e);if(!1!==r&&r.parent)r.parent.insertBefore(t,r.node);else if(n&&"number"===typeof n.nodeType){var i=n,o=i.parentNode;o&&o.insertBefore(t,i.nextSibling)}else ut().appendChild(t)}(this.element,this.sheet.options);var t=Boolean(this.sheet&&this.sheet.deployed);this.hasInsertedRules&&t&&(this.hasInsertedRules=!1,this.deploy())}},e.detach=function(){if(this.sheet){var t=this.element.parentNode;t&&t.removeChild(this.element),this.sheet.options.link&&(this.cssRules=[],this.element.textContent="\n")}},e.deploy=function(){var t=this.sheet;t&&(t.options.link?this.insertRules(t.rules):this.element.textContent="\n"+t.toString()+"\n")},e.insertRules=function(t,e){for(var n=0;ne.maxLength)&&((void 0===e.length||n.length===e.length)&&n.every((function(e,n){try{return d(t,e,r)}catch(i){throw s(i,n)}}))))))}return t=l(t),e=e||{},n.toJSON=function(){var n="["+o(t)+"]";return void 0!==e.length?n+="{"+e.length+"}":void 0===e.minLength&&void 0===e.maxLength||(n+="{"+(void 0===e.minLength?0:e.minLength)+","+(void 0===e.maxLength?1/0:e.maxLength)+"}"),n},n},maybe:function t(e){function n(n,r){return i.Nil(n)||e(n,r,t)}return e=l(e),n.toJSON=function(){return"?"+o(e)},n},map:function(t,e){function n(n,r){if(!i.Object(n))return!1;if(i.Nil(n))return!1;for(var o in n){try{e&&d(e,o,r)}catch(u){throw s(u,o,"key")}try{var a=n[o];d(t,a,r)}catch(u){throw s(u,o)}}return!0}return t=l(t),e&&(e=l(e)),n.toJSON=e?function(){return"{"+o(e)+": "+o(t)+"}"}:function(){return"{"+o(t)+"}"},n},object:function(t){var e={};for(var n in t)e[n]=l(t[n]);function r(t,n){if(!i.Object(t))return!1;if(i.Nil(t))return!1;var r;try{for(r in e){d(e[r],t[r],n)}}catch(o){throw s(o,r)}if(n)for(r in t)if(!e[r])throw new u(void 0,r);return!0}return r.toJSON=function(){return o(e)},r},anyOf:function(){var t=[].slice.call(arguments).map(l);function e(e,n){return t.some((function(t){try{return d(t,e,n)}catch(r){return!1}}))}return e.toJSON=function(){return t.map(o).join("|")},e},allOf:function(){var t=[].slice.call(arguments).map(l);function e(e,n){return t.every((function(t){try{return d(t,e,n)}catch(r){return!1}}))}return e.toJSON=function(){return t.map(o).join(" & ")},e},quacksLike:function(t){function e(e){return t===c(e)}return e.toJSON=function(){return t},e},tuple:function(){var t=[].slice.call(arguments).map(l);function e(e,n){return!i.Nil(e)&&(!i.Nil(e.length)&&((!n||e.length===t.length)&&t.every((function(t,r){try{return d(t,e[r],n)}catch(i){throw s(i,r)}}))))}return e.toJSON=function(){return"("+t.map(o).join(", ")+")"},e},value:function(t){function e(e){return e===t}return e.toJSON=function(){return t},e}};function l(t){if(i.String(t))return"?"===t[0]?f.maybe(t.slice(1)):i[t]||f.quacksLike(t);if(t&&i.Object(t)){if(i.Array(t)){if(1!==t.length)throw new TypeError("Expected compile() parameter of type Array of length 1");return f.arrayOf(t[0])}return f.object(t)}return i.Function(t)?t:f.value(t)}function d(t,e,n,r){if(i.Function(t)){if(t(e,n))return!0;throw new a(r||t,e)}return d(l(t),e,n)}for(var h in f.oneOf=f.anyOf,i)d[h]=i[h];for(h in f)d[h]=f[h];var p=n(781);for(h in p)d[h]=p[h];d.compile=l,d.TfTypeError=a,d.TfPropertyTypeError=u,t.exports=d},function(t,e,n){"use strict";(function(e){var r=n(113),i=n(52),o=n(49),a=function(t){for(var n=e.alloc(t.length),r=0;rt.size?n=r.trim(n,o):o0&&0===(127&t[t.length-1])&&(t.length<=1||0===(128&t[t.length-2])))throw new Error("non-minimally encoded script number");return r.fromSM(t,{endian:"little"})},r.prototype.toScriptNumBuffer=function(){return this.toSM({endian:"little"})},r.trim=function(t,e){return t.slice(e-t.length,t.length)},r.pad=function(t,n,r){for(var i=e.alloc(r),o=0;o=0}}},function(t,e){function n(){return t.exports=n=Object.assign||function(t){for(var e=1;e>>2];t.sigBytes-=e}},g=(n.BlockCipher=f.extend({cfg:f.cfg.extend({mode:h,padding:p}),reset:function(){f.reset.call(this);var t=this.cfg,e=t.iv,n=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,e&&e.words):(this._mode=r.call(n,this,e&&e.words),this._mode.__creator=r)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){t.pad(this._data,this.blockSize);var e=this._process(!0)}else e=this._process(!0),t.unpad(e);return e},blockSize:4}),n.CipherParams=r.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),m=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,n=t.salt;if(n)var r=i.create([1398893684,1701076831]).concat(n).concat(e);else r=e;return r.toString(s)},parse:function(t){var e=s.parse(t),n=e.words;if(1398893684==n[0]&&1701076831==n[1]){var r=i.create(n.slice(2,4));n.splice(0,4),e.sigBytes-=16}return g.create({ciphertext:e,salt:r})}},b=n.SerializableCipher=r.extend({cfg:r.extend({format:m}),encrypt:function(t,e,n,r){r=this.cfg.extend(r);var i=t.createEncryptor(n,r),o=i.finalize(e),a=i.cfg;return g.create({ciphertext:o,key:n,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,n,r){return r=this.cfg.extend(r),e=this._parse(e,r.format),t.createDecryptor(n,r).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),v=(e.kdf={}).OpenSSL={execute:function(t,e,n,r){r||(r=i.random(8));var o=c.create({keySize:e+n}).compute(t,r),a=i.create(o.words.slice(e),4*n);return o.sigBytes=4*e,g.create({key:o,iv:a,salt:r})}},y=n.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:v}),encrypt:function(t,e,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,t.keySize,t.ivSize);r.iv=i.iv;var o=b.encrypt.call(this,t,e,i.key,r);return o.mixIn(i),o},decrypt:function(t,e,n,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var i=r.kdf.execute(n,t.keySize,t.ivSize,e.salt);return r.iv=i.iv,b.decrypt.call(this,t,e,i.key,r)}})}()))}()},function(t,e,n){"use strict";(function(e){var r=n(481),i=n(63),o=n(52),a=t.exports;a.sha1=function(t){return o.checkArgument(i.isBuffer(t)),r.createHash("sha1").update(t).digest()},a.sha1.blocksize=512,a.sha256=function(t){return o.checkArgument(i.isBuffer(t)),r.createHash("sha256").update(t).digest()},a.sha256.blocksize=512,a.sha256sha256=function(t){return o.checkArgument(i.isBuffer(t)),a.sha256(a.sha256(t))},a.ripemd160=function(t){return o.checkArgument(i.isBuffer(t)),r.createHash("ripemd160").update(t).digest()},a.sha256ripemd160=function(t){return o.checkArgument(i.isBuffer(t)),a.ripemd160(a.sha256(t))},a.sha512=function(t){return o.checkArgument(i.isBuffer(t)),r.createHash("sha512").update(t).digest()},a.sha512.blocksize=1024,a.hmac=function(t,n,r){o.checkArgument(i.isBuffer(n)),o.checkArgument(i.isBuffer(r)),o.checkArgument(t.blocksize);var a=t.blocksize/8;if(r.length>a)r=t(r);else if(r0&&void 0!==arguments[0]?arguments[0]:["all"],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.duration,u=void 0===n?o.standard:n,s=e.easing,c=void 0===s?i.easeInOut:s,f=e.delay,l=void 0===f?0:f;Object(r.a)(e,["duration","easing","delay"]);return(Array.isArray(t)?t:[t]).map((function(t){return"".concat(t," ").concat("string"===typeof u?u:a(u)," ").concat(c," ").concat("string"===typeof l?l:a(l))})).join(",")},getAutoHeightDuration:function(t){if(!t)return 0;var e=t/36;return Math.round(10*(4+15*Math.pow(e,.25)+e/5))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(526);var i=n(282),o=n(527);function a(t,e){return Object(r.a)(t)||function(t,e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(s){i=!0,o=s}finally{try{r||null==u.return||u.return()}finally{if(i)throw o}}return n}}(t,e)||Object(i.a)(t,e)||Object(o.a)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return u})),n.d(e,"d",(function(){return l})),n.d(e,"e",(function(){return d}));var r,i=n(1),o=n.n(i),a=n(31);function u(){return r||(r=o.a.createContext({})),r}var s,c=function(t){var e=t.client,n=t.children,r=u();return o.a.createElement(r.Consumer,null,(function(t){return void 0===t&&(t={}),e&&t.client!==e&&(t=Object.assign({},t,{client:e})),Object(a.b)(t.client,5),o.a.createElement(r.Provider,{value:t},n)}))};!function(t){t[t.Query=0]="Query",t[t.Mutation=1]="Mutation",t[t.Subscription=2]="Subscription"}(s||(s={}));var f=new Map;function l(t){var e;switch(t){case s.Query:e="Query";break;case s.Mutation:e="Mutation";break;case s.Subscription:e="Subscription"}return e}function d(t){var e,n,r=f.get(t);if(r)return r;Object(a.b)(!!t&&!!t.kind,1);var i=t.definitions.filter((function(t){return"FragmentDefinition"===t.kind})),o=t.definitions.filter((function(t){return"OperationDefinition"===t.kind&&"query"===t.operation})),u=t.definitions.filter((function(t){return"OperationDefinition"===t.kind&&"mutation"===t.operation})),c=t.definitions.filter((function(t){return"OperationDefinition"===t.kind&&"subscription"===t.operation}));Object(a.b)(!i.length||o.length||u.length||c.length,2),Object(a.b)(o.length+u.length+c.length<=1,3),n=o.length?s.Query:s.Mutation,o.length||u.length||(n=s.Subscription);var l=o.length?o:u.length?u:c;Object(a.b)(1===l.length,4);var d=l[0];e=d.variableDefinitions||[];var h={name:d.name&&"Name"===d.name.kind?d.name.value:"data",type:n,variables:e};return f.set(t,h),h}},function(t,e,n){"use strict";e.a=Array.isArray||function(t){return null!=t&&t.length>=0&&"[object Array]"===Object.prototype.toString.call(t)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){function n(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=n,n.equal=function(t,e,n){if(t!=e)throw new Error(n||"Assertion failed: "+t+" != "+e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(401),i=(n(1),n(136));function o(){return Object(r.a)()||i.a}},function(t,e,n){"use strict";var r=n(16),i=n(71),o=n(138),a=n(75),u=n(64),s=function(){function t(t,e){this.xf=e,this.f=t}return t.prototype["@@transducer/init"]=u.a.init,t.prototype["@@transducer/result"]=u.a.result,t.prototype["@@transducer/step"]=function(t,e){return this.xf["@@transducer/step"](t,this.f(e))},t}(),c=Object(r.a)((function(t,e){return new s(t,e)})),f=n(85),l=n(98),d=Object(r.a)(Object(i.a)(["fantasy-land/map","map"],c,(function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return Object(f.a)(e.length,(function(){return t.call(this,e.apply(this,arguments))}));case"[object Object]":return Object(a.a)((function(n,r){return n[r]=t(e[r]),n}),{},Object(l.a)(e));default:return Object(o.a)(t,e)}})));e.a=d},function(t,e,n){"use strict";var r=n(32),i=n(61),o=n(289),a=!{toString:null}.propertyIsEnumerable("toString"),u=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],s=function(){return arguments.propertyIsEnumerable("length")}(),c=function(t,e){for(var n=0;n=0;)e=u[n],Object(i.a)(e,t)&&!c(r,e)&&(r[r.length]=e),n-=1;return r})):Object(r.a)((function(t){return Object(t)!==t?[]:Object.keys(t)}));e.a=f},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return a}));var r=n(287),i={Name:[],Document:["definitions"],OperationDefinition:["name","variableDefinitions","directives","selectionSet"],VariableDefinition:["variable","type","defaultValue","directives"],Variable:["name"],SelectionSet:["selections"],Field:["alias","name","arguments","directives","selectionSet"],Argument:["name","value"],FragmentSpread:["name","directives"],InlineFragment:["typeCondition","directives","selectionSet"],FragmentDefinition:["name","variableDefinitions","typeCondition","directives","selectionSet"],IntValue:[],FloatValue:[],StringValue:[],BooleanValue:[],NullValue:[],EnumValue:[],ListValue:["values"],ObjectValue:["fields"],ObjectField:["name","value"],Directive:["name","arguments"],NamedType:["name"],ListType:["type"],NonNullType:["type"],SchemaDefinition:["directives","operationTypes"],OperationTypeDefinition:["type"],ScalarTypeDefinition:["description","name","directives"],ObjectTypeDefinition:["description","name","interfaces","directives","fields"],FieldDefinition:["description","name","arguments","type","directives"],InputValueDefinition:["description","name","type","defaultValue","directives"],InterfaceTypeDefinition:["description","name","directives","fields"],UnionTypeDefinition:["description","name","directives","types"],EnumTypeDefinition:["description","name","directives","values"],EnumValueDefinition:["description","name","directives"],InputObjectTypeDefinition:["description","name","directives","fields"],DirectiveDefinition:["description","name","arguments","locations"],SchemaExtension:["directives","operationTypes"],ScalarTypeExtension:["name","directives"],ObjectTypeExtension:["name","interfaces","directives","fields"],InterfaceTypeExtension:["name","directives","fields"],UnionTypeExtension:["name","directives","types"],EnumTypeExtension:["name","directives","values"],InputObjectTypeExtension:["name","directives","fields"]},o=Object.freeze({});function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i,a=void 0,c=Array.isArray(t),f=[t],l=-1,d=[],h=void 0,p=void 0,g=void 0,m=[],b=[],v=t;do{var y=++l===f.length,_=y&&0!==d.length;if(y){if(p=0===b.length?void 0:m[m.length-1],h=g,g=b.pop(),_){if(c)h=h.slice();else{for(var w={},S=0,O=Object.keys(h);S72)return!1;if(48!=t[0])return!1;if(t[1]!=t.length-2)return!1;if(2!=t[2])return!1;var e=t[3];if(0==e)return!1;if(128&t[4])return!1;if(e>t.length-7)return!1;if(e>1&&0==t[4]&&!(128&t[5]))return!1;var n=e+4;if(2!=t[n])return!1;var r=t[n+1];return 0!=r&&(!(128&t[n+2])&&(n+r+2==t.length&&!(r>1&&0==t[n+2]&&!(128&t[n+3]))))},s.prototype.hasLowS=function(){return!this.s.lt(new r(1))&&!this.s.gt(new r("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex"))},s.prototype.hasDefinedHashtype=function(){if(!u.isNaturalNumber(this.nhashtype))return!1;var t=~(s.SIGHASH_FORKID|s.SIGHASH_ANYONECANPAY)>>>0,e=this.nhashtype&t;return!(es.SIGHASH_SINGLE)},s.prototype.toTxFormat=function(t){var n=this.toDER(t),r=e.alloc(1);return r.writeUInt8(this.nhashtype,0),e.concat([n,r])},s.SIGHASH_ALL=1,s.SIGHASH_NONE=2,s.SIGHASH_SINGLE=3,s.SIGHASH_FORKID=64,s.SIGHASH_ANYONECANPAY=128,t.exports=s}).call(this,n(29).Buffer)},function(t,e,n){"use strict";(function(e){var r=n(78),i=n(186),o=n(84),a=n(79),u=n(159),s=n(49),c=n(52);function f(t,e){if(!(this instanceof f))return new f(t,e);if(c.checkArgument(t,"First argument is required, please include public key data."),t instanceof f)return t;e=e||{};var n=this._classifyArgs(t,e);return n.point.validate(),a.defineImmutable(this,{point:n.point,compressed:n.compressed,network:n.network||u.defaultNetwork}),this}f.prototype._classifyArgs=function(t,n){var r={compressed:s.isUndefined(n.compressed)||n.compressed};if(t instanceof i)r.point=t;else if(t.x&&t.y)r=f._transformObject(t);else if("string"===typeof t)r=f._transformDER(e.from(t,"hex"));else if(f._isBuffer(t))r=f._transformDER(t);else{if(!f._isPrivateKey(t))throw new TypeError("First argument is an unrecognized data format.");r=f._transformPrivateKey(t)}return r.network||(r.network=s.isUndefined(n.network)?void 0:u.get(n.network)),r},f._isPrivateKey=function(t){return t instanceof n(273)},f._isBuffer=function(t){return t instanceof e||t instanceof Uint8Array},f._transformPrivateKey=function(t){c.checkArgument(f._isPrivateKey(t),"Must be an instance of PrivateKey");var e={};return e.point=i.getG().mul(t.bn),e.compressed=t.compressed,e.network=t.network,e},f._transformDER=function(t,e){c.checkArgument(f._isBuffer(t),"Must be a hex buffer of DER encoded public key");var n,o,a,u,l={};if(e=!!s.isUndefined(e)||e,4!==t[0]&&(e||6!==t[0]&&7!==t[0]))if(3===t[0])a=t.slice(1),n=new r(a),(l=f._transformX(!0,n)).compressed=!0;else{if(2!==t[0])throw new TypeError("Invalid DER format public key");a=t.slice(1),n=new r(a),(l=f._transformX(!1,n)).compressed=!0}else{if(a=t.slice(1,33),u=t.slice(33,65),32!==a.length||32!==u.length||65!==t.length)throw new TypeError("Length of x and y must be 32 bytes");n=new r(a),o=new r(u),l.point=new i(n,o),l.compressed=!1}return l},f._transformX=function(t,e){c.checkArgument("boolean"===typeof t,"Must specify whether y is odd or not (true or false)");var n={};return n.point=i.fromX(t,e),n},f._transformObject=function(t){var e=new r(t.x,"hex"),n=new r(t.y,"hex");return new f(new i(e,n),{compressed:t.compressed})},f.fromPrivateKey=function(t){c.checkArgument(f._isPrivateKey(t),"Must be an instance of PrivateKey");var e=f._transformPrivateKey(t);return new f(e.point,{compressed:e.compressed,network:e.network})},f.fromDER=f.fromBuffer=function(t,e){c.checkArgument(f._isBuffer(t),"Must be a hex buffer of DER encoded public key");var n=f._transformDER(t,e);return new f(n.point,{compressed:n.compressed})},f.fromPoint=function(t,e){return c.checkArgument(t instanceof i,"First argument must be an instance of Point."),new f(t,{compressed:e})},f.fromString=function(t,n){var r=e.from(t,n||"hex"),i=f._transformDER(r);return new f(i.point,{compressed:i.compressed})},f.fromX=function(t,e){var n=f._transformX(t,e);return new f(n.point,{compressed:n.compressed})},f.getValidationError=function(t){var e;try{new f(t)}catch(n){e=n}return e},f.isValid=function(t){return!f.getValidationError(t)},f.prototype.toObject=f.prototype.toJSON=function(){return{x:this.point.getX().toString("hex",2),y:this.point.getY().toString("hex",2),compressed:this.compressed}},f.prototype.toBuffer=f.prototype.toDER=function(){var t,n=this.point.getX(),r=this.point.getY(),i=n.toBuffer({size:32}),o=r.toBuffer({size:32});return this.compressed?(t=o[o.length-1]%2?e.from([3]):e.from([2]),e.concat([t,i])):(t=e.from([4]),e.concat([t,i,o]))},f.prototype._getID=function(){return o.sha256ripemd160(this.toBuffer())},f.prototype.toAddress=function(t){return n(187).fromPublicKey(this,t||this.network)},f.prototype.toString=function(){return this.toDER().toString("hex")},f.prototype.inspect=function(){return""},t.exports=f}).call(this,n(29).Buffer)},function(t,e,n){var r=n(726).runInContext();t.exports=n(727)(r,r)},function(t,e,n){"use strict";t.exports=n(615)},function(t,e,n){"use strict";var r=n(164),i=n(41),o=Object(i.a)(Object(r.a)("slice",(function(t,e,n){return Array.prototype.slice.call(n,t,e)})));e.a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1),i=n(191);function o(){return r.useContext(i.a)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(300);function i(t,e){return Object(r.a)(e,t,0)>=0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(245);var i=n(525),o=n(282);function a(t){return function(t){if(Array.isArray(t))return Object(r.a)(t)}(t)||Object(i.a)(t)||Object(o.a)(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(25),i=n(22);function o(t,e){Object(i.a)(2,arguments);var n=Object(r.a)(t),o=Object(r.a)(e),a=n.getTime()-o.getTime();return a<0?-1:a>0?1:a}},function(t,e,n){"use strict";function r(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.r(e),n.d(e,"ApolloLink",(function(){return y})),n.d(e,"concat",(function(){return v})),n.d(e,"createOperation",(function(){return d})),n.d(e,"empty",(function(){return g})),n.d(e,"execute",(function(){return _})),n.d(e,"from",(function(){return m})),n.d(e,"fromError",(function(){return l})),n.d(e,"fromPromise",(function(){return f})),n.d(e,"makePromise",(function(){return c})),n.d(e,"split",(function(){return b})),n.d(e,"toPromise",(function(){return s}));var r=n(82);n.d(e,"Observable",(function(){return r.a}));var i=n(31),o=n(14),a=n(27);n.d(e,"getOperationName",(function(){return a.n}));!function(t){function e(e,n){var r=t.call(this,e)||this;return r.link=n,r}Object(o.c)(e,t)}(Error);function u(t){return t.request.length<=1}function s(t){var e=!1;return new Promise((function(n,r){t.subscribe({next:function(t){e||(e=!0,n(t))},error:r})}))}var c=s;function f(t){return new r.a((function(e){t.then((function(t){e.next(t),e.complete()})).catch(e.error.bind(e))}))}function l(t){return new r.a((function(e){e.error(t)}))}function d(t,e){var n=Object(o.a)({},t);return Object.defineProperty(e,"setContext",{enumerable:!1,value:function(t){n="function"===typeof t?Object(o.a)({},n,t(n)):Object(o.a)({},n,t)}}),Object.defineProperty(e,"getContext",{enumerable:!1,value:function(){return Object(o.a)({},n)}}),Object.defineProperty(e,"toKey",{enumerable:!1,value:function(){return function(t){var e=t.query,n=t.variables,r=t.operationName;return JSON.stringify([r,e,n])}(e)}}),e}function h(t,e){return e?e(t):r.a.of()}function p(t){return"function"===typeof t?new y(t):t}function g(){return new y((function(){return r.a.of()}))}function m(t){return 0===t.length?g():t.map(p).reduce((function(t,e){return t.concat(e)}))}function b(t,e,n){var i=p(e),o=p(n||new y(h));return u(i)&&u(o)?new y((function(e){return t(e)?i.request(e)||r.a.of():o.request(e)||r.a.of()})):new y((function(e,n){return t(e)?i.request(e,n)||r.a.of():o.request(e,n)||r.a.of()}))}var v=function(t,e){var n=p(t);if(u(n))return n;var i=p(e);return u(i)?new y((function(t){return n.request(t,(function(t){return i.request(t)||r.a.of()}))||r.a.of()})):new y((function(t,e){return n.request(t,(function(t){return i.request(t,e)||r.a.of()}))||r.a.of()}))},y=function(){function t(t){t&&(this.request=t)}return t.prototype.split=function(e,n,r){return this.concat(b(e,n,r||new t(h)))},t.prototype.concat=function(t){return v(this,t)},t.prototype.request=function(t,e){throw new i.a(1)},t.empty=g,t.from=m,t.split=b,t.execute=_,t}();function _(t,e){return t.request(d(e.context,function(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName="string"!==typeof e.query?Object(a.n)(e.query):""),e}(function(t){for(var e=["query","operationName","variables","extensions","context"],n=0,r=Object.keys(t);n=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function s(t,e,n,r){for(var i=0,o=Math.min(t.length,n),a=e;a=49?u-49+10:u>=17?u-17+10:u}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"===typeof t)return this._initNumber(t,e,n);if("object"===typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){if(r("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=u(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=u(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,u=Math.min(o,o-a)+n,c=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,u=67108863&a,s=a/67108864|0;n.words[0]=u;for(var c=1;c>>26,l=67108863&s,d=Math.min(c,e.length-1),h=Math.max(0,c-t.length+1);h<=d;h++){var p=c-h|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[h])+l)/67108864|0,l=67108863&a}n.words[c]=0|l,s=0|f}return 0!==s?n.words[c]=0|s:n.length--,n.strip()}o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-s.length]+s+n:s+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],h=l[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(h).toString(t);n=(p=p.idivn(h)).isZero()?g+n:c[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,u,s="le"===e,c=new t(o),f=this.clone();if(s){for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[u]=a;for(;u=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0===(8191&e)&&(n+=13,e>>>=13),0===(127&e)&&(n+=7,e>>>=7),0===(15&e)&&(n+=4,e>>>=4),0===(3&e)&&(n+=2,e>>>=2),0===(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"===typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,h=0|a[1],p=8191&h,g=h>>>13,m=0|a[2],b=8191&m,v=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,S=0|a[4],O=8191&S,x=S>>>13,E=0|a[5],M=8191&E,T=E>>>13,$=0|a[6],A=8191&$,k=$>>>13,C=0|a[7],I=8191&C,P=C>>>13,N=0|a[8],R=8191&N,j=N>>>13,D=0|a[9],L=8191&D,F=D>>>13,B=0|u[0],U=8191&B,z=B>>>13,H=0|u[1],V=8191&H,q=H>>>13,W=0|u[2],G=8191&W,K=W>>>13,Y=0|u[3],Z=8191&Y,Q=Y>>>13,X=0|u[4],J=8191&X,tt=X>>>13,et=0|u[5],nt=8191&et,rt=et>>>13,it=0|u[6],ot=8191&it,at=it>>>13,ut=0|u[7],st=8191&ut,ct=ut>>>13,ft=0|u[8],lt=8191&ft,dt=ft>>>13,ht=0|u[9],pt=8191&ht,gt=ht>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(l,U))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,U)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(g,U)|0,o=Math.imul(g,z);var bt=(c+(r=r+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(d,V)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,U),i=(i=Math.imul(b,z))+Math.imul(v,U)|0,o=Math.imul(v,z),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var vt=(c+(r=r+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,K)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,K)|0;var yt=(c+(r=r+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(x,U)|0,o=Math.imul(x,z),r=r+Math.imul(_,V)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Q)|0;var _t=(c+(r=r+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(M,U),i=(i=Math.imul(M,z))+Math.imul(T,U)|0,o=Math.imul(T,z),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,q)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,tt)|0;var wt=(c+(r=r+Math.imul(l,nt)|0)|0)+((8191&(i=(i=i+Math.imul(l,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,z))+Math.imul(k,U)|0,o=Math.imul(k,z),r=r+Math.imul(M,V)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,K)|0,r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var St=(c+(r=r+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(P,U)|0,o=Math.imul(P,z),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,K)|0,r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Ot=(c+(r=r+Math.imul(l,st)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(d,st)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,z))+Math.imul(j,U)|0,o=Math.imul(j,z),r=r+Math.imul(I,V)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,q)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Q)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(w,nt)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(g,st)|0,o=o+Math.imul(g,ct)|0;var xt=(c+(r=r+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(F,U)|0,o=Math.imul(F,z),r=r+Math.imul(R,V)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,q)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(v,st)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(g,lt)|0,o=o+Math.imul(g,dt)|0;var Et=(c+(r=r+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,q))+Math.imul(F,V)|0,o=Math.imul(F,q),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,K)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0;var Mt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,K))+Math.imul(F,G)|0,o=Math.imul(F,K),r=r+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(O,st)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(x,st)|0,o=o+Math.imul(x,ct)|0,r=r+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0;var Tt=(c+(r=r+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,Q))+Math.imul(F,Z)|0,o=Math.imul(F,Q),r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,st)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,dt)|0;var $t=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,gt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,tt))+Math.imul(F,J)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(j,nt)|0,o=o+Math.imul(j,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(A,st)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(k,st)|0,o=o+Math.imul(k,ct)|0,r=r+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,dt)|0;var At=(c+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(L,nt),i=(i=Math.imul(L,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,r=r+Math.imul(I,st)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,st)|0,o=o+Math.imul(P,ct)|0,r=r+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0;var kt=(c+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(j,st)|0,o=o+Math.imul(j,ct)|0,r=r+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0;var Ct=(c+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(L,st),i=(i=Math.imul(L,ct))+Math.imul(F,st)|0,o=Math.imul(F,ct),r=r+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,dt)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(L,lt),i=(i=Math.imul(L,dt))+Math.imul(F,lt)|0,o=Math.imul(F,dt);var Pt=(c+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Nt=(c+(r=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,gt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,gt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,s[0]=mt,s[1]=bt,s[2]=vt,s[3]=yt,s[4]=_t,s[5]=wt,s[6]=St,s[7]=Ot,s[8]=xt,s[9]=Et,s[10]=Mt,s[11]=Tt,s[12]=$t,s[13]=At,s[14]=kt,s[15]=Ct,s[16]=It,s[17]=Pt,s[18]=Nt,0!==c&&(s[19]=c,n.length++),n};function p(t,e,n){return(new g).mulp(t,e,n)}function g(t,e){this.x=t,this.y=e}Math.imul||(h=d),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=u,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r>=1;return r},g.prototype.permute=function(t,e,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(e=0;e>>26-n}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&u}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"===typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"===typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===u)return this.strip();for(r(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var u,s=r.length-i.length;if("mod"!==e){(u=new o(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c=0;l--){var d=67108864*(0|r.words[i.length+l])+(0|r.words[i.length+l-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,l);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,l),r.isZero()||(r.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:u||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!==(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.isub(t)),{div:u.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,u},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),u=new o(0),s=new o(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),l=e.clone();!e.isZero();){for(var d=0,h=1;0===(e.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,g=1;0===(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(f),s.isub(l)),u.iushrn(1),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(u),a.isub(s)):(n.isub(e),u.isub(i),s.isub(a))}return{a:u,b:s,gcd:n.iushln(c)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),u=new o(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var l=0,d=1;0===(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(u)):(n.isub(e),u.isub(a))}return(i=0===e.cmpn(1)?a:u).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"===typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,u&=67108863,this.words[a]=u}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function O(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):n.strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var u=new o(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(s);)f.redIAdd(s);for(var l=this.pow(f,i),d=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),p=a;0!==h.cmp(u);){for(var g=h,m=0;0!==g.cmp(u);m++)g=g.redSqr();r(m=0;r--){for(var c=e.words[r],f=s-1;f>=0;f--){var l=c>>f&1;i!==n[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++u||0===r&&0===f)&&(i=this.mul(i,n[a]),u=0,a=0)):u=0}s=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new O(t)},i(O,S),O.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},O.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},O.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(94)(t))},function(t,e,n){"use strict";var r=e,i=n(149),o=n(95),a=n(261);r.assert=o,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-s:s,o.isubn(u)):u=0,r[a]=u,o.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,u,s=t.andln(3)+i&3,c=e.andln(3)+o&3;3===s&&(s=-1),3===c&&(c=-1),a=0===(1&s)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?s:-s,n[0].push(a),u=0===(1&c)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==s?c:-c,n[1].push(u),2*i===a+1&&(i=1-i),2*o===u+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"===typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,n){"use strict";var r=n(49);function i(t,e){return t.replace("{0}",e[0]).replace("{1}",e[1]).replace("{2}",e[2])}var o=function(t,e){var n=function(){if(r.isString(e.message))this.message=i(e.message,arguments);else{if(!r.isFunction(e.message))throw new Error("Invalid error definition for "+e.name);this.message=e.message.apply(null,arguments)}this.stack=this.message+"\n"+(new Error).stack};return(n.prototype=Object.create(t.prototype)).name=t.prototype.name+e.name,t[e.name]=n,e.errors&&a(n,e.errors),n},a=function(t,e){r.each(e,(function(e){o(t,e)}))},u={Error:function(){this.message="Internal error",this.stack=this.message+"\n"+(new Error).stack}};u.Error.prototype=Object.create(Error.prototype),u.Error.prototype.name="bitcore.Error";var s,c=n(872);s=u.Error,a(s,c),t.exports=u.Error,t.exports.extend=function(t){return o(u.Error,t)}},function(t,e,n){"use strict";var r=e,i=n(150),o=n(95),a=n(261);r.assert=o,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-s:s,o.isubn(u)):u=0,r[a]=u,o.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,u,s=t.andln(3)+i&3,c=e.andln(3)+o&3;3===s&&(s=-1),3===c&&(c=-1),a=0===(1&s)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?s:-s,n[0].push(a),u=0===(1&c)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==s?c:-c,n[1].push(u),2*i===a+1&&(i=1-i),2*o===u+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"===typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,n){"use strict";var r=e,i=n(151),o=n(95),a=n(261);r.assert=o,r.toArray=a.toArray,r.zero2=a.zero2,r.toHex=a.toHex,r.encode=a.encode,r.getNAF=function(t,e,n){var r=new Array(Math.max(t.bitLength(),n)+1);r.fill(0);for(var i=1<(i>>1)-1?(i>>1)-s:s,o.isubn(u)):u=0,r[a]=u,o.iushrn(1)}return r},r.getJSF=function(t,e){var n=[[],[]];t=t.clone(),e=e.clone();for(var r,i=0,o=0;t.cmpn(-i)>0||e.cmpn(-o)>0;){var a,u,s=t.andln(3)+i&3,c=e.andln(3)+o&3;3===s&&(s=-1),3===c&&(c=-1),a=0===(1&s)?0:3!==(r=t.andln(7)+i&7)&&5!==r||2!==c?s:-s,n[0].push(a),u=0===(1&c)?0:3!==(r=e.andln(7)+o&7)&&5!==r||2!==s?c:-c,n[1].push(u),2*i===a+1&&(i=1-i),2*o===u+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return n},r.cachedProperty=function(t,e,n){var r="_"+e;t.prototype[e]=function(){return void 0!==this[r]?this[r]:this[r]=n.call(this)}},r.parseBytes=function(t){return"string"===typeof t?r.toArray(t,"hex"):t},r.intFromLE=function(t){return new i(t,"hex","le")}},function(t,e,n){t.exports=n(512),t.exports.Interpreter=n(514)},function(t,e,n){"use strict";function r(t){var e=t.props,n=t.states,r=t.muiFormControl;return n.reduce((function(t,n){return t[n]=e[n],r&&"undefined"===typeof e[n]&&(t[n]=r[n]),t}),{})}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(16);function i(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}var o=n(225);var a=n(61);var u="function"===typeof Object.is?Object.is:function(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e},s=n(98),c=n(247);function f(t,e,n,r){var a=i(t),u=i(e);function s(t,e){return l(t,e,n.slice(),r.slice())}return!Object(o.a)((function(t,e){return!Object(o.a)(s,e,t)}),u,a)}function l(t,e,n,r){if(u(t,e))return!0;var i=Object(c.a)(t);if(i!==Object(c.a)(e))return!1;if(null==t||null==e)return!1;if("function"===typeof t["fantasy-land/equals"]||"function"===typeof e["fantasy-land/equals"])return"function"===typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e)&&"function"===typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t);if("function"===typeof t.equals||"function"===typeof e.equals)return"function"===typeof t.equals&&t.equals(e)&&"function"===typeof e.equals&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if("function"===typeof t.constructor&&"Promise"===function(t){var e=String(t).match(/^function (\w*)/);return null==e?"":e[1]}(t.constructor))return t===e;break;case"Boolean":case"Number":case"String":if(typeof t!==typeof e||!u(t.valueOf(),e.valueOf()))return!1;break;case"Date":if(!u(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(t.source!==e.source||t.global!==e.global||t.ignoreCase!==e.ignoreCase||t.multiline!==e.multiline||t.sticky!==e.sticky||t.unicode!==e.unicode)return!1}for(var o=n.length-1;o>=0;){if(n[o]===t)return r[o]===e;o-=1}switch(i){case"Map":return t.size===e.size&&f(t.entries(),e.entries(),n.concat([t]),r.concat([e]));case"Set":return t.size===e.size&&f(t.values(),e.values(),n.concat([t]),r.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var d=Object(s.a)(t);if(d.length!==Object(s.a)(e).length)return!1;var h=n.concat([t]),p=r.concat([e]);for(o=d.length-1;o>=0;){var g=d[o];if(!Object(a.a)(g,e)||!l(e[g],t[g],h,p))return!1;o-=1}return!0}var d=Object(r.a)((function(t,e){return l(t,e,[],[])}));e.a=d},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(1),i="undefined"!==typeof window?r.useLayoutEffect:r.useEffect;function o(t){var e=r.useRef(t);return i((function(){e.current=t})),r.useCallback((function(){return e.current.apply(void 0,arguments)}),[])}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var r=function(t){return t.scrollTop};function i(t,e){var n=t.timeout,r=t.style,i=void 0===r?{}:r;return{duration:i.transitionDuration||"number"===typeof n?n:n[e.mode]||0,delay:i.transitionDelay}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return O})),n.d(e,"b",(function(){return A})),n.d(e,"d",(function(){return C})),n.d(e,"c",(function(){return g})),n.d(e,"f",(function(){return m})),n.d(e,"e",(function(){return p}));var r=n(4);function i(t){return"/"===t.charAt(0)}function o(t,e){for(var n=e,r=n+1,i=t.length;r=0;d--){var h=a[d];"."===h?o(a,d):".."===h?(o(a,d),l++):l&&(o(a,d),l--)}if(!c)for(;l--;l)a.unshift("..");!c||""===a[0]||a[0]&&i(a[0])||a.unshift("");var p=a.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p};function u(t){return t.valueOf?t.valueOf():Object.prototype.valueOf.call(t)}var s=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every((function(e,r){return t(e,n[r])}));if("object"===typeof e||"object"===typeof n){var r=u(e),i=u(n);return r!==e||i!==n?t(r,i):Object.keys(Object.assign({},e,n)).every((function(r){return t(e[r],n[r])}))}return!1},c=n(111);function f(t){return"/"===t.charAt(0)?t:"/"+t}function l(t){return"/"===t.charAt(0)?t.substr(1):t}function d(t,e){return function(t,e){return 0===t.toLowerCase().indexOf(e.toLowerCase())&&-1!=="/?#".indexOf(t.charAt(e.length))}(t,e)?t.substr(e.length):t}function h(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t}function p(t){var e=t.pathname,n=t.search,r=t.hash,i=e||"/";return n&&"?"!==n&&(i+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function g(t,e,n,i){var o;"string"===typeof t?(o=function(t){var e=t||"/",n="",r="",i=e.indexOf("#");-1!==i&&(r=e.substr(i),e=e.substr(0,i));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===r?"":r}}(t)).state=e:(void 0===(o=Object(r.a)({},t)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==e&&void 0===o.state&&(o.state=e));try{o.pathname=decodeURI(o.pathname)}catch(u){throw u instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):u}return n&&(o.key=n),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=a(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function m(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&s(t.state,e.state)}function b(){var t=null;var e=[];return{setPrompt:function(e){return t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,r,i){if(null!=t){var o="function"===typeof t?t(e,n):t;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(t){var n=!0;function r(){n&&t.apply(void 0,arguments)}return e.push(r),function(){n=!1,e=e.filter((function(t){return t!==r}))}},notifyListeners:function(){for(var t=arguments.length,n=new Array(t),r=0;re?n.splice(e,n.length-e,i):n.push(i),l({action:r,location:i,index:e,entries:n})}}))},replace:function(t,e){var r="REPLACE",i=g(t,e,d(),_.location);f.confirmTransitionTo(i,r,n,(function(t){t&&(_.entries[_.index]=i,l({action:r,location:i}))}))},go:y,goBack:function(){y(-1)},goForward:function(){y(1)},canGo:function(t){var e=_.index+t;return e>=0&&e<_.entries.length},block:function(t){return void 0===t&&(t=!1),f.setPrompt(t)},listen:function(t){return f.appendListener(t)}};return _}},function(t,e){t.exports={bitcoin:{messagePrefix:"\x18Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},regtest:{messagePrefix:"\x18Bitcoin Signed Message:\n",bech32:"bcrt",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},testnet:{messagePrefix:"\x18Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239}}},function(t,e,n){"use strict";function r(t){return"[object String]"===Object.prototype.toString.call(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(103),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function s(t){return r.isMemo(t)?a:u[t.$$typeof]||i}u[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[r.Memo]=a;var c=Object.defineProperty,f=Object.getOwnPropertyNames,l=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,h=Object.getPrototypeOf,p=Object.prototype;t.exports=function t(e,n,r){if("string"!==typeof n){if(p){var i=h(n);i&&i!==p&&t(e,i,r)}var a=f(n);l&&(a=a.concat(l(n)));for(var u=s(e),g=s(n),m=0;m=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=Object(i.a)(t),l=f.getUTCDay(),d=(l=0)return"";switch(Object.prototype.toString.call(i)){case"[object Boolean]":return"object"===typeof i?"new Boolean ("+r(i.valueOf())+")":i.toString();case"[object Number]":return"object"===typeof i?"new Number ("+r(i.valueOf())+")":1/i===-1/0?"-0":i.toString(10);case"[object String]":return"object"===typeof i?"new String ("+r(i.valueOf())+")":JSON.stringify(i);case"[object Date]":return"new Date ("+r(isNaN(i.valueOf())?NaN:i.toISOString())+")";case"[object Error]":return"new "+i.name+" ("+r(i.message)+")";case"[object Arguments]":return"function () { return arguments; } ("+Array.prototype.map.call(i,r).join(", ")+")";case"[object Array]":e.push(i);try{return"["+i.map(r).concat(Object.keys(i).sort().filter((function(t){return!/^\d+$/.test(t)})).map(n(i))).join(", ")+"]"}finally{e.pop()}case"[object Object]":e.push(i);try{return!(t in i)||null!=i.constructor&&i.constructor.prototype===i?"{"+Object.keys(i).sort().map(n(i)).join(", ")+"}":i[t]()}finally{e.pop()}default:return String(i)}}return r}))},function(t,e,n){var r,i,o;!function(a){"use strict";"object"===typeof t.exports?t.exports=a(n(198)):null!=n(148)?(i=[n(198)],void 0===(o="function"===typeof(r=a)?r.apply(e,i):r)||(t.exports=o)):self.sanctuaryTypeClasses=a(self.sanctuaryTypeIdentifiers)}((function(t){"use strict";if("undefined"!==typeof __doctest){__doctest.require("sanctuary-identity");var e=__doctest.require("./test/List"),n=__doctest.require("sanctuary-maybe");__doctest.require("sanctuary-pair"),__doctest.require("./test/Sum"),e.Nil,e.Cons,n.Nothing,n.Just}function r(t){return function(e){return t.concat(e)}}function i(t){return function(e){return t}}function o(t,e){Object.keys(t).forEach(e,t)}function a(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function u(t){return t}function s(t){return function(e){return[t,e]}}function c(e,n){return typeof e===typeof n&&t(e)===t(n)}function f(t){return Object.keys(t).sort()}function l(t){return function(e){return t(e)}}function d(t){return{value:t,done:!1}}function h(t){return{value:t,done:!0}}function p(t,e,n,r){if(!(this instanceof p))return new p(t,e,n,r);this.name=t,this.url=e,this.test=function(t){return n.every((function(e){return e.test(t)}))&&r(t)}}p["@@type"]="sanctuary-type-classes/TypeClass@1";var g="Constructor",m="Value";function b(t,e,n){for(var r=n,i=0;ii)return!1;if(!X(this[r],t[r]))return tt(this[r],t[r])}},"fantasy-land/concat":Z,"fantasy-land/filter":function(t){var e={};return o(this,(function(n){t(this[n])&&(e[n]=this[n])})),e},"fantasy-land/map":function(t){var e={};return o(this,(function(n){e[n]=t(this[n])})),e},"fantasy-land/ap":function(t){var e={};return o(this,(function(n){a(n,t)&&(e[n]=t[n](this[n]))})),e},"fantasy-land/alt":Z,"fantasy-land/reduce":function(t,e){var n=this;return f(this).reduce((function(e,r){return t(e,n[r])}),e)},"fantasy-land/traverse":function(t,e){var n=this;return Object.keys(this).reduce((function(t,r){return ct((function(t){return function(e){var n={};return n[r]=e,Z.call(t,n)}}),t,e(n[r]))}),ft(t,{}))}}},Function:{"fantasy-land/id":function(){return u},"fantasy-land/of":function(t){return function(e){return t}},"fantasy-land/chainRec":function(t,e){return function(n){for(var r=d(e);!r.done;)r=t(d,h,r.value)(n);return r.value}},prototype:{"fantasy-land/equals":function(t){return t===this},"fantasy-land/compose":function(t){var e=this;return function(n){return t(e(n))}},"fantasy-land/map":function(t){var e=this;return function(n){return t(e(n))}},"fantasy-land/promap":function(t,e){var n=this;return function(r){return e(n(t(r)))}},"fantasy-land/ap":function(t){var e=this;return function(n){return t(n)(e(n))}},"fantasy-land/chain":function(t){var e=this;return function(n){return t(e(n))(n)}},"fantasy-land/extend":function(t){var e=this;return function(n){return t((function(t){return e(rt(n,t))}))}},"fantasy-land/contramap":function(t){var e=this;return function(n){return e(t(n))}}}}},X=function(){var t=[];return function(e,n){if(!c(e,n))return!1;if(t.some((function(t){return t[0]===e&&t[1]===n})))return!0;t.push([e,n]);try{return S.test(e)&&S.test(n)&&S.methods.equals(e)(n)}finally{t.pop()}}}();function J(t,e){return c(t,e)&&!tt(e,t)}var tt=function(){var t=[];return function(e,n){if(!c(e,n))return!1;if(t.some((function(t){return t[0]===e&&t[1]===n})))return X(e,n);t.push([e,n]);try{return O.test(e)&&O.test(n)&&O.methods.lte(e)(n)}finally{t.pop()}}}();function et(t,e){return tt(t,e)?t:e}function nt(t,e){return tt(t,e)?e:t}function rt(t,e){return M.methods.concat(t)(e)}function it(t){return T.methods.empty(t)()}function ot(t,e){return A.methods.filter(e)(t)}function at(t,e){return k.methods.map(e)(t)}function ut(t,e,n){return C.methods.bimap(n)(t,e)}function st(t,e){return P.methods.ap(e)(t)}function ct(t,e,n){return st(at(t,e),n)}function ft(t,e){return N.methods.of(t)(e)}function lt(t,e){return R.methods.chain(e)(t)}function dt(t,e,n){return U.methods.reduce(n)(t,e)}function ht(t,e){return Array.isArray(e)?e.some(l(t)):dt((function(e,n){return e||t(n)}),!1,e)}function pt(t,e){var n=dt((function(e,n){return e.push({idx:e.length,x:n,fx:t(n)}),e}),[],e),r=function(t){switch(typeof(t&&t.fx)){case"number":return function(t,e){return t<=e||t!==t};case"string":return function(t,e){return t<=e};default:return tt}}(n[0]);if(n.sort((function(t,e){return r(t.fx,e.fx)?r(e.fx,t.fx)?t.idx-e.idx:-1:1})),Array.isArray(e)){for(var i=0;i=t.length)&&56320===(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function u(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var n=[];if("string"===typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),i=0;i>6|192,n[r++]=63&a|128):o(t,i)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++i)),n[r++]=a>>18|240,n[r++]=a>>12&63|128,n[r++]=a>>6&63|128,n[r++]=63&a|128):(n[r++]=a>>12|224,n[r++]=a>>6&63|128,n[r++]=63&a|128)}else for(i=0;i>>0}return a},e.split32=function(t,e){for(var n=new Array(4*t.length),r=0,i=0;r>>24,n[i+1]=o>>>16&255,n[i+2]=o>>>8&255,n[i+3]=255&o):(n[i+3]=o>>>24,n[i+2]=o>>>16&255,n[i+1]=o>>>8&255,n[i]=255&o)}return n},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,n){return t+e+n>>>0},e.sum32_4=function(t,e,n,r){return t+e+n+r>>>0},e.sum32_5=function(t,e,n,r,i){return t+e+n+r+i>>>0},e.sum64=function(t,e,n,r){var i=t[e],o=r+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,n,r){return(e+r>>>0>>0},e.sum64_lo=function(t,e,n,r){return e+r>>>0},e.sum64_4_hi=function(t,e,n,r,i,o,a,u){var s=0,c=e;return s+=(c=c+r>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,n,r,i,o,a,u){return e+r+o+u>>>0},e.sum64_5_hi=function(t,e,n,r,i,o,a,u,s,c){var f=0,l=e;return f+=(l=l+r>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,n,r,i,o,a,u,s,c){return e+r+o+u+c>>>0},e.rotr64_hi=function(t,e,n){return(e<<32-n|t>>>n)>>>0},e.rotr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0},e.shr64_hi=function(t,e,n){return t>>>n},e.shr64_lo=function(t,e,n){return(t<<32-n|e>>>n)>>>0}},function(t,e,n){var r=n(77),i=Math.pow(2,31)-1;function o(t){return r.String(t)&&t.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}o.toJSON=function(){return"BIP32 derivation path"};var a=r.quacksLike("Point"),u=r.compile({messagePrefix:r.oneOf(r.Buffer,r.String),bip32:{public:r.UInt32,private:r.UInt32},pubKeyHash:r.UInt8,scriptHash:r.UInt8,wif:r.UInt8}),s={BIP32Path:o,Buffer256bit:r.BufferN(32),ECPoint:a,Hash160bit:r.BufferN(20),Hash256bit:r.BufferN(32),Network:u,Satoshi:function(t){return r.UInt53(t)&&t<=21e14},UInt31:function(t){return r.UInt32(t)&&t<=i}};for(var c in r)s[c]=r[c];t.exports=s},function(t,e,n){(function(e){var r=n(102),i=n(202),o=n(815),a=o.bech32,u=o.bech32m,s=n(816),c=n(829);function f(t,e){for(var n=0;n16)return console.log("Unsupported witness version for bech32m"),!1;var o=u.fromWords(r.words.slice(1));if(o.length<2||o.length>40)return console.log("Invalid bech32m address length: ".concat(o.length)),!1;return"main"===t&&r.prefix===n.mainNetPrefix||"test"===t&&r.prefix===n.testNetPrefix},bech32Validator:l,isBech32Address:function(t,e){return l("main",t,e)||l("test",t,e)},zecBech32Validator:function(t,e,n){var r;try{r=a.decode(e)}catch(o){return console.log("Failed to decode bech32 address"),!1}var i=a.fromWords(r.words);if(43!==i.length)return console.log("Invalid bech32 address length: ".concat(i.length)),!1;return"main"===t&&r.prefix===n.mainNetPrefix||"test"===t&&r.prefix===n.testNetPrefix},xmrValidator:function(t,n,i){try{var o=c.decode(n),a=o.slice(-8),u=(d=function(t){if(t.length%2!==0)return null;for(var e=new Uint8Array(t.length/2),n=0;n>18&63)+f.charAt(i>>12&63)+f.charAt(i>>6&63)+f.charAt(63&i);return 2==o?(e=t.charCodeAt(u)<<8,n=t.charCodeAt(++u),a+=f.charAt((i=e+n)>>10)+f.charAt(i>>4&63)+f.charAt(i<<2&63)+"="):1==o&&(i=t.charCodeAt(u),a+=f.charAt(i>>2)+f.charAt(i<<4&63)+"=="),a},decode:function(t){var e=(t=String(t).replace(l,"")).length;e%4==0&&(e=(t=t.replace(/==?$/,"")).length),(e%4==1||/[^+a-zA-Z0-9/]/.test(t))&&c("Invalid character: the string to be decoded is not correctly encoded.");for(var n,r,i=0,o="",a=-1;++a>(-2*i&6)));return o},version:"1.0.0"};void 0===(i=function(){return d}.call(e,n,e,t))||(t.exports=i)}()}).call(this,n(94)(t),n(59))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(25),i=n(22);function o(t){Object(i.a)(1,arguments);var e=1,n=Object(r.a)(t),o=n.getUTCDay(),a=(o=0&&s===u&&c())}var M=n(196),T=n.n(M),$=(n(13),function(){function t(e){var n=e.cellCount,r=e.cellSizeGetter,o=e.estimatedCellSize;i()(this,t),m()(this,"_cellSizeAndPositionData",{}),m()(this,"_lastMeasuredIndex",-1),m()(this,"_lastBatchedIndex",-1),m()(this,"_cellCount",void 0),m()(this,"_cellSizeGetter",void 0),m()(this,"_estimatedCellSize",void 0),this._cellSizeGetter=r,this._cellCount=n,this._estimatedCellSize=o}return a()(t,[{key:"areOffsetsAdjusted",value:function(){return!1}},{key:"configure",value:function(t){var e=t.cellCount,n=t.estimatedCellSize,r=t.cellSizeGetter;this._cellCount=e,this._estimatedCellSize=n,this._cellSizeGetter=r}},{key:"getCellCount",value:function(){return this._cellCount}},{key:"getEstimatedCellSize",value:function(){return this._estimatedCellSize}},{key:"getLastMeasuredIndex",value:function(){return this._lastMeasuredIndex}},{key:"getOffsetAdjustment",value:function(){return 0}},{key:"getSizeAndPositionOfCell",value:function(t){if(t<0||t>=this._cellCount)throw Error("Requested index ".concat(t," is outside of range 0..").concat(this._cellCount));if(t>this._lastMeasuredIndex)for(var e=this.getSizeAndPositionOfLastMeasuredCell(),n=e.offset+e.size,r=this._lastMeasuredIndex+1;r<=t;r++){var i=this._cellSizeGetter({index:r});if(void 0===i||isNaN(i))throw Error("Invalid size returned for cell ".concat(r," of value ").concat(i));null===i?(this._cellSizeAndPositionData[r]={offset:n,size:0},this._lastBatchedIndex=t):(this._cellSizeAndPositionData[r]={offset:n,size:i},n+=i,this._lastMeasuredIndex=t)}return this._cellSizeAndPositionData[t]}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._lastMeasuredIndex>=0?this._cellSizeAndPositionData[this._lastMeasuredIndex]:{offset:0,size:0}}},{key:"getTotalSize",value:function(){var t=this.getSizeAndPositionOfLastMeasuredCell();return t.offset+t.size+(this._cellCount-this._lastMeasuredIndex-1)*this._estimatedCellSize}},{key:"getUpdatedOffsetForIndex",value:function(t){var e=t.align,n=void 0===e?"auto":e,r=t.containerSize,i=t.currentOffset,o=t.targetIndex;if(r<=0)return 0;var a,u=this.getSizeAndPositionOfCell(o),s=u.offset,c=s-r+u.size;switch(n){case"start":a=s;break;case"end":a=c;break;case"center":a=s-(r-u.size)/2;break;default:a=Math.max(c,Math.min(s,i))}var f=this.getTotalSize();return Math.max(0,Math.min(f-r,a))}},{key:"getVisibleCellRange",value:function(t){var e=t.containerSize,n=t.offset;if(0===this.getTotalSize())return{};var r=n+e,i=this._findNearestCell(n),o=this.getSizeAndPositionOfCell(i);n=o.offset+o.size;for(var a=i;nn&&(t=r-1)}return e>0?e-1:0}},{key:"_exponentialSearch",value:function(t,e){for(var n=1;t=t?this._binarySearch(n,0,t):this._exponentialSearch(n,t)}}]),t}()),A=function(){return"undefined"!==typeof window&&window.chrome?16777100:15e5},k=function(){function t(e){var n=e.maxScrollSize,r=void 0===n?A():n,o=T()(e,["maxScrollSize"]);i()(this,t),m()(this,"_cellSizeAndPositionManager",void 0),m()(this,"_maxScrollSize",void 0),this._cellSizeAndPositionManager=new $(o),this._maxScrollSize=r}return a()(t,[{key:"areOffsetsAdjusted",value:function(){return this._cellSizeAndPositionManager.getTotalSize()>this._maxScrollSize}},{key:"configure",value:function(t){this._cellSizeAndPositionManager.configure(t)}},{key:"getCellCount",value:function(){return this._cellSizeAndPositionManager.getCellCount()}},{key:"getEstimatedCellSize",value:function(){return this._cellSizeAndPositionManager.getEstimatedCellSize()}},{key:"getLastMeasuredIndex",value:function(){return this._cellSizeAndPositionManager.getLastMeasuredIndex()}},{key:"getOffsetAdjustment",value:function(t){var e=t.containerSize,n=t.offset,r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize(),o=this._getOffsetPercentage({containerSize:e,offset:n,totalSize:i});return Math.round(o*(i-r))}},{key:"getSizeAndPositionOfCell",value:function(t){return this._cellSizeAndPositionManager.getSizeAndPositionOfCell(t)}},{key:"getSizeAndPositionOfLastMeasuredCell",value:function(){return this._cellSizeAndPositionManager.getSizeAndPositionOfLastMeasuredCell()}},{key:"getTotalSize",value:function(){return Math.min(this._maxScrollSize,this._cellSizeAndPositionManager.getTotalSize())}},{key:"getUpdatedOffsetForIndex",value:function(t){var e=t.align,n=void 0===e?"auto":e,r=t.containerSize,i=t.currentOffset,o=t.targetIndex;i=this._safeOffsetToOffset({containerSize:r,offset:i});var a=this._cellSizeAndPositionManager.getUpdatedOffsetForIndex({align:n,containerSize:r,currentOffset:i,targetIndex:o});return this._offsetToSafeOffset({containerSize:r,offset:a})}},{key:"getVisibleCellRange",value:function(t){var e=t.containerSize,n=t.offset;return n=this._safeOffsetToOffset({containerSize:e,offset:n}),this._cellSizeAndPositionManager.getVisibleCellRange({containerSize:e,offset:n})}},{key:"resetCell",value:function(t){this._cellSizeAndPositionManager.resetCell(t)}},{key:"_getOffsetPercentage",value:function(t){var e=t.containerSize,n=t.offset,r=t.totalSize;return r<=e?0:n/(r-e)}},{key:"_offsetToSafeOffset",value:function(t){var e=t.containerSize,n=t.offset,r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(r===i)return n;var o=this._getOffsetPercentage({containerSize:e,offset:n,totalSize:r});return Math.round(o*(i-e))}},{key:"_safeOffsetToOffset",value:function(t){var e=t.containerSize,n=t.offset,r=this._cellSizeAndPositionManager.getTotalSize(),i=this.getTotalSize();if(r===i)return n;var o=this._getOffsetPercentage({containerSize:e,offset:n,totalSize:i});return Math.round(o*(r-e))}}]),t}();function C(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e={};return function(n){var r=n.callback,i=n.indices,o=Object.keys(i),a=!t||o.every((function(t){var e=i[t];return Array.isArray(e)?e.length>0:e>=0})),u=o.length!==Object.keys(e).length||o.some((function(t){var n=e[t],r=i[t];return Array.isArray(r)?n.join(",")!==r.join(","):n!==r}));e=i,a&&u&&r(i)}}function I(t){var e=t.cellSize,n=t.cellSizeAndPositionManager,r=t.previousCellsCount,i=t.previousCellSize,o=t.previousScrollToAlignment,a=t.previousScrollToIndex,u=t.previousSize,s=t.scrollOffset,c=t.scrollToAlignment,f=t.scrollToIndex,l=t.size,d=t.sizeJustIncreasedFromZero,h=t.updateScrollIndexCallback,p=n.getCellCount(),g=f>=0&&f0&&(ln.getTotalSize()-l&&h(p-1)}var P,N,R=!("undefined"===typeof window||!window.document||!window.document.createElement);function j(t){if((!P&&0!==P||t)&&R){var e=document.createElement("div");e.style.position="absolute",e.style.top="-9999px",e.style.width="50px",e.style.height="50px",e.style.overflow="scroll",document.body.appendChild(e),P=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return P}var D,L,F=(N="undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).requestAnimationFrame||N.webkitRequestAnimationFrame||N.mozRequestAnimationFrame||N.oRequestAnimationFrame||N.msRequestAnimationFrame||function(t){return N.setTimeout(t,1e3/60)},B=N.cancelAnimationFrame||N.webkitCancelAnimationFrame||N.mozCancelAnimationFrame||N.oCancelAnimationFrame||N.msCancelAnimationFrame||function(t){N.clearTimeout(t)},U=F,z=B,H=function(t){return z(t.id)},V=function(t,e){var n;Promise.resolve().then((function(){n=Date.now()}));var r={id:U((function i(){Date.now()-n>=e?t.call():r.id=U(i)}))};return r};function q(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function W(t){for(var e=1;e0&&(n._initialScrollTop=n._getCalculatedScrollTop(t,n.state)),t.scrollToColumn>0&&(n._initialScrollLeft=n._getCalculatedScrollLeft(t,n.state)),n}return p()(e,t),a()(e,[{key:"getOffsetForCell",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.alignment,n=void 0===e?this.props.scrollToAlignment:e,r=t.columnIndex,i=void 0===r?this.props.scrollToColumn:r,o=t.rowIndex,a=void 0===o?this.props.scrollToRow:o,u=W({},this.props,{scrollToAlignment:n,scrollToColumn:i,scrollToRow:a});return{scrollLeft:this._getCalculatedScrollLeft(u),scrollTop:this._getCalculatedScrollTop(u)}}},{key:"getTotalRowsHeight",value:function(){return this.state.instanceProps.rowSizeAndPositionManager.getTotalSize()}},{key:"getTotalColumnsWidth",value:function(){return this.state.instanceProps.columnSizeAndPositionManager.getTotalSize()}},{key:"handleScrollEvent",value:function(t){var e=t.scrollLeft,n=void 0===e?0:e,r=t.scrollTop,i=void 0===r?0:r;if(!(i<0)){this._debounceScrollEnded();var o=this.props,a=o.autoHeight,u=o.autoWidth,s=o.height,c=o.width,f=this.state.instanceProps,l=f.scrollbarSize,d=f.rowSizeAndPositionManager.getTotalSize(),h=f.columnSizeAndPositionManager.getTotalSize(),p=Math.min(Math.max(0,h-c+l),n),g=Math.min(Math.max(0,d-s+l),i);if(this.state.scrollLeft!==p||this.state.scrollTop!==g){var m={isScrolling:!0,scrollDirectionHorizontal:p!==this.state.scrollLeft?p>this.state.scrollLeft?1:-1:this.state.scrollDirectionHorizontal,scrollDirectionVertical:g!==this.state.scrollTop?g>this.state.scrollTop?1:-1:this.state.scrollDirectionVertical,scrollPositionChangeReason:G};a||(m.scrollTop=g),u||(m.scrollLeft=p),m.needToResetStyleCache=!1,this.setState(m)}this._invokeOnScrollMemoizer({scrollLeft:p,scrollTop:g,totalColumnsWidth:h,totalRowsHeight:d})}}},{key:"invalidateCellSizeAfterRender",value:function(t){var e=t.columnIndex,n=t.rowIndex;this._deferredInvalidateColumnIndex="number"===typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,e):e,this._deferredInvalidateRowIndex="number"===typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,n):n}},{key:"measureAllCells",value:function(){var t=this.props,e=t.columnCount,n=t.rowCount,r=this.state.instanceProps;r.columnSizeAndPositionManager.getSizeAndPositionOfCell(e-1),r.rowSizeAndPositionManager.getSizeAndPositionOfCell(n-1)}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r,o=this.props,a=o.scrollToColumn,u=o.scrollToRow,s=this.state.instanceProps;s.columnSizeAndPositionManager.resetCell(n),s.rowSizeAndPositionManager.resetCell(i),this._recomputeScrollLeftFlag=a>=0&&(1===this.state.scrollDirectionHorizontal?n<=a:n>=a),this._recomputeScrollTopFlag=u>=0&&(1===this.state.scrollDirectionVertical?i<=u:i>=u),this._styleCache={},this._cellCache={},this.forceUpdate()}},{key:"scrollToCell",value:function(t){var e=t.columnIndex,n=t.rowIndex,r=this.props.columnCount,i=this.props;r>1&&void 0!==e&&this._updateScrollLeftForScrollToColumn(W({},i,{scrollToColumn:e})),void 0!==n&&this._updateScrollTopForScrollToRow(W({},i,{scrollToRow:n}))}},{key:"componentDidMount",value:function(){var t=this.props,n=t.getScrollbarSize,r=t.height,i=t.scrollLeft,o=t.scrollToColumn,a=t.scrollTop,u=t.scrollToRow,s=t.width,c=this.state.instanceProps;if(this._initialScrollTop=0,this._initialScrollLeft=0,this._handleInvalidatedGridSize(),c.scrollbarSizeMeasured||this.setState((function(t){var e=W({},t,{needToResetStyleCache:!1});return e.instanceProps.scrollbarSize=n(),e.instanceProps.scrollbarSizeMeasured=!0,e})),"number"===typeof i&&i>=0||"number"===typeof a&&a>=0){var f=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:i,scrollTop:a});f&&(f.needToResetStyleCache=!1,this.setState(f))}this._scrollingContainer&&(this._scrollingContainer.scrollLeft!==this.state.scrollLeft&&(this._scrollingContainer.scrollLeft=this.state.scrollLeft),this._scrollingContainer.scrollTop!==this.state.scrollTop&&(this._scrollingContainer.scrollTop=this.state.scrollTop));var l=r>0&&s>0;o>=0&&l&&this._updateScrollLeftForScrollToColumn(),u>=0&&l&&this._updateScrollTopForScrollToRow(),this._invokeOnGridRenderedHelper(),this._invokeOnScrollMemoizer({scrollLeft:i||0,scrollTop:a||0,totalColumnsWidth:c.columnSizeAndPositionManager.getTotalSize(),totalRowsHeight:c.rowSizeAndPositionManager.getTotalSize()}),this._maybeCallOnScrollbarPresenceChange()}},{key:"componentDidUpdate",value:function(t,e){var n=this,r=this.props,i=r.autoHeight,o=r.autoWidth,a=r.columnCount,u=r.height,s=r.rowCount,c=r.scrollToAlignment,f=r.scrollToColumn,l=r.scrollToRow,d=r.width,h=this.state,p=h.scrollLeft,g=h.scrollPositionChangeReason,m=h.scrollTop,b=h.instanceProps;this._handleInvalidatedGridSize();var v=a>0&&0===t.columnCount||s>0&&0===t.rowCount;g===K&&(!o&&p>=0&&(p!==this._scrollingContainer.scrollLeft||v)&&(this._scrollingContainer.scrollLeft=p),!i&&m>=0&&(m!==this._scrollingContainer.scrollTop||v)&&(this._scrollingContainer.scrollTop=m));var y=(0===t.width||0===t.height)&&u>0&&d>0;if(this._recomputeScrollLeftFlag?(this._recomputeScrollLeftFlag=!1,this._updateScrollLeftForScrollToColumn(this.props)):I({cellSizeAndPositionManager:b.columnSizeAndPositionManager,previousCellsCount:t.columnCount,previousCellSize:t.columnWidth,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToColumn,previousSize:t.width,scrollOffset:p,scrollToAlignment:c,scrollToIndex:f,size:d,sizeJustIncreasedFromZero:y,updateScrollIndexCallback:function(){return n._updateScrollLeftForScrollToColumn(n.props)}}),this._recomputeScrollTopFlag?(this._recomputeScrollTopFlag=!1,this._updateScrollTopForScrollToRow(this.props)):I({cellSizeAndPositionManager:b.rowSizeAndPositionManager,previousCellsCount:t.rowCount,previousCellSize:t.rowHeight,previousScrollToAlignment:t.scrollToAlignment,previousScrollToIndex:t.scrollToRow,previousSize:t.height,scrollOffset:m,scrollToAlignment:c,scrollToIndex:l,size:u,sizeJustIncreasedFromZero:y,updateScrollIndexCallback:function(){return n._updateScrollTopForScrollToRow(n.props)}}),this._invokeOnGridRenderedHelper(),p!==e.scrollLeft||m!==e.scrollTop){var _=b.rowSizeAndPositionManager.getTotalSize(),w=b.columnSizeAndPositionManager.getTotalSize();this._invokeOnScrollMemoizer({scrollLeft:p,scrollTop:m,totalColumnsWidth:w,totalRowsHeight:_})}this._maybeCallOnScrollbarPresenceChange()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&H(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var t=this.props,e=t.autoContainerWidth,n=t.autoHeight,r=t.autoWidth,i=t.className,o=t.containerProps,a=t.containerRole,u=t.containerStyle,s=t.height,c=t.id,f=t.noContentRenderer,l=t.role,d=t.style,h=t.tabIndex,p=t.width,g=this.state,m=g.instanceProps,v=g.needToResetStyleCache,y=this._isScrolling(),_={boxSizing:"border-box",direction:"ltr",height:n?"auto":s,position:"relative",width:r?"auto":p,WebkitOverflowScrolling:"touch",willChange:"transform"};v&&(this._styleCache={}),this.state.isScrolling||this._resetStyleCache(),this._calculateChildrenToRender(this.props,this.state);var w=m.columnSizeAndPositionManager.getTotalSize(),S=m.rowSizeAndPositionManager.getTotalSize(),E=S>s?m.scrollbarSize:0,M=w>p?m.scrollbarSize:0;M===this._horizontalScrollBarSize&&E===this._verticalScrollBarSize||(this._horizontalScrollBarSize=M,this._verticalScrollBarSize=E,this._scrollbarPresenceChanged=!0),_.overflowX=w+E<=p?"hidden":"auto",_.overflowY=S+M<=s?"hidden":"auto";var T=this._childrenToDisplay,$=0===T.length&&s>0&&p>0;return b.createElement("div",O()({ref:this._setScrollingContainerRef},o,{"aria-label":this.props["aria-label"],"aria-readonly":this.props["aria-readonly"],className:Object(x.a)("ReactVirtualized__Grid",i),id:c,onScroll:this._onScroll,role:l,style:W({},_,{},d),tabIndex:h}),T.length>0&&b.createElement("div",{className:"ReactVirtualized__Grid__innerScrollContainer",role:a,style:W({width:e?"auto":w,height:S,maxWidth:w,maxHeight:S,overflow:"hidden",pointerEvents:y?"none":"",position:"relative"},u)},T),$&&f())}},{key:"_calculateChildrenToRender",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,n=t.cellRenderer,r=t.cellRangeRenderer,i=t.columnCount,o=t.deferredMeasurementCache,a=t.height,u=t.overscanColumnCount,s=t.overscanIndicesGetter,c=t.overscanRowCount,f=t.rowCount,l=t.width,d=t.isScrollingOptOut,h=e.scrollDirectionHorizontal,p=e.scrollDirectionVertical,g=e.instanceProps,m=this._initialScrollTop>0?this._initialScrollTop:e.scrollTop,b=this._initialScrollLeft>0?this._initialScrollLeft:e.scrollLeft,v=this._isScrolling(t,e);if(this._childrenToDisplay=[],a>0&&l>0){var y=g.columnSizeAndPositionManager.getVisibleCellRange({containerSize:l,offset:b}),_=g.rowSizeAndPositionManager.getVisibleCellRange({containerSize:a,offset:m}),w=g.columnSizeAndPositionManager.getOffsetAdjustment({containerSize:l,offset:b}),S=g.rowSizeAndPositionManager.getOffsetAdjustment({containerSize:a,offset:m});this._renderedColumnStartIndex=y.start,this._renderedColumnStopIndex=y.stop,this._renderedRowStartIndex=_.start,this._renderedRowStopIndex=_.stop;var O=s({direction:"horizontal",cellCount:i,overscanCellsCount:u,scrollDirection:h,startIndex:"number"===typeof y.start?y.start:0,stopIndex:"number"===typeof y.stop?y.stop:-1}),x=s({direction:"vertical",cellCount:f,overscanCellsCount:c,scrollDirection:p,startIndex:"number"===typeof _.start?_.start:0,stopIndex:"number"===typeof _.stop?_.stop:-1}),E=O.overscanStartIndex,M=O.overscanStopIndex,T=x.overscanStartIndex,$=x.overscanStopIndex;if(o){if(!o.hasFixedHeight())for(var A=T;A<=$;A++)if(!o.has(A,0)){E=0,M=i-1;break}if(!o.hasFixedWidth())for(var k=E;k<=M;k++)if(!o.has(0,k)){T=0,$=f-1;break}}this._childrenToDisplay=r({cellCache:this._cellCache,cellRenderer:n,columnSizeAndPositionManager:g.columnSizeAndPositionManager,columnStartIndex:E,columnStopIndex:M,deferredMeasurementCache:o,horizontalOffsetAdjustment:w,isScrolling:v,isScrollingOptOut:d,parent:this,rowSizeAndPositionManager:g.rowSizeAndPositionManager,rowStartIndex:T,rowStopIndex:$,scrollLeft:b,scrollTop:m,styleCache:this._styleCache,verticalOffsetAdjustment:S,visibleColumnIndices:y,visibleRowIndices:_}),this._columnStartIndex=E,this._columnStopIndex=M,this._rowStartIndex=T,this._rowStopIndex=$}}},{key:"_debounceScrollEnded",value:function(){var t=this.props.scrollingResetTimeInterval;this._disablePointerEventsTimeoutId&&H(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=V(this._debounceScrollEndedCallback,t)}},{key:"_handleInvalidatedGridSize",value:function(){if("number"===typeof this._deferredInvalidateColumnIndex&&"number"===typeof this._deferredInvalidateRowIndex){var t=this._deferredInvalidateColumnIndex,e=this._deferredInvalidateRowIndex;this._deferredInvalidateColumnIndex=null,this._deferredInvalidateRowIndex=null,this.recomputeGridSize({columnIndex:t,rowIndex:e})}}},{key:"_invokeOnScrollMemoizer",value:function(t){var e=this,n=t.scrollLeft,r=t.scrollTop,i=t.totalColumnsWidth,o=t.totalRowsHeight;this._onScrollMemoizer({callback:function(t){var n=t.scrollLeft,r=t.scrollTop,a=e.props,u=a.height;(0,a.onScroll)({clientHeight:u,clientWidth:a.width,scrollHeight:o,scrollLeft:n,scrollTop:r,scrollWidth:i})},indices:{scrollLeft:n,scrollTop:r}})}},{key:"_isScrolling",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return Object.hasOwnProperty.call(t,"isScrolling")?Boolean(t.isScrolling):Boolean(e.isScrolling)}},{key:"_maybeCallOnScrollbarPresenceChange",value:function(){if(this._scrollbarPresenceChanged){var t=this.props.onScrollbarPresenceChange;this._scrollbarPresenceChanged=!1,t({horizontal:this._horizontalScrollBarSize>0,size:this.state.instanceProps.scrollbarSize,vertical:this._verticalScrollBarSize>0})}}},{key:"scrollToPosition",value:function(t){var n=t.scrollLeft,r=t.scrollTop,i=e._getScrollToPositionStateUpdate({prevState:this.state,scrollLeft:n,scrollTop:r});i&&(i.needToResetStyleCache=!1,this.setState(i))}},{key:"_getCalculatedScrollLeft",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollLeft(t,n)}},{key:"_updateScrollLeftForScrollToColumn",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=e._getScrollLeftForScrollToColumnStateUpdate(t,n);r&&(r.needToResetStyleCache=!1,this.setState(r))}},{key:"_getCalculatedScrollTop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state;return e._getCalculatedScrollTop(t,n)}},{key:"_resetStyleCache",value:function(){var t=this._styleCache,e=this._cellCache,n=this.props.isScrollingOptOut;this._cellCache={},this._styleCache={};for(var r=this._rowStartIndex;r<=this._rowStopIndex;r++)for(var i=this._columnStartIndex;i<=this._columnStopIndex;i++){var o="".concat(r,"-").concat(i);this._styleCache[o]=t[o],n&&(this._cellCache[o]=e[o])}}},{key:"_updateScrollTopForScrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.props,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.state,r=e._getScrollTopForScrollToRowStateUpdate(t,n);r&&(r.needToResetStyleCache=!1,this.setState(r))}}],[{key:"getDerivedStateFromProps",value:function(t,n){var r={};0===t.columnCount&&0!==n.scrollLeft||0===t.rowCount&&0!==n.scrollTop?(r.scrollLeft=0,r.scrollTop=0):(t.scrollLeft!==n.scrollLeft&&t.scrollToColumn<0||t.scrollTop!==n.scrollTop&&t.scrollToRow<0)&&Object.assign(r,e._getScrollToPositionStateUpdate({prevState:n,scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}));var i,o,a=n.instanceProps;return r.needToResetStyleCache=!1,t.columnWidth===a.prevColumnWidth&&t.rowHeight===a.prevRowHeight||(r.needToResetStyleCache=!0),a.columnSizeAndPositionManager.configure({cellCount:t.columnCount,estimatedCellSize:e._getEstimatedColumnSize(t),cellSizeGetter:e._wrapSizeGetter(t.columnWidth)}),a.rowSizeAndPositionManager.configure({cellCount:t.rowCount,estimatedCellSize:e._getEstimatedRowSize(t),cellSizeGetter:e._wrapSizeGetter(t.rowHeight)}),0!==a.prevColumnCount&&0!==a.prevRowCount||(a.prevColumnCount=0,a.prevRowCount=0),t.autoHeight&&!1===t.isScrolling&&!0===a.prevIsScrolling&&Object.assign(r,{isScrolling:!1}),E({cellCount:a.prevColumnCount,cellSize:"number"===typeof a.prevColumnWidth?a.prevColumnWidth:null,computeMetadataCallback:function(){return a.columnSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.columnCount,nextCellSize:"number"===typeof t.columnWidth?t.columnWidth:null,nextScrollToIndex:t.scrollToColumn,scrollToIndex:a.prevScrollToColumn,updateScrollOffsetForScrollToIndex:function(){i=e._getScrollLeftForScrollToColumnStateUpdate(t,n)}}),E({cellCount:a.prevRowCount,cellSize:"number"===typeof a.prevRowHeight?a.prevRowHeight:null,computeMetadataCallback:function(){return a.rowSizeAndPositionManager.resetCell(0)},computeMetadataCallbackProps:t,nextCellsCount:t.rowCount,nextCellSize:"number"===typeof t.rowHeight?t.rowHeight:null,nextScrollToIndex:t.scrollToRow,scrollToIndex:a.prevScrollToRow,updateScrollOffsetForScrollToIndex:function(){o=e._getScrollTopForScrollToRowStateUpdate(t,n)}}),a.prevColumnCount=t.columnCount,a.prevColumnWidth=t.columnWidth,a.prevIsScrolling=!0===t.isScrolling,a.prevRowCount=t.rowCount,a.prevRowHeight=t.rowHeight,a.prevScrollToColumn=t.scrollToColumn,a.prevScrollToRow=t.scrollToRow,a.scrollbarSize=t.getScrollbarSize(),void 0===a.scrollbarSize?(a.scrollbarSizeMeasured=!1,a.scrollbarSize=0):a.scrollbarSizeMeasured=!0,r.instanceProps=a,W({},r,{},i,{},o)}},{key:"_getEstimatedColumnSize",value:function(t){return"number"===typeof t.columnWidth?t.columnWidth:t.estimatedColumnSize}},{key:"_getEstimatedRowSize",value:function(t){return"number"===typeof t.rowHeight?t.rowHeight:t.estimatedRowSize}},{key:"_getScrollToPositionStateUpdate",value:function(t){var e=t.prevState,n=t.scrollLeft,r=t.scrollTop,i={scrollPositionChangeReason:K};return"number"===typeof n&&n>=0&&(i.scrollDirectionHorizontal=n>e.scrollLeft?1:-1,i.scrollLeft=n),"number"===typeof r&&r>=0&&(i.scrollDirectionVertical=r>e.scrollTop?1:-1,i.scrollTop=r),"number"===typeof n&&n>=0&&n!==e.scrollLeft||"number"===typeof r&&r>=0&&r!==e.scrollTop?i:{}}},{key:"_wrapSizeGetter",value:function(t){return"function"===typeof t?t:function(){return t}}},{key:"_getCalculatedScrollLeft",value:function(t,e){var n=t.columnCount,r=t.height,i=t.scrollToAlignment,o=t.scrollToColumn,a=t.width,u=e.scrollLeft,s=e.instanceProps;if(n>0){var c=n-1,f=o<0?c:Math.min(c,o),l=s.rowSizeAndPositionManager.getTotalSize(),d=s.scrollbarSizeMeasured&&l>r?s.scrollbarSize:0;return s.columnSizeAndPositionManager.getUpdatedOffsetForIndex({align:i,containerSize:a-d,currentOffset:u,targetIndex:f})}return 0}},{key:"_getScrollLeftForScrollToColumnStateUpdate",value:function(t,n){var r=n.scrollLeft,i=e._getCalculatedScrollLeft(t,n);return"number"===typeof i&&i>=0&&r!==i?e._getScrollToPositionStateUpdate({prevState:n,scrollLeft:i,scrollTop:-1}):{}}},{key:"_getCalculatedScrollTop",value:function(t,e){var n=t.height,r=t.rowCount,i=t.scrollToAlignment,o=t.scrollToRow,a=t.width,u=e.scrollTop,s=e.instanceProps;if(r>0){var c=r-1,f=o<0?c:Math.min(c,o),l=s.columnSizeAndPositionManager.getTotalSize(),d=s.scrollbarSizeMeasured&&l>a?s.scrollbarSize:0;return s.rowSizeAndPositionManager.getUpdatedOffsetForIndex({align:i,containerSize:n-d,currentOffset:u,targetIndex:f})}return 0}},{key:"_getScrollTopForScrollToRowStateUpdate",value:function(t,n){var r=n.scrollTop,i=e._getCalculatedScrollTop(t,n);return"number"===typeof i&&i>=0&&r!==i?e._getScrollToPositionStateUpdate({prevState:n,scrollLeft:-1,scrollTop:i}):{}}}]),e}(b.PureComponent),m()(D,"propTypes",null),L);m()(Y,"defaultProps",{"aria-label":"grid","aria-readonly":!0,autoContainerWidth:!1,autoHeight:!1,autoWidth:!1,cellRangeRenderer:function(t){for(var e=t.cellCache,n=t.cellRenderer,r=t.columnSizeAndPositionManager,i=t.columnStartIndex,o=t.columnStopIndex,a=t.deferredMeasurementCache,u=t.horizontalOffsetAdjustment,s=t.isScrolling,c=t.isScrollingOptOut,f=t.parent,l=t.rowSizeAndPositionManager,d=t.rowStartIndex,h=t.rowStopIndex,p=t.styleCache,g=t.verticalOffsetAdjustment,m=t.visibleColumnIndices,b=t.visibleRowIndices,v=[],y=r.areOffsetsAdjusted()||l.areOffsetsAdjusted(),_=!s&&!y,w=d;w<=h;w++)for(var S=l.getSizeAndPositionOfCell(w),O=i;O<=o;O++){var x=r.getSizeAndPositionOfCell(O),E=O>=m.start&&O<=m.stop&&w>=b.start&&w<=b.stop,M="".concat(w,"-").concat(O),T=void 0;_&&p[M]?T=p[M]:a&&!a.has(w,O)?T={height:"auto",left:0,position:"absolute",top:0,width:"auto"}:(T={height:S.size,left:x.offset+u,position:"absolute",top:S.offset+g,width:x.size},p[M]=T);var $={columnIndex:O,isScrolling:s,isVisible:E,key:M,parent:f,rowIndex:w,style:T},A=void 0;!c&&!s||u||g?A=n($):(e[M]||(e[M]=n($)),A=e[M]),null!=A&&!1!==A&&v.push(A)}return v},containerRole:"rowgroup",containerStyle:{},estimatedColumnSize:100,estimatedRowSize:30,getScrollbarSize:j,noContentRenderer:function(){return null},onScroll:function(){},onScrollbarPresenceChange:function(){},onSectionRendered:function(){},overscanColumnCount:0,overscanIndicesGetter:function(t){var e=t.cellCount,n=t.overscanCellsCount,r=t.scrollDirection,i=t.startIndex,o=t.stopIndex;return 1===r?{overscanStartIndex:Math.max(0,i),overscanStopIndex:Math.min(e-1,o+n)}:{overscanStartIndex:Math.max(0,i-n),overscanStopIndex:Math.min(e-1,o)}},overscanRowCount:10,role:"grid",scrollingResetTimeInterval:150,scrollToAlignment:"auto",scrollToColumn:-1,scrollToRow:-1,style:{},tabIndex:0,isScrollingOptOut:!1}),w(Y);var Z=Y;function Q(t){var e=t.cellCount,n=t.overscanCellsCount,r=t.scrollDirection,i=t.startIndex,o=t.stopIndex;return n=Math.max(1,n),1===r?{overscanStartIndex:Math.max(0,i-1),overscanStopIndex:Math.min(e-1,o+n)}:{overscanStartIndex:Math.max(0,i-n),overscanStopIndex:Math.min(e-1,o+1)}}var X,J;function tt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}var et=(J=X=function(t){function e(){var t,n;i()(this,e);for(var r=arguments.length,o=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),m()(this,"_cellHeightCache",{}),m()(this,"_cellWidthCache",{}),m()(this,"_columnWidthCache",{}),m()(this,"_rowHeightCache",{}),m()(this,"_defaultHeight",void 0),m()(this,"_defaultWidth",void 0),m()(this,"_minHeight",void 0),m()(this,"_minWidth",void 0),m()(this,"_keyMapper",void 0),m()(this,"_hasFixedHeight",void 0),m()(this,"_hasFixedWidth",void 0),m()(this,"_columnCount",0),m()(this,"_rowCount",0),m()(this,"columnWidth",(function(t){var n=t.index,r=e._keyMapper(0,n);return void 0!==e._columnWidthCache[r]?e._columnWidthCache[r]:e._defaultWidth})),m()(this,"rowHeight",(function(t){var n=t.index,r=e._keyMapper(n,0);return void 0!==e._rowHeightCache[r]?e._rowHeightCache[r]:e._defaultHeight}));var r=n.defaultHeight,o=n.defaultWidth,a=n.fixedHeight,u=n.fixedWidth,s=n.keyMapper,c=n.minHeight,f=n.minWidth;this._hasFixedHeight=!0===a,this._hasFixedWidth=!0===u,this._minHeight=c||0,this._minWidth=f||0,this._keyMapper=s||ht,this._defaultHeight=Math.max(this._minHeight,"number"===typeof r?r:30),this._defaultWidth=Math.max(this._minWidth,"number"===typeof o?o:100)}return a()(t,[{key:"clear",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this._keyMapper(t,e);delete this._cellHeightCache[n],delete this._cellWidthCache[n],this._updateCachedColumnAndRowSizes(t,e)}},{key:"clearAll",value:function(){this._cellHeightCache={},this._cellWidthCache={},this._columnWidthCache={},this._rowHeightCache={},this._rowCount=0,this._columnCount=0}},{key:"hasFixedHeight",value:function(){return this._hasFixedHeight}},{key:"hasFixedWidth",value:function(){return this._hasFixedWidth}},{key:"getHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedHeight)return this._defaultHeight;var n=this._keyMapper(t,e);return void 0!==this._cellHeightCache[n]?Math.max(this._minHeight,this._cellHeightCache[n]):this._defaultHeight}},{key:"getWidth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(this._hasFixedWidth)return this._defaultWidth;var n=this._keyMapper(t,e);return void 0!==this._cellWidthCache[n]?Math.max(this._minWidth,this._cellWidthCache[n]):this._defaultWidth}},{key:"has",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this._keyMapper(t,e);return void 0!==this._cellHeightCache[n]}},{key:"set",value:function(t,e,n,r){var i=this._keyMapper(t,e);e>=this._columnCount&&(this._columnCount=e+1),t>=this._rowCount&&(this._rowCount=t+1),this._cellHeightCache[i]=r,this._cellWidthCache[i]=n,this._updateCachedColumnAndRowSizes(t,e)}},{key:"_updateCachedColumnAndRowSizes",value:function(t,e){if(!this._hasFixedWidth){for(var n=0,r=0;r=0){var f=e.getScrollPositionForCell({align:i,cellIndex:o,height:r,scrollLeft:s,scrollTop:c,width:a});f.scrollLeft===s&&f.scrollTop===c||n._setScrollPosition(f)}})),m()(d()(n),"_onScroll",(function(t){if(t.target===n._scrollingContainer){n._enablePointerEventsAfterDelay();var e=n.props,r=e.cellLayoutManager,i=e.height,o=e.isScrollingChange,a=e.width,u=n._scrollbarSize,s=r.getTotalSize(),c=s.height,f=s.width,l=Math.max(0,Math.min(f-a+u,t.target.scrollLeft)),d=Math.max(0,Math.min(c-i+u,t.target.scrollTop));if(n.state.scrollLeft!==l||n.state.scrollTop!==d){var h=t.cancelable?mt:bt;n.state.isScrolling||o(!0),n.setState({isScrolling:!0,scrollLeft:l,scrollPositionChangeReason:h,scrollTop:d})}n._invokeOnScrollMemoizer({scrollLeft:l,scrollTop:d,totalWidth:f,totalHeight:c})}})),n._scrollbarSize=j(),void 0===n._scrollbarSize?(n._scrollbarSizeMeasured=!1,n._scrollbarSize=0):n._scrollbarSizeMeasured=!0,n}return p()(e,t),a()(e,[{key:"recomputeCellSizesAndPositions",value:function(){this._calculateSizeAndPositionDataOnNextUpdate=!0,this.forceUpdate()}},{key:"componentDidMount",value:function(){var t=this.props,e=t.cellLayoutManager,n=t.scrollLeft,r=t.scrollToCell,i=t.scrollTop;this._scrollbarSizeMeasured||(this._scrollbarSize=j(),this._scrollbarSizeMeasured=!0,this.setState({})),r>=0?this._updateScrollPositionForScrollToCell():(n>=0||i>=0)&&this._setScrollPosition({scrollLeft:n,scrollTop:i}),this._invokeOnSectionRenderedHelper();var o=e.getTotalSize(),a=o.height,u=o.width;this._invokeOnScrollMemoizer({scrollLeft:n||0,scrollTop:i||0,totalHeight:a,totalWidth:u})}},{key:"componentDidUpdate",value:function(t,e){var n=this.props,r=n.height,i=n.scrollToAlignment,o=n.scrollToCell,a=n.width,u=this.state,s=u.scrollLeft,c=u.scrollPositionChangeReason,f=u.scrollTop;c===bt&&(s>=0&&s!==e.scrollLeft&&s!==this._scrollingContainer.scrollLeft&&(this._scrollingContainer.scrollLeft=s),f>=0&&f!==e.scrollTop&&f!==this._scrollingContainer.scrollTop&&(this._scrollingContainer.scrollTop=f)),r===t.height&&i===t.scrollToAlignment&&o===t.scrollToCell&&a===t.width||this._updateScrollPositionForScrollToCell(),this._invokeOnSectionRenderedHelper()}},{key:"componentWillUnmount",value:function(){this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId)}},{key:"render",value:function(){var t=this.props,e=t.autoHeight,n=t.cellCount,r=t.cellLayoutManager,i=t.className,o=t.height,a=t.horizontalOverscanSize,u=t.id,s=t.noContentRenderer,c=t.style,f=t.verticalOverscanSize,l=t.width,d=this.state,h=d.isScrolling,p=d.scrollLeft,g=d.scrollTop;(this._lastRenderedCellCount!==n||this._lastRenderedCellLayoutManager!==r||this._calculateSizeAndPositionDataOnNextUpdate)&&(this._lastRenderedCellCount=n,this._lastRenderedCellLayoutManager=r,this._calculateSizeAndPositionDataOnNextUpdate=!1,r.calculateSizeAndPositionData());var m=r.getTotalSize(),v=m.height,y=m.width,_=Math.max(0,p-a),w=Math.max(0,g-f),S=Math.min(y,p+l+a),O=Math.min(v,g+o+f),E=o>0&&l>0?r.cellRenderers({height:O-w,isScrolling:h,width:S-_,x:_,y:w}):[],M={boxSizing:"border-box",direction:"ltr",height:e?"auto":o,position:"relative",WebkitOverflowScrolling:"touch",width:l,willChange:"transform"},T=v>o?this._scrollbarSize:0,$=y>l?this._scrollbarSize:0;return M.overflowX=y+T<=l?"hidden":"auto",M.overflowY=v+$<=o?"hidden":"auto",b.createElement("div",{ref:this._setScrollingContainerRef,"aria-label":this.props["aria-label"],className:Object(x.a)("ReactVirtualized__Collection",i),id:u,onScroll:this._onScroll,role:"grid",style:gt({},M,{},c),tabIndex:0},n>0&&b.createElement("div",{className:"ReactVirtualized__Collection__innerScrollContainer",style:{height:v,maxHeight:v,maxWidth:y,overflow:"hidden",pointerEvents:h?"none":"",width:y}},E),0===n&&s())}},{key:"_enablePointerEventsAfterDelay",value:function(){var t=this;this._disablePointerEventsTimeoutId&&clearTimeout(this._disablePointerEventsTimeoutId),this._disablePointerEventsTimeoutId=setTimeout((function(){(0,t.props.isScrollingChange)(!1),t._disablePointerEventsTimeoutId=null,t.setState({isScrolling:!1})}),150)}},{key:"_invokeOnScrollMemoizer",value:function(t){var e=this,n=t.scrollLeft,r=t.scrollTop,i=t.totalHeight,o=t.totalWidth;this._onScrollMemoizer({callback:function(t){var n=t.scrollLeft,r=t.scrollTop,a=e.props,u=a.height;(0,a.onScroll)({clientHeight:u,clientWidth:a.width,scrollHeight:i,scrollLeft:n,scrollTop:r,scrollWidth:o})},indices:{scrollLeft:n,scrollTop:r}})}},{key:"_setScrollPosition",value:function(t){var e=t.scrollLeft,n=t.scrollTop,r={scrollPositionChangeReason:bt};e>=0&&(r.scrollLeft=e),n>=0&&(r.scrollTop=n),(e>=0&&e!==this.state.scrollLeft||n>=0&&n!==this.state.scrollTop)&&this.setState(r)}}],[{key:"getDerivedStateFromProps",value:function(t,e){return 0!==t.cellCount||0===e.scrollLeft&&0===e.scrollTop?t.scrollLeft!==e.scrollLeft||t.scrollTop!==e.scrollTop?{scrollLeft:null!=t.scrollLeft?t.scrollLeft:e.scrollLeft,scrollTop:null!=t.scrollTop?t.scrollTop:e.scrollTop,scrollPositionChangeReason:bt}:null:{scrollLeft:0,scrollTop:0,scrollPositionChangeReason:bt}}}]),e}(b.PureComponent);m()(vt,"defaultProps",{"aria-label":"grid",horizontalOverscanSize:0,noContentRenderer:function(){return null},onScroll:function(){return null},onSectionRendered:function(){return null},scrollToAlignment:"auto",scrollToCell:-1,style:{},verticalOverscanSize:0}),vt.propTypes={},w(vt);var yt=vt,_t=function(){function t(e){var n=e.height,r=e.width,o=e.x,a=e.y;i()(this,t),this.height=n,this.width=r,this.x=o,this.y=a,this._indexMap={},this._indices=[]}return a()(t,[{key:"addCellIndex",value:function(t){var e=t.index;this._indexMap[e]||(this._indexMap[e]=!0,this._indices.push(e))}},{key:"getCellIndices",value:function(){return this._indices}},{key:"toString",value:function(){return"".concat(this.x,",").concat(this.y," ").concat(this.width,"x").concat(this.height)}}]),t}(),wt=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;i()(this,t),this._sectionSize=e,this._cellMetadata=[],this._sections={}}return a()(t,[{key:"getCellIndices",value:function(t){var e=t.height,n=t.width,r=t.x,i=t.y,o={};return this.getSections({height:e,width:n,x:r,y:i}).forEach((function(t){return t.getCellIndices().forEach((function(t){o[t]=t}))})),Object.keys(o).map((function(t){return o[t]}))}},{key:"getCellMetadata",value:function(t){var e=t.index;return this._cellMetadata[e]}},{key:"getSections",value:function(t){for(var e=t.height,n=t.width,r=t.x,i=t.y,o=Math.floor(r/this._sectionSize),a=Math.floor((r+n-1)/this._sectionSize),u=Math.floor(i/this._sectionSize),s=Math.floor((i+e-1)/this._sectionSize),c=[],f=o;f<=a;f++)for(var l=u;l<=s;l++){var d="".concat(f,".").concat(l);this._sections[d]||(this._sections[d]=new _t({height:this._sectionSize,width:this._sectionSize,x:f*this._sectionSize,y:l*this._sectionSize})),c.push(this._sections[d])}return c}},{key:"getTotalSectionCount",value:function(){return Object.keys(this._sections).length}},{key:"toString",value:function(){var t=this;return Object.keys(this._sections).map((function(e){return t._sections[e].toString()}))}},{key:"registerCell",value:function(t){var e=t.cellMetadatum,n=t.index;this._cellMetadata[n]=e,this.getSections(e).forEach((function(t){return t.addCellIndex({index:n})}))}}]),t}();function St(t){var e=t.align,n=void 0===e?"auto":e,r=t.cellOffset,i=t.cellSize,o=t.containerSize,a=t.currentOffset,u=r,s=u-o+i;switch(n){case"start":return u;case"end":return s;case"center":return u-(o-i)/2;default:return Math.max(s,Math.min(u,a))}}var Ot=function(t){function e(t,n){var r;return i()(this,e),(r=s()(this,f()(e).call(this,t,n)))._cellMetadata=[],r._lastRenderedCellIndices=[],r._cellCache=[],r._isScrollingChange=r._isScrollingChange.bind(d()(r)),r._setCollectionViewRef=r._setCollectionViewRef.bind(d()(r)),r}return p()(e,t),a()(e,[{key:"forceUpdate",value:function(){void 0!==this._collectionView&&this._collectionView.forceUpdate()}},{key:"recomputeCellSizesAndPositions",value:function(){this._cellCache=[],this._collectionView.recomputeCellSizesAndPositions()}},{key:"render",value:function(){var t=O()({},this.props);return b.createElement(yt,O()({cellLayoutManager:this,isScrollingChange:this._isScrollingChange,ref:this._setCollectionViewRef},t))}},{key:"calculateSizeAndPositionData",value:function(){var t=this.props,e=function(t){for(var e=t.cellCount,n=t.cellSizeAndPositionGetter,r=t.sectionSize,i=[],o=new wt(r),a=0,u=0,s=0;s=0&&nn||i1&&void 0!==arguments[1]?arguments[1]:0,n="function"===typeof t.recomputeGridSize?t.recomputeGridSize:t.recomputeRowHeights;n?n.call(t,e):t.forceUpdate()}(e._registeredChild,e._lastRenderedStartIndex)}))}))}},{key:"_onRowsRendered",value:function(t){var e=t.startIndex,n=t.stopIndex;this._lastRenderedStartIndex=e,this._lastRenderedStopIndex=n,this._doStuff(e,n)}},{key:"_doStuff",value:function(t,e){var n,r=this,i=this.props,o=i.isRowLoaded,a=i.minimumBatchSize,u=i.rowCount,s=i.threshold,c=function(t){for(var e=t.isRowLoaded,n=t.minimumBatchSize,r=t.rowCount,i=t.startIndex,o=t.stopIndex,a=[],u=null,s=null,c=i;c<=o;c++){e({index:c})?null!==s&&(a.push({startIndex:u,stopIndex:s}),u=s=null):(s=c,null===u&&(u=c))}if(null!==s){for(var f=Math.min(Math.max(s,u+n-1),r-1),l=s+1;l<=f&&!e({index:l});l++)s=l;a.push({startIndex:u,stopIndex:s})}if(a.length)for(var d=a[0];d.stopIndex-d.startIndex+10;){var h=d.startIndex-1;if(e({index:h}))break;d.startIndex=h}return a}({isRowLoaded:o,minimumBatchSize:a,rowCount:u,startIndex:Math.max(0,t-s),stopIndex:Math.min(u-1,e+s)}),f=(n=[]).concat.apply(n,Mt()(c.map((function(t){return[t.startIndex,t.stopIndex]}))));this._loadMoreRowsMemoizer({callback:function(){r._loadUnloadedRanges(c)},indices:{squashedUnloadedRanges:f}})}},{key:"_registerChild",value:function(t){this._registeredChild=t}}]),e}(b.PureComponent);m()(Tt,"defaultProps",{minimumBatchSize:10,rowCount:0,threshold:15}),Tt.propTypes={};var $t,At,kt=(At=$t=function(t){function e(){var t,n;i()(this,e);for(var r=arguments.length,o=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r;this.Grid&&this.Grid.recomputeGridSize({rowIndex:i,columnIndex:n})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t,columnIndex:0})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"render",value:function(){var t=this.props,e=t.className,n=t.noRowsRenderer,r=t.scrollToIndex,i=t.width,o=Object(x.a)("ReactVirtualized__List",e);return b.createElement(Z,O()({},this.props,{autoContainerWidth:!0,cellRenderer:this._cellRenderer,className:o,columnWidth:i,columnCount:1,noContentRenderer:n,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,scrollToRow:r}))}}]),e}(b.PureComponent),m()($t,"propTypes",null),At);m()(kt,"defaultProps",{autoHeight:!1,estimatedRowSize:30,onScroll:function(){},noRowsRenderer:function(){return null},onRowsRendered:function(){},overscanIndicesGetter:Q,overscanRowCount:10,scrollToAlignment:"auto",scrollToIndex:-1,style:{}});var Ct=n(561),It=n.n(Ct);var Pt={ge:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(var o=n+1;e<=n;){var a=e+n>>>1;i(t[a],r)>=0?(o=a,n=a-1):e=a+1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=n+1;e<=n;){var o=e+n>>>1;t[o]>=r?(i=o,n=o-1):e=o+1}return i}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)},gt:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(var o=n+1;e<=n;){var a=e+n>>>1;i(t[a],r)>0?(o=a,n=a-1):e=a+1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=n+1;e<=n;){var o=e+n>>>1;t[o]>r?(i=o,n=o-1):e=o+1}return i}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)},lt:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(var o=e-1;e<=n;){var a=e+n>>>1;i(t[a],r)<0?(o=a,e=a+1):n=a-1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=e-1;e<=n;){var o=e+n>>>1;t[o]>>1;i(t[a],r)<=0?(o=a,e=a+1):n=a-1}return o}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(var i=e-1;e<=n;){var o=e+n>>>1;t[o]<=r?(i=o,e=o+1):n=o-1}return i}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)},eq:function(t,e,n,r,i){return"function"===typeof n?function(t,e,n,r,i){for(;e<=n;){var o=e+n>>>1,a=i(t[o],r);if(0===a)return o;a<=0?e=o+1:n=o-1}return-1}(t,void 0===r?0:0|r,void 0===i?t.length-1:0|i,e,n):function(t,e,n,r){for(;e<=n;){var i=e+n>>>1,o=t[i];if(o===r)return i;o<=r?e=i+1:n=i-1}return-1}(t,void 0===n?0:0|n,void 0===r?t.length-1:0|r,e)}};function Nt(t,e,n,r,i){this.mid=t,this.left=e,this.right=n,this.leftPoints=r,this.rightPoints=i,this.count=(e?e.count:0)+(n?n.count:0)+r.length}var Rt=Nt.prototype;function jt(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function Dt(t,e){var n=Wt(e);t.mid=n.mid,t.left=n.left,t.right=n.right,t.leftPoints=n.leftPoints,t.rightPoints=n.rightPoints,t.count=n.count}function Lt(t,e){var n=t.intervals([]);n.push(e),Dt(t,n)}function Ft(t,e){var n=t.intervals([]),r=n.indexOf(e);return r<0?0:(n.splice(r,1),Dt(t,n),1)}function Bt(t,e,n){for(var r=0;r=0&&t[r][1]>=e;--r){var i=n(t[r]);if(i)return i}}function zt(t,e){for(var n=0;n>1],i=[],o=[],a=[];for(n=0;n3*(e+1)?Lt(this,t):this.left.insert(t):this.left=Wt([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?Lt(this,t):this.right.insert(t):this.right=Wt([t]);else{var n=Pt.ge(this.leftPoints,t,Vt),r=Pt.ge(this.rightPoints,t,qt);this.leftPoints.splice(n,0,t),this.rightPoints.splice(r,0,t)}},Rt.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?Ft(this,t):2===(o=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===o&&(this.count-=1),o):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?Ft(this,t):2===(o=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===o&&(this.count-=1),o):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,r=this.left;r.right;)n=r,r=r.right;if(n===this)r.right=this.right;else{var i=this.left,o=this.right;n.count-=r.count,n.right=r.left,r.left=i,r.right=o}jt(this,r),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?jt(this,this.left):jt(this,this.right);return 1}for(i=Pt.ge(this.leftPoints,t,Vt);ithis.mid){var n;if(this.right)if(n=this.right.queryPoint(t,e))return n;return Ut(this.rightPoints,t,e)}return zt(this.leftPoints,e)},Rt.queryInterval=function(t,e,n){var r;if(tthis.mid&&this.right&&(r=this.right.queryInterval(t,e,n)))return r;return ethis.mid?Ut(this.rightPoints,t,n):zt(this.leftPoints,n)};var Kt=Gt.prototype;Kt.insert=function(t){this.root?this.root.insert(t):this.root=new Nt(t[0],null,null,[t],[t])},Kt.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},Kt.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},Kt.queryInterval=function(t,e,n){if(t<=e&&this.root)return this.root.queryInterval(t,e,n)},Object.defineProperty(Kt,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(Kt,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}});var Yt,Zt,Qt=function(){function t(){var e;i()(this,t),m()(this,"_columnSizeMap",{}),m()(this,"_intervalTree",e&&0!==e.length?new Gt(Wt(e)):new Gt(null)),m()(this,"_leftMap",{})}return a()(t,[{key:"estimateTotalHeight",value:function(t,e,n){var r=t-this.count;return this.tallestColumnSize+Math.ceil(r/e)*n}},{key:"range",value:function(t,e,n){var r=this;this._intervalTree.queryInterval(t,t+e,(function(t){var e=It()(t,3),i=e[0],o=(e[1],e[2]);return n(o,r._leftMap[o],i)}))}},{key:"setPosition",value:function(t,e,n,r){this._intervalTree.insert([n,n+r,t]),this._leftMap[t]=e;var i=this._columnSizeMap,o=i[e];i[e]=void 0===o?n+r:Math.max(o,n+r)}},{key:"count",get:function(){return this._intervalTree.count}},{key:"shortestColumnSize",get:function(){var t=this._columnSizeMap,e=0;for(var n in t){var r=t[n];e=0===e?r:Math.min(e,r)}return e}},{key:"tallestColumnSize",get:function(){var t=this._columnSizeMap,e=0;for(var n in t){var r=t[n];e=Math.max(e,r)}return e}}]),t}();function Xt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Jt(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),m()(this,"_cellMeasurerCache",void 0),m()(this,"_columnIndexOffset",void 0),m()(this,"_rowIndexOffset",void 0),m()(this,"columnWidth",(function(t){var n=t.index;e._cellMeasurerCache.columnWidth({index:n+e._columnIndexOffset})})),m()(this,"rowHeight",(function(t){var n=t.index;e._cellMeasurerCache.rowHeight({index:n+e._rowIndexOffset})}));var r=n.cellMeasurerCache,o=n.columnIndexOffset,a=void 0===o?0:o,u=n.rowIndexOffset,s=void 0===u?0:u;this._cellMeasurerCache=r,this._columnIndexOffset=a,this._rowIndexOffset=s}return a()(t,[{key:"clear",value:function(t,e){this._cellMeasurerCache.clear(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"clearAll",value:function(){this._cellMeasurerCache.clearAll()}},{key:"hasFixedHeight",value:function(){return this._cellMeasurerCache.hasFixedHeight()}},{key:"hasFixedWidth",value:function(){return this._cellMeasurerCache.hasFixedWidth()}},{key:"getHeight",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getHeight(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"getWidth",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.getWidth(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"has",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this._cellMeasurerCache.has(t+this._rowIndexOffset,e+this._columnIndexOffset)}},{key:"set",value:function(t,e,n,r){this._cellMeasurerCache.set(t+this._rowIndexOffset,e+this._columnIndexOffset,n,r)}},{key:"defaultHeight",get:function(){return this._cellMeasurerCache.defaultHeight}},{key:"defaultWidth",get:function(){return this._cellMeasurerCache.defaultWidth}}]),t}();function re(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function ie(t){for(var e=1;e0?new ne({cellMeasurerCache:o,columnIndexOffset:0,rowIndexOffset:u}):o,r._deferredMeasurementCacheBottomRightGrid=a>0||u>0?new ne({cellMeasurerCache:o,columnIndexOffset:a,rowIndexOffset:u}):o,r._deferredMeasurementCacheTopRightGrid=a>0?new ne({cellMeasurerCache:o,columnIndexOffset:a,rowIndexOffset:0}):o),r}return p()(e,t),a()(e,[{key:"forceUpdateGrids",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.forceUpdate(),this._bottomRightGrid&&this._bottomRightGrid.forceUpdate(),this._topLeftGrid&&this._topLeftGrid.forceUpdate(),this._topRightGrid&&this._topRightGrid.forceUpdate()}},{key:"invalidateCellSizeAfterRender",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r;this._deferredInvalidateColumnIndex="number"===typeof this._deferredInvalidateColumnIndex?Math.min(this._deferredInvalidateColumnIndex,n):n,this._deferredInvalidateRowIndex="number"===typeof this._deferredInvalidateRowIndex?Math.min(this._deferredInvalidateRowIndex,i):i}},{key:"measureAllCells",value:function(){this._bottomLeftGrid&&this._bottomLeftGrid.measureAllCells(),this._bottomRightGrid&&this._bottomRightGrid.measureAllCells(),this._topLeftGrid&&this._topLeftGrid.measureAllCells(),this._topRightGrid&&this._topRightGrid.measureAllCells()}},{key:"recomputeGridSize",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r,o=this.props,a=o.fixedColumnCount,u=o.fixedRowCount,s=Math.max(0,n-a),c=Math.max(0,i-u);this._bottomLeftGrid&&this._bottomLeftGrid.recomputeGridSize({columnIndex:n,rowIndex:c}),this._bottomRightGrid&&this._bottomRightGrid.recomputeGridSize({columnIndex:s,rowIndex:c}),this._topLeftGrid&&this._topLeftGrid.recomputeGridSize({columnIndex:n,rowIndex:i}),this._topRightGrid&&this._topRightGrid.recomputeGridSize({columnIndex:s,rowIndex:i}),this._leftGridWidth=null,this._topGridHeight=null,this._maybeCalculateCachedStyles(!0)}},{key:"componentDidMount",value:function(){var t=this.props,e=t.scrollLeft,n=t.scrollTop;if(e>0||n>0){var r={};e>0&&(r.scrollLeft=e),n>0&&(r.scrollTop=n),this.setState(r)}this._handleInvalidatedGridSize()}},{key:"componentDidUpdate",value:function(){this._handleInvalidatedGridSize()}},{key:"render",value:function(){var t=this.props,e=t.onScroll,n=t.onSectionRendered,r=(t.onScrollbarPresenceChange,t.scrollLeft,t.scrollToColumn),i=(t.scrollTop,t.scrollToRow),o=T()(t,["onScroll","onSectionRendered","onScrollbarPresenceChange","scrollLeft","scrollToColumn","scrollTop","scrollToRow"]);if(this._prepareForRender(),0===this.props.width||0===this.props.height)return null;var a=this.state,u=a.scrollLeft,s=a.scrollTop;return b.createElement("div",{style:this._containerOuterStyle},b.createElement("div",{style:this._containerTopStyle},this._renderTopLeftGrid(o),this._renderTopRightGrid(ie({},o,{onScroll:e,scrollLeft:u}))),b.createElement("div",{style:this._containerBottomStyle},this._renderBottomLeftGrid(ie({},o,{onScroll:e,scrollTop:s})),this._renderBottomRightGrid(ie({},o,{onScroll:e,onSectionRendered:n,scrollLeft:u,scrollToColumn:r,scrollToRow:i,scrollTop:s}))))}},{key:"_getBottomGridHeight",value:function(t){return t.height-this._getTopGridHeight(t)}},{key:"_getLeftGridWidth",value:function(t){var e=t.fixedColumnCount,n=t.columnWidth;if(null==this._leftGridWidth)if("function"===typeof n){for(var r=0,i=0;i=0?t.scrollLeft:e.scrollLeft,scrollTop:null!=t.scrollTop&&t.scrollTop>=0?t.scrollTop:e.scrollTop}:null}}]),e}(b.PureComponent);m()(oe,"defaultProps",{classNameBottomLeftGrid:"",classNameBottomRightGrid:"",classNameTopLeftGrid:"",classNameTopRightGrid:"",enableFixedColumnScroll:!1,enableFixedRowScroll:!1,fixedColumnCount:0,fixedRowCount:0,scrollToColumn:-1,scrollToRow:-1,style:{},styleBottomLeftGrid:{},styleBottomRightGrid:{},styleTopLeftGrid:{},styleTopRightGrid:{},hideTopRightGridScrollbar:!1,hideBottomLeftGridScrollbar:!1}),oe.propTypes={},w(oe);var ae=function(t){function e(t,n){var r;return i()(this,e),(r=s()(this,f()(e).call(this,t,n))).state={clientHeight:0,clientWidth:0,scrollHeight:0,scrollLeft:0,scrollTop:0,scrollWidth:0},r._onScroll=r._onScroll.bind(d()(r)),r}return p()(e,t),a()(e,[{key:"render",value:function(){var t=this.props.children,e=this.state,n=e.clientHeight,r=e.clientWidth,i=e.scrollHeight,o=e.scrollLeft,a=e.scrollTop,u=e.scrollWidth;return t({clientHeight:n,clientWidth:r,onScroll:this._onScroll,scrollHeight:i,scrollLeft:o,scrollTop:a,scrollWidth:u})}},{key:"_onScroll",value:function(t){var e=t.clientHeight,n=t.clientWidth,r=t.scrollHeight,i=t.scrollLeft,o=t.scrollTop,a=t.scrollWidth;this.setState({clientHeight:e,clientWidth:n,scrollHeight:r,scrollLeft:i,scrollTop:o,scrollWidth:a})}}]),e}(b.PureComponent);ae.propTypes={};function ue(t){var e=t.className,n=t.columns,r=t.style;return b.createElement("div",{className:e,role:"row",style:r},n)}ue.propTypes=null;var se={ASC:"ASC",DESC:"DESC"};function ce(t){var e=t.sortDirection,n=Object(x.a)("ReactVirtualized__Table__sortableHeaderIcon",{"ReactVirtualized__Table__sortableHeaderIcon--ASC":e===se.ASC,"ReactVirtualized__Table__sortableHeaderIcon--DESC":e===se.DESC});return b.createElement("svg",{className:n,width:18,height:18,viewBox:"0 0 24 24"},e===se.ASC?b.createElement("path",{d:"M7 14l5-5 5 5z"}):b.createElement("path",{d:"M7 10l5 5 5-5z"}),b.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}))}function fe(t){var e=t.dataKey,n=t.label,r=t.sortBy,i=t.sortDirection,o=r===e,a=[b.createElement("span",{className:"ReactVirtualized__Table__headerTruncatedText",key:"label",title:"string"===typeof n?n:null},n)];return o&&a.push(b.createElement(ce,{key:"SortIndicator",sortDirection:i})),a}function le(t){var e=t.className,n=t.columns,r=t.index,i=t.key,o=t.onRowClick,a=t.onRowDoubleClick,u=t.onRowMouseOut,s=t.onRowMouseOver,c=t.onRowRightClick,f=t.rowData,l=t.style,d={"aria-rowindex":r+1};return(o||a||u||s||c)&&(d["aria-label"]="row",d.tabIndex=0,o&&(d.onClick=function(t){return o({event:t,index:r,rowData:f})}),a&&(d.onDoubleClick=function(t){return a({event:t,index:r,rowData:f})}),u&&(d.onMouseOut=function(t){return u({event:t,index:r,rowData:f})}),s&&(d.onMouseOver=function(t){return s({event:t,index:r,rowData:f})}),c&&(d.onContextMenu=function(t){return c({event:t,index:r,rowData:f})})),b.createElement("div",O()({},d,{className:e,key:i,role:"row",style:l}),n)}ce.propTypes={},fe.propTypes=null,le.propTypes=null;var de=function(t){function e(){return i()(this,e),s()(this,f()(e).apply(this,arguments))}return p()(e,t),e}(b.Component);function he(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function pe(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=t.columnIndex,n=void 0===e?0:e,r=t.rowIndex,i=void 0===r?0:r;this.Grid&&this.Grid.recomputeGridSize({rowIndex:i,columnIndex:n})}},{key:"recomputeRowHeights",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.recomputeGridSize({rowIndex:t})}},{key:"scrollToPosition",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToPosition({scrollTop:t})}},{key:"scrollToRow",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.Grid&&this.Grid.scrollToCell({columnIndex:0,rowIndex:t})}},{key:"getScrollbarWidth",value:function(){if(this.Grid){var t=Object(ft.findDOMNode)(this.Grid),e=t.clientWidth||0;return(t.offsetWidth||0)-e}return 0}},{key:"componentDidMount",value:function(){this._setScrollbarWidth()}},{key:"componentDidUpdate",value:function(){this._setScrollbarWidth()}},{key:"render",value:function(){var t=this,e=this.props,n=e.children,r=e.className,i=e.disableHeader,o=e.gridClassName,a=e.gridStyle,u=e.headerHeight,s=e.headerRowRenderer,c=e.height,f=e.id,l=e.noRowsRenderer,d=e.rowClassName,h=e.rowStyle,p=e.scrollToIndex,g=e.style,m=e.width,v=this.state.scrollbarWidth,y=i?c:c-u,_="function"===typeof d?d({index:-1}):d,w="function"===typeof h?h({index:-1}):h;return this._cachedColumnStyles=[],b.Children.toArray(n).forEach((function(e,n){var r=t._getFlexStyleForColumn(e,e.props.style);t._cachedColumnStyles[n]=pe({overflow:"hidden"},r)})),b.createElement("div",{"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-colcount":b.Children.toArray(n).length,"aria-rowcount":this.props.rowCount,className:Object(x.a)("ReactVirtualized__Table",r),id:f,role:"grid",style:g},!i&&s({className:Object(x.a)("ReactVirtualized__Table__headerRow",_),columns:this._getHeaderColumns(),style:pe({height:u,overflow:"hidden",paddingRight:v,width:m},w)}),b.createElement(Z,O()({},this.props,{"aria-readonly":null,autoContainerWidth:!0,className:Object(x.a)("ReactVirtualized__Table__Grid",o),cellRenderer:this._createRow,columnWidth:m,columnCount:1,height:y,id:void 0,noContentRenderer:l,onScroll:this._onScroll,onSectionRendered:this._onSectionRendered,ref:this._setRef,role:"rowgroup",scrollbarWidth:v,scrollToRow:p,style:pe({},a,{overflowX:"hidden"})})))}},{key:"_createColumn",value:function(t){var e=t.column,n=t.columnIndex,r=t.isScrolling,i=t.parent,o=t.rowData,a=t.rowIndex,u=this.props.onColumnClick,s=e.props,c=s.cellDataGetter,f=s.cellRenderer,l=s.className,d=s.columnData,h=s.dataKey,p=s.id,g=f({cellData:c({columnData:d,dataKey:h,rowData:o}),columnData:d,columnIndex:n,dataKey:h,isScrolling:r,parent:i,rowData:o,rowIndex:a}),m=this._cachedColumnStyles[n],v="string"===typeof g?g:null;return b.createElement("div",{"aria-colindex":n+1,"aria-describedby":p,className:Object(x.a)("ReactVirtualized__Table__rowColumn",l),key:"Row"+a+"-Col"+n,onClick:function(t){u&&u({columnData:d,dataKey:h,event:t})},role:"gridcell",style:m,title:v},g)}},{key:"_createHeader",value:function(t){var e,n,r,i,o,a=t.column,u=t.index,s=this.props,c=s.headerClassName,f=s.headerStyle,l=s.onHeaderClick,d=s.sort,h=s.sortBy,p=s.sortDirection,g=a.props,m=g.columnData,v=g.dataKey,y=g.defaultSortDirection,_=g.disableSort,w=g.headerRenderer,S=g.id,O=g.label,E=!_&&d,M=Object(x.a)("ReactVirtualized__Table__headerColumn",c,a.props.headerClassName,{ReactVirtualized__Table__sortableHeaderColumn:E}),T=this._getFlexStyleForColumn(a,pe({},f,{},a.props.headerStyle)),$=w({columnData:m,dataKey:v,disableSort:_,label:O,sortBy:h,sortDirection:p});if(E||l){var A=h!==v?y:p===se.DESC?se.ASC:se.DESC,k=function(t){E&&d({defaultSortDirection:y,event:t,sortBy:v,sortDirection:A}),l&&l({columnData:m,dataKey:v,event:t})};o=a.props["aria-label"]||O||v,i="none",r=0,e=k,n=function(t){"Enter"!==t.key&&" "!==t.key||k(t)}}return h===v&&(i=p===se.ASC?"ascending":"descending"),b.createElement("div",{"aria-label":o,"aria-sort":i,className:M,id:S,key:"Header-Col"+u,onClick:e,onKeyDown:n,role:"columnheader",style:T,tabIndex:r},$)}},{key:"_createRow",value:function(t){var e=this,n=t.rowIndex,r=t.isScrolling,i=t.key,o=t.parent,a=t.style,u=this.props,s=u.children,c=u.onRowClick,f=u.onRowDoubleClick,l=u.onRowRightClick,d=u.onRowMouseOver,h=u.onRowMouseOut,p=u.rowClassName,g=u.rowGetter,m=u.rowRenderer,v=u.rowStyle,y=this.state.scrollbarWidth,_="function"===typeof p?p({index:n}):p,w="function"===typeof v?v({index:n}):v,S=g({index:n}),O=b.Children.toArray(s).map((function(t,i){return e._createColumn({column:t,columnIndex:i,isScrolling:r,parent:o,rowData:S,rowIndex:n,scrollbarWidth:y})})),E=Object(x.a)("ReactVirtualized__Table__row",_),M=pe({},a,{height:this._getRowHeight(n),overflow:"hidden",paddingRight:y},w);return m({className:E,columns:O,index:n,isScrolling:r,key:i,onRowClick:c,onRowDoubleClick:f,onRowRightClick:l,onRowMouseOver:d,onRowMouseOut:h,rowData:S,style:M})}},{key:"_getFlexStyleForColumn",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="".concat(t.props.flexGrow," ").concat(t.props.flexShrink," ").concat(t.props.width,"px"),r=pe({},e,{flex:n,msFlex:n,WebkitFlex:n});return t.props.maxWidth&&(r.maxWidth=t.props.maxWidth),t.props.minWidth&&(r.minWidth=t.props.minWidth),r}},{key:"_getHeaderColumns",value:function(){var t=this,e=this.props,n=e.children;return(e.disableHeader?[]:b.Children.toArray(n)).map((function(e,n){return t._createHeader({column:e,index:n})}))}},{key:"_getRowHeight",value:function(t){var e=this.props.rowHeight;return"function"===typeof e?e({index:t}):e}},{key:"_onScroll",value:function(t){var e=t.clientHeight,n=t.scrollHeight,r=t.scrollTop;(0,this.props.onScroll)({clientHeight:e,scrollHeight:n,scrollTop:r})}},{key:"_onSectionRendered",value:function(t){var e=t.rowOverscanStartIndex,n=t.rowOverscanStopIndex,r=t.rowStartIndex,i=t.rowStopIndex;(0,this.props.onRowsRendered)({overscanStartIndex:e,overscanStopIndex:n,startIndex:r,stopIndex:i})}},{key:"_setRef",value:function(t){this.Grid=t}},{key:"_setScrollbarWidth",value:function(){var t=this.getScrollbarWidth();this.setState({scrollbarWidth:t})}}]),e}(b.PureComponent);m()(ge,"defaultProps",{disableHeader:!1,estimatedRowSize:30,headerHeight:0,headerStyle:{},noRowsRenderer:function(){return null},onRowsRendered:function(){return null},onScroll:function(){return null},overscanIndicesGetter:Q,overscanRowCount:10,rowRenderer:le,headerRowRenderer:ue,rowStyle:{},scrollToAlignment:"auto",scrollToIndex:-1,style:{}}),ge.propTypes={};var me=[],be=null,ve=null;function ye(){ve&&(ve=null,document.body&&null!=be&&(document.body.style.pointerEvents=be),be=null)}function _e(){ye(),me.forEach((function(t){return t.__resetIsScrolling()}))}function we(t){t.currentTarget===window&&null==be&&document.body&&(be=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),function(){ve&&H(ve);var t=0;me.forEach((function(e){t=Math.max(t,e.props.scrollingResetTimeInterval)})),ve=V(_e,t)}(),me.forEach((function(e){e.props.scrollElement===t.currentTarget&&e.__handleWindowScrollEvent()}))}function Se(t,e){me.some((function(t){return t.props.scrollElement===e}))||e.addEventListener("scroll",we),me.push(t)}function Oe(t,e){(me=me.filter((function(e){return e!==t}))).length||(e.removeEventListener("scroll",we),ve&&(H(ve),ye()))}var xe,Ee,Me=function(t){return t===window},Te=function(t){return t.getBoundingClientRect()};function $e(t,e){if(t){if(Me(t)){var n=window,r=n.innerHeight,i=n.innerWidth;return{height:"number"===typeof r?r:0,width:"number"===typeof i?i:0}}return Te(t)}return{height:e.serverHeight,width:e.serverWidth}}function Ae(t,e){if(Me(e)&&document.documentElement){var n=document.documentElement,r=Te(t),i=Te(n);return{top:r.top-i.top,left:r.left-i.left}}var o=ke(e),a=Te(t),u=Te(e);return{top:a.top+o.top-u.top,left:a.left+o.left-u.left}}function ke(t){return Me(t)&&document.documentElement?{top:"scrollY"in window?window.scrollY:document.documentElement.scrollTop,left:"scrollX"in window?window.scrollX:document.documentElement.scrollLeft}:{top:t.scrollTop,left:t.scrollLeft}}function Ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Ie(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:this.props.scrollElement,e=this.props.onResize,n=this.state,r=n.height,i=n.width,o=this._child||ft.findDOMNode(this);if(o instanceof Element&&t){var a=Ae(o,t);this._positionFromTop=a.top,this._positionFromLeft=a.left}var u=$e(t,this.props);r===u.height&&i===u.width||(this.setState({height:u.height,width:u.width}),e({height:u.height,width:u.width}))}},{key:"componentDidMount",value:function(){var t=this.props.scrollElement;this._detectElementResize=Object(it.a)(),this.updatePosition(t),t&&(Se(this,t),this._registerResizeListener(t)),this._isMounted=!0}},{key:"componentDidUpdate",value:function(t,e){var n=this.props.scrollElement,r=t.scrollElement;r!==n&&null!=r&&null!=n&&(this.updatePosition(n),Oe(this,r),Se(this,n),this._unregisterResizeListener(r),this._registerResizeListener(n))}},{key:"componentWillUnmount",value:function(){var t=this.props.scrollElement;t&&(Oe(this,t),this._unregisterResizeListener(t)),this._isMounted=!1}},{key:"render",value:function(){var t=this.props.children,e=this.state,n=e.isScrolling,r=e.scrollTop,i=e.scrollLeft,o=e.height,a=e.width;return t({onChildScroll:this._onChildScroll,registerChild:this._registerChild,height:o,isScrolling:n,scrollLeft:i,scrollTop:r,width:a})}}]),e}(b.PureComponent),m()(xe,"propTypes",null),Ee);m()(Ne,"defaultProps",{onResize:function(){},onScroll:function(){},scrollingResetTimeInterval:150,scrollElement:Pe(),serverHeight:0,serverWidth:0})},function(t,e,n){"use strict";var r=Array.isArray,i=Object.keys,o=Object.prototype.hasOwnProperty,a="undefined"!==typeof Element;function u(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){var n,s,c,f=r(t),l=r(e);if(f&&l){if((s=t.length)!=e.length)return!1;for(n=s;0!==n--;)if(!u(t[n],e[n]))return!1;return!0}if(f!=l)return!1;var d=t instanceof Date,h=e instanceof Date;if(d!=h)return!1;if(d&&h)return t.getTime()==e.getTime();var p=t instanceof RegExp,g=e instanceof RegExp;if(p!=g)return!1;if(p&&g)return t.toString()==e.toString();var m=i(t);if((s=m.length)!==i(e).length)return!1;for(n=s;0!==n--;)if(!o.call(e,m[n]))return!1;if(a&&t instanceof Element&&e instanceof Element)return t===e;for(n=s;0!==n--;)if(("_owner"!==(c=m[n])||!t.$$typeof)&&!u(t[c],e[c]))return!1;return!0}return t!==t&&e!==e}t.exports=function(t,e){try{return u(t,e)}catch(n){if(n.message&&n.message.match(/stack|recursion/i)||-2146828260===n.number)return console.warn("Warning: react-fast-compare does not handle circular references.",n.name,n.message),!1;throw n}}},,function(t,e,n){var r=n(414),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:n(738).Buffer}catch(E){}function u(t,e){var n=t.charCodeAt(e);return n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function s(t,e,n){var r=u(t,n);return n-1>=e&&(r|=u(t,n-1)<<4),r}function c(t,e,n,r){for(var i=0,o=Math.min(t.length,n),a=e;a=49?u-49+10:u>=17?u-17+10:u}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"===typeof t)return this._initNumber(t,e,n);if("object"===typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,n){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=2)i=s(t,e,r)<=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(r=(t.length-e)%2===0?e+1:e;r=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,u=Math.min(o,o-a)+n,s=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,u=67108863&a,s=a/67108864|0;n.words[0]=u;for(var c=1;c>>26,l=67108863&s,d=Math.min(c,e.length-1),h=Math.max(0,c-t.length+1);h<=d;h++){var p=c-h|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[h])+l)/67108864|0,l=67108863&a}n.words[c]=0|l,s=0|f}return 0!==s?n.words[c]=0|s:n.length--,n.strip()}o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?f[6-s.length]+s+n:s+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var c=l[t],h=d[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(h).toString(t);n=(p=p.idivn(h)).isZero()?g+n:f[c-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,u,s="le"===e,c=new t(o),f=this.clone();if(s){for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[u]=a;for(;u=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0===(8191&e)&&(n+=13,e>>>=13),0===(127&e)&&(n+=7,e>>>=7),0===(15&e)&&(n+=4,e>>>=4),0===(3&e)&&(n+=2,e>>>=2),0===(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"===typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,h=0|a[1],p=8191&h,g=h>>>13,m=0|a[2],b=8191&m,v=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,S=0|a[4],O=8191&S,x=S>>>13,E=0|a[5],M=8191&E,T=E>>>13,$=0|a[6],A=8191&$,k=$>>>13,C=0|a[7],I=8191&C,P=C>>>13,N=0|a[8],R=8191&N,j=N>>>13,D=0|a[9],L=8191&D,F=D>>>13,B=0|u[0],U=8191&B,z=B>>>13,H=0|u[1],V=8191&H,q=H>>>13,W=0|u[2],G=8191&W,K=W>>>13,Y=0|u[3],Z=8191&Y,Q=Y>>>13,X=0|u[4],J=8191&X,tt=X>>>13,et=0|u[5],nt=8191&et,rt=et>>>13,it=0|u[6],ot=8191&it,at=it>>>13,ut=0|u[7],st=8191&ut,ct=ut>>>13,ft=0|u[8],lt=8191&ft,dt=ft>>>13,ht=0|u[9],pt=8191&ht,gt=ht>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(l,U))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,U)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(g,U)|0,o=Math.imul(g,z);var bt=(c+(r=r+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(d,V)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,U),i=(i=Math.imul(b,z))+Math.imul(v,U)|0,o=Math.imul(v,z),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var vt=(c+(r=r+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,K)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,K)|0;var yt=(c+(r=r+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(x,U)|0,o=Math.imul(x,z),r=r+Math.imul(_,V)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Q)|0;var _t=(c+(r=r+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(M,U),i=(i=Math.imul(M,z))+Math.imul(T,U)|0,o=Math.imul(T,z),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,q)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,tt)|0;var wt=(c+(r=r+Math.imul(l,nt)|0)|0)+((8191&(i=(i=i+Math.imul(l,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,z))+Math.imul(k,U)|0,o=Math.imul(k,z),r=r+Math.imul(M,V)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,K)|0,r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var St=(c+(r=r+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(P,U)|0,o=Math.imul(P,z),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,K)|0,r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Ot=(c+(r=r+Math.imul(l,st)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(d,st)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,z))+Math.imul(j,U)|0,o=Math.imul(j,z),r=r+Math.imul(I,V)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,q)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Q)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(w,nt)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(g,st)|0,o=o+Math.imul(g,ct)|0;var xt=(c+(r=r+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(F,U)|0,o=Math.imul(F,z),r=r+Math.imul(R,V)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,q)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(v,st)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(g,lt)|0,o=o+Math.imul(g,dt)|0;var Et=(c+(r=r+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,q))+Math.imul(F,V)|0,o=Math.imul(F,q),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,K)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0;var Mt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,K))+Math.imul(F,G)|0,o=Math.imul(F,K),r=r+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(O,st)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(x,st)|0,o=o+Math.imul(x,ct)|0,r=r+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0;var Tt=(c+(r=r+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,Q))+Math.imul(F,Z)|0,o=Math.imul(F,Q),r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,st)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,dt)|0;var $t=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,gt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,tt))+Math.imul(F,J)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(j,nt)|0,o=o+Math.imul(j,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(A,st)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(k,st)|0,o=o+Math.imul(k,ct)|0,r=r+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,dt)|0;var At=(c+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(L,nt),i=(i=Math.imul(L,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,r=r+Math.imul(I,st)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,st)|0,o=o+Math.imul(P,ct)|0,r=r+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0;var kt=(c+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(j,st)|0,o=o+Math.imul(j,ct)|0,r=r+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0;var Ct=(c+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(L,st),i=(i=Math.imul(L,ct))+Math.imul(F,st)|0,o=Math.imul(F,ct),r=r+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,dt)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(L,lt),i=(i=Math.imul(L,dt))+Math.imul(F,lt)|0,o=Math.imul(F,dt);var Pt=(c+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Nt=(c+(r=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,gt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,gt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,s[0]=mt,s[1]=bt,s[2]=vt,s[3]=yt,s[4]=_t,s[5]=wt,s[6]=St,s[7]=Ot,s[8]=xt,s[9]=Et,s[10]=Mt,s[11]=Tt,s[12]=$t,s[13]=At,s[14]=kt,s[15]=Ct,s[16]=It,s[17]=Pt,s[18]=Nt,0!==c&&(s[19]=c,n.length++),n};function g(t,e,n){return(new m).mulp(t,e,n)}function m(t,e){this.x=t,this.y=e}Math.imul||(p=h),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):n<63?h(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=u,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,t,e):g(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r>=1;return r},m.prototype.permute=function(t,e,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(e=0;e>>26-n}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&u}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"===typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"===typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===u)return this.strip();for(r(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var u,s=r.length-i.length;if("mod"!==e){(u=new o(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c=0;l--){var d=67108864*(0|r.words[i.length+l])+(0|r.words[i.length+l-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,l);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,l),r.isZero()||(r.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:u||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!==(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.isub(t)),{div:u.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,u},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),u=new o(0),s=new o(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),l=e.clone();!e.isZero();){for(var d=0,h=1;0===(e.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,g=1;0===(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(f),s.isub(l)),u.iushrn(1),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(u),a.isub(s)):(n.isub(e),u.isub(i),s.isub(a))}return{a:u,b:s,gcd:n.iushln(c)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),u=new o(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var l=0,d=1;0===(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(u)):(n.isub(e),u.isub(a))}return(i=0===e.cmpn(1)?a:u).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"===typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,u&=67108863,this.words[a]=u}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new O(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var b={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){O.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(b[t])return b[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new _;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new S}return b[t]=e,e},O.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},O.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},O.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},O.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},O.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},O.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},O.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},O.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},O.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},O.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},O.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},O.prototype.isqr=function(t){return this.imul(t,t.clone())},O.prototype.sqr=function(t){return this.mul(t,t)},O.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var u=new o(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(s);)f.redIAdd(s);for(var l=this.pow(f,i),d=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),p=a;0!==h.cmp(u);){for(var g=h,m=0;0!==g.cmp(u);m++)g=g.redSqr();r(m=0;r--){for(var c=e.words[r],f=s-1;f>=0;f--){var l=c>>f&1;i!==n[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++u||0===r&&0===f)&&(i=this.mul(i,n[a]),u=0,a=0)):u=0}s=26}return i},O.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},O.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new x(t)},i(x,O),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(94)(t))},function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=n(898).Buffer}catch(x){}function u(t,e,n){for(var r=0,i=Math.min(t.length,n),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function s(t,e,n,r){for(var i=0,o=Math.min(t.length,n),a=e;a=49?u-49+10:u>=17?u-17+10:u}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"===typeof t)return this._initNumber(t,e,n);if("object"===typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){if(r("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=u(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=u(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,u=Math.min(o,o-a)+n,c=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,u=67108863&a,s=a/67108864|0;n.words[0]=u;for(var c=1;c>>26,l=67108863&s,d=Math.min(c,e.length-1),h=Math.max(0,c-t.length+1);h<=d;h++){var p=c-h|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[h])+l)/67108864|0,l=67108863&a}n.words[c]=0|l,s=0|f}return 0!==s?n.words[c]=0|s:n.length--,n.strip()}o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-s.length]+s+n:s+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],h=l[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(h).toString(t);n=(p=p.idivn(h)).isZero()?g+n:c[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,u,s="le"===e,c=new t(o),f=this.clone();if(s){for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[u]=a;for(;u=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0===(8191&e)&&(n+=13,e>>>=13),0===(127&e)&&(n+=7,e>>>=7),0===(15&e)&&(n+=4,e>>>=4),0===(3&e)&&(n+=2,e>>>=2),0===(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"===typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,h=0|a[1],p=8191&h,g=h>>>13,m=0|a[2],b=8191&m,v=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,S=0|a[4],O=8191&S,x=S>>>13,E=0|a[5],M=8191&E,T=E>>>13,$=0|a[6],A=8191&$,k=$>>>13,C=0|a[7],I=8191&C,P=C>>>13,N=0|a[8],R=8191&N,j=N>>>13,D=0|a[9],L=8191&D,F=D>>>13,B=0|u[0],U=8191&B,z=B>>>13,H=0|u[1],V=8191&H,q=H>>>13,W=0|u[2],G=8191&W,K=W>>>13,Y=0|u[3],Z=8191&Y,Q=Y>>>13,X=0|u[4],J=8191&X,tt=X>>>13,et=0|u[5],nt=8191&et,rt=et>>>13,it=0|u[6],ot=8191&it,at=it>>>13,ut=0|u[7],st=8191&ut,ct=ut>>>13,ft=0|u[8],lt=8191&ft,dt=ft>>>13,ht=0|u[9],pt=8191&ht,gt=ht>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(l,U))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,U)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(g,U)|0,o=Math.imul(g,z);var bt=(c+(r=r+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(d,V)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,U),i=(i=Math.imul(b,z))+Math.imul(v,U)|0,o=Math.imul(v,z),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var vt=(c+(r=r+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,K)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,K)|0;var yt=(c+(r=r+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(x,U)|0,o=Math.imul(x,z),r=r+Math.imul(_,V)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Q)|0;var _t=(c+(r=r+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(M,U),i=(i=Math.imul(M,z))+Math.imul(T,U)|0,o=Math.imul(T,z),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,q)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,tt)|0;var wt=(c+(r=r+Math.imul(l,nt)|0)|0)+((8191&(i=(i=i+Math.imul(l,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,z))+Math.imul(k,U)|0,o=Math.imul(k,z),r=r+Math.imul(M,V)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,K)|0,r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var St=(c+(r=r+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(P,U)|0,o=Math.imul(P,z),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,K)|0,r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Ot=(c+(r=r+Math.imul(l,st)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(d,st)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,z))+Math.imul(j,U)|0,o=Math.imul(j,z),r=r+Math.imul(I,V)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,q)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Q)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(w,nt)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(g,st)|0,o=o+Math.imul(g,ct)|0;var xt=(c+(r=r+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(F,U)|0,o=Math.imul(F,z),r=r+Math.imul(R,V)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,q)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(v,st)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(g,lt)|0,o=o+Math.imul(g,dt)|0;var Et=(c+(r=r+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,q))+Math.imul(F,V)|0,o=Math.imul(F,q),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,K)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0;var Mt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,K))+Math.imul(F,G)|0,o=Math.imul(F,K),r=r+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(O,st)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(x,st)|0,o=o+Math.imul(x,ct)|0,r=r+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0;var Tt=(c+(r=r+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,Q))+Math.imul(F,Z)|0,o=Math.imul(F,Q),r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,st)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,dt)|0;var $t=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,gt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,tt))+Math.imul(F,J)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(j,nt)|0,o=o+Math.imul(j,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(A,st)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(k,st)|0,o=o+Math.imul(k,ct)|0,r=r+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,dt)|0;var At=(c+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(L,nt),i=(i=Math.imul(L,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,r=r+Math.imul(I,st)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,st)|0,o=o+Math.imul(P,ct)|0,r=r+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0;var kt=(c+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(j,st)|0,o=o+Math.imul(j,ct)|0,r=r+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0;var Ct=(c+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(L,st),i=(i=Math.imul(L,ct))+Math.imul(F,st)|0,o=Math.imul(F,ct),r=r+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,dt)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(L,lt),i=(i=Math.imul(L,dt))+Math.imul(F,lt)|0,o=Math.imul(F,dt);var Pt=(c+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Nt=(c+(r=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,gt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,gt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,s[0]=mt,s[1]=bt,s[2]=vt,s[3]=yt,s[4]=_t,s[5]=wt,s[6]=St,s[7]=Ot,s[8]=xt,s[9]=Et,s[10]=Mt,s[11]=Tt,s[12]=$t,s[13]=At,s[14]=kt,s[15]=Ct,s[16]=It,s[17]=Pt,s[18]=Nt,0!==c&&(s[19]=c,n.length++),n};function p(t,e,n){return(new g).mulp(t,e,n)}function g(t,e){this.x=t,this.y=e}Math.imul||(h=d),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=u,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r>=1;return r},g.prototype.permute=function(t,e,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(e=0;e>>26-n}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&u}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"===typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"===typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===u)return this.strip();for(r(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var u,s=r.length-i.length;if("mod"!==e){(u=new o(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c=0;l--){var d=67108864*(0|r.words[i.length+l])+(0|r.words[i.length+l-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,l);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,l),r.isZero()||(r.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:u||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!==(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.isub(t)),{div:u.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,u},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),u=new o(0),s=new o(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),l=e.clone();!e.isZero();){for(var d=0,h=1;0===(e.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,g=1;0===(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(f),s.isub(l)),u.iushrn(1),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(u),a.isub(s)):(n.isub(e),u.isub(i),s.isub(a))}return{a:u,b:s,gcd:n.iushln(c)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),u=new o(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var l=0,d=1;0===(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(u)):(n.isub(e),u.isub(a))}return(i=0===e.cmpn(1)?a:u).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"===typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,u&=67108863,this.words[a]=u}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function O(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var u=new o(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(s);)f.redIAdd(s);for(var l=this.pow(f,i),d=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),p=a;0!==h.cmp(u);){for(var g=h,m=0;0!==g.cmp(u);m++)g=g.redSqr();r(m=0;r--){for(var c=e.words[r],f=s-1;f>=0;f--){var l=c>>f&1;i!==n[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++u||0===r&&0===f)&&(i=this.mul(i,n[a]),u=0,a=0)):u=0}s=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new O(t)},i(O,S),O.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},O.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},O.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(94)(t))},function(t,e,n){(function(t){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}function o(t,e,n){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(n=e,e=10),this._init(t||0,e||10,n||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=n(923).Buffer}catch(x){}function u(t,e,n){for(var r=0,i=Math.min(t.length,n),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return r}function s(t,e,n,r){for(var i=0,o=Math.min(t.length,n),a=e;a=49?u-49+10:u>=17?u-17+10:u}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,n){if("number"===typeof t)return this._initNumber(t,e,n);if("object"===typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initNumber=function(t,e,n){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},o.prototype._initArray=function(t,e,n){if(r("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===n)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=6)i=u(t,n,n+6),this.words[r]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,r++);n+6!==e&&(i=u(t,e,n+6),this.words[r]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=e)r++;r--,i=i/e|0;for(var o=t.length-n,a=o%r,u=Math.min(o,o-a)+n,c=0,f=n;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function d(t,e,n){n.negative=e.negative^t.negative;var r=t.length+e.length|0;n.length=r,r=r-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,u=67108863&a,s=a/67108864|0;n.words[0]=u;for(var c=1;c>>26,l=67108863&s,d=Math.min(c,e.length-1),h=Math.max(0,c-t.length+1);h<=d;h++){var p=c-h|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[h])+l)/67108864|0,l=67108863&a}n.words[c]=0|l,s=0|f}return 0!==s?n.words[c]=0|s:n.length--,n.strip()}o.prototype.toString=function(t,e){var n;if(e=0|e||1,16===(t=t||10)||"hex"===t){n="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-s.length]+s+n:s+n,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(n=o.toString(16)+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var d=f[t],h=l[t];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(h).toString(t);n=(p=p.idivn(h)).isZero()?g+n:c[d-g.length]+g+n}for(this.isZero()&&(n="0"+n);n.length%e!==0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return r("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var a,u,s="le"===e,c=new t(o),f=this.clone();if(s){for(u=0;!f.isZero();u++)a=f.andln(255),f.iushrn(8),c[u]=a;for(;u=4096&&(n+=13,e>>>=13),e>=64&&(n+=7,e>>>=7),e>=8&&(n+=4,e>>>=4),e>=2&&(n+=2,e>>>=2),n+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,n=0;return 0===(8191&e)&&(n+=13,e>>>=13),0===(127&e)&&(n+=7,e>>>=7),0===(15&e)&&(n+=4,e>>>=4),0===(3&e)&&(n+=2,e>>>=2),0===(1&e)&&n++,n},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var n=0;nt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,n;this.length>t.length?(e=this,n=t):(e=t,n=this);for(var r=0;rt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){r("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),n=t%26;this._expand(e),n>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){r("number"===typeof t&&t>=0);var n=t/26|0,i=t%26;return this._expand(n+1),this.words[n]=e?this.words[n]|1<t.length?(n=this,r=t):(n=t,r=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n,r,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=t):(n=t,r=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,h=0|a[1],p=8191&h,g=h>>>13,m=0|a[2],b=8191&m,v=m>>>13,y=0|a[3],_=8191&y,w=y>>>13,S=0|a[4],O=8191&S,x=S>>>13,E=0|a[5],M=8191&E,T=E>>>13,$=0|a[6],A=8191&$,k=$>>>13,C=0|a[7],I=8191&C,P=C>>>13,N=0|a[8],R=8191&N,j=N>>>13,D=0|a[9],L=8191&D,F=D>>>13,B=0|u[0],U=8191&B,z=B>>>13,H=0|u[1],V=8191&H,q=H>>>13,W=0|u[2],G=8191&W,K=W>>>13,Y=0|u[3],Z=8191&Y,Q=Y>>>13,X=0|u[4],J=8191&X,tt=X>>>13,et=0|u[5],nt=8191&et,rt=et>>>13,it=0|u[6],ot=8191&it,at=it>>>13,ut=0|u[7],st=8191&ut,ct=ut>>>13,ft=0|u[8],lt=8191&ft,dt=ft>>>13,ht=0|u[9],pt=8191&ht,gt=ht>>>13;n.negative=t.negative^e.negative,n.length=19;var mt=(c+(r=Math.imul(l,U))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,U)|0))<<13)|0;c=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,r=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(g,U)|0,o=Math.imul(g,z);var bt=(c+(r=r+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(d,V)|0))<<13)|0;c=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,r=Math.imul(b,U),i=(i=Math.imul(b,z))+Math.imul(v,U)|0,o=Math.imul(v,z),r=r+Math.imul(p,V)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,q)|0;var vt=(c+(r=r+Math.imul(l,G)|0)|0)+((8191&(i=(i=i+Math.imul(l,K)|0)+Math.imul(d,G)|0))<<13)|0;c=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,r=Math.imul(_,U),i=(i=Math.imul(_,z))+Math.imul(w,U)|0,o=Math.imul(w,z),r=r+Math.imul(b,V)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,q)|0,r=r+Math.imul(p,G)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,K)|0;var yt=(c+(r=r+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(d,Z)|0))<<13)|0;c=((o=o+Math.imul(d,Q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,r=Math.imul(O,U),i=(i=Math.imul(O,z))+Math.imul(x,U)|0,o=Math.imul(x,z),r=r+Math.imul(_,V)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(w,V)|0,o=o+Math.imul(w,q)|0,r=r+Math.imul(b,G)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,K)|0,r=r+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,Q)|0;var _t=(c+(r=r+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,J)|0))<<13)|0;c=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,r=Math.imul(M,U),i=(i=Math.imul(M,z))+Math.imul(T,U)|0,o=Math.imul(T,z),r=r+Math.imul(O,V)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,q)|0,r=r+Math.imul(_,G)|0,i=(i=i+Math.imul(_,K)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,K)|0,r=r+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,Q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,Q)|0,r=r+Math.imul(p,J)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,tt)|0;var wt=(c+(r=r+Math.imul(l,nt)|0)|0)+((8191&(i=(i=i+Math.imul(l,rt)|0)+Math.imul(d,nt)|0))<<13)|0;c=((o=o+Math.imul(d,rt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,r=Math.imul(A,U),i=(i=Math.imul(A,z))+Math.imul(k,U)|0,o=Math.imul(k,z),r=r+Math.imul(M,V)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,q)|0,r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,K)|0,r=r+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,Q)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,Q)|0,r=r+Math.imul(b,J)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,tt)|0,r=r+Math.imul(p,nt)|0,i=(i=i+Math.imul(p,rt)|0)+Math.imul(g,nt)|0,o=o+Math.imul(g,rt)|0;var St=(c+(r=r+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(d,ot)|0))<<13)|0;c=((o=o+Math.imul(d,at)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,r=Math.imul(I,U),i=(i=Math.imul(I,z))+Math.imul(P,U)|0,o=Math.imul(P,z),r=r+Math.imul(A,V)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,q)|0,r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,K)|0,r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,Q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Q)|0,r=r+Math.imul(_,J)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(w,J)|0,o=o+Math.imul(w,tt)|0,r=r+Math.imul(b,nt)|0,i=(i=i+Math.imul(b,rt)|0)+Math.imul(v,nt)|0,o=o+Math.imul(v,rt)|0,r=r+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,at)|0;var Ot=(c+(r=r+Math.imul(l,st)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(d,st)|0))<<13)|0;c=((o=o+Math.imul(d,ct)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,r=Math.imul(R,U),i=(i=Math.imul(R,z))+Math.imul(j,U)|0,o=Math.imul(j,z),r=r+Math.imul(I,V)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,q)|0,r=r+Math.imul(A,G)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,K)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,Q)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,tt)|0,r=r+Math.imul(_,nt)|0,i=(i=i+Math.imul(_,rt)|0)+Math.imul(w,nt)|0,o=o+Math.imul(w,rt)|0,r=r+Math.imul(b,ot)|0,i=(i=i+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,r=r+Math.imul(p,st)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(g,st)|0,o=o+Math.imul(g,ct)|0;var xt=(c+(r=r+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;c=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,r=Math.imul(L,U),i=(i=Math.imul(L,z))+Math.imul(F,U)|0,o=Math.imul(F,z),r=r+Math.imul(R,V)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,q)|0,r=r+Math.imul(I,G)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,K)|0,r=r+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,Q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,Q)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,tt)|0,r=r+Math.imul(O,nt)|0,i=(i=i+Math.imul(O,rt)|0)+Math.imul(x,nt)|0,o=o+Math.imul(x,rt)|0,r=r+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,at)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,at)|0,r=r+Math.imul(b,st)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(v,st)|0,o=o+Math.imul(v,ct)|0,r=r+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(g,lt)|0,o=o+Math.imul(g,dt)|0;var Et=(c+(r=r+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,gt)|0)+Math.imul(d,pt)|0))<<13)|0;c=((o=o+Math.imul(d,gt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,r=Math.imul(L,V),i=(i=Math.imul(L,q))+Math.imul(F,V)|0,o=Math.imul(F,q),r=r+Math.imul(R,G)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(j,G)|0,o=o+Math.imul(j,K)|0,r=r+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,Q)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,Q)|0,r=r+Math.imul(A,J)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,tt)|0,r=r+Math.imul(M,nt)|0,i=(i=i+Math.imul(M,rt)|0)+Math.imul(T,nt)|0,o=o+Math.imul(T,rt)|0,r=r+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,at)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,at)|0,r=r+Math.imul(_,st)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(w,st)|0,o=o+Math.imul(w,ct)|0,r=r+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0;var Mt=(c+(r=r+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,gt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,K))+Math.imul(F,G)|0,o=Math.imul(F,K),r=r+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,Q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,Q)|0,r=r+Math.imul(I,J)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,tt)|0,r=r+Math.imul(A,nt)|0,i=(i=i+Math.imul(A,rt)|0)+Math.imul(k,nt)|0,o=o+Math.imul(k,rt)|0,r=r+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,at)|0,r=r+Math.imul(O,st)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(x,st)|0,o=o+Math.imul(x,ct)|0,r=r+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(w,lt)|0,o=o+Math.imul(w,dt)|0;var Tt=(c+(r=r+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,gt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,gt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,Q))+Math.imul(F,Z)|0,o=Math.imul(F,Q),r=r+Math.imul(R,J)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,tt)|0,r=r+Math.imul(I,nt)|0,i=(i=i+Math.imul(I,rt)|0)+Math.imul(P,nt)|0,o=o+Math.imul(P,rt)|0,r=r+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,r=r+Math.imul(M,st)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(T,st)|0,o=o+Math.imul(T,ct)|0,r=r+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,dt)|0)+Math.imul(x,lt)|0,o=o+Math.imul(x,dt)|0;var $t=(c+(r=r+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,gt)|0)+Math.imul(w,pt)|0))<<13)|0;c=((o=o+Math.imul(w,gt)|0)+(i>>>13)|0)+($t>>>26)|0,$t&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,tt))+Math.imul(F,J)|0,o=Math.imul(F,tt),r=r+Math.imul(R,nt)|0,i=(i=i+Math.imul(R,rt)|0)+Math.imul(j,nt)|0,o=o+Math.imul(j,rt)|0,r=r+Math.imul(I,ot)|0,i=(i=i+Math.imul(I,at)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,at)|0,r=r+Math.imul(A,st)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(k,st)|0,o=o+Math.imul(k,ct)|0,r=r+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,dt)|0;var At=(c+(r=r+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,gt)|0)+Math.imul(x,pt)|0))<<13)|0;c=((o=o+Math.imul(x,gt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,r=Math.imul(L,nt),i=(i=Math.imul(L,rt))+Math.imul(F,nt)|0,o=Math.imul(F,rt),r=r+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,r=r+Math.imul(I,st)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(P,st)|0,o=o+Math.imul(P,ct)|0,r=r+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0;var kt=(c+(r=r+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,gt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,gt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,r=Math.imul(L,ot),i=(i=Math.imul(L,at))+Math.imul(F,ot)|0,o=Math.imul(F,at),r=r+Math.imul(R,st)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(j,st)|0,o=o+Math.imul(j,ct)|0,r=r+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,dt)|0)+Math.imul(P,lt)|0,o=o+Math.imul(P,dt)|0;var Ct=(c+(r=r+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,gt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,gt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,r=Math.imul(L,st),i=(i=Math.imul(L,ct))+Math.imul(F,st)|0,o=Math.imul(F,ct),r=r+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,dt)|0;var It=(c+(r=r+Math.imul(I,pt)|0)|0)+((8191&(i=(i=i+Math.imul(I,gt)|0)+Math.imul(P,pt)|0))<<13)|0;c=((o=o+Math.imul(P,gt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,r=Math.imul(L,lt),i=(i=Math.imul(L,dt))+Math.imul(F,lt)|0,o=Math.imul(F,dt);var Pt=(c+(r=r+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,gt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,gt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var Nt=(c+(r=Math.imul(L,pt))|0)+((8191&(i=(i=Math.imul(L,gt))+Math.imul(F,pt)|0))<<13)|0;return c=((o=Math.imul(F,gt))+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,s[0]=mt,s[1]=bt,s[2]=vt,s[3]=yt,s[4]=_t,s[5]=wt,s[6]=St,s[7]=Ot,s[8]=xt,s[9]=Et,s[10]=Mt,s[11]=Tt,s[12]=$t,s[13]=At,s[14]=kt,s[15]=Ct,s[16]=It,s[17]=Pt,s[18]=Nt,0!==c&&(s[19]=c,n.length++),n};function p(t,e,n){return(new g).mulp(t,e,n)}function g(t,e){this.x=t,this.y=e}Math.imul||(h=d),o.prototype.mulTo=function(t,e){var n=this.length+t.length;return 10===this.length&&10===t.length?h(this,t,e):n<63?d(this,t,e):n<1024?function(t,e,n){n.negative=e.negative^t.negative,n.length=t.length+e.length;for(var r=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}n.words[o]=u,r=a,a=i}return 0!==r?n.words[o]=r:n.length--,n.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),n=o.prototype._countBits(t)-1,r=0;r>=1;return r},g.prototype.permute=function(t,e,n,r,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,n[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[n]=67108863&o}return 0!==e&&(this.words[n]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),n=0;n>>i}return e}(t);if(0===e.length)return new o(1);for(var n=this,r=0;r=0);var e,n=t%26,i=(t-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var a=0;for(e=0;e>>26-n}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&u}return s&&0!==f&&(s.words[s.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,n){return r(0===this.negative),this.iushrn(t,e,n)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){r("number"===typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==e&&n++,this.length=Math.min(n,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(r("number"===typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(s/67108864|0),this.words[i+n]=67108863&o}for(;i>26,this.words[i+n]=67108863&o;if(0===u)return this.strip();for(r(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var n=(this.length,t.length),r=this.clone(),i=t,a=0|i.words[i.length-1];0!==(n=26-this._countBits(a))&&(i=i.ushln(n),r.iushln(n),a=0|i.words[i.length-1]);var u,s=r.length-i.length;if("mod"!==e){(u=new o(null)).length=s+1,u.words=new Array(u.length);for(var c=0;c=0;l--){var d=67108864*(0|r.words[i.length+l])+(0|r.words[i.length+l-1]);for(d=Math.min(d/a|0,67108863),r._ishlnsubmul(i,d,l);0!==r.negative;)d--,r.negative=0,r._ishlnsubmul(i,1,l),r.isZero()||(r.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),r.strip(),"div"!==e&&0!==n&&r.iushrn(n),{div:u||null,mod:r}},o.prototype.divmod=function(t,e,n){return r(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!==(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(a=u.mod.neg(),n&&0!==a.negative&&a.isub(t)),{div:u.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,u},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var n=0!==e.div.negative?e.mod.isub(t):e.mod,r=t.ushrn(1),i=t.andln(1),o=n.cmp(r);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+(0|this.words[i]))%t;return n},o.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),u=new o(0),s=new o(1),c=0;e.isEven()&&n.isEven();)e.iushrn(1),n.iushrn(1),++c;for(var f=n.clone(),l=e.clone();!e.isZero();){for(var d=0,h=1;0===(e.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,g=1;0===(n.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(u.isOdd()||s.isOdd())&&(u.iadd(f),s.isub(l)),u.iushrn(1),s.iushrn(1);e.cmp(n)>=0?(e.isub(n),i.isub(u),a.isub(s)):(n.isub(e),u.isub(i),s.isub(a))}return{a:u,b:s,gcd:n.iushln(c)}},o.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e=this,n=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),u=new o(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(var c=0,f=1;0===(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(s),a.iushrn(1);for(var l=0,d=1;0===(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(s),u.iushrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(u)):(n.isub(e),u.isub(a))}return(i=0===e.cmpn(1)?a:u).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),n=t.clone();e.negative=0,n.negative=0;for(var r=0;e.isEven()&&n.isEven();r++)e.iushrn(1),n.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=e.cmp(n);if(i<0){var o=e;e=n,n=o}else if(0===i||0===n.cmpn(1))break;e.isub(n)}return n.iushln(r)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){r("number"===typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,u&=67108863,this.words[a]=u}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,n=t<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)e=1;else{n&&(t=-t),r(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;n--){var r=0|this.words[n],i=0|t.words[n];if(r!==i){ri&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function b(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function O(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},b.prototype.ireduce=function(t){var e,n=t;do{this.split(n,this.tmp),e=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(e>this.n);var r=e0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},b.prototype.split=function(t,e){t.iushrn(this.n,0,e)},b.prototype.imulK=function(t){return t.imul(this.k)},i(v,b),v.prototype.split=function(t,e){for(var n=4194303,r=Math.min(t.length,9),i=0;i>>22,o=a}o>>>=22,t.words[i-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,n=0;n>>=26,t.words[n]=i,e=r}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},S.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){r(0===(t.negative|e.negative),"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var n=t.add(e);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var n=t.iadd(e);return n.cmp(this.m)>=0&&n.isub(this.m),n},S.prototype.sub=function(t,e){this._verify2(t,e);var n=t.sub(e);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var n=t.isub(e);return n.cmpn(0)<0&&n.iadd(this.m),n},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2===1),3===e){var n=this.m.add(new o(1)).iushrn(2);return this.pow(t,n)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);r(!i.isZero());var u=new o(1).toRed(this),s=u.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(s);)f.redIAdd(s);for(var l=this.pow(f,i),d=this.pow(t,i.addn(1).iushrn(1)),h=this.pow(t,i),p=a;0!==h.cmp(u);){for(var g=h,m=0;0!==g.cmp(u);m++)g=g.redSqr();r(m=0;r--){for(var c=e.words[r],f=s-1;f>=0;f--){var l=c>>f&1;i!==n[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++u||0===r&&0===f)&&(i=this.mul(i,n[a]),u=0,a=0)):u=0}s=26}return i},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new O(t)},i(O,S),O.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},O.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},O.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},O.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},O.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(94)(t))},function(t,e,n){"use strict";(function(e){n(29);var r=n(100),i=n(118),o=n(153),a=n(160),u=n(134),s=n(78),c=n(84),f=n(375),l=n(386),d=n(52),h=n(63),p=n(514),g=n(49),m=p.SCRIPT_ENABLE_SIGHASH_FORKID,b=function(t,f,l,b,v,y){var _=n(387),w=n(388);g.isUndefined(y)&&(y=m);var S,O=_.shallowCopy(t);(b=new i(b),y&p.SCRIPT_ENABLE_REPLAY_PROTECTION)&&(f=(16711680|57005^f>>8)<<8|255&f);if(f&r.SIGHASH_FORKID&&y&p.SCRIPT_ENABLE_SIGHASH_FORKID)return function(t,e,n,i,o){var f=t.inputs[n];function l(t,e){var n=new u;g.isUndefined(e)?g.each(t.outputs,(function(t){t.toBufferWriter(n)})):t.outputs[e].toBufferWriter(n);var r=n.toBuffer();return c.sha256sha256(r)}d.checkArgument(o instanceof s,"For ForkId=0 signatures, satoshis or complete input must be provided");var p=h.emptyBuffer(32),m=h.emptyBuffer(32),b=h.emptyBuffer(32);e&r.SIGHASH_ANYONECANPAY||(p=function(t){var e=new u;g.each(t.inputs,(function(t){e.writeReverse(t.prevTxId),e.writeUInt32LE(t.outputIndex)}));var n=e.toBuffer();return c.sha256sha256(n)}(t)),e&r.SIGHASH_ANYONECANPAY||(31&e)==r.SIGHASH_SINGLE||(31&e)==r.SIGHASH_NONE||(m=function(t){var e=new u;g.each(t.inputs,(function(t){e.writeUInt32LE(t.sequenceNumber)}));var n=e.toBuffer();return c.sha256sha256(n)}(t)),(31&e)!=r.SIGHASH_SINGLE&&(31&e)!=r.SIGHASH_NONE?b=l(t):(31&e)==r.SIGHASH_SINGLE&&n>>0);var _=v.toBuffer(),w=c.sha256sha256(_);return new a(w).readReverse()}(O,f,l,b,v);for(b.removeCodeseparators(),S=0;S=O.outputs.length)return e.from("0000000000000000000000000000000000000000000000000000000000000001","hex");for(O.outputs.length=l+1,S=0;S9007199254740991?"transaction txout satoshis greater than max safe integer":this._satoshis!==this._satoshisBN.toNumber()?"transaction txout satoshis has corrupted value":this._satoshis<0&&"transaction txout negative"},Object.defineProperty(l.prototype,"satoshisBN",{configurable:!1,enumerable:!0,get:function(){return this._satoshisBN},set:function(t){this._satoshisBN=t,this._satoshis=t.toNumber(),c.checkState(a.isNaturalNumber(this._satoshis),"Output satoshis is not a natural number")}}),l.prototype.toObject=l.prototype.toJSON=function(){var t={satoshis:this.satoshis};return t.script=this._scriptBuffer.toString("hex"),t},l.fromObject=function(t){return new l(t)},l.prototype.setScriptFromBuffer=function(t){this._scriptBuffer=t;try{this._script=s.fromBuffer(this._scriptBuffer),this._script._isOutput=!0}catch(e){if(!(e instanceof f.Script.InvalidBuffer))throw e;this._script=null}},l.prototype.setScript=function(t){if(t instanceof s)this._scriptBuffer=t.toBuffer(),this._script=t,this._script._isOutput=!0;else if(r.isString(t))this._script=s.fromString(t),this._scriptBuffer=this._script.toBuffer(),this._script._isOutput=!0;else{if(!o.isBuffer(t))throw new TypeError("Invalid argument type: script");this.setScriptFromBuffer(t)}return this},l.prototype.inspect=function(){var t;return t=this.script?this.script.inspect():this._scriptBuffer.toString("hex"),""},l.fromBufferReader=function(t){var n={};n.satoshis=t.readUInt64LEBN();var r=t.readVarintNum();return n.script=0!==r?t.read(r):e.from([]),new l(n)},l.prototype.toBufferWriter=function(t){t||(t=new u),t.writeUInt64LEBN(this._satoshisBN);var e=this._scriptBuffer;return t.writeVarintNum(e.length),t.write(e),t},t.exports=l}).call(this,n(29).Buffer)},function(t,e,n){"use strict";(function(t){var r=n(291),i="object"==typeof exports&&exports&&!exports.nodeType&&exports,o=i&&"object"==typeof t&&t&&!t.nodeType&&t,a=o&&o.exports===i&&r.a.process,u=function(){try{var t=o&&o.require&&o.require("util").types;return t||a&&a.binding&&a.binding("util")}catch(e){}}();e.a=u}).call(this,n(253)(t))},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(37).Buffer,i=n(758).Transform,o=n(238).StringDecoder;function a(t){i.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}n(38)(a,i),a.prototype.update=function(t,e,n){"string"===typeof t&&(t=r.from(t,e));var i=this._update(t);return this.hashMode?this:(n&&(i=this._toString(i,n)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,n){var r;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(i){r=i}finally{n(r)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(n){e=n}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||r.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,n){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var r=this._decoder.write(t);return n&&(r+=this._decoder.end()),r},t.exports=a},function(t,e,n){var r=n(158);function i(t){return r("rmd160").update(t).digest()}function o(t){return r("sha256").update(t).digest()}t.exports={hash160:function(t){return i(o(t))},hash256:function(t){return o(o(t))},ripemd160:i,sha1:function(t){return r("sha1").update(t).digest()},sha256:o}},function(t,e,n){"use strict";var r=n(38),i=n(358),o=n(360),a=n(361),u=n(156);function s(t){u.call(this,"digest"),this._hash=t}r(s,u),s.prototype._update=function(t){this._hash.update(t)},s.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new s(a(t))}},function(t,e,n){"use strict";var r=n(49),i=n(63),o=n(79),a=[],u={};function s(){}function c(t,e){if(~a.indexOf(t))return t;if(!e)return u[t];r.isArray(e)||(e=[e]);for(var n=0;n=this.buf.length},u.prototype.finished=u.prototype.eof,u.prototype.read=function(t){i.checkArgument(!r.isUndefined(t),"Must specify a length");var e=this.buf.slice(this.pos,this.pos+t);return this.pos=this.pos+t,e},u.prototype.readAll=function(){var t=this.buf.slice(this.pos,this.buf.length);return this.pos=this.buf.length,t},u.prototype.readUInt8=function(){var t=this.buf.readUInt8(this.pos);return this.pos=this.pos+1,t},u.prototype.readUInt16BE=function(){var t=this.buf.readUInt16BE(this.pos);return this.pos=this.pos+2,t},u.prototype.readUInt16LE=function(){var t=this.buf.readUInt16LE(this.pos);return this.pos=this.pos+2,t},u.prototype.readUInt32BE=function(){var t=this.buf.readUInt32BE(this.pos);return this.pos=this.pos+4,t},u.prototype.readUInt32LE=function(){var t=this.buf.readUInt32LE(this.pos);return this.pos=this.pos+4,t},u.prototype.readInt32LE=function(){var t=this.buf.readInt32LE(this.pos);return this.pos=this.pos+4,t},u.prototype.readUInt64BEBN=function(){var t=this.buf.slice(this.pos,this.pos+8),e=a.fromBuffer(t);return this.pos=this.pos+8,e},u.prototype.readUInt64LEBN=function(){var t,e=this.buf.readUInt32LE(this.pos),n=4294967296*this.buf.readUInt32LE(this.pos+4)+e;if(n<=9007199254740991)t=new a(n);else{var r=Array.prototype.slice.call(this.buf,this.pos,this.pos+8);t=new a(r,10,"le")}return this.pos=this.pos+8,t},u.prototype.readVarintNum=function(){var t=this.readUInt8();switch(t){case 253:return this.readUInt16LE();case 254:return this.readUInt32LE();case 255:var e=this.readUInt64LEBN().toNumber();if(e<=Math.pow(2,53))return e;throw new Error("number too large to retain precision - use readVarintBN");default:return t}},u.prototype.readVarLengthBuffer=function(){var t=this.readVarintNum(),e=this.read(t);return i.checkState(e.length===t,"Invalid length while reading varlength buffer. Expected to read: "+t+" and read "+e.length),e},u.prototype.readVarintBuf=function(){switch(this.buf.readUInt8(this.pos)){case 253:return this.read(3);case 254:return this.read(5);case 255:return this.read(9);default:return this.read(1)}},u.prototype.readVarintBN=function(){var t=this.readUInt8();switch(t){case 253:return new a(this.readUInt16LE());case 254:return new a(this.readUInt32LE());case 255:return this.readUInt64LEBN();default:return new a(t)}},u.prototype.reverse=function(){for(var t=e.alloc(this.buf.length),n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var n=0;n>6),e+=String.fromCharCode(128|63&r)):r<55296||r>=57344?(e+=String.fromCharCode(224|r>>12),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|63&r)):(n++,r=65536+((1023&r)<<10|1023&t.charCodeAt(n)),e+=String.fromCharCode(240|r>>18),e+=String.fromCharCode(128|r>>12&63),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|63&r))}return e}var w={size:128,level:"L",bgColor:"#FFFFFF",fgColor:"#000000",includeMargin:!1},S={value:b.string.isRequired,size:b.number,level:b.oneOf(["L","M","Q","H"]),bgColor:b.string,fgColor:b.string,includeMargin:b.bool};function O(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=[];return t.forEach((function(t,r){var i=null;t.forEach((function(o,a){if(!o&&null!==i)return n.push("M".concat(i+e," ").concat(r+e,"h").concat(a-i,"v1H").concat(i+e,"z")),void(i=null);if(a!==t.length-1)o&&null===i&&(i=a);else{if(!o)return;null===i?n.push("M".concat(a+e,",").concat(r+e," h1v1H").concat(a+e,"z")):n.push("M".concat(i+e,",").concat(r+e," h").concat(a+1-i,"v1H").concat(i+e,"z"))}}))})),n.join("")}var x=function(){try{(new Path2D).addPath(new Path2D)}catch(t){return!1}return!0}(),E=function(t){function e(){var t,n;u(this,e);for(var r=arguments.length,i=new Array(r),o=0;o=this._maxSize&&this.clear(),t in this._values||this._size++,this._values[t]=e};var i=/[^.^\]^[]+|(?=\[\]|\.\.)/g,o=/^\d+$/,a=/^\d/,u=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,s=/^\s*(['"]?)(.*?)(\1)\s*$/,c=new r(512),f=new r(512),l=new r(512);function d(t){return c.get(t)||c.set(t,h(t).map((function(t){return t.replace(s,"$2")})))}function h(t){return t.match(i)}function p(t){return"string"===typeof t&&t&&-1!==["'",'"'].indexOf(t.charAt(0))}function g(t){return!p(t)&&(function(t){return t.match(a)&&!t.match(o)}(t)||function(t){return u.test(t)}(t))}t.exports={Cache:r,split:h,normalizePath:d,setter:function(t){var e=d(t);return f.get(t)||f.set(t,(function(t,n){for(var r=0,i=e.length,o=t;r0?"in "+i:i+" ago":i};function o(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,r=t.formats[n]||t.formats[t.defaultWidth];return r}}var a={date:o({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:o({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:o({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},u={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function s(t){return function(e,n){var r,i=n||{};if("formatting"===(i.context?String(i.context):"standalone")&&t.formattingValues){var o=t.defaultFormattingWidth||t.defaultWidth,a=i.width?String(i.width):o;r=t.formattingValues[a]||t.formattingValues[o]}else{var u=t.defaultWidth,s=i.width?String(i.width):t.defaultWidth;r=t.values[s]||t.values[u]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function c(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,i=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(i);if(!o)return null;var a,u=o[0],s=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(s)?l(s,(function(t){return t.test(u)})):f(s,(function(t){return t.test(u)}));a=t.valueCallback?t.valueCallback(c):c,a=n.valueCallback?n.valueCallback(a):a;var d=e.slice(u.length);return{value:a,rest:d}}}function f(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function l(t,e){for(var n=0;n20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:s({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:s({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:s({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:s({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:s({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(d={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.match(d.matchPattern);if(!n)return null;var r=n[0],i=t.match(d.parsePattern);if(!i)return null;var o=d.valueCallback?d.valueCallback(i[0]):i[0];o=e.valueCallback?e.valueCallback(o):o;var a=t.slice(r.length);return{value:o,rest:a}}),era:c({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:c({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:c({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:c({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:c({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};e.a=h},function(t,e,n){"use strict";function r(t,e){for(var n=0;n0}var g,m=function(t){function e(n){var r=n.graphQLErrors,i=n.networkError,o=n.errorMessage,a=n.extraInfo,u=t.call(this,o)||this;return u.graphQLErrors=r||[],u.networkError=i||null,u.message=o||function(t){var e="";return p(t.graphQLErrors)&&t.graphQLErrors.forEach((function(t){var n=t?t.message:"Error message not found.";e+="GraphQL error: "+n+"\n"})),t.networkError&&(e+="Network error: "+t.networkError.message+"\n"),e=e.replace(/\n$/,"")}(u),u.extraInfo=a,u.__proto__=e.prototype,u}return Object(i.c)(e,t),e}(Error);!function(t){t[t.normal=1]="normal",t[t.refetch=2]="refetch",t[t.poll=3]="poll"}(g||(g={}));var b=function(t){function e(e){var n=e.queryManager,r=e.options,i=e.shouldSubscribe,a=void 0===i||i,u=t.call(this,(function(t){return u.onSubscribe(t)}))||this;u.observers=new Set,u.subscriptions=new Set,u.isTornDown=!1,u.options=r,u.variables=r.variables||{},u.queryId=n.generateQueryId(),u.shouldSubscribe=a;var s=Object(o.m)(r.query);return u.queryName=s&&s.name&&s.name.value,u.queryManager=n,u}return Object(i.c)(e,t),e.prototype.result=function(){var t=this;return new Promise((function(e,n){var r={next:function(n){e(n),t.observers.delete(r),t.observers.size||t.queryManager.removeQuery(t.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=t.subscribe(r)}))},e.prototype.currentResult=function(){var t=this.getCurrentResult();return void 0===t.data&&(t.data={}),t},e.prototype.getCurrentResult=function(){if(this.isTornDown){var t=this.lastResult;return{data:!this.lastError&&t&&t.data||void 0,error:this.lastError,loading:!1,networkStatus:r.error}}var e,n,o,a=this.queryManager.getCurrentQueryResult(this),u=a.data,s=a.partial,c=this.queryManager.queryStore.get(this.queryId),f=this.options.fetchPolicy,l="network-only"===f||"no-cache"===f;if(c){var h=c.networkStatus;if(n=c,void 0===(o=this.options.errorPolicy)&&(o="none"),n&&(n.networkError||"none"===o&&p(n.graphQLErrors)))return{data:void 0,loading:!1,networkStatus:h,error:new m({graphQLErrors:c.graphQLErrors,networkError:c.networkError})};c.variables&&(this.options.variables=Object(i.a)(Object(i.a)({},this.options.variables),c.variables),this.variables=this.options.variables),e={data:u,loading:d(h),networkStatus:h},c.graphQLErrors&&"all"===this.options.errorPolicy&&(e.errors=c.graphQLErrors)}else{var g=l||s&&"cache-only"!==f;e={data:u,loading:g,networkStatus:g?r.loading:r.ready}}return s||this.updateLastResult(Object(i.a)(Object(i.a)({},e),{stale:!1})),Object(i.a)(Object(i.a)({},e),{partial:s})},e.prototype.isDifferentFromLastResult=function(t){var e=this.lastResultSnapshot;return!(e&&t&&e.networkStatus===t.networkStatus&&e.stale===t.stale&&Object(a.a)(e.data,t.data))},e.prototype.getLastResult=function(){return this.lastResult},e.prototype.getLastError=function(){return this.lastError},e.prototype.resetLastResults=function(){delete this.lastResult,delete this.lastResultSnapshot,delete this.lastError,this.isTornDown=!1},e.prototype.resetQueryStoreErrors=function(){var t=this.queryManager.queryStore.get(this.queryId);t&&(t.networkError=null,t.graphQLErrors=[])},e.prototype.refetch=function(t){var e=this.options.fetchPolicy;return"cache-only"===e?Promise.reject(new f.a(1)):("no-cache"!==e&&"cache-and-network"!==e&&(e="network-only"),Object(a.a)(this.variables,t)||(this.variables=Object(i.a)(Object(i.a)({},this.variables),t)),Object(a.a)(this.options.variables,this.variables)||(this.options.variables=Object(i.a)(Object(i.a)({},this.options.variables),this.variables)),this.queryManager.fetchQuery(this.queryId,Object(i.a)(Object(i.a)({},this.options),{fetchPolicy:e}),g.refetch))},e.prototype.fetchMore=function(t){var e=this;Object(f.b)(t.updateQuery,2);var n=Object(i.a)(Object(i.a)({},t.query?t:Object(i.a)(Object(i.a)(Object(i.a)({},this.options),t),{variables:Object(i.a)(Object(i.a)({},this.variables),t.variables)})),{fetchPolicy:"network-only"}),r=this.queryManager.generateQueryId();return this.queryManager.fetchQuery(r,n,g.normal,this.queryId).then((function(i){return e.updateQuery((function(e){return t.updateQuery(e,{fetchMoreResult:i.data,variables:n.variables})})),e.queryManager.stopQuery(r),i}),(function(t){throw e.queryManager.stopQuery(r),t}))},e.prototype.subscribeToMore=function(t){var e=this,n=this.queryManager.startGraphQLSubscription({query:t.document,variables:t.variables}).subscribe({next:function(n){var r=t.updateQuery;r&&e.updateQuery((function(t,e){var i=e.variables;return r(t,{subscriptionData:n,variables:i})}))},error:function(e){t.onError&&t.onError(e)}});return this.subscriptions.add(n),function(){e.subscriptions.delete(n)&&n.unsubscribe()}},e.prototype.setOptions=function(t){var e=this.options.fetchPolicy;this.options=Object(i.a)(Object(i.a)({},this.options),t),t.pollInterval?this.startPolling(t.pollInterval):0===t.pollInterval&&this.stopPolling();var n=t.fetchPolicy;return this.setVariables(this.options.variables,e!==n&&("cache-only"===e||"standby"===e||"network-only"===n),t.fetchResults)},e.prototype.setVariables=function(t,e,n){return void 0===e&&(e=!1),void 0===n&&(n=!0),this.isTornDown=!1,t=t||this.variables,!e&&Object(a.a)(t,this.variables)?this.observers.size&&n?this.result():Promise.resolve():(this.variables=this.options.variables=t,this.observers.size?this.queryManager.fetchQuery(this.queryId,this.options):Promise.resolve())},e.prototype.updateQuery=function(t){var e=this.queryManager,n=e.getQueryWithPreviousResult(this.queryId),r=n.previousResult,i=n.variables,a=n.document,u=Object(o.I)((function(){return t(r,{variables:i})}));u&&(e.dataStore.markUpdateQueryResult(a,i,u),e.broadcastQueries())},e.prototype.stopPolling=function(){this.queryManager.stopPollingQuery(this.queryId),this.options.pollInterval=void 0},e.prototype.startPolling=function(t){_(this),this.options.pollInterval=t,this.queryManager.startPollingQuery(this.options,this.queryId)},e.prototype.updateLastResult=function(t){var e=this.lastResult;return this.lastResult=t,this.lastResultSnapshot=this.queryManager.assumeImmutableResults?t:Object(o.f)(t),e},e.prototype.onSubscribe=function(t){var e=this;try{var n=t._subscription._observer;n&&!n.error&&(n.error=v)}catch(i){}var r=!this.observers.size;return this.observers.add(t),t.next&&this.lastResult&&t.next(this.lastResult),t.error&&this.lastError&&t.error(this.lastError),r&&this.setUpQuery(),function(){e.observers.delete(t)&&!e.observers.size&&e.tearDownQuery()}},e.prototype.setUpQuery=function(){var t=this,e=this.queryManager,n=this.queryId;this.shouldSubscribe&&e.addObservableQuery(n,this),this.options.pollInterval&&(_(this),e.startPollingQuery(this.options,n));var o=function(e){t.updateLastResult(Object(i.a)(Object(i.a)({},t.lastResult),{errors:e.graphQLErrors,networkStatus:r.error,loading:!1})),y(t.observers,"error",t.lastError=e)};e.observeQuery(n,this.options,{next:function(n){if(t.lastError||t.isDifferentFromLastResult(n)){var r=t.updateLastResult(n),i=t.options,o=i.query,u=i.variables,s=i.fetchPolicy;e.transform(o).hasClientExports?e.getLocalState().addExportedVariables(o,u).then((function(i){var u=t.variables;t.variables=t.options.variables=i,!n.loading&&r&&"cache-only"!==s&&e.transform(o).serverQuery&&!Object(a.a)(u,i)?t.refetch():y(t.observers,"next",n)})):y(t.observers,"next",n)}},error:o}).catch(o)},e.prototype.tearDownQuery=function(){var t=this.queryManager;this.isTornDown=!0,t.stopPollingQuery(this.queryId),this.subscriptions.forEach((function(t){return t.unsubscribe()})),this.subscriptions.clear(),t.removeObservableQuery(this.queryId),t.stopQuery(this.queryId),this.observers.clear()},e}(h);function v(t){}function y(t,e,n){var r=[];t.forEach((function(t){return t[e]&&r.push(t)})),r.forEach((function(t){return t[e](n)}))}function _(t){var e=t.options.fetchPolicy;Object(f.b)("cache-first"!==e&&"cache-only"!==e,3)}var w=function(){function t(){this.store={}}return t.prototype.getStore=function(){return this.store},t.prototype.get=function(t){return this.store[t]},t.prototype.initMutation=function(t,e,n){this.store[t]={mutation:e,variables:n||{},loading:!0,error:null}},t.prototype.markMutationError=function(t,e){var n=this.store[t];n&&(n.loading=!1,n.error=e)},t.prototype.markMutationResult=function(t){var e=this.store[t];e&&(e.loading=!1,e.error=null)},t.prototype.reset=function(){this.store={}},t}(),S=function(){function t(){this.store={}}return t.prototype.getStore=function(){return this.store},t.prototype.get=function(t){return this.store[t]},t.prototype.initQuery=function(t){var e=this.store[t.queryId];Object(f.b)(!e||e.document===t.document||Object(a.a)(e.document,t.document),19);var n,i=!1,o=null;t.storePreviousVariables&&e&&e.networkStatus!==r.loading&&(Object(a.a)(e.variables,t.variables)||(i=!0,o=e.variables)),n=i?r.setVariables:t.isPoll?r.poll:t.isRefetch?r.refetch:r.loading;var u=[];e&&e.graphQLErrors&&(u=e.graphQLErrors),this.store[t.queryId]={document:t.document,variables:t.variables,previousVariables:o,networkError:null,graphQLErrors:u,networkStatus:n,metadata:t.metadata},"string"===typeof t.fetchMoreForQueryId&&this.store[t.fetchMoreForQueryId]&&(this.store[t.fetchMoreForQueryId].networkStatus=r.fetchMore)},t.prototype.markQueryResult=function(t,e,n){this.store&&this.store[t]&&(this.store[t].networkError=null,this.store[t].graphQLErrors=p(e.errors)?e.errors:[],this.store[t].previousVariables=null,this.store[t].networkStatus=r.ready,"string"===typeof n&&this.store[n]&&(this.store[n].networkStatus=r.ready))},t.prototype.markQueryError=function(t,e,n){this.store&&this.store[t]&&(this.store[t].networkError=e,this.store[t].networkStatus=r.error,"string"===typeof n&&this.markQueryResultClient(n,!0))},t.prototype.markQueryResultClient=function(t,e){var n=this.store&&this.store[t];n&&(n.networkError=null,n.previousVariables=null,e&&(n.networkStatus=r.ready))},t.prototype.stopQuery=function(t){delete this.store[t]},t.prototype.reset=function(t){var e=this;Object.keys(this.store).forEach((function(n){t.indexOf(n)<0?e.stopQuery(n):e.store[n].networkStatus=r.loading}))},t}();var O=function(){function t(t){var e=t.cache,n=t.client,r=t.resolvers,i=t.fragmentMatcher;this.cache=e,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return t.prototype.addResolvers=function(t){var e=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach((function(t){e.resolvers=Object(o.A)(e.resolvers,t)})):this.resolvers=Object(o.A)(this.resolvers,t)},t.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},t.prototype.getResolvers=function(){return this.resolvers||{}},t.prototype.runResolvers=function(t){var e=t.document,n=t.remoteResult,r=t.context,o=t.variables,a=t.onlyRunForcedResolvers,u=void 0!==a&&a;return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(t){return e?[2,this.resolveDocument(e,n.data,r,o,this.fragmentMatcher,u).then((function(t){return Object(i.a)(Object(i.a)({},n),{data:t.result})}))]:[2,n]}))}))},t.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},t.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},t.prototype.clientQuery=function(t){return Object(o.s)(["client"],t)&&this.resolvers?t:null},t.prototype.serverQuery=function(t){return this.resolvers?Object(o.C)(t):t},t.prototype.prepareContext=function(t){void 0===t&&(t={});var e=this.cache;return Object(i.a)(Object(i.a)({},t),{cache:e,getCacheKey:function(t){if(e.config)return e.config.dataIdFromObject(t);Object(f.b)(!1,6)}})},t.prototype.addExportedVariables=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(r){return t?[2,this.resolveDocument(t,this.buildRootValueFromCache(t,e)||{},this.prepareContext(n),e).then((function(t){return Object(i.a)(Object(i.a)({},e),t.exportedVariables)}))]:[2,Object(i.a)({},e)]}))}))},t.prototype.shouldForceResolvers=function(t){var e=!1;return Object(l.b)(t,{Directive:{enter:function(t){if("client"===t.name.value&&t.arguments&&(e=t.arguments.some((function(t){return"always"===t.name.value&&"BooleanValue"===t.value.kind&&!0===t.value.value}))))return l.a}}}),e},t.prototype.buildRootValueFromCache=function(t,e){return this.cache.diff({query:Object(o.d)(t),variables:e,returnPartialData:!0,optimistic:!1}).result},t.prototype.resolveDocument=function(t,e,n,r,a,u){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===a&&(a=function(){return!0}),void 0===u&&(u=!1),Object(i.b)(this,void 0,void 0,(function(){var s,c,f,l,d,h,p,g,m;return Object(i.d)(this,(function(b){var v;return s=Object(o.l)(t),c=Object(o.j)(t),f=Object(o.g)(c),l=s.operation,d=l?(v=l).charAt(0).toUpperCase()+v.slice(1):"Query",p=(h=this).cache,g=h.client,m={fragmentMap:f,context:Object(i.a)(Object(i.a)({},n),{cache:p,client:g}),variables:r,fragmentMatcher:a,defaultOperationType:d,exportedVariables:{},onlyRunForcedResolvers:u},[2,this.resolveSelectionSet(s.selectionSet,e,m).then((function(t){return{result:t,exportedVariables:m.exportedVariables}}))]}))}))},t.prototype.resolveSelectionSet=function(t,e,n){return Object(i.b)(this,void 0,void 0,(function(){var r,a,u,s,c,l=this;return Object(i.d)(this,(function(d){return r=n.fragmentMap,a=n.context,u=n.variables,s=[e],c=function(t){return Object(i.b)(l,void 0,void 0,(function(){var c,l;return Object(i.d)(this,(function(i){return Object(o.F)(t,u)?Object(o.t)(t)?[2,this.resolveField(t,e,n).then((function(e){var n;"undefined"!==typeof e&&s.push(((n={})[Object(o.E)(t)]=e,n))}))]:(Object(o.v)(t)?c=t:(c=r[t.name.value],Object(f.b)(c,7)),c&&c.typeCondition&&(l=c.typeCondition.name.value,n.fragmentMatcher(e,l,a))?[2,this.resolveSelectionSet(c.selectionSet,e,n).then((function(t){s.push(t)}))]:[2]):[2]}))}))},[2,Promise.all(t.selections.map(c)).then((function(){return Object(o.B)(s)}))]}))}))},t.prototype.resolveField=function(t,e,n){return Object(i.b)(this,void 0,void 0,(function(){var r,a,u,s,c,f,l,d,h,p=this;return Object(i.d)(this,(function(i){return r=n.variables,a=t.name.value,u=Object(o.E)(t),s=a!==u,c=e[u]||e[a],f=Promise.resolve(c),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(t)||(l=e.__typename||n.defaultOperationType,(d=this.resolvers&&this.resolvers[l])&&(h=d[s?a:u])&&(f=Promise.resolve(h(e,Object(o.b)(t,r),n.context,{field:t,fragmentMap:n.fragmentMap})))),[2,f.then((function(e){return void 0===e&&(e=c),t.directives&&t.directives.forEach((function(t){"export"===t.name.value&&t.arguments&&t.arguments.forEach((function(t){"as"===t.name.value&&"StringValue"===t.value.kind&&(n.exportedVariables[t.value.value]=e)}))})),t.selectionSet?null==e?e:Array.isArray(e)?p.resolveSubSelectedArray(t,e,n):t.selectionSet?p.resolveSelectionSet(t.selectionSet,e,n):void 0:e}))]}))}))},t.prototype.resolveSubSelectedArray=function(t,e,n){var r=this;return Promise.all(e.map((function(e){return null===e?null:Array.isArray(e)?r.resolveSubSelectedArray(t,e,n):t.selectionSet?r.resolveSelectionSet(t.selectionSet,e,n):void 0})))},t}();function x(t){var e=new Set,n=null;return new h((function(r){return e.add(r),n=n||t.subscribe({next:function(t){e.forEach((function(e){return e.next&&e.next(t)}))},error:function(t){e.forEach((function(e){return e.error&&e.error(t)}))},complete:function(){e.forEach((function(t){return t.complete&&t.complete()}))}}),function(){e.delete(r)&&!e.size&&n&&(n.unsubscribe(),n=null)}}))}var E=Object.prototype.hasOwnProperty,M=function(){function t(t){var e=t.link,n=t.queryDeduplication,r=void 0!==n&&n,i=t.store,a=t.onBroadcast,u=void 0===a?function(){}:a,s=t.ssrMode,c=void 0!==s&&s,f=t.clientAwareness,l=void 0===f?{}:f,d=t.localState,h=t.assumeImmutableResults;this.mutationStore=new w,this.queryStore=new S,this.clientAwareness={},this.idCounter=1,this.queries=new Map,this.fetchQueryRejectFns=new Map,this.transformCache=new(o.e?WeakMap:Map),this.inFlightLinkObservables=new Map,this.pollingInfoByQueryId=new Map,this.link=e,this.queryDeduplication=r,this.dataStore=i,this.onBroadcast=u,this.clientAwareness=l,this.localState=d||new O({cache:i.getCache()}),this.ssrMode=c,this.assumeImmutableResults=!!h}return t.prototype.stop=function(){var t=this;this.queries.forEach((function(e,n){t.stopQueryNoBroadcast(n)})),this.fetchQueryRejectFns.forEach((function(t){t(new f.a(8))}))},t.prototype.mutate=function(t){var e=t.mutation,n=t.variables,r=t.optimisticResponse,a=t.updateQueries,u=t.refetchQueries,s=void 0===u?[]:u,c=t.awaitRefetchQueries,l=void 0!==c&&c,d=t.update,h=t.errorPolicy,g=void 0===h?"none":h,b=t.fetchPolicy,v=t.context,y=void 0===v?{}:v;return Object(i.b)(this,void 0,void 0,(function(){var t,u,c,h=this;return Object(i.d)(this,(function(v){switch(v.label){case 0:return Object(f.b)(e,9),Object(f.b)(!b||"no-cache"===b,10),t=this.generateQueryId(),e=this.transform(e).document,this.setQuery(t,(function(){return{document:e}})),n=this.getVariables(e,n),this.transform(e).hasClientExports?[4,this.localState.addExportedVariables(e,n,y)]:[3,2];case 1:n=v.sent(),v.label=2;case 2:return u=function(){var t={};return a&&h.queries.forEach((function(e,n){var r=e.observableQuery;if(r){var i=r.queryName;i&&E.call(a,i)&&(t[n]={updater:a[i],query:h.queryStore.get(n)})}})),t},this.mutationStore.initMutation(t,e,n),this.dataStore.markMutationInit({mutationId:t,document:e,variables:n,updateQueries:u(),update:d,optimisticResponse:r}),this.broadcastQueries(),c=this,[2,new Promise((function(a,f){var h,v;c.getObservableFromLink(e,Object(i.a)(Object(i.a)({},y),{optimisticResponse:r}),n,!1).subscribe({next:function(r){Object(o.q)(r)&&"none"===g?v=new m({graphQLErrors:r.errors}):(c.mutationStore.markMutationResult(t),"no-cache"!==b&&c.dataStore.markMutationResult({mutationId:t,result:r,document:e,variables:n,updateQueries:u(),update:d}),h=r)},error:function(e){c.mutationStore.markMutationError(t,e),c.dataStore.markMutationComplete({mutationId:t,optimisticResponse:r}),c.broadcastQueries(),c.setQuery(t,(function(){return{document:null}})),f(new m({networkError:e}))},complete:function(){if(v&&c.mutationStore.markMutationError(t,v),c.dataStore.markMutationComplete({mutationId:t,optimisticResponse:r}),c.broadcastQueries(),v)f(v);else{"function"===typeof s&&(s=s(h));var e=[];p(s)&&s.forEach((function(t){if("string"===typeof t)c.queries.forEach((function(n){var r=n.observableQuery;r&&r.queryName===t&&e.push(r.refetch())}));else{var n={query:t.query,variables:t.variables,fetchPolicy:"network-only"};t.context&&(n.context=t.context),e.push(c.query(n))}})),Promise.all(l?e:[]).then((function(){c.setQuery(t,(function(){return{document:null}})),"ignore"===g&&h&&Object(o.q)(h)&&delete h.errors,a(h)}))}}})}))]}}))}))},t.prototype.fetchQuery=function(t,e,n,r){return Object(i.b)(this,void 0,void 0,(function(){var a,u,s,c,f,l,d,h,p,b,v,y,_,w,S,O,x,E,M=this;return Object(i.d)(this,(function(T){switch(T.label){case 0:return a=e.metadata,u=void 0===a?null:a,s=e.fetchPolicy,c=void 0===s?"cache-first":s,f=e.context,l=void 0===f?{}:f,d=this.transform(e.query).document,h=this.getVariables(d,e.variables),this.transform(d).hasClientExports?[4,this.localState.addExportedVariables(d,h,l)]:[3,2];case 1:h=T.sent(),T.label=2;case 2:if(e=Object(i.a)(Object(i.a)({},e),{variables:h}),v=b="network-only"===c||"no-cache"===c,b||(y=this.dataStore.getCache().diff({query:d,variables:h,returnPartialData:!0,optimistic:!1}),_=y.complete,w=y.result,v=!_||"cache-and-network"===c,p=w),S=v&&"cache-only"!==c&&"standby"!==c,Object(o.s)(["live"],d)&&(S=!0),O=this.idCounter++,x="no-cache"!==c?this.updateQueryWatch(t,d,e):void 0,this.setQuery(t,(function(){return{document:d,lastRequestId:O,invalidated:!0,cancel:x}})),this.invalidate(r),this.queryStore.initQuery({queryId:t,document:d,storePreviousVariables:S,variables:h,isPoll:n===g.poll,isRefetch:n===g.refetch,metadata:u,fetchMoreForQueryId:r}),this.broadcastQueries(),S){if(E=this.fetchRequest({requestId:O,queryId:t,document:d,options:e,fetchMoreForQueryId:r}).catch((function(e){throw e.hasOwnProperty("graphQLErrors")?e:(O>=M.getQuery(t).lastRequestId&&(M.queryStore.markQueryError(t,e,r),M.invalidate(t),M.invalidate(r),M.broadcastQueries()),new m({networkError:e}))})),"cache-and-network"!==c)return[2,E];E.catch((function(){}))}return this.queryStore.markQueryResultClient(t,!S),this.invalidate(t),this.invalidate(r),this.transform(d).hasForcedResolvers?[2,this.localState.runResolvers({document:d,remoteResult:{data:p},context:l,variables:h,onlyRunForcedResolvers:!0}).then((function(n){return M.markQueryResult(t,n,e,r),M.broadcastQueries(),n}))]:(this.broadcastQueries(),[2,{data:p}])}}))}))},t.prototype.markQueryResult=function(t,e,n,r){var i=n.fetchPolicy,o=n.variables,a=n.errorPolicy;"no-cache"===i?this.setQuery(t,(function(){return{newData:{result:e.data,complete:!0}}})):this.dataStore.markQueryResult(e,this.getQuery(t).document,o,r,"ignore"===a||"all"===a)},t.prototype.queryListenerForObserver=function(t,e,n){var r=this;function i(t,e){if(n[t])try{n[t](e)}catch(r){}}return function(n,o){if(r.invalidate(t,!1),n){var a=r.getQuery(t),u=a.observableQuery,s=a.document,c=u?u.options.fetchPolicy:e.fetchPolicy;if("standby"!==c){var f=d(n.networkStatus),l=u&&u.getLastResult(),h=!(!l||l.networkStatus===n.networkStatus),g=e.returnPartialData||!o&&n.previousVariables||h&&e.notifyOnNetworkStatusChange||"cache-only"===c||"cache-and-network"===c;if(!f||g){var b=p(n.graphQLErrors),v=u&&u.options.errorPolicy||e.errorPolicy||"none";if("none"===v&&b||n.networkError)return i("error",new m({graphQLErrors:n.graphQLErrors,networkError:n.networkError}));try{var y=void 0,_=void 0;if(o)"no-cache"!==c&&"network-only"!==c&&r.setQuery(t,(function(){return{newData:null}})),y=o.result,_=!o.complete;else{var w=u&&u.getLastError(),S="none"!==v&&(w&&w.graphQLErrors)!==n.graphQLErrors;if(l&&l.data&&!S)y=l.data,_=!1;else{var O=r.dataStore.getCache().diff({query:s,variables:n.previousVariables||n.variables,returnPartialData:!0,optimistic:!0});y=O.result,_=!O.complete}}var x=_&&!(e.returnPartialData||"cache-only"===c),E={data:x?l&&l.data:y,loading:f,networkStatus:n.networkStatus,stale:x};"all"===v&&b&&(E.errors=n.graphQLErrors),i("next",E)}catch(M){i("error",new m({networkError:M}))}}}}}},t.prototype.transform=function(t){var e=this.transformCache;if(!e.has(t)){var n=this.dataStore.getCache(),r=n.transformDocument(t),i=Object(o.D)(n.transformForLink(r)),a=this.localState.clientQuery(r),u=this.localState.serverQuery(i),s={document:r,hasClientExports:Object(o.r)(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:a,serverQuery:u,defaultVars:Object(o.h)(Object(o.m)(r))},c=function(t){t&&!e.has(t)&&e.set(t,s)};c(t),c(r),c(a),c(u)}return e.get(t)},t.prototype.getVariables=function(t,e){return Object(i.a)(Object(i.a)({},this.transform(t).defaultVars),e)},t.prototype.watchQuery=function(t,e){void 0===e&&(e=!0),Object(f.b)("standby"!==t.fetchPolicy,11),t.variables=this.getVariables(t.query,t.variables),"undefined"===typeof t.notifyOnNetworkStatusChange&&(t.notifyOnNetworkStatusChange=!1);var n=Object(i.a)({},t);return new b({queryManager:this,options:n,shouldSubscribe:e})},t.prototype.query=function(t){var e=this;return Object(f.b)(t.query,12),Object(f.b)("Document"===t.query.kind,13),Object(f.b)(!t.returnPartialData,14),Object(f.b)(!t.pollInterval,15),new Promise((function(n,r){var i=e.watchQuery(t,!1);e.fetchQueryRejectFns.set("query:"+i.queryId,r),i.result().then(n,r).then((function(){return e.fetchQueryRejectFns.delete("query:"+i.queryId)}))}))},t.prototype.generateQueryId=function(){return String(this.idCounter++)},t.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryInStoreNoBroadcast=function(t){this.stopPollingQuery(t),this.queryStore.stopQuery(t),this.invalidate(t)},t.prototype.addQueryListener=function(t,e){this.setQuery(t,(function(t){return t.listeners.add(e),{invalidated:!1}}))},t.prototype.updateQueryWatch=function(t,e,n){var r=this,i=this.getQuery(t).cancel;i&&i();return this.dataStore.getCache().watch({query:e,variables:n.variables,optimistic:!0,previousResult:function(){var e=null,n=r.getQuery(t).observableQuery;if(n){var i=n.getLastResult();i&&(e=i.data)}return e},callback:function(e){r.setQuery(t,(function(){return{invalidated:!0,newData:e}}))}})},t.prototype.addObservableQuery=function(t,e){this.setQuery(t,(function(){return{observableQuery:e}}))},t.prototype.removeObservableQuery=function(t){var e=this.getQuery(t).cancel;this.setQuery(t,(function(){return{observableQuery:null}})),e&&e()},t.prototype.clearStore=function(){this.fetchQueryRejectFns.forEach((function(t){t(new f.a(16))}));var t=[];return this.queries.forEach((function(e,n){e.observableQuery&&t.push(n)})),this.queryStore.reset(t),this.mutationStore.reset(),this.dataStore.reset()},t.prototype.resetStore=function(){var t=this;return this.clearStore().then((function(){return t.reFetchObservableQueries()}))},t.prototype.reFetchObservableQueries=function(t){var e=this;void 0===t&&(t=!1);var n=[];return this.queries.forEach((function(r,i){var o=r.observableQuery;if(o){var a=o.options.fetchPolicy;o.resetLastResults(),"cache-only"===a||!t&&"standby"===a||n.push(o.refetch()),e.setQuery(i,(function(){return{newData:null}})),e.invalidate(i)}})),this.broadcastQueries(),Promise.all(n)},t.prototype.observeQuery=function(t,e,n){return this.addQueryListener(t,this.queryListenerForObserver(t,e,n)),this.fetchQuery(t,e)},t.prototype.startQuery=function(t,e,n){return this.addQueryListener(t,n),this.fetchQuery(t,e).catch((function(){})),t},t.prototype.startGraphQLSubscription=function(t){var e=this,n=t.query,r=t.fetchPolicy,i=t.variables;n=this.transform(n).document,i=this.getVariables(n,i);var a=function(t){return e.getObservableFromLink(n,{},t,!1).map((function(i){if(r&&"no-cache"===r||(e.dataStore.markSubscriptionResult(i,n,t),e.broadcastQueries()),Object(o.q)(i))throw new m({graphQLErrors:i.errors});return i}))};if(this.transform(n).hasClientExports){var u=this.localState.addExportedVariables(n,i).then(a);return new h((function(t){var e=null;return u.then((function(n){return e=n.subscribe(t)}),t.error),function(){return e&&e.unsubscribe()}}))}return a(i)},t.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},t.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},t.prototype.removeQuery=function(t){this.fetchQueryRejectFns.delete("query:"+t),this.fetchQueryRejectFns.delete("fetchRequest:"+t),this.getQuery(t).subscriptions.forEach((function(t){return t.unsubscribe()})),this.queries.delete(t)},t.prototype.getCurrentQueryResult=function(t,e){void 0===e&&(e=!0);var n=t.options,r=n.variables,i=n.query,o=n.fetchPolicy,a=n.returnPartialData,u=t.getLastResult(),s=this.getQuery(t.queryId).newData;if(s&&s.complete)return{data:s.result,partial:!1};if("no-cache"===o||"network-only"===o)return{data:void 0,partial:!1};var c=this.dataStore.getCache().diff({query:i,variables:r,previousResult:u?u.data:void 0,returnPartialData:!0,optimistic:e}),f=c.result,l=c.complete;return{data:l||a?f:void 0,partial:!l}},t.prototype.getQueryWithPreviousResult=function(t){var e;if("string"===typeof t){var n=this.getQuery(t).observableQuery;Object(f.b)(n,17),e=n}else e=t;var r=e.options,i=r.variables,o=r.query;return{previousResult:this.getCurrentQueryResult(e,!1).data,variables:i,document:o}},t.prototype.broadcastQueries=function(){var t=this;this.onBroadcast(),this.queries.forEach((function(e,n){e.invalidated&&e.listeners.forEach((function(r){r&&r(t.queryStore.get(n),e.newData)}))}))},t.prototype.getLocalState=function(){return this.localState},t.prototype.getObservableFromLink=function(t,e,n,r){var a,u=this;void 0===r&&(r=this.queryDeduplication);var c=this.transform(t).serverQuery;if(c){var f=this.inFlightLinkObservables,l=this.link,d={query:c,variables:n,operationName:Object(o.n)(c)||void 0,context:this.prepareContext(Object(i.a)(Object(i.a)({},e),{forceFetch:!r}))};if(e=d.context,r){var p=f.get(c)||new Map;f.set(c,p);var g=JSON.stringify(n);if(!(a=p.get(g))){p.set(g,a=x(Object(s.execute)(l,d)));var m=function(){p.delete(g),p.size||f.delete(c),b.unsubscribe()},b=a.subscribe({next:m,error:m,complete:m})}}else a=x(Object(s.execute)(l,d))}else a=h.of({data:{}}),e=this.prepareContext(e);var v=this.transform(t).clientQuery;return v&&(a=function(t,e){return new h((function(n){var r=n.next,i=n.error,o=n.complete,a=0,u=!1,s={next:function(t){++a,new Promise((function(n){n(e(t))})).then((function(t){--a,r&&r.call(n,t),u&&s.complete()}),(function(t){--a,i&&i.call(n,t)}))},error:function(t){i&&i.call(n,t)},complete:function(){u=!0,a||o&&o.call(n)}},c=t.subscribe(s);return function(){return c.unsubscribe()}}))}(a,(function(t){return u.localState.runResolvers({document:v,remoteResult:t,context:e,variables:n})}))),a},t.prototype.fetchRequest=function(t){var e,n,i=this,o=t.requestId,a=t.queryId,u=t.document,s=t.options,c=t.fetchMoreForQueryId,f=s.variables,l=s.errorPolicy,d=void 0===l?"none":l,h=s.fetchPolicy;return new Promise((function(t,l){var g=i.getObservableFromLink(u,s.context,f),b="fetchRequest:"+a;i.fetchQueryRejectFns.set(b,l);var v=function(){i.fetchQueryRejectFns.delete(b),i.setQuery(a,(function(t){t.subscriptions.delete(y)}))},y=g.map((function(t){if(o>=i.getQuery(a).lastRequestId&&(i.markQueryResult(a,t,s,c),i.queryStore.markQueryResult(a,t,c),i.invalidate(a),i.invalidate(c),i.broadcastQueries()),"none"===d&&p(t.errors))return l(new m({graphQLErrors:t.errors}));if("all"===d&&(n=t.errors),c||"no-cache"===h)e=t.data;else{var r=i.dataStore.getCache().diff({variables:f,query:u,optimistic:!1,returnPartialData:!0}),g=r.result;(r.complete||s.returnPartialData)&&(e=g)}})).subscribe({error:function(t){v(),l(t)},complete:function(){v(),t({data:e,errors:n,loading:!1,networkStatus:r.ready,stale:!1})}});i.setQuery(a,(function(t){t.subscriptions.add(y)}))}))},t.prototype.getQuery=function(t){return this.queries.get(t)||{listeners:new Set,invalidated:!1,document:null,newData:null,lastRequestId:1,observableQuery:null,subscriptions:new Set}},t.prototype.setQuery=function(t,e){var n=this.getQuery(t),r=Object(i.a)(Object(i.a)({},n),e(n));this.queries.set(t,r)},t.prototype.invalidate=function(t,e){void 0===e&&(e=!0),t&&this.setQuery(t,(function(){return{invalidated:e}}))},t.prototype.prepareContext=function(t){void 0===t&&(t={});var e=this.localState.prepareContext(t);return Object(i.a)(Object(i.a)({},e),{clientAwareness:this.clientAwareness})},t.prototype.checkInFlight=function(t){var e=this.queryStore.get(t);return e&&e.networkStatus!==r.ready&&e.networkStatus!==r.error},t.prototype.startPollingQuery=function(t,e,n){var r=this,o=t.pollInterval;if(Object(f.b)(o,18),!this.ssrMode){var a=this.pollingInfoByQueryId.get(e);a||this.pollingInfoByQueryId.set(e,a={}),a.interval=o,a.options=Object(i.a)(Object(i.a)({},t),{fetchPolicy:"network-only"});var u=function(){var t=r.pollingInfoByQueryId.get(e);t&&(r.checkInFlight(e)?s():r.fetchQuery(e,t.options,g.poll).then(s,s))},s=function(){var t=r.pollingInfoByQueryId.get(e);t&&(clearTimeout(t.timeout),t.timeout=setTimeout(u,t.interval))};n&&this.addQueryListener(e,n),s()}return e},t.prototype.stopPollingQuery=function(t){this.pollingInfoByQueryId.delete(t)},t}(),T=function(){function t(t){this.cache=t}return t.prototype.getCache=function(){return this.cache},t.prototype.markQueryResult=function(t,e,n,r,i){void 0===i&&(i=!1);var a=!Object(o.q)(t);i&&Object(o.q)(t)&&t.data&&(a=!0),!r&&a&&this.cache.write({result:t.data,dataId:"ROOT_QUERY",query:e,variables:n})},t.prototype.markSubscriptionResult=function(t,e,n){Object(o.q)(t)||this.cache.write({result:t.data,dataId:"ROOT_SUBSCRIPTION",query:e,variables:n})},t.prototype.markMutationInit=function(t){var e,n=this;t.optimisticResponse&&(e="function"===typeof t.optimisticResponse?t.optimisticResponse(t.variables):t.optimisticResponse,this.cache.recordOptimisticTransaction((function(r){var i=n.cache;n.cache=r;try{n.markMutationResult({mutationId:t.mutationId,result:{data:e},document:t.document,variables:t.variables,updateQueries:t.updateQueries,update:t.update})}finally{n.cache=i}}),t.mutationId))},t.prototype.markMutationResult=function(t){var e=this;if(!Object(o.q)(t.result)){var n=[{result:t.result.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}],r=t.updateQueries;r&&Object.keys(r).forEach((function(i){var a=r[i],u=a.query,s=a.updater,c=e.cache.diff({query:u.document,variables:u.variables,returnPartialData:!0,optimistic:!1}),f=c.result;if(c.complete){var l=Object(o.I)((function(){return s(f,{mutationResult:t.result,queryName:Object(o.n)(u.document)||void 0,queryVariables:u.variables})}));l&&n.push({result:l,dataId:"ROOT_QUERY",query:u.document,variables:u.variables})}})),this.cache.performTransaction((function(e){n.forEach((function(t){return e.write(t)}));var r=t.update;r&&Object(o.I)((function(){return r(e,t.result)}))}))}},t.prototype.markMutationComplete=function(t){var e=t.mutationId;t.optimisticResponse&&this.cache.removeOptimistic(e)},t.prototype.markUpdateQueryResult=function(t,e,n){this.cache.write({result:n,dataId:"ROOT_QUERY",variables:e,query:t})},t.prototype.reset=function(){return this.cache.reset()},t}(),$=function(){function t(t){var e=this;this.defaultOptions={},this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=t.cache,r=t.ssrMode,i=void 0!==r&&r,o=t.ssrForceFetchDelay,a=void 0===o?0:o,u=t.connectToDevTools,c=t.queryDeduplication,l=void 0===c||c,d=t.defaultOptions,h=t.assumeImmutableResults,p=void 0!==h&&h,g=t.resolvers,m=t.typeDefs,b=t.fragmentMatcher,v=t.name,y=t.version,_=t.link;if(!_&&g&&(_=s.ApolloLink.empty()),!_||!n)throw new f.a(4);this.link=_,this.cache=n,this.store=new T(n),this.disableNetworkFetches=i||a>0,this.queryDeduplication=l,this.defaultOptions=d||{},this.typeDefs=m,a&&setTimeout((function(){return e.disableNetworkFetches=!1}),a),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this);"undefined"!==typeof u&&(u&&"undefined"!==typeof window)&&(window.__APOLLO_CLIENT__=this),this.version="2.6.10",this.localState=new O({cache:n,client:this,resolvers:g,fragmentMatcher:b}),this.queryManager=new M({link:this.link,store:this.store,queryDeduplication:l,ssrMode:i,clientAwareness:{name:v,version:y},localState:this.localState,assumeImmutableResults:p,onBroadcast:function(){e.devToolsHookCb&&e.devToolsHookCb({action:{},state:{queries:e.queryManager.queryStore.getStore(),mutations:e.queryManager.mutationStore.getStore()},dataWithOptimisticResults:e.cache.extract(!0)})}})}return t.prototype.stop=function(){this.queryManager.stop()},t.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=Object(i.a)(Object(i.a)({},this.defaultOptions.watchQuery),t)),!this.disableNetworkFetches||"network-only"!==t.fetchPolicy&&"cache-and-network"!==t.fetchPolicy||(t=Object(i.a)(Object(i.a)({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},t.prototype.query=function(t){return this.defaultOptions.query&&(t=Object(i.a)(Object(i.a)({},this.defaultOptions.query),t)),Object(f.b)("cache-and-network"!==t.fetchPolicy,5),this.disableNetworkFetches&&"network-only"===t.fetchPolicy&&(t=Object(i.a)(Object(i.a)({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},t.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=Object(i.a)(Object(i.a)({},this.defaultOptions.mutate),t)),this.queryManager.mutate(t)},t.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},t.prototype.readQuery=function(t,e){return void 0===e&&(e=!1),this.cache.readQuery(t,e)},t.prototype.readFragment=function(t,e){return void 0===e&&(e=!1),this.cache.readFragment(t,e)},t.prototype.writeQuery=function(t){var e=this.cache.writeQuery(t);return this.queryManager.broadcastQueries(),e},t.prototype.writeFragment=function(t){var e=this.cache.writeFragment(t);return this.queryManager.broadcastQueries(),e},t.prototype.writeData=function(t){var e=this.cache.writeData(t);return this.queryManager.broadcastQueries(),e},t.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},t.prototype.__requestRaw=function(t){return Object(s.execute)(this.link,t)},t.prototype.initQueryManager=function(){return this.queryManager},t.prototype.resetStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore()})).then((function(){return Promise.all(t.resetStoreCallbacks.map((function(t){return t()})))})).then((function(){return t.reFetchObservableQueries()}))},t.prototype.clearStore=function(){var t=this;return Promise.resolve().then((function(){return t.queryManager.clearStore()})).then((function(){return Promise.all(t.clearStoreCallbacks.map((function(t){return t()})))}))},t.prototype.onResetStore=function(t){var e=this;return this.resetStoreCallbacks.push(t),function(){e.resetStoreCallbacks=e.resetStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.onClearStore=function(t){var e=this;return this.clearStoreCallbacks.push(t),function(){e.clearStoreCallbacks=e.clearStoreCallbacks.filter((function(e){return e!==t}))}},t.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},t.prototype.extract=function(t){return this.cache.extract(t)},t.prototype.restore=function(t){return this.cache.restore(t)},t.prototype.addResolvers=function(t){this.localState.addResolvers(t)},t.prototype.setResolvers=function(t){this.localState.setResolvers(t)},t.prototype.getResolvers=function(){return this.localState.getResolvers()},t.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(306),i=n(30),o=n(305),a=n(22);function u(t,e){Object(a.a)(2,arguments);var n=Object(i.a)(e);return Object(o.a)(t,-n)}function s(t,e){if(Object(a.a)(2,arguments),!e||"object"!==typeof e)return new Date(NaN);var n=e.years?Object(i.a)(e.years):0,o=e.months?Object(i.a)(e.months):0,s=e.weeks?Object(i.a)(e.weeks):0,c=e.days?Object(i.a)(e.days):0,f=e.hours?Object(i.a)(e.hours):0,l=e.minutes?Object(i.a)(e.minutes):0,d=e.seconds?Object(i.a)(e.seconds):0,h=u(t,o+12*n),p=Object(r.a)(h,c+7*s),g=l+60*f,m=d+60*g,b=1e3*m,v=new Date(p.getTime()-b);return v}},function(t,e,n){var r=n(630),i=n(633);t.exports=function(t,e){var n=i(t,e);return r(n)?n:void 0}},function(t,e){t.exports=function(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){(function(e){var r=n(113),i=new(0,n(352).ec)("secp256k1"),o=n(756),a=e.alloc(32,0),u=e.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),s=e.from("fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f","hex"),c=i.curve.n,f=c.shrn(1),l=i.curve.g,d="Expected Private",h="Expected Point",p="Expected Tweak",g="Expected Hash";function m(t){return e.isBuffer(t)&&32===t.length}function b(t){return!!m(t)&&t.compare(u)<0}function v(t){if(!e.isBuffer(t))return!1;if(t.length<33)return!1;var n=t[0],r=t.slice(1,33);if(0===r.compare(a))return!1;if(r.compare(s)>=0)return!1;if((2===n||3===n)&&33===t.length){try{x(t)}catch(o){return!1}return!0}var i=t.slice(33);return 0!==i.compare(a)&&(!(i.compare(s)>=0)&&(4===n&&65===t.length))}function y(t){return 4!==t[0]}function _(t){return!!m(t)&&(t.compare(a)>0&&t.compare(u)<0)}function w(t,e){return void 0===t&&void 0!==e?y(e):void 0===t||t}function S(t){return new r(t)}function O(t){return t.toArrayLike(e,"be",32)}function x(t){return i.curve.decodePoint(t)}function E(t,n){return e.from(t._encode(n))}function M(t,n,r){if(!m(t))throw new TypeError(g);if(!_(n))throw new TypeError(d);if(void 0!==r&&!m(r))throw new TypeError("Expected Extra Data (32 bytes)");var i,a,u=S(n),s=S(t);o(t,n,(function(t){var e=S(t),n=l.mul(e);return!n.isInfinity()&&(0!==(i=n.x.umod(c)).isZero()&&0!==(a=e.invm(c).mul(s.add(u.mul(i))).umod(c)).isZero())}),_,r),a.cmp(f)>0&&(a=c.sub(a));var h=e.allocUnsafe(64);return O(i).copy(h,0),O(a).copy(h,32),h}t.exports={isPoint:v,isPointCompressed:function(t){return!!v(t)&&y(t)},isPrivate:_,pointAdd:function(t,e,n){if(!v(t))throw new TypeError(h);if(!v(e))throw new TypeError(h);var r=x(t),i=x(e),o=r.add(i);return o.isInfinity()?null:E(o,w(n,t))},pointAddScalar:function(t,e,n){if(!v(t))throw new TypeError(h);if(!b(e))throw new TypeError(p);var r=w(n,t),i=x(t);if(0===e.compare(a))return E(i,r);var o=S(e),u=l.mul(o),s=i.add(u);return s.isInfinity()?null:E(s,r)},pointCompress:function(t,e){if(!v(t))throw new TypeError(h);var n=x(t);if(n.isInfinity())throw new TypeError(h);return E(n,w(e,t))},pointFromScalar:function(t,e){if(!_(t))throw new TypeError(d);var n=S(t),r=l.mul(n);return r.isInfinity()?null:E(r,w(e))},pointMultiply:function(t,e,n){if(!v(t))throw new TypeError(h);if(!b(e))throw new TypeError(p);var r=w(n,t),i=x(t),o=S(e),a=i.mul(o);return a.isInfinity()?null:E(a,r)},privateAdd:function(t,e){if(!_(t))throw new TypeError(d);if(!b(e))throw new TypeError(p);var n=S(t),r=S(e),i=O(n.add(r).umod(c));return _(i)?i:null},privateSub:function(t,e){if(!_(t))throw new TypeError(d);if(!b(e))throw new TypeError(p);var n=S(t),r=S(e),i=O(n.sub(r).umod(c));return _(i)?i:null},sign:function(t,e){return M(t,e)},signWithEntropy:function(t,e,n){return M(t,e,n)},verify:function(t,n,r,i){if(!m(t))throw new TypeError(g);if(!v(n))throw new TypeError(h);if(!function(t){var n=t.slice(0,32),r=t.slice(32,64);return e.isBuffer(t)&&64===t.length&&n.compare(u)<0&&r.compare(u)<0}(r))throw new TypeError("Expected Signature");var o=x(n),a=S(r.slice(0,32)),s=S(r.slice(32,64));if(i&&s.cmp(f)>0)return!1;if(a.gtn(0)<=0)return!1;if(s.gtn(0)<=0)return!1;var d=S(t),p=s.invm(c),b=d.mul(p).umod(c),y=a.mul(p).umod(c),_=l.mulAdd(b,o,y);return!_.isInfinity()&&_.x.umod(c).eq(a)}}}).call(this,n(29).Buffer)},function(t,e,n){var r;function i(t){this.rand=t}if(t.exports=function(t){return r||(r=new i(null)),r.generate(t)},t.exports.Rand=i,i.prototype.generate=function(t){return this._rand(t)},i.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),n=0;no)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(t);if(t>0)if(t>i)for(var s=0;s100)throw new TypeError("address string is too long");t=t.trim();var r=u.get(e);if(e&&!r)throw new TypeError("Unknown network");if(t.length>35){var i=p(t);if(!i.network||r&&r.name!==i.network.name)throw new TypeError("Address has mismatched network type.");if(!i.type||n&&n!==i.type)throw new TypeError("Address has mismatched type.");return i}var o=a.decode(t);return h._transformBuffer(o,e,n)},h.fromPublicKey=function(t,e){var n=h._transformPublicKey(t);return e=e||u.defaultNetwork,new h(n.hashBuffer,e,n.type)},h.fromPublicKeyHash=function(t,e){var n=h._transformHash(t);return new h(n.hashBuffer,e,h.PayToPublicKeyHash)},h.fromScriptHash=function(t,e){i.checkArgument(t,"hash parameter is required");var n=h._transformHash(t);return new h(n.hashBuffer,e,h.PayToScriptHash)},h.payingTo=function(t,e){return i.checkArgument(t,"script is required"),i.checkArgument(t instanceof v,"script must be instance of Script"),h.fromScriptHash(s.sha256ripemd160(t.toBuffer()),e)},h.fromScript=function(t,e){i.checkArgument(t instanceof v,"script must be a Script instance");var n=h._transformScript(t,e);return new h(n.hashBuffer,e,n.type)},h.fromBuffer=function(t,e,n){var r=h._transformBuffer(t,e,n);return new h(r.hashBuffer,r.network,r.type)},h.fromString=function(t,e,n){var r=h._transformString(t,e,n);return new h(r.hashBuffer,r.network,r.type)},h.fromObject=function(t){return i.checkState(c.isHexa(t.hash),'Unexpected hash property, "'+t.hash+'", expected to be hex.'),new h(e.from(t.hash,"hex"),t.network,t.type)},h.getValidationError=function(t,e,n){var r;try{new h(t,e,n)}catch(i){r=i}return r},h.isValid=function(t,e,n){return!h.getValidationError(t,e,n)},h.prototype.isPayToPublicKeyHash=function(){return this.type===h.PayToPublicKeyHash},h.prototype.isPayToScriptHash=function(){return this.type===h.PayToScriptHash},h.prototype.toBuffer=function(){var t=e.from([this.network[this.type]]);return e.concat([t,this.hashBuffer])},h.prototype.toObject=h.prototype.toJSON=function(){return{hash:this.hashBuffer.toString("hex"),type:this.type,network:this.network.toString()}},h.prototype.inspect=function(){return""},h.prototype.toCashBuffer=function(){var t=e.from([this.network[this.type]]);return e.concat([t,this.hashBuffer])},h.prototype.toLegacyAddress=function(){return a.encode(this.toBuffer())},h.prototype.toCashAddress=function(t){var e=this.network.prefixArray.concat([0]),n=function(t){switch(t){case"pubkeyhash":return 0;case"scripthash":return 8;default:throw new Error("Invalid type:"+t)}}(this.type)+function(t){switch(8*t.length){case 160:return 0;case 192:return 1;case 224:return 2;case 256:return 3;case 320:return 4;case 384:return 5;case 448:return 6;case 512:return 7;default:throw new Error("Invalid hash size:"+t.length)}}(this.hashBuffer),r=Array.prototype.slice.call(this.hashBuffer,0),i=d([n].concat(r),8,5),o=e.concat(i).concat([0,0,0,0,0,0,0,0]),a=i.concat(function(t){for(var e=[],n=0;n<8;++n)e.push(31&t),t/=32;return e.reverse()}(b(o)));return!0===t?l.encode(a):this.network.prefix+":"+l.encode(a)},h.prototype.toString=h.prototype.toCashAddress;var g=[152,121,243,174,30],m=[4072443489,3077413346,1046459332,783016616,1329849456];function b(t){for(var e=0,n=1,r=0,i=0;i>>3,e&=7,e<<=5,e|=n>>>27,n&=134217727,n<<=5,n^=t[i];for(var o=0;o1&&void 0!==arguments[1]&&arguments[1];return t&&(r(t.value)&&""!==t.value||e&&r(t.defaultValue)&&""!==t.defaultValue)}function o(t){return t.startAdornment}n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";function r(t){return"[object Function]"===Object.prototype.toString.call(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(22);function i(t){return Object(r.a)(1,arguments),t instanceof Date||"object"===typeof t&&"[object Date]"===Object.prototype.toString.call(t)}var o=n(25);function a(t){if(Object(r.a)(1,arguments),!i(t)&&"number"!==typeof t)return!1;var e=Object(o.a)(t);return!isNaN(Number(e))}},function(t,e,n){"use strict";var r="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},i="object"===("undefined"===typeof window?"undefined":r(window))&&"object"===("undefined"===typeof document?"undefined":r(document))&&9===document.nodeType;e.a=i},function(t,e,n){var r=n(957);t.exports=function(t,e){if(null==t)return{};var n,i,o=r(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}},,function(t,e,n){var r,i,o;!function(a){"use strict";"object"===typeof t.exports?t.exports=a():null!=n(148)?(i=[],void 0===(o="function"===typeof(r=a)?r.apply(e,i):r)||(t.exports=o)):self.sanctuaryTypeIdentifiers=a()}((function(){"use strict";var t="@@type",e=new RegExp("^([\\s\\S]+)/([\\s\\S]+?)(?:@([0-9]+))?$");function n(e){return null!=e&&null!=e.constructor&&e.constructor.prototype!==e&&"string"===typeof e.constructor[t]?e.constructor[t]:Object.prototype.toString.call(e).slice("[object ".length,-"]".length)}return n.parse=function(t){var n=e.exec(t);return{namespace:null==n||null==n[1]?null:n[1],name:null==n?t:n[2],version:null==n||null==n[3]?0:Number(n[3])}},n}))},function(t,e,n){"use strict";var r={};function i(t,e,n){n||(n=Error);var i=function(t){var n,r;function i(n,r,i){return t.call(this,function(t,n,r){return"string"===typeof e?e:e(t,n,r)}(n,r,i))||this}return r=t,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,n.__proto__=r,i}(n);i.prototype.name=n.name,i.prototype.code=t,r[t]=i}function o(t,e){if(Array.isArray(t)){var n=t.length;return t=t.map((function(t){return String(t)})),n>2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}i("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(t,e,n){var r,i,a,u;if("string"===typeof e&&(i="not ",e.substr(!a||a<0?0:+a,i.length)===i)?(r="must not be",e=e.replace(/^not /,"")):r="must be",function(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}(t," argument"))u="The ".concat(t," ").concat(r," ").concat(o(e,"type"));else{var s=function(t,e,n){return"number"!==typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}(t,".")?"property":"argument";u='The "'.concat(t,'" ').concat(s," ").concat(r," ").concat(o(e,"type"))}return u+=". Received type ".concat(typeof n)}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=r},function(t,e,n){"use strict";(function(e){var r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var i=n(452),o=n(456);n(38)(c,i);for(var a=r(o.prototype),u=0;u=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var r=(4294967295&n)>>>0,i=(n-r)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(r,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,n){"use strict";var r=n(158),i=n(787);t.exports=i((function(t){var e=r("sha256").update(t).digest();return r("sha256").update(e).digest()}))},function(t,e,n){!function(e,r){var i;t.exports=(i=n(50),function(){var t=i,e=t.lib.WordArray;function n(t,n,r){for(var i=[],o=0,a=0;a>>6-a%4*2;i[o>>>2]|=(u|s)<<24-o%4*8,o++}return e.create(i,o)}t.enc.Base64={stringify:function(t){var e=t.words,n=t.sigBytes,r=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,u=0;u<4&&o+.75*u>>6*(3-u)&63));var s=r.charAt(64);if(s)for(;i.length%4;)i.push(s);return i.join("")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=t[e+0],s=t[e+1],h=t[e+2],p=t[e+3],g=t[e+4],m=t[e+5],b=t[e+6],v=t[e+7],y=t[e+8],_=t[e+9],w=t[e+10],S=t[e+11],O=t[e+12],x=t[e+13],E=t[e+14],M=t[e+15],T=o[0],$=o[1],A=o[2],k=o[3];T=c(T,$,A,k,a,7,u[0]),k=c(k,T,$,A,s,12,u[1]),A=c(A,k,T,$,h,17,u[2]),$=c($,A,k,T,p,22,u[3]),T=c(T,$,A,k,g,7,u[4]),k=c(k,T,$,A,m,12,u[5]),A=c(A,k,T,$,b,17,u[6]),$=c($,A,k,T,v,22,u[7]),T=c(T,$,A,k,y,7,u[8]),k=c(k,T,$,A,_,12,u[9]),A=c(A,k,T,$,w,17,u[10]),$=c($,A,k,T,S,22,u[11]),T=c(T,$,A,k,O,7,u[12]),k=c(k,T,$,A,x,12,u[13]),A=c(A,k,T,$,E,17,u[14]),T=f(T,$=c($,A,k,T,M,22,u[15]),A,k,s,5,u[16]),k=f(k,T,$,A,b,9,u[17]),A=f(A,k,T,$,S,14,u[18]),$=f($,A,k,T,a,20,u[19]),T=f(T,$,A,k,m,5,u[20]),k=f(k,T,$,A,w,9,u[21]),A=f(A,k,T,$,M,14,u[22]),$=f($,A,k,T,g,20,u[23]),T=f(T,$,A,k,_,5,u[24]),k=f(k,T,$,A,E,9,u[25]),A=f(A,k,T,$,p,14,u[26]),$=f($,A,k,T,y,20,u[27]),T=f(T,$,A,k,x,5,u[28]),k=f(k,T,$,A,h,9,u[29]),A=f(A,k,T,$,v,14,u[30]),T=l(T,$=f($,A,k,T,O,20,u[31]),A,k,m,4,u[32]),k=l(k,T,$,A,y,11,u[33]),A=l(A,k,T,$,S,16,u[34]),$=l($,A,k,T,E,23,u[35]),T=l(T,$,A,k,s,4,u[36]),k=l(k,T,$,A,g,11,u[37]),A=l(A,k,T,$,v,16,u[38]),$=l($,A,k,T,w,23,u[39]),T=l(T,$,A,k,x,4,u[40]),k=l(k,T,$,A,a,11,u[41]),A=l(A,k,T,$,p,16,u[42]),$=l($,A,k,T,b,23,u[43]),T=l(T,$,A,k,_,4,u[44]),k=l(k,T,$,A,O,11,u[45]),A=l(A,k,T,$,M,16,u[46]),T=d(T,$=l($,A,k,T,h,23,u[47]),A,k,a,6,u[48]),k=d(k,T,$,A,v,10,u[49]),A=d(A,k,T,$,E,15,u[50]),$=d($,A,k,T,m,21,u[51]),T=d(T,$,A,k,O,6,u[52]),k=d(k,T,$,A,p,10,u[53]),A=d(A,k,T,$,w,15,u[54]),$=d($,A,k,T,s,21,u[55]),T=d(T,$,A,k,y,6,u[56]),k=d(k,T,$,A,M,10,u[57]),A=d(A,k,T,$,b,15,u[58]),$=d($,A,k,T,x,21,u[59]),T=d(T,$,A,k,g,6,u[60]),k=d(k,T,$,A,S,10,u[61]),A=d(A,k,T,$,h,15,u[62]),$=d($,A,k,T,_,21,u[63]),o[0]=o[0]+T|0,o[1]=o[1]+$|0,o[2]=o[2]+A|0,o[3]=o[3]+k|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var o=t.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(n.length+1),this._process();for(var u=this._hash,s=u.words,c=0;c<4;c++){var f=s[c];s[c]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return u},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,n,r,i,o,a){var u=t+(e&n|~e&r)+i+a;return(u<>>32-o)+e}function f(t,e,n,r,i,o,a){var u=t+(e&r|n&~r)+i+a;return(u<>>32-o)+e}function l(t,e,n,r,i,o,a){var u=t+(e^n^r)+i+a;return(u<>>32-o)+e}function d(t,e,n,r,i,o,a){var u=t+(n^(e|~r))+i+a;return(u<>>32-o)+e}e.MD5=o._createHelper(s),e.HmacMD5=o._createHmacHelper(s)}(Math),i.MD5)}()},function(t,e,n){"use strict";(function(e){var r=n(49),i=n(52),o=n(115),a=n(134),u=(n(29),n(63)),s=n(79),c=n(118),f=n(152),l=n(153),d=4294967295,h=d,p=Math.pow(2,31),g=Math.pow(2,22),m=65535,b=Math.pow(2,16)-1;function v(t){return this instanceof v?t?this._fromObject(t):void 0:new v(t)}v.MAXINT=d,v.DEFAULT_SEQNUMBER=h,v.DEFAULT_LOCKTIME_SEQNUMBER=4294967294,v.DEFAULT_RBF_SEQNUMBER=4294967293,v.SEQUENCE_LOCKTIME_TYPE_FLAG=g,Object.defineProperty(v.prototype,"script",{configurable:!1,enumerable:!0,get:function(){return this.isNull()?null:(this._script||(this._script=new c(this._scriptBuffer),this._script._isInput=!0),this._script)}}),v.fromObject=function(t){return i.checkArgument(r.isObject(t)),(new v)._fromObject(t)},v.prototype._fromObject=function(t){var n;if(n=r.isString(t.prevTxId)&&s.isHexa(t.prevTxId)?e.from(t.prevTxId,"hex"):t.prevTxId,this.output=t.output?t.output instanceof l?t.output:new l(t.output):void 0,this.prevTxId=n||t.txidbuf,this.outputIndex=r.isUndefined(t.outputIndex)?t.txoutnum:t.outputIndex,this.sequenceNumber=r.isUndefined(t.sequenceNumber)?r.isUndefined(t.seqnum)?h:t.seqnum:t.sequenceNumber,r.isUndefined(t.script)&&r.isUndefined(t.scriptBuffer))throw new o.Transaction.Input.MissingScript;return this.setScript(t.scriptBuffer||t.script),this},v.prototype.toObject=v.prototype.toJSON=function(){var t={prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,sequenceNumber:this.sequenceNumber,script:this._scriptBuffer.toString("hex")};return this.script&&(t.scriptString=this.script.toString()),this.output&&(t.output=this.output.toObject()),t},v.fromBufferReader=function(t){var e=new v;return e.prevTxId=t.readReverse(32),e.outputIndex=t.readUInt32LE(),e._scriptBuffer=t.readVarLengthBuffer(),e.sequenceNumber=t.readUInt32LE(),e},v.prototype.toBufferWriter=function(t){t||(t=new a),t.writeReverse(this.prevTxId),t.writeUInt32LE(this.outputIndex);var e=this._scriptBuffer;return t.writeVarintNum(e.length),t.write(e),t.writeUInt32LE(this.sequenceNumber),t},v.prototype.setScript=function(t){if(this._script=null,t instanceof c)this._script=t,this._script._isInput=!0,this._scriptBuffer=t.toBuffer();else if(null===t)this._script=c.empty(),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else if(s.isHexa(t))this._scriptBuffer=e.from(t,"hex");else if(r.isString(t))this._script=new c(t),this._script._isInput=!0,this._scriptBuffer=this._script.toBuffer();else{if(!u.isBuffer(t))throw new TypeError("Invalid argument type: script");this._scriptBuffer=e.from(t)}return this},v.prototype.getSignatures=function(){throw new o.AbstractMethodInvoked("Trying to sign unsupported output type (only P2PKH and P2SH multisig inputs are supported) for input: "+JSON.stringify(this))},v.prototype.isFullySigned=function(){throw new o.AbstractMethodInvoked("Input#isFullySigned")},v.prototype.isFinal=function(){return 4294967295!==this.sequenceNumber},v.prototype.addSignature=function(){throw new o.AbstractMethodInvoked("Input#addSignature")},v.prototype.clearSignatures=function(){throw new o.AbstractMethodInvoked("Input#clearSignatures")},v.prototype.isValidSignature=function(t,e,n){return e.signature.nhashtype=e.sigtype,f.verify(t,e.signature,e.publicKey,e.inputIndex,this.output.script,this.output.satoshisBN,void 0,n)},v.prototype.isNull=function(){return"0000000000000000000000000000000000000000000000000000000000000000"===this.prevTxId.toString("hex")&&4294967295===this.outputIndex},v.prototype._estimateSize=function(){return this.toBufferWriter().toBuffer().length},v.prototype.lockForSeconds=function(t){if(i.checkArgument(r.isNumber(t)),t<0||t>=33553920)throw new o.Transaction.Input.LockTimeRange;return t=parseInt(Math.floor(t/512)),this.sequenceNumber=t|g,this},v.prototype.lockUntilBlockHeight=function(t){if(i.checkArgument(r.isNumber(t)),t<0||t>=b)throw new o.Transaction.Input.BlockHeightOutOfRange;return this.sequenceNumber=t,this},v.prototype.getLockTime=function(){return this.sequenceNumber&p?null:this.sequenceNumber&g?512*(this.sequenceNumber&m):this.sequenceNumber&m},t.exports=v}).call(this,n(29).Buffer)},function(t,e){"function"===typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e,n){"use strict";(function(e){var r=n(49),i=n(52),o=n(206),a=n(63),u=n(79),s=n(101),c=n(115),f=n(100);function l(t){if(!(this instanceof l))return new l(t);if(t instanceof l)return t;if(r.isObject(t))return this._fromObject(t);throw new c.InvalidArgument("TransactionSignatures must be instantiated from an object")}o(l,f),l.prototype._fromObject=function(t){return this._checkObjectArgs(t),this.publicKey=new s(t.publicKey),this.prevTxId=a.isBuffer(t.prevTxId)?t.prevTxId:e.from(t.prevTxId,"hex"),this.outputIndex=t.outputIndex,this.inputIndex=t.inputIndex,this.signature=t.signature instanceof f?t.signature:a.isBuffer(t.signature)?f.fromBuffer(t.signature):f.fromString(t.signature),this.sigtype=t.sigtype,this},l.prototype._checkObjectArgs=function(t){i.checkArgument(s(t.publicKey),"publicKey"),i.checkArgument(!r.isUndefined(t.inputIndex),"inputIndex"),i.checkArgument(!r.isUndefined(t.outputIndex),"outputIndex"),i.checkState(r.isNumber(t.inputIndex),"inputIndex must be a number"),i.checkState(r.isNumber(t.outputIndex),"outputIndex must be a number"),i.checkArgument(t.signature,"signature"),i.checkArgument(t.prevTxId,"prevTxId"),i.checkState(t.signature instanceof f||a.isBuffer(t.signature)||u.isHexa(t.signature),"signature must be a buffer or hexa value"),i.checkState(a.isBuffer(t.prevTxId)||u.isHexa(t.prevTxId),"prevTxId must be a buffer or hexa value"),i.checkArgument(t.sigtype,"sigtype"),i.checkState(r.isNumber(t.sigtype),"sigtype must be a number")},l.prototype.toObject=l.prototype.toJSON=function(){return{publicKey:this.publicKey.toString(),prevTxId:this.prevTxId.toString("hex"),outputIndex:this.outputIndex,inputIndex:this.inputIndex,signature:this.signature.toString(),sigtype:this.sigtype}},l.fromObject=function(t){return i.checkArgument(t),new l(t)},t.exports=l}).call(this,n(29).Buffer)},function(t,e,n){"use strict";var r=n(58),i=n(17),o=n(393),a=n(4),u=["xs","sm","md","lg","xl"];function s(t){var e=t.values,n=void 0===e?{xs:0,sm:600,md:960,lg:1280,xl:1920}:e,r=t.unit,o=void 0===r?"px":r,s=t.step,c=void 0===s?5:s,f=Object(i.a)(t,["values","unit","step"]);function l(t){var e="number"===typeof n[t]?n[t]:t;return"@media (min-width:".concat(e).concat(o,")")}function d(t,e){var r=u.indexOf(e);return r===u.length-1?l(t):"@media (min-width:".concat("number"===typeof n[t]?n[t]:t).concat(o,") and ")+"(max-width:".concat((-1!==r&&"number"===typeof n[u[r+1]]?n[u[r+1]]:e)-c/100).concat(o,")")}return Object(a.a)({keys:u,values:n,up:l,down:function(t){var e=u.indexOf(t)+1,r=n[u[e]];return e===u.length?l("xs"):"@media (max-width:".concat(("number"===typeof r&&e>0?r:t)-c/100).concat(o,")")},between:d,only:function(t){return d(t,t)},width:function(t){return n[t]}},f)}function c(t,e,n){var i;return Object(a.a)({gutters:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object(a.a)({paddingLeft:e(2),paddingRight:e(2)},n,Object(r.a)({},t.up("sm"),Object(a.a)({paddingLeft:e(3),paddingRight:e(3)},n[t.up("sm")])))},toolbar:(i={minHeight:56},Object(r.a)(i,"".concat(t.up("xs")," and (orientation: landscape)"),{minHeight:48}),Object(r.a)(i,t.up("sm"),{minHeight:64}),i)},n)}var f=n(284),l={black:"#000",white:"#fff"},d={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"},h={50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe"},p={50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162"},g={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},m={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},b={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},v={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},y=n(36),_={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.54)",disabled:"rgba(0, 0, 0, 0.38)",hint:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:l.white,default:d[50]},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},w={text:{primary:l.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",hint:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:d[800],default:"#303030"},action:{active:l.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function S(t,e,n,r){var i=r.light||r,o=r.dark||1.5*r;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:"light"===e?t.light=Object(y.i)(t.main,i):"dark"===e&&(t.dark=Object(y.a)(t.main,o)))}function O(t){var e=t.primary,n=void 0===e?{light:h[300],main:h[500],dark:h[700]}:e,r=t.secondary,u=void 0===r?{light:p.A200,main:p.A400,dark:p.A700}:r,s=t.error,c=void 0===s?{light:g[300],main:g[500],dark:g[700]}:s,O=t.warning,x=void 0===O?{light:m[300],main:m[500],dark:m[700]}:O,E=t.info,M=void 0===E?{light:b[300],main:b[500],dark:b[700]}:E,T=t.success,$=void 0===T?{light:v[300],main:v[500],dark:v[700]}:T,A=t.type,k=void 0===A?"light":A,C=t.contrastThreshold,I=void 0===C?3:C,P=t.tonalOffset,N=void 0===P?.2:P,R=Object(i.a)(t,["primary","secondary","error","warning","info","success","type","contrastThreshold","tonalOffset"]);function j(t){return Object(y.e)(t,w.text.primary)>=I?w.text.primary:_.text.primary}var D=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:700;if(!(t=Object(a.a)({},t)).main&&t[e]&&(t.main=t[e]),!t.main)throw new Error(Object(f.a)(4,e));if("string"!==typeof t.main)throw new Error(Object(f.a)(5,JSON.stringify(t.main)));return S(t,"light",n,N),S(t,"dark",r,N),t.contrastText||(t.contrastText=j(t.main)),t},L={dark:w,light:_};return Object(o.a)(Object(a.a)({common:l,type:k,primary:D(n),secondary:D(u,"A400","A200","A700"),error:D(c),warning:D(x),info:D(M),success:D($),grey:d,contrastThreshold:I,getContrastText:j,augmentColor:D,tonalOffset:N},L[k]),R)}function x(t){return Math.round(1e5*t)/1e5}var E={textTransform:"uppercase"},M='"Roboto", "Helvetica", "Arial", sans-serif';function T(t,e){var n="function"===typeof e?e(t):e,r=n.fontFamily,u=void 0===r?M:r,s=n.fontSize,c=void 0===s?14:s,f=n.fontWeightLight,l=void 0===f?300:f,d=n.fontWeightRegular,h=void 0===d?400:d,p=n.fontWeightMedium,g=void 0===p?500:p,m=n.fontWeightBold,b=void 0===m?700:m,v=n.htmlFontSize,y=void 0===v?16:v,_=n.allVariants,w=n.pxToRem,S=Object(i.a)(n,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]);var O=c/14,T=w||function(t){return"".concat(t/y*O,"rem")},$=function(t,e,n,r,i){return Object(a.a)({fontFamily:u,fontWeight:t,fontSize:T(e),lineHeight:n},u===M?{letterSpacing:"".concat(x(r/e),"em")}:{},i,_)},A={h1:$(l,96,1.167,-1.5),h2:$(l,60,1.2,-.5),h3:$(h,48,1.167,0),h4:$(h,34,1.235,.25),h5:$(h,24,1.334,0),h6:$(g,20,1.6,.15),subtitle1:$(h,16,1.75,.15),subtitle2:$(g,14,1.57,.1),body1:$(h,16,1.5,.15),body2:$(h,14,1.43,.15),button:$(g,14,1.75,.4,E),caption:$(h,12,1.66,.4),overline:$(h,12,2.66,1,E)};return Object(o.a)(Object(a.a)({htmlFontSize:y,pxToRem:T,round:x,fontFamily:u,fontSize:c,fontWeightLight:l,fontWeightRegular:h,fontWeightMedium:g,fontWeightBold:b},A),S,{clone:!1})}function $(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var A=["none",$(0,2,1,-1,0,1,1,0,0,1,3,0),$(0,3,1,-2,0,2,2,0,0,1,5,0),$(0,3,3,-2,0,3,4,0,0,1,8,0),$(0,2,4,-1,0,4,5,0,0,1,10,0),$(0,3,5,-1,0,5,8,0,0,1,14,0),$(0,3,5,-1,0,6,10,0,0,1,18,0),$(0,4,5,-2,0,7,10,1,0,2,16,1),$(0,5,5,-3,0,8,10,1,0,3,14,2),$(0,5,6,-3,0,9,12,1,0,3,16,2),$(0,6,6,-3,0,10,14,1,0,4,18,3),$(0,6,7,-4,0,11,15,1,0,4,20,3),$(0,7,8,-4,0,12,17,2,0,5,22,4),$(0,7,8,-4,0,13,19,2,0,5,24,4),$(0,7,9,-4,0,14,21,2,0,5,26,4),$(0,8,9,-5,0,15,22,2,0,6,28,5),$(0,8,10,-5,0,16,24,2,0,6,30,5),$(0,8,11,-5,0,17,26,2,0,6,32,5),$(0,9,11,-5,0,18,28,2,0,7,34,6),$(0,9,12,-6,0,19,29,2,0,7,36,6),$(0,10,13,-6,0,20,31,3,0,8,38,7),$(0,10,13,-6,0,21,33,3,0,8,40,7),$(0,10,14,-6,0,22,35,3,0,8,42,7),$(0,11,14,-7,0,23,36,3,0,9,44,8),$(0,11,15,-7,0,24,38,3,0,9,46,8)],k={borderRadius:4},C=n(1146);function I(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(t.mui)return t;var e=Object(C.a)({spacing:t}),n=function(){for(var t=arguments.length,n=new Array(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=t.breakpoints,n=void 0===e?{}:e,r=t.mixins,a=void 0===r?{}:r,u=t.palette,f=void 0===u?{}:u,l=t.spacing,d=t.typography,h=void 0===d?{}:d,p=Object(i.a)(t,["breakpoints","mixins","palette","spacing","typography"]),g=O(f),m=s(n),b=I(l),v=Object(o.a)({breakpoints:m,direction:"ltr",mixins:c(m,b,a),overrides:{},palette:g,props:{},shadows:A,typography:T(g,h),spacing:b,shape:k,transitions:P.a,zIndex:N.a},p),y=arguments.length,_=new Array(y>1?y-1:0),w=1;w0&&(t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1)))))}));e.a=a},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(162),i=n(57);function o(t,e,n){return function(){for(var a=[],u=0,s=t,c=0;c=arguments.length)?f=e[c]:(f=arguments[u],u+=1),a[c]=f,Object(i.a)(f)||(s-=1),c+=1}return s<=0?n.apply(this,a):Object(r.a)(s,o(t,a,n))}}},function(t,e,n){"use strict";function r(t,e){return(r=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";var r=n(61);e.a="function"===typeof Object.assign?Object.assign:function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1,i=arguments.length;n1&&void 0!==arguments[1]?arguments[1]:166;function r(){for(var r=arguments.length,i=new Array(r),o=0;o=1&&d<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(u+1,0,d),h.setUTCHours(0,0,0,0);var p=Object(o.a)(h,e),g=new Date(0);g.setUTCFullYear(u,0,d),g.setUTCHours(0,0,0,0);var m=Object(o.a)(g,e);return n.getTime()>=p.getTime()?u+1:n.getTime()>=m.getTime()?u:u-1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(25),i=n(22);function o(t,e){Object(i.a)(2,arguments);var n=Object(r.a)(t),o=Object(r.a)(e),a=n.getFullYear()-o.getFullYear(),u=n.getMonth()-o.getMonth();return 12*a+u}var a=n(108),u=n(308);function s(t){Object(i.a)(1,arguments);var e=Object(r.a)(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function c(t){Object(i.a)(1,arguments);var e=Object(r.a)(t);return Object(u.a)(e).getTime()===s(e).getTime()}function f(t,e){Object(i.a)(2,arguments);var n,u=Object(r.a)(t),s=Object(r.a)(e),f=Object(a.a)(u,s),l=Math.abs(o(u,s));if(l<1)n=0;else{1===u.getMonth()&&u.getDate()>27&&u.setDate(30),u.setMonth(u.getMonth()-f*l);var d=Object(a.a)(u,s)===-f;c(Object(r.a)(t))&&1===l&&1===Object(a.a)(t,s)&&(d=!1),n=f*(l-Number(d))}return 0===n?0:n}},function(t,e,n){"use strict";var r=n(16),i=n(329),o=Object(r.a)((function(t,e){return Object(i.a)((n=t,function(){return!n.apply(this,arguments)}),e);var n}));e.a=o},function(t,e,n){"use strict";function r(t,e){var n=function(t){if(!o[t]){var e=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),n="06/25/2014, 00:00:00"===e||"\u200e06\u200e/\u200e25\u200e/\u200e2014\u200e \u200e00\u200e:\u200e00\u200e:\u200e00"===e;o[t]=n?new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}return o[t]}(e);return n.formatToParts?function(t,e){for(var n=t.formatToParts(e),r=[],o=0;o=0&&(r[a]=parseInt(n[o].value,10))}return r}(n,t):function(t,e){var n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(n);return[r[3],r[1],r[2],r[4],r[5],r[6]]}(n,t)}n.d(e,"a",(function(){return s}));var i={year:0,month:1,day:2,hour:3,minute:4,second:5};var o={};var a=36e5,u={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-])(\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function s(t,e,n){var r,i,o;if(r=u.timezoneZ.exec(t))return 0;if(r=u.timezoneHH.exec(t))return f(o=parseInt(r[2],10))?(i=o*a,"+"===r[1]?-i:i):NaN;if(r=u.timezoneHHMM.exec(t)){o=parseInt(r[2],10);var s=parseInt(r[3],10);return f(o,s)?(i=o*a+6e4*s,"+"===r[1]?-i:i):NaN}if(function(t){try{return Intl.DateTimeFormat(void 0,{timeZone:t}),!0}catch(e){return!1}}(t)){e=new Date(e||Date.now());var l=c(n?e:function(t){return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}(e),t);return-(n?l:function(t,e,n){var r=t.getTime()-e,i=c(new Date(r),n);if(e===i)return e;r-=i-e;var o=c(new Date(r),n);if(i===o)return i;return Math.max(i,o)}(e,l,t))}return 0}function c(t,e){var n=r(t,e),i=Date.UTC(n[0],n[1]-1,n[2],n[3]%24,n[4],n[5]),o=t.getTime(),a=o%1e3;return i-(o-=a>=0?a:1e3+a)}function f(t,e){return null==e||!(e<0||e>59)}},function(t,e,n){"use strict";function r(t,e,n){for(var r=0,i=n.length;r":l(n,r)},r=function(t,e){return Object(o.a)((function(e){return a(e)+": "+n(t[e])}),e.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+Object(o.a)(n,t).join(", ")+"))";case"[object Array]":return"["+Object(o.a)(n,t).concat(r(t,Object(f.a)((function(t){return/^\d+$/.test(t)}),Object(c.a)(t)))).join(", ")+"]";case"[object Boolean]":return"object"===typeof t?"new Boolean("+n(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?n(NaN):a(s(t)))+")";case"[object Null]":return"null";case"[object Number]":return"object"===typeof t?"new Number("+n(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object String]":return"object"===typeof t?"new String("+n(t.valueOf())+")":a(t);case"[object Undefined]":return"undefined";default:if("function"===typeof t.toString){var u=t.toString();if("[object Object]"!==u)return u}return"{"+r(t,Object(c.a)(t)).join(", ")+"}"}}var d=Object(r.a)((function(t){return l(t,[])}));e.a=d},function(t,e,n){var r=n(254),i=n(622),o=n(623),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e,n){var r=n(648);t.exports=function(t){return null==t?"":r(t)}},function(t,e,n){"use strict";var r=n(178);Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){var n=o.default.memo(o.default.forwardRef((function(e,n){return o.default.createElement(a.default,(0,i.default)({ref:n},e),t)})));0;return n.muiName=a.default.muiName,n};var i=r(n(80)),o=r(n(1)),a=r(n(433))},function(t,e,n){(function(t){var r=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),n={},r=0;r=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}})),s=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),p(n)?r.showHidden=n:n&&e._extend(r,n),v(r.showHidden)&&(r.showHidden=!1),v(r.depth)&&(r.depth=2),v(r.colors)&&(r.colors=!1),v(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=s),f(r,t,r.depth)}function s(t,e){var n=u.styles[e];return n?"\x1b["+u.colors[n][0]+"m"+t+"\x1b["+u.colors[n][1]+"m":t}function c(t,e){return t}function f(t,n,r){if(t.customInspect&&n&&O(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return b(i)||(i=f(t,i,r)),i}var o=function(t,e){if(v(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}if(m(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(g(e))return t.stylize("null","null")}(t,n);if(o)return o;var a=Object.keys(n),u=function(t){var e={};return t.forEach((function(t,n){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),S(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(n);if(0===a.length){if(O(n)){var s=n.name?": "+n.name:"";return t.stylize("[Function"+s+"]","special")}if(y(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return t.stylize(Date.prototype.toString.call(n),"date");if(S(n))return l(n)}var c,_="",x=!1,E=["{","}"];(h(n)&&(x=!0,E=["[","]"]),O(n))&&(_=" [Function"+(n.name?": "+n.name:"")+"]");return y(n)&&(_=" "+RegExp.prototype.toString.call(n)),w(n)&&(_=" "+Date.prototype.toUTCString.call(n)),S(n)&&(_=" "+l(n)),0!==a.length||x&&0!=n.length?r<0?y(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),c=x?function(t,e,n,r,i){for(var o=[],a=0,u=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1];return n[0]+e+" "+t.join(", ")+" "+n[1]}(c,_,E)):E[0]+_+E[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,n,r,i,o){var a,u,s;if((s=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?u=s.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):s.set&&(u=t.stylize("[Setter]","special")),$(r,i)||(a="["+i+"]"),u||(t.seen.indexOf(s.value)<0?(u=g(n)?f(t,s.value,null):f(t,s.value,n-1)).indexOf("\n")>-1&&(u=o?u.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+u.split("\n").map((function(t){return" "+t})).join("\n")):u=t.stylize("[Circular]","special")),v(a)){if(o&&i.match(/^\d+$/))return u;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+u}function h(t){return Array.isArray(t)}function p(t){return"boolean"===typeof t}function g(t){return null===t}function m(t){return"number"===typeof t}function b(t){return"string"===typeof t}function v(t){return void 0===t}function y(t){return _(t)&&"[object RegExp]"===x(t)}function _(t){return"object"===typeof t&&null!==t}function w(t){return _(t)&&"[object Date]"===x(t)}function S(t){return _(t)&&("[object Error]"===x(t)||t instanceof Error)}function O(t){return"function"===typeof t}function x(t){return Object.prototype.toString.call(t)}function E(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(n){if(v(o)&&(o=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_TYPE_CHECK_SANCTUARY:"false",REACT_APP_BUILD_TARGET:"LAMASSU"}).NODE_DEBUG||""),n=n.toUpperCase(),!a[n])if(new RegExp("\\b"+n+"\\b","i").test(o)){var r=t.pid;a[n]=function(){var t=e.format.apply(e,arguments);console.error("%s %d: %s",n,r,t)}}else a[n]=function(){};return a[n]},e.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=h,e.isBoolean=p,e.isNull=g,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=b,e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=v,e.isRegExp=y,e.isObject=_,e.isDate=w,e.isError=S,e.isFunction=O,e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=n(721);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var t=new Date,e=[E(t.getHours()),E(t.getMinutes()),E(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function $(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",T(),e.format.apply(e,arguments))},e.inherits=n(722),e._extend=function(t,e){if(!e||!_(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t};var A="undefined"!==typeof Symbol?Symbol("util.promisify.custom"):void 0;function k(t,e){if(!t){var n=new Error("Promise was rejected with a falsy value");n.reason=t,t=n}return e(t)}e.promisify=function(t){if("function"!==typeof t)throw new TypeError('The "original" argument must be of type Function');if(A&&t[A]){var e;if("function"!==typeof(e=t[A]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,A,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,n,r=new Promise((function(t,r){e=t,n=r})),i=[],o=0;o=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var i=0;i>>24&255,r[i++]=t>>>16&255,r[i++]=t>>>8&255,r[i++]=255&t}else for(r[i++]=255&t,r[i++]=t>>>8&255,r[i++]=t>>>16&255,r[i++]=t>>>24&255,r[i++]=0,r[i++]=0,r[i++]=0,r[i++]=0,o=8;o0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,u=s,console&&console.warn&&console.warn(u)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var s=i[t];if(void 0===s)return!1;if("function"===typeof s)o(s,this,e);else{var c=s.length,f=m(s,c);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return p(this,t,!0)},u.prototype.rawListeners=function(t){return p(this,t,!1)},u.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},u.prototype.listenerCount=g,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){(function(t){function n(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===n(t)},e.isBoolean=function(t){return"boolean"===typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"===typeof t},e.isString=function(t){return"string"===typeof t},e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===n(t)},e.isObject=function(t){return"object"===typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===n(t)},e.isError=function(t){return"[object Error]"===n(t)||t instanceof Error},e.isFunction=function(t){return"function"===typeof t},e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=t.isBuffer}).call(this,n(29).Buffer)},function(t,e,n){"use strict";var r=n(37).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!==typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=s,this.end=c,e=4;break;case"utf8":this.fillLast=u,e=4;break;case"base64":this.text=f,this.end=l,e=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function a(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function u(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function s(t,e){if((t.length-e)%2===0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function f(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function d(t){return t.toString(this.encoding)}function h(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(t.lastNeed=i-1),i;if(--r=0)return i>0&&(t.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){(function(e){t.exports=function(t,n){for(var r=Math.min(t.length,n.length),i=new e(r),o=0;o>>=8)}return n},t.exports=i}).call(this,n(69),n(29).Buffer)},function(t,e,n){"use strict";var r=n(178);Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i=r(n(1)),o=(0,r(n(233)).default)(i.default.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");e.default=o},function(t,e,n){"use strict";function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);nt.length)&&(e=t.length);for(var n=0,r=new Array(e);n1&&void 0!==arguments[1]?arguments[1]:.15;return c(t)>.5?f(t,e):l(t,e)},e.fade=function(t,e){t=u(t),e=i(e),("rgb"===t.type||"hsl"===t.type)&&(t.type+="a");return t.values[3]=e,s(t)},e.darken=f,e.lighten=l;var r=n(40);function i(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(e,t),n)}function o(t){t=t.substr(1);var e=new RegExp(".{1,".concat(t.length>=6?2:1,"}"),"g"),n=t.match(e);return n&&1===n[0].length&&(n=n.map((function(t){return t+t}))),n?"rgb".concat(4===n.length?"a":"","(").concat(n.map((function(t,e){return e<3?parseInt(t,16):Math.round(parseInt(t,16)/255*1e3)/1e3})).join(", "),")"):""}function a(t){var e=(t=u(t)).values,n=e[0],r=e[1]/100,i=e[2]/100,o=r*Math.min(i,1-i),a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t+n/30)%12;return i-o*Math.max(Math.min(e-3,9-e,1),-1)},c="rgb",f=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===t.type&&(c+="a",f.push(e[3])),s({type:c,values:f})}function u(t){if(t.type)return t;if("#"===t.charAt(0))return u(o(t));var e=t.indexOf("("),n=t.substring(0,e);if(-1===["rgb","rgba","hsl","hsla"].indexOf(n))throw new Error((0,r.formatMuiErrorMessage)(3,t));var i=t.substring(e+1,t.length-1).split(",");return{type:n,values:i=i.map((function(t){return parseFloat(t)}))}}function s(t){var e=t.type,n=t.values;return-1!==e.indexOf("rgb")?n=n.map((function(t,e){return e<3?parseInt(t,10):t})):-1!==e.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),"".concat(e,"(").concat(n.join(", "),")")}function c(t){var e="hsl"===(t=u(t)).type?u(a(t)).values:t.values;return e=e.map((function(t){return(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function f(t,e){if(t=u(t),e=i(e),-1!==t.type.indexOf("hsl"))t.values[2]*=1-e;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]*=1-e;return s(t)}function l(t,e){if(t=u(t),e=i(e),-1!==t.type.indexOf("hsl"))t.values[2]+=(100-t.values[2])*e;else if(-1!==t.type.indexOf("rgb"))for(var n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;return s(t)}},function(t,e,n){"use strict";function r(t){return"[object Number]"===Object.prototype.toString.call(t)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(51),i=n(213);var o=n(293);function a(t,e,n){return(a=Object(o.a)()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&Object(i.a)(o,n.prototype),o}).apply(null,arguments)}function u(t){var e="function"===typeof Map?new Map:void 0;return(u=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!==typeof t)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof e){if(e.has(t))return e.get(t);e.set(t,o)}function o(){return a(t,arguments,Object(r.a)(this).constructor)}return o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),Object(i.a)(o,t)})(t)}},,,function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){var r=n(147).Symbol;t.exports=r},function(t,e,n){var r=n(177)(Object,"create");t.exports=r},function(t,e,n){var r=n(638),i=n(639),o=n(640),a=n(641),u=n(642);function s(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e>8,a=255&i;o?n.push(o,a):n.push(a)}return n},r.zero2=i,r.toHex=o,r.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,n){"use strict";var r=n(149),i=n(114),o=i.getNAF,a=i.getJSF,u=i.assert;function s(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(t,e){u(t.precomputed);var n=t._getDoubles(),r=o(e,1,this._bitLength),i=(1<=a;f--)s=(s<<1)+r[f];c.push(s)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,s=s.dblp(f),c<0)break;var l=a[c];u(0!==l),s="affine"===t.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},s.prototype._wnafMulAdd=function(t,e,n,r,i){var u,s,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(u=0;u=1;u-=2){var g=u-1,m=u;if(1===f[g]&&1===f[m]){var b=[e[g],null,null,e[m]];0===e[g].y.cmp(e[m].y)?(b[1]=e[g].add(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg())):0===e[g].y.cmp(e[m].y.redNeg())?(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].add(e[m].neg())):(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=a(n[g],n[m]);for(h=Math.max(y[0].length,h),d[g]=new Array(h),d[m]=new Array(h),s=0;s=0;u--){for(var x=0;u>=0;){var E=!0;for(s=0;s=0&&x++,S=S.dblp(x),u<0)break;for(s=0;s0?c=l[s][M-1>>1]:M<0&&(c=l[s][-M-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(u=0;u=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;in)?e=("rmd160"===t?new s:c(t)).update(e).digest():e.length=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(!y(t[u=f[c]],e[u],n,r))return!1;return!0}(t,e,n,r))}return n?t===e:t==e}function _(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(n){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function S(t,e,n,r){var i;if("function"!==typeof e)throw new TypeError('"block" argument must be a function');"string"===typeof n&&(r=n,n=null),i=function(t){var e;try{t()}catch(n){e=n}return e}(e),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),t&&!i&&b(i,n,"Missing expected exception"+r);var o="string"===typeof r,u=!t&&i&&!n;if((!t&&a.isError(i)&&o&&w(i,n)||u)&&b(i,n,"Got unwanted exception"+r),t&&i&&n&&!w(i,n)||!t&&i)throw i}d.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return g(m(t.actual),128)+" "+t.operator+" "+g(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||b;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var n=new Error;if(n.stack){var r=n.stack,i=p(e),o=r.indexOf("\n"+i);if(o>=0){var a=r.indexOf("\n",o+1);r=r.substring(a+1)}this.stack=r}}},a.inherits(d.AssertionError,Error),d.fail=b,d.ok=v,d.equal=function(t,e,n){t!=e&&b(t,e,n,"==",d.equal)},d.notEqual=function(t,e,n){t==e&&b(t,e,n,"!=",d.notEqual)},d.deepEqual=function(t,e,n){y(t,e,!1)||b(t,e,n,"deepEqual",d.deepEqual)},d.deepStrictEqual=function(t,e,n){y(t,e,!0)||b(t,e,n,"deepStrictEqual",d.deepStrictEqual)},d.notDeepEqual=function(t,e,n){y(t,e,!1)&&b(t,e,n,"notDeepEqual",d.notDeepEqual)},d.notDeepStrictEqual=function t(e,n,r){y(e,n,!0)&&b(e,n,r,"notDeepStrictEqual",t)},d.strictEqual=function(t,e,n){t!==e&&b(t,e,n,"===",d.strictEqual)},d.notStrictEqual=function(t,e,n){t===e&&b(t,e,n,"!==",d.notStrictEqual)},d.throws=function(t,e,n){S(!0,t,e,n)},d.doesNotThrow=function(t,e,n){S(!1,t,e,n)},d.ifError=function(t){if(t)throw t},d.strict=r((function t(e,n){e||b(e,!0,n,"==",t)}),d,{equal:d.strictEqual,deepEqual:d.deepStrictEqual,notEqual:d.notStrictEqual,notDeepEqual:d.notDeepStrictEqual}),d.strict.strict=d.strict;var O=Object.keys||function(t){var e=[];for(var n in t)u.call(t,n)&&e.push(n);return e}}).call(this,n(59))},function(t,e,n){var r=n(37).Buffer;function i(t){r.isBuffer(t)||(t=r.from(t));for(var e=t.length/4|0,n=new Array(e),i=0;i>>24]^f[p>>>16&255]^l[g>>>8&255]^d[255&m]^e[b++],a=c[p>>>24]^f[g>>>16&255]^l[m>>>8&255]^d[255&h]^e[b++],u=c[g>>>24]^f[m>>>16&255]^l[h>>>8&255]^d[255&p]^e[b++],s=c[m>>>24]^f[h>>>16&255]^l[p>>>8&255]^d[255&g]^e[b++],h=o,p=a,g=u,m=s;return o=(r[h>>>24]<<24|r[p>>>16&255]<<16|r[g>>>8&255]<<8|r[255&m])^e[b++],a=(r[p>>>24]<<24|r[g>>>16&255]<<16|r[m>>>8&255]<<8|r[255&h])^e[b++],u=(r[g>>>24]<<24|r[m>>>16&255]<<16|r[h>>>8&255]<<8|r[255&p])^e[b++],s=(r[m>>>24]<<24|r[h>>>16&255]<<16|r[p>>>8&255]<<8|r[255&g])^e[b++],[o>>>=0,a>>>=0,u>>>=0,s>>>=0]}var u=[0,1,2,4,8,16,32,64,128,27,54],s=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var n=[],r=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,u=0,s=0;s<256;++s){var c=u^u<<1^u<<2^u<<3^u<<4;c=c>>>8^255&c^99,n[a]=c,r[c]=a;var f=t[a],l=t[f],d=t[l],h=257*t[c]^16843008*c;i[0][a]=h<<24|h>>>8,i[1][a]=h<<16|h>>>16,i[2][a]=h<<8|h>>>24,i[3][a]=h,h=16843009*d^65537*l^257*f^16843008*a,o[0][c]=h<<24|h>>>8,o[1][c]=h<<16|h>>>16,o[2][c]=h<<8|h>>>24,o[3][c]=h,0===a?a=u=1:(a=f^t[t[t[d^f]]],u^=t[t[u]])}return{SBOX:n,INV_SBOX:r,SUB_MIX:i,INV_SUB_MIX:o}}();function c(t){this._key=i(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,n=e+6,r=4*(n+1),i=[],o=0;o>>24,a=s.SBOX[a>>>24]<<24|s.SBOX[a>>>16&255]<<16|s.SBOX[a>>>8&255]<<8|s.SBOX[255&a],a^=u[o/e|0]<<24):e>6&&o%e===4&&(a=s.SBOX[a>>>24]<<24|s.SBOX[a>>>16&255]<<16|s.SBOX[a>>>8&255]<<8|s.SBOX[255&a]),i[o]=i[o-e]^a}for(var c=[],f=0;f>>24]]^s.INV_SUB_MIX[1][s.SBOX[d>>>16&255]]^s.INV_SUB_MIX[2][s.SBOX[d>>>8&255]]^s.INV_SUB_MIX[3][s.SBOX[255&d]]}this._nRounds=n,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,s.SUB_MIX,s.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),n=r.allocUnsafe(16);return n.writeUInt32BE(e[0],0),n.writeUInt32BE(e[1],4),n.writeUInt32BE(e[2],8),n.writeUInt32BE(e[3],12),n},c.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var n=a(t,this._invKeySchedule,s.INV_SUB_MIX,s.INV_SBOX,this._nRounds),o=r.allocUnsafe(16);return o.writeUInt32BE(n[0],0),o.writeUInt32BE(n[3],4),o.writeUInt32BE(n[2],8),o.writeUInt32BE(n[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=c},function(t,e,n){var r=n(37).Buffer,i=n(358);t.exports=function(t,e,n,o){if(r.isBuffer(t)||(t=r.from(t,"binary")),e&&(r.isBuffer(e)||(e=r.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=n/8,u=r.alloc(a),s=r.alloc(o||0),c=r.alloc(0);a>0||o>0;){var f=new i;f.update(c),f.update(t),e&&f.update(e),c=f.digest();var l=0;if(a>0){var d=u.length-a;l=Math.min(a,c.length),c.copy(u,d,0,l),a-=l}if(l0){var h=s.length-o,p=Math.min(o,c.length-l);c.copy(s,h,l,l+p),o-=p}}return c.fill(0),{key:u,iv:s}}},function(t,e,n){"use strict";var r=n(150),i=n(116),o=i.getNAF,a=i.getJSF,u=i.assert;function s(t,e){this.type=t,this.p=new r(e.p,16),this.red=e.prime?r.red(e.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=e.n&&new r(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(t,e){u(t.precomputed);var n=t._getDoubles(),r=o(e,1,this._bitLength),i=(1<=a;f--)s=(s<<1)+r[f];c.push(s)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,s=s.dblp(f),c<0)break;var l=a[c];u(0!==l),s="affine"===t.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},s.prototype._wnafMulAdd=function(t,e,n,r,i){var u,s,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(u=0;u=1;u-=2){var g=u-1,m=u;if(1===f[g]&&1===f[m]){var b=[e[g],null,null,e[m]];0===e[g].y.cmp(e[m].y)?(b[1]=e[g].add(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg())):0===e[g].y.cmp(e[m].y.redNeg())?(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].add(e[m].neg())):(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=a(n[g],n[m]);for(h=Math.max(y[0].length,h),d[g]=new Array(h),d[m]=new Array(h),s=0;s=0;u--){for(var x=0;u>=0;){var E=!0;for(s=0;s=0&&x++,S=S.dblp(x),u<0)break;for(s=0;s0?c=l[s][M-1>>1]:M<0&&(c=l[s][-M-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(u=0;u=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=s,s.prototype.point=function(){throw new Error("Not implemented")},s.prototype.validate=function(){throw new Error("Not implemented")},s.prototype._fixedNafMul=function(t,e){u(t.precomputed);var n=t._getDoubles(),r=o(e,1,this._bitLength),i=(1<=a;f--)s=(s<<1)+r[f];c.push(s)}for(var l=this.jpoint(null,null,null),d=this.jpoint(null,null,null),h=i;h>0;h--){for(a=0;a=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,s=s.dblp(f),c<0)break;var l=a[c];u(0!==l),s="affine"===t.type?l>0?s.mixedAdd(i[l-1>>1]):s.mixedAdd(i[-l-1>>1].neg()):l>0?s.add(i[l-1>>1]):s.add(i[-l-1>>1].neg())}return"affine"===t.type?s.toP():s},s.prototype._wnafMulAdd=function(t,e,n,r,i){var u,s,c,f=this._wnafT1,l=this._wnafT2,d=this._wnafT3,h=0;for(u=0;u=1;u-=2){var g=u-1,m=u;if(1===f[g]&&1===f[m]){var b=[e[g],null,null,e[m]];0===e[g].y.cmp(e[m].y)?(b[1]=e[g].add(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg())):0===e[g].y.cmp(e[m].y.redNeg())?(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].add(e[m].neg())):(b[1]=e[g].toJ().mixedAdd(e[m]),b[2]=e[g].toJ().mixedAdd(e[m].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=a(n[g],n[m]);for(h=Math.max(y[0].length,h),d[g]=new Array(h),d[m]=new Array(h),s=0;s=0;u--){for(var x=0;u>=0;){var E=!0;for(s=0;s=0&&x++,S=S.dblp(x),u<0)break;for(s=0;s0?c=l[s][M-1>>1]:M<0&&(c=l[s][-M-1>>1].neg()),S="affine"===c.type?S.mixedAdd(c):S.add(c))}}for(u=0;u=Math.ceil((t.bitLength()+1)/e.step)},c.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],r=this,i=0;i"},t.exports=h}).call(this,n(29).Buffer)},function(t,e,n){"use strict";(function(e){var r=n(49),i=n(364),o=n(29),a="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".split(""),u=function t(n){if(!(this instanceof t))return new t(n);if(e.isBuffer(n)){var r=n;this.fromBuffer(r)}else if("string"===typeof n){var i=n;this.fromString(i)}else n&&this.set(n)};u.validCharacters=function(t){return o.Buffer.isBuffer(t)&&(t=t.toString()),r.every(r.map(t,(function(t){return r.includes(a,t)})))},u.prototype.set=function(t){return this.buf=t.buf||this.buf||void 0,this},u.encode=function(t){if(!o.Buffer.isBuffer(t))throw new Error("Input should be a buffer");return i.encode(t)},u.decode=function(t){if("string"!==typeof t)throw new Error("Input should be a string");return e.from(i.decode(t))},u.prototype.fromBuffer=function(t){return this.buf=t,this},u.prototype.fromString=function(t){var e=u.decode(t);return this.buf=e,this},u.prototype.toBuffer=function(){return this.buf},u.prototype.toString=function(){return u.encode(this.buf)},t.exports=u}).call(this,n(29).Buffer)},function(t,e,n){"use strict";(function(e){var r=n(49),i=n(52),o=n(63),a=n(79);function u(t){if(!(this instanceof u))return new u(t);var e;if(r.isNumber(t))e=t;else{if(!r.isString(t))throw new TypeError('Unrecognized num type: "'+typeof t+'" for Opcode');e=u.map[t]}return a.defineImmutable(this,{num:e}),this}for(var s in u.fromBuffer=function(t){return i.checkArgument(o.isBuffer(t)),new u(Number("0x"+t.toString("hex")))},u.fromNumber=function(t){return i.checkArgument(r.isNumber(t)),new u(t)},u.fromString=function(t){i.checkArgument(r.isString(t));var e=u.map[t];if("undefined"===typeof e)throw new TypeError("Invalid opcodestr");return new u(e)},u.prototype.toHex=function(){return this.num.toString(16)},u.prototype.toBuffer=function(){return e.from(this.toHex(),"hex")},u.prototype.toNumber=function(){return this.num},u.prototype.toString=function(){var t=u.reverseMap[this.num];if("undefined"===typeof t)throw new Error("Opcode does not have a string representation");return t},u.smallInt=function(t){return i.checkArgument(r.isNumber(t),"Invalid Argument: n should be number"),i.checkArgument(t>=0&&t<=16,"Invalid Argument: n must be between 0 and 16"),0===t?u("OP_0"):new u(u.map.OP_1+t-1)},u.map={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_TRUE:81,OP_1:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SPLIT:127,OP_NUM2BIN:128,OP_BIN2NUM:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_CHECKSEQUENCEVERIFY:178,OP_NOP1:176,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_CHECKDATASIG:186,OP_CHECKDATASIGVERIFY:187,OP_REVERSEBYTES:188,OP_PREFIX_BEGIN:240,OP_PREFIX_END:241,OP_SMALLINTEGER:250,OP_PUBKEYS:251,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255},u.reverseMap=[],u.map)u.reverseMap[u.map[s]]=s;r.extend(u,u.map),u.isSmallIntOp=function(t){return t instanceof u&&(t=t.toNumber()),t===u.map.OP_0||t>=u.map.OP_1&&t<=u.map.OP_16},u.prototype.inspect=function(){return""},t.exports=u}).call(this,n(29).Buffer)},function(t,e,n){t.exports=n(387),t.exports.Input=n(388),t.exports.Output=n(153),t.exports.UnspentOutput=n(516),t.exports.Signature=n(207),t.exports.Sighash=n(152)},function(t,e,n){"use strict";(function(e){var r=n(49),i=n(78),o=n(63),a=n(160),u=n(134),s=n(84),c=(n(79),n(52)),f=function t(e){if(!(this instanceof t))return new t(e);var n=t._from(e);return this.version=n.version,this.prevHash=n.prevHash,this.merkleRoot=n.merkleRoot,this.time=n.time,this.timestamp=n.time,this.bits=n.bits,this.nonce=n.nonce,n.hash&&c.checkState(this.hash===n.hash,"Argument object hash property does not match block hash."),this};f._from=function(t){var e={};if(o.isBuffer(t))e=f._fromBufferReader(a(t));else{if(!r.isObject(t))throw new TypeError("Unrecognized argument for BlockHeader");e=f._fromObject(t)}return e},f._fromObject=function(t){c.checkArgument(t,"data is required");var n=t.prevHash,i=t.merkleRoot;return r.isString(t.prevHash)&&(n=o.reverse(e.from(t.prevHash,"hex"))),r.isString(t.merkleRoot)&&(i=o.reverse(e.from(t.merkleRoot,"hex"))),{hash:t.hash,version:t.version,prevHash:n,merkleRoot:i,time:t.time,timestamp:t.time,bits:t.bits,nonce:t.nonce}},f.fromObject=function(t){var e=f._fromObject(t);return new f(e)},f.fromRawBlock=function(t){o.isBuffer(t)||(t=e.from(t,"binary"));var n=a(t);n.pos=f.Constants.START_OF_HEADER;var r=f._fromBufferReader(n);return new f(r)},f.fromBuffer=function(t){var e=f._fromBufferReader(a(t));return new f(e)},f.fromString=function(t){var n=e.from(t,"hex");return f.fromBuffer(n)},f._fromBufferReader=function(t){var e={};return e.version=t.readInt32LE(),e.prevHash=t.read(32),e.merkleRoot=t.read(32),e.time=t.readUInt32LE(),e.bits=t.readUInt32LE(),e.nonce=t.readUInt32LE(),e},f.fromBufferReader=function(t){var e=f._fromBufferReader(t);return new f(e)},f.prototype.toObject=f.prototype.toJSON=function(){return{hash:this.hash,version:this.version,prevHash:o.reverse(this.prevHash).toString("hex"),merkleRoot:o.reverse(this.merkleRoot).toString("hex"),time:this.time,bits:this.bits,nonce:this.nonce}},f.prototype.toBuffer=function(){return this.toBufferWriter().concat()},f.prototype.toString=function(){return this.toBuffer().toString("hex")},f.prototype.toBufferWriter=function(t){return t||(t=new u),t.writeInt32LE(this.version),t.write(this.prevHash),t.write(this.merkleRoot),t.writeUInt32LE(this.time),t.writeUInt32LE(this.bits),t.writeUInt32LE(this.nonce),t},f.prototype.getTargetDifficulty=function(t){t=t||this.bits;for(var e=new i(16777215&t),n=8*((t>>>24)-3);n-- >0;)e=e.mul(new i(2));return e},f.prototype.getDifficulty=function(){var t=this.getTargetDifficulty(486604799).mul(new i(Math.pow(10,8))),e=this.getTargetDifficulty(),n=t.div(e).toString(10),r=n.length-8;return n=n.slice(0,r)+"."+n.slice(r),parseFloat(n)},f.prototype._getHash=function(){var t=this.toBuffer();return s.sha256sha256(t)};var l={configurable:!1,enumerable:!0,get:function(){return this._id||(this._id=a(this._getHash()).readReverse().toString("hex")),this._id},set:r.noop};Object.defineProperty(f.prototype,"id",l),Object.defineProperty(f.prototype,"hash",l),f.prototype.validTimestamp=function(){var t=Math.round((new Date).getTime()/1e3);return!(this.time>t+f.Constants.MAX_TIME_OFFSET)},f.prototype.validProofOfWork=function(){var t=new i(this.id,"hex"),e=this.getTargetDifficulty();return!(t.cmp(e)>0)},f.prototype.inspect=function(){return""},f.Constants={START_OF_HEADER:8,MAX_TIME_OFFSET:7200,LARGEST_HASH:new i("10000000000000000000000000000000000000000000000000000000000000000","hex")},t.exports=f}).call(this,n(29).Buffer)},function(t,e,n){"use strict";n.r(e);var r=n(304);n.d(e,"default",(function(){return r.a}))},function(t,e,n){"use strict";n.r(e);var r=n(395);n.d(e,"default",(function(){return r.a}))},function(t,e,n){"use strict";var r=n(4),i=n(17),o=n(1),a=n.n(o),u=n(15),s=(n(13),n(126)),c=n.n(s),f=n(976);function l(t,e){var n={};return Object.keys(t).forEach((function(r){-1===e.indexOf(r)&&(n[r]=t[r])})),n}var d=n(136);e.a=function(t){var e=function(t){return function(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=o.name,d=Object(i.a)(o,["name"]),h=s,p="function"===typeof e?function(t){return{root:function(n){return e(Object(r.a)({theme:t},n))}}}:{root:e},g=Object(f.a)(p,Object(r.a)({Component:t,name:s||t.displayName,classNamePrefix:h},d));e.filterProps&&(n=e.filterProps,delete e.filterProps),e.propTypes&&(e.propTypes,delete e.propTypes);var m=a.a.forwardRef((function(e,o){var s=e.children,c=e.className,f=e.clone,d=e.component,h=Object(i.a)(e,["children","className","clone","component"]),p=g(e),m=Object(u.a)(p.root,c),b=h;if(n&&(b=l(b,n)),f)return a.a.cloneElement(s,Object(r.a)({className:Object(u.a)(s.props.className,m)},b));if("function"===typeof s)return s(Object(r.a)({className:m},b));var v=d||t;return a.a.createElement(v,Object(r.a)({ref:o,className:m},b),s)}));return c()(m,t),m}}(t);return function(t,n){return e(t,Object(r.a)({defaultTheme:d.a},n))}}},function(t,e,n){"use strict";var r=n(1),i=n.n(r).a.createContext(null);e.a=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(245);function i(t,e){if(t){if("string"===typeof t)return Object(r.a)(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(t,e):void 0}}},function(t,e,n){"use strict";var r="function"===typeof Symbol&&Symbol.for;e.a=r?Symbol.for("mui.nested"):"__THEME_NESTED__"},function(t,e,n){"use strict";function r(t){for(var e="https://material-ui.com/production-error/?code="+t,n=1;n2)return"[Array]";for(var n=Math.min(10,t.length),r=t.length-n,i=[],o=0;o1&&i.push("... ".concat(r," more items"));return"["+i.join(", ")+"]"}(t,n);return function(t,e){var n=Object.keys(t);if(0===n.length)return"{}";if(e.length>2)return"["+function(t){var e=Object.prototype.toString.call(t).replace(/^\[object /,"").replace(/]$/,"");if("Object"===e&&"function"===typeof t.constructor){var n=t.constructor.name;if("string"===typeof n&&""!==n)return n}return e}(t)+"]";return"{ "+n.map((function(n){return n+": "+a(t[n],e)})).join(", ")+" }"}(t,n)}(t,e);default:return String(t)}}},function(t,e,n){"use strict";function r(t){var e=t.split(/\r\n|[\n\r]/g),n=function(t){for(var e=null,n=1;n0&&o(e[0]);)e.shift();for(;e.length>0&&o(e[e.length-1]);)e.pop();return e.join("\n")}function i(t){for(var e=0;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=-1===t.indexOf("\n"),i=" "===t[0]||"\t"===t[0],o='"'===t[t.length-1],a=!r||o||n,u="";return!a||r&&i||(u+="\n"+e),u+=e?t.replace(/\n/g,"\n"+e):t,a&&(u+="\n"),'"""'+u.replace(/"""/g,'\\"""')+'"""'}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return a}))},function(t,e,n){"use strict";var r=n(61),i=Object.prototype.toString,o=function(){return"[object Arguments]"===i.call(arguments)?function(t){return"[object Arguments]"===i.call(t)}:function(t){return Object(r.a)("callee",t)}}();e.a=o},function(t,e,n){"use strict";function r(t,e){for(var n=0,r=e.length,i=[];n=c?s:(n.setFullYear(s.getFullYear(),s.getMonth(),u),n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(30),i=n(307),o=n(22);function a(t,e){Object(o.a)(2,arguments);var n=Object(r.a)(e);return Object(i.a)(t,-n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(30),i=n(25),o=n(22);function a(t,e){Object(o.a)(2,arguments);var n=Object(i.a)(t),a=Object(r.a)(e);return isNaN(a)?new Date(NaN):a?(n.setDate(n.getDate()+a),n):n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(25),i=n(22);function o(t){Object(i.a)(1,arguments);var e=Object(r.a)(t);return e.setHours(23,59,59,999),e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(219),i=n(22),o=n(220);function a(t,e,n){Object(i.a)(2,arguments);var a=Object(r.a)(t,e)/1e3;return Object(o.a)(null===n||void 0===n?void 0:n.roundingMethod)(a)}},function(t,e,n){"use strict";function r(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}}function i(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}}var o={p:i,P:function(t,e){var n,o=t.match(/(P+)(p+)?/),a=o[1],u=o[2];if(!u)return r(t,e);switch(a){case"P":n=e.dateTime({width:"short"});break;case"PP":n=e.dateTime({width:"medium"});break;case"PPP":n=e.dateTime({width:"long"});break;case"PPPP":default:n=e.dateTime({width:"full"})}return n.replace("{{date}}",r(a,e)).replace("{{time}}",i(u,e))}};e.a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(25),i=n(142),o=n(22);function a(t){Object(o.a)(1,arguments);var e=Object(r.a)(t),n=e.getUTCFullYear(),a=new Date(0);a.setUTCFullYear(n+1,0,4),a.setUTCHours(0,0,0,0);var u=Object(i.a)(a),s=new Date(0);s.setUTCFullYear(n,0,4),s.setUTCHours(0,0,0,0);var c=Object(i.a)(s);return e.getTime()>=u.getTime()?n+1:e.getTime()>=c.getTime()?n:n-1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(313);function i(t){return Object(r.a)({},t)}},function(t,e,n){"use strict";function r(t,e){if(null==t)throw new TypeError("assign requires that input parameter not be null or undefined");for(var n in e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var r=n(30),i=n(109),o=n(224),a=36e5,u={dateTimeDelimeter:/[T ]/,plainTime:/:/,timeZoneDelimeter:/[Z ]/i,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timezone:/([Z+-].*| UTC|(?:[a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?))$/};function s(t,e){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(null===t)return new Date(NaN);var n=e||{},a=null==n.additionalDigits?2:Object(r.a)(n.additionalDigits);if(2!==a&&1!==a&&0!==a)throw new RangeError("additionalDigits must be 0, 1 or 2");if(t instanceof Date||"object"===typeof t&&"[object Date]"===Object.prototype.toString.call(t))return new Date(t.getTime());if("number"===typeof t||"[object Number]"===Object.prototype.toString.call(t))return new Date(t);if("string"!==typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var u=c(t),s=f(u.date,a),h=s.year,p=s.restDateString,g=l(p,h);if(isNaN(g))return new Date(NaN);if(g){var m,b=g.getTime(),v=0;if(u.time&&(v=d(u.time),isNaN(v)))return new Date(NaN);if(u.timezone||n.timeZone){if(m=Object(o.a)(u.timezone||n.timeZone,new Date(b+v)),isNaN(m))return new Date(NaN)}else m=Object(i.a)(new Date(b+v)),m=Object(i.a)(new Date(b+v+m));return new Date(b+v+m)}return new Date(NaN)}function c(t){var e,n={},r=t.split(u.dateTimeDelimeter);if(u.plainTime.test(r[0])?(n.date=null,e=r[0]):(n.date=r[0],e=r[1],n.timezone=r[2],u.timeZoneDelimeter.test(n.date)&&(n.date=t.split(u.timeZoneDelimeter)[0],e=t.substr(n.date.length,t.length))),e){var i=u.timezone.exec(e);i?(n.time=e.replace(i[1],""),n.timezone=i[1]):n.time=e}return n}function f(t,e){var n,r=u.YYY[e],i=u.YYYYY[e];if(n=u.YYYY.exec(t)||i.exec(t)){var o=n[1];return{year:parseInt(o,10),restDateString:t.slice(o.length)}}if(n=u.YY.exec(t)||r.exec(t)){var a=n[1];return{year:100*parseInt(a,10),restDateString:t.slice(a.length)}}return{year:null}}function l(t,e){if(null===e)return null;var n,r,i,o;if(0===t.length)return(r=new Date(0)).setUTCFullYear(e),r;if(n=u.MM.exec(t))return r=new Date(0),b(e,i=parseInt(n[1],10)-1)?(r.setUTCFullYear(e,i),r):new Date(NaN);if(n=u.DDD.exec(t)){r=new Date(0);var a=parseInt(n[1],10);return function(t,e){if(e<1)return!1;var n=m(t);if(n&&e>366)return!1;if(!n&&e>365)return!1;return!0}(e,a)?(r.setUTCFullYear(e,0,a),r):new Date(NaN)}if(n=u.MMDD.exec(t)){r=new Date(0),i=parseInt(n[1],10)-1;var s=parseInt(n[2],10);return b(e,i,s)?(r.setUTCFullYear(e,i,s),r):new Date(NaN)}if(n=u.Www.exec(t))return v(e,o=parseInt(n[1],10)-1)?h(e,o):new Date(NaN);if(n=u.WwwD.exec(t)){o=parseInt(n[1],10)-1;var c=parseInt(n[2],10)-1;return v(e,o,c)?h(e,o,c):new Date(NaN)}return null}function d(t){var e,n,r;if(e=u.HH.exec(t))return y(n=parseFloat(e[1].replace(",",".")))?n%24*a:NaN;if(e=u.HHMM.exec(t))return y(n=parseInt(e[1],10),r=parseFloat(e[2].replace(",",".")))?n%24*a+6e4*r:NaN;if(e=u.HHMMSS.exec(t)){n=parseInt(e[1],10),r=parseInt(e[2],10);var i=parseFloat(e[3].replace(",","."));return y(n,r,i)?n%24*a+6e4*r+1e3*i:NaN}return null}function h(t,e,n){e=e||0,n=n||0;var r=new Date(0);r.setUTCFullYear(t,0,4);var i=7*e+n+1-(r.getUTCDay()||7);return r.setUTCDate(r.getUTCDate()+i),r}var p=[31,28,31,30,31,30,31,31,30,31,30,31],g=[31,29,31,30,31,30,31,31,30,31,30,31];function m(t){return t%400===0||t%4===0&&t%100!==0}function b(t,e,n){if(e<0||e>11)return!1;if(null!=n){if(n<1)return!1;var r=m(t);if(r&&n>g[e])return!1;if(!r&&n>p[e])return!1}return!0}function v(t,e,n){return!(e<0||e>52)&&(null==n||!(n<0||n>6))}function y(t,e,n){return(null==t||!(t<0||t>=25))&&((null==e||!(e<0||e>=60))&&(null==n||!(n<0||n>=60)))}},function(t,e,n){"use strict";var r=n(16),i=Object(r.a)((function(t,e){return e>t?e:t}));e.a=i},function(t,e,n){"use strict";var r=n(16),i=n(97),o=n(536),a=Object(r.a)((function(t,e){return Object(i.a)(Object(o.a)(t),e)}));e.a=a},function(t,e,n){"use strict";var r=n(1),i=r.createContext();e.a=i},function(t,e,n){(function(r){var i,o,a;!function(r){"use strict";"object"===typeof t.exports?t.exports=r(n(434),n(260),n(435),n(436),n(129),n(130),n(198)):null!=n(148)?(o=[n(434),n(260),n(435),n(436),n(129),n(130),n(198)],void 0===(a="function"===typeof(i=r)?i.apply(e,o):i)||(t.exports=a)):self.sanctuary=r(self.sanctuaryDef,self.sanctuaryEither,self.sanctuaryMaybe,self.sanctuaryPair,self.sanctuaryShow,self.sanctuaryTypeClasses,self.sanctuaryTypeIdentifiers)}((function(t,e,i,o,a,u,s){"use strict";if("undefined"!==typeof __doctest){__doctest.require("sanctuary-descending"),__doctest.require("./test/internal/List").Nil,__doctest.require("./test/internal/List").Cons;var c=__doctest.require("./test/internal/Sum");(function(e){var n=e.create({checkTypes:!0,env:e.env.concat([__doctest.require("./test/internal/List").Type(t.Unknown),c.Type])});n.env=e.env})(n(318))}var f=e.Left,l=e.Right,d=i.Nothing,h=i.Just;function p(t){return function(e){return function(n){return t(e(n))}}}function g(t){return function(e){return function(n){return t(n)(e)}}}function m(t){return p((function(e){return t in e?h(e[t]):d}))(y)}function b(t){return function(e){return e[t]()}}function v(t){return function(e){return function(n){return n[t](e)}}}function y(t){return null==t?Object.create(null):Object(t)}var _=t.TypeVariable("a"),w=t.TypeVariable("b"),S=t.TypeVariable("c"),O=t.TypeVariable("d"),x=t.TypeVariable("e"),E=t.TypeVariable("g"),M=t.TypeVariable("r"),T=t.UnaryTypeVariable("f"),$=t.UnaryTypeVariable("m"),A=t.UnaryTypeVariable("t"),k=t.UnaryTypeVariable("w"),C=t.BinaryTypeVariable("p"),I=t.BinaryTypeVariable("s"),P=t.UnaryType("TypeRep")("https://github.com/fantasyland/fantasy-land#type-representatives")([])((function(e){return t.test([])(t.AnyFunction)(e)||null!=e&&t.test([])(t.String)(e["@@type"])}))(V([])),N=t.RecordType({checkTypes:t.Boolean,env:t.Array(t.Any)}),R={};function j(n){var r=t.create(n),o={env:n.env,is:r("is")({})([t.Type,t.Any,t.Boolean])(t.test(n.env)),Maybe:i,Nothing:d,Either:e};return Object.keys(R).forEach((function(t){o[t]=r(t)(R[t].consts)(R[t].types)(R[t].impl)})),o.unchecked=n.checkTypes?j({checkTypes:!1,env:n.env}):o,o}function D(t){return function(e){return u.equals(t,e)}}function L(t){return function(e){return u.gt(e,t)}}function F(t){return function(e){return u.filter(t,e)}}function B(t){return function(e){return u.reject(t,e)}}function U(t){return function(e){return u.map(t,e)}}function z(t){return function(e){return function(n){return u.reduce((function(e,n){return t(e)(n)}),e,n)}}}function H(t){return t}function V(t){return function(e){return t}}function q(t){return function(e){return e(t)}}function W(t){return function(e){return function(n){return t(e,n)}}}function G(t){return function(e){return function(n){return function(r){return t(e,n,r)}}}}function K(t){return function(e){return function(n){return function(r){return function(i){return t(e,n,r,i)}}}}}function Y(t){return function(e){return t(e.fst)(e.snd)}}function Z(t){return t.isJust}function Q(t){return function(e){return function(n){return n.isJust?e(n.value):t}}}function X(t){return function(e){return function(n){return n.isJust?e(n.value):t()}}}function J(t){return U(ht("value"))(F(Z)(t))}function tt(t){return t.isLeft}function et(t){return t.isRight}function nt(t){return function(e){return function(n){return(n.isLeft?t:e)(n.value)}}}function rt(t){return function(e){try{return l(t(e))}catch(n){return f(n)}}}function it(t){return t.isLeft?d:h(t.value)}function ot(t){return!t}function at(t){return function(e){return function(n){return function(r){return(t(r)?e:n)(r)}}}}function ut(t,e){return function(n){return function(r){if(n<0)return d;if(Array.isArray(r))return n<=r.length?h(t(n,r)):d;var i=u.reduce((function(t,n){return u.map((function(t){var r=t.fst,i=t.snd;return o(r-1)(e(r,i,n))}),t)}),h(o(n)(u.empty(r.constructor))),r);return u.map(o.snd,u.reject(p(L(0))(o.fst),i))}}}R.create={consts:{},types:[N,t.Object],impl:j},R.type={consts:{},types:[t.Any,t.RecordType({namespace:t.Maybe(t.String),name:t.String,version:t.NonNegativeInteger})],impl:function(t){var e=s.parse(s(t));return e.namespace=u.reject(D(null),h(e.namespace)),e}},R.show={consts:{},types:[t.Any,t.String],impl:a},R.equals={consts:{a:[u.Setoid]},types:[_,_,t.Boolean],impl:D},R.lt={consts:{a:[u.Ord]},types:[_,_,t.Boolean],impl:function(t){return function(e){return u.lt(e,t)}}},R.lte={consts:{a:[u.Ord]},types:[_,_,t.Boolean],impl:function(t){return function(e){return u.lte(e,t)}}},R.gt={consts:{a:[u.Ord]},types:[_,_,t.Boolean],impl:L},R.gte={consts:{a:[u.Ord]},types:[_,_,t.Boolean],impl:function(t){return function(e){return u.gte(e,t)}}},R.min={consts:{a:[u.Ord]},types:[_,_,_],impl:W(u.min)},R.max={consts:{a:[u.Ord]},types:[_,_,_],impl:W(u.max)},R.clamp={consts:{a:[u.Ord]},types:[_,_,_,_],impl:G(u.clamp)},R.id={consts:{c:[u.Category]},types:[P(S),S],impl:u.id},R.concat={consts:{a:[u.Semigroup]},types:[_,_,_],impl:W(u.concat)},R.empty={consts:{a:[u.Monoid]},types:[P(_),_],impl:u.empty},R.invert={consts:{g:[u.Group]},types:[E,E],impl:u.invert},R.filter={consts:{f:[u.Filterable]},types:[t.Predicate(_),T(_),T(_)],impl:F},R.reject={consts:{f:[u.Filterable]},types:[t.Predicate(_),T(_),T(_)],impl:B},R.map={consts:{f:[u.Functor]},types:[t.Fn(_)(w),T(_),T(w)],impl:U},R.flip={consts:{f:[u.Functor]},types:[T(t.Fn(_)(w)),_,T(w)],impl:W(u.flip)},R.bimap={consts:{p:[u.Bifunctor]},types:[t.Fn(_)(w),t.Fn(S)(O),C(_)(S),C(w)(O)],impl:G(u.bimap)},R.mapLeft={consts:{p:[u.Bifunctor]},types:[t.Fn(_)(w),C(_)(S),C(w)(S)],impl:W(u.mapLeft)},R.promap={consts:{p:[u.Profunctor]},types:[t.Fn(_)(w),t.Fn(S)(O),C(w)(S),C(_)(O)],impl:G(u.promap)},R.alt={consts:{f:[u.Alt]},types:[T(_),T(_),T(_)],impl:function(t){return function(e){return u.alt(e,t)}}},R.zero={consts:{f:[u.Plus]},types:[P(T(_)),T(_)],impl:u.zero},R.reduce={consts:{f:[u.Foldable]},types:[t.Fn(_)(t.Fn(w)(_)),_,T(w),_],impl:z},R.traverse={consts:{f:[u.Applicative],t:[u.Traversable]},types:[P(T(w)),t.Fn(_)(T(w)),A(_),T(A(w))],impl:G(u.traverse)},R.sequence={consts:{f:[u.Applicative],t:[u.Traversable]},types:[P(T(_)),A(T(_)),T(A(_))],impl:W(u.sequence)},R.ap={consts:{f:[u.Apply]},types:[T(t.Fn(_)(w)),T(_),T(w)],impl:W(u.ap)},R.lift2={consts:{f:[u.Apply]},types:[t.Fn(_)(t.Fn(w)(S)),T(_),T(w),T(S)],impl:G(u.lift2)},R.lift3={consts:{f:[u.Apply]},types:[t.Fn(_)(t.Fn(w)(t.Fn(S)(O))),T(_),T(w),T(S),T(O)],impl:K(u.lift3)},R.apFirst={consts:{f:[u.Apply]},types:[T(_),T(w),T(_)],impl:W(u.apFirst)},R.apSecond={consts:{f:[u.Apply]},types:[T(_),T(w),T(w)],impl:W(u.apSecond)},R.of={consts:{f:[u.Applicative]},types:[P(T(_)),_,T(_)],impl:function(t){return function(e){return u.of(t,e)}}},R.chain={consts:{m:[u.Chain]},types:[t.Fn(_)($(w)),$(_),$(w)],impl:W(u.chain)},R.join={consts:{m:[u.Chain]},types:[$($(_)),$(_)],impl:u.join},R.chainRec={consts:{m:[u.ChainRec]},types:[P($(w)),t.Fn(_)($(t.Either(_)(w))),_,$(w)],impl:function(t){return function(e){return function(e){return u.chainRec(t,n,e)};function n(t,n,r){return u.map(nt(t)(n),e(r))}}}},R.extend={consts:{w:[u.Extend]},types:[t.Fn(k(_))(w),k(_),k(w)],impl:W(u.extend)},R.duplicate={consts:{w:[u.Extend]},types:[k(_),k(k(_))],impl:u.duplicate},R.extract={consts:{w:[u.Comonad]},types:[k(_),_],impl:u.extract},R.contramap={consts:{f:[u.Contravariant]},types:[t.Fn(w)(_),T(_),T(w)],impl:W(u.contramap)},R.I={consts:{},types:[_,_],impl:H},R.K={consts:{},types:[_,w,_],impl:V},R.T={consts:{},types:[_,t.Fn(_)(w),w],impl:q},R.curry2={consts:{},types:[t.Function([_,w,S]),_,w,S],impl:W},R.curry3={consts:{},types:[t.Function([_,w,S,O]),_,w,S,O],impl:G},R.curry4={consts:{},types:[t.Function([_,w,S,O,x]),_,w,S,O,x],impl:K},R.curry5={consts:{},types:[t.Function([_,w,S,O,x,M]),_,w,S,O,x,M],impl:function(t){return function(e){return function(n){return function(r){return function(i){return function(o){return t(e,n,r,i,o)}}}}}}},R.compose={consts:{s:[u.Semigroupoid]},types:[I(w)(S),I(_)(w),I(_)(S)],impl:W(u.compose)},R.pipe={consts:{f:[u.Foldable]},types:[T(t.Fn(t.Any)(t.Any)),_,w],impl:function(t){return function(e){return z(q)(e)(t)}}},R.pipeK={consts:{f:[u.Foldable],m:[u.Chain]},types:[T(t.Fn(t.Any)($(t.Any))),$(_),$(w)],impl:function(t){return function(e){return u.reduce((function(t,e){return u.chain(e,t)}),e,t)}}},R.on={consts:{},types:[t.Fn(w)(t.Fn(w)(S)),t.Fn(_)(w),_,_,S],impl:function(t){return function(e){return function(n){return function(r){return t(e(n))(e(r))}}}}},R.Pair={consts:{},types:[_,w,t.Pair(_)(w)],impl:o},R.pair={consts:{},types:[t.Fn(_)(t.Fn(w)(S)),t.Pair(_)(w),S],impl:Y},R.fst={consts:{},types:[t.Pair(_)(w),_],impl:Y(V)},R.snd={consts:{},types:[t.Pair(_)(w),w],impl:Y(g(V))},R.swap={consts:{},types:[t.Pair(_)(w),t.Pair(w)(_)],impl:Y(g(o))},R.Just={consts:{},types:[_,t.Maybe(_)],impl:h},R.isNothing={consts:{},types:[t.Maybe(_),t.Boolean],impl:function(t){return t.isNothing}},R.isJust={consts:{},types:[t.Maybe(_),t.Boolean],impl:Z},R.fromMaybe={consts:{},types:[_,t.Maybe(_),_],impl:g(Q)(H)},R.fromMaybe_={consts:{},types:[t.Thunk(_),t.Maybe(_),_],impl:g(X)(H)},R.maybeToNullable={consts:{},types:[t.Maybe(_),t.Nullable(_)],impl:function(t){return t.isJust?t.value:null}},R.maybe={consts:{},types:[w,t.Fn(_)(w),t.Maybe(_),w],impl:Q},R.maybe_={consts:{},types:[t.Thunk(w),t.Fn(_)(w),t.Maybe(_),w],impl:X},R.justs={consts:{f:[u.Filterable,u.Functor]},types:[T(t.Maybe(_)),T(_)],impl:J},R.mapMaybe={consts:{f:[u.Filterable,u.Functor]},types:[t.Fn(_)(t.Maybe(w)),T(_),T(w)],impl:p(p(J))(U)},R.maybeToEither={consts:{},types:[_,t.Maybe(w),t.Either(_)(w)],impl:function(t){return Q(f(t))(l)}},R.Left={consts:{},types:[_,t.Either(_)(w)],impl:f},R.Right={consts:{},types:[w,t.Either(_)(w)],impl:l},R.isLeft={consts:{},types:[t.Either(_)(w),t.Boolean],impl:tt},R.isRight={consts:{},types:[t.Either(_)(w),t.Boolean],impl:et},R.fromEither={consts:{},types:[w,t.Either(_)(w),w],impl:function(t){return nt(V(t))(H)}},R.either={consts:{},types:[t.Fn(_)(S),t.Fn(w)(S),t.Either(_)(w),S],impl:nt},R.lefts={consts:{f:[u.Filterable,u.Functor]},types:[T(t.Either(_)(w)),T(_)],impl:p(U(ht("value")))(F(tt))},R.rights={consts:{f:[u.Filterable,u.Functor]},types:[T(t.Either(_)(w)),T(w)],impl:p(U(ht("value")))(F(et))},R.tagBy={consts:{},types:[t.Predicate(_),_,t.Either(_)(_)],impl:function(t){return at(t)(l)(f)}},R.encase={consts:{},types:[t.Fn(_)(w),_,t.Either(t.Error)(w)],impl:rt},R.eitherToMaybe={consts:{},types:[t.Either(_)(w),t.Maybe(w)],impl:it},R.and={consts:{},types:[t.Boolean,t.Boolean,t.Boolean],impl:function(t){return function(e){return t&&e}}},R.or={consts:{},types:[t.Boolean,t.Boolean,t.Boolean],impl:function(t){return function(e){return t||e}}},R.not={consts:{},types:[t.Boolean,t.Boolean],impl:ot},R.complement={consts:{},types:[t.Predicate(_),_,t.Boolean],impl:p(ot)},R.boolean={consts:{},types:[_,_,t.Boolean,_],impl:function(t){return function(e){return function(n){return n?e:t}}}},R.ifElse={consts:{},types:[t.Predicate(_),t.Fn(_)(w),t.Fn(_)(w),_,w],impl:at},R.when={consts:{},types:[t.Predicate(_),t.Fn(_)(_),_,_],impl:function(t){return g(at(t))(H)}},R.unless={consts:{},types:[t.Predicate(_),t.Fn(_)(_),_,_],impl:function(t){return at(t)(H)}},R.array={consts:{},types:[w,t.Fn(_)(t.Fn(t.Array(_))(w)),t.Array(_),w],impl:function(t){return function(e){return function(n){return 0===n.length?t:e(n[0])(n.slice(1))}}}},R.head={consts:{f:[u.Foldable]},types:[T(_),t.Maybe(_)],impl:function(t){return Array.isArray(t)?t.length>0?h(t[0]):d:u.reduce((function(t,e){return t.isJust?t:h(e)}),d,t)}},R.last={consts:{f:[u.Foldable]},types:[T(_),t.Maybe(_)],impl:function(t){return Array.isArray(t)?t.length>0?h(t[t.length-1]):d:u.reduce((function(t,e){return h(e)}),d,t)}},R.tail={consts:{f:[u.Applicative,u.Foldable,u.Monoid]},types:[T(_),t.Maybe(T(_))],impl:function(t){if(Array.isArray(t))return t.length>0?h(t.slice(1)):d;var e=u.empty(t.constructor);return u.reduce((function(t,n){return h(Q(e)(ft(n))(t))}),d,t)}},R.init={consts:{f:[u.Applicative,u.Foldable,u.Monoid]},types:[T(_),t.Maybe(T(_))],impl:function(t){if(Array.isArray(t))return t.length>0?h(t.slice(0,-1)):d;var e=u.empty(t.constructor);return u.map(o.snd,u.reduce((function(t,n){return h(o(n)(Q(e)(Y(ft))(t)))}),d,t))}};var st=ut((function(t,e){return e.slice(0,t)}),(function(t,e,n){return t>0?u.append(n,e):e}));R.take={consts:{f:[u.Applicative,u.Foldable,u.Monoid]},types:[t.Integer,T(_),t.Maybe(T(_))],impl:st};var ct=ut((function(t,e){return e.slice(t)}),(function(t,e,n){return t>0?e:u.append(n,e)}));function ft(t){return function(e){return u.append(t,e)}}function lt(t){return function(e){for(var n=[],r=t(e);r.isJust;r=t(r.value.snd))n.push(r.value.fst);return n}}function dt(t){return function(e){return function(n){for(var r=[],i=Math.min(e.length,n.length),o=0;o0?h(e.total/e.count):d}},R.even={consts:{},types:[t.Integer,t.Boolean],impl:function(t){return t%2===0}},R.odd={consts:{},types:[t.Integer,t.Boolean],impl:function(t){return t%2!==0}},R.parseDate={consts:{},types:[t.String,t.Maybe(t.ValidDate)],impl:function(t){var e=new Date(t);return isNaN(e.valueOf())?d:h(e)}};var vt,yt=new RegExp("^\\s*[+-]?"+bt(["Infinity","NaN",bt(["[0-9]+","[0-9]+[.][0-9]+","[0-9]+[.]","[.][0-9]+"])+(vt=["[Ee][+-]?[0-9]+"],bt(vt)+"?")])+"\\s*$");R.parseFloat={consts:{},types:[t.String,t.Maybe(t.Number)],impl:function(t){return yt.test(t)?h(parseFloat(t)):d}};var _t=t.NullaryType("Radix")("")([t.Integer])((function(t){return t>=2&&t<=36}));R.parseInt={consts:{},types:[_t,t.String,t.Maybe(t.Integer)],impl:function(e){return function(n){var r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".slice(0,e),i=new RegExp("^["+r+"]+$","i"),o=n.replace(/^[+-]/,"");if(i.test(16===e?o.replace(/^0x/i,""):o)){var a=parseInt(n,e);if(t.test([])(t.Integer)(a))return h(a)}return d}}},R.parseJson={consts:{},types:[t.Predicate(t.Any),t.String,t.Maybe(_)],impl:function(t){return p(F(t))(p(it)(rt(JSON.parse)))}};var wt=t.RecordType({match:t.String,groups:t.Array(t.Maybe(t.String))});function St(t){return{match:t[0],groups:u.map(p(B(D(void 0)))(h),t.slice(1))}}function Ot(t,e){var n=t.lastIndex,r=e();return t.lastIndex=n,r}return R.regex={consts:{},types:[t.RegexFlags,t.String,t.RegExp],impl:function(t){return function(e){return new RegExp(e,t)}}},R.regexEscape={consts:{},types:[t.String,t.String],impl:function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}},R.test={consts:{},types:[t.RegExp,t.String,t.Boolean],impl:function(t){return function(e){return Ot(t,(function(){return t.test(e)}))}}},R.match={consts:{},types:[t.NonGlobalRegExp,t.String,t.Maybe(wt)],impl:function(t){return function(e){return u.map(St,u.reject(D(null),h(e.match(t))))}}},R.matchAll={consts:{},types:[t.GlobalRegExp,t.String,t.Array(wt)],impl:function(t){return function(e){return Ot(t,(function(){return lt((function(n){return u.map((function(t){return o(St(t))(null)}),u.reject(D(null),h(t.exec(e))))}))([])}))}}},R.toUpper={consts:{},types:[t.String,t.String],impl:b("toUpperCase")},R.toLower={consts:{},types:[t.String,t.String],impl:b("toLowerCase")},R.trim={consts:{},types:[t.String,t.String],impl:b("trim")},R.stripPrefix={consts:{},types:[t.String,t.String,t.Maybe(t.String)],impl:function(t){return function(e){var n=t.length;return e.slice(0,n)===t?h(e.slice(n)):d}}},R.stripSuffix={consts:{},types:[t.String,t.String,t.Maybe(t.String)],impl:function(t){return function(e){var n=e.length-t.length;return e.slice(n)===t?h(e.slice(0,n)):d}}},R.words={consts:{},types:[t.String,t.Array(t.String)],impl:function(t){var e=t.split(/\s+/),n=e.length;return e.slice(""===e[0]?1:0,""===e[n-1]?n-1:n)}},R.unwords={consts:{},types:[t.Array(t.String),t.String],impl:v("join")(" ")},R.lines={consts:{},types:[t.String,t.Array(t.String)],impl:function(t){return""===t?[]:t.replace(/\r\n?/g,"\n").match(/^(?=[\s\S]).*/gm)}},R.unlines={consts:{},types:[t.Array(t.String),t.String],impl:function(t){return t.reduce((function(t,e){return t+e+"\n"}),"")}},R.splitOn={consts:{},types:[t.String,t.String,t.Array(t.String)],impl:v("split")},R.splitOnRegex={consts:{},types:[t.GlobalRegExp,t.String,t.Array(t.String)],impl:function(t){return function(e){return Ot(t,(function(){for(var n,r=[],i=0;null!=(n=t.exec(e));)if(t.lastIndex===i&&""===n[0]){if(t.lastIndex===e.length)return r;t.lastIndex+=1}else r.push(e.slice(i,n.index)),i=n.index+n[0].length;return r.push(e.slice(i)),r}))}}},j({checkTypes:"undefined"===typeof r||null==r||null==Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_TYPE_CHECK_SANCTUARY:"false",REACT_APP_BUILD_TARGET:"LAMASSU"})||!1,env:t.env})}))}).call(this,n(69))},function(t,e,n){"use strict";var r=n(16),i=n(125),o=Object(r.a)((function(t,e){var n=t<0?e.length+t:t;return Object(i.a)(e)?e.charAt(n):e[n]}));e.a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(211);function i(t){return function e(n){for(var i,o,a,u=[],s=0,c=n.length;s=e.status}function o(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(r){var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof n&&n.global===n?n:void 0,u=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype?function(t,e,n){var u=a.URL||a.webkitURL,s=document.createElement("a");e=e||t.name||"download",s.download=e,s.rel="noopener","string"==typeof t?(s.href=t,s.origin===location.origin?o(s):i(s.href)?r(t,e,n):o(s,s.target="_blank")):(s.href=u.createObjectURL(t),setTimeout((function(){u.revokeObjectURL(s.href)}),4e4),setTimeout((function(){o(s)}),0))}:"msSaveOrOpenBlob"in navigator?function(t,n,a){if(n=n||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(e(t,a),n);else if(i(t))r(t,n,a);else{var u=document.createElement("a");u.href=t,u.target="_blank",setTimeout((function(){o(u)}))}}:function(t,e,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof t)return r(t,e,n);var o="application/octet-stream"===t.type,u=/constructor/i.test(a.HTMLElement)||a.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||o&&u)&&"object"==typeof FileReader){var c=new FileReader;c.onloadend=function(){var t=c.result;t=s?t:t.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=t:location=t,i=null},c.readAsDataURL(t)}else{var f=a.URL||a.webkitURL,l=f.createObjectURL(t);i?i.location=l:location.href=l,i=null,setTimeout((function(){f.revokeObjectURL(l)}),4e4)}});a.saveAs=u.saveAs=u,t.exports=u})?r.apply(e,i):r)||(t.exports=o)}).call(this,n(59))},function(t,e,n){"use strict";(function(t){function r(e,n){var r,i="undefined"!==typeof(r="undefined"!==typeof n?n:"undefined"!==typeof window?window:"undefined"!==typeof self?self:t).document&&r.document.attachEvent;if(!i){var o=function(){var t=r.requestAnimationFrame||r.mozRequestAnimationFrame||r.webkitRequestAnimationFrame||function(t){return r.setTimeout(t,20)};return function(e){return t(e)}}(),a=function(){var t=r.cancelAnimationFrame||r.mozCancelAnimationFrame||r.webkitCancelAnimationFrame||r.clearTimeout;return function(e){return t(e)}}(),u=function(t){var e=t.__resizeTriggers__,n=e.firstElementChild,r=e.lastElementChild,i=n.firstElementChild;r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight,i.style.width=n.offsetWidth+1+"px",i.style.height=n.offsetHeight+1+"px",n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight},s=function(t){if(!(t.target.className&&"function"===typeof t.target.className.indexOf&&t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0)){var e=this;u(this),this.__resizeRAF__&&a(this.__resizeRAF__),this.__resizeRAF__=o((function(){(function(t){return t.offsetWidth!=t.__resizeLast__.width||t.offsetHeight!=t.__resizeLast__.height})(e)&&(e.__resizeLast__.width=e.offsetWidth,e.__resizeLast__.height=e.offsetHeight,e.__resizeListeners__.forEach((function(n){n.call(e,t)})))}))}},c=!1,f="",l="animationstart",d="Webkit Moz O ms".split(" "),h="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),p=r.document.createElement("fakeelement");if(void 0!==p.style.animationName&&(c=!0),!1===c)for(var g=0;g div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',r=t.head||t.getElementsByTagName("head")[0],i=t.createElement("style");i.id="detectElementResize",i.type="text/css",null!=e&&i.setAttribute("nonce",e),i.styleSheet?i.styleSheet.cssText=n:i.appendChild(t.createTextNode(n)),r.appendChild(i)}}(o),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=o.createElement("div")).className="resize-triggers";var c='
';if(window.trustedTypes){var f=trustedTypes.createPolicy("react-virtualized-auto-sizer",{createHTML:function(){return c}});t.__resizeTriggers__.innerHTML=f.createHTML("")}else t.__resizeTriggers__.innerHTML=c;t.appendChild(t.__resizeTriggers__),u(t),t.addEventListener("scroll",s,!0),l&&(t.__resizeTriggers__.__animationListener__=function(e){e.animationName==m&&u(t)},t.__resizeTriggers__.addEventListener(l,t.__resizeTriggers__.__animationListener__))}t.__resizeListeners__.push(n)}},removeResizeListener:function(t,e){if(i)t.detachEvent("onresize",e);else if(t.__resizeListeners__.splice(t.__resizeListeners__.indexOf(e),1),!t.__resizeListeners__.length){t.removeEventListener("scroll",s,!0),t.__resizeTriggers__.__animationListener__&&(t.__resizeTriggers__.removeEventListener(l,t.__resizeTriggers__.__animationListener__),t.__resizeTriggers__.__animationListener__=null);try{t.__resizeTriggers__=!t.removeChild(t.__resizeTriggers__)}catch(n){}}}}}n.d(e,"a",(function(){return r}))}).call(this,n(59))},function(t,e,n){"use strict";var r=n(32),i=n(85),o=Object(r.a)((function(t){return Object(i.a)(t.length,(function(e,n){var r=Array.prototype.slice.call(arguments,0);return r[0]=n,r[1]=e,t.apply(this,r)}))}));e.a=o},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(25),i=n(22);function o(t){Object(i.a)(1,arguments);var e=Object(r.a)(t),n=e.getFullYear(),o=e.getMonth(),a=new Date(0);return a.setFullYear(n,o+1,0),a.setHours(0,0,0,0),a.getDate()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return N}));var r=n(194),i=n(170),o=n(334),a=n(25);function u(t,e){for(var n=t<0?"-":"",r=Math.abs(t).toString();r.length0?n:1-n;return u("yy"===e?r%100:r,e.length)},M:function(t,e){var n=t.getUTCMonth();return"M"===e?String(n+1):u(n+1,2)},d:function(t,e){return u(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return"am"===n?"a.m.":"p.m."}},h:function(t,e){return u(t.getUTCHours()%12||12,e.length)},H:function(t,e){return u(t.getUTCHours(),e.length)},m:function(t,e){return u(t.getUTCMinutes(),e.length)},s:function(t,e){return u(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,r=t.getUTCMilliseconds();return u(Math.floor(r*Math.pow(10,n-3)),e.length)}},c=n(22),f=864e5;var l=n(336),d=n(311),h=n(335),p=n(221),g="midnight",m="noon",b="morning",v="afternoon",y="evening",_="night";function w(t,e){var n=t>0?"-":"+",r=Math.abs(t),i=Math.floor(r/60),o=r%60;if(0===o)return n+String(i);var a=e||"";return n+String(i)+a+u(o,2)}function S(t,e){return t%60===0?(t>0?"-":"+")+u(Math.abs(t)/60,2):O(t,e)}function O(t,e){var n=e||"",r=t>0?"-":"+",i=Math.abs(t);return r+u(Math.floor(i/60),2)+n+u(i%60,2)}var x={G:function(t,e,n){var r=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){var r=t.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return s.y(t,e)},Y:function(t,e,n,r){var i=Object(p.a)(t,r),o=i>0?i:1-i;return"YY"===e?u(o%100,2):"Yo"===e?n.ordinalNumber(o,{unit:"year"}):u(o,e.length)},R:function(t,e){return u(Object(d.a)(t),e.length)},u:function(t,e){return u(t.getUTCFullYear(),e.length)},Q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return u(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){var r=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return u(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){var r=t.getUTCMonth();switch(e){case"M":case"MM":return s.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){var r=t.getUTCMonth();switch(e){case"L":return String(r+1);case"LL":return u(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){var i=Object(h.a)(t,r);return"wo"===e?n.ordinalNumber(i,{unit:"week"}):u(i,e.length)},I:function(t,e,n){var r=Object(l.a)(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):u(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):s.d(t,e)},D:function(t,e,n){var r=function(t){Object(c.a)(1,arguments);var e=Object(a.a)(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var r=e.getTime(),i=n-r;return Math.floor(i/f)+1}(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):u(r,e.length)},E:function(t,e,n){var r=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return u(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){var i=t.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return u(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(t,e,n){var r=t.getUTCDay(),i=0===r?7:r;switch(e){case"i":return String(i);case"ii":return u(i,e.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){var r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){var r,i=t.getUTCHours();switch(r=12===i?m:0===i?g:i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,n){var r,i=t.getUTCHours();switch(r=i>=17?y:i>=12?v:i>=4?b:_,e){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){var r=t.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return s.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):s.H(t,e)},K:function(t,e,n){var r=t.getUTCHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):u(r,e.length)},k:function(t,e,n){var r=t.getUTCHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):u(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):s.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):s.s(t,e)},S:function(t,e){return s.S(t,e)},X:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();if(0===i)return"Z";switch(e){case"X":return S(i);case"XXXX":case"XX":return O(i);case"XXXXX":case"XXX":default:return O(i,":")}},x:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"x":return S(i);case"xxxx":case"xx":return O(i);case"xxxxx":case"xxx":default:return O(i,":")}},O:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+w(i,":");case"OOOO":default:return"GMT"+O(i,":")}},z:function(t,e,n,r){var i=(r._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+w(i,":");case"zzzz":default:return"GMT"+O(i,":")}},t:function(t,e,n,r){var i=r._originalDate||t;return u(Math.floor(i.getTime()/1e3),e.length)},T:function(t,e,n,r){return u((r._originalDate||t).getTime(),e.length)}},E=n(310),M=n(109),T=n(143),$=n(30),A=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,k=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,C=/^'([^]*?)'?$/,I=/''/g,P=/[a-zA-Z]/;function N(t,e,n){Object(c.a)(2,arguments);var u=String(e),s=n||{},f=s.locale||i.a,l=f.options&&f.options.firstWeekContainsDate,d=null==l?1:Object($.a)(l),h=null==s.firstWeekContainsDate?d:Object($.a)(s.firstWeekContainsDate);if(!(h>=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var p=f.options&&f.options.weekStartsOn,g=null==p?0:Object($.a)(p),m=null==s.weekStartsOn?g:Object($.a)(s.weekStartsOn);if(!(m>=0&&m<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!f.localize)throw new RangeError("locale must contain localize property");if(!f.formatLong)throw new RangeError("locale must contain formatLong property");var b=Object(a.a)(t);if(!Object(r.a)(b))throw new RangeError("Invalid time value");var v=Object(M.a)(b),y=Object(o.a)(b,v),_={firstWeekContainsDate:h,weekStartsOn:m,locale:f,_originalDate:b},w=u.match(k).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,E.a[e])(t,f.formatLong,_):t})).join("").match(A).map((function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return R(n);var i=x[r];if(i)return!s.useAdditionalWeekYearTokens&&Object(T.b)(n)&&Object(T.c)(n,e,t),!s.useAdditionalDayOfYearTokens&&Object(T.a)(n)&&Object(T.c)(n,e,t),i(y,n,f.localize,_);if(r.match(P))throw new RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n})).join("");return w}function R(t){return t.match(C)[1].replace(I,"'")}},function(t,e,n){"use strict";var r=n(32),i=n(16),o=n(75),a=n(137),u=n(97),s=Object(i.a)((function(t,e){return"function"===typeof e["fantasy-land/ap"]?e["fantasy-land/ap"](t):"function"===typeof t.ap?t.ap(e):"function"===typeof t?function(n){return t(n)(e(n))}:Object(o.a)((function(t,n){return Object(a.a)(t,Object(u.a)(n,e))}),[],t)})),c=n(85),f=Object(i.a)((function(t,e){var n=Object(c.a)(t,e);return Object(c.a)(t,(function(){return Object(o.a)(s,Object(u.a)(n,arguments[0]),Array.prototype.slice.call(arguments,1))}))})),l=Object(r.a)((function(t){return f(t.length,t)}));e.a=l},function(t,e,n){"use strict";var r=n(212),i=n(71),o=n(61),a=n(75),u=n(64),s=function(){function t(t,e,n,r){this.valueFn=t,this.valueAcc=e,this.keyFn=n,this.xf=r,this.inputs={}}return t.prototype["@@transducer/init"]=u.a.init,t.prototype["@@transducer/result"]=function(t){var e;for(e in this.inputs)if(Object(o.a)(e,this.inputs)&&(t=this.xf["@@transducer/step"](t,this.inputs[e]))["@@transducer/reduced"]){t=t["@@transducer/value"];break}return this.inputs=null,this.xf["@@transducer/result"](t)},t.prototype["@@transducer/step"]=function(t,e){var n=this.keyFn(e);return this.inputs[n]=this.inputs[n]||[n,this.valueAcc],this.inputs[n][1]=this.valueFn(this.inputs[n][1],e),t},t}(),c=Object(r.a)(4,[],(function(t,e,n,r){return new s(t,e,n,r)})),f=Object(r.a)(4,[],Object(i.a)([],c,(function(t,e,n,r){return Object(a.a)((function(r,i){var a=n(i);return r[a]=t(Object(o.a)(a,r)?r[a]:e,i),r}),{},r)})));e.a=f},function(t,e,n){"use strict";var r=n(16),i=n(71),o=n(290),a=n(188),u=n(75),s=n(64),c=function(){function t(t,e){this.xf=e,this.f=t}return t.prototype["@@transducer/init"]=s.a.init,t.prototype["@@transducer/result"]=s.a.result,t.prototype["@@transducer/step"]=function(t,e){return this.f(e)?this.xf["@@transducer/step"](t,e):t},t}(),f=Object(r.a)((function(t,e){return new c(t,e)})),l=n(98),d=Object(r.a)(Object(i.a)(["filter"],f,(function(t,e){return Object(a.a)(e)?Object(u.a)((function(n,r){return t(e[r])&&(n[r]=e[r]),n}),{},Object(l.a)(e)):Object(o.a)(t,e)})));e.a=d},function(t,e,n){"use strict";var r=n(301),i=n(299),o=n(16),a=Object(o.a)((function(t,e){for(var n,r,o=new i.a,a=[],u=0;u=0&&this.i>=this.n?Object(o.a)(n):n},t}(),s=Object(r.a)((function(t,e){return new u(t,e)})),c=n(104),f=Object(r.a)(Object(i.a)(["take"],s,(function(t,e){return Object(c.a)(0,t<0?1/0:t,e)})));e.a=f},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(25),i=n(22);function o(t,e){Object(i.a)(2,arguments);var n=Object(r.a)(t),o=Object(r.a)(e);return n.getFullYear()-o.getFullYear()}var a=n(108);function u(t,e){Object(i.a)(2,arguments);var n=Object(r.a)(t),u=Object(r.a)(e),s=Object(a.a)(n,u),c=Math.abs(o(n,u));n.setFullYear(1584),u.setFullYear(1584);var f=Object(a.a)(n,u)===-s,l=s*(c-Number(f));return 0===l?0:l}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(25),i=n(109),o=n(174),a=n(22),u=864e5;function s(t,e){Object(a.a)(2,arguments);var n=Object(o.a)(t),r=Object(o.a)(e),s=n.getTime()-Object(i.a)(n),c=r.getTime()-Object(i.a)(r);return Math.round((s-c)/u)}function c(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function f(t,e){Object(a.a)(2,arguments);var n=Object(r.a)(t),i=Object(r.a)(e),o=c(n,i),u=Math.abs(s(n,i));n.setDate(n.getDate()-o*u);var f=Number(c(n,i)===-o),l=o*(u-f);return 0===l?0:l}},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var r=n(30),i=n(25),o=n(22);function a(t,e){Object(o.a)(2,arguments);var n=Object(i.a)(t).getTime(),a=Object(r.a)(e);return new Date(n+a)}function u(t,e){Object(o.a)(2,arguments);var n=Object(r.a)(e);return a(t,-n)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var r=n(25),i=n(127),o=n(30),a=n(221),u=n(22);function s(t,e){Object(u.a)(1,arguments);var n=e||{},r=n.locale,s=r&&r.options&&r.options.firstWeekContainsDate,c=null==s?1:Object(o.a)(s),f=null==n.firstWeekContainsDate?c:Object(o.a)(n.firstWeekContainsDate),l=Object(a.a)(t,e),d=new Date(0);d.setUTCFullYear(l,0,f),d.setUTCHours(0,0,0,0);var h=Object(i.a)(d,e);return h}var c=6048e5;function f(t,e){Object(u.a)(1,arguments);var n=Object(r.a)(t),o=Object(i.a)(n,e).getTime()-s(n,e).getTime();return Math.round(o/c)+1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(25),i=n(142),o=n(311),a=n(22);function u(t){Object(a.a)(1,arguments);var e=Object(o.a)(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var r=Object(i.a)(n);return r}var s=6048e5;function c(t){Object(a.a)(1,arguments);var e=Object(r.a)(t),n=Object(i.a)(e).getTime()-u(e).getTime();return Math.round(n/s)+1}},function(t,e,n){"use strict";var r=n(4),i=n(17),o=n(1),a=n.n(o),u=(n(13),n(48)),s=n(15),c=n(44),f=n(121),l=n(24),d=!0,h=!1,p=null,g={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function m(t){t.metaKey||t.altKey||t.ctrlKey||(d=!0)}function b(){d=!1}function v(){"hidden"===this.visibilityState&&h&&(d=!0)}function y(t){var e=t.target;try{return e.matches(":focus-visible")}catch(n){}return d||function(t){var e=t.type,n=t.tagName;return!("INPUT"!==n||!g[e]||t.readOnly)||"TEXTAREA"===n&&!t.readOnly||!!t.isContentEditable}(e)}function _(){h=!0,window.clearTimeout(p),p=window.setTimeout((function(){h=!1}),100)}function w(){return{isFocusVisible:y,onBlurVisible:_,ref:o.useCallback((function(t){var e,n=u.findDOMNode(t);null!=n&&((e=n.ownerDocument).addEventListener("keydown",m,!0),e.addEventListener("mousedown",b,!0),e.addEventListener("pointerdown",b,!0),e.addEventListener("touchstart",b,!0),e.addEventListener("visibilitychange",v,!0))}),[])}}var S=n(107),O=n(65),x=n(172),E=n(68),M=n(226);function T(t,e){var n=Object.create(null);return t&&o.Children.map(t,(function(t){return t})).forEach((function(t){n[t.key]=function(t){return e&&Object(o.isValidElement)(t)?e(t):t}(t)})),n}function $(t,e,n){return null!=n[e]?n[e]:t.props[e]}function A(t,e,n){var r=T(t.children),i=function(t,e){function n(n){return n in e?e[n]:t[n]}t=t||{},e=e||{};var r,i=Object.create(null),o=[];for(var a in t)a in e?o.length&&(i[a]=o,o=[]):o.push(a);var u={};for(var s in e){if(i[s])for(r=0;r0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=e.pulsate,i=void 0!==r&&r,o=e.center,u=void 0===o?a||e.pulsate:o,s=e.fakeElement,c=void 0!==s&&s;if("mousedown"===t.type&&m.current)m.current=!1;else{"touchstart"===t.type&&(m.current=!0);var f,l,d,h=c?null:y.current,p=h?h.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(u||0===t.clientX&&0===t.clientY||!t.clientX&&!t.touches)f=Math.round(p.width/2),l=Math.round(p.height/2);else{var g=t.touches?t.touches[0]:t,w=g.clientX,S=g.clientY;f=Math.round(w-p.left),l=Math.round(S-p.top)}if(u)(d=Math.sqrt((2*Math.pow(p.width,2)+Math.pow(p.height,2))/3))%2===0&&(d+=1);else{var O=2*Math.max(Math.abs((h?h.clientWidth:0)-f),f)+2,x=2*Math.max(Math.abs((h?h.clientHeight:0)-l),l)+2;d=Math.sqrt(Math.pow(O,2)+Math.pow(x,2))}t.touches?null===v.current&&(v.current=function(){_({pulsate:i,rippleX:f,rippleY:l,rippleSize:d,cb:n})},b.current=setTimeout((function(){v.current&&(v.current(),v.current=null)}),80)):_({pulsate:i,rippleX:f,rippleY:l,rippleSize:d,cb:n})}}),[a,_]),O=o.useCallback((function(){w({},{pulsate:!0})}),[w]),x=o.useCallback((function(t,e){if(clearTimeout(b.current),"touchend"===t.type&&v.current)return t.persist(),v.current(),v.current=null,void(b.current=setTimeout((function(){x(t,e)})));v.current=null,h((function(t){return t.length>0?t.slice(1):t})),g.current=e}),[]);return o.useImperativeHandle(e,(function(){return{pulsate:O,start:w,stop:x}}),[O,w,x]),o.createElement("span",Object(r.a)({className:Object(s.a)(u.root,c),ref:y},f),o.createElement(I,{component:null,exit:!0},d))})),j=Object(l.a)((function(t){return{root:{overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"},ripple:{opacity:0,position:"absolute"},rippleVisible:{opacity:.3,transform:"scale(1)",animation:"$enter ".concat(550,"ms ").concat(t.transitions.easing.easeInOut)},ripplePulsate:{animationDuration:"".concat(t.transitions.duration.shorter,"ms")},child:{opacity:1,display:"block",width:"100%",height:"100%",borderRadius:"50%",backgroundColor:"currentColor"},childLeaving:{opacity:0,animation:"$exit ".concat(550,"ms ").concat(t.transitions.easing.easeInOut)},childPulsate:{position:"absolute",left:0,top:0,animation:"$pulsate 2500ms ".concat(t.transitions.easing.easeInOut," 200ms infinite")},"@keyframes enter":{"0%":{transform:"scale(0)",opacity:.1},"100%":{transform:"scale(1)",opacity:.3}},"@keyframes exit":{"0%":{opacity:1},"100%":{opacity:0}},"@keyframes pulsate":{"0%":{transform:"scale(1)"},"50%":{transform:"scale(0.92)"},"100%":{transform:"scale(1)"}}}}),{flip:!1,name:"MuiTouchRipple"})(o.memo(R)),D=o.forwardRef((function(t,e){var n=t.action,a=t.buttonRef,l=t.centerRipple,d=void 0!==l&&l,h=t.children,p=t.classes,g=t.className,m=t.component,b=void 0===m?"button":m,v=t.disabled,y=void 0!==v&&v,_=t.disableRipple,S=void 0!==_&&_,O=t.disableTouchRipple,x=void 0!==O&&O,E=t.focusRipple,M=void 0!==E&&E,T=t.focusVisibleClassName,$=t.onBlur,A=t.onClick,k=t.onFocus,C=t.onFocusVisible,I=t.onKeyDown,P=t.onKeyUp,N=t.onMouseDown,R=t.onMouseLeave,D=t.onMouseUp,L=t.onTouchEnd,F=t.onTouchMove,B=t.onTouchStart,U=t.onDragLeave,z=t.tabIndex,H=void 0===z?0:z,V=t.TouchRippleProps,q=t.type,W=void 0===q?"button":q,G=Object(i.a)(t,["action","buttonRef","centerRipple","children","classes","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","onBlur","onClick","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","onDragLeave","tabIndex","TouchRippleProps","type"]),K=o.useRef(null);var Y=o.useRef(null),Z=o.useState(!1),Q=Z[0],X=Z[1];y&&Q&&X(!1);var J=w(),tt=J.isFocusVisible,et=J.onBlurVisible,nt=J.ref;function rt(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x;return Object(f.a)((function(r){return e&&e(r),!n&&Y.current&&Y.current[t](r),!0}))}o.useImperativeHandle(n,(function(){return{focusVisible:function(){X(!0),K.current.focus()}}}),[]),o.useEffect((function(){Q&&M&&!S&&Y.current.pulsate()}),[S,M,Q]);var it=rt("start",N),ot=rt("stop",U),at=rt("stop",D),ut=rt("stop",(function(t){Q&&t.preventDefault(),R&&R(t)})),st=rt("start",B),ct=rt("stop",L),ft=rt("stop",F),lt=rt("stop",(function(t){Q&&(et(t),X(!1)),$&&$(t)}),!1),dt=Object(f.a)((function(t){K.current||(K.current=t.currentTarget),tt(t)&&(X(!0),C&&C(t)),k&&k(t)})),ht=function(){var t=u.findDOMNode(K.current);return b&&"button"!==b&&!("A"===t.tagName&&t.href)},pt=o.useRef(!1),gt=Object(f.a)((function(t){M&&!pt.current&&Q&&Y.current&&" "===t.key&&(pt.current=!0,t.persist(),Y.current.stop(t,(function(){Y.current.start(t)}))),t.target===t.currentTarget&&ht()&&" "===t.key&&t.preventDefault(),I&&I(t),t.target===t.currentTarget&&ht()&&"Enter"===t.key&&!y&&(t.preventDefault(),A&&A(t))})),mt=Object(f.a)((function(t){M&&" "===t.key&&Y.current&&Q&&!t.defaultPrevented&&(pt.current=!1,t.persist(),Y.current.stop(t,(function(){Y.current.pulsate(t)}))),P&&P(t),A&&t.target===t.currentTarget&&ht()&&" "===t.key&&!t.defaultPrevented&&A(t)})),bt=b;"button"===bt&&G.href&&(bt="a");var vt={};"button"===bt?(vt.type=W,vt.disabled=y):("a"===bt&&G.href||(vt.role="button"),vt["aria-disabled"]=y);var yt=Object(c.a)(a,e),_t=Object(c.a)(nt,K),wt=Object(c.a)(yt,_t),St=o.useState(!1),Ot=St[0],xt=St[1];o.useEffect((function(){xt(!0)}),[]);var Et=Ot&&!S&&!y;return o.createElement(bt,Object(r.a)({className:Object(s.a)(p.root,g,Q&&[p.focusVisible,T],y&&p.disabled),onBlur:lt,onClick:A,onFocus:dt,onKeyDown:gt,onKeyUp:mt,onMouseDown:it,onMouseLeave:ut,onMouseUp:at,onDragLeave:ot,onTouchEnd:ct,onTouchMove:ft,onTouchStart:st,ref:wt,tabIndex:y?-1:H},vt,G),h,Et?o.createElement(j,Object(r.a)({ref:Y,center:d},V)):null)}));e.a=Object(l.a)({root:{display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle","-moz-appearance":"none","-webkit-appearance":"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},"&$disabled":{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}},disabled:{},focusVisible:{}},{name:"MuiButtonBase"})(D)},,,,,,,function(t,e,n){"use strict";var r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;function a(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}t.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(i){return!1}}()?Object.assign:function(t,e){for(var n,u,s=a(t),c=1;c-1&&t%1==0&&t<=9007199254740991}},function(t,e,n){var r=n(654),i=n(660),o=n(664);t.exports=function(t){return o(t)?r(t):i(t)}},function(t,e,n){"use strict";var r=e;r.version=n(737).version,r.utils=n(114),r.rand=n(180),r.curve=n(440),r.curves=n(353),r.ec=n(750),r.eddsa=n(753)},function(t,e,n){"use strict";var r,i=e,o=n(181),a=n(440),u=n(114).assert;function s(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,u(this.g.validate(),"Invalid curve"),u(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var n=new s(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=s,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(749)}catch(f){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(t,e,n){"use strict";var r=n(181),i=n(261),o=n(95);function a(t){if(!(this instanceof a))return new a(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=i.toArray(t.entropy,t.entropyEnc||"hex"),n=i.toArray(t.nonce,t.nonceEnc||"hex"),r=i.toArray(t.pers,t.persEnc||"hex");o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,n,r)}t.exports=a,a.prototype._init=function(t,e,n){var r=t.concat(e).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},a.prototype.generate=function(t,e,n,r){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof e&&(r=n,n=e,e=null),n&&(n=i.toArray(n,r||"hex"),this._update(n));for(var o=[];o.length-1?r:o.nextTick;v.WritableState=b;var c=Object.create(n(237));c.inherits=n(38);var f={deprecate:n(448)},l=n(445),d=n(356).Buffer,h=i.Uint8Array||function(){};var p,g=n(446);function m(){}function b(t,e){u=u||n(182),t=t||{};var r=e instanceof u;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,c=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(c||0===c)?c:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===t.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,r=n.sync,i=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,r,i){--e.pendingcb,n?(o.nextTick(i,r),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",r)):(i(r),t._writableState.errorEmitted=!0,t.emit("error",r),x(t,e))}(t,n,r,e,i);else{var a=S(n);a||n.corked||n.bufferProcessing||!n.bufferedRequest||w(t,n),r?s(_,t,n,a,i):_(t,n,a,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function v(t){if(u=u||n(182),!p.call(v,this)&&!(this instanceof u))return new v(t);this._writableState=new b(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),l.call(this)}function y(t,e,n,r,i,o,a){e.writelen=r,e.writecb=a,e.writing=!0,e.sync=!0,n?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function _(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),x(t,e)}function w(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,i=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var u=0,s=!0;n;)i[u]=n,n.isBuf||(s=!1),n=n.next,u+=1;i.allBuffers=s,y(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,f=n.encoding,l=n.callback;if(y(t,e,!1,e.objectMode?1:c.length,c,f,l),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function S(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function O(t,e){t._final((function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),x(t,e)}))}function x(t,e){var n=S(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"===typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(O,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}c.inherits(v,l),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(b.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof b)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,n){var r,i=this._writableState,a=!1,u=!i.objectMode&&(r=t,d.isBuffer(r)||r instanceof h);return u&&!d.isBuffer(t)&&(t=function(t){return d.from(t)}(t)),"function"===typeof e&&(n=e,e=null),u?e="buffer":e||(e=i.defaultEncoding),"function"!==typeof n&&(n=m),i.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(u||function(t,e,n,r){var i=!0,a=!1;return null===n?a=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(r,a),i=!1),i}(this,i,t,n))&&(i.pendingcb++,a=function(t,e,n,r,i,o){if(!n){var a=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=d.from(e,n));return e}(e,r,i);r!==a&&(n=!0,i="buffer",r=a)}var u=e.objectMode?1:r.length;e.length+=u;var s=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,n){var r=this._writableState;"function"===typeof t?(n=t,t=null,e=null):"function"===typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(t,e,n){e.ending=!0,x(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,r,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=g.destroy,v.prototype._undestroy=g.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(69),n(447).setImmediate,n(59))},function(t,e,n){"use strict";var r=n(38),i=n(451),o=n(37).Buffer,a=new Array(16);function u(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function s(t,e){return t<>>32-e}function c(t,e,n,r,i,o,a){return s(t+(e&n|~e&r)+i+o|0,a)+e|0}function f(t,e,n,r,i,o,a){return s(t+(e&r|n&~r)+i+o|0,a)+e|0}function l(t,e,n,r,i,o,a){return s(t+(e^n^r)+i+o|0,a)+e|0}function d(t,e,n,r,i,o,a){return s(t+(n^(e|~r))+i+o|0,a)+e|0}r(u,i),u.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var n=this._a,r=this._b,i=this._c,o=this._d;n=c(n,r,i,o,t[0],3614090360,7),o=c(o,n,r,i,t[1],3905402710,12),i=c(i,o,n,r,t[2],606105819,17),r=c(r,i,o,n,t[3],3250441966,22),n=c(n,r,i,o,t[4],4118548399,7),o=c(o,n,r,i,t[5],1200080426,12),i=c(i,o,n,r,t[6],2821735955,17),r=c(r,i,o,n,t[7],4249261313,22),n=c(n,r,i,o,t[8],1770035416,7),o=c(o,n,r,i,t[9],2336552879,12),i=c(i,o,n,r,t[10],4294925233,17),r=c(r,i,o,n,t[11],2304563134,22),n=c(n,r,i,o,t[12],1804603682,7),o=c(o,n,r,i,t[13],4254626195,12),i=c(i,o,n,r,t[14],2792965006,17),n=f(n,r=c(r,i,o,n,t[15],1236535329,22),i,o,t[1],4129170786,5),o=f(o,n,r,i,t[6],3225465664,9),i=f(i,o,n,r,t[11],643717713,14),r=f(r,i,o,n,t[0],3921069994,20),n=f(n,r,i,o,t[5],3593408605,5),o=f(o,n,r,i,t[10],38016083,9),i=f(i,o,n,r,t[15],3634488961,14),r=f(r,i,o,n,t[4],3889429448,20),n=f(n,r,i,o,t[9],568446438,5),o=f(o,n,r,i,t[14],3275163606,9),i=f(i,o,n,r,t[3],4107603335,14),r=f(r,i,o,n,t[8],1163531501,20),n=f(n,r,i,o,t[13],2850285829,5),o=f(o,n,r,i,t[2],4243563512,9),i=f(i,o,n,r,t[7],1735328473,14),n=l(n,r=f(r,i,o,n,t[12],2368359562,20),i,o,t[5],4294588738,4),o=l(o,n,r,i,t[8],2272392833,11),i=l(i,o,n,r,t[11],1839030562,16),r=l(r,i,o,n,t[14],4259657740,23),n=l(n,r,i,o,t[1],2763975236,4),o=l(o,n,r,i,t[4],1272893353,11),i=l(i,o,n,r,t[7],4139469664,16),r=l(r,i,o,n,t[10],3200236656,23),n=l(n,r,i,o,t[13],681279174,4),o=l(o,n,r,i,t[0],3936430074,11),i=l(i,o,n,r,t[3],3572445317,16),r=l(r,i,o,n,t[6],76029189,23),n=l(n,r,i,o,t[9],3654602809,4),o=l(o,n,r,i,t[12],3873151461,11),i=l(i,o,n,r,t[15],530742520,16),n=d(n,r=l(r,i,o,n,t[2],3299628645,23),i,o,t[0],4096336452,6),o=d(o,n,r,i,t[7],1126891415,10),i=d(i,o,n,r,t[14],2878612391,15),r=d(r,i,o,n,t[5],4237533241,21),n=d(n,r,i,o,t[12],1700485571,6),o=d(o,n,r,i,t[3],2399980690,10),i=d(i,o,n,r,t[10],4293915773,15),r=d(r,i,o,n,t[1],2240044497,21),n=d(n,r,i,o,t[8],1873313359,6),o=d(o,n,r,i,t[15],4264355552,10),i=d(i,o,n,r,t[6],2734768916,15),r=d(r,i,o,n,t[13],1309151649,21),n=d(n,r,i,o,t[4],4149444226,6),o=d(o,n,r,i,t[11],3174756917,10),i=d(i,o,n,r,t[2],718787259,15),r=d(r,i,o,n,t[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+o|0},u.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=u},function(t,e,n){"use strict";var r=n(199).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,o){if("function"===typeof n)return t(e,null,n);n||(n={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i>>32-e}function g(t,e,n,r,i,o,a,u){return p(t+(e^n^r)+o+a|0,u)+i|0}function m(t,e,n,r,i,o,a,u){return p(t+(e&n|~e&r)+o+a|0,u)+i|0}function b(t,e,n,r,i,o,a,u){return p(t+((e|~n)^r)+o+a|0,u)+i|0}function v(t,e,n,r,i,o,a,u){return p(t+(e&r|n&~r)+o+a|0,u)+i|0}function y(t,e,n,r,i,o,a,u){return p(t+(e^(n|~r))+o+a|0,u)+i|0}i(h,o),h.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var n=0|this._a,r=0|this._b,i=0|this._c,o=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,S=0|this._c,O=0|this._d,x=0|this._e,E=0;E<80;E+=1){var M,T;E<16?(M=g(n,r,i,o,h,t[u[E]],l[0],c[E]),T=y(_,w,S,O,x,t[s[E]],d[0],f[E])):E<32?(M=m(n,r,i,o,h,t[u[E]],l[1],c[E]),T=v(_,w,S,O,x,t[s[E]],d[1],f[E])):E<48?(M=b(n,r,i,o,h,t[u[E]],l[2],c[E]),T=b(_,w,S,O,x,t[s[E]],d[2],f[E])):E<64?(M=v(n,r,i,o,h,t[u[E]],l[3],c[E]),T=m(_,w,S,O,x,t[s[E]],d[3],f[E])):(M=y(n,r,i,o,h,t[u[E]],l[4],c[E]),T=g(_,w,S,O,x,t[s[E]],d[4],f[E])),n=h,h=o,o=p(i,10),i=r,r=M,_=x,x=O,O=p(S,10),S=w,w=T}var $=this._b+i+O|0;this._b=this._c+o+x|0,this._c=this._d+h+_|0,this._d=this._e+n+w|0,this._e=this._a+r+S|0,this._a=$},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var t=r.alloc?r.alloc(20):new r(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=h},function(t,e,n){(e=t.exports=function(t){t=t.toLowerCase();var n=e[t];if(!n)throw new Error(t+" is not supported (we accept pull requests)");return new n}).sha=n(776),e.sha1=n(777),e.sha224=n(778),e.sha256=n(458),e.sha384=n(779),e.sha512=n(459)},function(t,e){var n={Array:function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){return null!==t&&void 0!==t&&t.constructor===Array})),Boolean:function(t){return"boolean"===typeof t},Function:function(t){return"function"===typeof t},Nil:function(t){return void 0===t||null===t},Number:function(t){return"number"===typeof t},Object:function(t){return"object"===typeof t},String:function(t){return"string"===typeof t},"":function(){return!0}};for(var r in n.Null=n.Nil,n)n[r].toJSON=function(t){return t}.bind(null,r);t.exports=n},function(t,e,n){var r=n(37).Buffer,i=n(157),o=n(60),a=n(786),u=n(67),s=n(77),c=n(132),f=n(462);function l(t){var e=t.length;return f.encodingLength(e)+e}function d(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}d.DEFAULT_SEQUENCE=4294967295,d.SIGHASH_ALL=1,d.SIGHASH_NONE=2,d.SIGHASH_SINGLE=3,d.SIGHASH_ANYONECANPAY=128,d.ADVANCED_TRANSACTION_MARKER=0,d.ADVANCED_TRANSACTION_FLAG=1;var h=r.allocUnsafe(0),p=[],g=r.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),m=r.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),b=r.from("ffffffffffffffff","hex"),v={script:h,valueBuffer:b};d.fromBuffer=function(t,e){var n=0;function r(e){return n+=e,t.slice(n-e,n)}function i(){var e=t.readUInt32LE(n);return n+=4,e}function o(){var e=a.readUInt64LE(t,n);return n+=8,e}function u(){var e=f.decode(t,n);return n+=f.decode.bytes,e}function s(){return r(u())}function c(){for(var t=u(),e=[],n=0;n=this.ins.length)return m;var a=o.compile(o.decompile(e).filter((function(t){return t!==u.OP_CODESEPARATOR}))),f=this.clone();if((31&n)===d.SIGHASH_NONE)f.outs=[],f.ins.forEach((function(e,n){n!==t&&(e.sequence=0)}));else if((31&n)===d.SIGHASH_SINGLE){if(t>=this.outs.length)return m;f.outs.length=t+1;for(var l=0;l>25;return(33554431&t)<<5^996825010&-(e>>0&1)^642813549&-(e>>1&1)^513874426&-(e>>2&1)^1027748829&-(e>>3&1)^705979059&-(e>>4&1)}function s(t){for(var e=1,n=0;n126)return"Invalid prefix ("+t+")";e=u(e)^r>>5}for(e=u(e),n=0;ne)return"Exceeds length limit";var n=t.toLowerCase(),r=t.toUpperCase();if(t!==n&&t!==r)return"Mixed-case string "+t;var o=(t=n).lastIndexOf("1");if(-1===o)return"No separator character for "+t;if(0===o)return"Missing prefix for "+t;var a=t.slice(0,o),c=t.slice(o+1);if(c.length<6)return"Data too short";var f=s(a);if("string"===typeof f)return f;for(var l=[],d=0;d=c.length||l.push(p)}return 1!==f?"Invalid checksum for "+t:{prefix:a,words:l}}function f(t,e,n,r){for(var i=0,o=0,a=(1<=n;)o-=n,u.push(i>>o&a);if(r)o>0&&u.push(i<=e)return"Excess padding";if(i<n)throw new TypeError("Exceeds length limit");var i=s(t=t.toLowerCase());if("string"===typeof i)throw new Error(i);for(var o=t+"1",a=0;a>5!==0)throw new Error("Non 5-bit word");i=u(i)^c,o+=r.charAt(c)}for(a=0;a<6;++a)i=u(i);for(i^=1,a=0;a<6;++a){o+=r.charAt(i>>5*(5-a)&31)}return o},toWordsUnsafe:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e},toWords:function(t){var e=f(t,8,5,!0);if(Array.isArray(e))return e;throw new Error(e)},fromWordsUnsafe:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e},fromWords:function(t){var e=f(t,5,8,!1);if(Array.isArray(e))return e;throw new Error(e)}}},function(t,e,n){var r=n(789),i=n(790),o=n(791),a=n(792),u=n(793),s=n(794),c=n(795);t.exports={embed:r,p2ms:i,p2pk:o,p2pkh:a,p2sh:u,p2wpkh:s,p2wsh:c}},function(t,e,n){t.exports={input:n(797),output:n(798)}},function(t,e,n){t.exports={input:n(800),output:n(801)}},function(t,e,n){t.exports={input:n(802),output:n(803)}},function(t,e,n){!function(e,r){var i;t.exports=(i=n(50),function(){var t=i,e=t.lib,n=e.WordArray,r=e.Hasher,o=t.algo,a=[],u=o.SHA1=r.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],u=n[3],s=n[4],c=0;c<80;c++){if(c<16)a[c]=0|t[e+c];else{var f=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=f<<1|f>>>31}var l=(r<<5|r>>>27)+s+a[c];l+=c<20?1518500249+(i&o|~i&u):c<40?1859775393+(i^o^u):c<60?(i&o|i&u|o&u)-1894007588:(i^o^u)-899497514,s=u,u=o,o=i<<30|i>>>2,i=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+u|0,n[4]=n[4]+s|0},_doFinalize:function(){var t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=r._createHelper(u),t.HmacSHA1=r._createHmacHelper(u)}(),i.SHA1)}()},function(t,e,n){!function(e,r){var i;t.exports=(i=n(50),void function(){var t=i,e=t.lib.Base,n=t.enc.Utf8;t.algo.HMAC=e.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=n.parse(e));var r=t.blockSize,i=4*r;e.sigBytes>i&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),a=this._iKey=e.clone(),u=o.words,s=a.words,c=0;c>1,c=i.getN(),f=i.getG(),d=s?n.add(c):n,h=i.fromX(u,d);if(!h.mul(c).isInfinity())throw new Error("nR is not a valid curve point");var p=e.neg().umod(c),g=n.invm(c),m=h.mul(o).add(f.mul(p)).mul(g);return a.fromPoint(m,this.sig.compressed)},d.prototype.sigError=function(){if(!c.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var t=this.sig.r,e=this.sig.s;if(!t.gt(r.Zero)||!t.lt(i.getN())||!e.gt(r.Zero)||!e.lt(i.getN()))return"r and s not in range";var n=r.fromBuffer(this.hashbuf,this.endian?{endian:this.endian}:void 0),o=i.getN(),a=e.invm(o),u=a.mul(n).umod(o),s=a.mul(t).umod(o),f=i.getG().mulAdd(u,this.pubkey.point,s);return f.isInfinity()?"p is infinity":0!==f.getX().umod(o).cmp(t)&&"Invalid signature"},d.toLowS=function(t){return t.gt(r.fromBuffer(e.from("7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0","hex")))&&(t=i.getN().sub(t)),t},d.prototype._findSignature=function(t,e){var n,o,a,u=i.getN(),s=i.getG(),c=0;do{(!this.k||c>0)&&this.deterministicK(c),c++,n=this.k,o=s.mul(n).x.umod(u),a=n.invm(u).mul(e.add(t.mul(o))).umod(u)}while(o.cmp(r.Zero)<=0||a.cmp(r.Zero)<=0);return{s:a=d.toLowS(a),r:o}},d.prototype.sign=function(){var t=this.hashbuf,e=this.privkey,n=e.bn;l.checkState(t&&e&&n,new Error("invalid parameters")),l.checkState(c.isBuffer(t)&&32===t.length,new Error("hashbuf must be a 32 byte buffer"));var i=r.fromBuffer(t,this.endian?{endian:this.endian}:void 0),a=this._findSignature(n,i);return a.compressed=this.pubkey.compressed,this.sig=new o(a),this},d.prototype.signRandomK=function(){return this.randomK(),this.sign()},d.prototype.toString=function(){var t={};return this.hashbuf&&(t.hashbuf=this.hashbuf.toString("hex")),this.privkey&&(t.privkey=this.privkey.toString()),this.pubkey&&(t.pubkey=this.pubkey.toString()),this.sig&&(t.sig=this.sig.toString()),this.k&&(t.k=this.k.toString()),JSON.stringify(t)},d.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},d.sign=function(t,e,n){return d().set({hashbuf:t,endian:n,privkey:e}).sign().sig},d.verify=function(t,e,n,r){return d().set({hashbuf:t,endian:r,sig:e,pubkey:n}).verify().verified},t.exports=d}).call(this,n(29).Buffer)},function(t,e,n){"use strict";var r=n(95);function i(t){this.options=t,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}t.exports=i,i.prototype._init=function(){},i.prototype.update=function(t){return 0===t.length?[]:"decrypt"===this.type?this._updateDecrypt(t):this._updateEncrypt(t)},i.prototype._buffer=function(t,e){for(var n=Math.min(this.buffer.length-this.bufferOff,t.length-e),r=0;r0;r--)e+=this._buffer(t,e),n+=this._flushBuffer(i,n);return e+=this._buffer(t,e),i},i.prototype.final=function(t){var e,n;return t&&(e=this.update(t)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),e?e.concat(n):n},i.prototype._pad=function(t,e){if(0===e)return!1;for(;e=0||!e.umod(t.prime1)||!e.umod(t.prime2));return e}function a(t,n){var i=function(t){var e=o(t);return{blinder:e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed(),unblinder:e.invm(t.modulus)}}(n),a=n.modulus.byteLength(),u=new r(t).mul(i.blinder).umod(n.modulus),s=u.toRed(r.mont(n.prime1)),c=u.toRed(r.mont(n.prime2)),f=n.coefficient,l=n.prime1,d=n.prime2,h=s.redPow(n.exponent1).fromRed(),p=c.redPow(n.exponent2).fromRed(),g=h.isub(p).imul(f).umod(l).imul(d);return p.iadd(g).imul(i.unblinder).umod(n.modulus).toArrayLike(e,"be",a)}a.getr=o,t.exports=a}).call(this,n(29).Buffer)},function(t,e,n){"use strict";var r,i=e,o=n(181),a=n(498),u=n(116).assert;function s(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,u(this.g.validate(),"Invalid curve"),u(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var n=new s(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=s,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(902)}catch(f){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(t,e,n){"use strict";(function(e){var r,i=n(29),o=i.Buffer,a={};for(r in i)i.hasOwnProperty(r)&&"SlowBuffer"!==r&&"Buffer"!==r&&(a[r]=i[r]);var u=a.Buffer={};for(r in o)o.hasOwnProperty(r)&&"allocUnsafe"!==r&&"allocUnsafeSlow"!==r&&(u[r]=o[r]);if(a.Buffer.prototype=o.prototype,u.from&&u.from!==Uint8Array.from||(u.from=function(t,e,n){if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof t);if(t&&"undefined"===typeof t.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);return o(t,e,n)}),u.alloc||(u.alloc=function(t,e,n){if("number"!==typeof t)throw new TypeError('The "size" argument must be of type number. Received type '+typeof t);if(t<0||t>=2*(1<<30))throw new RangeError('The value "'+t+'" is invalid for option "size"');var r=o(t);return e&&0!==e.length?"string"===typeof n?r.fill(e,n):r.fill(e):r.fill(0),r}),!a.kStringMaxLength)try{a.kStringMaxLength=e.binding("buffer").kStringMaxLength}catch(s){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this,n(69))},function(t,e,n){"use strict";var r=n(383).Reporter,i=n(240).EncoderBuffer,o=n(240).DecoderBuffer,a=n(95),u=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],s=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(u);function c(t,e,n){var r={};this._baseState=r,r.name=n,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=c;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){var t=this._baseState,e={};f.forEach((function(n){e[n]=t[n]}));var n=new this.constructor(e.parent);return n._baseState=e,n},c.prototype._wrap=function(){var t=this._baseState;s.forEach((function(e){this[e]=function(){var n=new this.constructor(this);return t.children.push(n),n[e].apply(n,arguments)}}),this)},c.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter((function(t){return t._baseState.parent===this}),this),a.equal(e.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(t){var e=this._baseState,n=t.filter((function(t){return t instanceof this.constructor}),this);t=t.filter((function(t){return!(t instanceof this.constructor)}),this),0!==n.length&&(a(null===e.children),e.children=n,n.forEach((function(t){t._baseState.parent=this}),this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map((function(t){if("object"!==typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach((function(n){n==(0|n)&&(n|=0);var r=t[n];e[r]=n})),e})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(t){c.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}})),u.forEach((function(t){c.prototype[t]=function(){var e=this._baseState,n=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(n),this}})),c.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},c.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},c.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},c.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},c.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map((function(e){return t[e]}))),this},c.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},c.prototype._decode=function(t,e){var n=this._baseState;if(null===n.parent)return t.wrapResult(n.children[0]._decode(t,e));var r,i=n.default,a=!0,u=null;if(null!==n.key&&(u=t.enterKey(n.key)),n.optional){var s=null;if(null!==n.explicit?s=n.explicit:null!==n.implicit?s=n.implicit:null!==n.tag&&(s=n.tag),null!==s||n.any){if(a=this._peekTag(t,s,n.any),t.isError(a))return a}else{var c=t.save();try{null===n.choice?this._decodeGeneric(n.tag,t,e):this._decodeChoice(t,e),a=!0}catch(g){a=!1}t.restore(c)}}if(n.obj&&a&&(r=t.enterObject()),a){if(null!==n.explicit){var f=this._decodeTag(t,n.explicit);if(t.isError(f))return f;t=f}var l=t.offset;if(null===n.use&&null===n.choice){var d;n.any&&(d=t.save());var h=this._decodeTag(t,null!==n.implicit?n.implicit:n.tag,n.any);if(t.isError(h))return h;n.any?i=t.raw(d):t=h}if(e&&e.track&&null!==n.tag&&e.track(t.path(),l,t.length,"tagged"),e&&e.track&&null!==n.tag&&e.track(t.path(),t.offset,t.length,"content"),n.any||(i=null===n.choice?this._decodeGeneric(n.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(t,e)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){var p=new o(i);i=this._getUse(n.contains,t._reporterState.obj)._decode(p,e)}}return n.obj&&a&&(i=t.leaveObject(r)),null===n.key||null===i&&!0!==a?null!==u&&t.exitKey(u):t.leaveKey(u,n.key,i),i},c.prototype._decodeGeneric=function(t,e,n){var r=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,r.args[0],n):/str$/.test(t)?this._decodeStr(e,t,n):"objid"===t&&r.args?this._decodeObjid(e,r.args[0],r.args[1],n):"objid"===t?this._decodeObjid(e,null,null,n):"gentime"===t||"utctime"===t?this._decodeTime(e,t,n):"null_"===t?this._decodeNull(e,n):"bool"===t?this._decodeBool(e,n):"objDesc"===t?this._decodeStr(e,t,n):"int"===t||"enum"===t?this._decodeInt(e,r.args&&r.args[0],n):null!==r.use?this._getUse(r.use,e._reporterState.obj)._decode(e,n):e.error("unknown tag: "+t)},c.prototype._getUse=function(t,e){var n=this._baseState;return n.useDecoder=this._use(t,e),a(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},c.prototype._decodeChoice=function(t,e){var n=this._baseState,r=null,i=!1;return Object.keys(n.choice).some((function(o){var a=t.save(),u=n.choice[o];try{var s=u._decode(t,e);if(t.isError(s))return!1;r={type:o,value:s},i=!0}catch(c){return t.restore(a),!1}return!0}),this),i?r:t.error("Choice not matched")},c.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},c.prototype._encode=function(t,e,n){var r=this._baseState;if(null===r.default||r.default!==t){var i=this._encodeValue(t,e,n);if(void 0!==i&&!this._skipDefault(i,e,n))return i}},c.prototype._encodeValue=function(t,e,n){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new r);var o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}var a=null,u=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)a=this._getUse(i.contains,n)._encode(t,e),u=!0;else if(i.children)a=i.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,e,t);if(null===n._baseState.key)return e.error("Child should have a key");var r=e.enterKey(n._baseState.key);if("object"!==typeof t)return e.error("Child expected, but input is not object");var i=n._encode(t[n._baseState.key],e,t);return e.leaveKey(r),i}),this).filter((function(t){return t})),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var s=this.clone();s._baseState.implicit=null,a=this._createEncoderBuffer(t.map((function(n){var r=this._baseState;return this._getUse(r.args[0],t)._encode(n,e)}),s))}else null!==i.use?o=this._getUse(i.use,n)._encode(t,e):(a=this._encodePrimitive(i.tag,t),u=!0);if(!i.any&&null===i.choice){var c=null!==i.implicit?i.implicit:i.tag,f=null===i.implicit?"universal":"context";null===c?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(c,u,f,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(t,e){var n=this._baseState,r=n.choice[t.type];return r||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(n.choice))),r._encode(t.value,e)},c.prototype._encodePrimitive=function(t,e){var n=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&n.args)return this._encodeObjid(e,n.reverseArgs[0],n.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,n.args&&n.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},c.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},c.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(t)}},function(t,e,n){"use strict";var r=n(38);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.Reporter=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,n){var r=this._reporterState;this.exitKey(t),null!==r.obj&&(r.obj[e]=n)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){var e=this._reporterState,n=e.obj;return e.obj=t,n},i.prototype.error=function(t){var e,n=this._reporterState,r=t instanceof o;if(e=r?t:new o(n.path.map((function(t){return"["+JSON.stringify(t)+"]"})).join(""),t.message||t,t.stack),!n.options.partial)throw e;return r||n.errors.push(e),e},i.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},r(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(t,e,n){"use strict";function r(t){var e={};return Object.keys(t).forEach((function(n){(0|n)==n&&(n|=0);var r=t[n];e[r]=n})),e}e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=r(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=r(e.tag)},function(t,e,n){"use strict";var r,i=e,o=n(181),a=n(506),u=n(117).assert;function s(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,u(this.g.validate(),"Invalid curve"),u(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(t,e){Object.defineProperty(i,t,{configurable:!0,enumerable:!0,get:function(){var n=new s(e);return Object.defineProperty(i,t,{configurable:!0,enumerable:!0,value:n}),n}})}i.PresetCurve=s,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=n(927)}catch(f){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})},function(t,e,n){"use strict";(function(e){var r=n(78),i=n(186),o=n(100),a=(n(101),n(242),n(84)),u=n(63),s=(n(49),n(52)),c=function t(e){if(!(this instanceof t))return new t(e);e&&this.set(e)};function f(t){return t.toBuffer().length<32?t.toBuffer({size:32}):t.toBuffer()}c.prototype.set=function(t){return this.hashbuf=t.hashbuf||this.hashbuf,this.endian=t.endian||this.endian,this.privkey=t.privkey||this.privkey,this.pubkey=t.pubkey||(this.privkey?this.privkey.publicKey:this.pubkey),this.sig=t.sig||this.sig,this.verified=t.verified||this.verified,this},c.prototype.privkey2pubkey=function(){this.pubkey=this.privkey.toPublicKey()},c.prototype.toPublicKey=function(){return this.privkey.toPublicKey()},c.prototype.sign=function(){var t=this.hashbuf,e=this.privkey,n=e.bn;s.checkState(t&&e&&n,new Error("invalid parameters")),s.checkState(u.isBuffer(t)&&32===t.length,new Error("hashbuf must be a 32 byte buffer"));var i=r.fromBuffer(t,this.endian?{endian:this.endian}:void 0),a=this._findSignature(n,i);return a.compressed=this.pubkey.compressed,a.isSchnorr=!0,this.sig=new o(a),this},c.prototype._findSignature=function(t,n){var o=i.getN(),u=i.getG();s.checkState(!t.lte(new r(0)),new Error("privkey out of field of curve")),s.checkState(!t.gte(o),new Error("privkey out of field of curve"));var c=this.nonceFunctionRFC6979(t.toBuffer({size:32}),n.toBuffer({size:32})),l=u.mul(t),d=u.mul(c);c=d.hasSquare()?c:o.sub(c);var h=d.getX();return{r:h,s:r.fromBuffer(a.sha256(e.concat([f(h),i.pointToCompressed(l),n.toBuffer({size:32})]))).mul(t).add(c).mod(o)}},c.prototype.sigError=function(){if(!u.isBuffer(this.hashbuf)||32!==this.hashbuf.length)return"hashbuf must be a 32 byte buffer";var t=f(this.sig.r).length+function(t){return t.toBuffer().length<32?t.toBuffer({size:32}):t.toBuffer()}(this.sig.s).length;if(64!==t&&65!==t)return"signature must be a 64 byte or 65 byte array";var n="little"===this.endian?u.reverse(this.hashbuf):this.hashbuf,o=this.pubkey.point,s=i.getG();if(o.isInfinity())return!0;var c=this.sig.r,l=this.sig.s,d=new r("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex"),h=i.getN();if(c.gte(d)||l.gte(h))return!0;var p=f(this.sig.r),g=i.pointToCompressed(o),m=a.sha256(e.concat([p,g,n])),b=r.fromBuffer(m,"big").umod(h),v=s.mul(l),y=o.mul(h.sub(b)),_=v.add(y);return!(!_.isInfinity()&&_.hasSquare()&&_.getX().eq(c))},c.prototype.verify=function(){return this.sigError()?this.verified=!1:this.verified=!0,this},c.prototype.nonceFunctionRFC6979=function(t,n){var o=e.from("0101010101010101010101010101010101010101010101010101010101010101","hex"),u=e.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),c=e.concat([t,n,e.from("","ascii"),e.from("Schnorr+SHA256 ","ascii")]);u=a.sha256hmac(e.concat([o,e.from("00","hex"),c]),u),o=a.sha256hmac(o,u),u=a.sha256hmac(e.concat([o,e.from("01","hex"),c]),u),o=a.sha256hmac(o,u);for(var f=new r(0);o=a.sha256hmac(o,u),f=r.fromBuffer(o),s.checkState(o.length>=32,"V length should be >= 32"),!f.gt(new r(0))||!f.lt(i.getN());)u=a.sha256hmac(e.concat([o,e.from("00","hex")]),u),o=a.hmac(a.sha256,o,u);return f},c.sign=function(t,e,n){return c().set({hashbuf:t,endian:n,privkey:e}).sign().sig},c.verify=function(t,e,n,r){return c().set({hashbuf:t,endian:r,sig:e,pubkey:n}).verify().verified},t.exports=c}).call(this,n(29).Buffer)},function(t,e,n){"use strict";(function(e){var r=n(513),i=n(372),o=n(942),a=n(515),u=n(49),s=n(52),c=n(29),f=e.compare||n(943),l=n(115),d=n(63),h=n(79),p=n(160),g=n(134),m=n(84),b=n(100),v=n(152),y=n(187),_=n(516),w=n(388),S=w.PublicKeyHash,O=w.PublicKey,x=w.MultiSigScriptHash,E=w.MultiSig,M=w.Escrow,T=n(153),$=n(118),A=n(273),k=n(101),C=n(78);function I(t){if(!(this instanceof I))return new I(t);if(this.inputs=[],this.outputs=[],this._inputAmount=void 0,this._outputAmount=void 0,t){if(t instanceof I)return I.shallowCopy(t);if(h.isHexa(t))this.fromString(t);else if(d.isBuffer(t))this.fromBuffer(t);else{if(!u.isObject(t))throw new l.InvalidArgument("Must provide an object or string to deserialize a transaction");this.fromObject(t)}}else this._newTransaction()}I.DUST_AMOUNT=546,I.FEE_SECURITY_MARGIN=150,I.MAX_MONEY=21e14,I.NLOCKTIME_BLOCKHEIGHT_LIMIT=5e8,I.NLOCKTIME_MAX_VALUE=4294967295,I.FEE_PER_KB=1e5,I.CHANGE_OUTPUT_MAX_SIZE=62,I.MAXIMUM_EXTRA_SIZE=26,I.shallowCopy=function(t){return new I(t.toBuffer())};var P={configurable:!1,enumerable:!0,get:function(){return this._hash=new p(this._getHash()).readReverse().toString("hex"),this._hash}};Object.defineProperty(I.prototype,"hash",P),Object.defineProperty(I.prototype,"id",P);var N={configurable:!1,enumerable:!0,get:function(){return this._getInputAmount()}};Object.defineProperty(I.prototype,"inputAmount",N),N.get=function(){return this._getOutputAmount()},Object.defineProperty(I.prototype,"outputAmount",N),I.prototype._getHash=function(){return m.sha256sha256(this.toBuffer())},I.prototype.serialize=function(t){return!0===t||t&&t.disableAll?this.uncheckedSerialize():this.checkedSerialize(t)},I.prototype.uncheckedSerialize=I.prototype.toString=function(){return this.toBuffer().toString("hex")},I.prototype.checkedSerialize=function(t){var e=this.getSerializationError(t);if(e)throw e.message+=" - For more information please see: https://bitcore.io/api/lib/transaction#serialization-checks",e;return this.uncheckedSerialize()},I.prototype.invalidSatoshis=function(){for(var t=!1,e=0;en)return this._missingChange()?new l.Transaction.ChangeAddressMissing("Fee is too large and no change address was provided"):new l.Transaction.FeeError.TooLarge("expected less than "+n+" but got "+e)}if(!t.disableSmallFees){var r=Math.ceil(this._estimateFee()/I.FEE_SECURITY_MARGIN);if(e"},I.prototype.toBuffer=function(){var t=new g;return this.toBufferWriter(t).toBuffer()},I.prototype.toBufferWriter=function(t){return t.writeInt32LE(this.version),t.writeVarintNum(this.inputs.length),u.each(this.inputs,(function(e){e.toBufferWriter(t)})),t.writeVarintNum(this.outputs.length),u.each(this.outputs,(function(e){e.toBufferWriter(t)})),t.writeUInt32LE(this.nLockTime),t},I.prototype.fromBuffer=function(t){var e=new p(t);return this.fromBufferReader(e)},I.prototype.fromBufferReader=function(t){var e,n,r;for(s.checkArgument(!t.finished(),"No transaction data received"),this.version=t.readInt32LE(),n=t.readVarintNum(),e=0;e=I.NLOCKTIME_BLOCKHEIGHT_LIMIT)throw new l.Transaction.BlockHeightTooHigh;if(t<0)throw new l.Transaction.NLockTimeOutOfRange;for(var e=0;e1?this._fromEscrowUtxo(t,t.publicKeys):this._fromNonP2SH(t)),this},I.prototype.associateInputs=function(t,e,n,r){var i,o=this,u=[],s=a(t);try{var c=function(){var t=i.value,a=o.inputs.findIndex((function(e){return e.prevTxId.toString("hex")===t.txId&&e.outputIndex===t.outputIndex}));u.push(a),a>=0&&(o.inputs[a]=o._getInputFrom(t,e,n,r))};for(s.s();!(i=s.n()).done;)c()}catch(f){s.e(f)}finally{s.f()}return u},I.prototype._selectInputType=function(t,e,n){var r;return t=new _(t),e&&n?t.script.isMultisigOut()?r=E:(t.script.isScriptHashOut()||t.script.isWitnessScriptHashOut())&&(r=x):r=t.script.isPublicKeyHashOut()||t.script.isWitnessPublicKeyHashOut()||t.script.isScriptHashOut()?S:t.script.isPublicKeyOut()?O:w,r},I.prototype._getInputFrom=function(t,e,n,r){t=new _(t);var i=this._selectInputType(t,e,n),a={output:new T({script:t.script,satoshis:t.satoshis}),prevTxId:t.txId,outputIndex:t.outputIndex,sequenceNumber:t.sequenceNumber,script:$.empty()};return o(i,[a].concat(e&&n?[e,n,!1,r]:[]))},I.prototype._fromEscrowUtxo=function(t,e){var n=e.map((function(t){return new k(t)})),r=n.slice(1),i=n[0];t=new _(t),this.addInput(new M({output:new T({script:t.script,satoshis:t.satoshis}),prevTxId:t.txId,outputIndex:t.outputIndex,script:$.empty()},r,i))},I.prototype._fromNonP2SH=function(t){var e;e=(t=new _(t)).script.isPublicKeyHashOut()?S:t.script.isPublicKeyOut()?O:w,this.addInput(new e({output:new T({script:t.script,satoshis:t.satoshis}),prevTxId:t.txId,outputIndex:t.outputIndex,script:$.empty()}))},I.prototype._fromMultisigUtxo=function(t,e,n,r){var i;if(s.checkArgument(n<=e.length,"Number of required signatures must be greater than the number of public keys"),(t=new _(t)).script.isMultisigOut())i=E;else{if(!t.script.isScriptHashOut())throw new Error("@TODO");i=x}this.addInput(new i({output:new T({script:t.script,satoshis:t.satoshis}),prevTxId:t.txId,outputIndex:t.outputIndex,script:$.empty()},e,n,void 0,r))},I.prototype.addInput=function(t,e,n){if(s.checkArgumentType(t,w,"input"),!t.output&&(u.isUndefined(e)||u.isUndefined(n)))throw new l.Transaction.NeedMoreInfo("Need information about the UTXO script and satoshis");return t.output||!e||u.isUndefined(n)||(e=e instanceof $?e:new $(e),s.checkArgumentType(n,"number","satoshis"),t.output=new T({script:e,satoshis:n})),this.uncheckedAddInput(t)},I.prototype.uncheckedAddInput=function(t){return s.checkArgumentType(t,w,"input"),this.inputs.push(t),this._inputAmount=void 0,this._updateChangeOutput(),this},I.prototype.hasAllUtxoInfo=function(){return u.every(this.inputs.map((function(t){return!!t.output})))},I.prototype.fee=function(t){return s.checkArgument(u.isNumber(t),"amount must be a number"),this._fee=t,this._updateChangeOutput(),this},I.prototype.feePerKb=function(t){return s.checkArgument(u.isNumber(t),"amount must be a number"),this._feePerKb=t,this._updateChangeOutput(),this},I.prototype.feePerByte=function(t){return s.checkArgument(u.isNumber(t),"amount must be a number"),this._feePerByte=t,this._updateChangeOutput(),this},I.prototype.change=function(t){return s.checkArgument(t,"address is required"),this._changeScript=$.fromAddress(t),this._updateChangeOutput(),this},I.prototype.escrow=function(t,e){s.checkArgument(this.inputs.length>0,"inputs must have already been set when setting escrow"),s.checkArgument(this.outputs.length>0,"non-change outputs must have already been set when setting escrow"),s.checkArgument(!this.getChangeOutput(),"change must still be unset when setting escrow"),s.checkArgument(t,"address is required"),s.checkArgument(e,"amount is required");var n=this._getOutputAmount()+this.getFee()+e,r=this._getInputAmount()-n>I.DUST_AMOUNT;return this.to(t,e),r||(this._fee=void 0),this},I.prototype.getChangeOutput=function(){return u.isUndefined(this._changeIndex)?null:this.outputs[this._changeIndex]},I.prototype.to=function(t,e){if(u.isArray(t)){var n=this;return u.each(t,(function(t){n.to(t.address,t.satoshis)})),this}return s.checkArgument(h.isNaturalNumber(e),"Amount is expected to be a positive integer"),this.addOutput(new T({script:$(new y(t)),satoshis:e})),this},I.prototype.addData=function(t){return this.addOutput(new T({script:$.buildDataOut(t),satoshis:0})),this},I.prototype.addOutput=function(t){return s.checkArgumentType(t,T,"output"),this._addOutput(t),this._updateChangeOutput(),this},I.prototype.clearOutputs=function(){return this.outputs=[],this._clearSignatures(),this._outputAmount=void 0,this._changeIndex=void 0,this._updateChangeOutput(),this},I.prototype._addOutput=function(t){this.outputs.push(t),this._outputAmount=void 0},I.prototype._getOutputAmount=function(){if(u.isUndefined(this._outputAmount)){var t=this;this._outputAmount=0,u.each(this.outputs,(function(e){t._outputAmount+=e.satoshis}))}return this._outputAmount},I.prototype._getInputAmount=function(){return u.isUndefined(this._inputAmount)&&(this._inputAmount=u.sumBy(this.inputs,(function(t){if(u.isUndefined(t.output))throw new l.Transaction.Input.MissingPreviousOutput;return t.output.satoshis}))),this._inputAmount},I.prototype._updateChangeOutput=function(){if(this._changeScript){this._clearSignatures(),u.isUndefined(this._changeIndex)||this._removeOutput(this._changeIndex);var t=this._getUnspentValue()-this.getFee();t>=I.DUST_AMOUNT?(this._changeIndex=this.outputs.length,this._addOutput(new T({script:this._changeScript,satoshis:t}))):this._changeIndex=void 0}},I.prototype.getFee=function(){return this.isCoinbase()?0:u.isUndefined(this._fee)?this._changeScript?this._estimateFee():this._getUnspentValue():this._fee},I.prototype._estimateFee=function(){var t=this._estimateSize(),e=this._getUnspentValue(),n=this._feePerByte||(this._feePerKb||I.FEE_PER_KB)/1e3;function r(t){return t*n}var i=Math.ceil(r(t)),o=Math.ceil(r(t)+r(I.CHANGE_OUTPUT_MAX_SIZE));return!this._changeScript||e<=o?i:o},I.prototype._getUnspentValue=function(){return this._getInputAmount()-this._getOutputAmount()},I.prototype._clearSignatures=function(){u.each(this.inputs,(function(t){t.clearSignatures()}))},I.prototype._estimateSize=function(){var t=I.MAXIMUM_EXTRA_SIZE;return u.each(this.inputs,(function(e){var n=e._estimateSize(),r=g.varintBufNum(n).length;t+=36+r+n})),u.each(this.outputs,(function(e){t+=e.script.toBuffer().length+9})),t},I.prototype._removeOutput=function(t){var e=this.outputs[t];this.outputs=u.without(this.outputs,e),this._outputAmount=void 0},I.prototype.removeOutput=function(t){this._removeOutput(t),this._updateChangeOutput()},I.prototype.sort=function(){return this.sortInputs((function(t){var e=Array.prototype.concat.apply([],t),n=0;return e.forEach((function(t){t.i=n++})),e.sort((function(t,e){return f(t.prevTxId,e.prevTxId)||t.outputIndex-e.outputIndex||t.i-e.i})),e})),this.sortOutputs((function(t){var e=Array.prototype.concat.apply([],t),n=0;return e.forEach((function(t){t.i=n++})),e.sort((function(t,e){return t.satoshis-e.satoshis||f(t.script.toBuffer(),e.script.toBuffer())||t.i-e.i})),e})),this},I.prototype.shuffleOutputs=function(){return this.sortOutputs(u.shuffle)},I.prototype.sortOutputs=function(t){var e=t(this.outputs);return this._newOutputOrder(e)},I.prototype.sortInputs=function(t){return this.inputs=t(this.inputs),this._clearSignatures(),this},I.prototype._newOutputOrder=function(t){if(this.outputs.length!==t.length||0!==u.difference(this.outputs,t).length)throw new l.Transaction.InvalidSorting;if(!u.isUndefined(this._changeIndex)){var e=this.outputs[this._changeIndex];this._changeIndex=u.findIndex(t,e)}return this.outputs=t,this},I.prototype.removeInput=function(t,e){var n;if((n=!e&&u.isNumber(t)?t:u.findIndex(this.inputs,(function(n){return n.prevTxId.toString("hex")===t&&n.outputIndex===e})))<0||n>=this.inputs.length)throw new l.Transaction.InvalidIndex(n,this.inputs.length);var r=this.inputs[n];this.inputs=u.without(this.inputs,r),this._inputAmount=void 0,this._updateChangeOutput()},I.prototype.sign=function(t,e,n){n=n||"ecdsa",s.checkState(this.hasAllUtxoInfo(),"Not all utxo information is available to sign the transaction.");var r=this;return u.isArray(t)?(u.each(t,(function(t){r.sign(t,e,n)})),this):(u.each(this.getSignatures(t,e,n),(function(t){r.applySignature(t,n)})),this)},I.prototype.getSignatures=function(t,e,n){t=new A(t),e=e||b.SIGHASH_ALL|b.SIGHASH_FORKID;var r=this,i=[],o=m.sha256ripemd160(t.publicKey.toBuffer());return u.each(this.inputs,(function(a,s){u.each(a.getSignatures(r,t,s,e,o,n),(function(t){i.push(t)}))})),i},I.prototype.applySignature=function(t,e){return this.inputs[t.inputIndex].addSignature(this,t,e),this},I.prototype.isFullySigned=function(){return u.each(this.inputs,(function(t){if(t.isFullySigned===w.prototype.isFullySigned)throw new l.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction")})),u.every(u.map(this.inputs,(function(t){return t.isFullySigned()})))},I.prototype.isValidSignature=function(t){if(this.inputs[t.inputIndex].isValidSignature===w.prototype.isValidSignature)throw new l.Transaction.UnableToVerifySignature("Unrecognized script kind, or not enough information to execute script.This usually happens when creating a transaction from a serialized transaction");return this.inputs[t.inputIndex].isValidSignature(this,t)},I.prototype.verifySignature=function(t,e,n,r,i,o,a){return v.verify(this,t,e,n,r,i,o,a)},I.prototype.verify=function(){if(0===this.inputs.length)return"transaction txins empty";if(0===this.outputs.length)return"transaction txouts empty";for(var t=new C(0),e=0;e1e6)return"transaction over the maximum block size";var r={};for(e=0;e100)return"coinbase transaction script size invalid"}else for(e=0;e65536)return!1;if(!this.inputs.every((function(t){return t.script.isPublicKeyHashIn()})))return!1;var o;try{o=new I(t)}catch(T){return!1}var a=o.inputs[0];if(a.prevTxId.toString("hex")!==this.id)return!1;var u=this.outputs[a.outputIndex];if(!u)return!1;var s=this.uncheckedSerialize().length/2*n;if(u.toObject().satoshis"},t.exports=u},function(t,e,n){"use strict";t.exports=function(t){var e=t.uri,n=t.name,r=t.type;this.uri=e,this.name=n,this.type=r}},function(t,e,n){"use strict";var r=n(390);t.exports=function(t){return"undefined"!==typeof File&&t instanceof File||"undefined"!==typeof Blob&&t instanceof Blob||t instanceof r}},function(t,e,n){"use strict";n.r(e);var r=n(394);n.d(e,"default",(function(){return r.a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var r=n(4),i=n(135);function o(t){return t&&"object"===Object(i.a)(t)&&t.constructor===Object}function a(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},i=n.clone?Object(r.a)({},t):t;return o(t)&&o(e)&&Object.keys(e).forEach((function(r){"__proto__"!==r&&(o(e[r])&&r in t?i[r]=a(t[r],e[r],n):i[r]=e[r])})),i}},function(t,e,n){"use strict";var r=n(4),i=n(17),o=n(1),a=(n(13),n(15)),u=n(24),s=n(36),c=n(337),f=n(34),l=o.forwardRef((function(t,e){var n=t.edge,u=void 0!==n&&n,s=t.children,l=t.classes,d=t.className,h=t.color,p=void 0===h?"default":h,g=t.disabled,m=void 0!==g&&g,b=t.disableFocusRipple,v=void 0!==b&&b,y=t.size,_=void 0===y?"medium":y,w=Object(i.a)(t,["edge","children","classes","className","color","disabled","disableFocusRipple","size"]);return o.createElement(c.a,Object(r.a)({className:Object(a.a)(l.root,d,"default"!==p&&l["color".concat(Object(f.a)(p))],m&&l.disabled,"small"===_&&l["size".concat(Object(f.a)(_))],{start:l.edgeStart,end:l.edgeEnd}[u]),centerRipple:!0,focusRipple:!v,disabled:m,ref:e},w),o.createElement("span",{className:l.label},s))}));e.a=Object(u.a)((function(t){return{root:{textAlign:"center",flex:"0 0 auto",fontSize:t.typography.pxToRem(24),padding:12,borderRadius:"50%",overflow:"visible",color:t.palette.action.active,transition:t.transitions.create("background-color",{duration:t.transitions.duration.shortest}),"&:hover":{backgroundColor:Object(s.d)(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"&$disabled":{backgroundColor:"transparent",color:t.palette.action.disabled}},edgeStart:{marginLeft:-12,"$sizeSmall&":{marginLeft:-3}},edgeEnd:{marginRight:-12,"$sizeSmall&":{marginRight:-3}},colorInherit:{color:"inherit"},colorPrimary:{color:t.palette.primary.main,"&:hover":{backgroundColor:Object(s.d)(t.palette.primary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},colorSecondary:{color:t.palette.secondary.main,"&:hover":{backgroundColor:Object(s.d)(t.palette.secondary.main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},disabled:{},sizeSmall:{padding:3,fontSize:t.typography.pxToRem(18)},label:{width:"100%",display:"flex",alignItems:"inherit",justifyContent:"inherit"}}}),{name:"MuiIconButton"})(l)},function(t,e,n){"use strict";var r=n(4),i=n(17),o=n(1),a=(n(13),n(48)),u=n(215),s=n(578),c=n(44),f=n(96),l=n(90),d=n(122);function h(t,e){var n=function(t,e){var n,r=e.getBoundingClientRect();if(e.fakeTransform)n=e.fakeTransform;else{var i=window.getComputedStyle(e);n=i.getPropertyValue("-webkit-transform")||i.getPropertyValue("transform")}var o=0,a=0;if(n&&"none"!==n&&"string"===typeof n){var u=n.split("(")[1].split(")")[0].split(",");o=parseInt(u[4],10),a=parseInt(u[5],10)}return"left"===t?"translateX(".concat(window.innerWidth,"px) translateX(").concat(o-r.left,"px)"):"right"===t?"translateX(-".concat(r.left+r.width-o,"px)"):"up"===t?"translateY(".concat(window.innerHeight,"px) translateY(").concat(a-r.top,"px)"):"translateY(-".concat(r.top+r.height-a,"px)")}(t,e);n&&(e.style.webkitTransform=n,e.style.transform=n)}var p={enter:l.b.enteringScreen,exit:l.b.leavingScreen},g=o.forwardRef((function(t,e){var n=t.children,l=t.direction,g=void 0===l?"down":l,m=t.in,b=t.onEnter,v=t.onEntered,y=t.onEntering,_=t.onExit,w=t.onExited,S=t.onExiting,O=t.style,x=t.timeout,E=void 0===x?p:x,M=t.TransitionComponent,T=void 0===M?s.a:M,$=Object(i.a)(t,["children","direction","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"]),A=Object(f.a)(),k=o.useRef(null),C=o.useCallback((function(t){k.current=a.findDOMNode(t)}),[]),I=Object(c.a)(n.ref,C),P=Object(c.a)(I,e),N=function(t){return function(e){t&&(void 0===e?t(k.current):t(k.current,e))}},R=N((function(t,e){h(g,t),Object(d.b)(t),b&&b(t,e)})),j=N((function(t,e){var n=Object(d.a)({timeout:E,style:O},{mode:"enter"});t.style.webkitTransition=A.transitions.create("-webkit-transform",Object(r.a)({},n,{easing:A.transitions.easing.easeOut})),t.style.transition=A.transitions.create("transform",Object(r.a)({},n,{easing:A.transitions.easing.easeOut})),t.style.webkitTransform="none",t.style.transform="none",y&&y(t,e)})),D=N(v),L=N(S),F=N((function(t){var e=Object(d.a)({timeout:E,style:O},{mode:"exit"});t.style.webkitTransition=A.transitions.create("-webkit-transform",Object(r.a)({},e,{easing:A.transitions.easing.sharp})),t.style.transition=A.transitions.create("transform",Object(r.a)({},e,{easing:A.transitions.easing.sharp})),h(g,t),_&&_(t)})),B=N((function(t){t.style.webkitTransition="",t.style.transition="",w&&w(t)})),U=o.useCallback((function(){k.current&&h(g,k.current)}),[g]);return o.useEffect((function(){if(!m&&"down"!==g&&"right"!==g){var t=Object(u.a)((function(){k.current&&h(g,k.current)}));return window.addEventListener("resize",t),function(){t.clear(),window.removeEventListener("resize",t)}}}),[g,m]),o.useEffect((function(){m||U()}),[m,U]),o.createElement(T,Object(r.a)({nodeRef:k,onEnter:R,onEntered:D,onEntering:j,onExit:F,onExited:B,onExiting:L,appear:!0,in:m,timeout:E},$),(function(t,e){return o.cloneElement(n,Object(r.a)({ref:P,style:Object(r.a)({visibility:"exited"!==t||m?void 0:"hidden"},O,n.props.style)},e))}))}));e.a=g},function(t,e,n){"use strict";t.exports=n(614)},function(t,e,n){var r=n(431)((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));t.exports=r},function(t,e,n){var r=n(719);t.exports=h,t.exports.parse=o,t.exports.compile=function(t,e){return u(o(t,e),e)},t.exports.tokensToFunction=u,t.exports.tokensToRegExp=d;var i=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(t,e){for(var n,r=[],o=0,a=0,u="",f=e&&e.delimiter||"/";null!=(n=i.exec(t));){var l=n[0],d=n[1],h=n.index;if(u+=t.slice(a,h),a=h+l.length,d)u+=d[1];else{var p=t[a],g=n[2],m=n[3],b=n[4],v=n[5],y=n[6],_=n[7];u&&(r.push(u),u="");var w=null!=g&&null!=p&&p!==g,S="+"===y||"*"===y,O="?"===y||"*"===y,x=n[2]||f,E=b||v;r.push({name:m||o++,prefix:g||"",delimiter:x,optional:O,repeat:S,partial:w,asterisk:!!_,pattern:E?c(E):_?".*":"[^"+s(x)+"]+?"})}}return a=r}}),"es6","es3"),$jscomp.findInternal=function(t,e,n){t instanceof String&&(t=String(t));for(var r=t.length,i=0;i=i}}),"es6","es3"),$jscomp.polyfill("String.prototype.repeat",(function(t){return t||function(t){var e=$jscomp.checkStringArgs(this,null,"repeat");if(0>t||1342177279>>=1)&&(e+=e);return n}}),"es6","es3"),$jscomp.arrayIteratorImpl=function(t){var e=0;return function(){return e>>0),goog.uidCounter_=0,goog.cloneObject=function(t){var e=goog.typeOf(t);if("object"==e||"array"==e){if("function"===typeof t.clone)return t.clone();for(var n in e="array"==e?[]:{},t)e[n]=goog.cloneObject(t[n]);return e}return t},goog.bindNative_=function(t,e,n){return t.call.apply(t.bind,arguments)},goog.bindJs_=function(t,e,n){if(!t)throw Error();if(2").replace(/'/g,"'").replace(/"/g,'"').replace(/&/g,"&")),e&&(t=t.replace(/\{\$([^}]+)}/g,(function(t,n){return null!=e&&n in e?e[n]:t}))),t},goog.getMsgWithFallback=function(t,e){return t},goog.exportSymbol=function(t,e,n){goog.exportPath_(t,e,!0,n)},goog.exportProperty=function(t,e,n){t[e]=n},goog.inherits=function(t,e){function n(){}n.prototype=e.prototype,t.superClass_=e.prototype,t.prototype=new n,t.prototype.constructor=t,t.base=function(t,n,r){for(var i=Array(arguments.length-2),o=2;o{"use strict";class X{constructor(){if(new.target!=String)throw 1;this.x=42}}let q=Reflect.construct(X,[],String);if(q.x!=42||!(q instanceof String))throw 1;for(const a of[2,3]){if(a==2)continue;function f(z={a}){let a=0;return z.a}{function f(){return 0;}}return f()==3}})()')})),a("es7",(function(){return b("2 ** 2 == 4")})),a("es8",(function(){return b("async () => 1, true")})),a("es9",(function(){return b("({...rest} = {}), true")})),a("es_next",(function(){return!1})),{target:c,map:d}},goog.Transpiler.prototype.needsTranspile=function(t,e){if("always"==goog.TRANSPILE)return!0;if("never"==goog.TRANSPILE)return!1;if(!this.requiresTranspilation_){var n=this.createRequiresTranspilation_();this.requiresTranspilation_=n.map,this.transpilationTarget_=this.transpilationTarget_||n.target}if(t in this.requiresTranspilation_)return!!this.requiresTranspilation_[t]||!(!goog.inHtmlDocument_()||"es6"!=e||"noModule"in goog.global.document.createElement("script"));throw Error("Unknown language mode: "+t)},goog.Transpiler.prototype.transpile=function(t,e){return goog.transpile_(t,e,this.transpilationTarget_)},goog.transpiler_=new goog.Transpiler,goog.protectScriptTag_=function(t){return t.replace(/<\/(SCRIPT)/gi,"\\x3c/$1")},goog.DebugLoader_=function(){this.dependencies_={},this.idToPath_={},this.written_={},this.loadingDeps_=[],this.depsToLoad_=[],this.paused_=!1,this.factory_=new goog.DependencyFactory(goog.transpiler_),this.deferredCallbacks_={},this.deferredQueue_=[]},goog.DebugLoader_.prototype.bootstrap=function(t,e){function n(){r&&(goog.global.setTimeout(r,0),r=null)}var r=e;if(t.length){e=[];for(var i=0;i<\/script>';i+="",i=goog.Dependency.defer_?i+"document.getElementById('script-"+r+"').onload = function() {\n goog.Dependency.callback_('"+r+"', this);\n};\n":i+"goog.Dependency.callback_('"+r+"', document.getElementById('script-"+r+"'));",i+="<\/script>",e.write(goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createHTML(i):i)}else{var o=e.createElement("script");o.defer=goog.Dependency.defer_,o.async=!1,n&&(o.nonce=n),goog.DebugLoader_.IS_OLD_IE_?(t.pause(),o.onreadystatechange=function(){"loaded"!=o.readyState&&"complete"!=o.readyState||(t.loaded(),t.resume())}):o.onload=function(){o.onload=null,t.loaded()},o.src=goog.TRUSTED_TYPES_POLICY_?goog.TRUSTED_TYPES_POLICY_.createScriptURL(this.path):this.path,e.head.appendChild(o)}}else goog.logToConsole_("Cannot use default debug loader outside of HTML documents."),"deps.js"==this.relativePath?(goog.logToConsole_("Consider setting CLOSURE_IMPORT_SCRIPT before loading base.js, or setting CLOSURE_NO_DEPS to true."),t.loaded()):t.pause()},goog.Es6ModuleDependency=function(t,e,n,r,i){goog.Dependency.call(this,t,e,n,r,i)},goog.inherits(goog.Es6ModuleDependency,goog.Dependency),goog.Es6ModuleDependency.prototype.load=function(t){if(goog.global.CLOSURE_IMPORT_SCRIPT)goog.global.CLOSURE_IMPORT_SCRIPT(this.path)?t.loaded():t.pause();else if(goog.inHtmlDocument_()){var e=goog.global.document,n=this;if(goog.isDocumentLoading_()){var r=function(t,n){var r="",i=goog.getScriptNonce();i&&(r=' nonce="'+i+'"'),t=n?'\n//. \n//. \n//. \n//. \n//. \n//. \n//. \n//. ```\n//.\n//. To ensure compatibility one should use the dependency versions specified\n//. in __package.json__.\n//.\n//. For convenience one could define aliases for various modules:\n//.\n//. ```javascript\n//. const S = window.sanctuary;\n//. const $ = window.sanctuaryDef;\n//. // ...\n//. ```\n//.\n//. ## API\n\n(function(f) {\n\n 'use strict';\n\n /* istanbul ignore else */\n if (typeof module === 'object' && typeof module.exports === 'object') {\n module.exports = f (require ('sanctuary-def'),\n require ('sanctuary-either'),\n require ('sanctuary-maybe'),\n require ('sanctuary-pair'),\n require ('sanctuary-show'),\n require ('sanctuary-type-classes'),\n require ('sanctuary-type-identifiers'));\n } else if (typeof define === 'function' && define.amd != null) {\n define (['sanctuary-def',\n 'sanctuary-either',\n 'sanctuary-maybe',\n 'sanctuary-pair',\n 'sanctuary-show',\n 'sanctuary-type-classes',\n 'sanctuary-type-identifiers'],\n f);\n } else {\n self.sanctuary = f (self.sanctuaryDef,\n self.sanctuaryEither,\n self.sanctuaryMaybe,\n self.sanctuaryPair,\n self.sanctuaryShow,\n self.sanctuaryTypeClasses,\n self.sanctuaryTypeIdentifiers);\n }\n\n} (function($, Either, Maybe, Pair, show, Z, type) {\n\n 'use strict';\n\n /* istanbul ignore if */\n if (typeof __doctest !== 'undefined') {\n /* eslint-disable no-unused-vars */\n var Descending = __doctest.require ('sanctuary-descending');\n var Nil = (__doctest.require ('./test/internal/List')).Nil;\n var Cons = (__doctest.require ('./test/internal/List')).Cons;\n var Sum = __doctest.require ('./test/internal/Sum');\n var S = (function(S) {\n var S_ = S.create ({\n checkTypes: true,\n env: S.env.concat ([\n (__doctest.require ('./test/internal/List')).Type ($.Unknown),\n Sum.Type\n ])\n });\n S_.env = S.env; // see S.env doctest\n return S_;\n } (require ('.')));\n /* eslint-enable no-unused-vars */\n }\n\n // Left :: a -> Either a b\n var Left = Either.Left;\n\n // Right :: b -> Either a b\n var Right = Either.Right;\n\n // Nothing :: Maybe a\n var Nothing = Maybe.Nothing;\n\n // Just :: a -> Maybe a\n var Just = Maybe.Just;\n\n // B :: (b -> c) -> (a -> b) -> a -> c\n function B(f) {\n return function(g) {\n return function(x) {\n return f (g (x));\n };\n };\n }\n\n // C :: (a -> b -> c) -> b -> a -> c\n function C(f) {\n return function(y) {\n return function(x) {\n return f (x) (y);\n };\n };\n }\n\n // get_ :: String -> a -> Maybe b\n function get_(key) {\n return B (function(obj) { return key in obj ? Just (obj[key]) : Nothing; })\n (toObject);\n }\n\n // invoke0 :: String -> a -> b\n function invoke0(name) {\n return function(target) {\n return target[name] ();\n };\n }\n\n // invoke1 :: String -> a -> b -> c\n function invoke1(name) {\n return function(x) {\n return function(target) {\n return target[name] (x);\n };\n };\n }\n\n // toObject :: a -> Object\n function toObject(x) {\n return x == null ? Object.create (null) : Object (x);\n }\n\n // :: Type\n var a = $.TypeVariable ('a');\n var b = $.TypeVariable ('b');\n var c = $.TypeVariable ('c');\n var d = $.TypeVariable ('d');\n var e = $.TypeVariable ('e');\n var g = $.TypeVariable ('g');\n var r = $.TypeVariable ('r');\n\n // :: Type -> Type\n var f = $.UnaryTypeVariable ('f');\n var m = $.UnaryTypeVariable ('m');\n var t = $.UnaryTypeVariable ('t');\n var w = $.UnaryTypeVariable ('w');\n\n // :: Type -> Type -> Type\n var p = $.BinaryTypeVariable ('p');\n var s = $.BinaryTypeVariable ('s');\n\n // TypeRep :: Type -> Type\n var TypeRep = $.UnaryType\n ('TypeRep')\n ('https://github.com/fantasyland/fantasy-land#type-representatives')\n ([])\n (function(x) {\n return $.test ([]) ($.AnyFunction) (x) ||\n x != null && $.test ([]) ($.String) (x['@@type']);\n })\n (K ([]));\n\n // Options :: Type\n var Options = $.RecordType ({checkTypes: $.Boolean, env: $.Array ($.Any)});\n\n var _ = {};\n\n //. ### Configure\n\n //# create :: { checkTypes :: Boolean, env :: Array Type } -> Module\n //.\n //. Takes an options record and returns a Sanctuary module. `checkTypes`\n //. specifies whether to enable type checking. The module's polymorphic\n //. functions (such as [`I`](#I)) require each value associated with a\n //. type variable to be a member of at least one type in the environment.\n //.\n //. A well-typed application of a Sanctuary function will produce the same\n //. result regardless of whether type checking is enabled. If type checking\n //. is enabled, a badly typed application will produce an exception with a\n //. descriptive error message.\n //.\n //. The following snippet demonstrates defining a custom type and using\n //. `create` to produce a Sanctuary module that is aware of that type:\n //.\n //. ```javascript\n //. const {create, env} = require ('sanctuary');\n //. const $ = require ('sanctuary-def');\n //. const type = require ('sanctuary-type-identifiers');\n //.\n //. // Identity :: a -> Identity a\n //. const Identity = x => {\n //. const identity = Object.create (Identity$prototype);\n //. identity.value = x;\n //. return identity;\n //. };\n //.\n //. Identity['@@type'] = 'my-package/Identity@1';\n //.\n //. const Identity$prototype = {\n //. 'constructor': Identity,\n //. '@@show': function() { return `Identity (${S.show (this.value)})`; },\n //. 'fantasy-land/map': function(f) { return Identity (f (this.value)); },\n //. };\n //.\n //. // IdentityType :: Type -> Type\n //. const IdentityType = $.UnaryType\n //. ('Identity')\n //. ('http://example.com/my-package#Identity')\n //. ([])\n //. (x => type (x) === Identity['@@type'])\n //. (identity => [identity.value]);\n //.\n //. const S = create ({\n //. checkTypes: process.env.NODE_ENV !== 'production',\n //. env: env.concat ([IdentityType ($.Unknown)]),\n //. });\n //.\n //. S.map (S.sub (1)) (Identity (43));\n //. // => Identity (42)\n //. ```\n //.\n //. See also [`env`](#env).\n function create(opts) {\n var def = $.create (opts);\n var S = {\n env: opts.env,\n is: def ('is') ({}) ([$.Type, $.Any, $.Boolean]) ($.test (opts.env)),\n Maybe: Maybe,\n Nothing: Nothing,\n Either: Either\n };\n (Object.keys (_)).forEach (function(name) {\n S[name] = def (name) (_[name].consts) (_[name].types) (_[name].impl);\n });\n S.unchecked = opts.checkTypes ? create ({checkTypes: false, env: opts.env})\n : S;\n return S;\n }\n _.create = {\n consts: {},\n types: [Options, $.Object],\n impl: create\n };\n\n //# env :: Array Type\n //.\n //. The Sanctuary module's environment (`(S.create ({checkTypes, env})).env`\n //. is a reference to `env`). Useful in conjunction with [`create`](#create).\n //.\n //. ```javascript\n //. > S.env\n //. [ $.AnyFunction,\n //. . $.Arguments,\n //. . $.Array ($.Unknown),\n //. . $.Array2 ($.Unknown) ($.Unknown),\n //. . $.Boolean,\n //. . $.Date,\n //. . $.Descending ($.Unknown),\n //. . $.Either ($.Unknown) ($.Unknown),\n //. . $.Error,\n //. . $.Fn ($.Unknown) ($.Unknown),\n //. . $.HtmlElement,\n //. . $.Identity ($.Unknown),\n //. . $.Maybe ($.Unknown),\n //. . $.Null,\n //. . $.Number,\n //. . $.Object,\n //. . $.Pair ($.Unknown) ($.Unknown),\n //. . $.RegExp,\n //. . $.StrMap ($.Unknown),\n //. . $.String,\n //. . $.Symbol,\n //. . $.Type,\n //. . $.TypeClass,\n //. . $.Undefined ]\n //. ```\n\n //# unchecked :: Module\n //.\n //. A complete Sanctuary module that performs no type checking. This is\n //. useful as it permits operations that Sanctuary's type checking would\n //. disallow, such as mapping over an object with heterogeneous values.\n //.\n //. See also [`create`](#create).\n //.\n //. ```javascript\n //. > S.unchecked.map (S.show) ({x: 'foo', y: true, z: 42})\n //. {x: '\"foo\"', y: 'true', z: '42'}\n //. ```\n //.\n //. Opting out of type checking may cause type errors to go unnoticed.\n //.\n //. ```javascript\n //. > S.unchecked.add (2) ('2')\n //. '22'\n //. ```\n\n //. ### Classify\n\n //# type :: Any -> { namespace :: Maybe String, name :: String, version :: NonNegativeInteger }\n //.\n //. Returns the result of parsing the [type identifier][] of the given value.\n //.\n //. ```javascript\n //. > S.type (S.Just (42))\n //. {namespace: Just ('sanctuary-maybe'), name: 'Maybe', version: 1}\n //.\n //. > S.type ([1, 2, 3])\n //. {namespace: Nothing, name: 'Array', version: 0}\n //. ```\n function type_(x) {\n var r = type.parse (type (x));\n r.namespace = Z.reject (equals (null), Just (r.namespace));\n return r;\n }\n _.type = {\n consts: {},\n types: [$.Any,\n $.RecordType ({namespace: $.Maybe ($.String),\n name: $.String,\n version: $.NonNegativeInteger})],\n impl: type_\n };\n\n //# is :: Type -> Any -> Boolean\n //.\n //. Returns `true` [iff][] the given value is a member of the specified type.\n //. See [`$.test`][] for details.\n //.\n //. ```javascript\n //. > S.is ($.Array ($.Integer)) ([1, 2, 3])\n //. true\n //.\n //. > S.is ($.Array ($.Integer)) ([1, 2, 3.14])\n //. false\n //. ```\n\n //. ### Showable\n\n //# show :: Any -> String\n //.\n //. Alias of [`show`][].\n //.\n //. ```javascript\n //. > S.show (-0)\n //. '-0'\n //.\n //. > S.show (['foo', 'bar', 'baz'])\n //. '[\"foo\", \"bar\", \"baz\"]'\n //.\n //. > S.show ({x: 1, y: 2, z: 3})\n //. '{\"x\": 1, \"y\": 2, \"z\": 3}'\n //.\n //. > S.show (S.Left (S.Right (S.Just (S.Nothing))))\n //. 'Left (Right (Just (Nothing)))'\n //. ```\n _.show = {\n consts: {},\n types: [$.Any, $.String],\n impl: show\n };\n\n //. ### Fantasy Land\n //.\n //. Sanctuary is compatible with the [Fantasy Land][] specification.\n\n //# equals :: Setoid a => a -> a -> Boolean\n //.\n //. Curried version of [`Z.equals`][] that requires two arguments of the\n //. same type.\n //.\n //. To compare values of different types first use [`create`](#create) to\n //. create a Sanctuary module with type checking disabled, then use that\n //. module's `equals` function.\n //.\n //. ```javascript\n //. > S.equals (0) (-0)\n //. true\n //.\n //. > S.equals (NaN) (NaN)\n //. true\n //.\n //. > S.equals (S.Just ([1, 2, 3])) (S.Just ([1, 2, 3]))\n //. true\n //.\n //. > S.equals (S.Just ([1, 2, 3])) (S.Just ([1, 2, 4]))\n //. false\n //. ```\n function equals(x) {\n return function(y) {\n return Z.equals (x, y);\n };\n }\n _.equals = {\n consts: {a: [Z.Setoid]},\n types: [a, a, $.Boolean],\n impl: equals\n };\n\n //# lt :: Ord a => a -> a -> Boolean\n //.\n //. Returns `true` [iff][] the *second* argument is less than the first\n //. according to [`Z.lt`][].\n //.\n //. ```javascript\n //. > S.filter (S.lt (3)) ([1, 2, 3, 4, 5])\n //. [1, 2]\n //. ```\n function lt(y) {\n return function(x) {\n return Z.lt (x, y);\n };\n }\n _.lt = {\n consts: {a: [Z.Ord]},\n types: [a, a, $.Boolean],\n impl: lt\n };\n\n //# lte :: Ord a => a -> a -> Boolean\n //.\n //. Returns `true` [iff][] the *second* argument is less than or equal to\n //. the first according to [`Z.lte`][].\n //.\n //. ```javascript\n //. > S.filter (S.lte (3)) ([1, 2, 3, 4, 5])\n //. [1, 2, 3]\n //. ```\n function lte(y) {\n return function(x) {\n return Z.lte (x, y);\n };\n }\n _.lte = {\n consts: {a: [Z.Ord]},\n types: [a, a, $.Boolean],\n impl: lte\n };\n\n //# gt :: Ord a => a -> a -> Boolean\n //.\n //. Returns `true` [iff][] the *second* argument is greater than the first\n //. according to [`Z.gt`][].\n //.\n //. ```javascript\n //. > S.filter (S.gt (3)) ([1, 2, 3, 4, 5])\n //. [4, 5]\n //. ```\n function gt(y) {\n return function(x) {\n return Z.gt (x, y);\n };\n }\n _.gt = {\n consts: {a: [Z.Ord]},\n types: [a, a, $.Boolean],\n impl: gt\n };\n\n //# gte :: Ord a => a -> a -> Boolean\n //.\n //. Returns `true` [iff][] the *second* argument is greater than or equal\n //. to the first according to [`Z.gte`][].\n //.\n //. ```javascript\n //. > S.filter (S.gte (3)) ([1, 2, 3, 4, 5])\n //. [3, 4, 5]\n //. ```\n function gte(y) {\n return function(x) {\n return Z.gte (x, y);\n };\n }\n _.gte = {\n consts: {a: [Z.Ord]},\n types: [a, a, $.Boolean],\n impl: gte\n };\n\n //# min :: Ord a => a -> a -> a\n //.\n //. Returns the smaller of its two arguments (according to [`Z.lte`][]).\n //.\n //. See also [`max`](#max).\n //.\n //. ```javascript\n //. > S.min (10) (2)\n //. 2\n //.\n //. > S.min (new Date ('1999-12-31')) (new Date ('2000-01-01'))\n //. new Date ('1999-12-31')\n //.\n //. > S.min ('10') ('2')\n //. '10'\n //. ```\n _.min = {\n consts: {a: [Z.Ord]},\n types: [a, a, a],\n impl: curry2 (Z.min)\n };\n\n //# max :: Ord a => a -> a -> a\n //.\n //. Returns the larger of its two arguments (according to [`Z.lte`][]).\n //.\n //. See also [`min`](#min).\n //.\n //. ```javascript\n //. > S.max (10) (2)\n //. 10\n //.\n //. > S.max (new Date ('1999-12-31')) (new Date ('2000-01-01'))\n //. new Date ('2000-01-01')\n //.\n //. > S.max ('10') ('2')\n //. '2'\n //. ```\n _.max = {\n consts: {a: [Z.Ord]},\n types: [a, a, a],\n impl: curry2 (Z.max)\n };\n\n //# clamp :: Ord a => a -> a -> a -> a\n //.\n //. Takes a lower bound, an upper bound, and a value of the same type.\n //. Returns the value if it is within the bounds; the nearer bound otherwise.\n //.\n //. See also [`min`](#min) and [`max`](#max).\n //.\n //. ```javascript\n //. > S.clamp (0) (100) (42)\n //. 42\n //.\n //. > S.clamp (0) (100) (-1)\n //. 0\n //.\n //. > S.clamp ('A') ('Z') ('~')\n //. 'Z'\n //. ```\n _.clamp = {\n consts: {a: [Z.Ord]},\n types: [a, a, a, a],\n impl: curry3 (Z.clamp)\n };\n\n //# id :: Category c => TypeRep c -> c\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.id`][].\n //.\n //. ```javascript\n //. > S.id (Function) (42)\n //. 42\n //. ```\n _.id = {\n consts: {c: [Z.Category]},\n types: [TypeRep (c), c],\n impl: Z.id\n };\n\n //# concat :: Semigroup a => a -> a -> a\n //.\n //. Curried version of [`Z.concat`][].\n //.\n //. ```javascript\n //. > S.concat ('abc') ('def')\n //. 'abcdef'\n //.\n //. > S.concat ([1, 2, 3]) ([4, 5, 6])\n //. [1, 2, 3, 4, 5, 6]\n //.\n //. > S.concat ({x: 1, y: 2}) ({y: 3, z: 4})\n //. {x: 1, y: 3, z: 4}\n //.\n //. > S.concat (S.Just ([1, 2, 3])) (S.Just ([4, 5, 6]))\n //. Just ([1, 2, 3, 4, 5, 6])\n //.\n //. > S.concat (Sum (18)) (Sum (24))\n //. Sum (42)\n //. ```\n _.concat = {\n consts: {a: [Z.Semigroup]},\n types: [a, a, a],\n impl: curry2 (Z.concat)\n };\n\n //# empty :: Monoid a => TypeRep a -> a\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.empty`][].\n //.\n //. ```javascript\n //. > S.empty (String)\n //. ''\n //.\n //. > S.empty (Array)\n //. []\n //.\n //. > S.empty (Object)\n //. {}\n //.\n //. > S.empty (Sum)\n //. Sum (0)\n //. ```\n _.empty = {\n consts: {a: [Z.Monoid]},\n types: [TypeRep (a), a],\n impl: Z.empty\n };\n\n //# invert :: Group g => g -> g\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.invert`][].\n //.\n //. ```javascript\n //. > S.invert (Sum (5))\n //. Sum (-5)\n //. ```\n _.invert = {\n consts: {g: [Z.Group]},\n types: [g, g],\n impl: Z.invert\n };\n\n //# filter :: Filterable f => (a -> Boolean) -> f a -> f a\n //.\n //. Curried version of [`Z.filter`][]. Discards every element that does not\n //. satisfy the predicate.\n //.\n //. See also [`reject`](#reject).\n //.\n //. ```javascript\n //. > S.filter (S.odd) ([1, 2, 3])\n //. [1, 3]\n //.\n //. > S.filter (S.odd) ({x: 1, y: 2, z: 3})\n //. {x: 1, z: 3}\n //.\n //. > S.filter (S.odd) (S.Nothing)\n //. Nothing\n //.\n //. > S.filter (S.odd) (S.Just (0))\n //. Nothing\n //.\n //. > S.filter (S.odd) (S.Just (1))\n //. Just (1)\n //. ```\n function filter(pred) {\n return function(filterable) {\n return Z.filter (pred, filterable);\n };\n }\n _.filter = {\n consts: {f: [Z.Filterable]},\n types: [$.Predicate (a), f (a), f (a)],\n impl: filter\n };\n\n //# reject :: Filterable f => (a -> Boolean) -> f a -> f a\n //.\n //. Curried version of [`Z.reject`][]. Discards every element that satisfies\n //. the predicate.\n //.\n //. See also [`filter`](#filter).\n //.\n //. ```javascript\n //. > S.reject (S.odd) ([1, 2, 3])\n //. [2]\n //.\n //. > S.reject (S.odd) ({x: 1, y: 2, z: 3})\n //. {y: 2}\n //.\n //. > S.reject (S.odd) (S.Nothing)\n //. Nothing\n //.\n //. > S.reject (S.odd) (S.Just (0))\n //. Just (0)\n //.\n //. > S.reject (S.odd) (S.Just (1))\n //. Nothing\n //. ```\n function reject(pred) {\n return function(filterable) {\n return Z.reject (pred, filterable);\n };\n }\n _.reject = {\n consts: {f: [Z.Filterable]},\n types: [$.Predicate (a), f (a), f (a)],\n impl: reject\n };\n\n //# map :: Functor f => (a -> b) -> f a -> f b\n //.\n //. Curried version of [`Z.map`][].\n //.\n //. ```javascript\n //. > S.map (Math.sqrt) ([1, 4, 9])\n //. [1, 2, 3]\n //.\n //. > S.map (Math.sqrt) ({x: 1, y: 4, z: 9})\n //. {x: 1, y: 2, z: 3}\n //.\n //. > S.map (Math.sqrt) (S.Just (9))\n //. Just (3)\n //.\n //. > S.map (Math.sqrt) (S.Right (9))\n //. Right (3)\n //.\n //. > S.map (Math.sqrt) (S.Pair (99980001) (99980001))\n //. Pair (99980001) (9999)\n //. ```\n //.\n //. Replacing `Functor f => f` with `Function x` produces the B combinator\n //. from combinatory logic (i.e. [`compose`](#compose)):\n //.\n //. Functor f => (a -> b) -> f a -> f b\n //. (a -> b) -> Function x a -> Function x b\n //. (a -> c) -> Function x a -> Function x c\n //. (b -> c) -> Function x b -> Function x c\n //. (b -> c) -> Function a b -> Function a c\n //. (b -> c) -> (a -> b) -> (a -> c)\n //.\n //. ```javascript\n //. > S.map (Math.sqrt) (S.add (1)) (99)\n //. 10\n //. ```\n function map(f) {\n return function(functor) {\n return Z.map (f, functor);\n };\n }\n _.map = {\n consts: {f: [Z.Functor]},\n types: [$.Fn (a) (b), f (a), f (b)],\n impl: map\n };\n\n //# flip :: Functor f => f (a -> b) -> a -> f b\n //.\n //. Curried version of [`Z.flip`][]. Maps over the given functions, applying\n //. each to the given value.\n //.\n //. Replacing `Functor f => f` with `Function x` produces the C combinator\n //. from combinatory logic:\n //.\n //. Functor f => f (a -> b) -> a -> f b\n //. Function x (a -> b) -> a -> Function x b\n //. Function x (a -> c) -> a -> Function x c\n //. Function x (b -> c) -> b -> Function x c\n //. Function a (b -> c) -> b -> Function a c\n //. (a -> b -> c) -> b -> a -> c\n //.\n //. ```javascript\n //. > S.flip (S.concat) ('!') ('foo')\n //. 'foo!'\n //.\n //. > S.flip ([Math.floor, Math.ceil]) (1.5)\n //. [1, 2]\n //.\n //. > S.flip ({floor: Math.floor, ceil: Math.ceil}) (1.5)\n //. {floor: 1, ceil: 2}\n //.\n //. > S.flip (Cons (Math.floor) (Cons (Math.ceil) (Nil))) (1.5)\n //. Cons (1) (Cons (2) (Nil))\n //. ```\n _.flip = {\n consts: {f: [Z.Functor]},\n types: [f ($.Fn (a) (b)), a, f (b)],\n impl: curry2 (Z.flip)\n };\n\n //# bimap :: Bifunctor f => (a -> b) -> (c -> d) -> f a c -> f b d\n //.\n //. Curried version of [`Z.bimap`][].\n //.\n //. ```javascript\n //. > S.bimap (S.toUpper) (Math.sqrt) (S.Pair ('foo') (64))\n //. Pair ('FOO') (8)\n //.\n //. > S.bimap (S.toUpper) (Math.sqrt) (S.Left ('foo'))\n //. Left ('FOO')\n //.\n //. > S.bimap (S.toUpper) (Math.sqrt) (S.Right (64))\n //. Right (8)\n //. ```\n _.bimap = {\n consts: {p: [Z.Bifunctor]},\n types: [$.Fn (a) (b), $.Fn (c) (d), p (a) (c), p (b) (d)],\n impl: curry3 (Z.bimap)\n };\n\n //# mapLeft :: Bifunctor f => (a -> b) -> f a c -> f b c\n //.\n //. Curried version of [`Z.mapLeft`][]. Maps the given function over the left\n //. side of a Bifunctor.\n //.\n //. ```javascript\n //. > S.mapLeft (S.toUpper) (S.Pair ('foo') (64))\n //. Pair ('FOO') (64)\n //.\n //. > S.mapLeft (S.toUpper) (S.Left ('foo'))\n //. Left ('FOO')\n //.\n //. > S.mapLeft (S.toUpper) (S.Right (64))\n //. Right (64)\n //. ```\n _.mapLeft = {\n consts: {p: [Z.Bifunctor]},\n types: [$.Fn (a) (b), p (a) (c), p (b) (c)],\n impl: curry2 (Z.mapLeft)\n };\n\n //# promap :: Profunctor p => (a -> b) -> (c -> d) -> p b c -> p a d\n //.\n //. Curried version of [`Z.promap`][].\n //.\n //. ```javascript\n //. > S.promap (Math.abs) (S.add (1)) (Math.sqrt) (-100)\n //. 11\n //. ```\n _.promap = {\n consts: {p: [Z.Profunctor]},\n types: [$.Fn (a) (b), $.Fn (c) (d), p (b) (c), p (a) (d)],\n impl: curry3 (Z.promap)\n };\n\n //# alt :: Alt f => f a -> f a -> f a\n //.\n //. Curried version of [`Z.alt`][] with arguments flipped to facilitate\n //. partial application.\n //.\n //. ```javascript\n //. > S.alt (S.Just ('default')) (S.Nothing)\n //. Just ('default')\n //.\n //. > S.alt (S.Just ('default')) (S.Just ('hello'))\n //. Just ('hello')\n //.\n //. > S.alt (S.Right (0)) (S.Left ('X'))\n //. Right (0)\n //.\n //. > S.alt (S.Right (0)) (S.Right (1))\n //. Right (1)\n //. ```\n function alt(y) {\n return function(x) {\n return Z.alt (x, y);\n };\n }\n _.alt = {\n consts: {f: [Z.Alt]},\n types: [f (a), f (a), f (a)],\n impl: alt\n };\n\n //# zero :: Plus f => TypeRep f -> f a\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.zero`][].\n //.\n //. ```javascript\n //. > S.zero (Array)\n //. []\n //.\n //. > S.zero (Object)\n //. {}\n //.\n //. > S.zero (S.Maybe)\n //. Nothing\n //. ```\n _.zero = {\n consts: {f: [Z.Plus]},\n types: [TypeRep (f (a)), f (a)],\n impl: Z.zero\n };\n\n //# reduce :: Foldable f => (b -> a -> b) -> b -> f a -> b\n //.\n //. Takes a curried binary function, an initial value, and a [Foldable][],\n //. and applies the function to the initial value and the Foldable's first\n //. value, then applies the function to the result of the previous\n //. application and the Foldable's second value. Repeats this process\n //. until each of the Foldable's values has been used. Returns the initial\n //. value if the Foldable is empty; the result of the final application\n //. otherwise.\n //.\n //. ```javascript\n //. > S.reduce (S.add) (0) ([1, 2, 3, 4, 5])\n //. 15\n //.\n //. > S.reduce (xs => x => S.prepend (x) (xs)) ([]) ([1, 2, 3, 4, 5])\n //. [5, 4, 3, 2, 1]\n //. ```\n function reduce(f) {\n return function(initial) {\n return function(foldable) {\n return Z.reduce (function(y, x) { return f (y) (x); },\n initial,\n foldable);\n };\n };\n }\n _.reduce = {\n consts: {f: [Z.Foldable]},\n types: [$.Fn (a) ($.Fn (b) (a)), a, f (b), a],\n impl: reduce\n };\n\n //# traverse :: (Applicative f, Traversable t) => TypeRep f -> (a -> f b) -> t a -> f (t b)\n //.\n //. Curried version of [`Z.traverse`][].\n //.\n //. ```javascript\n //. > S.traverse (Array) (S.words) (S.Just ('foo bar baz'))\n //. [Just ('foo'), Just ('bar'), Just ('baz')]\n //.\n //. > S.traverse (Array) (S.words) (S.Nothing)\n //. [Nothing]\n //.\n //. > S.traverse (S.Maybe) (S.parseInt (16)) (['A', 'B', 'C'])\n //. Just ([10, 11, 12])\n //.\n //. > S.traverse (S.Maybe) (S.parseInt (16)) (['A', 'B', 'C', 'X'])\n //. Nothing\n //.\n //. > S.traverse (S.Maybe) (S.parseInt (16)) ({a: 'A', b: 'B', c: 'C'})\n //. Just ({a: 10, b: 11, c: 12})\n //.\n //. > S.traverse (S.Maybe) (S.parseInt (16)) ({a: 'A', b: 'B', c: 'C', x: 'X'})\n //. Nothing\n //. ```\n _.traverse = {\n consts: {f: [Z.Applicative], t: [Z.Traversable]},\n types: [TypeRep (f (b)), $.Fn (a) (f (b)), t (a), f (t (b))],\n impl: curry3 (Z.traverse)\n };\n\n //# sequence :: (Applicative f, Traversable t) => TypeRep f -> t (f a) -> f (t a)\n //.\n //. Curried version of [`Z.sequence`][]. Inverts the given `t (f a)`\n //. to produce an `f (t a)`.\n //.\n //. ```javascript\n //. > S.sequence (Array) (S.Just ([1, 2, 3]))\n //. [Just (1), Just (2), Just (3)]\n //.\n //. > S.sequence (S.Maybe) ([S.Just (1), S.Just (2), S.Just (3)])\n //. Just ([1, 2, 3])\n //.\n //. > S.sequence (S.Maybe) ([S.Just (1), S.Just (2), S.Nothing])\n //. Nothing\n //.\n //. > S.sequence (S.Maybe) ({a: S.Just (1), b: S.Just (2), c: S.Just (3)})\n //. Just ({a: 1, b: 2, c: 3})\n //.\n //. > S.sequence (S.Maybe) ({a: S.Just (1), b: S.Just (2), c: S.Nothing})\n //. Nothing\n //. ```\n _.sequence = {\n consts: {f: [Z.Applicative], t: [Z.Traversable]},\n types: [TypeRep (f (a)), t (f (a)), f (t (a))],\n impl: curry2 (Z.sequence)\n };\n\n //# ap :: Apply f => f (a -> b) -> f a -> f b\n //.\n //. Curried version of [`Z.ap`][].\n //.\n //. ```javascript\n //. > S.ap ([Math.sqrt, x => x * x]) ([1, 4, 9, 16, 25])\n //. [1, 2, 3, 4, 5, 1, 16, 81, 256, 625]\n //.\n //. > S.ap ({x: Math.sqrt, y: S.add (1), z: S.sub (1)}) ({w: 4, x: 4, y: 4})\n //. {x: 2, y: 5}\n //.\n //. > S.ap (S.Just (Math.sqrt)) (S.Just (64))\n //. Just (8)\n //. ```\n //.\n //. Replacing `Apply f => f` with `Function x` produces the S combinator\n //. from combinatory logic:\n //.\n //. Apply f => f (a -> b) -> f a -> f b\n //. Function x (a -> b) -> Function x a -> Function x b\n //. Function x (a -> c) -> Function x a -> Function x c\n //. Function x (b -> c) -> Function x b -> Function x c\n //. Function a (b -> c) -> Function a b -> Function a c\n //. (a -> b -> c) -> (a -> b) -> (a -> c)\n //.\n //. ```javascript\n //. > S.ap (s => n => s.slice (0, n)) (s => Math.ceil (s.length / 2)) ('Haskell')\n //. 'Hask'\n //. ```\n _.ap = {\n consts: {f: [Z.Apply]},\n types: [f ($.Fn (a) (b)), f (a), f (b)],\n impl: curry2 (Z.ap)\n };\n\n //# lift2 :: Apply f => (a -> b -> c) -> f a -> f b -> f c\n //.\n //. Promotes a curried binary function to a function that operates on two\n //. [Apply][]s.\n //.\n //. ```javascript\n //. > S.lift2 (S.add) (S.Just (2)) (S.Just (3))\n //. Just (5)\n //.\n //. > S.lift2 (S.add) (S.Just (2)) (S.Nothing)\n //. Nothing\n //.\n //. > S.lift2 (S.and) (S.Just (true)) (S.Just (true))\n //. Just (true)\n //.\n //. > S.lift2 (S.and) (S.Just (true)) (S.Just (false))\n //. Just (false)\n //. ```\n _.lift2 = {\n consts: {f: [Z.Apply]},\n types: [$.Fn (a) ($.Fn (b) (c)), f (a), f (b), f (c)],\n impl: curry3 (Z.lift2)\n };\n\n //# lift3 :: Apply f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d\n //.\n //. Promotes a curried ternary function to a function that operates on three\n //. [Apply][]s.\n //.\n //. ```javascript\n //. > S.lift3 (S.reduce) (S.Just (S.add)) (S.Just (0)) (S.Just ([1, 2, 3]))\n //. Just (6)\n //.\n //. > S.lift3 (S.reduce) (S.Just (S.add)) (S.Just (0)) (S.Nothing)\n //. Nothing\n //. ```\n _.lift3 = {\n consts: {f: [Z.Apply]},\n types: [$.Fn (a) ($.Fn (b) ($.Fn (c) (d))), f (a), f (b), f (c), f (d)],\n impl: curry4 (Z.lift3)\n };\n\n //# apFirst :: Apply f => f a -> f b -> f a\n //.\n //. Curried version of [`Z.apFirst`][]. Combines two effectful actions,\n //. keeping only the result of the first. Equivalent to Haskell's `(<*)`\n //. function.\n //.\n //. See also [`apSecond`](#apSecond).\n //.\n //. ```javascript\n //. > S.apFirst ([1, 2]) ([3, 4])\n //. [1, 1, 2, 2]\n //.\n //. > S.apFirst (S.Just (1)) (S.Just (2))\n //. Just (1)\n //. ```\n _.apFirst = {\n consts: {f: [Z.Apply]},\n types: [f (a), f (b), f (a)],\n impl: curry2 (Z.apFirst)\n };\n\n //# apSecond :: Apply f => f a -> f b -> f b\n //.\n //. Curried version of [`Z.apSecond`][]. Combines two effectful actions,\n //. keeping only the result of the second. Equivalent to Haskell's `(*>)`\n //. function.\n //.\n //. See also [`apFirst`](#apFirst).\n //.\n //. ```javascript\n //. > S.apSecond ([1, 2]) ([3, 4])\n //. [3, 4, 3, 4]\n //.\n //. > S.apSecond (S.Just (1)) (S.Just (2))\n //. Just (2)\n //. ```\n _.apSecond = {\n consts: {f: [Z.Apply]},\n types: [f (a), f (b), f (b)],\n impl: curry2 (Z.apSecond)\n };\n\n //# of :: Applicative f => TypeRep f -> a -> f a\n //.\n //. Curried version of [`Z.of`][].\n //.\n //. ```javascript\n //. > S.of (Array) (42)\n //. [42]\n //.\n //. > S.of (Function) (42) (null)\n //. 42\n //.\n //. > S.of (S.Maybe) (42)\n //. Just (42)\n //.\n //. > S.of (S.Either) (42)\n //. Right (42)\n //. ```\n function of(typeRep) {\n return function(x) {\n return Z.of (typeRep, x);\n };\n }\n _.of = {\n consts: {f: [Z.Applicative]},\n types: [TypeRep (f (a)), a, f (a)],\n impl: of\n };\n\n //# chain :: Chain m => (a -> m b) -> m a -> m b\n //.\n //. Curried version of [`Z.chain`][].\n //.\n //. ```javascript\n //. > S.chain (x => [x, x]) ([1, 2, 3])\n //. [1, 1, 2, 2, 3, 3]\n //.\n //. > S.chain (n => s => s.slice (0, n)) (s => Math.ceil (s.length / 2)) ('slice')\n //. 'sli'\n //.\n //. > S.chain (S.parseInt (10)) (S.Just ('123'))\n //. Just (123)\n //.\n //. > S.chain (S.parseInt (10)) (S.Just ('XXX'))\n //. Nothing\n //. ```\n _.chain = {\n consts: {m: [Z.Chain]},\n types: [$.Fn (a) (m (b)), m (a), m (b)],\n impl: curry2 (Z.chain)\n };\n\n //# join :: Chain m => m (m a) -> m a\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.join`][].\n //. Removes one level of nesting from a nested monadic structure.\n //.\n //. ```javascript\n //. > S.join ([[1], [2], [3]])\n //. [1, 2, 3]\n //.\n //. > S.join ([[[1, 2, 3]]])\n //. [[1, 2, 3]]\n //.\n //. > S.join (S.Just (S.Just (1)))\n //. Just (1)\n //.\n //. > S.join (S.Pair ('foo') (S.Pair ('bar') ('baz')))\n //. Pair ('foobar') ('baz')\n //. ```\n //.\n //. Replacing `Chain m => m` with `Function x` produces the W combinator\n //. from combinatory logic:\n //.\n //. Chain m => m (m a) -> m a\n //. Function x (Function x a) -> Function x a\n //. (x -> x -> a) -> (x -> a)\n //.\n //. ```javascript\n //. > S.join (S.concat) ('abc')\n //. 'abcabc'\n //. ```\n _.join = {\n consts: {m: [Z.Chain]},\n types: [m (m (a)), m (a)],\n impl: Z.join\n };\n\n //# chainRec :: ChainRec m => TypeRep m -> (a -> m (Either a b)) -> a -> m b\n //.\n //. Performs a [`chain`](#chain)-like computation with constant stack usage.\n //. Similar to [`Z.chainRec`][], but curried and more convenient due to the\n //. use of the Either type to indicate completion (via a Right).\n //.\n //. ```javascript\n //. > S.chainRec (Array)\n //. . (s => s.length === 2 ? S.map (S.Right) ([s + '!', s + '?'])\n //. . : S.map (S.Left) ([s + 'o', s + 'n']))\n //. . ('')\n //. ['oo!', 'oo?', 'on!', 'on?', 'no!', 'no?', 'nn!', 'nn?']\n //. ```\n function chainRec(typeRep) {\n return function(f) {\n return function(x) {\n return Z.chainRec (typeRep, step, x);\n };\n function step(next, done, x) {\n return Z.map (either (next) (done), f (x));\n }\n };\n }\n _.chainRec = {\n consts: {m: [Z.ChainRec]},\n types: [TypeRep (m (b)), $.Fn (a) (m ($.Either (a) (b))), a, m (b)],\n impl: chainRec\n };\n\n //# extend :: Extend w => (w a -> b) -> w a -> w b\n //.\n //. Curried version of [`Z.extend`][].\n //.\n //. ```javascript\n //. > S.extend (S.joinWith ('')) (['x', 'y', 'z'])\n //. ['xyz', 'yz', 'z']\n //.\n //. > S.extend (f => f ([3, 4])) (S.reverse) ([1, 2])\n //. [4, 3, 2, 1]\n //. ```\n _.extend = {\n consts: {w: [Z.Extend]},\n types: [$.Fn (w (a)) (b), w (a), w (b)],\n impl: curry2 (Z.extend)\n };\n\n //# duplicate :: Extend w => w a -> w (w a)\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.duplicate`][].\n //. Adds one level of nesting to a comonadic structure.\n //.\n //. ```javascript\n //. > S.duplicate (S.Just (1))\n //. Just (Just (1))\n //.\n //. > S.duplicate ([1])\n //. [[1]]\n //.\n //. > S.duplicate ([1, 2, 3])\n //. [[1, 2, 3], [2, 3], [3]]\n //.\n //. > S.duplicate (S.reverse) ([1, 2]) ([3, 4])\n //. [4, 3, 2, 1]\n //. ```\n _.duplicate = {\n consts: {w: [Z.Extend]},\n types: [w (a), w (w (a))],\n impl: Z.duplicate\n };\n\n //# extract :: Comonad w => w a -> a\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.extract`][].\n //.\n //. ```javascript\n //. > S.extract (S.Pair ('foo') ('bar'))\n //. 'bar'\n //. ```\n _.extract = {\n consts: {w: [Z.Comonad]},\n types: [w (a), a],\n impl: Z.extract\n };\n\n //# contramap :: Contravariant f => (b -> a) -> f a -> f b\n //.\n //. [Type-safe][sanctuary-def] version of [`Z.contramap`][].\n //.\n //. ```javascript\n //. > S.contramap (s => s.length) (Math.sqrt) ('Sanctuary')\n //. 3\n //. ```\n _.contramap = {\n consts: {f: [Z.Contravariant]},\n types: [$.Fn (b) (a), f (a), f (b)],\n impl: curry2 (Z.contramap)\n };\n\n //. ### Combinator\n\n //# I :: a -> a\n //.\n //. The I combinator. Returns its argument. Equivalent to Haskell's `id`\n //. function.\n //.\n //. ```javascript\n //. > S.I ('foo')\n //. 'foo'\n //. ```\n function I(x) {\n return x;\n }\n _.I = {\n consts: {},\n types: [a, a],\n impl: I\n };\n\n //# K :: a -> b -> a\n //.\n //. The K combinator. Takes two values and returns the first. Equivalent to\n //. Haskell's `const` function.\n //.\n //. ```javascript\n //. > S.K ('foo') ('bar')\n //. 'foo'\n //.\n //. > S.map (S.K (42)) (S.range (0) (5))\n //. [42, 42, 42, 42, 42]\n //. ```\n function K(x) {\n return function(y) {\n return x;\n };\n }\n _.K = {\n consts: {},\n types: [a, b, a],\n impl: K\n };\n\n //# T :: a -> (a -> b) -> b\n //.\n //. The T ([thrush][]) combinator. Takes a value and a function, and returns\n //. the result of applying the function to the value. Equivalent to Haskell's\n //. `(&)` function.\n //.\n //. ```javascript\n //. > S.T (42) (S.add (1))\n //. 43\n //.\n //. > S.map (S.T (100)) ([S.add (1), Math.sqrt])\n //. [101, 10]\n //. ```\n function T(x) {\n return function(f) {\n return f (x);\n };\n }\n _.T = {\n consts: {},\n types: [a, $.Fn (a) (b), b],\n impl: T\n };\n\n //. ### Function\n\n //# curry2 :: ((a, b) -> c) -> a -> b -> c\n //.\n //. Curries the given binary function.\n //.\n //. ```javascript\n //. > S.map (S.curry2 (Math.pow) (10)) ([1, 2, 3])\n //. [10, 100, 1000]\n //. ```\n function curry2(f) {\n return function(x) {\n return function(y) {\n return f (x, y);\n };\n };\n }\n _.curry2 = {\n consts: {},\n types: [$.Function ([a, b, c]), a, b, c],\n impl: curry2\n };\n\n //# curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d\n //.\n //. Curries the given ternary function.\n //.\n //. ```javascript\n //. > const replaceString = S.curry3 ((what, replacement, string) =>\n //. . string.replace (what, replacement)\n //. . )\n //.\n //. > replaceString ('banana') ('orange') ('banana icecream')\n //. 'orange icecream'\n //. ```\n function curry3(f) {\n return function(x) {\n return function(y) {\n return function(z) {\n return f (x, y, z);\n };\n };\n };\n }\n _.curry3 = {\n consts: {},\n types: [$.Function ([a, b, c, d]), a, b, c, d],\n impl: curry3\n };\n\n //# curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -> e\n //.\n //. Curries the given quaternary function.\n //.\n //. ```javascript\n //. > const createRect = S.curry4 ((x, y, width, height) =>\n //. . ({x, y, width, height})\n //. . )\n //.\n //. > createRect (0) (0) (10) (10)\n //. {x: 0, y: 0, width: 10, height: 10}\n //. ```\n function curry4(f) {\n return function(w) {\n return function(x) {\n return function(y) {\n return function(z) {\n return f (w, x, y, z);\n };\n };\n };\n };\n }\n _.curry4 = {\n consts: {},\n types: [$.Function ([a, b, c, d, e]), a, b, c, d, e],\n impl: curry4\n };\n\n //# curry5 :: ((a, b, c, d, e) -> f) -> a -> b -> c -> d -> e -> f\n //.\n //. Curries the given quinary function.\n //.\n //. ```javascript\n //. > const toUrl = S.curry5 ((protocol, creds, hostname, port, pathname) =>\n //. . protocol + '//' +\n //. . S.maybe ('') (S.flip (S.concat) ('@')) (creds) +\n //. . hostname +\n //. . S.maybe ('') (S.concat (':')) (port) +\n //. . pathname\n //. . )\n //.\n //. > toUrl ('https:') (S.Nothing) ('example.com') (S.Just ('443')) ('/foo/bar')\n //. 'https://example.com:443/foo/bar'\n //. ```\n function curry5(f) {\n return function(v) {\n return function(w) {\n return function(x) {\n return function(y) {\n return function(z) {\n return f (v, w, x, y, z);\n };\n };\n };\n };\n };\n }\n _.curry5 = {\n consts: {},\n types: [$.Function ([a, b, c, d, e, r]), a, b, c, d, e, r],\n impl: curry5\n };\n\n //. ### Composition\n\n //# compose :: Semigroupoid s => s b c -> s a b -> s a c\n //.\n //. Curried version of [`Z.compose`][].\n //.\n //. When specialized to Function, `compose` composes two unary functions,\n //. from right to left (this is the B combinator from combinatory logic).\n //.\n //. The generalized type signature indicates that `compose` is compatible\n //. with any [Semigroupoid][].\n //.\n //. See also [`pipe`](#pipe).\n //.\n //. ```javascript\n //. > S.compose (Math.sqrt) (S.add (1)) (99)\n //. 10\n //. ```\n _.compose = {\n consts: {s: [Z.Semigroupoid]},\n types: [s (b) (c), s (a) (b), s (a) (c)],\n impl: curry2 (Z.compose)\n };\n\n //# pipe :: Foldable f => f (Any -> Any) -> a -> b\n //.\n //. Takes a sequence of functions assumed to be unary and a value of any\n //. type, and returns the result of applying the sequence of transformations\n //. to the initial value.\n //.\n //. In general terms, `pipe` performs left-to-right composition of a sequence\n //. of functions. `pipe ([f, g, h]) (x)` is equivalent to `h (g (f (x)))`.\n //.\n //. ```javascript\n //. > S.pipe ([S.add (1), Math.sqrt, S.sub (1)]) (99)\n //. 9\n //. ```\n function pipe(fs) {\n return function(x) {\n return reduce (T) (x) (fs);\n };\n }\n _.pipe = {\n consts: {f: [Z.Foldable]},\n types: [f ($.Fn ($.Any) ($.Any)), a, b],\n impl: pipe\n };\n\n //# pipeK :: (Foldable f, Chain m) => f (Any -> m Any) -> m a -> m b\n //.\n //. Takes a sequence of functions assumed to be unary that return values\n //. with a [Chain][], and a value of that Chain, and returns the result\n //. of applying the sequence of transformations to the initial value.\n //.\n //. In general terms, `pipeK` performs left-to-right [Kleisli][] composition\n //. of an sequence of functions. `pipeK ([f, g, h]) (x)` is equivalent to\n //. `chain (h) (chain (g) (chain (f) (x)))`.\n //.\n //. ```javascript\n //. > S.pipeK ([S.tail, S.tail, S.head]) (S.Just ([1, 2, 3, 4]))\n //. Just (3)\n //. ```\n function pipeK(fs) {\n return function(x) {\n return Z.reduce (function(x, f) { return Z.chain (f, x); }, x, fs);\n };\n }\n _.pipeK = {\n consts: {f: [Z.Foldable], m: [Z.Chain]},\n types: [f ($.Fn ($.Any) (m ($.Any))), m (a), m (b)],\n impl: pipeK\n };\n\n //# on :: (b -> b -> c) -> (a -> b) -> a -> a -> c\n //.\n //. Takes a binary function `f`, a unary function `g`, and two\n //. values `x` and `y`. Returns `f (g (x)) (g (y))`.\n //.\n //. This is the P combinator from combinatory logic.\n //.\n //. ```javascript\n //. > S.on (S.concat) (S.reverse) ([1, 2, 3]) ([4, 5, 6])\n //. [3, 2, 1, 6, 5, 4]\n //. ```\n function on(f) {\n return function(g) {\n return function(x) {\n return function(y) {\n return f (g (x)) (g (y));\n };\n };\n };\n }\n _.on = {\n consts: {},\n types: [$.Fn (b) ($.Fn (b) (c)), $.Fn (a) (b), a, a, c],\n impl: on\n };\n\n //. ### Pair\n //.\n //. Pair is the canonical product type: a value of type `Pair a b` always\n //. contains exactly two values: one of type `a`; one of type `b`.\n //.\n //. The implementation is provided by [sanctuary-pair][].\n\n //# Pair :: a -> b -> Pair a b\n //.\n //. Pair's sole data constructor. Additionally, it serves as the\n //. Pair [type representative][].\n //.\n //. ```javascript\n //. > S.Pair ('foo') (42)\n //. Pair ('foo') (42)\n //. ```\n _.Pair = {\n consts: {},\n types: [a, b, $.Pair (a) (b)],\n impl: Pair\n };\n\n //# pair :: (a -> b -> c) -> Pair a b -> c\n //.\n //. Case analysis for the `Pair a b` type.\n //.\n //. ```javascript\n //. > S.pair (S.concat) (S.Pair ('foo') ('bar'))\n //. 'foobar'\n //. ```\n function pair(f) {\n return function(pair) {\n return f (pair.fst) (pair.snd);\n };\n }\n _.pair = {\n consts: {},\n types: [$.Fn (a) ($.Fn (b) (c)), $.Pair (a) (b), c],\n impl: pair\n };\n\n //# fst :: Pair a b -> a\n //.\n //. `fst (Pair (x) (y))` is equivalent to `x`.\n //.\n //. ```javascript\n //. > S.fst (S.Pair ('foo') (42))\n //. 'foo'\n //. ```\n _.fst = {\n consts: {},\n types: [$.Pair (a) (b), a],\n impl: pair (K)\n };\n\n //# snd :: Pair a b -> b\n //.\n //. `snd (Pair (x) (y))` is equivalent to `y`.\n //.\n //. ```javascript\n //. > S.snd (S.Pair ('foo') (42))\n //. 42\n //. ```\n _.snd = {\n consts: {},\n types: [$.Pair (a) (b), b],\n impl: pair (C (K))\n };\n\n //# swap :: Pair a b -> Pair b a\n //.\n //. `swap (Pair (x) (y))` is equivalent to `Pair (y) (x)`.\n //.\n //. ```javascript\n //. > S.swap (S.Pair ('foo') (42))\n //. Pair (42) ('foo')\n //. ```\n _.swap = {\n consts: {},\n types: [$.Pair (a) (b), $.Pair (b) (a)],\n impl: pair (C (Pair))\n };\n\n //. ### Maybe\n //.\n //. The Maybe type represents optional values: a value of type `Maybe a` is\n //. either Nothing (the empty value) or a Just whose value is of type `a`.\n //.\n //. The implementation is provided by [sanctuary-maybe][].\n\n //# Maybe :: TypeRep Maybe\n //.\n //. Maybe [type representative][].\n\n //# Nothing :: Maybe a\n //.\n //. The empty value of type `Maybe a`.\n //.\n //. ```javascript\n //. > S.Nothing\n //. Nothing\n //. ```\n\n //# Just :: a -> Maybe a\n //.\n //. Constructs a value of type `Maybe a` from a value of type `a`.\n //.\n //. ```javascript\n //. > S.Just (42)\n //. Just (42)\n //. ```\n _.Just = {\n consts: {},\n types: [a, $.Maybe (a)],\n impl: Just\n };\n\n //# isNothing :: Maybe a -> Boolean\n //.\n //. Returns `true` if the given Maybe is Nothing; `false` if it is a Just.\n //.\n //. ```javascript\n //. > S.isNothing (S.Nothing)\n //. true\n //.\n //. > S.isNothing (S.Just (42))\n //. false\n //. ```\n function isNothing(maybe) {\n return maybe.isNothing;\n }\n _.isNothing = {\n consts: {},\n types: [$.Maybe (a), $.Boolean],\n impl: isNothing\n };\n\n //# isJust :: Maybe a -> Boolean\n //.\n //. Returns `true` if the given Maybe is a Just; `false` if it is Nothing.\n //.\n //. ```javascript\n //. > S.isJust (S.Just (42))\n //. true\n //.\n //. > S.isJust (S.Nothing)\n //. false\n //. ```\n function isJust(maybe) {\n return maybe.isJust;\n }\n _.isJust = {\n consts: {},\n types: [$.Maybe (a), $.Boolean],\n impl: isJust\n };\n\n //# fromMaybe :: a -> Maybe a -> a\n //.\n //. Takes a default value and a Maybe, and returns the Maybe's value\n //. if the Maybe is a Just; the default value otherwise.\n //.\n //. See also [`fromMaybe_`](#fromMaybe_) and\n //. [`maybeToNullable`](#maybeToNullable).\n //.\n //. ```javascript\n //. > S.fromMaybe (0) (S.Just (42))\n //. 42\n //.\n //. > S.fromMaybe (0) (S.Nothing)\n //. 0\n //. ```\n _.fromMaybe = {\n consts: {},\n types: [a, $.Maybe (a), a],\n impl: C (maybe) (I)\n };\n\n //# fromMaybe_ :: (() -> a) -> Maybe a -> a\n //.\n //. Variant of [`fromMaybe`](#fromMaybe) that takes a thunk so the default\n //. value is only computed if required.\n //.\n //. ```javascript\n //. > function fib(n) { return n <= 1 ? n : fib (n - 2) + fib (n - 1); }\n //.\n //. > S.fromMaybe_ (() => fib (30)) (S.Just (1000000))\n //. 1000000\n //.\n //. > S.fromMaybe_ (() => fib (30)) (S.Nothing)\n //. 832040\n //. ```\n _.fromMaybe_ = {\n consts: {},\n types: [$.Thunk (a), $.Maybe (a), a],\n impl: C (maybe_) (I)\n };\n\n //# maybeToNullable :: Maybe a -> Nullable a\n //.\n //. Returns the given Maybe's value if the Maybe is a Just; `null` otherwise.\n //. [Nullable][] is defined in [sanctuary-def][].\n //.\n //. See also [`fromMaybe`](#fromMaybe).\n //.\n //. ```javascript\n //. > S.maybeToNullable (S.Just (42))\n //. 42\n //.\n //. > S.maybeToNullable (S.Nothing)\n //. null\n //. ```\n function maybeToNullable(maybe) {\n return maybe.isJust ? maybe.value : null;\n }\n _.maybeToNullable = {\n consts: {},\n types: [$.Maybe (a), $.Nullable (a)],\n impl: maybeToNullable\n };\n\n //# maybe :: b -> (a -> b) -> Maybe a -> b\n //.\n //. Takes a value of any type, a function, and a Maybe. If the Maybe is\n //. a Just, the return value is the result of applying the function to\n //. the Just's value. Otherwise, the first argument is returned.\n //.\n //. See also [`maybe_`](#maybe_).\n //.\n //. ```javascript\n //. > S.maybe (0) (S.prop ('length')) (S.Just ('refuge'))\n //. 6\n //.\n //. > S.maybe (0) (S.prop ('length')) (S.Nothing)\n //. 0\n //. ```\n function maybe(x) {\n return function(f) {\n return function(maybe) {\n return maybe.isJust ? f (maybe.value) : x;\n };\n };\n }\n _.maybe = {\n consts: {},\n types: [b, $.Fn (a) (b), $.Maybe (a), b],\n impl: maybe\n };\n\n //# maybe_ :: (() -> b) -> (a -> b) -> Maybe a -> b\n //.\n //. Variant of [`maybe`](#maybe) that takes a thunk so the default value\n //. is only computed if required.\n //.\n //. ```javascript\n //. > function fib(n) { return n <= 1 ? n : fib (n - 2) + fib (n - 1); }\n //.\n //. > S.maybe_ (() => fib (30)) (Math.sqrt) (S.Just (1000000))\n //. 1000\n //.\n //. > S.maybe_ (() => fib (30)) (Math.sqrt) (S.Nothing)\n //. 832040\n //. ```\n function maybe_(thunk) {\n return function(f) {\n return function(maybe) {\n return maybe.isJust ? f (maybe.value) : thunk ();\n };\n };\n }\n _.maybe_ = {\n consts: {},\n types: [$.Thunk (b), $.Fn (a) (b), $.Maybe (a), b],\n impl: maybe_\n };\n\n //# justs :: (Filterable f, Functor f) => f (Maybe a) -> f a\n //.\n //. Discards each element that is Nothing, and unwraps each element that is\n //. a Just. Related to Haskell's `catMaybes` function.\n //.\n //. See also [`lefts`](#lefts) and [`rights`](#rights).\n //.\n //. ```javascript\n //. > S.justs ([S.Just ('foo'), S.Nothing, S.Just ('baz')])\n //. ['foo', 'baz']\n //. ```\n function justs(maybes) {\n return map (prop ('value')) (filter (isJust) (maybes));\n }\n _.justs = {\n consts: {f: [Z.Filterable, Z.Functor]},\n types: [f ($.Maybe (a)), f (a)],\n impl: justs\n };\n\n //# mapMaybe :: (Filterable f, Functor f) => (a -> Maybe b) -> f a -> f b\n //.\n //. Takes a function and a structure, applies the function to each element\n //. of the structure, and returns the \"successful\" results. If the result of\n //. applying the function to an element is Nothing, the result is discarded;\n //. if the result is a Just, the Just's value is included.\n //.\n //. ```javascript\n //. > S.mapMaybe (S.head) ([[], [1, 2, 3], [], [4, 5, 6], []])\n //. [1, 4]\n //.\n //. > S.mapMaybe (S.head) ({x: [1, 2, 3], y: [], z: [4, 5, 6]})\n //. {x: 1, z: 4}\n //. ```\n _.mapMaybe = {\n consts: {f: [Z.Filterable, Z.Functor]},\n types: [$.Fn (a) ($.Maybe (b)), f (a), f (b)],\n impl: B (B (justs)) (map)\n };\n\n //# maybeToEither :: a -> Maybe b -> Either a b\n //.\n //. Converts a Maybe to an Either. Nothing becomes a Left (containing the\n //. first argument); a Just becomes a Right.\n //.\n //. See also [`eitherToMaybe`](#eitherToMaybe).\n //.\n //. ```javascript\n //. > S.maybeToEither ('Expecting an integer') (S.parseInt (10) ('xyz'))\n //. Left ('Expecting an integer')\n //.\n //. > S.maybeToEither ('Expecting an integer') (S.parseInt (10) ('42'))\n //. Right (42)\n //. ```\n function maybeToEither(x) {\n return maybe (Left (x)) (Right);\n }\n _.maybeToEither = {\n consts: {},\n types: [a, $.Maybe (b), $.Either (a) (b)],\n impl: maybeToEither\n };\n\n //. ### Either\n //.\n //. The Either type represents values with two possibilities: a value of type\n //. `Either a b` is either a Left whose value is of type `a` or a Right whose\n //. value is of type `b`.\n //.\n //. The implementation is provided by [sanctuary-either][].\n\n //# Either :: TypeRep Either\n //.\n //. Either [type representative][].\n\n //# Left :: a -> Either a b\n //.\n //. Constructs a value of type `Either a b` from a value of type `a`.\n //.\n //. ```javascript\n //. > S.Left ('Cannot divide by zero')\n //. Left ('Cannot divide by zero')\n //. ```\n _.Left = {\n consts: {},\n types: [a, $.Either (a) (b)],\n impl: Left\n };\n\n //# Right :: b -> Either a b\n //.\n //. Constructs a value of type `Either a b` from a value of type `b`.\n //.\n //. ```javascript\n //. > S.Right (42)\n //. Right (42)\n //. ```\n _.Right = {\n consts: {},\n types: [b, $.Either (a) (b)],\n impl: Right\n };\n\n //# isLeft :: Either a b -> Boolean\n //.\n //. Returns `true` if the given Either is a Left; `false` if it is a Right.\n //.\n //. ```javascript\n //. > S.isLeft (S.Left ('Cannot divide by zero'))\n //. true\n //.\n //. > S.isLeft (S.Right (42))\n //. false\n //. ```\n function isLeft(either) {\n return either.isLeft;\n }\n _.isLeft = {\n consts: {},\n types: [$.Either (a) (b), $.Boolean],\n impl: isLeft\n };\n\n //# isRight :: Either a b -> Boolean\n //.\n //. Returns `true` if the given Either is a Right; `false` if it is a Left.\n //.\n //. ```javascript\n //. > S.isRight (S.Right (42))\n //. true\n //.\n //. > S.isRight (S.Left ('Cannot divide by zero'))\n //. false\n //. ```\n function isRight(either) {\n return either.isRight;\n }\n _.isRight = {\n consts: {},\n types: [$.Either (a) (b), $.Boolean],\n impl: isRight\n };\n\n //# fromEither :: b -> Either a b -> b\n //.\n //. Takes a default value and an Either, and returns the Right value\n //. if the Either is a Right; the default value otherwise.\n //.\n //. ```javascript\n //. > S.fromEither (0) (S.Right (42))\n //. 42\n //.\n //. > S.fromEither (0) (S.Left (42))\n //. 0\n //. ```\n function fromEither(x) {\n return either (K (x)) (I);\n }\n _.fromEither = {\n consts: {},\n types: [b, $.Either (a) (b), b],\n impl: fromEither\n };\n\n //# either :: (a -> c) -> (b -> c) -> Either a b -> c\n //.\n //. Takes two functions and an Either, and returns the result of\n //. applying the first function to the Left's value, if the Either\n //. is a Left, or the result of applying the second function to the\n //. Right's value, if the Either is a Right.\n //.\n //. ```javascript\n //. > S.either (S.toUpper) (S.show) (S.Left ('Cannot divide by zero'))\n //. 'CANNOT DIVIDE BY ZERO'\n //.\n //. > S.either (S.toUpper) (S.show) (S.Right (42))\n //. '42'\n //. ```\n function either(l) {\n return function(r) {\n return function(either) {\n return (either.isLeft ? l : r) (either.value);\n };\n };\n }\n _.either = {\n consts: {},\n types: [$.Fn (a) (c), $.Fn (b) (c), $.Either (a) (b), c],\n impl: either\n };\n\n //# lefts :: (Filterable f, Functor f) => f (Either a b) -> f a\n //.\n //. Discards each element that is a Right, and unwraps each element that is\n //. a Left.\n //.\n //. See also [`rights`](#rights).\n //.\n //. ```javascript\n //. > S.lefts ([S.Right (20), S.Left ('foo'), S.Right (10), S.Left ('bar')])\n //. ['foo', 'bar']\n //. ```\n _.lefts = {\n consts: {f: [Z.Filterable, Z.Functor]},\n types: [f ($.Either (a) (b)), f (a)],\n impl: B (map (prop ('value'))) (filter (isLeft))\n };\n\n //# rights :: (Filterable f, Functor f) => f (Either a b) -> f b\n //.\n //. Discards each element that is a Left, and unwraps each element that is\n //. a Right.\n //.\n //. See also [`lefts`](#lefts).\n //.\n //. ```javascript\n //. > S.rights ([S.Right (20), S.Left ('foo'), S.Right (10), S.Left ('bar')])\n //. [20, 10]\n //. ```\n _.rights = {\n consts: {f: [Z.Filterable, Z.Functor]},\n types: [f ($.Either (a) (b)), f (b)],\n impl: B (map (prop ('value'))) (filter (isRight))\n };\n\n //# tagBy :: (a -> Boolean) -> a -> Either a a\n //.\n //. Takes a predicate and a value, and returns a Right of the value if it\n //. satisfies the predicate; a Left of the value otherwise.\n //.\n //. ```javascript\n //. > S.tagBy (S.odd) (0)\n //. Left (0)\n //\n //. > S.tagBy (S.odd) (1)\n //. Right (1)\n //. ```\n function tagBy(pred) {\n return ifElse (pred) (Right) (Left);\n }\n _.tagBy = {\n consts: {},\n types: [$.Predicate (a), a, $.Either (a) (a)],\n impl: tagBy\n };\n\n //# encase :: (a -> b) -> a -> Either Error b\n //.\n //. Takes a function that may throw and returns a pure function.\n //.\n //. ```javascript\n //. > S.encase (JSON.parse) ('[\"foo\",\"bar\",\"baz\"]')\n //. Right (['foo', 'bar', 'baz'])\n //.\n //. > S.encase (JSON.parse) ('[')\n //. Left (new SyntaxError ('Unexpected end of JSON input'))\n //. ```\n function encase(f) {\n return function(x) {\n try {\n return Right (f (x));\n } catch (err) {\n return Left (err);\n }\n };\n }\n _.encase = {\n consts: {},\n types: [$.Fn (a) (b), a, $.Either ($.Error) (b)],\n impl: encase\n };\n\n //# eitherToMaybe :: Either a b -> Maybe b\n //.\n //. Converts an Either to a Maybe. A Left becomes Nothing; a Right becomes\n //. a Just.\n //.\n //. See also [`maybeToEither`](#maybeToEither).\n //.\n //. ```javascript\n //. > S.eitherToMaybe (S.Left ('Cannot divide by zero'))\n //. Nothing\n //.\n //. > S.eitherToMaybe (S.Right (42))\n //. Just (42)\n //. ```\n function eitherToMaybe(either) {\n return either.isLeft ? Nothing : Just (either.value);\n }\n _.eitherToMaybe = {\n consts: {},\n types: [$.Either (a) (b), $.Maybe (b)],\n impl: eitherToMaybe\n };\n\n //. ### Logic\n\n //# and :: Boolean -> Boolean -> Boolean\n //.\n //. Boolean \"and\".\n //.\n //. ```javascript\n //. > S.and (false) (false)\n //. false\n //.\n //. > S.and (false) (true)\n //. false\n //.\n //. > S.and (true) (false)\n //. false\n //.\n //. > S.and (true) (true)\n //. true\n //. ```\n function and(x) {\n return function(y) {\n return x && y;\n };\n }\n _.and = {\n consts: {},\n types: [$.Boolean, $.Boolean, $.Boolean],\n impl: and\n };\n\n //# or :: Boolean -> Boolean -> Boolean\n //.\n //. Boolean \"or\".\n //.\n //. ```javascript\n //. > S.or (false) (false)\n //. false\n //.\n //. > S.or (false) (true)\n //. true\n //.\n //. > S.or (true) (false)\n //. true\n //.\n //. > S.or (true) (true)\n //. true\n //. ```\n function or(x) {\n return function(y) {\n return x || y;\n };\n }\n _.or = {\n consts: {},\n types: [$.Boolean, $.Boolean, $.Boolean],\n impl: or\n };\n\n //# not :: Boolean -> Boolean\n //.\n //. Boolean \"not\".\n //.\n //. See also [`complement`](#complement).\n //.\n //. ```javascript\n //. > S.not (false)\n //. true\n //.\n //. > S.not (true)\n //. false\n //. ```\n function not(x) {\n return !x;\n }\n _.not = {\n consts: {},\n types: [$.Boolean, $.Boolean],\n impl: not\n };\n\n //# complement :: (a -> Boolean) -> a -> Boolean\n //.\n //. Takes a unary predicate and a value of any type, and returns the logical\n //. negation of applying the predicate to the value.\n //.\n //. See also [`not`](#not).\n //.\n //. ```javascript\n //. > Number.isInteger (42)\n //. true\n //.\n //. > S.complement (Number.isInteger) (42)\n //. false\n //. ```\n _.complement = {\n consts: {},\n types: [$.Predicate (a), a, $.Boolean],\n impl: B (not)\n };\n\n //# boolean :: a -> a -> Boolean -> a\n //.\n //. Case analysis for the `Boolean` type. `boolean (x) (y) (b)` evaluates\n //. to `x` if `b` is `false`; to `y` if `b` is `true`.\n //.\n //. ```javascript\n //. > S.boolean ('no') ('yes') (false)\n //. 'no'\n //.\n //. > S.boolean ('no') ('yes') (true)\n //. 'yes'\n //. ```\n function boolean(x) {\n return function(y) {\n return function(b) {\n return b ? y : x;\n };\n };\n }\n _.boolean = {\n consts: {},\n types: [a, a, $.Boolean, a],\n impl: boolean\n };\n\n //# ifElse :: (a -> Boolean) -> (a -> b) -> (a -> b) -> a -> b\n //.\n //. Takes a unary predicate, a unary \"if\" function, a unary \"else\"\n //. function, and a value of any type, and returns the result of\n //. applying the \"if\" function to the value if the value satisfies\n //. the predicate; the result of applying the \"else\" function to the\n //. value otherwise.\n //.\n //. See also [`when`](#when) and [`unless`](#unless).\n //.\n //. ```javascript\n //. > S.ifElse (x => x < 0) (Math.abs) (Math.sqrt) (-1)\n //. 1\n //.\n //. > S.ifElse (x => x < 0) (Math.abs) (Math.sqrt) (16)\n //. 4\n //. ```\n function ifElse(pred) {\n return function(f) {\n return function(g) {\n return function(x) {\n return (pred (x) ? f : g) (x);\n };\n };\n };\n }\n _.ifElse = {\n consts: {},\n types: [$.Predicate (a), $.Fn (a) (b), $.Fn (a) (b), a, b],\n impl: ifElse\n };\n\n //# when :: (a -> Boolean) -> (a -> a) -> a -> a\n //.\n //. Takes a unary predicate, a unary function, and a value of any type, and\n //. returns the result of applying the function to the value if the value\n //. satisfies the predicate; the value otherwise.\n //.\n //. See also [`unless`](#unless) and [`ifElse`](#ifElse).\n //.\n //. ```javascript\n //. > S.when (x => x >= 0) (Math.sqrt) (16)\n //. 4\n //.\n //. > S.when (x => x >= 0) (Math.sqrt) (-1)\n //. -1\n //. ```\n function when(pred) {\n return C (ifElse (pred)) (I);\n }\n _.when = {\n consts: {},\n types: [$.Predicate (a), $.Fn (a) (a), a, a],\n impl: when\n };\n\n //# unless :: (a -> Boolean) -> (a -> a) -> a -> a\n //.\n //. Takes a unary predicate, a unary function, and a value of any type, and\n //. returns the result of applying the function to the value if the value\n //. does not satisfy the predicate; the value otherwise.\n //.\n //. See also [`when`](#when) and [`ifElse`](#ifElse).\n //.\n //. ```javascript\n //. > S.unless (x => x < 0) (Math.sqrt) (16)\n //. 4\n //.\n //. > S.unless (x => x < 0) (Math.sqrt) (-1)\n //. -1\n //. ```\n function unless(pred) {\n return ifElse (pred) (I);\n }\n _.unless = {\n consts: {},\n types: [$.Predicate (a), $.Fn (a) (a), a, a],\n impl: unless\n };\n\n //. ### Array\n\n //# array :: b -> (a -> Array a -> b) -> Array a -> b\n //.\n //. Case analysis for the `Array a` type.\n //.\n //. ```javascript\n //. > S.array (S.Nothing) (head => tail => S.Just (head)) ([])\n //. Nothing\n //.\n //. > S.array (S.Nothing) (head => tail => S.Just (head)) ([1, 2, 3])\n //. Just (1)\n //.\n //. > S.array (S.Nothing) (head => tail => S.Just (tail)) ([])\n //. Nothing\n //.\n //. > S.array (S.Nothing) (head => tail => S.Just (tail)) ([1, 2, 3])\n //. Just ([2, 3])\n //. ```\n function array(y) {\n return function(f) {\n return function(xs) {\n return xs.length === 0 ? y : f (xs[0]) (xs.slice (1));\n };\n };\n }\n _.array = {\n consts: {},\n types: [b, $.Fn (a) ($.Fn ($.Array (a)) (b)), $.Array (a), b],\n impl: array\n };\n\n //# head :: Foldable f => f a -> Maybe a\n //.\n //. Returns Just the first element of the given structure if the structure\n //. contains at least one element; Nothing otherwise.\n //.\n //. ```javascript\n //. > S.head ([1, 2, 3])\n //. Just (1)\n //.\n //. > S.head ([])\n //. Nothing\n //.\n //. > S.head (Cons (1) (Cons (2) (Cons (3) (Nil))))\n //. Just (1)\n //.\n //. > S.head (Nil)\n //. Nothing\n //. ```\n function head(foldable) {\n // Fast path for arrays.\n if (Array.isArray (foldable)) {\n return foldable.length > 0 ? Just (foldable[0]) : Nothing;\n }\n return Z.reduce (function(m, x) { return m.isJust ? m : Just (x); },\n Nothing,\n foldable);\n }\n _.head = {\n consts: {f: [Z.Foldable]},\n types: [f (a), $.Maybe (a)],\n impl: head\n };\n\n //# last :: Foldable f => f a -> Maybe a\n //.\n //. Returns Just the last element of the given structure if the structure\n //. contains at least one element; Nothing otherwise.\n //.\n //. ```javascript\n //. > S.last ([1, 2, 3])\n //. Just (3)\n //.\n //. > S.last ([])\n //. Nothing\n //.\n //. > S.last (Cons (1) (Cons (2) (Cons (3) (Nil))))\n //. Just (3)\n //.\n //. > S.last (Nil)\n //. Nothing\n //. ```\n function last(foldable) {\n // Fast path for arrays.\n if (Array.isArray (foldable)) {\n return foldable.length > 0 ? Just (foldable[foldable.length - 1])\n : Nothing;\n }\n return Z.reduce (function(_, x) { return Just (x); }, Nothing, foldable);\n }\n _.last = {\n consts: {f: [Z.Foldable]},\n types: [f (a), $.Maybe (a)],\n impl: last\n };\n\n //# tail :: (Applicative f, Foldable f, Monoid (f a)) => f a -> Maybe (f a)\n //.\n //. Returns Just all but the first of the given structure's elements if the\n //. structure contains at least one element; Nothing otherwise.\n //.\n //. ```javascript\n //. > S.tail ([1, 2, 3])\n //. Just ([2, 3])\n //.\n //. > S.tail ([])\n //. Nothing\n //.\n //. > S.tail (Cons (1) (Cons (2) (Cons (3) (Nil))))\n //. Just (Cons (2) (Cons (3) (Nil)))\n //\n //. > S.tail (Nil)\n //. Nothing\n //. ```\n function tail(foldable) {\n // Fast path for arrays.\n if (Array.isArray (foldable)) {\n return foldable.length > 0 ? Just (foldable.slice (1)) : Nothing;\n }\n var empty = Z.empty (foldable.constructor);\n return Z.reduce (function(m, x) {\n return Just (maybe (empty) (append (x)) (m));\n }, Nothing, foldable);\n }\n _.tail = {\n consts: {f: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [f (a), $.Maybe (f (a))],\n impl: tail\n };\n\n //# init :: (Applicative f, Foldable f, Monoid (f a)) => f a -> Maybe (f a)\n //.\n //. Returns Just all but the last of the given structure's elements if the\n //. structure contains at least one element; Nothing otherwise.\n //.\n //. ```javascript\n //. > S.init ([1, 2, 3])\n //. Just ([1, 2])\n //.\n //. > S.init ([])\n //. Nothing\n //.\n //. > S.init (Cons (1) (Cons (2) (Cons (3) (Nil))))\n //. Just (Cons (1) (Cons (2) (Nil)))\n //.\n //. > S.init (Nil)\n //. Nothing\n //. ```\n function init(foldable) {\n // Fast path for arrays.\n if (Array.isArray (foldable)) {\n return foldable.length > 0 ? Just (foldable.slice (0, -1)) : Nothing;\n }\n var empty = Z.empty (foldable.constructor);\n return Z.map (Pair.snd, Z.reduce (function(m, x) {\n return Just (Pair (x) (maybe (empty) (pair (append)) (m)));\n }, Nothing, foldable));\n }\n _.init = {\n consts: {f: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [f (a), $.Maybe (f (a))],\n impl: init\n };\n\n //# take :: (Applicative f, Foldable f, Monoid (f a)) => Integer -> f a -> Maybe (f a)\n //.\n //. Returns Just the first N elements of the given structure if N is\n //. non-negative and less than or equal to the size of the structure;\n //. Nothing otherwise.\n //.\n //. ```javascript\n //. > S.take (0) (['foo', 'bar'])\n //. Just ([])\n //.\n //. > S.take (1) (['foo', 'bar'])\n //. Just (['foo'])\n //.\n //. > S.take (2) (['foo', 'bar'])\n //. Just (['foo', 'bar'])\n //.\n //. > S.take (3) (['foo', 'bar'])\n //. Nothing\n //.\n //. > S.take (3) (Cons (1) (Cons (2) (Cons (3) (Cons (4) (Cons (5) (Nil))))))\n //. Just (Cons (1) (Cons (2) (Cons (3) (Nil))))\n //. ```\n function _takeDrop(arrayCase, generalCase) {\n return function(n) {\n return function(xs) {\n if (n < 0) return Nothing;\n\n // Fast path for arrays.\n if (Array.isArray (xs)) {\n return n <= xs.length ? Just (arrayCase (n, xs)) : Nothing;\n }\n\n // m :: Maybe (Pair Integer (f a))\n var m = Z.reduce (function(m, x) {\n return Z.map (function(pair) {\n var n = pair.fst;\n var xs = pair.snd;\n return Pair (n - 1) (generalCase (n, xs, x));\n }, m);\n }, Just (Pair (n) (Z.empty (xs.constructor))), xs);\n\n return Z.map (Pair.snd, Z.reject (B (gt (0)) (Pair.fst), m));\n };\n };\n }\n var take = _takeDrop (\n function(n, xs) { return xs.slice (0, n); },\n function(n, xs, x) { return n > 0 ? Z.append (x, xs) : xs; }\n );\n _.take = {\n consts: {f: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [$.Integer, f (a), $.Maybe (f (a))],\n impl: take\n };\n\n //# drop :: (Applicative f, Foldable f, Monoid (f a)) => Integer -> f a -> Maybe (f a)\n //.\n //. Returns Just all but the first N elements of the given structure if\n //. N is non-negative and less than or equal to the size of the structure;\n //. Nothing otherwise.\n //.\n //. ```javascript\n //. > S.drop (0) (['foo', 'bar'])\n //. Just (['foo', 'bar'])\n //.\n //. > S.drop (1) (['foo', 'bar'])\n //. Just (['bar'])\n //.\n //. > S.drop (2) (['foo', 'bar'])\n //. Just ([])\n //.\n //. > S.drop (3) (['foo', 'bar'])\n //. Nothing\n //.\n //. > S.drop (3) (Cons (1) (Cons (2) (Cons (3) (Cons (4) (Cons (5) (Nil))))))\n //. Just (Cons (4) (Cons (5) (Nil)))\n //. ```\n var drop = _takeDrop (\n function(n, xs) { return xs.slice (n); },\n function(n, xs, x) { return n > 0 ? xs : Z.append (x, xs); }\n );\n _.drop = {\n consts: {f: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [$.Integer, f (a), $.Maybe (f (a))],\n impl: drop\n };\n\n //# takeLast :: (Applicative f, Foldable f, Monoid (f a)) => Integer -> f a -> Maybe (f a)\n //.\n //. Returns Just the last N elements of the given structure if N is\n //. non-negative and less than or equal to the size of the structure;\n //. Nothing otherwise.\n //.\n //. ```javascript\n //. > S.takeLast (0) (['foo', 'bar'])\n //. Just ([])\n //.\n //. > S.takeLast (1) (['foo', 'bar'])\n //. Just (['bar'])\n //.\n //. > S.takeLast (2) (['foo', 'bar'])\n //. Just (['foo', 'bar'])\n //.\n //. > S.takeLast (3) (['foo', 'bar'])\n //. Nothing\n //.\n //. > S.takeLast (3) (Cons (1) (Cons (2) (Cons (3) (Cons (4) (Nil)))))\n //. Just (Cons (2) (Cons (3) (Cons (4) (Nil))))\n //. ```\n function takeLast(n) {\n return function(xs) {\n return Z.map (Z.reverse, take (n) (Z.reverse (xs)));\n };\n }\n _.takeLast = {\n consts: {f: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [$.Integer, f (a), $.Maybe (f (a))],\n impl: takeLast\n };\n\n //# dropLast :: (Applicative f, Foldable f, Monoid (f a)) => Integer -> f a -> Maybe (f a)\n //.\n //. Returns Just all but the last N elements of the given structure if\n //. N is non-negative and less than or equal to the size of the structure;\n //. Nothing otherwise.\n //.\n //. ```javascript\n //. > S.dropLast (0) (['foo', 'bar'])\n //. Just (['foo', 'bar'])\n //.\n //. > S.dropLast (1) (['foo', 'bar'])\n //. Just (['foo'])\n //.\n //. > S.dropLast (2) (['foo', 'bar'])\n //. Just ([])\n //.\n //. > S.dropLast (3) (['foo', 'bar'])\n //. Nothing\n //.\n //. > S.dropLast (3) (Cons (1) (Cons (2) (Cons (3) (Cons (4) (Nil)))))\n //. Just (Cons (1) (Nil))\n //. ```\n function dropLast(n) {\n return function(xs) {\n return Z.map (Z.reverse, drop (n) (Z.reverse (xs)));\n };\n }\n _.dropLast = {\n consts: {f: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [$.Integer, f (a), $.Maybe (f (a))],\n impl: dropLast\n };\n\n //# takeWhile :: (a -> Boolean) -> Array a -> Array a\n //.\n //. Discards the first element that does not satisfy the predicate,\n //. and all subsequent elements.\n //.\n //. See also [`dropWhile`](#dropWhile).\n //.\n //. ```javascript\n //. > S.takeWhile (S.odd) ([3, 3, 3, 7, 6, 3, 5, 4])\n //. [3, 3, 3, 7]\n //.\n //. > S.takeWhile (S.even) ([3, 3, 3, 7, 6, 3, 5, 4])\n //. []\n //. ```\n function takeWhile(pred) {\n return function(xs) {\n var idx = 0;\n while (idx < xs.length && pred (xs[idx])) idx += 1;\n return xs.slice (0, idx);\n };\n }\n _.takeWhile = {\n consts: {},\n types: [$.Predicate (a), $.Array (a), $.Array (a)],\n impl: takeWhile\n };\n\n //# dropWhile :: (a -> Boolean) -> Array a -> Array a\n //.\n //. Retains the first element that does not satisfy the predicate,\n //. and all subsequent elements.\n //.\n //. See also [`takeWhile`](#takeWhile).\n //.\n //. ```javascript\n //. > S.dropWhile (S.odd) ([3, 3, 3, 7, 6, 3, 5, 4])\n //. [6, 3, 5, 4]\n //.\n //. > S.dropWhile (S.even) ([3, 3, 3, 7, 6, 3, 5, 4])\n //. [3, 3, 3, 7, 6, 3, 5, 4]\n //. ```\n function dropWhile(pred) {\n return function(xs) {\n var idx = 0;\n while (idx < xs.length && pred (xs[idx])) idx += 1;\n return xs.slice (idx);\n };\n }\n _.dropWhile = {\n consts: {},\n types: [$.Predicate (a), $.Array (a), $.Array (a)],\n impl: dropWhile\n };\n\n //# size :: Foldable f => f a -> NonNegativeInteger\n //.\n //. Returns the number of elements of the given structure.\n //.\n //. ```javascript\n //. > S.size ([])\n //. 0\n //.\n //. > S.size (['foo', 'bar', 'baz'])\n //. 3\n //.\n //. > S.size (Nil)\n //. 0\n //.\n //. > S.size (Cons ('foo') (Cons ('bar') (Cons ('baz') (Nil))))\n //. 3\n //.\n //. > S.size (S.Nothing)\n //. 0\n //.\n //. > S.size (S.Just ('quux'))\n //. 1\n //.\n //. > S.size (S.Pair ('ignored!') ('counted!'))\n //. 1\n //. ```\n _.size = {\n consts: {f: [Z.Foldable]},\n types: [f (a), $.NonNegativeInteger],\n impl: Z.size\n };\n\n //# all :: Foldable f => (a -> Boolean) -> f a -> Boolean\n //.\n //. Returns `true` [iff][] all the elements of the structure satisfy the\n //. predicate.\n //.\n //. See also [`any`](#any) and [`none`](#none).\n //.\n //. ```javascript\n //. > S.all (S.odd) ([])\n //. true\n //.\n //. > S.all (S.odd) ([1, 3, 5])\n //. true\n //.\n //. > S.all (S.odd) ([1, 2, 3])\n //. false\n //. ```\n _.all = {\n consts: {f: [Z.Foldable]},\n types: [$.Predicate (a), f (a), $.Boolean],\n impl: curry2 (Z.all)\n };\n\n //# any :: Foldable f => (a -> Boolean) -> f a -> Boolean\n //.\n //. Returns `true` [iff][] any element of the structure satisfies the\n //. predicate.\n //.\n //. See also [`all`](#all) and [`none`](#none).\n //.\n //. ```javascript\n //. > S.any (S.odd) ([])\n //. false\n //.\n //. > S.any (S.odd) ([2, 4, 6])\n //. false\n //.\n //. > S.any (S.odd) ([1, 2, 3])\n //. true\n //. ```\n _.any = {\n consts: {f: [Z.Foldable]},\n types: [$.Predicate (a), f (a), $.Boolean],\n impl: curry2 (Z.any)\n };\n\n //# none :: Foldable f => (a -> Boolean) -> f a -> Boolean\n //.\n //. Returns `true` [iff][] none of the elements of the structure satisfies\n //. the predicate.\n //.\n //. Properties:\n //.\n //. - `forall p :: a -> Boolean, xs :: Foldable f => f a.\n //. S.none (p) (xs) = S.not (S.any (p) (xs))`\n //.\n //. - `forall p :: a -> Boolean, xs :: Foldable f => f a.\n //. S.none (p) (xs) = S.all (S.complement (p)) (xs)`\n //.\n //. See also [`all`](#all) and [`any`](#any).\n //.\n //. ```javascript\n //. > S.none (S.odd) ([])\n //. true\n //.\n //. > S.none (S.odd) ([2, 4, 6])\n //. true\n //.\n //. > S.none (S.odd) ([1, 2, 3])\n //. false\n //. ```\n _.none = {\n consts: {f: [Z.Foldable]},\n types: [$.Predicate (a), f (a), $.Boolean],\n impl: curry2 (Z.none)\n };\n\n //# append :: (Applicative f, Semigroup (f a)) => a -> f a -> f a\n //.\n //. Returns the result of appending the first argument to the second.\n //.\n //. See also [`prepend`](#prepend).\n //.\n //. ```javascript\n //. > S.append (3) ([1, 2])\n //. [1, 2, 3]\n //.\n //. > S.append (3) (Cons (1) (Cons (2) (Nil)))\n //. Cons (1) (Cons (2) (Cons (3) (Nil)))\n //.\n //. > S.append ([1]) (S.Nothing)\n //. Just ([1])\n //.\n //. > S.append ([3]) (S.Just ([1, 2]))\n //. Just ([1, 2, 3])\n //. ```\n function append(x) {\n return function(xs) {\n return Z.append (x, xs);\n };\n }\n _.append = {\n consts: {f: [Z.Applicative, Z.Semigroup]},\n types: [a, f (a), f (a)],\n impl: append\n };\n\n //# prepend :: (Applicative f, Semigroup (f a)) => a -> f a -> f a\n //.\n //. Returns the result of prepending the first argument to the second.\n //.\n //. See also [`append`](#append).\n //.\n //. ```javascript\n //. > S.prepend (1) ([2, 3])\n //. [1, 2, 3]\n //.\n //. > S.prepend (1) (Cons (2) (Cons (3) (Nil)))\n //. Cons (1) (Cons (2) (Cons (3) (Nil)))\n //.\n //. > S.prepend ([1]) (S.Nothing)\n //. Just ([1])\n //.\n //. > S.prepend ([1]) (S.Just ([2, 3]))\n //. Just ([1, 2, 3])\n //. ```\n _.prepend = {\n consts: {f: [Z.Applicative, Z.Semigroup]},\n types: [a, f (a), f (a)],\n impl: curry2 (Z.prepend)\n };\n\n //# joinWith :: String -> Array String -> String\n //.\n //. Joins the strings of the second argument separated by the first argument.\n //.\n //. Properties:\n //.\n //. - `forall s :: String, t :: String.\n //. S.joinWith (s) (S.splitOn (s) (t)) = t`\n //.\n //. See also [`splitOn`](#splitOn).\n //.\n //. ```javascript\n //. > S.joinWith (':') (['foo', 'bar', 'baz'])\n //. 'foo:bar:baz'\n //. ```\n _.joinWith = {\n consts: {},\n types: [$.String, $.Array ($.String), $.String],\n impl: invoke1 ('join')\n };\n\n //# elem :: (Setoid a, Foldable f) => a -> f a -> Boolean\n //.\n //. Takes a value and a structure and returns `true` [iff][] the value is an\n //. element of the structure.\n //.\n //. See also [`find`](#find).\n //.\n //. ```javascript\n //. > S.elem ('c') (['a', 'b', 'c'])\n //. true\n //.\n //. > S.elem ('x') (['a', 'b', 'c'])\n //. false\n //.\n //. > S.elem (3) ({x: 1, y: 2, z: 3})\n //. true\n //.\n //. > S.elem (8) ({x: 1, y: 2, z: 3})\n //. false\n //.\n //. > S.elem (0) (S.Just (0))\n //. true\n //.\n //. > S.elem (0) (S.Just (1))\n //. false\n //.\n //. > S.elem (0) (S.Nothing)\n //. false\n //. ```\n _.elem = {\n consts: {a: [Z.Setoid], f: [Z.Foldable]},\n types: [a, f (a), $.Boolean],\n impl: curry2 (Z.elem)\n };\n\n //# find :: Foldable f => (a -> Boolean) -> f a -> Maybe a\n //.\n //. Takes a predicate and a structure and returns Just the leftmost element\n //. of the structure that satisfies the predicate; Nothing if there is no\n //. such element.\n //.\n //. See also [`elem`](#elem).\n //.\n //. ```javascript\n //. > S.find (S.lt (0)) ([1, -2, 3, -4, 5])\n //. Just (-2)\n //.\n //. > S.find (S.lt (0)) ([1, 2, 3, 4, 5])\n //. Nothing\n //. ```\n function find(pred) {\n return function(xs) {\n return Z.reduce (\n function(m, x) {\n return m.isJust ? m : pred (x) ? Just (x) : Nothing;\n },\n Nothing,\n xs\n );\n };\n }\n _.find = {\n consts: {f: [Z.Foldable]},\n types: [$.Predicate (a), f (a), $.Maybe (a)],\n impl: find\n };\n\n //# foldMap :: (Monoid m, Foldable f) => TypeRep m -> (a -> m) -> f a -> m\n //.\n //. Curried version of [`Z.foldMap`][]. Deconstructs a foldable by mapping\n //. every element to a monoid and concatenating the results.\n //.\n //. ```javascript\n //. > S.foldMap (String) (f => f.name) ([Math.sin, Math.cos, Math.tan])\n //. 'sincostan'\n //.\n //. > S.foldMap (Array) (x => [x + 1, x + 2]) ([10, 20, 30])\n //. [11, 12, 21, 22, 31, 32]\n //. ```\n _.foldMap = {\n consts: {b: [Z.Monoid], f: [Z.Foldable]},\n types: [TypeRep (b), $.Fn (a) (b), f (a), b],\n impl: curry3 (Z.foldMap)\n };\n\n //# unfoldr :: (b -> Maybe (Pair a b)) -> b -> Array a\n //.\n //. Takes a function and a seed value, and returns an array generated by\n //. applying the function repeatedly. The array is initially empty. The\n //. function is initially applied to the seed value. Each application\n //. of the function should result in either:\n //.\n //. - Nothing, in which case the array is returned; or\n //.\n //. - Just a pair, in which case the first element is appended to\n //. the array and the function is applied to the second element.\n //.\n //. ```javascript\n //. > S.unfoldr (n => n < 1000 ? S.Just (S.Pair (n) (2 * n)) : S.Nothing) (1)\n //. [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]\n //. ```\n function unfoldr(f) {\n return function(x) {\n var result = [];\n for (var m = f (x); m.isJust; m = f (m.value.snd)) {\n result.push (m.value.fst);\n }\n return result;\n };\n }\n _.unfoldr = {\n consts: {},\n types: [$.Fn (b) ($.Maybe ($.Pair (a) (b))), b, $.Array (a)],\n impl: unfoldr\n };\n\n //# range :: Integer -> Integer -> Array Integer\n //.\n //. Returns an array of consecutive integers starting with the first argument\n //. and ending with the second argument minus one. Returns `[]` if the second\n //. argument is less than or equal to the first argument.\n //.\n //. ```javascript\n //. > S.range (0) (10)\n //. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n //.\n //. > S.range (-5) (0)\n //. [-5, -4, -3, -2, -1]\n //.\n //. > S.range (0) (-5)\n //. []\n //. ```\n function range(from) {\n return function(to) {\n var result = [];\n for (var n = from; n < to; n += 1) result.push (n);\n return result;\n };\n }\n _.range = {\n consts: {},\n types: [$.Integer, $.Integer, $.Array ($.Integer)],\n impl: range\n };\n\n //# groupBy :: (a -> a -> Boolean) -> Array a -> Array (Array a)\n //.\n //. Splits its array argument into an array of arrays of equal,\n //. adjacent elements. Equality is determined by the function\n //. provided as the first argument. Its behaviour can be surprising\n //. for functions that aren't reflexive, transitive, and symmetric\n //. (see [equivalence][] relation).\n //.\n //. Properties:\n //.\n //. - `forall f :: a -> a -> Boolean, xs :: Array a.\n //. S.join (S.groupBy (f) (xs)) = xs`\n //.\n //. ```javascript\n //. > S.groupBy (S.equals) ([1, 1, 2, 1, 1])\n //. [[1, 1], [2], [1, 1]]\n //.\n //. > S.groupBy (x => y => x + y === 0) ([2, -3, 3, 3, 3, 4, -4, 4])\n //. [[2], [-3, 3, 3, 3], [4, -4], [4]]\n //. ```\n function groupBy(f) {\n return function(xs) {\n if (xs.length === 0) return [];\n var x0 = xs[0]; // :: a\n var active = [x0]; // :: Array a\n var result = [active]; // :: Array (Array a)\n for (var idx = 1; idx < xs.length; idx += 1) {\n var x = xs[idx];\n if (f (x0) (x)) active.push (x); else result.push (active = [x0 = x]);\n }\n return result;\n };\n }\n _.groupBy = {\n consts: {},\n types: [$.Fn (a) ($.Predicate (a)), $.Array (a), $.Array ($.Array (a))],\n impl: groupBy\n };\n\n //# reverse :: (Applicative f, Foldable f, Monoid (f a)) => f a -> f a\n //.\n //. Reverses the elements of the given structure.\n //.\n //. ```javascript\n //. > S.reverse ([1, 2, 3])\n //. [3, 2, 1]\n //.\n //. > S.reverse (Cons (1) (Cons (2) (Cons (3) (Nil))))\n //. Cons (3) (Cons (2) (Cons (1) (Nil)))\n //.\n //. > S.pipe ([S.splitOn (''), S.reverse, S.joinWith ('')]) ('abc')\n //. 'cba'\n //. ```\n _.reverse = {\n consts: {f: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [f (a), f (a)],\n impl: Z.reverse\n };\n\n //# sort :: (Ord a, Applicative m, Foldable m, Monoid (m a)) => m a -> m a\n //.\n //. Performs a [stable sort][] of the elements of the given structure, using\n //. [`Z.lte`][] for comparisons.\n //.\n //. Properties:\n //.\n //. - `S.sort (S.sort (m)) = S.sort (m)` (idempotence)\n //.\n //. See also [`sortBy`](#sortBy).\n //.\n //. ```javascript\n //. > S.sort (['foo', 'bar', 'baz'])\n //. ['bar', 'baz', 'foo']\n //.\n //. > S.sort ([S.Left (4), S.Right (3), S.Left (2), S.Right (1)])\n //. [Left (2), Left (4), Right (1), Right (3)]\n //. ```\n _.sort = {\n consts: {a: [Z.Ord], m: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [m (a), m (a)],\n impl: Z.sort\n };\n\n //# sortBy :: (Ord b, Applicative m, Foldable m, Monoid (m a)) => (a -> b) -> m a -> m a\n //.\n //. Performs a [stable sort][] of the elements of the given structure, using\n //. [`Z.lte`][] to compare the values produced by applying the given function\n //. to each element of the structure.\n //.\n //. Properties:\n //.\n //. - `S.sortBy (f) (S.sortBy (f) (m)) = S.sortBy (f) (m)` (idempotence)\n //.\n //. See also [`sort`](#sort).\n //.\n //. ```javascript\n //. > S.sortBy (S.prop ('rank')) ([\n //. . {rank: 7, suit: 'spades'},\n //. . {rank: 5, suit: 'hearts'},\n //. . {rank: 2, suit: 'hearts'},\n //. . {rank: 5, suit: 'spades'},\n //. . ])\n //. [ {rank: 2, suit: 'hearts'},\n //. . {rank: 5, suit: 'hearts'},\n //. . {rank: 5, suit: 'spades'},\n //. . {rank: 7, suit: 'spades'} ]\n //.\n //. > S.sortBy (S.prop ('suit')) ([\n //. . {rank: 7, suit: 'spades'},\n //. . {rank: 5, suit: 'hearts'},\n //. . {rank: 2, suit: 'hearts'},\n //. . {rank: 5, suit: 'spades'},\n //. . ])\n //. [ {rank: 5, suit: 'hearts'},\n //. . {rank: 2, suit: 'hearts'},\n //. . {rank: 7, suit: 'spades'},\n //. . {rank: 5, suit: 'spades'} ]\n //. ```\n //.\n //. If descending order is desired, one may use [`Descending`][]:\n //.\n //. ```javascript\n //. > S.sortBy (Descending) ([83, 97, 110, 99, 116, 117, 97, 114, 121])\n //. [121, 117, 116, 114, 110, 99, 97, 97, 83]\n //. ```\n _.sortBy = {\n consts: {b: [Z.Ord], m: [Z.Applicative, Z.Foldable, Z.Monoid]},\n types: [$.Fn (a) (b), m (a), m (a)],\n impl: curry2 (Z.sortBy)\n };\n\n //# zip :: Array a -> Array b -> Array (Pair a b)\n //.\n //. Returns an array of pairs of corresponding elements from the given\n //. arrays. The length of the resulting array is equal to the length of\n //. the shorter input array.\n //.\n //. See also [`zipWith`](#zipWith).\n //.\n //. ```javascript\n //. > S.zip (['a', 'b']) (['x', 'y', 'z'])\n //. [Pair ('a') ('x'), Pair ('b') ('y')]\n //.\n //. > S.zip ([1, 3, 5]) ([2, 4])\n //. [Pair (1) (2), Pair (3) (4)]\n //. ```\n _.zip = {\n consts: {},\n types: [$.Array (a), $.Array (b), $.Array ($.Pair (a) (b))],\n impl: zipWith (Pair)\n };\n\n //# zipWith :: (a -> b -> c) -> Array a -> Array b -> Array c\n //.\n //. Returns the result of combining, pairwise, the given arrays using the\n //. given binary function. The length of the resulting array is equal to the\n //. length of the shorter input array.\n //.\n //. See also [`zip`](#zip).\n //.\n //. ```javascript\n //. > S.zipWith (a => b => a + b) (['a', 'b']) (['x', 'y', 'z'])\n //. ['ax', 'by']\n //.\n //. > S.zipWith (a => b => [a, b]) ([1, 3, 5]) ([2, 4])\n //. [[1, 2], [3, 4]]\n //. ```\n function zipWith(f) {\n return function(xs) {\n return function(ys) {\n var result = [];\n var len = Math.min (xs.length, ys.length);\n for (var idx = 0; idx < len; idx += 1) {\n result.push (f (xs[idx]) (ys[idx]));\n }\n return result;\n };\n };\n }\n _.zipWith = {\n consts: {},\n types: [$.Fn (a) ($.Fn (b) (c)), $.Array (a), $.Array (b), $.Array (c)],\n impl: zipWith\n };\n\n //. ### Object\n\n //# prop :: String -> a -> b\n //.\n //. Takes a property name and an object with known properties and returns\n //. the value of the specified property. If for some reason the object\n //. lacks the specified property, a type error is thrown.\n //.\n //. For accessing properties of uncertain objects, use [`get`](#get) instead.\n //. For accessing string map values by key, use [`value`](#value) instead.\n //.\n //. ```javascript\n //. > S.prop ('a') ({a: 1, b: 2})\n //. 1\n //. ```\n function prop(key) {\n return function(x) {\n var obj = toObject (x);\n if (key in obj) return obj[key];\n throw new TypeError ('‘prop’ expected object to have a property named ' +\n '‘' + key + '’; ' + show (x) + ' does not');\n };\n }\n _.prop = {\n consts: {},\n types: [$.String, a, b],\n impl: prop\n };\n\n //# props :: Array String -> a -> b\n //.\n //. Takes a property path (an array of property names) and an object with\n //. known structure and returns the value at the given path. If for some\n //. reason the path does not exist, a type error is thrown.\n //.\n //. For accessing property paths of uncertain objects, use [`gets`](#gets)\n //. instead.\n //.\n //. ```javascript\n //. > S.props (['a', 'b', 'c']) ({a: {b: {c: 1}}})\n //. 1\n //. ```\n function props(path) {\n return function(x) {\n return path.reduce (function(x, key) {\n var obj = toObject (x);\n if (key in obj) return obj[key];\n throw new TypeError ('‘props’ expected object to have a property at ' +\n show (path) + '; ' + show (x) + ' does not');\n }, x);\n };\n }\n _.props = {\n consts: {},\n types: [$.Array ($.String), a, b],\n impl: props\n };\n\n //# get :: (Any -> Boolean) -> String -> a -> Maybe b\n //.\n //. Takes a predicate, a property name, and an object and returns Just the\n //. value of the specified object property if it exists and the value\n //. satisfies the given predicate; Nothing otherwise.\n //.\n //. See also [`gets`](#gets), [`prop`](#prop), and [`value`](#value).\n //.\n //. ```javascript\n //. > S.get (S.is ($.Number)) ('x') ({x: 1, y: 2})\n //. Just (1)\n //.\n //. > S.get (S.is ($.Number)) ('x') ({x: '1', y: '2'})\n //. Nothing\n //.\n //. > S.get (S.is ($.Number)) ('x') ({})\n //. Nothing\n //.\n //. > S.get (S.is ($.Array ($.Number))) ('x') ({x: [1, 2, 3]})\n //. Just ([1, 2, 3])\n //.\n //. > S.get (S.is ($.Array ($.Number))) ('x') ({x: [1, 2, 3, null]})\n //. Nothing\n //. ```\n function get(pred) {\n return B (B (filter (pred))) (get_);\n }\n _.get = {\n consts: {},\n types: [$.Predicate ($.Any), $.String, a, $.Maybe (b)],\n impl: get\n };\n\n //# gets :: (Any -> Boolean) -> Array String -> a -> Maybe b\n //.\n //. Takes a predicate, a property path (an array of property names), and\n //. an object and returns Just the value at the given path if such a path\n //. exists and the value satisfies the given predicate; Nothing otherwise.\n //.\n //. See also [`get`](#get).\n //.\n //. ```javascript\n //. > S.gets (S.is ($.Number)) (['a', 'b', 'c']) ({a: {b: {c: 42}}})\n //. Just (42)\n //.\n //. > S.gets (S.is ($.Number)) (['a', 'b', 'c']) ({a: {b: {c: '42'}}})\n //. Nothing\n //.\n //. > S.gets (S.is ($.Number)) (['a', 'b', 'c']) ({})\n //. Nothing\n //. ```\n function gets(pred) {\n return function(keys) {\n return function(x) {\n return Z.filter (pred, keys.reduce (function(maybe, key) {\n return Z.chain (get_ (key), maybe);\n }, Just (x)));\n };\n };\n }\n _.gets = {\n consts: {},\n types: [$.Predicate ($.Any), $.Array ($.String), a, $.Maybe (b)],\n impl: gets\n };\n\n //. ### StrMap\n //.\n //. StrMap is an abbreviation of _string map_. A string map is an object,\n //. such as `{foo: 1, bar: 2, baz: 3}`, whose values are all members of\n //. the same type. Formally, a value is a member of type `StrMap a` if its\n //. [type identifier][] is `'Object'` and the values of its enumerable own\n //. properties are all members of type `a`.\n\n //# value :: String -> StrMap a -> Maybe a\n //.\n //. Retrieve the value associated with the given key in the given string map.\n //.\n //. Formally, `value (k) (m)` evaluates to `Just (m[k])` if `k` is an\n //. enumerable own property of `m`; `Nothing` otherwise.\n //.\n //. See also [`prop`](#prop) and [`get`](#get).\n //.\n //. ```javascript\n //. > S.value ('foo') ({foo: 1, bar: 2})\n //. Just (1)\n //.\n //. > S.value ('bar') ({foo: 1, bar: 2})\n //. Just (2)\n //.\n //. > S.value ('baz') ({foo: 1, bar: 2})\n //. Nothing\n //. ```\n function value(key) {\n return function(strMap) {\n return Object.prototype.propertyIsEnumerable.call (strMap, key) ?\n Just (strMap[key]) :\n Nothing;\n };\n }\n _.value = {\n consts: {},\n types: [$.String, $.StrMap (a), $.Maybe (a)],\n impl: value\n };\n\n //# singleton :: String -> a -> StrMap a\n //.\n //. Takes a string and a value of any type, and returns a string map with\n //. a single entry (mapping the key to the value).\n //.\n //. ```javascript\n //. > S.singleton ('foo') (42)\n //. {foo: 42}\n //. ```\n function singleton(key) {\n return function(val) {\n var strMap = {};\n strMap[key] = val;\n return strMap;\n };\n }\n _.singleton = {\n consts: {},\n types: [$.String, a, $.StrMap (a)],\n impl: singleton\n };\n\n //# insert :: String -> a -> StrMap a -> StrMap a\n //.\n //. Takes a string, a value of any type, and a string map, and returns a\n //. string map comprising all the entries of the given string map plus the\n //. entry specified by the first two arguments (which takes precedence).\n //.\n //. Equivalent to Haskell's `insert` function. Similar to Clojure's `assoc`\n //. function.\n //.\n //. ```javascript\n //. > S.insert ('c') (3) ({a: 1, b: 2})\n //. {a: 1, b: 2, c: 3}\n //.\n //. > S.insert ('a') (4) ({a: 1, b: 2})\n //. {a: 4, b: 2}\n //. ```\n function insert(key) {\n return function(val) {\n return function(strMap) {\n return Z.concat (strMap, singleton (key) (val));\n };\n };\n }\n _.insert = {\n consts: {},\n types: [$.String, a, $.StrMap (a), $.StrMap (a)],\n impl: insert\n };\n\n //# remove :: String -> StrMap a -> StrMap a\n //.\n //. Takes a string and a string map, and returns a string map comprising all\n //. the entries of the given string map except the one whose key matches the\n //. given string (if such a key exists).\n //.\n //. Equivalent to Haskell's `delete` function. Similar to Clojure's `dissoc`\n //. function.\n //.\n //. ```javascript\n //. > S.remove ('c') ({a: 1, b: 2, c: 3})\n //. {a: 1, b: 2}\n //.\n //. > S.remove ('c') ({})\n //. {}\n //. ```\n function remove(key) {\n return function(strMap) {\n var result = Z.concat (strMap, {});\n delete result[key];\n return result;\n };\n }\n _.remove = {\n consts: {},\n types: [$.String, $.StrMap (a), $.StrMap (a)],\n impl: remove\n };\n\n //# keys :: StrMap a -> Array String\n //.\n //. Returns the keys of the given string map, in arbitrary order.\n //.\n //. ```javascript\n //. > S.sort (S.keys ({b: 2, c: 3, a: 1}))\n //. ['a', 'b', 'c']\n //. ```\n _.keys = {\n consts: {},\n types: [$.StrMap (a), $.Array ($.String)],\n impl: Object.keys\n };\n\n //# values :: StrMap a -> Array a\n //.\n //. Returns the values of the given string map, in arbitrary order.\n //.\n //. ```javascript\n //. > S.sort (S.values ({a: 1, c: 3, b: 2}))\n //. [1, 2, 3]\n //. ```\n function values(strMap) {\n return Z.map (function(k) { return strMap[k]; }, Object.keys (strMap));\n }\n _.values = {\n consts: {},\n types: [$.StrMap (a), $.Array (a)],\n impl: values\n };\n\n //# pairs :: StrMap a -> Array (Pair String a)\n //.\n //. Returns the key–value pairs of the given string map, in arbitrary order.\n //.\n //. ```javascript\n //. > S.sort (S.pairs ({b: 2, a: 1, c: 3}))\n //. [Pair ('a') (1), Pair ('b') (2), Pair ('c') (3)]\n //. ```\n function pairs(strMap) {\n return Z.map (function(k) { return Pair (k) (strMap[k]); },\n Object.keys (strMap));\n }\n _.pairs = {\n consts: {},\n types: [$.StrMap (a), $.Array ($.Pair ($.String) (a))],\n impl: pairs\n };\n\n //# fromPairs :: Foldable f => f (Pair String a) -> StrMap a\n //.\n //. Returns a string map containing the key–value pairs specified by the\n //. given [Foldable][]. If a key appears in multiple pairs, the rightmost\n //. pair takes precedence.\n //.\n //. ```javascript\n //. > S.fromPairs ([S.Pair ('a') (1), S.Pair ('b') (2), S.Pair ('c') (3)])\n //. {a: 1, b: 2, c: 3}\n //.\n //. > S.fromPairs ([S.Pair ('x') (1), S.Pair ('x') (2)])\n //. {x: 2}\n //. ```\n function fromPairs(pairs) {\n return Z.reduce (function(strMap, pair) {\n strMap[pair.fst] = pair.snd;\n return strMap;\n }, {}, pairs);\n }\n _.fromPairs = {\n consts: {f: [Z.Foldable]},\n types: [f ($.Pair ($.String) (a)), $.StrMap (a)],\n impl: fromPairs\n };\n\n //. ### Number\n\n //# negate :: ValidNumber -> ValidNumber\n //.\n //. Negates its argument.\n //.\n //. ```javascript\n //. > S.negate (12.5)\n //. -12.5\n //.\n //. > S.negate (-42)\n //. 42\n //. ```\n function negate(n) {\n return -n;\n }\n _.negate = {\n consts: {},\n types: [$.ValidNumber, $.ValidNumber],\n impl: negate\n };\n\n //# add :: FiniteNumber -> FiniteNumber -> FiniteNumber\n //.\n //. Returns the sum of two (finite) numbers.\n //.\n //. ```javascript\n //. > S.add (1) (1)\n //. 2\n //. ```\n function add(x) {\n return function(y) {\n return x + y;\n };\n }\n _.add = {\n consts: {},\n types: [$.FiniteNumber, $.FiniteNumber, $.FiniteNumber],\n impl: add\n };\n\n //# sum :: Foldable f => f FiniteNumber -> FiniteNumber\n //.\n //. Returns the sum of the given array of (finite) numbers.\n //.\n //. ```javascript\n //. > S.sum ([1, 2, 3, 4, 5])\n //. 15\n //.\n //. > S.sum ([])\n //. 0\n //.\n //. > S.sum (S.Just (42))\n //. 42\n //.\n //. > S.sum (S.Nothing)\n //. 0\n //. ```\n _.sum = {\n consts: {f: [Z.Foldable]},\n types: [f ($.FiniteNumber), $.FiniteNumber],\n impl: reduce (add) (0)\n };\n\n //# sub :: FiniteNumber -> FiniteNumber -> FiniteNumber\n //.\n //. Takes a finite number `n` and returns the _subtract `n`_ function.\n //.\n //. ```javascript\n //. > S.map (S.sub (1)) ([1, 2, 3])\n //. [0, 1, 2]\n //. ```\n function sub(y) {\n return function(x) {\n return x - y;\n };\n }\n _.sub = {\n consts: {},\n types: [$.FiniteNumber, $.FiniteNumber, $.FiniteNumber],\n impl: sub\n };\n\n //# mult :: FiniteNumber -> FiniteNumber -> FiniteNumber\n //.\n //. Returns the product of two (finite) numbers.\n //.\n //. ```javascript\n //. > S.mult (4) (2)\n //. 8\n //. ```\n function mult(x) {\n return function(y) {\n return x * y;\n };\n }\n _.mult = {\n consts: {},\n types: [$.FiniteNumber, $.FiniteNumber, $.FiniteNumber],\n impl: mult\n };\n\n //# product :: Foldable f => f FiniteNumber -> FiniteNumber\n //.\n //. Returns the product of the given array of (finite) numbers.\n //.\n //. ```javascript\n //. > S.product ([1, 2, 3, 4, 5])\n //. 120\n //.\n //. > S.product ([])\n //. 1\n //.\n //. > S.product (S.Just (42))\n //. 42\n //.\n //. > S.product (S.Nothing)\n //. 1\n //. ```\n _.product = {\n consts: {f: [Z.Foldable]},\n types: [f ($.FiniteNumber), $.FiniteNumber],\n impl: reduce (mult) (1)\n };\n\n //# div :: NonZeroFiniteNumber -> FiniteNumber -> FiniteNumber\n //.\n //. Takes a non-zero finite number `n` and returns the _divide by `n`_\n //. function.\n //.\n //. ```javascript\n //. > S.map (S.div (2)) ([0, 1, 2, 3])\n //. [0, 0.5, 1, 1.5]\n //. ```\n function div(y) {\n return function(x) {\n return x / y;\n };\n }\n _.div = {\n consts: {},\n types: [$.NonZeroFiniteNumber, $.FiniteNumber, $.FiniteNumber],\n impl: div\n };\n\n //# pow :: FiniteNumber -> FiniteNumber -> FiniteNumber\n //.\n //. Takes a finite number `n` and returns the _power of `n`_ function.\n //.\n //. ```javascript\n //. > S.map (S.pow (2)) ([-3, -2, -1, 0, 1, 2, 3])\n //. [9, 4, 1, 0, 1, 4, 9]\n //.\n //. > S.map (S.pow (0.5)) ([1, 4, 9, 16, 25])\n //. [1, 2, 3, 4, 5]\n //. ```\n function pow(exp) {\n return function(base) {\n return Math.pow (base, exp);\n };\n }\n _.pow = {\n consts: {},\n types: [$.FiniteNumber, $.FiniteNumber, $.FiniteNumber],\n impl: pow\n };\n\n //# mean :: Foldable f => f FiniteNumber -> Maybe FiniteNumber\n //.\n //. Returns the mean of the given array of (finite) numbers.\n //.\n //. ```javascript\n //. > S.mean ([1, 2, 3, 4, 5])\n //. Just (3)\n //.\n //. > S.mean ([])\n //. Nothing\n //.\n //. > S.mean (S.Just (42))\n //. Just (42)\n //.\n //. > S.mean (S.Nothing)\n //. Nothing\n //. ```\n function mean(foldable) {\n var result = Z.reduce (\n function(acc, n) {\n acc.total += n;\n acc.count += 1;\n return acc;\n },\n {total: 0, count: 0},\n foldable\n );\n return result.count > 0 ? Just (result.total / result.count) : Nothing;\n }\n _.mean = {\n consts: {f: [Z.Foldable]},\n types: [f ($.FiniteNumber), $.Maybe ($.FiniteNumber)],\n impl: mean\n };\n\n //. ### Integer\n\n //# even :: Integer -> Boolean\n //.\n //. Returns `true` if the given integer is even; `false` if it is odd.\n //.\n //. ```javascript\n //. > S.even (42)\n //. true\n //.\n //. > S.even (99)\n //. false\n //. ```\n function even(n) {\n return n % 2 === 0;\n }\n _.even = {\n consts: {},\n types: [$.Integer, $.Boolean],\n impl: even\n };\n\n //# odd :: Integer -> Boolean\n //.\n //. Returns `true` if the given integer is odd; `false` if it is even.\n //.\n //. ```javascript\n //. > S.odd (99)\n //. true\n //.\n //. > S.odd (42)\n //. false\n //. ```\n function odd(n) {\n return n % 2 !== 0;\n }\n _.odd = {\n consts: {},\n types: [$.Integer, $.Boolean],\n impl: odd\n };\n\n //. ### Parse\n\n //# parseDate :: String -> Maybe ValidDate\n //.\n //. Takes a string `s` and returns `Just (new Date (s))` if `new Date (s)`\n //. evaluates to a [`ValidDate`][ValidDate] value; Nothing otherwise.\n //.\n //. As noted in [#488][], this function's behaviour is unspecified for some\n //. inputs! [MDN][date parsing] warns against using the `Date` constructor\n //. to parse date strings:\n //.\n //. > __Note:__ parsing of date strings with the `Date` constructor […] is\n //. > strongly discouraged due to browser differences and inconsistencies.\n //. > Support for RFC 2822 format strings is by convention only. Support for\n //. > ISO 8601 formats differs in that date-only strings (e.g. \"1970-01-01\")\n //. > are treated as UTC, not local.\n //.\n //. ```javascript\n //. > S.parseDate ('2011-01-19T17:40:00Z')\n //. Just (new Date ('2011-01-19T17:40:00.000Z'))\n //.\n //. > S.parseDate ('today')\n //. Nothing\n //. ```\n function parseDate(s) {\n var date = new Date (s);\n return isNaN (date.valueOf ()) ? Nothing : Just (date);\n }\n _.parseDate = {\n consts: {},\n types: [$.String, $.Maybe ($.ValidDate)],\n impl: parseDate\n };\n\n // requiredNonCapturingGroup :: Array String -> String\n function requiredNonCapturingGroup(xs) {\n return '(?:' + xs.join ('|') + ')';\n }\n\n // optionalNonCapturingGroup :: Array String -> String\n function optionalNonCapturingGroup(xs) {\n return requiredNonCapturingGroup (xs) + '?';\n }\n\n // validFloatRepr :: RegExp\n var validFloatRepr = new RegExp (\n '^' + // start-of-string anchor\n '\\\\s*' + // any number of leading whitespace characters\n '[+-]?' + // optional sign\n requiredNonCapturingGroup ([\n 'Infinity', // \"Infinity\"\n 'NaN', // \"NaN\"\n requiredNonCapturingGroup ([\n '[0-9]+', // number\n '[0-9]+[.][0-9]+', // number with interior decimal point\n '[0-9]+[.]', // number with trailing decimal point\n '[.][0-9]+' // number with leading decimal point\n ]) +\n optionalNonCapturingGroup ([\n '[Ee]' + // \"E\" or \"e\"\n '[+-]?' + // optional sign\n '[0-9]+' // exponent\n ])\n ]) +\n '\\\\s*' + // any number of trailing whitespace characters\n '$' // end-of-string anchor\n );\n\n //# parseFloat :: String -> Maybe Number\n //.\n //. Takes a string and returns Just the number represented by the string\n //. if it does in fact represent a number; Nothing otherwise.\n //.\n //. ```javascript\n //. > S.parseFloat ('-123.45')\n //. Just (-123.45)\n //.\n //. > S.parseFloat ('foo.bar')\n //. Nothing\n //. ```\n function parseFloat_(s) {\n return validFloatRepr.test (s) ? Just (parseFloat (s)) : Nothing;\n }\n _.parseFloat = {\n consts: {},\n types: [$.String, $.Maybe ($.Number)],\n impl: parseFloat_\n };\n\n // Radix :: Type\n var Radix = $.NullaryType\n ('Radix')\n ('')\n ([$.Integer])\n (function(x) { return x >= 2 && x <= 36; });\n\n //# parseInt :: Radix -> String -> Maybe Integer\n //.\n //. Takes a radix (an integer between 2 and 36 inclusive) and a string,\n //. and returns Just the number represented by the string if it does in\n //. fact represent a number in the base specified by the radix; Nothing\n //. otherwise.\n //.\n //. This function is stricter than [`parseInt`][parseInt]: a string\n //. is considered to represent an integer only if all its non-prefix\n //. characters are members of the character set specified by the radix.\n //.\n //. ```javascript\n //. > S.parseInt (10) ('-42')\n //. Just (-42)\n //.\n //. > S.parseInt (16) ('0xFF')\n //. Just (255)\n //.\n //. > S.parseInt (16) ('0xGG')\n //. Nothing\n //. ```\n function parseInt_(radix) {\n return function(s) {\n var charset = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.slice (0, radix);\n var pattern = new RegExp ('^[' + charset + ']+$', 'i');\n\n var t = s.replace (/^[+-]/, '');\n if (pattern.test (radix === 16 ? t.replace (/^0x/i, '') : t)) {\n var n = parseInt (s, radix);\n if ($.test ([]) ($.Integer) (n)) return Just (n);\n }\n return Nothing;\n };\n }\n _.parseInt = {\n consts: {},\n types: [Radix, $.String, $.Maybe ($.Integer)],\n impl: parseInt_\n };\n\n //# parseJson :: (Any -> Boolean) -> String -> Maybe a\n //.\n //. Takes a predicate and a string that may or may not be valid JSON, and\n //. returns Just the result of applying `JSON.parse` to the string *if* the\n //. result satisfies the predicate; Nothing otherwise.\n //.\n //. ```javascript\n //. > S.parseJson (S.is ($.Array ($.Integer))) ('[')\n //. Nothing\n //.\n //. > S.parseJson (S.is ($.Array ($.Integer))) ('[\"1\",\"2\",\"3\"]')\n //. Nothing\n //.\n //. > S.parseJson (S.is ($.Array ($.Integer))) ('[0,1.5,3,4.5]')\n //. Nothing\n //.\n //. > S.parseJson (S.is ($.Array ($.Integer))) ('[1,2,3]')\n //. Just ([1, 2, 3])\n //. ```\n function parseJson(pred) {\n return B (filter (pred)) (B (eitherToMaybe) (encase (JSON.parse)));\n }\n _.parseJson = {\n consts: {},\n types: [$.Predicate ($.Any), $.String, $.Maybe (a)],\n impl: parseJson\n };\n\n //. ### RegExp\n\n // Match :: Type\n var Match = $.RecordType ({\n match: $.String,\n groups: $.Array ($.Maybe ($.String))\n });\n\n // toMatch :: Array String? -> Match\n function toMatch(ss) {\n return {\n match: ss[0],\n groups: Z.map (B (reject (equals (undefined))) (Just), ss.slice (1))\n };\n }\n\n // withRegex :: (RegExp, () -> a) -> a\n function withRegex(pattern, thunk) {\n var lastIndex = pattern.lastIndex;\n var result = thunk ();\n pattern.lastIndex = lastIndex;\n return result;\n }\n\n //# regex :: RegexFlags -> String -> RegExp\n //.\n //. Takes a [RegexFlags][] and a pattern, and returns a RegExp.\n //.\n //. ```javascript\n //. > S.regex ('g') (':\\\\d+:')\n //. /:\\d+:/g\n //. ```\n function regex(flags) {\n return function(source) {\n return new RegExp (source, flags);\n };\n }\n _.regex = {\n consts: {},\n types: [$.RegexFlags, $.String, $.RegExp],\n impl: regex\n };\n\n //# regexEscape :: String -> String\n //.\n //. Takes a string that may contain regular expression metacharacters,\n //. and returns a string with those metacharacters escaped.\n //.\n //. Properties:\n //.\n //. - `forall s :: String.\n //. S.test (S.regex ('') (S.regexEscape (s))) (s) = true`\n //.\n //. ```javascript\n //. > S.regexEscape ('-=*{XYZ}*=-')\n //. '\\\\-=\\\\*\\\\{XYZ\\\\}\\\\*=\\\\-'\n //. ```\n function regexEscape(s) {\n return s.replace (/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\n }\n _.regexEscape = {\n consts: {},\n types: [$.String, $.String],\n impl: regexEscape\n };\n\n //# test :: RegExp -> String -> Boolean\n //.\n //. Takes a pattern and a string, and returns `true` [iff][] the pattern\n //. matches the string.\n //.\n //. ```javascript\n //. > S.test (/^a/) ('abacus')\n //. true\n //.\n //. > S.test (/^a/) ('banana')\n //. false\n //. ```\n function test(pattern) {\n return function(s) {\n return withRegex (pattern, function() { return pattern.test (s); });\n };\n }\n _.test = {\n consts: {},\n types: [$.RegExp, $.String, $.Boolean],\n impl: test\n };\n\n //# match :: NonGlobalRegExp -> String -> Maybe { match :: String, groups :: Array (Maybe String) }\n //.\n //. Takes a pattern and a string, and returns Just a match record if the\n //. pattern matches the string; Nothing otherwise.\n //.\n //. `groups :: Array (Maybe String)` acknowledges the existence of optional\n //. capturing groups.\n //.\n //. Properties:\n //.\n //. - `forall p :: Pattern, s :: String.\n //. S.head (S.matchAll (S.regex ('g') (p)) (s))\n //. = S.match (S.regex ('') (p)) (s)`\n //.\n //. See also [`matchAll`](#matchAll).\n //.\n //. ```javascript\n //. > S.match (/(good)?bye/) ('goodbye')\n //. Just ({match: 'goodbye', groups: [Just ('good')]})\n //.\n //. > S.match (/(good)?bye/) ('bye')\n //. Just ({match: 'bye', groups: [Nothing]})\n //. ```\n function match(pattern) {\n return function(s) {\n return Z.map (toMatch,\n Z.reject (equals (null), Just (s.match (pattern))));\n };\n }\n _.match = {\n consts: {},\n types: [$.NonGlobalRegExp, $.String, $.Maybe (Match)],\n impl: match\n };\n\n //# matchAll :: GlobalRegExp -> String -> Array { match :: String, groups :: Array (Maybe String) }\n //.\n //. Takes a pattern and a string, and returns an array of match records.\n //.\n //. `groups :: Array (Maybe String)` acknowledges the existence of optional\n //. capturing groups.\n //.\n //. See also [`match`](#match).\n //.\n //. ```javascript\n //. > S.matchAll (/@([a-z]+)/g) ('Hello, world!')\n //. []\n //.\n //. > S.matchAll (/@([a-z]+)/g) ('Hello, @foo! Hello, @bar! Hello, @baz!')\n //. [ {match: '@foo', groups: [Just ('foo')]},\n //. . {match: '@bar', groups: [Just ('bar')]},\n //. . {match: '@baz', groups: [Just ('baz')]} ]\n //. ```\n function matchAll(pattern) {\n return function(s) {\n return withRegex (pattern, function() {\n return unfoldr (function(_) {\n return Z.map (function(ss) {\n return Pair (toMatch (ss)) (null);\n }, Z.reject (equals (null), Just (pattern.exec (s))));\n }) ([]);\n });\n };\n }\n _.matchAll = {\n consts: {},\n types: [$.GlobalRegExp, $.String, $.Array (Match)],\n impl: matchAll\n };\n\n //. ### String\n\n //# toUpper :: String -> String\n //.\n //. Returns the upper-case equivalent of its argument.\n //.\n //. See also [`toLower`](#toLower).\n //.\n //. ```javascript\n //. > S.toUpper ('ABC def 123')\n //. 'ABC DEF 123'\n //. ```\n _.toUpper = {\n consts: {},\n types: [$.String, $.String],\n impl: invoke0 ('toUpperCase')\n };\n\n //# toLower :: String -> String\n //.\n //. Returns the lower-case equivalent of its argument.\n //.\n //. See also [`toUpper`](#toUpper).\n //.\n //. ```javascript\n //. > S.toLower ('ABC def 123')\n //. 'abc def 123'\n //. ```\n _.toLower = {\n consts: {},\n types: [$.String, $.String],\n impl: invoke0 ('toLowerCase')\n };\n\n //# trim :: String -> String\n //.\n //. Strips leading and trailing whitespace characters.\n //.\n //. ```javascript\n //. > S.trim ('\\t\\t foo bar \\n')\n //. 'foo bar'\n //. ```\n _.trim = {\n consts: {},\n types: [$.String, $.String],\n impl: invoke0 ('trim')\n };\n\n //# stripPrefix :: String -> String -> Maybe String\n //.\n //. Returns Just the portion of the given string (the second argument) left\n //. after removing the given prefix (the first argument) if the string starts\n //. with the prefix; Nothing otherwise.\n //.\n //. See also [`stripSuffix`](#stripSuffix).\n //.\n //. ```javascript\n //. > S.stripPrefix ('https://') ('https://sanctuary.js.org')\n //. Just ('sanctuary.js.org')\n //.\n //. > S.stripPrefix ('https://') ('http://sanctuary.js.org')\n //. Nothing\n //. ```\n function stripPrefix(prefix) {\n return function(s) {\n var idx = prefix.length;\n return s.slice (0, idx) === prefix ? Just (s.slice (idx)) : Nothing;\n };\n }\n _.stripPrefix = {\n consts: {},\n types: [$.String, $.String, $.Maybe ($.String)],\n impl: stripPrefix\n };\n\n //# stripSuffix :: String -> String -> Maybe String\n //.\n //. Returns Just the portion of the given string (the second argument) left\n //. after removing the given suffix (the first argument) if the string ends\n //. with the suffix; Nothing otherwise.\n //.\n //. See also [`stripPrefix`](#stripPrefix).\n //.\n //. ```javascript\n //. > S.stripSuffix ('.md') ('README.md')\n //. Just ('README')\n //.\n //. > S.stripSuffix ('.md') ('README')\n //. Nothing\n //. ```\n function stripSuffix(suffix) {\n return function(s) {\n var idx = s.length - suffix.length; // value may be negative\n return s.slice (idx) === suffix ? Just (s.slice (0, idx)) : Nothing;\n };\n }\n _.stripSuffix = {\n consts: {},\n types: [$.String, $.String, $.Maybe ($.String)],\n impl: stripSuffix\n };\n\n //# words :: String -> Array String\n //.\n //. Takes a string and returns the array of words the string contains\n //. (words are delimited by whitespace characters).\n //.\n //. See also [`unwords`](#unwords).\n //.\n //. ```javascript\n //. > S.words (' foo bar baz ')\n //. ['foo', 'bar', 'baz']\n //. ```\n function words(s) {\n var words = s.split (/\\s+/);\n var len = words.length;\n return words.slice (words[0] === '' ? 1 : 0,\n words[len - 1] === '' ? len - 1 : len);\n }\n _.words = {\n consts: {},\n types: [$.String, $.Array ($.String)],\n impl: words\n };\n\n //# unwords :: Array String -> String\n //.\n //. Takes an array of words and returns the result of joining the words\n //. with separating spaces.\n //.\n //. See also [`words`](#words).\n //.\n //. ```javascript\n //. > S.unwords (['foo', 'bar', 'baz'])\n //. 'foo bar baz'\n //. ```\n _.unwords = {\n consts: {},\n types: [$.Array ($.String), $.String],\n impl: invoke1 ('join') (' ')\n };\n\n //# lines :: String -> Array String\n //.\n //. Takes a string and returns the array of lines the string contains\n //. (lines are delimited by newlines: `'\\n'` or `'\\r\\n'` or `'\\r'`).\n //. The resulting strings do not contain newlines.\n //.\n //. See also [`unlines`](#unlines).\n //.\n //. ```javascript\n //. > S.lines ('foo\\nbar\\nbaz\\n')\n //. ['foo', 'bar', 'baz']\n //. ```\n function lines(s) {\n return s === '' ? []\n : (s.replace (/\\r\\n?/g, '\\n')).match (/^(?=[\\s\\S]).*/gm);\n }\n _.lines = {\n consts: {},\n types: [$.String, $.Array ($.String)],\n impl: lines\n };\n\n //# unlines :: Array String -> String\n //.\n //. Takes an array of lines and returns the result of joining the lines\n //. after appending a terminating line feed (`'\\n'`) to each.\n //.\n //. See also [`lines`](#lines).\n //.\n //. ```javascript\n //. > S.unlines (['foo', 'bar', 'baz'])\n //. 'foo\\nbar\\nbaz\\n'\n //. ```\n function unlines(xs) {\n return xs.reduce (function(s, x) { return s + x + '\\n'; }, '');\n }\n _.unlines = {\n consts: {},\n types: [$.Array ($.String), $.String],\n impl: unlines\n };\n\n //# splitOn :: String -> String -> Array String\n //.\n //. Returns the substrings of its second argument separated by occurrences\n //. of its first argument.\n //.\n //. See also [`joinWith`](#joinWith) and [`splitOnRegex`](#splitOnRegex).\n //.\n //. ```javascript\n //. > S.splitOn ('::') ('foo::bar::baz')\n //. ['foo', 'bar', 'baz']\n //. ```\n _.splitOn = {\n consts: {},\n types: [$.String, $.String, $.Array ($.String)],\n impl: invoke1 ('split')\n };\n\n //# splitOnRegex :: GlobalRegExp -> String -> Array String\n //.\n //. Takes a pattern and a string, and returns the result of splitting the\n //. string at every non-overlapping occurrence of the pattern.\n //.\n //. Properties:\n //.\n //. - `forall s :: String, t :: String.\n //. S.joinWith (s)\n //. (S.splitOnRegex (S.regex ('g') (S.regexEscape (s))) (t))\n //. = t`\n //.\n //. See also [`splitOn`](#splitOn).\n //.\n //. ```javascript\n //. > S.splitOnRegex (/[,;][ ]*/g) ('foo, bar, baz')\n //. ['foo', 'bar', 'baz']\n //.\n //. > S.splitOnRegex (/[,;][ ]*/g) ('foo;bar;baz')\n //. ['foo', 'bar', 'baz']\n //. ```\n function splitOnRegex(pattern) {\n return function(s) {\n return withRegex (pattern, function() {\n var result = [];\n var lastIndex = 0;\n var match;\n while ((match = pattern.exec (s)) != null) {\n if (pattern.lastIndex === lastIndex && match[0] === '') {\n if (pattern.lastIndex === s.length) return result;\n pattern.lastIndex += 1;\n } else {\n result.push (s.slice (lastIndex, match.index));\n lastIndex = match.index + match[0].length;\n }\n }\n result.push (s.slice (lastIndex));\n return result;\n });\n };\n }\n _.splitOnRegex = {\n consts: {},\n types: [$.GlobalRegExp, $.String, $.Array ($.String)],\n impl: splitOnRegex\n };\n\n return create ({\n checkTypes: typeof process === 'undefined'\n || process == null\n || process.env == null\n || process.env.NODE_ENV !== 'production',\n env: $.env\n });\n\n}));\n\n//. [#438]: https://github.com/sanctuary-js/sanctuary/issues/438\n//. [#488]: https://github.com/sanctuary-js/sanctuary/issues/488\n//. [Apply]: v:fantasyland/fantasy-land#apply\n//. [Chain]: v:fantasyland/fantasy-land#chain\n//. [Either]: #section:either\n//. [Fantasy Land]: v:fantasyland/fantasy-land\n//. [Foldable]: v:fantasyland/fantasy-land#foldable\n//. [Folktale]: https://folktale.origamitower.com/\n//. [GIGO]: https://en.wikipedia.org/wiki/Garbage_in,_garbage_out\n//. [Haskell]: https://www.haskell.org/\n//. [Kleisli]: https://en.wikipedia.org/wiki/Kleisli_category\n//. [Maybe]: #section:maybe\n//. [Nullable]: v:sanctuary-js/sanctuary-def#Nullable\n//. [PureScript]: http://www.purescript.org/\n//. [Ramda]: https://ramdajs.com/\n//. [RegexFlags]: v:sanctuary-js/sanctuary-def#RegexFlags\n//. [Semigroupoid]: v:fantasyland/fantasy-land#semigroupoid\n//. [ValidDate]: v:sanctuary-js/sanctuary-def#ValidDate\n//. [`$.test`]: v:sanctuary-js/sanctuary-def#test\n//. [`Descending`]: v:sanctuary-js/sanctuary-descending#Descending\n//. [`R.__`]: https://ramdajs.com/docs/#__\n//. [`R.bind`]: https://ramdajs.com/docs/#bind\n//. [`R.invoker`]: https://ramdajs.com/docs/#invoker\n//. [`Z.alt`]: v:sanctuary-js/sanctuary-type-classes#alt\n//. [`Z.ap`]: v:sanctuary-js/sanctuary-type-classes#ap\n//. [`Z.apFirst`]: v:sanctuary-js/sanctuary-type-classes#apFirst\n//. [`Z.apSecond`]: v:sanctuary-js/sanctuary-type-classes#apSecond\n//. [`Z.bimap`]: v:sanctuary-js/sanctuary-type-classes#bimap\n//. [`Z.chain`]: v:sanctuary-js/sanctuary-type-classes#chain\n//. [`Z.chainRec`]: v:sanctuary-js/sanctuary-type-classes#chainRec\n//. [`Z.compose`]: v:sanctuary-js/sanctuary-type-classes#compose\n//. [`Z.concat`]: v:sanctuary-js/sanctuary-type-classes#concat\n//. [`Z.contramap`]: v:sanctuary-js/sanctuary-type-classes#contramap\n//. [`Z.duplicate`]: v:sanctuary-js/sanctuary-type-classes#duplicate\n//. [`Z.empty`]: v:sanctuary-js/sanctuary-type-classes#empty\n//. [`Z.equals`]: v:sanctuary-js/sanctuary-type-classes#equals\n//. [`Z.extend`]: v:sanctuary-js/sanctuary-type-classes#extend\n//. [`Z.extract`]: v:sanctuary-js/sanctuary-type-classes#extract\n//. [`Z.filter`]: v:sanctuary-js/sanctuary-type-classes#filter\n//. [`Z.flip`]: v:sanctuary-js/sanctuary-type-classes#flip\n//. [`Z.foldMap`]: v:sanctuary-js/sanctuary-type-classes#foldMap\n//. [`Z.gt`]: v:sanctuary-js/sanctuary-type-classes#gt\n//. [`Z.gte`]: v:sanctuary-js/sanctuary-type-classes#gte\n//. [`Z.id`]: v:sanctuary-js/sanctuary-type-classes#id\n//. [`Z.invert`]: v:sanctuary-js/sanctuary-type-classes#invert\n//. [`Z.join`]: v:sanctuary-js/sanctuary-type-classes#join\n//. [`Z.lt`]: v:sanctuary-js/sanctuary-type-classes#lt\n//. [`Z.lte`]: v:sanctuary-js/sanctuary-type-classes#lte\n//. [`Z.map`]: v:sanctuary-js/sanctuary-type-classes#map\n//. [`Z.mapLeft`]: v:sanctuary-js/sanctuary-type-classes#mapLeft\n//. [`Z.of`]: v:sanctuary-js/sanctuary-type-classes#of\n//. [`Z.promap`]: v:sanctuary-js/sanctuary-type-classes#promap\n//. [`Z.reject`]: v:sanctuary-js/sanctuary-type-classes#reject\n//. [`Z.sequence`]: v:sanctuary-js/sanctuary-type-classes#sequence\n//. [`Z.traverse`]: v:sanctuary-js/sanctuary-type-classes#traverse\n//. [`Z.zero`]: v:sanctuary-js/sanctuary-type-classes#zero\n//. [`show`]: v:sanctuary-js/sanctuary-show#show\n//. [date parsing]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date\n//. [equivalence]: https://en.wikipedia.org/wiki/Equivalence_relation\n//. [iff]: https://en.wikipedia.org/wiki/If_and_only_if\n//. [parseInt]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt\n//. [partial functions]: https://en.wikipedia.org/wiki/Partial_function\n//. [ramda/ramda#683]: https://github.com/ramda/ramda/issues/683\n//. [ramda/ramda#1413]: https://github.com/ramda/ramda/issues/1413\n//. [ramda/ramda#1419]: https://github.com/ramda/ramda/pull/1419\n//. [sanctuary-def]: v:sanctuary-js/sanctuary-def\n//. [sanctuary-either]: v:sanctuary-js/sanctuary-either\n//. [sanctuary-maybe]: v:sanctuary-js/sanctuary-maybe\n//. [sanctuary-pair]: v:sanctuary-js/sanctuary-pair\n//. [sanctuary-show]: v:sanctuary-js/sanctuary-show\n//. [sanctuary-type-classes]: v:sanctuary-js/sanctuary-type-classes\n//. [stable sort]: https://en.wikipedia.org/wiki/Sorting_algorithm#Stability\n//. [thrush]: https://github.com/raganwald-deprecated/homoiconic/blob/master/2008-10-30/thrush.markdown\n//. [total functions]: https://en.wikipedia.org/wiki/Partial_function#Total_function\n//. [type checking]: #section:type-checking\n//. [type identifier]: v:sanctuary-js/sanctuary-type-identifiers\n//. [type representative]: v:fantasyland/fantasy-land#type-representatives\n//. [variadic functions]: https://en.wikipedia.org/wiki/Variadic_function\n","import _curry2 from './internal/_curry2.js';\nimport _isString from './internal/_isString.js';\n\n/**\n * Returns the nth element of the given list or string. If n is negative the\n * element at index length + n is returned.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> a | Undefined\n * @sig Number -> String -> String\n * @param {Number} offset\n * @param {*} list\n * @return {*}\n * @example\n *\n * const list = ['foo', 'bar', 'baz', 'quux'];\n * R.nth(1, list); //=> 'bar'\n * R.nth(-1, list); //=> 'quux'\n * R.nth(-99, list); //=> undefined\n *\n * R.nth(2, 'abc'); //=> 'c'\n * R.nth(3, 'abc'); //=> ''\n * @symb R.nth(-1, [a, b, c]) = c\n * @symb R.nth(0, [a, b, c]) = a\n * @symb R.nth(1, [a, b, c]) = b\n */\nvar nth = /*#__PURE__*/_curry2(function nth(offset, list) {\n var idx = offset < 0 ? list.length + offset : offset;\n return _isString(list) ? list.charAt(idx) : list[idx];\n});\nexport default nth;","import _isArrayLike from './_isArrayLike.js';\n\n/**\n * `_makeFlat` is a helper function that returns a one-level or fully recursive\n * function based on the flag passed in.\n *\n * @private\n */\nexport default function _makeFlat(recursive) {\n return function flatt(list) {\n var value, jlen, j;\n var result = [];\n var idx = 0;\n var ilen = list.length;\n\n while (idx < ilen) {\n if (_isArrayLike(list[idx])) {\n value = recursive ? flatt(list[idx]) : list[idx];\n j = 0;\n jlen = value.length;\n while (j < jlen) {\n result[result.length] = value[j];\n j += 1;\n }\n } else {\n result[result.length] = list[idx];\n }\n idx += 1;\n }\n return result;\n };\n}","import _curry3 from './internal/_curry3.js';\nimport _has from './internal/_has.js';\n\n/**\n * Creates a new object with the own properties of the two provided objects. If\n * a key exists in both objects, the provided function is applied to the key\n * and the values associated with the key in each object, with the result being\n * used as the value associated with the key in the returned object.\n *\n * @func\n * @memberOf R\n * @since v0.19.0\n * @category Object\n * @sig ((String, a, a) -> a) -> {a} -> {a} -> {a}\n * @param {Function} fn\n * @param {Object} l\n * @param {Object} r\n * @return {Object}\n * @see R.mergeDeepWithKey, R.merge, R.mergeWith\n * @example\n *\n * let concatValues = (k, l, r) => k == 'values' ? R.concat(l, r) : r\n * R.mergeWithKey(concatValues,\n * { a: true, thing: 'foo', values: [10, 20] },\n * { b: true, thing: 'bar', values: [15, 35] });\n * //=> { a: true, b: true, thing: 'bar', values: [10, 20, 15, 35] }\n * @symb R.mergeWithKey(f, { x: 1, y: 2 }, { y: 5, z: 3 }) = { x: 1, y: f('y', 2, 5), z: 3 }\n */\nvar mergeWithKey = /*#__PURE__*/_curry3(function mergeWithKey(fn, l, r) {\n var result = {};\n var k;\n\n for (k in l) {\n if (_has(k, l)) {\n result[k] = _has(k, r) ? fn(k, l[k], r[k]) : l[k];\n }\n }\n\n for (k in r) {\n if (_has(k, r) && !_has(k, result)) {\n result[k] = r[k];\n }\n }\n\n return result;\n});\nexport default mergeWithKey;","/*\n* FileSaver.js\n* A saveAs() FileSaver implementation.\n*\n* By Eli Grey, http://eligrey.com\n*\n* License : https://github.com/eligrey/FileSaver.js/blob/master/LICENSE.md (MIT)\n* source : http://purl.eligrey.com/github/FileSaver.js\n*/\n\n// The one and only way of getting global scope in all environments\n// https://stackoverflow.com/q/3277182/1008999\nvar _global = typeof window === 'object' && window.window === window\n ? window : typeof self === 'object' && self.self === self\n ? self : typeof global === 'object' && global.global === global\n ? global\n : this\n\nfunction bom (blob, opts) {\n if (typeof opts === 'undefined') opts = { autoBom: false }\n else if (typeof opts !== 'object') {\n console.warn('Deprecated: Expected third argument to be a object')\n opts = { autoBom: !opts }\n }\n\n // prepend BOM for UTF-8 XML and text/* types (including HTML)\n // note: your browser will automatically convert UTF-16 U+FEFF to EF BB BF\n if (opts.autoBom && /^\\s*(?:text\\/\\S*|application\\/xml|\\S*\\/\\S*\\+xml)\\s*;.*charset\\s*=\\s*utf-8/i.test(blob.type)) {\n return new Blob([String.fromCharCode(0xFEFF), blob], { type: blob.type })\n }\n return blob\n}\n\nfunction download (url, name, opts) {\n var xhr = new XMLHttpRequest()\n xhr.open('GET', url)\n xhr.responseType = 'blob'\n xhr.onload = function () {\n saveAs(xhr.response, name, opts)\n }\n xhr.onerror = function () {\n console.error('could not download file')\n }\n xhr.send()\n}\n\nfunction corsEnabled (url) {\n var xhr = new XMLHttpRequest()\n // use sync to avoid popup blocker\n xhr.open('HEAD', url, false)\n try {\n xhr.send()\n } catch (e) {}\n return xhr.status >= 200 && xhr.status <= 299\n}\n\n// `a.click()` doesn't work for all browsers (#465)\nfunction click (node) {\n try {\n node.dispatchEvent(new MouseEvent('click'))\n } catch (e) {\n var evt = document.createEvent('MouseEvents')\n evt.initMouseEvent('click', true, true, window, 0, 0, 0, 80,\n 20, false, false, false, false, 0, null)\n node.dispatchEvent(evt)\n }\n}\n\nvar saveAs = _global.saveAs || (\n // probably in some web worker\n (typeof window !== 'object' || window !== _global)\n ? function saveAs () { /* noop */ }\n\n // Use download attribute first if possible (#193 Lumia mobile)\n : 'download' in HTMLAnchorElement.prototype\n ? function saveAs (blob, name, opts) {\n var URL = _global.URL || _global.webkitURL\n var a = document.createElement('a')\n name = name || blob.name || 'download'\n\n a.download = name\n a.rel = 'noopener' // tabnabbing\n\n // TODO: detect chrome extensions & packaged apps\n // a.target = '_blank'\n\n if (typeof blob === 'string') {\n // Support regular links\n a.href = blob\n if (a.origin !== location.origin) {\n corsEnabled(a.href)\n ? download(blob, name, opts)\n : click(a, a.target = '_blank')\n } else {\n click(a)\n }\n } else {\n // Support blobs\n a.href = URL.createObjectURL(blob)\n setTimeout(function () { URL.revokeObjectURL(a.href) }, 4E4) // 40s\n setTimeout(function () { click(a) }, 0)\n }\n }\n\n // Use msSaveOrOpenBlob as a second approach\n : 'msSaveOrOpenBlob' in navigator\n ? function saveAs (blob, name, opts) {\n name = name || blob.name || 'download'\n\n if (typeof blob === 'string') {\n if (corsEnabled(blob)) {\n download(blob, name, opts)\n } else {\n var a = document.createElement('a')\n a.href = blob\n a.target = '_blank'\n setTimeout(function () { click(a) })\n }\n } else {\n navigator.msSaveOrOpenBlob(bom(blob, opts), name)\n }\n }\n\n // Fallback to using FileReader and a popup\n : function saveAs (blob, name, opts, popup) {\n // Open a popup immediately do go around popup blocker\n // Mostly only available on user interaction and the fileReader is async so...\n popup = popup || open('', '_blank')\n if (popup) {\n popup.document.title =\n popup.document.body.innerText = 'downloading...'\n }\n\n if (typeof blob === 'string') return download(blob, name, opts)\n\n var force = blob.type === 'application/octet-stream'\n var isSafari = /constructor/i.test(_global.HTMLElement) || _global.safari\n var isChromeIOS = /CriOS\\/[\\d]+/.test(navigator.userAgent)\n\n if ((isChromeIOS || (force && isSafari)) && typeof FileReader === 'object') {\n // Safari doesn't allow downloading of blob URLs\n var reader = new FileReader()\n reader.onloadend = function () {\n var url = reader.result\n url = isChromeIOS ? url : url.replace(/^data:[^;]*;/, 'data:attachment/file;')\n if (popup) popup.location.href = url\n else location = url\n popup = null // reverse-tabnabbing #460\n }\n reader.readAsDataURL(blob)\n } else {\n var URL = _global.URL || _global.webkitURL\n var url = URL.createObjectURL(blob)\n if (popup) popup.location = url\n else location.href = url\n popup = null // reverse-tabnabbing #460\n setTimeout(function () { URL.revokeObjectURL(url) }, 4E4) // 40s\n }\n }\n)\n\n_global.saveAs = saveAs.saveAs = saveAs\n\nif (typeof module !== 'undefined') {\n module.exports = saveAs;\n}\n","/**\n * Detect Element Resize.\n * https://github.com/sdecima/javascript-detect-element-resize\n * Sebastian Decima\n *\n * Forked from version 0.5.3; includes the following modifications:\n * 1) Guard against unsafe 'window' and 'document' references (to support SSR).\n * 2) Defer initialization code via a top-level function wrapper (to support SSR).\n * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.\n * 4) Add nonce for style element.\n * 5) Added support for injecting custom window object\n **/\nexport default function createDetectElementResize(nonce, hostWindow) {\n // Check `document` and `window` in case of server-side rendering\n var _window;\n\n if (typeof hostWindow !== 'undefined') {\n _window = hostWindow;\n } else if (typeof window !== 'undefined') {\n _window = window;\n } else if (typeof self !== 'undefined') {\n _window = self;\n } else {\n _window = global;\n }\n\n var attachEvent = typeof _window.document !== 'undefined' && _window.document.attachEvent;\n\n if (!attachEvent) {\n var requestFrame = function () {\n var raf = _window.requestAnimationFrame || _window.mozRequestAnimationFrame || _window.webkitRequestAnimationFrame || function (fn) {\n return _window.setTimeout(fn, 20);\n };\n\n return function (fn) {\n return raf(fn);\n };\n }();\n\n var cancelFrame = function () {\n var cancel = _window.cancelAnimationFrame || _window.mozCancelAnimationFrame || _window.webkitCancelAnimationFrame || _window.clearTimeout;\n return function (id) {\n return cancel(id);\n };\n }();\n\n var resetTriggers = function resetTriggers(element) {\n var triggers = element.__resizeTriggers__,\n expand = triggers.firstElementChild,\n contract = triggers.lastElementChild,\n expandChild = expand.firstElementChild;\n contract.scrollLeft = contract.scrollWidth;\n contract.scrollTop = contract.scrollHeight;\n expandChild.style.width = expand.offsetWidth + 1 + 'px';\n expandChild.style.height = expand.offsetHeight + 1 + 'px';\n expand.scrollLeft = expand.scrollWidth;\n expand.scrollTop = expand.scrollHeight;\n };\n\n var checkTriggers = function checkTriggers(element) {\n return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;\n };\n\n var scrollListener = function scrollListener(e) {\n // Don't measure (which forces) reflow for scrolls that happen inside of children!\n if (e.target.className && typeof e.target.className.indexOf === 'function' && e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {\n return;\n }\n\n var element = this;\n resetTriggers(this);\n\n if (this.__resizeRAF__) {\n cancelFrame(this.__resizeRAF__);\n }\n\n this.__resizeRAF__ = requestFrame(function () {\n if (checkTriggers(element)) {\n element.__resizeLast__.width = element.offsetWidth;\n element.__resizeLast__.height = element.offsetHeight;\n\n element.__resizeListeners__.forEach(function (fn) {\n fn.call(element, e);\n });\n }\n });\n };\n /* Detect CSS Animations support to detect element display/re-attach */\n\n\n var animation = false,\n keyframeprefix = '',\n animationstartevent = 'animationstart',\n domPrefixes = 'Webkit Moz O ms'.split(' '),\n startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),\n pfx = '';\n {\n var elm = _window.document.createElement('fakeelement');\n\n if (elm.style.animationName !== undefined) {\n animation = true;\n }\n\n if (animation === false) {\n for (var i = 0; i < domPrefixes.length; i++) {\n if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {\n pfx = domPrefixes[i];\n keyframeprefix = '-' + pfx.toLowerCase() + '-';\n animationstartevent = startEvents[i];\n animation = true;\n break;\n }\n }\n }\n }\n var animationName = 'resizeanim';\n var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';\n var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';\n }\n\n var createStyles = function createStyles(doc) {\n if (!doc.getElementById('detectElementResize')) {\n //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360\n var css = (animationKeyframes ? animationKeyframes : '') + '.resize-triggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',\n head = doc.head || doc.getElementsByTagName('head')[0],\n style = doc.createElement('style');\n style.id = 'detectElementResize';\n style.type = 'text/css';\n\n if (nonce != null) {\n style.setAttribute('nonce', nonce);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(doc.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n };\n\n var addResizeListener = function addResizeListener(element, fn) {\n if (attachEvent) {\n element.attachEvent('onresize', fn);\n } else {\n if (!element.__resizeTriggers__) {\n var doc = element.ownerDocument;\n\n var elementStyle = _window.getComputedStyle(element);\n\n if (elementStyle && elementStyle.position == 'static') {\n element.style.position = 'relative';\n }\n\n createStyles(doc);\n element.__resizeLast__ = {};\n element.__resizeListeners__ = [];\n (element.__resizeTriggers__ = doc.createElement('div')).className = 'resize-triggers';\n var resizeTriggersHtml = '
' + '
';\n\n if (window.trustedTypes) {\n var staticPolicy = trustedTypes.createPolicy('react-virtualized-auto-sizer', {\n createHTML: function createHTML() {\n return resizeTriggersHtml;\n }\n });\n element.__resizeTriggers__.innerHTML = staticPolicy.createHTML('');\n } else {\n element.__resizeTriggers__.innerHTML = resizeTriggersHtml;\n }\n\n element.appendChild(element.__resizeTriggers__);\n resetTriggers(element);\n element.addEventListener('scroll', scrollListener, true);\n /* Listen for a css animation to detect element display/re-attach */\n\n if (animationstartevent) {\n element.__resizeTriggers__.__animationListener__ = function animationListener(e) {\n if (e.animationName == animationName) {\n resetTriggers(element);\n }\n };\n\n element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);\n }\n }\n\n element.__resizeListeners__.push(fn);\n }\n };\n\n var removeResizeListener = function removeResizeListener(element, fn) {\n if (attachEvent) {\n element.detachEvent('onresize', fn);\n } else {\n element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);\n\n if (!element.__resizeListeners__.length) {\n element.removeEventListener('scroll', scrollListener, true);\n\n if (element.__resizeTriggers__.__animationListener__) {\n element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);\n\n element.__resizeTriggers__.__animationListener__ = null;\n }\n\n try {\n element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);\n } catch (e) {// Preact compat; see developit/preact-compat/issues/228\n }\n }\n }\n };\n\n return {\n addResizeListener: addResizeListener,\n removeResizeListener: removeResizeListener\n };\n}","import _curry1 from './internal/_curry1.js';\nimport curryN from './curryN.js';\n\n/**\n * Returns a new function much like the supplied one, except that the first two\n * arguments' order is reversed.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category Function\n * @sig ((a, b, c, ...) -> z) -> (b -> a -> c -> ... -> z)\n * @param {Function} fn The function to invoke with its first two parameters reversed.\n * @return {*} The result of invoking `fn` with its first two parameters' order reversed.\n * @example\n *\n * const mergeThree = (a, b, c) => [].concat(a, b, c);\n *\n * mergeThree(1, 2, 3); //=> [1, 2, 3]\n *\n * R.flip(mergeThree)(1, 2, 3); //=> [2, 1, 3]\n * @symb R.flip(f)(a, b, c) = f(b, a, c)\n */\nvar flip = /*#__PURE__*/_curry1(function flip(fn) {\n return curryN(fn.length, function (a, b) {\n var args = Array.prototype.slice.call(arguments, 0);\n args[0] = b;\n args[1] = a;\n return fn.apply(this, args);\n });\n});\nexport default flip;","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name getDaysInMonth\n * @category Month Helpers\n * @summary Get the number of days in a month of the given date.\n *\n * @description\n * Get the number of days in a month of the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the given date\n * @returns {Number} the number of days in a month\n * @throws {TypeError} 1 argument required\n *\n * @example\n * // How many days are in February 2000?\n * const result = getDaysInMonth(new Date(2000, 1))\n * //=> 29\n */\n\nexport default function getDaysInMonth(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var year = date.getFullYear();\n var monthIndex = date.getMonth();\n var lastDayOfMonth = new Date(0);\n lastDayOfMonth.setFullYear(year, monthIndex + 1, 0);\n lastDayOfMonth.setHours(0, 0, 0, 0);\n return lastDayOfMonth.getDate();\n}","export default function addLeadingZeros(number, targetLength) {\n var sign = number < 0 ? '-' : '';\n var output = Math.abs(number).toString();\n\n while (output.length < targetLength) {\n output = '0' + output;\n }\n\n return sign + output;\n}","import addLeadingZeros from \"../../addLeadingZeros/index.js\";\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | |\n * | d | Day of month | D | |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | m | Minute | M | Month |\n * | s | Second | S | Fraction of second |\n * | y | Year (abs) | Y | |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n */\n\nvar formatters = {\n // Year\n y: function (date, token) {\n // From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens\n // | Year | y | yy | yyy | yyyy | yyyyy |\n // |----------|-------|----|-------|-------|-------|\n // | AD 1 | 1 | 01 | 001 | 0001 | 00001 |\n // | AD 12 | 12 | 12 | 012 | 0012 | 00012 |\n // | AD 123 | 123 | 23 | 123 | 0123 | 00123 |\n // | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |\n // | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return addLeadingZeros(token === 'yy' ? year % 100 : year, token.length);\n },\n // Month\n M: function (date, token) {\n var month = date.getUTCMonth();\n return token === 'M' ? String(month + 1) : addLeadingZeros(month + 1, 2);\n },\n // Day of the month\n d: function (date, token) {\n return addLeadingZeros(date.getUTCDate(), token.length);\n },\n // AM or PM\n a: function (date, token) {\n var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return dayPeriodEnumValue.toUpperCase();\n\n case 'aaa':\n return dayPeriodEnumValue;\n\n case 'aaaaa':\n return dayPeriodEnumValue[0];\n\n case 'aaaa':\n default:\n return dayPeriodEnumValue === 'am' ? 'a.m.' : 'p.m.';\n }\n },\n // Hour [1-12]\n h: function (date, token) {\n return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);\n },\n // Hour [0-23]\n H: function (date, token) {\n return addLeadingZeros(date.getUTCHours(), token.length);\n },\n // Minute\n m: function (date, token) {\n return addLeadingZeros(date.getUTCMinutes(), token.length);\n },\n // Second\n s: function (date, token) {\n return addLeadingZeros(date.getUTCSeconds(), token.length);\n },\n // Fraction of second\n S: function (date, token) {\n var numberOfDigits = token.length;\n var milliseconds = date.getUTCMilliseconds();\n var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));\n return addLeadingZeros(fractionalSeconds, token.length);\n }\n};\nexport default formatters;","import toDate from \"../../toDate/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCDayOfYear(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var timestamp = date.getTime();\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n var startOfYearTimestamp = date.getTime();\n var difference = timestamp - startOfYearTimestamp;\n return Math.floor(difference / MILLISECONDS_IN_DAY) + 1;\n}","import lightFormatters from \"../lightFormatters/index.js\";\nimport getUTCDayOfYear from \"../../../_lib/getUTCDayOfYear/index.js\";\nimport getUTCISOWeek from \"../../../_lib/getUTCISOWeek/index.js\";\nimport getUTCISOWeekYear from \"../../../_lib/getUTCISOWeekYear/index.js\";\nimport getUTCWeek from \"../../../_lib/getUTCWeek/index.js\";\nimport getUTCWeekYear from \"../../../_lib/getUTCWeekYear/index.js\";\nimport addLeadingZeros from \"../../addLeadingZeros/index.js\";\nvar dayPeriodEnum = {\n am: 'am',\n pm: 'pm',\n midnight: 'midnight',\n noon: 'noon',\n morning: 'morning',\n afternoon: 'afternoon',\n evening: 'evening',\n night: 'night'\n};\n/*\n * | | Unit | | Unit |\n * |-----|--------------------------------|-----|--------------------------------|\n * | a | AM, PM | A* | Milliseconds in day |\n * | b | AM, PM, noon, midnight | B | Flexible day period |\n * | c | Stand-alone local day of week | C* | Localized hour w/ day period |\n * | d | Day of month | D | Day of year |\n * | e | Local day of week | E | Day of week |\n * | f | | F* | Day of week in month |\n * | g* | Modified Julian day | G | Era |\n * | h | Hour [1-12] | H | Hour [0-23] |\n * | i! | ISO day of week | I! | ISO week of year |\n * | j* | Localized hour w/ day period | J* | Localized hour w/o day period |\n * | k | Hour [1-24] | K | Hour [0-11] |\n * | l* | (deprecated) | L | Stand-alone month |\n * | m | Minute | M | Month |\n * | n | | N | |\n * | o! | Ordinal number modifier | O | Timezone (GMT) |\n * | p! | Long localized time | P! | Long localized date |\n * | q | Stand-alone quarter | Q | Quarter |\n * | r* | Related Gregorian year | R! | ISO week-numbering year |\n * | s | Second | S | Fraction of second |\n * | t! | Seconds timestamp | T! | Milliseconds timestamp |\n * | u | Extended year | U* | Cyclic year |\n * | v* | Timezone (generic non-locat.) | V* | Timezone (location) |\n * | w | Local week of year | W* | Week of month |\n * | x | Timezone (ISO-8601 w/o Z) | X | Timezone (ISO-8601) |\n * | y | Year (abs) | Y | Local week-numbering year |\n * | z | Timezone (specific non-locat.) | Z* | Timezone (aliases) |\n *\n * Letters marked by * are not implemented but reserved by Unicode standard.\n *\n * Letters marked by ! are non-standard, but implemented by date-fns:\n * - `o` modifies the previous token to turn it into an ordinal (see `format` docs)\n * - `i` is ISO day of week. For `i` and `ii` is returns numeric ISO week days,\n * i.e. 7 for Sunday, 1 for Monday, etc.\n * - `I` is ISO week of year, as opposed to `w` which is local week of year.\n * - `R` is ISO week-numbering year, as opposed to `Y` which is local week-numbering year.\n * `R` is supposed to be used in conjunction with `I` and `i`\n * for universal ISO week-numbering date, whereas\n * `Y` is supposed to be used in conjunction with `w` and `e`\n * for week-numbering date specific to the locale.\n * - `P` is long localized date format\n * - `p` is long localized time format\n */\n\nvar formatters = {\n // Era\n G: function (date, token, localize) {\n var era = date.getUTCFullYear() > 0 ? 1 : 0;\n\n switch (token) {\n // AD, BC\n case 'G':\n case 'GG':\n case 'GGG':\n return localize.era(era, {\n width: 'abbreviated'\n });\n // A, B\n\n case 'GGGGG':\n return localize.era(era, {\n width: 'narrow'\n });\n // Anno Domini, Before Christ\n\n case 'GGGG':\n default:\n return localize.era(era, {\n width: 'wide'\n });\n }\n },\n // Year\n y: function (date, token, localize) {\n // Ordinal number\n if (token === 'yo') {\n var signedYear = date.getUTCFullYear(); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var year = signedYear > 0 ? signedYear : 1 - signedYear;\n return localize.ordinalNumber(year, {\n unit: 'year'\n });\n }\n\n return lightFormatters.y(date, token);\n },\n // Local week-numbering year\n Y: function (date, token, localize, options) {\n var signedWeekYear = getUTCWeekYear(date, options); // Returns 1 for 1 BC (which is year 0 in JavaScript)\n\n var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear; // Two digit year\n\n if (token === 'YY') {\n var twoDigitYear = weekYear % 100;\n return addLeadingZeros(twoDigitYear, 2);\n } // Ordinal number\n\n\n if (token === 'Yo') {\n return localize.ordinalNumber(weekYear, {\n unit: 'year'\n });\n } // Padding\n\n\n return addLeadingZeros(weekYear, token.length);\n },\n // ISO week-numbering year\n R: function (date, token) {\n var isoWeekYear = getUTCISOWeekYear(date); // Padding\n\n return addLeadingZeros(isoWeekYear, token.length);\n },\n // Extended year. This is a single number designating the year of this calendar system.\n // The main difference between `y` and `u` localizers are B.C. years:\n // | Year | `y` | `u` |\n // |------|-----|-----|\n // | AC 1 | 1 | 1 |\n // | BC 1 | 1 | 0 |\n // | BC 2 | 2 | -1 |\n // Also `yy` always returns the last two digits of a year,\n // while `uu` pads single digit years to 2 characters and returns other years unchanged.\n u: function (date, token) {\n var year = date.getUTCFullYear();\n return addLeadingZeros(year, token.length);\n },\n // Quarter\n Q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'Q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'QQ':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'Qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'QQQ':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'QQQQQ':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'formatting'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'QQQQ':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone quarter\n q: function (date, token, localize) {\n var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);\n\n switch (token) {\n // 1, 2, 3, 4\n case 'q':\n return String(quarter);\n // 01, 02, 03, 04\n\n case 'qq':\n return addLeadingZeros(quarter, 2);\n // 1st, 2nd, 3rd, 4th\n\n case 'qo':\n return localize.ordinalNumber(quarter, {\n unit: 'quarter'\n });\n // Q1, Q2, Q3, Q4\n\n case 'qqq':\n return localize.quarter(quarter, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // 1, 2, 3, 4 (narrow quarter; could be not numerical)\n\n case 'qqqqq':\n return localize.quarter(quarter, {\n width: 'narrow',\n context: 'standalone'\n });\n // 1st quarter, 2nd quarter, ...\n\n case 'qqqq':\n default:\n return localize.quarter(quarter, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Month\n M: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n case 'M':\n case 'MM':\n return lightFormatters.M(date, token);\n // 1st, 2nd, ..., 12th\n\n case 'Mo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'MMM':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // J, F, ..., D\n\n case 'MMMMM':\n return localize.month(month, {\n width: 'narrow',\n context: 'formatting'\n });\n // January, February, ..., December\n\n case 'MMMM':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone month\n L: function (date, token, localize) {\n var month = date.getUTCMonth();\n\n switch (token) {\n // 1, 2, ..., 12\n case 'L':\n return String(month + 1);\n // 01, 02, ..., 12\n\n case 'LL':\n return addLeadingZeros(month + 1, 2);\n // 1st, 2nd, ..., 12th\n\n case 'Lo':\n return localize.ordinalNumber(month + 1, {\n unit: 'month'\n });\n // Jan, Feb, ..., Dec\n\n case 'LLL':\n return localize.month(month, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // J, F, ..., D\n\n case 'LLLLL':\n return localize.month(month, {\n width: 'narrow',\n context: 'standalone'\n });\n // January, February, ..., December\n\n case 'LLLL':\n default:\n return localize.month(month, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // Local week of year\n w: function (date, token, localize, options) {\n var week = getUTCWeek(date, options);\n\n if (token === 'wo') {\n return localize.ordinalNumber(week, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(week, token.length);\n },\n // ISO week of year\n I: function (date, token, localize) {\n var isoWeek = getUTCISOWeek(date);\n\n if (token === 'Io') {\n return localize.ordinalNumber(isoWeek, {\n unit: 'week'\n });\n }\n\n return addLeadingZeros(isoWeek, token.length);\n },\n // Day of the month\n d: function (date, token, localize) {\n if (token === 'do') {\n return localize.ordinalNumber(date.getUTCDate(), {\n unit: 'date'\n });\n }\n\n return lightFormatters.d(date, token);\n },\n // Day of year\n D: function (date, token, localize) {\n var dayOfYear = getUTCDayOfYear(date);\n\n if (token === 'Do') {\n return localize.ordinalNumber(dayOfYear, {\n unit: 'dayOfYear'\n });\n }\n\n return addLeadingZeros(dayOfYear, token.length);\n },\n // Day of week\n E: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n\n switch (token) {\n // Tue\n case 'E':\n case 'EE':\n case 'EEE':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'EEEEE':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'EEEEEE':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'EEEE':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Local day of week\n e: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (Nth day of week with current locale or weekStartsOn)\n case 'e':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'ee':\n return addLeadingZeros(localDayOfWeek, 2);\n // 1st, 2nd, ..., 7th\n\n case 'eo':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'eee':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'eeeee':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'eeeeee':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'eeee':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Stand-alone local day of week\n c: function (date, token, localize, options) {\n var dayOfWeek = date.getUTCDay();\n var localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;\n\n switch (token) {\n // Numerical value (same as in `e`)\n case 'c':\n return String(localDayOfWeek);\n // Padded numerical value\n\n case 'cc':\n return addLeadingZeros(localDayOfWeek, token.length);\n // 1st, 2nd, ..., 7th\n\n case 'co':\n return localize.ordinalNumber(localDayOfWeek, {\n unit: 'day'\n });\n\n case 'ccc':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'standalone'\n });\n // T\n\n case 'ccccc':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'standalone'\n });\n // Tu\n\n case 'cccccc':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'standalone'\n });\n // Tuesday\n\n case 'cccc':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'standalone'\n });\n }\n },\n // ISO day of week\n i: function (date, token, localize) {\n var dayOfWeek = date.getUTCDay();\n var isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;\n\n switch (token) {\n // 2\n case 'i':\n return String(isoDayOfWeek);\n // 02\n\n case 'ii':\n return addLeadingZeros(isoDayOfWeek, token.length);\n // 2nd\n\n case 'io':\n return localize.ordinalNumber(isoDayOfWeek, {\n unit: 'day'\n });\n // Tue\n\n case 'iii':\n return localize.day(dayOfWeek, {\n width: 'abbreviated',\n context: 'formatting'\n });\n // T\n\n case 'iiiii':\n return localize.day(dayOfWeek, {\n width: 'narrow',\n context: 'formatting'\n });\n // Tu\n\n case 'iiiiii':\n return localize.day(dayOfWeek, {\n width: 'short',\n context: 'formatting'\n });\n // Tuesday\n\n case 'iiii':\n default:\n return localize.day(dayOfWeek, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM or PM\n a: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n\n switch (token) {\n case 'a':\n case 'aa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'aaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'aaaaa':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'aaaa':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // AM, PM, midnight, noon\n b: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours === 12) {\n dayPeriodEnumValue = dayPeriodEnum.noon;\n } else if (hours === 0) {\n dayPeriodEnumValue = dayPeriodEnum.midnight;\n } else {\n dayPeriodEnumValue = hours / 12 >= 1 ? 'pm' : 'am';\n }\n\n switch (token) {\n case 'b':\n case 'bb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'bbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n }).toLowerCase();\n\n case 'bbbbb':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'bbbb':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // in the morning, in the afternoon, in the evening, at night\n B: function (date, token, localize) {\n var hours = date.getUTCHours();\n var dayPeriodEnumValue;\n\n if (hours >= 17) {\n dayPeriodEnumValue = dayPeriodEnum.evening;\n } else if (hours >= 12) {\n dayPeriodEnumValue = dayPeriodEnum.afternoon;\n } else if (hours >= 4) {\n dayPeriodEnumValue = dayPeriodEnum.morning;\n } else {\n dayPeriodEnumValue = dayPeriodEnum.night;\n }\n\n switch (token) {\n case 'B':\n case 'BB':\n case 'BBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'abbreviated',\n context: 'formatting'\n });\n\n case 'BBBBB':\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'narrow',\n context: 'formatting'\n });\n\n case 'BBBB':\n default:\n return localize.dayPeriod(dayPeriodEnumValue, {\n width: 'wide',\n context: 'formatting'\n });\n }\n },\n // Hour [1-12]\n h: function (date, token, localize) {\n if (token === 'ho') {\n var hours = date.getUTCHours() % 12;\n if (hours === 0) hours = 12;\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return lightFormatters.h(date, token);\n },\n // Hour [0-23]\n H: function (date, token, localize) {\n if (token === 'Ho') {\n return localize.ordinalNumber(date.getUTCHours(), {\n unit: 'hour'\n });\n }\n\n return lightFormatters.H(date, token);\n },\n // Hour [0-11]\n K: function (date, token, localize) {\n var hours = date.getUTCHours() % 12;\n\n if (token === 'Ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Hour [1-24]\n k: function (date, token, localize) {\n var hours = date.getUTCHours();\n if (hours === 0) hours = 24;\n\n if (token === 'ko') {\n return localize.ordinalNumber(hours, {\n unit: 'hour'\n });\n }\n\n return addLeadingZeros(hours, token.length);\n },\n // Minute\n m: function (date, token, localize) {\n if (token === 'mo') {\n return localize.ordinalNumber(date.getUTCMinutes(), {\n unit: 'minute'\n });\n }\n\n return lightFormatters.m(date, token);\n },\n // Second\n s: function (date, token, localize) {\n if (token === 'so') {\n return localize.ordinalNumber(date.getUTCSeconds(), {\n unit: 'second'\n });\n }\n\n return lightFormatters.s(date, token);\n },\n // Fraction of second\n S: function (date, token) {\n return lightFormatters.S(date, token);\n },\n // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)\n X: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n if (timezoneOffset === 0) {\n return 'Z';\n }\n\n switch (token) {\n // Hours and optional minutes\n case 'X':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XX`\n\n case 'XXXX':\n case 'XX':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `XXX`\n\n case 'XXXXX':\n case 'XXX': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)\n x: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Hours and optional minutes\n case 'x':\n return formatTimezoneWithOptionalMinutes(timezoneOffset);\n // Hours, minutes and optional seconds without `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xx`\n\n case 'xxxx':\n case 'xx':\n // Hours and minutes without `:` delimiter\n return formatTimezone(timezoneOffset);\n // Hours, minutes and optional seconds with `:` delimiter\n // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets\n // so this token always has the same output as `xxx`\n\n case 'xxxxx':\n case 'xxx': // Hours and minutes with `:` delimiter\n\n default:\n return formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (GMT)\n O: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'O':\n case 'OO':\n case 'OOO':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'OOOO':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Timezone (specific non-location)\n z: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timezoneOffset = originalDate.getTimezoneOffset();\n\n switch (token) {\n // Short\n case 'z':\n case 'zz':\n case 'zzz':\n return 'GMT' + formatTimezoneShort(timezoneOffset, ':');\n // Long\n\n case 'zzzz':\n default:\n return 'GMT' + formatTimezone(timezoneOffset, ':');\n }\n },\n // Seconds timestamp\n t: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = Math.floor(originalDate.getTime() / 1000);\n return addLeadingZeros(timestamp, token.length);\n },\n // Milliseconds timestamp\n T: function (date, token, _localize, options) {\n var originalDate = options._originalDate || date;\n var timestamp = originalDate.getTime();\n return addLeadingZeros(timestamp, token.length);\n }\n};\n\nfunction formatTimezoneShort(offset, dirtyDelimiter) {\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = Math.floor(absOffset / 60);\n var minutes = absOffset % 60;\n\n if (minutes === 0) {\n return sign + String(hours);\n }\n\n var delimiter = dirtyDelimiter || '';\n return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);\n}\n\nfunction formatTimezoneWithOptionalMinutes(offset, dirtyDelimiter) {\n if (offset % 60 === 0) {\n var sign = offset > 0 ? '-' : '+';\n return sign + addLeadingZeros(Math.abs(offset) / 60, 2);\n }\n\n return formatTimezone(offset, dirtyDelimiter);\n}\n\nfunction formatTimezone(offset, dirtyDelimiter) {\n var delimiter = dirtyDelimiter || '';\n var sign = offset > 0 ? '-' : '+';\n var absOffset = Math.abs(offset);\n var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);\n var minutes = addLeadingZeros(absOffset % 60, 2);\n return sign + hours + delimiter + minutes;\n}\n\nexport default formatters;","import isValid from \"../isValid/index.js\";\nimport defaultLocale from \"../locale/en-US/index.js\";\nimport subMilliseconds from \"../subMilliseconds/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport formatters from \"../_lib/format/formatters/index.js\";\nimport longFormatters from \"../_lib/format/longFormatters/index.js\";\nimport getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport { isProtectedDayOfYearToken, isProtectedWeekYearToken, throwProtectedError } from \"../_lib/protectedTokens/index.js\";\nimport toInteger from \"../_lib/toInteger/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // This RegExp consists of three parts separated by `|`:\n// - [yYQqMLwIdDecihHKkms]o matches any available ordinal number token\n// (one of the certain letters followed by `o`)\n// - (\\w)\\1* matches any sequences of the same letter\n// - '' matches two quote characters in a row\n// - '(''|[^'])+('|$) matches anything surrounded by two quote characters ('),\n// except a single quote symbol, which ends the sequence.\n// Two quote characters do not end the sequence.\n// If there is no matching single quote\n// then the sequence will continue until the end of the string.\n// - . matches any single character unmatched by previous parts of the RegExps\n\nvar formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\\w)\\1*|''|'(''|[^'])+('|$)|./g; // This RegExp catches symbols escaped by quotes, and also\n// sequences of symbols P, p, and the combinations like `PPPPPPPppppp`\n\nvar longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;\nvar escapedStringRegExp = /^'([^]*?)'?$/;\nvar doubleQuoteRegExp = /''/g;\nvar unescapedLatinCharacterRegExp = /[a-zA-Z]/;\n/**\n * @name format\n * @category Common Helpers\n * @summary Format the date.\n *\n * @description\n * Return the formatted date string in the given format. The result may vary by locale.\n *\n * > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.\n * > See: https://git.io/fxCyr\n *\n * The characters wrapped between two single quotes characters (') are escaped.\n * Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.\n * (see the last example)\n *\n * Format of the string is based on Unicode Technical Standard #35:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * with a few additions (see note 7 below the table).\n *\n * Accepted patterns:\n * | Unit | Pattern | Result examples | Notes |\n * |---------------------------------|---------|-----------------------------------|-------|\n * | Era | G..GGG | AD, BC | |\n * | | GGGG | Anno Domini, Before Christ | 2 |\n * | | GGGGG | A, B | |\n * | Calendar year | y | 44, 1, 1900, 2017 | 5 |\n * | | yo | 44th, 1st, 0th, 17th | 5,7 |\n * | | yy | 44, 01, 00, 17 | 5 |\n * | | yyy | 044, 001, 1900, 2017 | 5 |\n * | | yyyy | 0044, 0001, 1900, 2017 | 5 |\n * | | yyyyy | ... | 3,5 |\n * | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |\n * | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |\n * | | YY | 44, 01, 00, 17 | 5,8 |\n * | | YYY | 044, 001, 1900, 2017 | 5 |\n * | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |\n * | | YYYYY | ... | 3,5 |\n * | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |\n * | | RR | -43, 00, 01, 1900, 2017 | 5,7 |\n * | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |\n * | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |\n * | | RRRRR | ... | 3,5,7 |\n * | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |\n * | | uu | -43, 01, 1900, 2017 | 5 |\n * | | uuu | -043, 001, 1900, 2017 | 5 |\n * | | uuuu | -0043, 0001, 1900, 2017 | 5 |\n * | | uuuuu | ... | 3,5 |\n * | Quarter (formatting) | Q | 1, 2, 3, 4 | |\n * | | Qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | QQ | 01, 02, 03, 04 | |\n * | | QQQ | Q1, Q2, Q3, Q4 | |\n * | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |\n * | | QQQQQ | 1, 2, 3, 4 | 4 |\n * | Quarter (stand-alone) | q | 1, 2, 3, 4 | |\n * | | qo | 1st, 2nd, 3rd, 4th | 7 |\n * | | qq | 01, 02, 03, 04 | |\n * | | qqq | Q1, Q2, Q3, Q4 | |\n * | | qqqq | 1st quarter, 2nd quarter, ... | 2 |\n * | | qqqqq | 1, 2, 3, 4 | 4 |\n * | Month (formatting) | M | 1, 2, ..., 12 | |\n * | | Mo | 1st, 2nd, ..., 12th | 7 |\n * | | MM | 01, 02, ..., 12 | |\n * | | MMM | Jan, Feb, ..., Dec | |\n * | | MMMM | January, February, ..., December | 2 |\n * | | MMMMM | J, F, ..., D | |\n * | Month (stand-alone) | L | 1, 2, ..., 12 | |\n * | | Lo | 1st, 2nd, ..., 12th | 7 |\n * | | LL | 01, 02, ..., 12 | |\n * | | LLL | Jan, Feb, ..., Dec | |\n * | | LLLL | January, February, ..., December | 2 |\n * | | LLLLL | J, F, ..., D | |\n * | Local week of year | w | 1, 2, ..., 53 | |\n * | | wo | 1st, 2nd, ..., 53th | 7 |\n * | | ww | 01, 02, ..., 53 | |\n * | ISO week of year | I | 1, 2, ..., 53 | 7 |\n * | | Io | 1st, 2nd, ..., 53th | 7 |\n * | | II | 01, 02, ..., 53 | 7 |\n * | Day of month | d | 1, 2, ..., 31 | |\n * | | do | 1st, 2nd, ..., 31st | 7 |\n * | | dd | 01, 02, ..., 31 | |\n * | Day of year | D | 1, 2, ..., 365, 366 | 9 |\n * | | Do | 1st, 2nd, ..., 365th, 366th | 7 |\n * | | DD | 01, 02, ..., 365, 366 | 9 |\n * | | DDD | 001, 002, ..., 365, 366 | |\n * | | DDDD | ... | 3 |\n * | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |\n * | | EEEE | Monday, Tuesday, ..., Sunday | 2 |\n * | | EEEEE | M, T, W, T, F, S, S | |\n * | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |\n * | | io | 1st, 2nd, ..., 7th | 7 |\n * | | ii | 01, 02, ..., 07 | 7 |\n * | | iii | Mon, Tue, Wed, ..., Sun | 7 |\n * | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |\n * | | iiiii | M, T, W, T, F, S, S | 7 |\n * | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |\n * | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |\n * | | eo | 2nd, 3rd, ..., 1st | 7 |\n * | | ee | 02, 03, ..., 01 | |\n * | | eee | Mon, Tue, Wed, ..., Sun | |\n * | | eeee | Monday, Tuesday, ..., Sunday | 2 |\n * | | eeeee | M, T, W, T, F, S, S | |\n * | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |\n * | | co | 2nd, 3rd, ..., 1st | 7 |\n * | | cc | 02, 03, ..., 01 | |\n * | | ccc | Mon, Tue, Wed, ..., Sun | |\n * | | cccc | Monday, Tuesday, ..., Sunday | 2 |\n * | | ccccc | M, T, W, T, F, S, S | |\n * | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |\n * | AM, PM | a..aa | AM, PM | |\n * | | aaa | am, pm | |\n * | | aaaa | a.m., p.m. | 2 |\n * | | aaaaa | a, p | |\n * | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |\n * | | bbb | am, pm, noon, midnight | |\n * | | bbbb | a.m., p.m., noon, midnight | 2 |\n * | | bbbbb | a, p, n, mi | |\n * | Flexible day period | B..BBB | at night, in the morning, ... | |\n * | | BBBB | at night, in the morning, ... | 2 |\n * | | BBBBB | at night, in the morning, ... | |\n * | Hour [1-12] | h | 1, 2, ..., 11, 12 | |\n * | | ho | 1st, 2nd, ..., 11th, 12th | 7 |\n * | | hh | 01, 02, ..., 11, 12 | |\n * | Hour [0-23] | H | 0, 1, 2, ..., 23 | |\n * | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |\n * | | HH | 00, 01, 02, ..., 23 | |\n * | Hour [0-11] | K | 1, 2, ..., 11, 0 | |\n * | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |\n * | | KK | 01, 02, ..., 11, 00 | |\n * | Hour [1-24] | k | 24, 1, 2, ..., 23 | |\n * | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |\n * | | kk | 24, 01, 02, ..., 23 | |\n * | Minute | m | 0, 1, ..., 59 | |\n * | | mo | 0th, 1st, ..., 59th | 7 |\n * | | mm | 00, 01, ..., 59 | |\n * | Second | s | 0, 1, ..., 59 | |\n * | | so | 0th, 1st, ..., 59th | 7 |\n * | | ss | 00, 01, ..., 59 | |\n * | Fraction of second | S | 0, 1, ..., 9 | |\n * | | SS | 00, 01, ..., 99 | |\n * | | SSS | 000, 001, ..., 999 | |\n * | | SSSS | ... | 3 |\n * | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |\n * | | XX | -0800, +0530, Z | |\n * | | XXX | -08:00, +05:30, Z | |\n * | | XXXX | -0800, +0530, Z, +123456 | 2 |\n * | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |\n * | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |\n * | | xx | -0800, +0530, +0000 | |\n * | | xxx | -08:00, +05:30, +00:00 | 2 |\n * | | xxxx | -0800, +0530, +0000, +123456 | |\n * | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |\n * | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |\n * | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |\n * | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |\n * | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |\n * | Seconds timestamp | t | 512969520 | 7 |\n * | | tt | ... | 3,7 |\n * | Milliseconds timestamp | T | 512969520900 | 7 |\n * | | TT | ... | 3,7 |\n * | Long localized date | P | 04/29/1453 | 7 |\n * | | PP | Apr 29, 1453 | 7 |\n * | | PPP | April 29th, 1453 | 7 |\n * | | PPPP | Friday, April 29th, 1453 | 2,7 |\n * | Long localized time | p | 12:00 AM | 7 |\n * | | pp | 12:00:00 AM | 7 |\n * | | ppp | 12:00:00 AM GMT+2 | 7 |\n * | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |\n * | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |\n * | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |\n * | | PPPppp | April 29th, 1453 at ... | 7 |\n * | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |\n * Notes:\n * 1. \"Formatting\" units (e.g. formatting quarter) in the default en-US locale\n * are the same as \"stand-alone\" units, but are different in some languages.\n * \"Formatting\" units are declined according to the rules of the language\n * in the context of a date. \"Stand-alone\" units are always nominative singular:\n *\n * `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`\n *\n * `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`\n *\n * 2. Any sequence of the identical letters is a pattern, unless it is escaped by\n * the single quote characters (see below).\n * If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)\n * the output will be the same as default pattern for this unit, usually\n * the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units\n * are marked with \"2\" in the last column of the table.\n *\n * `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`\n *\n * `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`\n *\n * `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`\n *\n * 3. Some patterns could be unlimited length (such as `yyyyyyyy`).\n * The output will be padded with zeros to match the length of the pattern.\n *\n * `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`\n *\n * 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.\n * These tokens represent the shortest form of the quarter.\n *\n * 5. The main difference between `y` and `u` patterns are B.C. years:\n *\n * | Year | `y` | `u` |\n * |------|-----|-----|\n * | AC 1 | 1 | 1 |\n * | BC 1 | 1 | 0 |\n * | BC 2 | 2 | -1 |\n *\n * Also `yy` always returns the last two digits of a year,\n * while `uu` pads single digit years to 2 characters and returns other years unchanged:\n *\n * | Year | `yy` | `uu` |\n * |------|------|------|\n * | 1 | 01 | 01 |\n * | 14 | 14 | 14 |\n * | 376 | 76 | 376 |\n * | 1453 | 53 | 1453 |\n *\n * The same difference is true for local and ISO week-numbering years (`Y` and `R`),\n * except local week-numbering years are dependent on `options.weekStartsOn`\n * and `options.firstWeekContainsDate` (compare [getISOWeekYear]{@link https://date-fns.org/docs/getISOWeekYear}\n * and [getWeekYear]{@link https://date-fns.org/docs/getWeekYear}).\n *\n * 6. Specific non-location timezones are currently unavailable in `date-fns`,\n * so right now these tokens fall back to GMT timezones.\n *\n * 7. These patterns are not in the Unicode Technical Standard #35:\n * - `i`: ISO day of week\n * - `I`: ISO week of year\n * - `R`: ISO week-numbering year\n * - `t`: seconds timestamp\n * - `T`: milliseconds timestamp\n * - `o`: ordinal number modifier\n * - `P`: long localized date\n * - `p`: long localized time\n *\n * 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.\n * You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://git.io/fxCyr\n *\n * 9. `D` and `DD` tokens represent days of the year but they are ofthen confused with days of the month.\n * You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://git.io/fxCyr\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * - The second argument is now required for the sake of explicitness.\n *\n * ```javascript\n * // Before v2.0.0\n * format(new Date(2016, 0, 1))\n *\n * // v2.0.0 onward\n * format(new Date(2016, 0, 1), \"yyyy-MM-dd'T'HH:mm:ss.SSSxxx\")\n * ```\n *\n * - New format string API for `format` function\n * which is based on [Unicode Technical Standard #35](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table).\n * See [this post](https://blog.date-fns.org/post/unicode-tokens-in-date-fns-v2-sreatyki91jg) for more details.\n *\n * - Characters are now escaped using single quote symbols (`'`) instead of square brackets.\n *\n * @param {Date|Number} date - the original date\n * @param {String} format - the string of tokens\n * @param {Object} [options] - an object with options.\n * @param {Locale} [options.locale=defaultLocale] - the locale object. See [Locale]{@link https://date-fns.org/docs/Locale}\n * @param {0|1|2|3|4|5|6} [options.weekStartsOn=0] - the index of the first day of the week (0 - Sunday)\n * @param {Number} [options.firstWeekContainsDate=1] - the day of January, which is\n * @param {Boolean} [options.useAdditionalWeekYearTokens=false] - if true, allows usage of the week-numbering year tokens `YY` and `YYYY`;\n * see: https://git.io/fxCyr\n * @param {Boolean} [options.useAdditionalDayOfYearTokens=false] - if true, allows usage of the day of year tokens `D` and `DD`;\n * see: https://git.io/fxCyr\n * @returns {String} the formatted date string\n * @throws {TypeError} 2 arguments required\n * @throws {RangeError} `date` must not be Invalid Date\n * @throws {RangeError} `options.locale` must contain `localize` property\n * @throws {RangeError} `options.locale` must contain `formatLong` property\n * @throws {RangeError} `options.weekStartsOn` must be between 0 and 6\n * @throws {RangeError} `options.firstWeekContainsDate` must be between 1 and 7\n * @throws {RangeError} use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://git.io/fxCyr\n * @throws {RangeError} format string contains an unescaped latin alphabet character\n *\n * @example\n * // Represent 11 February 2014 in middle-endian format:\n * var result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')\n * //=> '02/11/2014'\n *\n * @example\n * // Represent 2 July 2014 in Esperanto:\n * import { eoLocale } from 'date-fns/locale/eo'\n * var result = format(new Date(2014, 6, 2), \"do 'de' MMMM yyyy\", {\n * locale: eoLocale\n * })\n * //=> '2-a de julio 2014'\n *\n * @example\n * // Escape string by single quote characters:\n * var result = format(new Date(2014, 6, 2, 15), \"h 'o''clock'\")\n * //=> \"3 o'clock\"\n */\n\nexport default function format(dirtyDate, dirtyFormatStr, dirtyOptions) {\n requiredArgs(2, arguments);\n var formatStr = String(dirtyFormatStr);\n var options = dirtyOptions || {};\n var locale = options.locale || defaultLocale;\n var localeFirstWeekContainsDate = locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate); // Test if weekStartsOn is between 1 and 7 _and_ is not NaN\n\n if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {\n throw new RangeError('firstWeekContainsDate must be between 1 and 7 inclusively');\n }\n\n var localeWeekStartsOn = locale.options && locale.options.weekStartsOn;\n var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);\n var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn); // Test if weekStartsOn is between 0 and 6 _and_ is not NaN\n\n if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {\n throw new RangeError('weekStartsOn must be between 0 and 6 inclusively');\n }\n\n if (!locale.localize) {\n throw new RangeError('locale must contain localize property');\n }\n\n if (!locale.formatLong) {\n throw new RangeError('locale must contain formatLong property');\n }\n\n var originalDate = toDate(dirtyDate);\n\n if (!isValid(originalDate)) {\n throw new RangeError('Invalid time value');\n } // Convert the date in system timezone to the same date in UTC+00:00 timezone.\n // This ensures that when UTC functions will be implemented, locales will be compatible with them.\n // See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376\n\n\n var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);\n var utcDate = subMilliseconds(originalDate, timezoneOffset);\n var formatterOptions = {\n firstWeekContainsDate: firstWeekContainsDate,\n weekStartsOn: weekStartsOn,\n locale: locale,\n _originalDate: originalDate\n };\n var result = formatStr.match(longFormattingTokensRegExp).map(function (substring) {\n var firstCharacter = substring[0];\n\n if (firstCharacter === 'p' || firstCharacter === 'P') {\n var longFormatter = longFormatters[firstCharacter];\n return longFormatter(substring, locale.formatLong, formatterOptions);\n }\n\n return substring;\n }).join('').match(formattingTokensRegExp).map(function (substring) {\n // Replace two single quote characters with one single quote character\n if (substring === \"''\") {\n return \"'\";\n }\n\n var firstCharacter = substring[0];\n\n if (firstCharacter === \"'\") {\n return cleanEscapedString(substring);\n }\n\n var formatter = formatters[firstCharacter];\n\n if (formatter) {\n if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {\n throwProtectedError(substring, dirtyFormatStr, dirtyDate);\n }\n\n return formatter(utcDate, substring, locale.localize, formatterOptions);\n }\n\n if (firstCharacter.match(unescapedLatinCharacterRegExp)) {\n throw new RangeError('Format string contains an unescaped latin alphabet character `' + firstCharacter + '`');\n }\n\n return substring;\n }).join('');\n return result;\n}\n\nfunction cleanEscapedString(input) {\n return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, \"'\");\n}","import _concat from './internal/_concat.js';\nimport _curry2 from './internal/_curry2.js';\nimport _reduce from './internal/_reduce.js';\nimport map from './map.js';\n\n/**\n * ap applies a list of functions to a list of values.\n *\n * Dispatches to the `ap` method of the second argument, if present. Also\n * treats curried functions as applicatives.\n *\n * @func\n * @memberOf R\n * @since v0.3.0\n * @category Function\n * @sig [a -> b] -> [a] -> [b]\n * @sig Apply f => f (a -> b) -> f a -> f b\n * @sig (r -> a -> b) -> (r -> a) -> (r -> b)\n * @param {*} applyF\n * @param {*} applyX\n * @return {*}\n * @example\n *\n * R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]\n * R.ap([R.concat('tasty '), R.toUpper], ['pizza', 'salad']); //=> [\"tasty pizza\", \"tasty salad\", \"PIZZA\", \"SALAD\"]\n *\n * // R.ap can also be used as S combinator\n * // when only two functions are passed\n * R.ap(R.concat, R.toUpper)('Ramda') //=> 'RamdaRAMDA'\n * @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]\n */\nvar ap = /*#__PURE__*/_curry2(function ap(applyF, applyX) {\n return typeof applyX['fantasy-land/ap'] === 'function' ? applyX['fantasy-land/ap'](applyF) : typeof applyF.ap === 'function' ? applyF.ap(applyX) : typeof applyF === 'function' ? function (x) {\n return applyF(x)(applyX(x));\n } : _reduce(function (acc, f) {\n return _concat(acc, map(f, applyX));\n }, [], applyF);\n});\nexport default ap;","import _curry2 from './internal/_curry2.js';\nimport _reduce from './internal/_reduce.js';\nimport ap from './ap.js';\nimport curryN from './curryN.js';\nimport map from './map.js';\n\n/**\n * \"lifts\" a function to be the specified arity, so that it may \"map over\" that\n * many lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig Number -> (*... -> *) -> ([*]... -> [*])\n * @param {Function} fn The function to lift into higher context\n * @return {Function} The lifted function.\n * @see R.lift, R.ap\n * @example\n *\n * const madd3 = R.liftN(3, (...args) => R.sum(args));\n * madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]\n */\nvar liftN = /*#__PURE__*/_curry2(function liftN(arity, fn) {\n var lifted = curryN(arity, fn);\n return curryN(arity, function () {\n return _reduce(ap, map(lifted, arguments[0]), Array.prototype.slice.call(arguments, 1));\n });\n});\nexport default liftN;","import _curry1 from './internal/_curry1.js';\nimport liftN from './liftN.js';\n\n/**\n * \"lifts\" a function of arity > 1 so that it may \"map over\" a list, Function or other\n * object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).\n *\n * @func\n * @memberOf R\n * @since v0.7.0\n * @category Function\n * @sig (*... -> *) -> ([*]... -> [*])\n * @param {Function} fn The function to lift into higher context\n * @return {Function} The lifted function.\n * @see R.liftN\n * @example\n *\n * const madd3 = R.lift((a, b, c) => a + b + c);\n *\n * madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]\n *\n * const madd5 = R.lift((a, b, c, d, e) => a + b + c + d + e);\n *\n * madd5([1,2], [3], [4, 5], [6], [7, 8]); //=> [21, 22, 22, 23, 22, 23, 23, 24]\n */\nvar lift = /*#__PURE__*/_curry1(function lift(fn) {\n return liftN(fn.length, fn);\n});\nexport default lift;","import _curryN from './_curryN.js';\nimport _has from './_has.js';\nimport _xfBase from './_xfBase.js';\n\nvar XReduceBy = /*#__PURE__*/function () {\n function XReduceBy(valueFn, valueAcc, keyFn, xf) {\n this.valueFn = valueFn;\n this.valueAcc = valueAcc;\n this.keyFn = keyFn;\n this.xf = xf;\n this.inputs = {};\n }\n XReduceBy.prototype['@@transducer/init'] = _xfBase.init;\n XReduceBy.prototype['@@transducer/result'] = function (result) {\n var key;\n for (key in this.inputs) {\n if (_has(key, this.inputs)) {\n result = this.xf['@@transducer/step'](result, this.inputs[key]);\n if (result['@@transducer/reduced']) {\n result = result['@@transducer/value'];\n break;\n }\n }\n }\n this.inputs = null;\n return this.xf['@@transducer/result'](result);\n };\n XReduceBy.prototype['@@transducer/step'] = function (result, input) {\n var key = this.keyFn(input);\n this.inputs[key] = this.inputs[key] || [key, this.valueAcc];\n this.inputs[key][1] = this.valueFn(this.inputs[key][1], input);\n return result;\n };\n\n return XReduceBy;\n}();\n\nvar _xreduceBy = /*#__PURE__*/_curryN(4, [], function _xreduceBy(valueFn, valueAcc, keyFn, xf) {\n return new XReduceBy(valueFn, valueAcc, keyFn, xf);\n});\nexport default _xreduceBy;","import _curryN from './internal/_curryN.js';\nimport _dispatchable from './internal/_dispatchable.js';\nimport _has from './internal/_has.js';\nimport _reduce from './internal/_reduce.js';\nimport _xreduceBy from './internal/_xreduceBy.js';\n\n/**\n * Groups the elements of the list according to the result of calling\n * the String-returning function `keyFn` on each element and reduces the elements\n * of each group to a single value via the reducer function `valueFn`.\n *\n * This function is basically a more general [`groupBy`](#groupBy) function.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.20.0\n * @category List\n * @sig ((a, b) -> a) -> a -> (b -> String) -> [b] -> {String: a}\n * @param {Function} valueFn The function that reduces the elements of each group to a single\n * value. Receives two values, accumulator for a particular group and the current element.\n * @param {*} acc The (initial) accumulator value for each group.\n * @param {Function} keyFn The function that maps the list's element into a key.\n * @param {Array} list The array to group.\n * @return {Object} An object with the output of `keyFn` for keys, mapped to the output of\n * `valueFn` for elements which produced that key when passed to `keyFn`.\n * @see R.groupBy, R.reduce\n * @example\n *\n * const groupNames = (acc, {name}) => acc.concat(name)\n * const toGrade = ({score}) =>\n * score < 65 ? 'F' :\n * score < 70 ? 'D' :\n * score < 80 ? 'C' :\n * score < 90 ? 'B' : 'A'\n *\n * var students = [\n * {name: 'Abby', score: 83},\n * {name: 'Bart', score: 62},\n * {name: 'Curt', score: 88},\n * {name: 'Dora', score: 92},\n * ]\n *\n * reduceBy(groupNames, [], toGrade, students)\n * //=> {\"A\": [\"Dora\"], \"B\": [\"Abby\", \"Curt\"], \"F\": [\"Bart\"]}\n */\nvar reduceBy = /*#__PURE__*/_curryN(4, [], /*#__PURE__*/_dispatchable([], _xreduceBy, function reduceBy(valueFn, valueAcc, keyFn, list) {\n return _reduce(function (acc, elt) {\n var key = keyFn(elt);\n acc[key] = valueFn(_has(key, acc) ? acc[key] : valueAcc, elt);\n return acc;\n }, {}, list);\n}));\nexport default reduceBy;","import _curry2 from './_curry2.js';\nimport _xfBase from './_xfBase.js';\n\nvar XFilter = /*#__PURE__*/function () {\n function XFilter(f, xf) {\n this.xf = xf;\n this.f = f;\n }\n XFilter.prototype['@@transducer/init'] = _xfBase.init;\n XFilter.prototype['@@transducer/result'] = _xfBase.result;\n XFilter.prototype['@@transducer/step'] = function (result, input) {\n return this.f(input) ? this.xf['@@transducer/step'](result, input) : result;\n };\n\n return XFilter;\n}();\n\nvar _xfilter = /*#__PURE__*/_curry2(function _xfilter(f, xf) {\n return new XFilter(f, xf);\n});\nexport default _xfilter;","import _curry2 from './internal/_curry2.js';\nimport _dispatchable from './internal/_dispatchable.js';\nimport _filter from './internal/_filter.js';\nimport _isObject from './internal/_isObject.js';\nimport _reduce from './internal/_reduce.js';\nimport _xfilter from './internal/_xfilter.js';\nimport keys from './keys.js';\n\n/**\n * Takes a predicate and a `Filterable`, and returns a new filterable of the\n * same type containing the members of the given filterable which satisfy the\n * given predicate. Filterable objects include plain objects or any object\n * that has a filter method such as `Array`.\n *\n * Dispatches to the `filter` method of the second argument, if present.\n *\n * Acts as a transducer if a transformer is given in list position.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Filterable f => (a -> Boolean) -> f a -> f a\n * @param {Function} pred\n * @param {Array} filterable\n * @return {Array} Filterable\n * @see R.reject, R.transduce, R.addIndex\n * @example\n *\n * const isEven = n => n % 2 === 0;\n *\n * R.filter(isEven, [1, 2, 3, 4]); //=> [2, 4]\n *\n * R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}\n */\nvar filter = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable(['filter'], _xfilter, function (pred, filterable) {\n return _isObject(filterable) ? _reduce(function (acc, key) {\n if (pred(filterable[key])) {\n acc[key] = filterable[key];\n }\n return acc;\n }, {}, keys(filterable)) :\n // else\n _filter(pred, filterable);\n}));\nexport default filter;","import identity from './identity.js';\nimport uniqBy from './uniqBy.js';\n\n/**\n * Returns a new list containing only one copy of each element in the original\n * list. [`R.equals`](#equals) is used to determine equality.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig [a] -> [a]\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * R.uniq([1, 1, 2, 1]); //=> [1, 2]\n * R.uniq([1, '1']); //=> [1, '1']\n * R.uniq([[42], [42]]); //=> [[42]]\n */\nvar uniq = /*#__PURE__*/uniqBy(identity);\nexport default uniq;","import _Set from './internal/_Set.js';\nimport _curry2 from './internal/_curry2.js';\n\n/**\n * Returns a new list containing only one copy of each element in the original\n * list, based upon the value returned by applying the supplied function to\n * each list element. Prefers the first item if the supplied function produces\n * the same value on two items. [`R.equals`](#equals) is used for comparison.\n *\n * @func\n * @memberOf R\n * @since v0.16.0\n * @category List\n * @sig (a -> b) -> [a] -> [a]\n * @param {Function} fn A function used to produce a value to use during comparisons.\n * @param {Array} list The array to consider.\n * @return {Array} The list of unique items.\n * @example\n *\n * R.uniqBy(Math.abs, [-1, -5, 2, 10, 1, 2]); //=> [-1, -5, 2, 10]\n */\nvar uniqBy = /*#__PURE__*/_curry2(function uniqBy(fn, list) {\n var set = new _Set();\n var result = [];\n var idx = 0;\n var appliedItem, item;\n\n while (idx < list.length) {\n item = list[idx];\n appliedItem = fn(item);\n if (set.add(appliedItem)) {\n result.push(item);\n }\n idx += 1;\n }\n return result;\n});\nexport default uniqBy;","import _curry2 from './_curry2.js';\nimport _reduced from './_reduced.js';\nimport _xfBase from './_xfBase.js';\n\nvar XTake = /*#__PURE__*/function () {\n function XTake(n, xf) {\n this.xf = xf;\n this.n = n;\n this.i = 0;\n }\n XTake.prototype['@@transducer/init'] = _xfBase.init;\n XTake.prototype['@@transducer/result'] = _xfBase.result;\n XTake.prototype['@@transducer/step'] = function (result, input) {\n this.i += 1;\n var ret = this.n === 0 ? result : this.xf['@@transducer/step'](result, input);\n return this.n >= 0 && this.i >= this.n ? _reduced(ret) : ret;\n };\n\n return XTake;\n}();\n\nvar _xtake = /*#__PURE__*/_curry2(function _xtake(n, xf) {\n return new XTake(n, xf);\n});\nexport default _xtake;","import _curry2 from './internal/_curry2.js';\nimport _dispatchable from './internal/_dispatchable.js';\nimport _xtake from './internal/_xtake.js';\nimport slice from './slice.js';\n\n/**\n * Returns the first `n` elements of the given list, string, or\n * transducer/transformer (or object with a `take` method).\n *\n * Dispatches to the `take` method of the second argument, if present.\n *\n * @func\n * @memberOf R\n * @since v0.1.0\n * @category List\n * @sig Number -> [a] -> [a]\n * @sig Number -> String -> String\n * @param {Number} n\n * @param {*} list\n * @return {*}\n * @see R.drop\n * @example\n *\n * R.take(1, ['foo', 'bar', 'baz']); //=> ['foo']\n * R.take(2, ['foo', 'bar', 'baz']); //=> ['foo', 'bar']\n * R.take(3, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.take(4, ['foo', 'bar', 'baz']); //=> ['foo', 'bar', 'baz']\n * R.take(3, 'ramda'); //=> 'ram'\n *\n * const personnel = [\n * 'Dave Brubeck',\n * 'Paul Desmond',\n * 'Eugene Wright',\n * 'Joe Morello',\n * 'Gerry Mulligan',\n * 'Bob Bates',\n * 'Joe Dodge',\n * 'Ron Crotty'\n * ];\n *\n * const takeFive = R.take(5);\n * takeFive(personnel);\n * //=> ['Dave Brubeck', 'Paul Desmond', 'Eugene Wright', 'Joe Morello', 'Gerry Mulligan']\n * @symb R.take(-1, [a, b]) = [a, b]\n * @symb R.take(0, [a, b]) = []\n * @symb R.take(1, [a, b]) = [a]\n * @symb R.take(2, [a, b]) = [a, b]\n */\nvar take = /*#__PURE__*/_curry2( /*#__PURE__*/_dispatchable(['take'], _xtake, function take(n, xs) {\n return slice(0, n < 0 ? Infinity : n, xs);\n}));\nexport default take;","import toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInCalendarYears\n * @category Year Helpers\n * @summary Get the number of calendar years between the given dates.\n *\n * @description\n * Get the number of calendar years between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInCalendarYears(\n * new Date(2015, 1, 11),\n * new Date(2013, 11, 31)\n * )\n * //=> 2\n */\n\nexport default function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n return dateLeft.getFullYear() - dateRight.getFullYear();\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarYears from \"../differenceInCalendarYears/index.js\";\nimport compareAsc from \"../compareAsc/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name differenceInYears\n * @category Year Helpers\n * @summary Get the number of full years between the given dates.\n *\n * @description\n * Get the number of full years between the given dates.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full years\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full years are between 31 December 2013 and 11 February 2015?\n * const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))\n * //=> 1\n */\n\nexport default function differenceInYears(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight)); // Set both dates to a valid leap year for accurate comparison when dealing\n // with leap days\n\n dateLeft.setFullYear(1584);\n dateRight.setFullYear(1584); // Math.abs(diff in full years - diff in calendar years) === 1 if last calendar year is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign;\n var result = sign * (difference - Number(isLastYearNotFull)); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import getTimezoneOffsetInMilliseconds from \"../_lib/getTimezoneOffsetInMilliseconds/index.js\";\nimport startOfDay from \"../startOfDay/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\nvar MILLISECONDS_IN_DAY = 86400000;\n/**\n * @name differenceInCalendarDays\n * @category Day Helpers\n * @summary Get the number of calendar days between the given dates.\n *\n * @description\n * Get the number of calendar days between the given dates. This means that the times are removed\n * from the dates and then the difference in days is calculated.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of calendar days\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many calendar days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInCalendarDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 366\n * // How many calendar days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInCalendarDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 1\n */\n\nexport default function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var startOfDayLeft = startOfDay(dirtyDateLeft);\n var startOfDayRight = startOfDay(dirtyDateRight);\n var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);\n var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight); // Round the number of days to the nearest integer\n // because the number of milliseconds in a day is not constant\n // (e.g. it's different in the day of the daylight saving time clock shift)\n\n return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);\n}","import toDate from \"../toDate/index.js\";\nimport differenceInCalendarDays from \"../differenceInCalendarDays/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\"; // Like `compareAsc` but uses local time not UTC, which is needed\n// for accurate equality comparisons of UTC timestamps that end up\n// having the same representation in local time, e.g. one hour before\n// DST ends vs. the instant that DST ends.\n\nfunction compareLocalAsc(dateLeft, dateRight) {\n var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();\n\n if (diff < 0) {\n return -1;\n } else if (diff > 0) {\n return 1; // Return 0 if diff is 0; return NaN if diff is NaN\n } else {\n return diff;\n }\n}\n/**\n * @name differenceInDays\n * @category Day Helpers\n * @summary Get the number of full days between the given dates.\n *\n * @description\n * Get the number of full day periods between two dates. Fractional days are\n * truncated towards zero.\n *\n * One \"full day\" is the distance between a local time in one day to the same\n * local time on the next or previous day. A full day can sometimes be less than\n * or more than 24 hours if a daylight savings change happens between two dates.\n *\n * To ignore DST and only measure exact 24-hour periods, use this instead:\n * `Math.floor(differenceInHours(dateLeft, dateRight)/24)|0`.\n *\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} dateLeft - the later date\n * @param {Date|Number} dateRight - the earlier date\n * @returns {Number} the number of full days according to the local timezone\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // How many full days are between\n * // 2 July 2011 23:00:00 and 2 July 2012 00:00:00?\n * const result = differenceInDays(\n * new Date(2012, 6, 2, 0, 0),\n * new Date(2011, 6, 2, 23, 0)\n * )\n * //=> 365\n * // How many full days are between\n * // 2 July 2011 23:59:00 and 3 July 2011 00:01:00?\n * const result = differenceInDays(\n * new Date(2011, 6, 3, 0, 1),\n * new Date(2011, 6, 2, 23, 59)\n * )\n * //=> 0\n * // How many full days are between\n * // 1 March 2020 0:00 and 1 June 2020 0:00 ?\n * // Note: because local time is used, the\n * // result will always be 92 days, even in\n * // time zones where DST starts and the\n * // period has only 92*24-1 hours.\n * const result = differenceInDays(\n * new Date(2020, 5, 1),\n * new Date(2020, 2, 1)\n * )\n//=> 92\n */\n\n\nexport default function differenceInDays(dirtyDateLeft, dirtyDateRight) {\n requiredArgs(2, arguments);\n var dateLeft = toDate(dirtyDateLeft);\n var dateRight = toDate(dirtyDateRight);\n var sign = compareLocalAsc(dateLeft, dateRight);\n var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));\n dateLeft.setDate(dateLeft.getDate() - sign * difference); // Math.abs(diff in full days - diff in calendar days) === 1 if last calendar day is not full\n // If so, result must be decreased by 1 in absolute value\n\n var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign);\n var result = sign * (difference - isLastDayNotFull); // Prevent negative zero\n\n return result === 0 ? 0 : result;\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport toDate from \"../toDate/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name addMilliseconds\n * @category Millisecond Helpers\n * @summary Add the specified number of milliseconds to the given date.\n *\n * @description\n * Add the specified number of milliseconds to the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be added. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds added\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Add 750 milliseconds to 10 July 2014 12:45:30.000:\n * const result = addMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:30.750\n */\n\nexport default function addMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var timestamp = toDate(dirtyDate).getTime();\n var amount = toInteger(dirtyAmount);\n return new Date(timestamp + amount);\n}","import toInteger from \"../_lib/toInteger/index.js\";\nimport addMilliseconds from \"../addMilliseconds/index.js\";\nimport requiredArgs from \"../_lib/requiredArgs/index.js\";\n/**\n * @name subMilliseconds\n * @category Millisecond Helpers\n * @summary Subtract the specified number of milliseconds from the given date.\n *\n * @description\n * Subtract the specified number of milliseconds from the given date.\n *\n * ### v2.0.0 breaking changes:\n *\n * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).\n *\n * @param {Date|Number} date - the date to be changed\n * @param {Number} amount - the amount of milliseconds to be subtracted. Positive decimals will be rounded using `Math.floor`, decimals less than zero will be rounded using `Math.ceil`.\n * @returns {Date} the new date with the milliseconds subtracted\n * @throws {TypeError} 2 arguments required\n *\n * @example\n * // Subtract 750 milliseconds from 10 July 2014 12:45:30.000:\n * const result = subMilliseconds(new Date(2014, 6, 10, 12, 45, 30, 0), 750)\n * //=> Thu Jul 10 2014 12:45:29.250\n */\n\nexport default function subMilliseconds(dirtyDate, dirtyAmount) {\n requiredArgs(2, arguments);\n var amount = toInteger(dirtyAmount);\n return addMilliseconds(dirtyDate, -amount);\n}","import toInteger from \"../toInteger/index.js\";\nimport getUTCWeekYear from \"../getUTCWeekYear/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCWeekYear(dirtyDate, dirtyOptions) {\n requiredArgs(1, arguments);\n var options = dirtyOptions || {};\n var locale = options.locale;\n var localeFirstWeekContainsDate = locale && locale.options && locale.options.firstWeekContainsDate;\n var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);\n var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);\n var year = getUTCWeekYear(dirtyDate, dirtyOptions);\n var firstWeek = new Date(0);\n firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);\n firstWeek.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCWeek(firstWeek, dirtyOptions);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCWeek from \"../startOfUTCWeek/index.js\";\nimport startOfUTCWeekYear from \"../startOfUTCWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCWeek(dirtyDate, options) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","import getUTCISOWeekYear from \"../getUTCISOWeekYear/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\"; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function startOfUTCISOWeekYear(dirtyDate) {\n requiredArgs(1, arguments);\n var year = getUTCISOWeekYear(dirtyDate);\n var fourthOfJanuary = new Date(0);\n fourthOfJanuary.setUTCFullYear(year, 0, 4);\n fourthOfJanuary.setUTCHours(0, 0, 0, 0);\n var date = startOfUTCISOWeek(fourthOfJanuary);\n return date;\n}","import toDate from \"../../toDate/index.js\";\nimport startOfUTCISOWeek from \"../startOfUTCISOWeek/index.js\";\nimport startOfUTCISOWeekYear from \"../startOfUTCISOWeekYear/index.js\";\nimport requiredArgs from \"../requiredArgs/index.js\";\nvar MILLISECONDS_IN_WEEK = 604800000; // This function will be a part of public API when UTC function will be implemented.\n// See issue: https://github.com/date-fns/date-fns/issues/376\n\nexport default function getUTCISOWeek(dirtyDate) {\n requiredArgs(1, arguments);\n var date = toDate(dirtyDate);\n var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime(); // Round the number of days to the nearest integer\n // because the number of milliseconds in a week is not constant\n // (e.g. it's different in the week of the daylight saving time clock shift)\n\n return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;\n}","// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nvar hadKeyboardEvent = true;\nvar hadFocusVisibleRecently = false;\nvar hadFocusVisibleRecentlyTimeout = null;\nvar inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @return {boolean}\n */\n\nfunction focusTriggersKeyboardModality(node) {\n var type = node.type,\n tagName = node.tagName;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n\n if (node.isContentEditable) {\n return true;\n }\n\n return false;\n}\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\n\n\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n\n hadKeyboardEvent = true;\n}\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\n\n\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\n\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\n\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nfunction isFocusVisible(event) {\n var target = event.target;\n\n try {\n return target.matches(':focus-visible');\n } catch (error) {// browsers not implementing :focus-visible will throw a SyntaxError\n // we use our own heuristic for those browsers\n // rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n } // no need for validFocusTarget check. the user does that by attaching it to\n // focusable events only\n\n\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\n/**\n * Should be called if a blur event is fired on a focus-visible element\n */\n\n\nfunction handleBlurVisible() {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {\n hadFocusVisibleRecently = false;\n }, 100);\n}\n\nexport default function useIsFocusVisible() {\n var ref = React.useCallback(function (instance) {\n var node = ReactDOM.findDOMNode(instance);\n\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(isFocusVisible);\n }\n\n return {\n isFocusVisible: isFocusVisible,\n onBlurVisible: handleBlurVisible,\n ref: ref\n };\n}","import { Children, cloneElement, isValidElement } from 'react';\n/**\n * Given `this.props.children`, return an object mapping key to child.\n *\n * @param {*} children `this.props.children`\n * @return {object} Mapping of key to child\n */\n\nexport function getChildMapping(children, mapFn) {\n var mapper = function mapper(child) {\n return mapFn && isValidElement(child) ? mapFn(child) : child;\n };\n\n var result = Object.create(null);\n if (children) Children.map(children, function (c) {\n return c;\n }).forEach(function (child) {\n // run the map function here instead so that the key is the computed one\n result[child.key] = mapper(child);\n });\n return result;\n}\n/**\n * When you're adding or removing children some may be added or removed in the\n * same render pass. We want to show *both* since we want to simultaneously\n * animate elements in and out. This function takes a previous set of keys\n * and a new set of keys and merges them with its best guess of the correct\n * ordering. In the future we may expose some of the utilities in\n * ReactMultiChild to make this easy, but for now React itself does not\n * directly have this concept of the union of prevChildren and nextChildren\n * so we implement it here.\n *\n * @param {object} prev prev children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @param {object} next next children as returned from\n * `ReactTransitionChildMapping.getChildMapping()`.\n * @return {object} a key set that contains all keys in `prev` and all keys\n * in `next` in a reasonable order.\n */\n\nexport function mergeChildMappings(prev, next) {\n prev = prev || {};\n next = next || {};\n\n function getValueForKey(key) {\n return key in next ? next[key] : prev[key];\n } // For each key of `next`, the list of keys to insert before that key in\n // the combined list\n\n\n var nextKeysPending = Object.create(null);\n var pendingKeys = [];\n\n for (var prevKey in prev) {\n if (prevKey in next) {\n if (pendingKeys.length) {\n nextKeysPending[prevKey] = pendingKeys;\n pendingKeys = [];\n }\n } else {\n pendingKeys.push(prevKey);\n }\n }\n\n var i;\n var childMapping = {};\n\n for (var nextKey in next) {\n if (nextKeysPending[nextKey]) {\n for (i = 0; i < nextKeysPending[nextKey].length; i++) {\n var pendingNextKey = nextKeysPending[nextKey][i];\n childMapping[nextKeysPending[nextKey][i]] = getValueForKey(pendingNextKey);\n }\n }\n\n childMapping[nextKey] = getValueForKey(nextKey);\n } // Finally, add the keys which didn't appear before any key in `next`\n\n\n for (i = 0; i < pendingKeys.length; i++) {\n childMapping[pendingKeys[i]] = getValueForKey(pendingKeys[i]);\n }\n\n return childMapping;\n}\n\nfunction getProp(child, prop, props) {\n return props[prop] != null ? props[prop] : child.props[prop];\n}\n\nexport function getInitialChildMapping(props, onExited) {\n return getChildMapping(props.children, function (child) {\n return cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n appear: getProp(child, 'appear', props),\n enter: getProp(child, 'enter', props),\n exit: getProp(child, 'exit', props)\n });\n });\n}\nexport function getNextChildMapping(nextProps, prevChildMapping, onExited) {\n var nextChildMapping = getChildMapping(nextProps.children);\n var children = mergeChildMappings(prevChildMapping, nextChildMapping);\n Object.keys(children).forEach(function (key) {\n var child = children[key];\n if (!isValidElement(child)) return;\n var hasPrev = (key in prevChildMapping);\n var hasNext = (key in nextChildMapping);\n var prevChild = prevChildMapping[key];\n var isLeaving = isValidElement(prevChild) && !prevChild.props.in; // item is new (entering)\n\n if (hasNext && (!hasPrev || isLeaving)) {\n // console.log('entering', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: true,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n } else if (!hasNext && hasPrev && !isLeaving) {\n // item is old (exiting)\n // console.log('leaving', key)\n children[key] = cloneElement(child, {\n in: false\n });\n } else if (hasNext && hasPrev && isValidElement(prevChild)) {\n // item hasn't changed transition states\n // copy over the last transition props;\n // console.log('unchanged', key)\n children[key] = cloneElement(child, {\n onExited: onExited.bind(null, child),\n in: prevChild.props.in,\n exit: getProp(child, 'exit', nextProps),\n enter: getProp(child, 'enter', nextProps)\n });\n }\n });\n return children;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _assertThisInitialized from \"@babel/runtime/helpers/esm/assertThisInitialized\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport TransitionGroupContext from './TransitionGroupContext';\nimport { getChildMapping, getInitialChildMapping, getNextChildMapping } from './utils/ChildMapping';\n\nvar values = Object.values || function (obj) {\n return Object.keys(obj).map(function (k) {\n return obj[k];\n });\n};\n\nvar defaultProps = {\n component: 'div',\n childFactory: function childFactory(child) {\n return child;\n }\n};\n/**\n * The `` component manages a set of transition components\n * (`` and ``) in a list. Like with the transition\n * components, `` is a state machine for managing the mounting\n * and unmounting of components over time.\n *\n * Consider the example below. As items are removed or added to the TodoList the\n * `in` prop is toggled automatically by the ``.\n *\n * Note that `` does not define any animation behavior!\n * Exactly _how_ a list item animates is up to the individual transition\n * component. This means you can mix and match animations across different list\n * items.\n */\n\nvar TransitionGroup = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(TransitionGroup, _React$Component);\n\n function TransitionGroup(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n\n var handleExited = _this.handleExited.bind(_assertThisInitialized(_this)); // Initial children should all be entering, dependent on appear\n\n\n _this.state = {\n contextValue: {\n isMounting: true\n },\n handleExited: handleExited,\n firstRender: true\n };\n return _this;\n }\n\n var _proto = TransitionGroup.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.mounted = true;\n this.setState({\n contextValue: {\n isMounting: false\n }\n });\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.mounted = false;\n };\n\n TransitionGroup.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, _ref) {\n var prevChildMapping = _ref.children,\n handleExited = _ref.handleExited,\n firstRender = _ref.firstRender;\n return {\n children: firstRender ? getInitialChildMapping(nextProps, handleExited) : getNextChildMapping(nextProps, prevChildMapping, handleExited),\n firstRender: false\n };\n } // node is `undefined` when user provided `nodeRef` prop\n ;\n\n _proto.handleExited = function handleExited(child, node) {\n var currentChildMapping = getChildMapping(this.props.children);\n if (child.key in currentChildMapping) return;\n\n if (child.props.onExited) {\n child.props.onExited(node);\n }\n\n if (this.mounted) {\n this.setState(function (state) {\n var children = _extends({}, state.children);\n\n delete children[child.key];\n return {\n children: children\n };\n });\n }\n };\n\n _proto.render = function render() {\n var _this$props = this.props,\n Component = _this$props.component,\n childFactory = _this$props.childFactory,\n props = _objectWithoutPropertiesLoose(_this$props, [\"component\", \"childFactory\"]);\n\n var contextValue = this.state.contextValue;\n var children = values(this.state.children).map(childFactory);\n delete props.appear;\n delete props.enter;\n delete props.exit;\n\n if (Component === null) {\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, children);\n }\n\n return /*#__PURE__*/React.createElement(TransitionGroupContext.Provider, {\n value: contextValue\n }, /*#__PURE__*/React.createElement(Component, props, children));\n };\n\n return TransitionGroup;\n}(React.Component);\n\nTransitionGroup.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * `` renders a `
` by default. You can change this\n * behavior by providing a `component` prop.\n * If you use React v16+ and would like to avoid a wrapping `
` element\n * you can pass in `component={null}`. This is useful if the wrapping div\n * borks your css styles.\n */\n component: PropTypes.any,\n\n /**\n * A set of `` components, that are toggled `in` and out as they\n * leave. the `` will inject specific transition props, so\n * remember to spread them through if you are wrapping the `` as\n * with our `` example.\n *\n * While this component is meant for multiple `Transition` or `CSSTransition`\n * children, sometimes you may want to have a single transition child with\n * content that you want to be transitioned out and in when you change it\n * (e.g. routes, images etc.) In that case you can change the `key` prop of\n * the transition child as you change its content, this will cause\n * `TransitionGroup` to transition the child out and back in.\n */\n children: PropTypes.node,\n\n /**\n * A convenience prop that enables or disables appear animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n appear: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables enter animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * A convenience prop that enables or disables exit animations\n * for all children. Note that specifying this will override any defaults set\n * on individual children Transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * You may need to apply reactive updates to a child as it is exiting.\n * This is generally done by using `cloneElement` however in the case of an exiting\n * child the element has already been removed and not accessible to the consumer.\n *\n * If you do need to update a child as it leaves you can provide a `childFactory`\n * to wrap every child, even the ones that are leaving.\n *\n * @type Function(child: ReactElement) -> ReactElement\n */\n childFactory: PropTypes.func\n} : {};\nTransitionGroup.defaultProps = defaultProps;\nexport default TransitionGroup;","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport useEventCallback from '../utils/useEventCallback';\nvar useEnhancedEffect = typeof window === 'undefined' ? React.useEffect : React.useLayoutEffect;\n/**\n * @ignore - internal component.\n */\n\nfunction Ripple(props) {\n var classes = props.classes,\n _props$pulsate = props.pulsate,\n pulsate = _props$pulsate === void 0 ? false : _props$pulsate,\n rippleX = props.rippleX,\n rippleY = props.rippleY,\n rippleSize = props.rippleSize,\n inProp = props.in,\n _props$onExited = props.onExited,\n onExited = _props$onExited === void 0 ? function () {} : _props$onExited,\n timeout = props.timeout;\n\n var _React$useState = React.useState(false),\n leaving = _React$useState[0],\n setLeaving = _React$useState[1];\n\n var rippleClassName = clsx(classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);\n var rippleStyles = {\n width: rippleSize,\n height: rippleSize,\n top: -(rippleSize / 2) + rippleY,\n left: -(rippleSize / 2) + rippleX\n };\n var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);\n var handleExited = useEventCallback(onExited); // Ripple is used for user feedback (e.g. click or press) so we want to apply styles with the highest priority\n\n useEnhancedEffect(function () {\n if (!inProp) {\n // react-transition-group#onExit\n setLeaving(true); // react-transition-group#onExited\n\n var timeoutId = setTimeout(handleExited, timeout);\n return function () {\n clearTimeout(timeoutId);\n };\n }\n\n return undefined;\n }, [handleExited, inProp, timeout]);\n return /*#__PURE__*/React.createElement(\"span\", {\n className: rippleClassName,\n style: rippleStyles\n }, /*#__PURE__*/React.createElement(\"span\", {\n className: childClassName\n }));\n}\n\nprocess.env.NODE_ENV !== \"production\" ? Ripple.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore - injected from TransitionGroup\n */\n in: PropTypes.bool,\n\n /**\n * @ignore - injected from TransitionGroup\n */\n onExited: PropTypes.func,\n\n /**\n * If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.\n */\n pulsate: PropTypes.bool,\n\n /**\n * Diameter of the ripple.\n */\n rippleSize: PropTypes.number,\n\n /**\n * Horizontal position of the ripple center.\n */\n rippleX: PropTypes.number,\n\n /**\n * Vertical position of the ripple center.\n */\n rippleY: PropTypes.number,\n\n /**\n * exit delay\n */\n timeout: PropTypes.number.isRequired\n} : void 0;\nexport default Ripple;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { TransitionGroup } from 'react-transition-group';\nimport clsx from 'clsx';\nimport withStyles from '../styles/withStyles';\nimport Ripple from './Ripple';\nvar DURATION = 550;\nexport var DELAY_RIPPLE = 80;\nexport var styles = function styles(theme) {\n return {\n /* Styles applied to the root element. */\n root: {\n overflow: 'hidden',\n pointerEvents: 'none',\n position: 'absolute',\n zIndex: 0,\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n borderRadius: 'inherit'\n },\n\n /* Styles applied to the internal `Ripple` components `ripple` class. */\n ripple: {\n opacity: 0,\n position: 'absolute'\n },\n\n /* Styles applied to the internal `Ripple` components `rippleVisible` class. */\n rippleVisible: {\n opacity: 0.3,\n transform: 'scale(1)',\n animation: \"$enter \".concat(DURATION, \"ms \").concat(theme.transitions.easing.easeInOut)\n },\n\n /* Styles applied to the internal `Ripple` components `ripplePulsate` class. */\n ripplePulsate: {\n animationDuration: \"\".concat(theme.transitions.duration.shorter, \"ms\")\n },\n\n /* Styles applied to the internal `Ripple` components `child` class. */\n child: {\n opacity: 1,\n display: 'block',\n width: '100%',\n height: '100%',\n borderRadius: '50%',\n backgroundColor: 'currentColor'\n },\n\n /* Styles applied to the internal `Ripple` components `childLeaving` class. */\n childLeaving: {\n opacity: 0,\n animation: \"$exit \".concat(DURATION, \"ms \").concat(theme.transitions.easing.easeInOut)\n },\n\n /* Styles applied to the internal `Ripple` components `childPulsate` class. */\n childPulsate: {\n position: 'absolute',\n left: 0,\n top: 0,\n animation: \"$pulsate 2500ms \".concat(theme.transitions.easing.easeInOut, \" 200ms infinite\")\n },\n '@keyframes enter': {\n '0%': {\n transform: 'scale(0)',\n opacity: 0.1\n },\n '100%': {\n transform: 'scale(1)',\n opacity: 0.3\n }\n },\n '@keyframes exit': {\n '0%': {\n opacity: 1\n },\n '100%': {\n opacity: 0\n }\n },\n '@keyframes pulsate': {\n '0%': {\n transform: 'scale(1)'\n },\n '50%': {\n transform: 'scale(0.92)'\n },\n '100%': {\n transform: 'scale(1)'\n }\n }\n };\n};\n/**\n * @ignore - internal component.\n *\n * TODO v5: Make private\n */\n\nvar TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(props, ref) {\n var _props$center = props.center,\n centerProp = _props$center === void 0 ? false : _props$center,\n classes = props.classes,\n className = props.className,\n other = _objectWithoutProperties(props, [\"center\", \"classes\", \"className\"]);\n\n var _React$useState = React.useState([]),\n ripples = _React$useState[0],\n setRipples = _React$useState[1];\n\n var nextKey = React.useRef(0);\n var rippleCallback = React.useRef(null);\n React.useEffect(function () {\n if (rippleCallback.current) {\n rippleCallback.current();\n rippleCallback.current = null;\n }\n }, [ripples]); // Used to filter out mouse emulated events on mobile.\n\n var ignoringMouseDown = React.useRef(false); // We use a timer in order to only show the ripples for touch \"click\" like events.\n // We don't want to display the ripple for touch scroll events.\n\n var startTimer = React.useRef(null); // This is the hook called once the previous timeout is ready.\n\n var startTimerCommit = React.useRef(null);\n var container = React.useRef(null);\n React.useEffect(function () {\n return function () {\n clearTimeout(startTimer.current);\n };\n }, []);\n var startCommit = React.useCallback(function (params) {\n var pulsate = params.pulsate,\n rippleX = params.rippleX,\n rippleY = params.rippleY,\n rippleSize = params.rippleSize,\n cb = params.cb;\n setRipples(function (oldRipples) {\n return [].concat(_toConsumableArray(oldRipples), [/*#__PURE__*/React.createElement(Ripple, {\n key: nextKey.current,\n classes: classes,\n timeout: DURATION,\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize\n })]);\n });\n nextKey.current += 1;\n rippleCallback.current = cb;\n }, [classes]);\n var start = React.useCallback(function () {\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var cb = arguments.length > 2 ? arguments[2] : undefined;\n var _options$pulsate = options.pulsate,\n pulsate = _options$pulsate === void 0 ? false : _options$pulsate,\n _options$center = options.center,\n center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,\n _options$fakeElement = options.fakeElement,\n fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;\n\n if (event.type === 'mousedown' && ignoringMouseDown.current) {\n ignoringMouseDown.current = false;\n return;\n }\n\n if (event.type === 'touchstart') {\n ignoringMouseDown.current = true;\n }\n\n var element = fakeElement ? null : container.current;\n var rect = element ? element.getBoundingClientRect() : {\n width: 0,\n height: 0,\n left: 0,\n top: 0\n }; // Get the size of the ripple\n\n var rippleX;\n var rippleY;\n var rippleSize;\n\n if (center || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {\n rippleX = Math.round(rect.width / 2);\n rippleY = Math.round(rect.height / 2);\n } else {\n var _ref = event.touches ? event.touches[0] : event,\n clientX = _ref.clientX,\n clientY = _ref.clientY;\n\n rippleX = Math.round(clientX - rect.left);\n rippleY = Math.round(clientY - rect.top);\n }\n\n if (center) {\n rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3); // For some reason the animation is broken on Mobile Chrome if the size if even.\n\n if (rippleSize % 2 === 0) {\n rippleSize += 1;\n }\n } else {\n var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;\n var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;\n rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));\n } // Touche devices\n\n\n if (event.touches) {\n // check that this isn't another touchstart due to multitouch\n // otherwise we will only clear a single timer when unmounting while two\n // are running\n if (startTimerCommit.current === null) {\n // Prepare the ripple effect.\n startTimerCommit.current = function () {\n startCommit({\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize,\n cb: cb\n });\n }; // Delay the execution of the ripple effect.\n\n\n startTimer.current = setTimeout(function () {\n if (startTimerCommit.current) {\n startTimerCommit.current();\n startTimerCommit.current = null;\n }\n }, DELAY_RIPPLE); // We have to make a tradeoff with this value.\n }\n } else {\n startCommit({\n pulsate: pulsate,\n rippleX: rippleX,\n rippleY: rippleY,\n rippleSize: rippleSize,\n cb: cb\n });\n }\n }, [centerProp, startCommit]);\n var pulsate = React.useCallback(function () {\n start({}, {\n pulsate: true\n });\n }, [start]);\n var stop = React.useCallback(function (event, cb) {\n clearTimeout(startTimer.current); // The touch interaction occurs too quickly.\n // We still want to show ripple effect.\n\n if (event.type === 'touchend' && startTimerCommit.current) {\n event.persist();\n startTimerCommit.current();\n startTimerCommit.current = null;\n startTimer.current = setTimeout(function () {\n stop(event, cb);\n });\n return;\n }\n\n startTimerCommit.current = null;\n setRipples(function (oldRipples) {\n if (oldRipples.length > 0) {\n return oldRipples.slice(1);\n }\n\n return oldRipples;\n });\n rippleCallback.current = cb;\n }, []);\n React.useImperativeHandle(ref, function () {\n return {\n pulsate: pulsate,\n start: start,\n stop: stop\n };\n }, [pulsate, start, stop]);\n return /*#__PURE__*/React.createElement(\"span\", _extends({\n className: clsx(classes.root, className),\n ref: container\n }, other), /*#__PURE__*/React.createElement(TransitionGroup, {\n component: null,\n exit: true\n }, ripples));\n});\nprocess.env.NODE_ENV !== \"production\" ? TouchRipple.propTypes = {\n /**\n * If `true`, the ripple starts at the center of the component\n * rather than at the point of interaction.\n */\n center: PropTypes.bool,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object.isRequired,\n\n /**\n * @ignore\n */\n className: PropTypes.string\n} : void 0;\nexport default withStyles(styles, {\n flip: false,\n name: 'MuiTouchRipple'\n})( /*#__PURE__*/React.memo(TouchRipple));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport * as ReactDOM from 'react-dom';\nimport clsx from 'clsx';\nimport { elementTypeAcceptingRef, refType } from '@material-ui/utils';\nimport useForkRef from '../utils/useForkRef';\nimport useEventCallback from '../utils/useEventCallback';\nimport withStyles from '../styles/withStyles';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport TouchRipple from './TouchRipple';\nexport var styles = {\n /* Styles applied to the root element. */\n root: {\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n position: 'relative',\n WebkitTapHighlightColor: 'transparent',\n backgroundColor: 'transparent',\n // Reset default value\n // We disable the focus ring for mouse, touch and keyboard users.\n outline: 0,\n border: 0,\n margin: 0,\n // Remove the margin in Safari\n borderRadius: 0,\n padding: 0,\n // Remove the padding in Firefox\n cursor: 'pointer',\n userSelect: 'none',\n verticalAlign: 'middle',\n '-moz-appearance': 'none',\n // Reset\n '-webkit-appearance': 'none',\n // Reset\n textDecoration: 'none',\n // So we take precedent over the style of a native element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n\n },\n '&$disabled': {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n }\n },\n\n /* Pseudo-class applied to the root element if `disabled={true}`. */\n disabled: {},\n\n /* Pseudo-class applied to the root element if keyboard focused. */\n focusVisible: {}\n};\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\n\nvar ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {\n var action = props.action,\n buttonRefProp = props.buttonRef,\n _props$centerRipple = props.centerRipple,\n centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,\n children = props.children,\n classes = props.classes,\n className = props.className,\n _props$component = props.component,\n component = _props$component === void 0 ? 'button' : _props$component,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$disableRipple = props.disableRipple,\n disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,\n _props$disableTouchRi = props.disableTouchRipple,\n disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,\n _props$focusRipple = props.focusRipple,\n focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,\n focusVisibleClassName = props.focusVisibleClassName,\n onBlur = props.onBlur,\n onClick = props.onClick,\n onFocus = props.onFocus,\n onFocusVisible = props.onFocusVisible,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp,\n onMouseDown = props.onMouseDown,\n onMouseLeave = props.onMouseLeave,\n onMouseUp = props.onMouseUp,\n onTouchEnd = props.onTouchEnd,\n onTouchMove = props.onTouchMove,\n onTouchStart = props.onTouchStart,\n onDragLeave = props.onDragLeave,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n TouchRippleProps = props.TouchRippleProps,\n _props$type = props.type,\n type = _props$type === void 0 ? 'button' : _props$type,\n other = _objectWithoutProperties(props, [\"action\", \"buttonRef\", \"centerRipple\", \"children\", \"classes\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"onBlur\", \"onClick\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"onDragLeave\", \"tabIndex\", \"TouchRippleProps\", \"type\"]);\n\n var buttonRef = React.useRef(null);\n\n function getButtonNode() {\n // #StrictMode ready\n return ReactDOM.findDOMNode(buttonRef.current);\n }\n\n var rippleRef = React.useRef(null);\n\n var _React$useState = React.useState(false),\n focusVisible = _React$useState[0],\n setFocusVisible = _React$useState[1];\n\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n\n var _useIsFocusVisible = useIsFocusVisible(),\n isFocusVisible = _useIsFocusVisible.isFocusVisible,\n onBlurVisible = _useIsFocusVisible.onBlurVisible,\n focusVisibleRef = _useIsFocusVisible.ref;\n\n React.useImperativeHandle(action, function () {\n return {\n focusVisible: function focusVisible() {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n };\n }, []);\n React.useEffect(function () {\n if (focusVisible && focusRipple && !disableRipple) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible]);\n\n function useRippleHandler(rippleAction, eventCallback) {\n var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;\n return useEventCallback(function (event) {\n if (eventCallback) {\n eventCallback(event);\n }\n\n var ignore = skipRippleAction;\n\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n\n return true;\n });\n }\n\n var handleMouseDown = useRippleHandler('start', onMouseDown);\n var handleDragLeave = useRippleHandler('stop', onDragLeave);\n var handleMouseUp = useRippleHandler('stop', onMouseUp);\n var handleMouseLeave = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n event.preventDefault();\n }\n\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n var handleTouchStart = useRippleHandler('start', onTouchStart);\n var handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n var handleTouchMove = useRippleHandler('stop', onTouchMove);\n var handleBlur = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n onBlurVisible(event);\n setFocusVisible(false);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n var handleFocus = useEventCallback(function (event) {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n\n if (isFocusVisible(event)) {\n setFocusVisible(true);\n\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n\n if (onFocus) {\n onFocus(event);\n }\n });\n\n var isNonNativeButton = function isNonNativeButton() {\n var button = getButtonNode();\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n /**\n * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n\n\n var keydownRef = React.useRef(false);\n var handleKeyDown = useEventCallback(function (event) {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n event.persist();\n rippleRef.current.stop(event, function () {\n rippleRef.current.start(event);\n });\n }\n\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n } // Keyboard accessibility for non interactive elements\n\n\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n\n if (onClick) {\n onClick(event);\n }\n }\n });\n var handleKeyUp = useEventCallback(function (event) {\n // calling preventDefault in keyUp on a