From d9c41ecd00be755426417751c0a3d27d3c8f171c Mon Sep 17 00:00:00 2001 From: iOS Date: Tue, 30 Nov 2021 21:15:27 +0000 Subject: [PATCH] bday Seraphine --- .obsidian/community-plugins.json | 5 +- .obsidian/plugins/ledger-obsidian/data.json | 6 +- .obsidian/plugins/ledger-obsidian/main.js | 25838 ++--- .../plugins/ledger-obsidian/manifest.json | 2 +- .obsidian/plugins/mrj-text-expand/main.js | 696 + .../plugins/mrj-text-expand/manifest.json | 9 + .obsidian/plugins/mrj-text-expand/styles.css | 1 + .../plugins/obsidian-admonition/data.json | 2 +- .obsidian/plugins/obsidian-admonition/main.js | 2 +- .../plugins/obsidian-admonition/manifest.json | 2 +- .../plugins/obsidian-advanced-uri/main.js | 2028 + .../obsidian-advanced-uri/manifest.json | 8 + .../plugins/obsidian-advanced-uri/styles.css | 1 + .../obsidian-crypto-lookup/currencies.json | 1 + .../plugins/obsidian-dice-roller/main.js | 2 +- .../obsidian-dice-roller/manifest.json | 2 +- .obsidian/plugins/obsidian-footnotes/main.js | 174 + .../plugins/obsidian-footnotes/manifest.json | 10 + .../plugins/obsidian-footnotes/styles.css | 1 + .obsidian/plugins/rss-reader/data.json | 84761 +++++++++++----- .obsidian/plugins/rss-reader/main.js | 1430 +- .obsidian/plugins/rss-reader/manifest.json | 2 +- .../plugins/table-editor-obsidian/main.js | 188 +- .../table-editor-obsidian/manifest.json | 4 +- .obsidian/workspace | 32 +- 00.03 News/News.md | 3 - 01.03 Family/Birthdays.md | 3 +- 27 files changed, 72447 insertions(+), 42766 deletions(-) create mode 100644 .obsidian/plugins/mrj-text-expand/main.js create mode 100644 .obsidian/plugins/mrj-text-expand/manifest.json create mode 100644 .obsidian/plugins/mrj-text-expand/styles.css create mode 100644 .obsidian/plugins/obsidian-advanced-uri/main.js create mode 100644 .obsidian/plugins/obsidian-advanced-uri/manifest.json create mode 100644 .obsidian/plugins/obsidian-advanced-uri/styles.css create mode 100644 .obsidian/plugins/obsidian-crypto-lookup/currencies.json create mode 100644 .obsidian/plugins/obsidian-footnotes/main.js create mode 100644 .obsidian/plugins/obsidian-footnotes/manifest.json create mode 100644 .obsidian/plugins/obsidian-footnotes/styles.css diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index d30afbf9..c2769bd0 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -28,5 +28,8 @@ "nldates-obsidian", "rss-reader", "customizable-page-header-buttons", - "obsidian-crypto-lookup" + "obsidian-crypto-lookup", + "obsidian-footnotes", + "obsidian-advanced-uri", + "mrj-text-expand" ] \ No newline at end of file diff --git a/.obsidian/plugins/ledger-obsidian/data.json b/.obsidian/plugins/ledger-obsidian/data.json index e4986584..b16c6da2 100644 --- a/.obsidian/plugins/ledger-obsidian/data.json +++ b/.obsidian/plugins/ledger-obsidian/data.json @@ -2,5 +2,9 @@ "currencySymbol": "£", "ledgerFile": "Ledger.md", "includeFinalLineAmount": false, - "enableLedgerVis": false + "enableLedgerVis": false, + "assetAccountsPrefix": "a", + "expenseAccountsPrefix": "e", + "incomeAccountsPrefix": "i", + "liabilityAccountsPrefix": "l" } \ No newline at end of file diff --git a/.obsidian/plugins/ledger-obsidian/main.js b/.obsidian/plugins/ledger-obsidian/main.js index 301ffdf4..b5ede9b2 100644 --- a/.obsidian/plugins/ledger-obsidian/main.js +++ b/.obsidian/plugins/ledger-obsidian/main.js @@ -2,31 +2,6 @@ var obsidian = require('obsidian'); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function createCommonjsModule(fn) { @@ -35,603 +10,43 @@ function createCommonjsModule(fn) { } var moo = createCommonjsModule(function (module) { -(function(root, factory) { - if ( module.exports) { - module.exports = factory(); - } else { - root.moo = factory(); - } -}(commonjsGlobal, function() { - - var hasOwnProperty = Object.prototype.hasOwnProperty; - var toString = Object.prototype.toString; - var hasSticky = typeof new RegExp().sticky === 'boolean'; - - /***************************************************************************/ - - function isRegExp(o) { return o && toString.call(o) === '[object RegExp]' } - function isObject(o) { return o && typeof o === 'object' && !isRegExp(o) && !Array.isArray(o) } - - function reEscape(s) { - return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&') - } - function reGroups(s) { - var re = new RegExp('|' + s); - return re.exec('').length - 1 - } - function reCapture(s) { - return '(' + s + ')' - } - function reUnion(regexps) { - if (!regexps.length) return '(?!)' - var source = regexps.map(function(s) { - return "(?:" + s + ")" - }).join('|'); - return "(?:" + source + ")" - } - - function regexpOrLiteral(obj) { - if (typeof obj === 'string') { - return '(?:' + reEscape(obj) + ')' - - } else if (isRegExp(obj)) { - // TODO: consider /u support - if (obj.ignoreCase) throw new Error('RegExp /i flag not allowed') - if (obj.global) throw new Error('RegExp /g flag is implied') - if (obj.sticky) throw new Error('RegExp /y flag is implied') - if (obj.multiline) throw new Error('RegExp /m flag is implied') - return obj.source - - } else { - throw new Error('Not a pattern: ' + obj) - } - } - - function objectToRules(object) { - var keys = Object.getOwnPropertyNames(object); - var result = []; - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var thing = object[key]; - var rules = [].concat(thing); - if (key === 'include') { - for (var j = 0; j < rules.length; j++) { - result.push({include: rules[j]}); - } - continue - } - var match = []; - rules.forEach(function(rule) { - if (isObject(rule)) { - if (match.length) result.push(ruleOptions(key, match)); - result.push(ruleOptions(key, rule)); - match = []; - } else { - match.push(rule); - } - }); - if (match.length) result.push(ruleOptions(key, match)); - } - return result - } - - function arrayToRules(array) { - var result = []; - for (var i = 0; i < array.length; i++) { - var obj = array[i]; - if (obj.include) { - var include = [].concat(obj.include); - for (var j = 0; j < include.length; j++) { - result.push({include: include[j]}); - } - continue - } - if (!obj.type) { - throw new Error('Rule has no type: ' + JSON.stringify(obj)) - } - result.push(ruleOptions(obj.type, obj)); - } - return result - } - - function ruleOptions(type, obj) { - if (!isObject(obj)) { - obj = { match: obj }; - } - if (obj.include) { - throw new Error('Matching rules cannot also include states') - } - - // nb. error and fallback imply lineBreaks - var options = { - defaultType: type, - lineBreaks: !!obj.error || !!obj.fallback, - pop: false, - next: null, - push: null, - error: false, - fallback: false, - value: null, - type: null, - shouldThrow: false, - }; - - // Avoid Object.assign(), so we support IE9+ - for (var key in obj) { - if (hasOwnProperty.call(obj, key)) { - options[key] = obj[key]; - } - } - - // type transform cannot be a string - if (typeof options.type === 'string' && type !== options.type) { - throw new Error("Type transform cannot be a string (type '" + options.type + "' for token '" + type + "')") - } - - // convert to array - var match = options.match; - options.match = Array.isArray(match) ? match : match ? [match] : []; - options.match.sort(function(a, b) { - return isRegExp(a) && isRegExp(b) ? 0 - : isRegExp(b) ? -1 : isRegExp(a) ? +1 : b.length - a.length - }); - return options - } - - function toRules(spec) { - return Array.isArray(spec) ? arrayToRules(spec) : objectToRules(spec) - } - - var defaultErrorRule = ruleOptions('error', {lineBreaks: true, shouldThrow: true}); - function compileRules(rules, hasStates) { - var errorRule = null; - var fast = Object.create(null); - var fastAllowed = true; - var unicodeFlag = null; - var groups = []; - var parts = []; - - // If there is a fallback rule, then disable fast matching - for (var i = 0; i < rules.length; i++) { - if (rules[i].fallback) { - fastAllowed = false; - } - } - - for (var i = 0; i < rules.length; i++) { - var options = rules[i]; - - if (options.include) { - // all valid inclusions are removed by states() preprocessor - throw new Error('Inheritance is not allowed in stateless lexers') - } - - if (options.error || options.fallback) { - // errorRule can only be set once - if (errorRule) { - if (!options.fallback === !errorRule.fallback) { - throw new Error("Multiple " + (options.fallback ? "fallback" : "error") + " rules not allowed (for token '" + options.defaultType + "')") - } else { - throw new Error("fallback and error are mutually exclusive (for token '" + options.defaultType + "')") - } - } - errorRule = options; - } - - var match = options.match.slice(); - if (fastAllowed) { - while (match.length && typeof match[0] === 'string' && match[0].length === 1) { - var word = match.shift(); - fast[word.charCodeAt(0)] = options; - } - } - - // Warn about inappropriate state-switching options - if (options.pop || options.push || options.next) { - if (!hasStates) { - throw new Error("State-switching options are not allowed in stateless lexers (for token '" + options.defaultType + "')") - } - if (options.fallback) { - throw new Error("State-switching options are not allowed on fallback tokens (for token '" + options.defaultType + "')") - } - } - - // Only rules with a .match are included in the RegExp - if (match.length === 0) { - continue - } - fastAllowed = false; - - groups.push(options); - - // Check unicode flag is used everywhere or nowhere - for (var j = 0; j < match.length; j++) { - var obj = match[j]; - if (!isRegExp(obj)) { - continue - } - - if (unicodeFlag === null) { - unicodeFlag = obj.unicode; - } else if (unicodeFlag !== obj.unicode && options.fallback === false) { - throw new Error('If one rule is /u then all must be') - } - } - - // convert to RegExp - var pat = reUnion(match.map(regexpOrLiteral)); - - // validate - var regexp = new RegExp(pat); - if (regexp.test("")) { - throw new Error("RegExp matches empty string: " + regexp) - } - var groupCount = reGroups(pat); - if (groupCount > 0) { - throw new Error("RegExp has capture groups: " + regexp + "\nUse (?: … ) instead") - } - - // try and detect rules matching newlines - if (!options.lineBreaks && regexp.test('\n')) { - throw new Error('Rule should declare lineBreaks: ' + regexp) - } - - // store regex - parts.push(reCapture(pat)); - } - - - // If there's no fallback rule, use the sticky flag so we only look for - // matches at the current index. - // - // If we don't support the sticky flag, then fake it using an irrefutable - // match (i.e. an empty pattern). - var fallbackRule = errorRule && errorRule.fallback; - var flags = hasSticky && !fallbackRule ? 'ym' : 'gm'; - var suffix = hasSticky || fallbackRule ? '' : '|'; - - if (unicodeFlag === true) flags += "u"; - var combined = new RegExp(reUnion(parts) + suffix, flags); - return {regexp: combined, groups: groups, fast: fast, error: errorRule || defaultErrorRule} - } - - function compile(rules) { - var result = compileRules(toRules(rules)); - return new Lexer({start: result}, 'start') - } - - function checkStateGroup(g, name, map) { - var state = g && (g.push || g.next); - if (state && !map[state]) { - throw new Error("Missing state '" + state + "' (in token '" + g.defaultType + "' of state '" + name + "')") - } - if (g && g.pop && +g.pop !== 1) { - throw new Error("pop must be 1 (in token '" + g.defaultType + "' of state '" + name + "')") - } - } - function compileStates(states, start) { - var all = states.$all ? toRules(states.$all) : []; - delete states.$all; - - var keys = Object.getOwnPropertyNames(states); - if (!start) start = keys[0]; - - var ruleMap = Object.create(null); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - ruleMap[key] = toRules(states[key]).concat(all); - } - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - var rules = ruleMap[key]; - var included = Object.create(null); - for (var j = 0; j < rules.length; j++) { - var rule = rules[j]; - if (!rule.include) continue - var splice = [j, 1]; - if (rule.include !== key && !included[rule.include]) { - included[rule.include] = true; - var newRules = ruleMap[rule.include]; - if (!newRules) { - throw new Error("Cannot include nonexistent state '" + rule.include + "' (in state '" + key + "')") - } - for (var k = 0; k < newRules.length; k++) { - var newRule = newRules[k]; - if (rules.indexOf(newRule) !== -1) continue - splice.push(newRule); - } - } - rules.splice.apply(rules, splice); - j--; - } - } - - var map = Object.create(null); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - map[key] = compileRules(ruleMap[key], true); - } - - for (var i = 0; i < keys.length; i++) { - var name = keys[i]; - var state = map[name]; - var groups = state.groups; - for (var j = 0; j < groups.length; j++) { - checkStateGroup(groups[j], name, map); - } - var fastKeys = Object.getOwnPropertyNames(state.fast); - for (var j = 0; j < fastKeys.length; j++) { - checkStateGroup(state.fast[fastKeys[j]], name, map); - } - } - - return new Lexer(map, start) - } - - function keywordTransform(map) { - var reverseMap = Object.create(null); - var byLength = Object.create(null); - var types = Object.getOwnPropertyNames(map); - for (var i = 0; i < types.length; i++) { - var tokenType = types[i]; - var item = map[tokenType]; - var keywordList = Array.isArray(item) ? item : [item]; - keywordList.forEach(function(keyword) { - (byLength[keyword.length] = byLength[keyword.length] || []).push(keyword); - if (typeof keyword !== 'string') { - throw new Error("keyword must be string (in keyword '" + tokenType + "')") - } - reverseMap[keyword] = tokenType; - }); - } - - // fast string lookup - // https://jsperf.com/string-lookups - function str(x) { return JSON.stringify(x) } - var source = ''; - source += 'switch (value.length) {\n'; - for (var length in byLength) { - var keywords = byLength[length]; - source += 'case ' + length + ':\n'; - source += 'switch (value) {\n'; - keywords.forEach(function(keyword) { - var tokenType = reverseMap[keyword]; - source += 'case ' + str(keyword) + ': return ' + str(tokenType) + '\n'; - }); - source += '}\n'; - } - source += '}\n'; - return Function('value', source) // type - } - - /***************************************************************************/ - - var Lexer = function(states, state) { - this.startState = state; - this.states = states; - this.buffer = ''; - this.stack = []; - this.reset(); - }; - - Lexer.prototype.reset = function(data, info) { - this.buffer = data || ''; - this.index = 0; - this.line = info ? info.line : 1; - this.col = info ? info.col : 1; - this.queuedToken = info ? info.queuedToken : null; - this.queuedThrow = info ? info.queuedThrow : null; - this.setState(info ? info.state : this.startState); - this.stack = info && info.stack ? info.stack.slice() : []; - return this - }; - - Lexer.prototype.save = function() { - return { - line: this.line, - col: this.col, - state: this.state, - stack: this.stack.slice(), - queuedToken: this.queuedToken, - queuedThrow: this.queuedThrow, - } - }; - - Lexer.prototype.setState = function(state) { - if (!state || this.state === state) return - this.state = state; - var info = this.states[state]; - this.groups = info.groups; - this.error = info.error; - this.re = info.regexp; - this.fast = info.fast; - }; - - Lexer.prototype.popState = function() { - this.setState(this.stack.pop()); - }; - - Lexer.prototype.pushState = function(state) { - this.stack.push(this.state); - this.setState(state); - }; - - var eat = hasSticky ? function(re, buffer) { // assume re is /y - return re.exec(buffer) - } : function(re, buffer) { // assume re is /g - var match = re.exec(buffer); - // will always match, since we used the |(?:) trick - if (match[0].length === 0) { - return null - } - return match - }; - - Lexer.prototype._getGroup = function(match) { - var groupCount = this.groups.length; - for (var i = 0; i < groupCount; i++) { - if (match[i + 1] !== undefined) { - return this.groups[i] - } - } - throw new Error('Cannot find token type for matched text') - }; - - function tokenToString() { - return this.value - } - - Lexer.prototype.next = function() { - var index = this.index; - - // If a fallback token matched, we don't need to re-run the RegExp - if (this.queuedGroup) { - var token = this._token(this.queuedGroup, this.queuedText, index); - this.queuedGroup = null; - this.queuedText = ""; - return token - } - - var buffer = this.buffer; - if (index === buffer.length) { - return // EOF - } - - // Fast matching for single characters - var group = this.fast[buffer.charCodeAt(index)]; - if (group) { - return this._token(group, buffer.charAt(index), index) - } - - // Execute RegExp - var re = this.re; - re.lastIndex = index; - var match = eat(re, buffer); - - // Error tokens match the remaining buffer - var error = this.error; - if (match == null) { - return this._token(error, buffer.slice(index, buffer.length), index) - } - - var group = this._getGroup(match); - var text = match[0]; - - if (error.fallback && match.index !== index) { - this.queuedGroup = group; - this.queuedText = text; - - // Fallback tokens contain the unmatched portion of the buffer - return this._token(error, buffer.slice(index, match.index), index) - } - - return this._token(group, text, index) - }; - - Lexer.prototype._token = function(group, text, offset) { - // count line breaks - var lineBreaks = 0; - if (group.lineBreaks) { - var matchNL = /\n/g; - var nl = 1; - if (text === '\n') { - lineBreaks = 1; - } else { - while (matchNL.exec(text)) { lineBreaks++; nl = matchNL.lastIndex; } - } - } - - var token = { - type: (typeof group.type === 'function' && group.type(text)) || group.defaultType, - value: typeof group.value === 'function' ? group.value(text) : text, - text: text, - toString: tokenToString, - offset: offset, - lineBreaks: lineBreaks, - line: this.line, - col: this.col, - }; - // nb. adding more props to token object will make V8 sad! - - var size = text.length; - this.index += size; - this.line += lineBreaks; - if (lineBreaks !== 0) { - this.col = size - nl + 1; - } else { - this.col += size; - } - - // throw, if no rule with {error: true} - if (group.shouldThrow) { - throw new Error(this.formatError(token, "invalid syntax")) - } - - if (group.pop) this.popState(); - else if (group.push) this.pushState(group.push); - else if (group.next) this.setState(group.next); - - return token - }; - - if (typeof Symbol !== 'undefined' && Symbol.iterator) { - var LexerIterator = function(lexer) { - this.lexer = lexer; - }; - - LexerIterator.prototype.next = function() { - var token = this.lexer.next(); - return {value: token, done: !token} - }; - - LexerIterator.prototype[Symbol.iterator] = function() { - return this - }; - - Lexer.prototype[Symbol.iterator] = function() { - return new LexerIterator(this) - }; - } - - Lexer.prototype.formatError = function(token, message) { - if (token == null) { - // An undefined token indicates EOF - var text = this.buffer.slice(this.index); - var token = { - text: text, - offset: this.index, - lineBreaks: text.indexOf('\n') === -1 ? 0 : 1, - line: this.line, - col: this.col, - }; - } - var start = Math.max(0, token.offset - token.col + 1); - var eol = token.lineBreaks ? token.text.indexOf('\n') : token.text.length; - var firstLine = this.buffer.substring(start, token.offset + eol); - message += " at line " + token.line + " col " + token.col + ":\n\n"; - message += " " + firstLine + "\n"; - message += " " + Array(token.col).join(" ") + "^"; - return message - }; - - Lexer.prototype.clone = function() { - return new Lexer(this.states, this.state) - }; - - Lexer.prototype.has = function(tokenType) { - return true - }; - - - return { - compile: compile, - states: compileStates, - error: Object.freeze({error: true}), - fallback: Object.freeze({fallback: true}), - keywords: keywordTransform, - } - -})); +(function(root,factory){if(module.exports){module.exports=factory();}else {root.moo=factory();}})(commonjsGlobal,function(){var hasOwnProperty=Object.prototype.hasOwnProperty;var toString=Object.prototype.toString;var hasSticky=typeof new RegExp().sticky==='boolean';/***************************************************************************/function isRegExp(o){return o&&toString.call(o)==='[object RegExp]';}function isObject(o){return o&&typeof o==='object'&&!isRegExp(o)&&!Array.isArray(o);}function reEscape(s){return s.replace(/[-\/\\^$*+?.()|[\]{}]/g,'\\$&');}function reGroups(s){var re=new RegExp('|'+s);return re.exec('').length-1;}function reCapture(s){return '('+s+')';}function reUnion(regexps){if(!regexps.length)return '(?!)';var source=regexps.map(function(s){return "(?:"+s+")";}).join('|');return "(?:"+source+")";}function regexpOrLiteral(obj){if(typeof obj==='string'){return '(?:'+reEscape(obj)+')';}else if(isRegExp(obj)){// TODO: consider /u support +if(obj.ignoreCase)throw new Error('RegExp /i flag not allowed');if(obj.global)throw new Error('RegExp /g flag is implied');if(obj.sticky)throw new Error('RegExp /y flag is implied');if(obj.multiline)throw new Error('RegExp /m flag is implied');return obj.source;}else {throw new Error('Not a pattern: '+obj);}}function objectToRules(object){var keys=Object.getOwnPropertyNames(object);var result=[];for(var i=0;i0){throw new Error("RegExp has capture groups: "+regexp+"\nUse (?: … ) instead");}// try and detect rules matching newlines +if(!options.lineBreaks&®exp.test('\n')){throw new Error('Rule should declare lineBreaks: '+regexp);}// store regex +parts.push(reCapture(pat));}// If there's no fallback rule, use the sticky flag so we only look for +// matches at the current index. +// +// If we don't support the sticky flag, then fake it using an irrefutable +// match (i.e. an empty pattern). +var fallbackRule=errorRule&&errorRule.fallback;var flags=hasSticky&&!fallbackRule?'ym':'gm';var suffix=hasSticky||fallbackRule?'':'|';if(unicodeFlag===true)flags+="u";var combined=new RegExp(reUnion(parts)+suffix,flags);return {regexp:combined,groups:groups,fast:fast,error:errorRule||defaultErrorRule};}function compile(rules){var result=compileRules(toRules(rules));return new Lexer({start:result},'start');}function checkStateGroup(g,name,map){var state=g&&(g.push||g.next);if(state&&!map[state]){throw new Error("Missing state '"+state+"' (in token '"+g.defaultType+"' of state '"+name+"')");}if(g&&g.pop&&+g.pop!==1){throw new Error("pop must be 1 (in token '"+g.defaultType+"' of state '"+name+"')");}}function compileStates(states,start){var all=states.$all?toRules(states.$all):[];delete states.$all;var keys=Object.getOwnPropertyNames(states);if(!start)start=keys[0];var ruleMap=Object.create(null);for(var i=0;i null }, { "name": "transaction", "symbols": [(lexer.has("date") ? { type: "date" } : date), (lexer.has("ws") ? { type: "ws" } : ws), "transaction$ebnf$1", (lexer.has("payee") ? { type: "payee" } : payee), "transaction$ebnf$2", (lexer.has("newline") ? { type: "newline" } : newline), "expenselines"], "postprocess": function (d) { - var _a; return { date: d[0].value, check: d[2] || undefined, payee: d[3].value, - comment: ((_a = d[4]) === null || _a === void 0 ? void 0 : _a.value) || undefined, + comment: d[4]?.value || undefined, expenselines: d[6] }; } @@ -705,13 +119,12 @@ const grammar = { { "name": "expenseline$ebnf$5", "symbols": [(lexer.has("comment") ? { type: "comment" } : comment)], "postprocess": id }, { "name": "expenseline$ebnf$5", "symbols": [], "postprocess": () => null }, { "name": "expenseline", "symbols": ["expenseline$ebnf$1", "expenseline$ebnf$2", (lexer.has("category") ? { type: "category" } : category), "expenseline$ebnf$3", "expenseline$ebnf$4", "expenseline$ebnf$5"], "postprocess": function (d) { - var _a, _b, _c; return { reconcile: d[1] || '', category: d[2].value, - currency: (_a = d[3]) === null || _a === void 0 ? void 0 : _a.currency, - amount: (_b = d[3]) === null || _b === void 0 ? void 0 : _b.amount, - comment: (_c = d[5]) === null || _c === void 0 ? void 0 : _c.value, + currency: d[3]?.currency, + amount: d[3]?.amount, + comment: d[5]?.value, }; } }, @@ -738,168 +151,10 @@ const grammar = { */ var lodash = createCommonjsModule(function (module, exports) { -(function() { - - /** Used as a safe reference for `undefined` in pre-ES5 environments. */ - var undefined$1; - - /** Used as the semantic version number. */ - var VERSION = '4.17.21'; - - /** Used as the size to enable large array optimizations. */ - var LARGE_ARRAY_SIZE = 200; - - /** Error message constants. */ - var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function', - INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; - - /** Used to stand-in for `undefined` hash values. */ - var HASH_UNDEFINED = '__lodash_hash_undefined__'; - - /** Used as the maximum memoize cache size. */ - var MAX_MEMOIZE_SIZE = 500; - - /** Used as the internal argument placeholder. */ - var PLACEHOLDER = '__lodash_placeholder__'; - - /** Used to compose bitmasks for cloning. */ - var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; - - /** Used to compose bitmasks for value comparisons. */ - var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; - - /** Used to compose bitmasks for function metadata. */ - var WRAP_BIND_FLAG = 1, - WRAP_BIND_KEY_FLAG = 2, - WRAP_CURRY_BOUND_FLAG = 4, - WRAP_CURRY_FLAG = 8, - WRAP_CURRY_RIGHT_FLAG = 16, - WRAP_PARTIAL_FLAG = 32, - WRAP_PARTIAL_RIGHT_FLAG = 64, - WRAP_ARY_FLAG = 128, - WRAP_REARG_FLAG = 256, - WRAP_FLIP_FLAG = 512; - - /** Used as default options for `_.truncate`. */ - var DEFAULT_TRUNC_LENGTH = 30, - DEFAULT_TRUNC_OMISSION = '...'; - - /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 800, - HOT_SPAN = 16; - - /** Used to indicate the type of lazy iteratees. */ - var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; - - /** Used as references for various `Number` constants. */ - var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - - /** Used as references for the maximum length and index of an array. */ - var MAX_ARRAY_LENGTH = 4294967295, - MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, - HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - - /** Used to associate wrap methods with their bit flags. */ - var wrapFlags = [ - ['ary', WRAP_ARY_FLAG], - ['bind', WRAP_BIND_FLAG], - ['bindKey', WRAP_BIND_KEY_FLAG], - ['curry', WRAP_CURRY_FLAG], - ['curryRight', WRAP_CURRY_RIGHT_FLAG], - ['flip', WRAP_FLIP_FLAG], - ['partial', WRAP_PARTIAL_FLAG], - ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], - ['rearg', WRAP_REARG_FLAG] - ]; - - /** `Object#toString` result references. */ - var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - asyncTag = '[object AsyncFunction]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - domExcTag = '[object DOMException]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - nullTag = '[object Null]', - objectTag = '[object Object]', - promiseTag = '[object Promise]', - proxyTag = '[object Proxy]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - undefinedTag = '[object Undefined]', - weakMapTag = '[object WeakMap]', - weakSetTag = '[object WeakSet]'; - - var arrayBufferTag = '[object ArrayBuffer]', - dataViewTag = '[object DataView]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - - /** Used to match empty string literals in compiled template source. */ - var reEmptyStringLeading = /\b__p \+= '';/g, - reEmptyStringMiddle = /\b(__p \+=) '' \+/g, - reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - - /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, - reUnescapedHtml = /[&<>"']/g, - reHasEscapedHtml = RegExp(reEscapedHtml.source), - reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - - /** Used to match template delimiters. */ - var reEscape = /<%-([\s\S]+?)%>/g, - reEvaluate = /<%([\s\S]+?)%>/g, - reInterpolate = /<%=([\s\S]+?)%>/g; - - /** Used to match property names within property paths. */ - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, - reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - - /** +(function(){/** Used as a safe reference for `undefined` in pre-ES5 environments. */var undefined$1;/** Used as the semantic version number. */var VERSION='4.17.21';/** Used as the size to enable large array optimizations. */var LARGE_ARRAY_SIZE=200;/** Error message constants. */var CORE_ERROR_TEXT='Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',FUNC_ERROR_TEXT='Expected a function',INVALID_TEMPL_VAR_ERROR_TEXT='Invalid `variable` option passed into `_.template`';/** Used to stand-in for `undefined` hash values. */var HASH_UNDEFINED='__lodash_hash_undefined__';/** Used as the maximum memoize cache size. */var MAX_MEMOIZE_SIZE=500;/** Used as the internal argument placeholder. */var PLACEHOLDER='__lodash_placeholder__';/** Used to compose bitmasks for cloning. */var CLONE_DEEP_FLAG=1,CLONE_FLAT_FLAG=2,CLONE_SYMBOLS_FLAG=4;/** Used to compose bitmasks for value comparisons. */var COMPARE_PARTIAL_FLAG=1,COMPARE_UNORDERED_FLAG=2;/** Used to compose bitmasks for function metadata. */var WRAP_BIND_FLAG=1,WRAP_BIND_KEY_FLAG=2,WRAP_CURRY_BOUND_FLAG=4,WRAP_CURRY_FLAG=8,WRAP_CURRY_RIGHT_FLAG=16,WRAP_PARTIAL_FLAG=32,WRAP_PARTIAL_RIGHT_FLAG=64,WRAP_ARY_FLAG=128,WRAP_REARG_FLAG=256,WRAP_FLIP_FLAG=512;/** Used as default options for `_.truncate`. */var DEFAULT_TRUNC_LENGTH=30,DEFAULT_TRUNC_OMISSION='...';/** Used to detect hot functions by number of calls within a span of milliseconds. */var HOT_COUNT=800,HOT_SPAN=16;/** Used to indicate the type of lazy iteratees. */var LAZY_FILTER_FLAG=1,LAZY_MAP_FLAG=2,LAZY_WHILE_FLAG=3;/** Used as references for various `Number` constants. */var INFINITY=1/0,MAX_SAFE_INTEGER=9007199254740991,MAX_INTEGER=1.7976931348623157e+308,NAN=0/0;/** Used as references for the maximum length and index of an array. */var MAX_ARRAY_LENGTH=4294967295,MAX_ARRAY_INDEX=MAX_ARRAY_LENGTH-1,HALF_MAX_ARRAY_LENGTH=MAX_ARRAY_LENGTH>>>1;/** Used to associate wrap methods with their bit flags. */var wrapFlags=[['ary',WRAP_ARY_FLAG],['bind',WRAP_BIND_FLAG],['bindKey',WRAP_BIND_KEY_FLAG],['curry',WRAP_CURRY_FLAG],['curryRight',WRAP_CURRY_RIGHT_FLAG],['flip',WRAP_FLIP_FLAG],['partial',WRAP_PARTIAL_FLAG],['partialRight',WRAP_PARTIAL_RIGHT_FLAG],['rearg',WRAP_REARG_FLAG]];/** `Object#toString` result references. */var argsTag='[object Arguments]',arrayTag='[object Array]',asyncTag='[object AsyncFunction]',boolTag='[object Boolean]',dateTag='[object Date]',domExcTag='[object DOMException]',errorTag='[object Error]',funcTag='[object Function]',genTag='[object GeneratorFunction]',mapTag='[object Map]',numberTag='[object Number]',nullTag='[object Null]',objectTag='[object Object]',promiseTag='[object Promise]',proxyTag='[object Proxy]',regexpTag='[object RegExp]',setTag='[object Set]',stringTag='[object String]',symbolTag='[object Symbol]',undefinedTag='[object Undefined]',weakMapTag='[object WeakMap]',weakSetTag='[object WeakSet]';var arrayBufferTag='[object ArrayBuffer]',dataViewTag='[object DataView]',float32Tag='[object Float32Array]',float64Tag='[object Float64Array]',int8Tag='[object Int8Array]',int16Tag='[object Int16Array]',int32Tag='[object Int32Array]',uint8Tag='[object Uint8Array]',uint8ClampedTag='[object Uint8ClampedArray]',uint16Tag='[object Uint16Array]',uint32Tag='[object Uint32Array]';/** Used to match empty string literals in compiled template source. */var reEmptyStringLeading=/\b__p \+= '';/g,reEmptyStringMiddle=/\b(__p \+=) '' \+/g,reEmptyStringTrailing=/(__e\(.*?\)|\b__t\)) \+\n'';/g;/** Used to match HTML entities and HTML characters. */var reEscapedHtml=/&(?:amp|lt|gt|quot|#39);/g,reUnescapedHtml=/[&<>"']/g,reHasEscapedHtml=RegExp(reEscapedHtml.source),reHasUnescapedHtml=RegExp(reUnescapedHtml.source);/** Used to match template delimiters. */var reEscape=/<%-([\s\S]+?)%>/g,reEvaluate=/<%([\s\S]+?)%>/g,reInterpolate=/<%=([\s\S]+?)%>/g;/** Used to match property names within property paths. */var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;/** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). - */ - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, - reHasRegExpChar = RegExp(reRegExpChar.source); - - /** Used to match leading whitespace. */ - var reTrimStart = /^\s+/; - - /** Used to match a single whitespace character. */ - var reWhitespace = /\s/; - - /** Used to match wrap detail comments. */ - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; - - /** Used to match words composed of alphanumeric characters. */ - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - - /** + */var reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reHasRegExpChar=RegExp(reRegExpChar.source);/** Used to match leading whitespace. */var reTrimStart=/^\s+/;/** Used to match a single whitespace character. */var reWhitespace=/\s/;/** Used to match wrap detail comments. */var reWrapComment=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,reWrapDetails=/\{\n\/\* \[wrapped with (.+)\] \*/,reSplitDetails=/,? & /;/** Used to match words composed of alphanumeric characters. */var reAsciiWord=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;/** * Used to validate the `validate` option in `_.template` variable. * * Forbids characters which could potentially change the meaning of the function argument definition: @@ -908,303 +163,17 @@ var lodash = createCommonjsModule(function (module, exports) { * - "[]{}" (destructuring of function parameters) * - "/" (beginning of a comment) * - whitespace - */ - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; - - /** Used to match backslashes in property paths. */ - var reEscapeChar = /\\(\\)?/g; - - /** + */var reForbiddenIdentifierChars=/[()=,{}\[\]\/\s]/;/** Used to match backslashes in property paths. */var reEscapeChar=/\\(\\)?/g;/** * Used to match * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). - */ - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - - /** Used to match `RegExp` flags from their coerced string values. */ - var reFlags = /\w*$/; - - /** Used to detect bad signed hexadecimal string values. */ - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - - /** Used to detect binary string values. */ - var reIsBinary = /^0b[01]+$/i; - - /** Used to detect host constructors (Safari). */ - var reIsHostCtor = /^\[object .+?Constructor\]$/; - - /** Used to detect octal string values. */ - var reIsOctal = /^0o[0-7]+$/i; - - /** Used to detect unsigned integer values. */ - var reIsUint = /^(?:0|[1-9]\d*)$/; - - /** Used to match Latin Unicode letters (excluding mathematical operators). */ - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - - /** Used to ensure capturing order of template delimiters. */ - var reNoMatch = /($^)/; - - /** Used to match unescaped characters in compiled string literals. */ - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - - /** Used to compose unicode character classes. */ - var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f', - reComboHalfMarksRange = '\\ufe20-\\ufe2f', - rsComboSymbolsRange = '\\u20d0-\\u20ff', - rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, - rsDingbatRange = '\\u2700-\\u27bf', - rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', - rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', - rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', - rsPunctuationRange = '\\u2000-\\u206f', - rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', - rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', - rsVarRange = '\\ufe0e\\ufe0f', - rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - - /** Used to compose unicode capture groups. */ - var rsApos = "['\u2019]", - rsAstral = '[' + rsAstralRange + ']', - rsBreak = '[' + rsBreakRange + ']', - rsCombo = '[' + rsComboRange + ']', - rsDigits = '\\d+', - rsDingbat = '[' + rsDingbatRange + ']', - rsLower = '[' + rsLowerRange + ']', - rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsUpper = '[' + rsUpperRange + ']', - rsZWJ = '\\u200d'; - - /** Used to compose unicode regexes. */ - var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', - rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', - rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', - rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', - reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', - rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - - /** Used to match apostrophes. */ - var reApos = RegExp(rsApos, 'g'); - - /** + */var reEsTemplate=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;/** Used to match `RegExp` flags from their coerced string values. */var reFlags=/\w*$/;/** Used to detect bad signed hexadecimal string values. */var reIsBadHex=/^[-+]0x[0-9a-f]+$/i;/** Used to detect binary string values. */var reIsBinary=/^0b[01]+$/i;/** Used to detect host constructors (Safari). */var reIsHostCtor=/^\[object .+?Constructor\]$/;/** Used to detect octal string values. */var reIsOctal=/^0o[0-7]+$/i;/** Used to detect unsigned integer values. */var reIsUint=/^(?:0|[1-9]\d*)$/;/** Used to match Latin Unicode letters (excluding mathematical operators). */var reLatin=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;/** Used to ensure capturing order of template delimiters. */var reNoMatch=/($^)/;/** Used to match unescaped characters in compiled string literals. */var reUnescapedString=/['\n\r\u2028\u2029\\]/g;/** Used to compose unicode character classes. */var rsAstralRange='\\ud800-\\udfff',rsComboMarksRange='\\u0300-\\u036f',reComboHalfMarksRange='\\ufe20-\\ufe2f',rsComboSymbolsRange='\\u20d0-\\u20ff',rsComboRange=rsComboMarksRange+reComboHalfMarksRange+rsComboSymbolsRange,rsDingbatRange='\\u2700-\\u27bf',rsLowerRange='a-z\\xdf-\\xf6\\xf8-\\xff',rsMathOpRange='\\xac\\xb1\\xd7\\xf7',rsNonCharRange='\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',rsPunctuationRange='\\u2000-\\u206f',rsSpaceRange=' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',rsUpperRange='A-Z\\xc0-\\xd6\\xd8-\\xde',rsVarRange='\\ufe0e\\ufe0f',rsBreakRange=rsMathOpRange+rsNonCharRange+rsPunctuationRange+rsSpaceRange;/** Used to compose unicode capture groups. */var rsApos="['\u2019]",rsAstral='['+rsAstralRange+']',rsBreak='['+rsBreakRange+']',rsCombo='['+rsComboRange+']',rsDigits='\\d+',rsDingbat='['+rsDingbatRange+']',rsLower='['+rsLowerRange+']',rsMisc='[^'+rsAstralRange+rsBreakRange+rsDigits+rsDingbatRange+rsLowerRange+rsUpperRange+']',rsFitz='\\ud83c[\\udffb-\\udfff]',rsModifier='(?:'+rsCombo+'|'+rsFitz+')',rsNonAstral='[^'+rsAstralRange+']',rsRegional='(?:\\ud83c[\\udde6-\\uddff]){2}',rsSurrPair='[\\ud800-\\udbff][\\udc00-\\udfff]',rsUpper='['+rsUpperRange+']',rsZWJ='\\u200d';/** Used to compose unicode regexes. */var rsMiscLower='(?:'+rsLower+'|'+rsMisc+')',rsMiscUpper='(?:'+rsUpper+'|'+rsMisc+')',rsOptContrLower='(?:'+rsApos+'(?:d|ll|m|re|s|t|ve))?',rsOptContrUpper='(?:'+rsApos+'(?:D|LL|M|RE|S|T|VE))?',reOptMod=rsModifier+'?',rsOptVar='['+rsVarRange+']?',rsOptJoin='(?:'+rsZWJ+'(?:'+[rsNonAstral,rsRegional,rsSurrPair].join('|')+')'+rsOptVar+reOptMod+')*',rsOrdLower='\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',rsOrdUpper='\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',rsSeq=rsOptVar+reOptMod+rsOptJoin,rsEmoji='(?:'+[rsDingbat,rsRegional,rsSurrPair].join('|')+')'+rsSeq,rsSymbol='(?:'+[rsNonAstral+rsCombo+'?',rsCombo,rsRegional,rsSurrPair,rsAstral].join('|')+')';/** Used to match apostrophes. */var reApos=RegExp(rsApos,'g');/** * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). - */ - var reComboMark = RegExp(rsCombo, 'g'); - - /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - - /** Used to match complex or compound words. */ - var reUnicodeWord = RegExp([ - rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', - rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', - rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, - rsUpper + '+' + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join('|'), 'g'); - - /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - - /** Used to detect strings that need a more robust regexp to match words. */ - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - - /** Used to assign default `context` object properties. */ - var contextProps = [ - 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', - 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', - 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' - ]; - - /** Used to make template sourceURLs easier to identify. */ - var templateCounter = -1; - - /** Used to identify `toStringTag` values of typed arrays. */ - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = - typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = - typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = - typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = - typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = - typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = - typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = - typedArrayTags[errorTag] = typedArrayTags[funcTag] = - typedArrayTags[mapTag] = typedArrayTags[numberTag] = - typedArrayTags[objectTag] = typedArrayTags[regexpTag] = - typedArrayTags[setTag] = typedArrayTags[stringTag] = - typedArrayTags[weakMapTag] = false; - - /** Used to identify `toStringTag` values supported by `_.clone`. */ - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = - cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = - cloneableTags[boolTag] = cloneableTags[dateTag] = - cloneableTags[float32Tag] = cloneableTags[float64Tag] = - cloneableTags[int8Tag] = cloneableTags[int16Tag] = - cloneableTags[int32Tag] = cloneableTags[mapTag] = - cloneableTags[numberTag] = cloneableTags[objectTag] = - cloneableTags[regexpTag] = cloneableTags[setTag] = - cloneableTags[stringTag] = cloneableTags[symbolTag] = - cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = - cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = - cloneableTags[weakMapTag] = false; - - /** Used to map Latin Unicode letters to basic Latin letters. */ - var deburredLetters = { - // Latin-1 Supplement block. - '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', - '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', - '\xc7': 'C', '\xe7': 'c', - '\xd0': 'D', '\xf0': 'd', - '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', - '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', - '\xd1': 'N', '\xf1': 'n', - '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', - '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', - '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', - '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', - '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', - '\xc6': 'Ae', '\xe6': 'ae', - '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss', - // Latin Extended-A block. - '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', - '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', - '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', - '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', - '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', - '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', - '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', - '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', - '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', - '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', - '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', - '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', - '\u0134': 'J', '\u0135': 'j', - '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', - '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', - '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', - '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', - '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', - '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', - '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', - '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', - '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', - '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', - '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', - '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', - '\u0163': 't', '\u0165': 't', '\u0167': 't', - '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', - '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', - '\u0174': 'W', '\u0175': 'w', - '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', - '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', - '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', - '\u0132': 'IJ', '\u0133': 'ij', - '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 's' - }; - - /** Used to map characters to HTML entities. */ - var htmlEscapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' - }; - - /** Used to map HTML entities to characters. */ - var htmlUnescapes = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - ''': "'" - }; - - /** Used to escape characters for inclusion in compiled string literals. */ - var stringEscapes = { - '\\': '\\', - "'": "'", - '\n': 'n', - '\r': 'r', - '\u2028': 'u2028', - '\u2029': 'u2029' - }; - - /** Built-in method references without a dependency on `root`. */ - var freeParseFloat = parseFloat, - freeParseInt = parseInt; - - /** Detect free variable `global` from Node.js. */ - var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; - - /** Detect free variable `self`. */ - var freeSelf = typeof self == 'object' && self && self.Object === Object && self; - - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || Function('return this')(); - - /** Detect free variable `exports`. */ - var freeExports = exports && !exports.nodeType && exports; - - /** Detect free variable `module`. */ - var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; - - /** Detect the popular CommonJS extension `module.exports`. */ - var moduleExports = freeModule && freeModule.exports === freeExports; - - /** Detect free variable `process` from Node.js. */ - var freeProcess = moduleExports && freeGlobal.process; - - /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { - try { - // Use `util.types` for Node.js 10+. - var types = freeModule && freeModule.require && freeModule.require('util').types; - - if (types) { - return types; - } - - // Legacy `process.binding('util')` for Node.js < 10. - return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} - }()); - - /* Node.js helper references. */ - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, - nodeIsDate = nodeUtil && nodeUtil.isDate, - nodeIsMap = nodeUtil && nodeUtil.isMap, - nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, - nodeIsSet = nodeUtil && nodeUtil.isSet, - nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - - /*--------------------------------------------------------------------------*/ - - /** + */var reComboMark=RegExp(rsCombo,'g');/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */var reUnicode=RegExp(rsFitz+'(?='+rsFitz+')|'+rsSymbol+rsSeq,'g');/** Used to match complex or compound words. */var reUnicodeWord=RegExp([rsUpper+'?'+rsLower+'+'+rsOptContrLower+'(?='+[rsBreak,rsUpper,'$'].join('|')+')',rsMiscUpper+'+'+rsOptContrUpper+'(?='+[rsBreak,rsUpper+rsMiscLower,'$'].join('|')+')',rsUpper+'?'+rsMiscLower+'+'+rsOptContrLower,rsUpper+'+'+rsOptContrUpper,rsOrdUpper,rsOrdLower,rsDigits,rsEmoji].join('|'),'g');/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */var reHasUnicode=RegExp('['+rsZWJ+rsAstralRange+rsComboRange+rsVarRange+']');/** Used to detect strings that need a more robust regexp to match words. */var reHasUnicodeWord=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;/** Used to assign default `context` object properties. */var contextProps=['Array','Buffer','DataView','Date','Error','Float32Array','Float64Array','Function','Int8Array','Int16Array','Int32Array','Map','Math','Object','Promise','RegExp','Set','String','Symbol','TypeError','Uint8Array','Uint8ClampedArray','Uint16Array','Uint32Array','WeakMap','_','clearTimeout','isFinite','parseInt','setTimeout'];/** Used to make template sourceURLs easier to identify. */var templateCounter=-1;/** Used to identify `toStringTag` values of typed arrays. */var typedArrayTags={};typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=true;typedArrayTags[argsTag]=typedArrayTags[arrayTag]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag]=typedArrayTags[numberTag]=typedArrayTags[objectTag]=typedArrayTags[regexpTag]=typedArrayTags[setTag]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag]=false;/** Used to identify `toStringTag` values supported by `_.clone`. */var cloneableTags={};cloneableTags[argsTag]=cloneableTags[arrayTag]=cloneableTags[arrayBufferTag]=cloneableTags[dataViewTag]=cloneableTags[boolTag]=cloneableTags[dateTag]=cloneableTags[float32Tag]=cloneableTags[float64Tag]=cloneableTags[int8Tag]=cloneableTags[int16Tag]=cloneableTags[int32Tag]=cloneableTags[mapTag]=cloneableTags[numberTag]=cloneableTags[objectTag]=cloneableTags[regexpTag]=cloneableTags[setTag]=cloneableTags[stringTag]=cloneableTags[symbolTag]=cloneableTags[uint8Tag]=cloneableTags[uint8ClampedTag]=cloneableTags[uint16Tag]=cloneableTags[uint32Tag]=true;cloneableTags[errorTag]=cloneableTags[funcTag]=cloneableTags[weakMapTag]=false;/** Used to map Latin Unicode letters to basic Latin letters. */var deburredLetters={// Latin-1 Supplement block. +'\xc0':'A','\xc1':'A','\xc2':'A','\xc3':'A','\xc4':'A','\xc5':'A','\xe0':'a','\xe1':'a','\xe2':'a','\xe3':'a','\xe4':'a','\xe5':'a','\xc7':'C','\xe7':'c','\xd0':'D','\xf0':'d','\xc8':'E','\xc9':'E','\xca':'E','\xcb':'E','\xe8':'e','\xe9':'e','\xea':'e','\xeb':'e','\xcc':'I','\xcd':'I','\xce':'I','\xcf':'I','\xec':'i','\xed':'i','\xee':'i','\xef':'i','\xd1':'N','\xf1':'n','\xd2':'O','\xd3':'O','\xd4':'O','\xd5':'O','\xd6':'O','\xd8':'O','\xf2':'o','\xf3':'o','\xf4':'o','\xf5':'o','\xf6':'o','\xf8':'o','\xd9':'U','\xda':'U','\xdb':'U','\xdc':'U','\xf9':'u','\xfa':'u','\xfb':'u','\xfc':'u','\xdd':'Y','\xfd':'y','\xff':'y','\xc6':'Ae','\xe6':'ae','\xde':'Th','\xfe':'th','\xdf':'ss',// Latin Extended-A block. +'\u0100':'A','\u0102':'A','\u0104':'A','\u0101':'a','\u0103':'a','\u0105':'a','\u0106':'C','\u0108':'C','\u010a':'C','\u010c':'C','\u0107':'c','\u0109':'c','\u010b':'c','\u010d':'c','\u010e':'D','\u0110':'D','\u010f':'d','\u0111':'d','\u0112':'E','\u0114':'E','\u0116':'E','\u0118':'E','\u011a':'E','\u0113':'e','\u0115':'e','\u0117':'e','\u0119':'e','\u011b':'e','\u011c':'G','\u011e':'G','\u0120':'G','\u0122':'G','\u011d':'g','\u011f':'g','\u0121':'g','\u0123':'g','\u0124':'H','\u0126':'H','\u0125':'h','\u0127':'h','\u0128':'I','\u012a':'I','\u012c':'I','\u012e':'I','\u0130':'I','\u0129':'i','\u012b':'i','\u012d':'i','\u012f':'i','\u0131':'i','\u0134':'J','\u0135':'j','\u0136':'K','\u0137':'k','\u0138':'k','\u0139':'L','\u013b':'L','\u013d':'L','\u013f':'L','\u0141':'L','\u013a':'l','\u013c':'l','\u013e':'l','\u0140':'l','\u0142':'l','\u0143':'N','\u0145':'N','\u0147':'N','\u014a':'N','\u0144':'n','\u0146':'n','\u0148':'n','\u014b':'n','\u014c':'O','\u014e':'O','\u0150':'O','\u014d':'o','\u014f':'o','\u0151':'o','\u0154':'R','\u0156':'R','\u0158':'R','\u0155':'r','\u0157':'r','\u0159':'r','\u015a':'S','\u015c':'S','\u015e':'S','\u0160':'S','\u015b':'s','\u015d':'s','\u015f':'s','\u0161':'s','\u0162':'T','\u0164':'T','\u0166':'T','\u0163':'t','\u0165':'t','\u0167':'t','\u0168':'U','\u016a':'U','\u016c':'U','\u016e':'U','\u0170':'U','\u0172':'U','\u0169':'u','\u016b':'u','\u016d':'u','\u016f':'u','\u0171':'u','\u0173':'u','\u0174':'W','\u0175':'w','\u0176':'Y','\u0177':'y','\u0178':'Y','\u0179':'Z','\u017b':'Z','\u017d':'Z','\u017a':'z','\u017c':'z','\u017e':'z','\u0132':'IJ','\u0133':'ij','\u0152':'Oe','\u0153':'oe','\u0149':"'n",'\u017f':'s'};/** Used to map characters to HTML entities. */var htmlEscapes={'&':'&','<':'<','>':'>','"':'"',"'":'''};/** Used to map HTML entities to characters. */var htmlUnescapes={'&':'&','<':'<','>':'>','"':'"',''':"'"};/** Used to escape characters for inclusion in compiled string literals. */var stringEscapes={'\\':'\\',"'":"'",'\n':'n','\r':'r','\u2028':'u2028','\u2029':'u2029'};/** Built-in method references without a dependency on `root`. */var freeParseFloat=parseFloat,freeParseInt=parseInt;/** Detect free variable `global` from Node.js. */var freeGlobal=typeof commonjsGlobal=='object'&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal;/** Detect free variable `self`. */var freeSelf=typeof self=='object'&&self&&self.Object===Object&&self;/** Used as a reference to the global object. */var root=freeGlobal||freeSelf||Function('return this')();/** Detect free variable `exports`. */var freeExports=exports&&!exports.nodeType&&exports;/** Detect free variable `module`. */var freeModule=freeExports&&'object'=='object'&&module&&!module.nodeType&&module;/** Detect the popular CommonJS extension `module.exports`. */var moduleExports=freeModule&&freeModule.exports===freeExports;/** Detect free variable `process` from Node.js. */var freeProcess=moduleExports&&freeGlobal.process;/** Used to access faster Node.js helpers. */var nodeUtil=function(){try{// Use `util.types` for Node.js 10+. +var types=freeModule&&freeModule.require&&freeModule.require('util').types;if(types){return types;}// Legacy `process.binding('util')` for Node.js < 10. +return freeProcess&&freeProcess.binding&&freeProcess.binding('util');}catch(e){}}();/* Node.js helper references. */var nodeIsArrayBuffer=nodeUtil&&nodeUtil.isArrayBuffer,nodeIsDate=nodeUtil&&nodeUtil.isDate,nodeIsMap=nodeUtil&&nodeUtil.isMap,nodeIsRegExp=nodeUtil&&nodeUtil.isRegExp,nodeIsSet=nodeUtil&&nodeUtil.isSet,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray;/*--------------------------------------------------------------------------*/ /** * A faster alternative to `Function#apply`, this function invokes `func` * with the `this` binding of `thisArg` and the arguments of `args`. * @@ -1213,18 +182,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {*} thisArg The `this` binding of `func`. * @param {Array} args The arguments to invoke `func` with. * @returns {*} Returns the result of `func`. - */ - function apply(func, thisArg, args) { - switch (args.length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); - } - - /** + */function apply(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2]);}return func.apply(thisArg,args);}/** * A specialized version of `baseAggregator` for arrays. * * @private @@ -1233,19 +191,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Function} iteratee The iteratee to transform keys. * @param {Object} accumulator The initial aggregated object. * @returns {Function} Returns `accumulator`. - */ - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); - } - return accumulator; - } - - /** + */function arrayAggregator(array,setter,iteratee,accumulator){var index=-1,length=array==null?0:array.length;while(++index -1; - } - - /** + */function arrayIncludes(array,value){var length=array==null?0:array.length;return !!length&&baseIndexOf(array,value,0)>-1;}/** * This function is like `arrayIncludes` except that it accepts a comparator. * * @private @@ -1354,20 +240,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ - function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array == null ? 0 : array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; - } - - /** + */function arrayIncludesWith(array,value,comparator){var index=-1,length=array==null?0:array.length;while(++index -1) {} - return index; - } - - /** + */function charsStartIndex(strSymbols,chrSymbols){var index=-1,length=strSymbols.length;while(++index-1){}return index;}/** * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol * that is not found in the character symbols. * @@ -1818,147 +456,71 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Array} strSymbols The string symbols to inspect. * @param {Array} chrSymbols The character symbols to find. * @returns {number} Returns the index of the last unmatched string symbol. - */ - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} - return index; - } - - /** + */function charsEndIndex(strSymbols,chrSymbols){var index=strSymbols.length;while(index--&&baseIndexOf(chrSymbols,strSymbols[index],0)>-1){}return index;}/** * Gets the number of `placeholder` occurrences in `array`. * * @private * @param {Array} array The array to inspect. * @param {*} placeholder The placeholder to search for. * @returns {number} Returns the placeholder count. - */ - function countHolders(array, placeholder) { - var length = array.length, - result = 0; - - while (length--) { - if (array[length] === placeholder) { - ++result; - } - } - return result; - } - - /** + */function countHolders(array,placeholder){var length=array.length,result=0;while(length--){if(array[length]===placeholder){++result;}}return result;}/** * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. - */ - var deburrLetter = basePropertyOf(deburredLetters); - - /** + */var deburrLetter=basePropertyOf(deburredLetters);/** * Used by `_.escape` to convert characters to HTML entities. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. - */ - var escapeHtmlChar = basePropertyOf(htmlEscapes); - - /** + */var escapeHtmlChar=basePropertyOf(htmlEscapes);/** * Used by `_.template` to escape characters for inclusion in compiled string literals. * * @private * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. - */ - function escapeStringChar(chr) { - return '\\' + stringEscapes[chr]; - } - - /** + */function escapeStringChar(chr){return '\\'+stringEscapes[chr];}/** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. - */ - function getValue(object, key) { - return object == null ? undefined$1 : object[key]; - } - - /** + */function getValue(object,key){return object==null?undefined$1:object[key];}/** * Checks if `string` contains Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a symbol is found, else `false`. - */ - function hasUnicode(string) { - return reHasUnicode.test(string); - } - - /** + */function hasUnicode(string){return reHasUnicode.test(string);}/** * Checks if `string` contains a word composed of Unicode symbols. * * @private * @param {string} string The string to inspect. * @returns {boolean} Returns `true` if a word is found, else `false`. - */ - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - - /** + */function hasUnicodeWord(string){return reHasUnicodeWord.test(string);}/** * Converts `iterator` to an array. * * @private * @param {Object} iterator The iterator to convert. * @returns {Array} Returns the converted array. - */ - function iteratorToArray(iterator) { - var data, - result = []; - - while (!(data = iterator.next()).done) { - result.push(data.value); - } - return result; - } - - /** + */function iteratorToArray(iterator){var data,result=[];while(!(data=iterator.next()).done){result.push(data.value);}return result;}/** * Converts `map` to its key-value pairs. * * @private * @param {Object} map The map to convert. * @returns {Array} Returns the key-value pairs. - */ - function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - - /** + */function mapToArray(map){var index=-1,result=Array(map.size);map.forEach(function(value,key){result[++index]=[key,value];});return result;}/** * Creates a unary function that invokes `func` with its argument transformed. * * @private * @param {Function} func The function to wrap. * @param {Function} transform The argument transform. * @returns {Function} Returns the new function. - */ - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - - /** + */function overArg(func,transform){return function(arg){return func(transform(arg));};}/** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. * @@ -1966,58 +528,19 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Array} array The array to modify. * @param {*} placeholder The placeholder to replace. * @returns {Array} Returns the new array of placeholder indexes. - */ - function replaceHolders(array, placeholder) { - var index = -1, - length = array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; - } - } - return result; - } - - /** + */function replaceHolders(array,placeholder){var index=-1,length=array.length,resIndex=0,result=[];while(++index true - */ - function lodash(value) { - if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty.call(value, '__wrapped__')) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); - } - - /** + */function lodash(value){if(isObjectLike(value)&&!isArray(value)&&!(value instanceof LazyWrapper)){if(value instanceof LodashWrapper){return value;}if(hasOwnProperty.call(value,'__wrapped__')){return wrapperClone(value);}}return new LodashWrapper(value);}/** * The base implementation of `_.create` without support for assigning * properties to the created object. * * @private * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. - */ - var baseCreate = (function() { - function object() {} - return function(proto) { - if (!isObject(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result = new object; - object.prototype = undefined$1; - return result; - }; - }()); - - /** + */var baseCreate=function(){function object(){}return function(proto){if(!isObject(proto)){return {};}if(objectCreate){return objectCreate(proto);}object.prototype=proto;var result=new object();object.prototype=undefined$1;return result;};}();/** * The function whose prototype chain sequence wrappers inherit from. * * @private - */ - function baseLodash() { - // No operation performed. - } - - /** + */function baseLodash(){// No operation performed. +}/** * The base constructor for creating `lodash` wrapper objects. * * @private * @param {*} value The value to wrap. * @param {boolean} [chainAll] Enable explicit method chain sequences. - */ - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined$1; - } - - /** + */function LodashWrapper(value,chainAll){this.__wrapped__=value;this.__actions__=[];this.__chain__=!!chainAll;this.__index__=0;this.__values__=undefined$1;}/** * By default, the template delimiters used by lodash are like those in * embedded Ruby (ERB) as well as ES2015 template strings. Change the * following template settings to use alternative delimiters. @@ -2487,218 +775,78 @@ var lodash = createCommonjsModule(function (module, exports) { * @static * @memberOf _ * @type {Object} - */ - lodash.templateSettings = { - - /** + */lodash.templateSettings={/** * Used to detect `data` property values to be HTML-escaped. * * @memberOf _.templateSettings * @type {RegExp} - */ - 'escape': reEscape, - - /** + */'escape':reEscape,/** * Used to detect code to be evaluated. * * @memberOf _.templateSettings * @type {RegExp} - */ - 'evaluate': reEvaluate, - - /** + */'evaluate':reEvaluate,/** * Used to detect `data` property values to inject. * * @memberOf _.templateSettings * @type {RegExp} - */ - 'interpolate': reInterpolate, - - /** + */'interpolate':reInterpolate,/** * Used to reference the data object in the template text. * * @memberOf _.templateSettings * @type {string} - */ - 'variable': '', - - /** + */'variable':'',/** * Used to import variables into the compiled template. * * @memberOf _.templateSettings * @type {Object} - */ - 'imports': { - - /** + */'imports':{/** * A reference to the `lodash` function. * * @memberOf _.templateSettings.imports * @type {Function} - */ - '_': lodash - } - }; - - // Ensure wrappers are instances of `baseLodash`. - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; - - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - - /*------------------------------------------------------------------------*/ - - /** + */'_':lodash}};// Ensure wrappers are instances of `baseLodash`. +lodash.prototype=baseLodash.prototype;lodash.prototype.constructor=lodash;LodashWrapper.prototype=baseCreate(baseLodash.prototype);LodashWrapper.prototype.constructor=LodashWrapper;/*------------------------------------------------------------------------*/ /** * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. * * @private * @constructor * @param {*} value The value to wrap. - */ - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } - - /** + */function LazyWrapper(value){this.__wrapped__=value;this.__actions__=[];this.__dir__=1;this.__filtered__=false;this.__iteratees__=[];this.__takeCount__=MAX_ARRAY_LENGTH;this.__views__=[];}/** * Creates a clone of the lazy wrapper object. * * @private * @name clone * @memberOf LazyWrapper * @returns {Object} Returns the cloned `LazyWrapper` object. - */ - function lazyClone() { - var result = new LazyWrapper(this.__wrapped__); - result.__actions__ = copyArray(this.__actions__); - result.__dir__ = this.__dir__; - result.__filtered__ = this.__filtered__; - result.__iteratees__ = copyArray(this.__iteratees__); - result.__takeCount__ = this.__takeCount__; - result.__views__ = copyArray(this.__views__); - return result; - } - - /** + */function lazyClone(){var result=new LazyWrapper(this.__wrapped__);result.__actions__=copyArray(this.__actions__);result.__dir__=this.__dir__;result.__filtered__=this.__filtered__;result.__iteratees__=copyArray(this.__iteratees__);result.__takeCount__=this.__takeCount__;result.__views__=copyArray(this.__views__);return result;}/** * Reverses the direction of lazy iteration. * * @private * @name reverse * @memberOf LazyWrapper * @returns {Object} Returns the new reversed `LazyWrapper` object. - */ - function lazyReverse() { - if (this.__filtered__) { - var result = new LazyWrapper(this); - result.__dir__ = -1; - result.__filtered__ = true; - } else { - result = this.clone(); - result.__dir__ *= -1; - } - return result; - } - - /** + */function lazyReverse(){if(this.__filtered__){var result=new LazyWrapper(this);result.__dir__=-1;result.__filtered__=true;}else {result=this.clone();result.__dir__*=-1;}return result;}/** * Extracts the unwrapped value from its lazy wrapper. * * @private * @name value * @memberOf LazyWrapper * @returns {*} Returns the unwrapped value. - */ - function lazyValue() { - var array = this.__wrapped__.value(), - dir = this.__dir__, - isArr = isArray(array), - isRight = dir < 0, - arrLength = isArr ? array.length : 0, - view = getView(0, arrLength, this.__views__), - start = view.start, - end = view.end, - length = end - start, - index = isRight ? end : (start - 1), - iteratees = this.__iteratees__, - iterLength = iteratees.length, - resIndex = 0, - takeCount = nativeMin(length, this.__takeCount__); - - if (!isArr || (!isRight && arrLength == length && takeCount == length)) { - return baseWrapperValue(array, this.__actions__); - } - var result = []; - - outer: - while (length-- && resIndex < takeCount) { - index += dir; - - var iterIndex = -1, - value = array[index]; - - while (++iterIndex < iterLength) { - var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); - - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result[resIndex++] = value; - } - return result; - } - - // Ensure `LazyWrapper` is an instance of `baseLodash`. - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; - - /*------------------------------------------------------------------------*/ - - /** + */function lazyValue(){var array=this.__wrapped__.value(),dir=this.__dir__,isArr=isArray(array),isRight=dir<0,arrLength=isArr?array.length:0,view=getView(0,arrLength,this.__views__),start=view.start,end=view.end,length=end-start,index=isRight?end:start-1,iteratees=this.__iteratees__,iterLength=iteratees.length,resIndex=0,takeCount=nativeMin(length,this.__takeCount__);if(!isArr||!isRight&&arrLength==length&&takeCount==length){return baseWrapperValue(array,this.__actions__);}var result=[];outer:while(length--&&resIndex -1; - } - - /** + */function listCacheHas(key){return assocIndexOf(this.__data__,key)>-1;}/** * Sets the list cache `key` to `value`. * * @private @@ -2866,64 +926,20 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. - */ - function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - ++this.size; - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; - } - - // Add methods to `ListCache`. - ListCache.prototype.clear = listCacheClear; - ListCache.prototype['delete'] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - - /*------------------------------------------------------------------------*/ - - /** + */function listCacheSet(key,value){var data=this.__data__,index=assocIndexOf(data,key);if(index<0){++this.size;data.push([key,value]);}else {data[index][1]=value;}return this;}// Add methods to `ListCache`. +ListCache.prototype.clear=listCacheClear;ListCache.prototype['delete']=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;/*------------------------------------------------------------------------*/ /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. - */ - function MapCache(entries) { - var index = -1, - length = entries == null ? 0 : entries.length; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - - /** + */function MapCache(entries){var index=-1,length=entries==null?0:entries.length;this.clear();while(++index= lower ? number : lower; - } - } - return number; - } - - /** + */function baseClamp(number,lower,upper){if(number===number){if(upper!==undefined$1){number=number<=upper?number:upper;}if(lower!==undefined$1){number=number>=lower?number:lower;}}return number;}/** * The base implementation of `_.clone` and `_.cloneDeep` which tracks * traversed objects. * @@ -3390,124 +1162,22 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Object} [object] The parent object of `value`. * @param {Object} [stack] Tracks traversed objects and their clone counterparts. * @returns {*} Returns the cloned value. - */ - function baseClone(value, bitmask, customizer, key, object, stack) { - var result, - isDeep = bitmask & CLONE_DEEP_FLAG, - isFlat = bitmask & CLONE_FLAT_FLAG, - isFull = bitmask & CLONE_SYMBOLS_FLAG; - - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined$1) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - result = (isFlat || isFunc) ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat - ? copySymbolsIn(value, baseAssignIn(result, value)) - : copySymbols(value, baseAssign(result, value)); - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - if (isSet(value)) { - value.forEach(function(subValue) { - result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); - }); - } else if (isMap(value)) { - value.forEach(function(subValue, key) { - result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - } - - var keysFunc = isFull - ? (isFlat ? getAllKeysIn : getAllKeys) - : (isFlat ? keysIn : keys); - - var props = isArr ? undefined$1 : keysFunc(value); - arrayEach(props || value, function(subValue, key) { - if (props) { - key = subValue; - subValue = value[key]; - } - // Recursively populate clone (susceptible to call stack limits). - assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); - }); - return result; - } - - /** + */function baseClone(value,bitmask,customizer,key,object,stack){var result,isDeep=bitmask&CLONE_DEEP_FLAG,isFlat=bitmask&CLONE_FLAT_FLAG,isFull=bitmask&CLONE_SYMBOLS_FLAG;if(customizer){result=object?customizer(value,key,object,stack):customizer(value);}if(result!==undefined$1){return result;}if(!isObject(value)){return value;}var isArr=isArray(value);if(isArr){result=initCloneArray(value);if(!isDeep){return copyArray(value,result);}}else {var tag=getTag(value),isFunc=tag==funcTag||tag==genTag;if(isBuffer(value)){return cloneBuffer(value,isDeep);}if(tag==objectTag||tag==argsTag||isFunc&&!object){result=isFlat||isFunc?{}:initCloneObject(value);if(!isDeep){return isFlat?copySymbolsIn(value,baseAssignIn(result,value)):copySymbols(value,baseAssign(result,value));}}else {if(!cloneableTags[tag]){return object?value:{};}result=initCloneByTag(value,tag,isDeep);}}// Check for circular references and return its corresponding clone. +stack||(stack=new Stack());var stacked=stack.get(value);if(stacked){return stacked;}stack.set(value,result);if(isSet(value)){value.forEach(function(subValue){result.add(baseClone(subValue,bitmask,customizer,subValue,value,stack));});}else if(isMap(value)){value.forEach(function(subValue,key){result.set(key,baseClone(subValue,bitmask,customizer,key,value,stack));});}var keysFunc=isFull?isFlat?getAllKeysIn:getAllKeys:isFlat?keysIn:keys;var props=isArr?undefined$1:keysFunc(value);arrayEach(props||value,function(subValue,key){if(props){key=subValue;subValue=value[key];}// Recursively populate clone (susceptible to call stack limits). +assignValue(result,key,baseClone(subValue,bitmask,customizer,key,value,stack));});return result;}/** * The base implementation of `_.conforms` which doesn't clone `source`. * * @private * @param {Object} source The object of property predicates to conform to. * @returns {Function} Returns the new spec function. - */ - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } - - /** + */function baseConforms(source){var props=keys(source);return function(object){return baseConformsTo(object,source,props);};}/** * The base implementation of `_.conformsTo` which accepts `props` to check. * * @private * @param {Object} object The object to inspect. * @param {Object} source The object of property predicates to conform to. * @returns {boolean} Returns `true` if `object` conforms, else `false`. - */ - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; - } - object = Object(object); - while (length--) { - var key = props[length], - predicate = source[key], - value = object[key]; - - if ((value === undefined$1 && !(key in object)) || !predicate(value)) { - return false; - } - } - return true; - } - - /** + */function baseConformsTo(object,source,props){var length=props.length;if(object==null){return !length;}object=Object(object);while(length--){var key=props[length],predicate=source[key],value=object[key];if(value===undefined$1&&!(key in object)||!predicate(value)){return false;}}return true;}/** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. * @@ -3516,15 +1186,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {number} wait The number of milliseconds to delay invocation. * @param {Array} args The arguments to provide to `func`. * @returns {number|Object} Returns the timer id or timeout object. - */ - function baseDelay(func, wait, args) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return setTimeout(function() { func.apply(undefined$1, args); }, wait); - } - - /** + */function baseDelay(func,wait,args){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return setTimeout(function(){func.apply(undefined$1,args);},wait);}/** * The base implementation of methods like `_.difference` without support * for excluding multiple arrays or iteratee shorthands. * @@ -3534,73 +1196,21 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Function} [iteratee] The iteratee invoked per element. * @param {Function} [comparator] The comparator invoked per element. * @returns {Array} Returns the new array of filtered values. - */ - function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee == null ? value : iteratee(value); - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; - } - - /** + */function baseDifference(array,values,iteratee,comparator){var index=-1,includes=arrayIncludes,isCommon=true,length=array.length,result=[],valuesLength=values.length;if(!length){return result;}if(iteratee){values=arrayMap(values,baseUnary(iteratee));}if(comparator){includes=arrayIncludesWith;isCommon=false;}else if(values.length>=LARGE_ARRAY_SIZE){includes=cacheHas;isCommon=false;values=new SetCache(values);}outer:while(++index length ? 0 : (length + start); - } - end = (end === undefined$1 || end > length) ? length : toInteger(end); - if (end < 0) { - end += length; - } - end = start > end ? 0 : toLength(end); - while (start < end) { - array[start++] = value; - } - return array; - } - - /** + */function baseFill(array,value,start,end){var length=array.length;start=toInteger(start);if(start<0){start=-start>length?0:length+start;}end=end===undefined$1||end>length?length:toInteger(end);if(end<0){end+=length;}end=start>end?0:toLength(end);while(start 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; - } - - /** + */function baseFlatten(array,depth,predicate,isStrict,result){var index=-1,length=array.length;predicate||(predicate=isFlattenable);result||(result=[]);while(++index0&&predicate(value)){if(depth>1){// Recursively flatten arrays (susceptible to call stack limits). +baseFlatten(value,depth-1,predicate,isStrict,result);}else {arrayPush(result,value);}}else if(!isStrict){result[result.length]=value;}}return result;}/** * The base implementation of `baseForOwn` which iterates over `object` * properties returned by `keysFunc` and invokes `iteratee` for each property. * Iteratee functions may exit iteration early by explicitly returning `false`. @@ -3737,10 +1264,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. - */ - var baseFor = createBaseFor(); - - /** + */var baseFor=createBaseFor();/** * This function is like `baseFor` except that it iterates over properties * in the opposite order. * @@ -3749,34 +1273,21 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Function} iteratee The function invoked per iteration. * @param {Function} keysFunc The function to get the keys of `object`. * @returns {Object} Returns `object`. - */ - var baseForRight = createBaseFor(true); - - /** + */var baseForRight=createBaseFor(true);/** * The base implementation of `_.forOwn` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. - */ - function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); - } - - /** + */function baseForOwn(object,iteratee){return object&&baseFor(object,iteratee,keys);}/** * The base implementation of `_.forOwnRight` without support for iteratee shorthands. * * @private * @param {Object} object The object to iterate over. * @param {Function} iteratee The function invoked per iteration. * @returns {Object} Returns `object`. - */ - function baseForOwnRight(object, iteratee) { - return object && baseForRight(object, iteratee, keys); - } - - /** + */function baseForOwnRight(object,iteratee){return object&&baseForRight(object,iteratee,keys);}/** * The base implementation of `_.functions` which creates an array of * `object` function property names filtered from `props`. * @@ -3784,34 +1295,14 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Object} object The object to inspect. * @param {Array} props The property names to filter. * @returns {Array} Returns the function names. - */ - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } - - /** + */function baseFunctions(object,props){return arrayFilter(props,function(key){return isFunction(object[key]);});}/** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. - */ - function baseGet(object, path) { - path = castPath(path, object); - - var index = 0, - length = path.length; - - while (object != null && index < length) { - object = object[toKey(path[index++])]; - } - return (index && index == length) ? object : undefined$1; - } - - /** + */function baseGet(object,path){path=castPath(path,object);var index=0,length=path.length;while(object!=null&&index other; - } - - /** + */function baseGt(value,other){return value>other;}/** * The base implementation of `_.has` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHas(object, key) { - return object != null && hasOwnProperty.call(object, key); - } - - /** + */function baseHas(object,key){return object!=null&&hasOwnProperty.call(object,key);}/** * The base implementation of `_.hasIn` without support for deep paths. * * @private * @param {Object} [object] The object to query. * @param {Array|string} key The key to check. * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ - function baseHasIn(object, key) { - return object != null && key in Object(object); - } - - /** + */function baseHasIn(object,key){return object!=null&&key in Object(object);}/** * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private @@ -3888,12 +1348,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {number} start The start of the range. * @param {number} end The end of the range. * @returns {boolean} Returns `true` if `number` is in the range, else `false`. - */ - function baseInRange(number, start, end) { - return number >= nativeMin(start, end) && number < nativeMax(start, end); - } - - /** + */function baseInRange(number,start,end){return number>=nativeMin(start,end)&&number= 120 && array.length >= 120)) - ? new SetCache(othIndex && array) - : undefined$1; - } - array = arrays[0]; - - var index = -1, - seen = caches[0]; - - outer: - while (++index < length && result.length < maxLength) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache - ? cacheHas(cache, computed) - : includes(arrays[othIndex], computed, comparator)) - ) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** + */function baseIntersection(arrays,iteratee,comparator){var includes=comparator?arrayIncludesWith:arrayIncludes,length=arrays[0].length,othLength=arrays.length,othIndex=othLength,caches=Array(othLength),maxLength=Infinity,result=[];while(othIndex--){var array=arrays[othIndex];if(othIndex&&iteratee){array=arrayMap(array,baseUnary(iteratee));}maxLength=nativeMin(array.length,maxLength);caches[othIndex]=!comparator&&(iteratee||length>=120&&array.length>=120)?new SetCache(othIndex&&array):undefined$1;}array=arrays[0];var index=-1,seen=caches[0];outer:while(++index -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } - - /** + */function basePullAll(array,values,iteratee,comparator){var indexOf=comparator?baseIndexOfWith:baseIndexOf,index=-1,length=values.length,seen=array;if(array===values){values=copyArray(values);}if(iteratee){seen=arrayMap(array,baseUnary(iteratee));}while(++index-1){if(seen!==array){splice.call(seen,fromIndex,1);}splice.call(array,fromIndex,1);}}return array;}/** * The base implementation of `_.pullAt` without support for individual * indexes or capturing the removed elements. * @@ -4620,26 +1588,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Array} array The array to modify. * @param {number[]} indexes The indexes of elements to remove. * @returns {Array} Returns `array`. - */ - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, - lastIndex = length - 1; - - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } - - /** + */function basePullAt(array,indexes){var length=array?indexes.length:0,lastIndex=length-1;while(length--){var index=indexes[length];if(length==lastIndex||index!==previous){var previous=index;if(isIndex(index)){splice.call(array,index,1);}else {baseUnset(array,index);}}}return array;}/** * The base implementation of `_.random` without support for returning * floating-point numbers. * @@ -4647,12 +1596,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {number} lower The lower bound. * @param {number} upper The upper bound. * @returns {number} Returns the random number. - */ - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } - - /** + */function baseRandom(lower,upper){return lower+nativeFloor(nativeRandom()*(upper-lower+1));}/** * The base implementation of `_.range` and `_.rangeRight` which doesn't * coerce arguments. * @@ -4662,84 +1606,36 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {number} step The value to increment or decrement by. * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Array} Returns the range of numbers. - */ - function baseRange(start, end, step, fromRight) { - var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); - - while (length--) { - result[fromRight ? length : ++index] = start; - start += step; - } - return result; - } - - /** + */function baseRange(start,end,step,fromRight){var index=-1,length=nativeMax(nativeCeil((end-start)/(step||1)),0),result=Array(length);while(length--){result[fromRight?length:++index]=start;start+=step;}return result;}/** * The base implementation of `_.repeat` which doesn't coerce arguments. * * @private * @param {string} string The string to repeat. * @param {number} n The number of times to repeat the string. * @returns {string} Returns the repeated string. - */ - function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; - } - - /** + */function baseRepeat(string,n){var result='';if(!string||n<1||n>MAX_SAFE_INTEGER){return result;}// Leverage the exponentiation by squaring algorithm for a faster repeat. +// See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. +do{if(n%2){result+=string;}n=nativeFloor(n/2);if(n){string+=string;}}while(n);return result;}/** * The base implementation of `_.rest` which doesn't validate or coerce arguments. * * @private * @param {Function} func The function to apply a rest parameter to. * @param {number} [start=func.length-1] The start position of the rest parameter. * @returns {Function} Returns the new function. - */ - function baseRest(func, start) { - return setToString(overRest(func, start, identity), func + ''); - } - - /** + */function baseRest(func,start){return setToString(overRest(func,start,identity),func+'');}/** * The base implementation of `_.sample`. * * @private * @param {Array|Object} collection The collection to sample. * @returns {*} Returns the random element. - */ - function baseSample(collection) { - return arraySample(values(collection)); - } - - /** + */function baseSample(collection){return arraySample(values(collection));}/** * The base implementation of `_.sampleSize` without param guards. * * @private * @param {Array|Object} collection The collection to sample. * @param {number} n The number of elements to sample. * @returns {Array} Returns the random elements. - */ - function baseSampleSize(collection, n) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n, 0, array.length)); - } - - /** + */function baseSampleSize(collection,n){var array=values(collection);return shuffleSelf(array,baseClamp(n,0,array.length));}/** * The base implementation of `_.set`. * * @private @@ -4748,83 +1644,27 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. - */ - function baseSet(object, path, value, customizer) { - if (!isObject(object)) { - return object; - } - path = castPath(path, object); - - var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; - - while (nested != null && ++index < length) { - var key = toKey(path[index]), - newValue = value; - - if (key === '__proto__' || key === 'constructor' || key === 'prototype') { - return object; - } - - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined$1; - if (newValue === undefined$1) { - newValue = isObject(objValue) - ? objValue - : (isIndex(path[index + 1]) ? [] : {}); - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; - } - - /** + */function baseSet(object,path,value,customizer){if(!isObject(object)){return object;}path=castPath(path,object);var index=-1,length=path.length,lastIndex=length-1,nested=object;while(nested!=null&&++index length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; - } - - /** + */function baseSlice(array,start,end){var index=-1,length=array.length;if(start<0){start=-start>length?0:length+start;}end=end>length?length:end;if(end<0){end+=length;}length=start>end?0:end-start>>>0;start>>>=0;var result=Array(length);while(++index>> 1, - computed = array[mid]; - - if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } - - /** + */function baseSortedIndex(array,value,retHighest){var low=0,high=array==null?low:array.length;if(typeof value=='number'&&value===value&&high<=HALF_MAX_ARRAY_LENGTH){while(low>>1,computed=array[mid];if(computed!==null&&!isSymbol(computed)&&(retHighest?computed<=value:computed= LARGE_ARRAY_SIZE) { - var set = iteratee ? null : createSet(array); - if (set) { - return setToArray(set); - } - isCommon = false; - includes = cacheHas; - seen = new SetCache; - } - else { - seen = iteratee ? [] : result; - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee) { - seen.push(computed); - } - result.push(value); - } - else if (!includes(seen, computed, comparator)) { - if (seen !== result) { - seen.push(computed); - } - result.push(value); - } - } - return result; - } - - /** + */function baseUniq(array,iteratee,comparator){var index=-1,includes=arrayIncludes,length=array.length,isCommon=true,result=[],seen=result;if(comparator){isCommon=false;includes=arrayIncludesWith;}else if(length>=LARGE_ARRAY_SIZE){var set=iteratee?null:createSet(array);if(set){return setToArray(set);}isCommon=false;includes=cacheHas;seen=new SetCache();}else {seen=iteratee?[]:result;}outer:while(++index= length) ? array : baseSlice(array, start, end); - } - - /** + */function castSlice(array,start,end){var length=array.length;end=end===undefined$1?length:end;return !start&&end>=length?array:baseSlice(array,start,end);}/** * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). * * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. - */ - var clearTimeout = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; - - /** + */var clearTimeout=ctxClearTimeout||function(id){return root.clearTimeout(id);};/** * Creates a clone of `buffer`. * * @private * @param {Buffer} buffer The buffer to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Buffer} Returns the cloned buffer. - */ - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - - buffer.copy(result); - return result; - } - - /** + */function cloneBuffer(buffer,isDeep){if(isDeep){return buffer.slice();}var length=buffer.length,result=allocUnsafe?allocUnsafe(length):new buffer.constructor(length);buffer.copy(result);return result;}/** * Creates a clone of `arrayBuffer`. * * @private * @param {ArrayBuffer} arrayBuffer The array buffer to clone. * @returns {ArrayBuffer} Returns the cloned array buffer. - */ - function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; - } - - /** + */function cloneArrayBuffer(arrayBuffer){var result=new arrayBuffer.constructor(arrayBuffer.byteLength);new Uint8Array(result).set(new Uint8Array(arrayBuffer));return result;}/** * Creates a clone of `dataView`. * * @private * @param {Object} dataView The data view to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned data view. - */ - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); - } - - /** + */function cloneDataView(dataView,isDeep){var buffer=isDeep?cloneArrayBuffer(dataView.buffer):dataView.buffer;return new dataView.constructor(buffer,dataView.byteOffset,dataView.byteLength);}/** * Creates a clone of `regexp`. * * @private * @param {Object} regexp The regexp to clone. * @returns {Object} Returns the cloned regexp. - */ - function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; - } - - /** + */function cloneRegExp(regexp){var result=new regexp.constructor(regexp.source,reFlags.exec(regexp));result.lastIndex=regexp.lastIndex;return result;}/** * Creates a clone of the `symbol` object. * * @private * @param {Object} symbol The symbol object to clone. * @returns {Object} Returns the cloned symbol object. - */ - function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; - } - - /** + */function cloneSymbol(symbol){return symbolValueOf?Object(symbolValueOf.call(symbol)):{};}/** * Creates a clone of `typedArray`. * * @private * @param {Object} typedArray The typed array to clone. * @param {boolean} [isDeep] Specify a deep clone. * @returns {Object} Returns the cloned typed array. - */ - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); - } - - /** + */function cloneTypedArray(typedArray,isDeep){var buffer=isDeep?cloneArrayBuffer(typedArray.buffer):typedArray.buffer;return new typedArray.constructor(buffer,typedArray.byteOffset,typedArray.length);}/** * Compares values to sort them in ascending order. * * @private * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {number} Returns the sort order indicator for `value`. - */ - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined$1, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); - - var othIsDefined = other !== undefined$1, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); - - if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || - (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || - (valIsNull && othIsDefined && othIsReflexive) || - (!valIsDefined && othIsReflexive) || - !valIsReflexive) { - return 1; - } - if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || - (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || - (othIsNull && valIsDefined && valIsReflexive) || - (!othIsDefined && valIsReflexive) || - !othIsReflexive) { - return -1; - } - } - return 0; - } - - /** + */function compareAscending(value,other){if(value!==other){var valIsDefined=value!==undefined$1,valIsNull=value===null,valIsReflexive=value===value,valIsSymbol=isSymbol(value);var othIsDefined=other!==undefined$1,othIsNull=other===null,othIsReflexive=other===other,othIsSymbol=isSymbol(other);if(!othIsNull&&!othIsSymbol&&!valIsSymbol&&value>other||valIsSymbol&&othIsDefined&&othIsReflexive&&!othIsNull&&!othIsSymbol||valIsNull&&othIsDefined&&othIsReflexive||!valIsDefined&&othIsReflexive||!valIsReflexive){return 1;}if(!valIsNull&&!valIsSymbol&&!othIsSymbol&&value= ordersLength) { - return result; - } - var order = orders[index]; - return result * (order == 'desc' ? -1 : 1); - } - } - // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications - // that causes it, under certain circumstances, to provide the same value for - // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 - // for more details. - // - // This also ensures a stable sort in V8 and other engines. - // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. - return object.index - other.index; - } - - /** + */function compareMultiple(object,other,orders){var index=-1,objCriteria=object.criteria,othCriteria=other.criteria,length=objCriteria.length,ordersLength=orders.length;while(++index=ordersLength){return result;}var order=orders[index];return result*(order=='desc'?-1:1);}}// Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications +// that causes it, under certain circumstances, to provide the same value for +// `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 +// for more details. +// +// This also ensures a stable sort in V8 and other engines. +// See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. +return object.index-other.index;}/** * Creates an array that is the composition of partially applied arguments, * placeholders, and provided arguments into a single array of arguments. * @@ -5460,32 +1903,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {Array} holders The `partials` placeholder indexes. * @params {boolean} [isCurried] Specify composing for a curried function. * @returns {Array} Returns the new array of composed arguments. - */ - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, - argsLength = args.length, - holdersLength = holders.length, - leftIndex = -1, - leftLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(leftLength + rangeLength), - isUncurried = !isCurried; - - while (++leftIndex < leftLength) { - result[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result[leftIndex++] = args[argsIndex++]; - } - return result; - } - - /** + */function composeArgs(args,partials,holders,isCurried){var argsIndex=-1,argsLength=args.length,holdersLength=holders.length,leftIndex=-1,leftLength=partials.length,rangeLength=nativeMax(argsLength-holdersLength,0),result=Array(leftLength+rangeLength),isUncurried=!isCurried;while(++leftIndex 1 ? sources[length - 1] : undefined$1, - guard = length > 2 ? sources[2] : undefined$1; - - customizer = (assigner.length > 3 && typeof customizer == 'function') - ? (length--, customizer) - : undefined$1; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined$1 : customizer; - length = 1; - } - object = Object(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; - }); - } - - /** + */function createAssigner(assigner){return baseRest(function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:undefined$1,guard=length>2?sources[2]:undefined$1;customizer=assigner.length>3&&typeof customizer=='function'?(length--,customizer):undefined$1;if(guard&&isIterateeCall(sources[0],sources[1],guard)){customizer=length<3?undefined$1:customizer;length=1;}object=Object(object);while(++index -1 ? iterable[iteratee ? collection[index] : index] : undefined$1; - }; - } - - /** + */function createFind(findIndexFunc){return function(collection,predicate,fromIndex){var iterable=Object(collection);if(!isArrayLike(collection)){var iteratee=getIteratee(predicate,3);collection=keys(collection);predicate=function(key){return iteratee(iterable[key],key,iterable);};}var index=findIndexFunc(collection,predicate,fromIndex);return index>-1?iterable[iteratee?collection[index]:index]:undefined$1;};}/** * Creates a `_.flow` or `_.flowRight` function. * * @private * @param {boolean} [fromRight] Specify iterating from right to left. * @returns {Function} Returns the new flow function. - */ - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; - - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == 'wrapper') { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - - var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined$1; - - if (data && isLaziable(data[0]) && - data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && - !data[4].length && data[9] == 1 - ) { - wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); - } else { - wrapper = (func.length == 1 && isLaziable(func)) - ? wrapper[funcName]() - : wrapper.thru(func); - } - } - return function() { - var args = arguments, - value = args[0]; - - if (wrapper && args.length == 1 && isArray(value)) { - return wrapper.plant(value).value(); - } - var index = 0, - result = length ? funcs[index].apply(this, args) : value; - - while (++index < length) { - result = funcs[index].call(this, result); - } - return result; - }; - }); - } - - /** + */function createFlow(fromRight){return flatRest(function(funcs){var length=funcs.length,index=length,prereq=LodashWrapper.prototype.thru;if(fromRight){funcs.reverse();}while(index--){var func=funcs[index];if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(prereq&&!wrapper&&getFuncName(func)=='wrapper'){var wrapper=new LodashWrapper([],true);}}index=wrapper?index:length;while(++index 1) { - args.reverse(); - } - if (isAry && ary < length) { - args.length = ary; - } - if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtor(fn); - } - return fn.apply(thisBinding, args); - } - return wrapper; - } - - /** + */function createHybrid(func,bitmask,thisArg,partials,holders,partialsRight,holdersRight,argPos,ary,arity){var isAry=bitmask&WRAP_ARY_FLAG,isBind=bitmask&WRAP_BIND_FLAG,isBindKey=bitmask&WRAP_BIND_KEY_FLAG,isCurried=bitmask&(WRAP_CURRY_FLAG|WRAP_CURRY_RIGHT_FLAG),isFlip=bitmask&WRAP_FLIP_FLAG,Ctor=isBindKey?undefined$1:createCtor(func);function wrapper(){var length=arguments.length,args=Array(length),index=length;while(index--){args[index]=arguments[index];}if(isCurried){var placeholder=getHolder(wrapper),holdersCount=countHolders(args,placeholder);}if(partials){args=composeArgs(args,partials,holders,isCurried);}if(partialsRight){args=composeArgsRight(args,partialsRight,holdersRight,isCurried);}length-=holdersCount;if(isCurried&&length1){args.reverse();}if(isAry&&ary arrLength)) { - return false; - } - // Check that cyclic values are equal. - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined$1; - - stack.set(array, other); - stack.set(other, array); - - // Ignore non-index properties. - while (++index < arrLength) { - var arrValue = array[index], - othValue = other[index]; - - if (customizer) { - var compared = isPartial - ? customizer(othValue, arrValue, index, other, array, stack) - : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined$1) { - if (compared) { - continue; - } - result = false; - break; - } - // Recursively compare arrays (susceptible to call stack limits). - if (seen) { - if (!arraySome(other, function(othValue, othIndex) { - if (!cacheHas(seen, othIndex) && - (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result = false; - break; - } - } else if (!( - arrValue === othValue || - equalFunc(arrValue, othValue, bitmask, customizer, stack) - )) { - result = false; - break; - } - } - stack['delete'](array); - stack['delete'](other); - return result; - } - - /** + */function equalArrays(array,other,bitmask,customizer,equalFunc,stack){var isPartial=bitmask&COMPARE_PARTIAL_FLAG,arrLength=array.length,othLength=other.length;if(arrLength!=othLength&&!(isPartial&&othLength>arrLength)){return false;}// Check that cyclic values are equal. +var arrStacked=stack.get(array);var othStacked=stack.get(other);if(arrStacked&&othStacked){return arrStacked==other&&othStacked==array;}var index=-1,result=true,seen=bitmask&COMPARE_UNORDERED_FLAG?new SetCache():undefined$1;stack.set(array,other);stack.set(other,array);// Ignore non-index properties. +while(++index 1 ? '& ' : '') + details[lastIndex]; - details = details.join(length > 2 ? ', ' : ' '); - return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); - } - - /** + */function insertWrapDetails(source,details){var length=details.length;if(!length){return source;}var lastIndex=length-1;details[lastIndex]=(length>1?'& ':'')+details[lastIndex];details=details.join(length>2?', ':' ');return source.replace(reWrapComment,'{\n/* [wrapped with '+details+'] */\n');}/** * Checks if `value` is a flattenable `arguments` object or array. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenable(value) { - return isArray(value) || isArguments(value) || - !!(spreadableSymbol && value && value[spreadableSymbol]); - } - - /** + */function isFlattenable(value){return isArray(value)||isArguments(value)||!!(spreadableSymbol&&value&&value[spreadableSymbol]);}/** * Checks if `value` is a valid array-like index. * * @private * @param {*} value The value to check. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - - return !!length && - (type == 'number' || - (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); - } - - /** + */function isIndex(value,length){var type=typeof value;length=length==null?MAX_SAFE_INTEGER:length;return !!length&&(type=='number'||type!='symbol'&&reIsUint.test(value))&&value>-1&&value%1==0&&value 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined$1, arguments); - }; - } - - /** + */function shortOut(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=HOT_SPAN-(stamp-lastCalled);lastCalled=stamp;if(remaining>0){if(++count>=HOT_COUNT){return arguments[0];}}else {count=0;}return func.apply(undefined$1,arguments);};}/** * A specialized version of `_.shuffle` which mutates and sets the size of `array`. * * @private * @param {Array} array The array to shuffle. * @param {number} [size=array.length] The size of `array`. * @returns {Array} Returns `array`. - */ - function shuffleSelf(array, size) { - var index = -1, - length = array.length, - lastIndex = length - 1; - - size = size === undefined$1 ? length : size; - while (++index < size) { - var rand = baseRandom(index, lastIndex), - value = array[rand]; - - array[rand] = array[index]; - array[index] = value; - } - array.length = size; - return array; - } - - /** + */function shuffleSelf(array,size){var index=-1,length=array.length,lastIndex=length-1;size=size===undefined$1?length:size;while(++index [['a', 'b', 'c'], ['d']] - */ - function chunk(array, size, guard) { - if ((guard ? isIterateeCall(array, size, guard) : size === undefined$1)) { - size = 1; - } else { - size = nativeMax(toInteger(size), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size < 1) { - return []; - } - var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); - - while (index < length) { - result[resIndex++] = baseSlice(array, index, (index += size)); - } - return result; - } - - /** + */function chunk(array,size,guard){if(guard?isIterateeCall(array,size,guard):size===undefined$1){size=1;}else {size=nativeMax(toInteger(size),0);}var length=array==null?0:array.length;if(!length||size<1){return [];}var index=0,resIndex=0,result=Array(nativeCeil(length/size));while(index [1, 2, 3] - */ - function compact(array) { - var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; - - while (++index < length) { - var value = array[index]; - if (value) { - result[resIndex++] = value; - } - } - return result; - } - - /** + */function compact(array){var index=-1,length=array==null?0:array.length,resIndex=0,result=[];while(++index [1] - */ - function concat() { - var length = arguments.length; - if (!length) { - return []; - } - var args = Array(length - 1), - array = arguments[0], - index = length; - - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); - } - - /** + */function concat(){var length=arguments.length;if(!length){return [];}var args=Array(length-1),array=arguments[0],index=length;while(index--){args[index-1]=arguments[index];}return arrayPush(isArray(array)?copyArray(array):[array],baseFlatten(args,1));}/** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are @@ -7739,14 +2692,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.difference([2, 1], [2, 3]); * // => [1] - */ - var difference = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) - : []; - }); - - /** + */var difference=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true)):[];});/** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The order and references of result values are @@ -7771,18 +2717,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] - */ - var differenceBy = baseRest(function(array, values) { - var iteratee = last(values); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined$1; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) - : []; - }); - - /** + */var differenceBy=baseRest(function(array,values){var iteratee=last(values);if(isArrayLikeObject(iteratee)){iteratee=undefined$1;}return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true),getIteratee(iteratee,2)):[];});/** * This method is like `_.difference` except that it accepts `comparator` * which is invoked to compare elements of `array` to `values`. The order and * references of result values are determined by the first array. The comparator @@ -7804,18 +2739,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] - */ - var differenceWith = baseRest(function(array, values) { - var comparator = last(values); - if (isArrayLikeObject(comparator)) { - comparator = undefined$1; - } - return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined$1, comparator) - : []; - }); - - /** + */var differenceWith=baseRest(function(array,values){var comparator=last(values);if(isArrayLikeObject(comparator)){comparator=undefined$1;}return isArrayLikeObject(array)?baseDifference(array,baseFlatten(values,1,isArrayLikeObject,true),undefined$1,comparator):[];});/** * Creates a slice of `array` with `n` elements dropped from the beginning. * * @static @@ -7839,17 +2763,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.drop([1, 2, 3], 0); * // => [1, 2, 3] - */ - function drop(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined$1) ? 1 : toInteger(n); - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** + */function drop(array,n,guard){var length=array==null?0:array.length;if(!length){return [];}n=guard||n===undefined$1?1:toInteger(n);return baseSlice(array,n<0?0:n,length);}/** * Creates a slice of `array` with `n` elements dropped from the end. * * @static @@ -7873,18 +2787,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.dropRight([1, 2, 3], 0); * // => [1, 2, 3] - */ - function dropRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined$1) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** + */function dropRight(array,n,guard){var length=array==null?0:array.length;if(!length){return [];}n=guard||n===undefined$1?1:toInteger(n);n=length-n;return baseSlice(array,0,n<0?0:n);}/** * Creates a slice of `array` excluding elements dropped from the end. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). @@ -7918,14 +2821,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.dropRightWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true, true) - : []; - } - - /** + */function dropRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),true,true):[];}/** * Creates a slice of `array` excluding elements dropped from the beginning. * Elements are dropped until `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index, array). @@ -7959,14 +2855,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.dropWhile(users, 'active'); * // => objects for ['barney', 'fred', 'pebbles'] - */ - function dropWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), true) - : []; - } - - /** + */function dropWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),true):[];}/** * Fills elements of `array` with `value` from `start` up to, but not * including, `end`. * @@ -7994,20 +2883,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.fill([4, 6, 8, 10], '*', 1, 3); * // => [4, '*', '*', 10] - */ - function fill(array, value, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { - start = 0; - end = length; - } - return baseFill(array, value, start, end); - } - - /** + */function fill(array,value,start,end){var length=array==null?0:array.length;if(!length){return [];}if(start&&typeof start!='number'&&isIterateeCall(array,value,start)){start=0;end=length;}return baseFill(array,value,start,end);}/** * This method is like `_.find` except that it returns the index of the first * element `predicate` returns truthy for instead of the element itself. * @@ -8041,20 +2917,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.findIndex(users, 'active'); * // => 2 - */ - function findIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, getIteratee(predicate, 3), index); - } - - /** + */function findIndex(array,predicate,fromIndex){var length=array==null?0:array.length;if(!length){return -1;}var index=fromIndex==null?0:toInteger(fromIndex);if(index<0){index=nativeMax(length+index,0);}return baseFindIndex(array,getIteratee(predicate,3),index);}/** * This method is like `_.findIndex` except that it iterates over elements * of `collection` from right to left. * @@ -8088,23 +2951,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.findLastIndex(users, 'active'); * // => 0 - */ - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined$1) { - index = toInteger(fromIndex); - index = fromIndex < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); - } - - /** + */function findLastIndex(array,predicate,fromIndex){var length=array==null?0:array.length;if(!length){return -1;}var index=length-1;if(fromIndex!==undefined$1){index=toInteger(fromIndex);index=fromIndex<0?nativeMax(length+index,0):nativeMin(index,length-1);}return baseFindIndex(array,getIteratee(predicate,3),index,true);}/** * Flattens `array` a single level deep. * * @static @@ -8117,13 +2964,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.flatten([1, [2, [3, [4]], 5]]); * // => [1, 2, [3, [4]], 5] - */ - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } - - /** + */function flatten(array){var length=array==null?0:array.length;return length?baseFlatten(array,1):[];}/** * Recursively flattens `array`. * * @static @@ -8136,13 +2977,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.flattenDeep([1, [2, [3, [4]], 5]]); * // => [1, 2, 3, 4, 5] - */ - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } - - /** + */function flattenDeep(array){var length=array==null?0:array.length;return length?baseFlatten(array,INFINITY):[];}/** * Recursively flatten `array` up to `depth` times. * * @static @@ -8161,17 +2996,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.flattenDepth(array, 2); * // => [1, 2, 3, [4], 5] - */ - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined$1 ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } - - /** + */function flattenDepth(array,depth){var length=array==null?0:array.length;if(!length){return [];}depth=depth===undefined$1?1:toInteger(depth);return baseFlatten(array,depth);}/** * The inverse of `_.toPairs`; this method returns an object composed * from key-value `pairs`. * @@ -8185,20 +3010,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.fromPairs([['a', 1], ['b', 2]]); * // => { 'a': 1, 'b': 2 } - */ - function fromPairs(pairs) { - var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; - - while (++index < length) { - var pair = pairs[index]; - result[pair[0]] = pair[1]; - } - return result; - } - - /** + */function fromPairs(pairs){var index=-1,length=pairs==null?0:pairs.length,result={};while(++index undefined - */ - function head(array) { - return (array && array.length) ? array[0] : undefined$1; - } - - /** + */function head(array){return array&&array.length?array[0]:undefined$1;}/** * Gets the index at which the first occurrence of `value` is found in `array` * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the @@ -8242,20 +3049,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Search from the `fromIndex`. * _.indexOf([1, 2, 1, 2], 2, 2); * // => 3 - */ - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); - } - - /** + */function indexOf(array,value,fromIndex){var length=array==null?0:array.length;if(!length){return -1;}var index=fromIndex==null?0:toInteger(fromIndex);if(index<0){index=nativeMax(length+index,0);}return baseIndexOf(array,value,index);}/** * Gets all but the last element of `array`. * * @static @@ -8268,13 +3062,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.initial([1, 2, 3]); * // => [1, 2] - */ - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; - } - - /** + */function initial(array){var length=array==null?0:array.length;return length?baseSlice(array,0,-1):[];}/** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order and references of result values are @@ -8290,15 +3078,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.intersection([2, 1], [2, 3]); * // => [2] - */ - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped) - : []; - }); - - /** + */var intersection=baseRest(function(arrays){var mapped=arrayMap(arrays,castArrayLikeObject);return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped):[];});/** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion * by which they're compared. The order and references of result values are @@ -8320,22 +3100,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] - */ - var intersectionBy = baseRest(function(arrays) { - var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - if (iteratee === last(mapped)) { - iteratee = undefined$1; - } else { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee, 2)) - : []; - }); - - /** + */var intersectionBy=baseRest(function(arrays){var iteratee=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);if(iteratee===last(mapped)){iteratee=undefined$1;}else {mapped.pop();}return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,getIteratee(iteratee,2)):[];});/** * This method is like `_.intersection` except that it accepts `comparator` * which is invoked to compare elements of `arrays`. The order and references * of result values are determined by the first array. The comparator is @@ -8355,21 +3120,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] - */ - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); - - comparator = typeof comparator == 'function' ? comparator : undefined$1; - if (comparator) { - mapped.pop(); - } - return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, undefined$1, comparator) - : []; - }); - - /** + */var intersectionWith=baseRest(function(arrays){var comparator=last(arrays),mapped=arrayMap(arrays,castArrayLikeObject);comparator=typeof comparator=='function'?comparator:undefined$1;if(comparator){mapped.pop();}return mapped.length&&mapped[0]===arrays[0]?baseIntersection(mapped,undefined$1,comparator):[];});/** * Converts all elements in `array` into a string separated by `separator`. * * @static @@ -8383,12 +3134,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.join(['a', 'b', 'c'], '~'); * // => 'a~b~c' - */ - function join(array, separator) { - return array == null ? '' : nativeJoin.call(array, separator); - } - - /** + */function join(array,separator){return array==null?'':nativeJoin.call(array,separator);}/** * Gets the last element of `array`. * * @static @@ -8401,13 +3147,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.last([1, 2, 3]); * // => 3 - */ - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined$1; - } - - /** + */function last(array){var length=array==null?0:array.length;return length?array[length-1]:undefined$1;}/** * This method is like `_.indexOf` except that it iterates over elements of * `array` from right to left. * @@ -8427,23 +3167,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Search from the `fromIndex`. * _.lastIndexOf([1, 2, 1, 2], 2, 2); * // => 1 - */ - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined$1) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value - ? strictLastIndexOf(array, value, index) - : baseFindIndex(array, baseIsNaN, index, true); - } - - /** + */function lastIndexOf(array,value,fromIndex){var length=array==null?0:array.length;if(!length){return -1;}var index=length;if(fromIndex!==undefined$1){index=toInteger(fromIndex);index=index<0?nativeMax(length+index,0):nativeMin(index,length-1);}return value===value?strictLastIndexOf(array,value,index):baseFindIndex(array,baseIsNaN,index,true);}/** * Gets the element at index `n` of `array`. If `n` is negative, the nth * element from the end is returned. * @@ -8463,12 +3187,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.nth(array, -2); * // => 'c'; - */ - function nth(array, n) { - return (array && array.length) ? baseNth(array, toInteger(n)) : undefined$1; - } - - /** + */function nth(array,n){return array&&array.length?baseNth(array,toInteger(n)):undefined$1;}/** * Removes all given values from `array` using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. @@ -8490,10 +3209,7 @@ var lodash = createCommonjsModule(function (module, exports) { * _.pull(array, 'a', 'c'); * console.log(array); * // => ['b', 'b'] - */ - var pull = baseRest(pullAll); - - /** + */var pull=baseRest(pullAll);/** * This method is like `_.pull` except that it accepts an array of values to remove. * * **Note:** Unlike `_.difference`, this method mutates `array`. @@ -8512,14 +3228,7 @@ var lodash = createCommonjsModule(function (module, exports) { * _.pullAll(array, ['a', 'c']); * console.log(array); * // => ['b', 'b'] - */ - function pullAll(array, values) { - return (array && array.length && values && values.length) - ? basePullAll(array, values) - : array; - } - - /** + */function pullAll(array,values){return array&&array.length&&values&&values.length?basePullAll(array,values):array;}/** * This method is like `_.pullAll` except that it accepts `iteratee` which is * invoked for each element of `array` and `values` to generate the criterion * by which they're compared. The iteratee is invoked with one argument: (value). @@ -8541,14 +3250,7 @@ var lodash = createCommonjsModule(function (module, exports) { * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); * console.log(array); * // => [{ 'x': 2 }] - */ - function pullAllBy(array, values, iteratee) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee, 2)) - : array; - } - - /** + */function pullAllBy(array,values,iteratee){return array&&array.length&&values&&values.length?basePullAll(array,values,getIteratee(iteratee,2)):array;}/** * This method is like `_.pullAll` except that it accepts `comparator` which * is invoked to compare elements of `array` to `values`. The comparator is * invoked with two arguments: (arrVal, othVal). @@ -8570,14 +3272,7 @@ var lodash = createCommonjsModule(function (module, exports) { * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); * console.log(array); * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] - */ - function pullAllWith(array, values, comparator) { - return (array && array.length && values && values.length) - ? basePullAll(array, values, undefined$1, comparator) - : array; - } - - /** + */function pullAllWith(array,values,comparator){return array&&array.length&&values&&values.length?basePullAll(array,values,undefined$1,comparator):array;}/** * Removes elements from `array` corresponding to `indexes` and returns an * array of removed elements. * @@ -8600,19 +3295,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(pulled); * // => ['b', 'd'] - */ - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); - - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - - return result; - }); - - /** + */var pullAt=flatRest(function(array,indexes){var length=array==null?0:array.length,result=baseAt(array,indexes);basePullAt(array,arrayMap(indexes,function(index){return isIndex(index,length)?+index:index;}).sort(compareAscending));return result;});/** * Removes all elements from `array` that `predicate` returns truthy for * and returns an array of the removed elements. The predicate is invoked * with three arguments: (value, index, array). @@ -8639,29 +3322,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(evens); * // => [2, 4] - */ - function remove(array, predicate) { - var result = []; - if (!(array && array.length)) { - return result; - } - var index = -1, - indexes = [], - length = array.length; - - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result.push(value); - indexes.push(index); - } - } - basePullAt(array, indexes); - return result; - } - - /** + */function remove(array,predicate){var result=[];if(!(array&&array.length)){return result;}var index=-1,indexes=[],length=array.length;predicate=getIteratee(predicate,3);while(++index [3, 2, 1] - */ - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } - - /** + */function reverse(array){return array==null?array:nativeReverse.call(array);}/** * Creates a slice of `array` from `start` up to, but not including, `end`. * * **Note:** This method is used instead of @@ -8703,24 +3359,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @param {number} [start=0] The start position. * @param {number} [end=array.length] The end position. * @returns {Array} Returns the slice of `array`. - */ - function slice(array, start, end) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { - start = 0; - end = length; - } - else { - start = start == null ? 0 : toInteger(start); - end = end === undefined$1 ? length : toInteger(end); - } - return baseSlice(array, start, end); - } - - /** + */function slice(array,start,end){var length=array==null?0:array.length;if(!length){return [];}if(end&&typeof end!='number'&&isIterateeCall(array,start,end)){start=0;end=length;}else {start=start==null?0:toInteger(start);end=end===undefined$1?length:toInteger(end);}return baseSlice(array,start,end);}/** * Uses a binary search to determine the lowest index at which `value` * should be inserted into `array` in order to maintain its sort order. * @@ -8736,12 +3375,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sortedIndex([30, 50], 40); * // => 1 - */ - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - - /** + */function sortedIndex(array,value){return baseSortedIndex(array,value);}/** * This method is like `_.sortedIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). @@ -8765,12 +3399,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); * // => 0 - */ - function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); - } - - /** + */function sortedIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2));}/** * This method is like `_.indexOf` except that it performs a binary * search on a sorted `array`. * @@ -8785,19 +3414,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sortedIndexOf([4, 5, 5, 5, 6], 5); * // => 1 - */ - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** + */function sortedIndexOf(array,value){var length=array==null?0:array.length;if(length){var index=baseSortedIndex(array,value);if(index 4 - */ - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); - } - - /** + */function sortedLastIndex(array,value){return baseSortedIndex(array,value,true);}/** * This method is like `_.sortedLastIndex` except that it accepts `iteratee` * which is invoked for `value` and each element of `array` to compute their * sort ranking. The iteratee is invoked with one argument: (value). @@ -8843,12 +3455,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); * // => 1 - */ - function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); - } - - /** + */function sortedLastIndexBy(array,value,iteratee){return baseSortedIndexBy(array,value,getIteratee(iteratee,2),true);}/** * This method is like `_.lastIndexOf` except that it performs a binary * search on a sorted `array`. * @@ -8863,19 +3470,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); * // => 3 - */ - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; - } - - /** + */function sortedLastIndexOf(array,value){var length=array==null?0:array.length;if(length){var index=baseSortedIndex(array,value,true)-1;if(eq(array[index],value)){return index;}}return -1;}/** * This method is like `_.uniq` except that it's designed and optimized * for sorted arrays. * @@ -8889,14 +3484,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sortedUniq([1, 1, 2]); * // => [1, 2] - */ - function sortedUniq(array) { - return (array && array.length) - ? baseSortedUniq(array) - : []; - } - - /** + */function sortedUniq(array){return array&&array.length?baseSortedUniq(array):[];}/** * This method is like `_.uniqBy` except that it's designed and optimized * for sorted arrays. * @@ -8911,14 +3499,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); * // => [1.1, 2.3] - */ - function sortedUniqBy(array, iteratee) { - return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee, 2)) - : []; - } - - /** + */function sortedUniqBy(array,iteratee){return array&&array.length?baseSortedUniq(array,getIteratee(iteratee,2)):[];}/** * Gets all but the first element of `array`. * * @static @@ -8931,13 +3512,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.tail([1, 2, 3]); * // => [2, 3] - */ - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; - } - - /** + */function tail(array){var length=array==null?0:array.length;return length?baseSlice(array,1,length):[];}/** * Creates a slice of `array` with `n` elements taken from the beginning. * * @static @@ -8961,16 +3536,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.take([1, 2, 3], 0); * // => [] - */ - function take(array, n, guard) { - if (!(array && array.length)) { - return []; - } - n = (guard || n === undefined$1) ? 1 : toInteger(n); - return baseSlice(array, 0, n < 0 ? 0 : n); - } - - /** + */function take(array,n,guard){if(!(array&&array.length)){return [];}n=guard||n===undefined$1?1:toInteger(n);return baseSlice(array,0,n<0?0:n);}/** * Creates a slice of `array` with `n` elements taken from the end. * * @static @@ -8994,18 +3560,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.takeRight([1, 2, 3], 0); * // => [] - */ - function takeRight(array, n, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n = (guard || n === undefined$1) ? 1 : toInteger(n); - n = length - n; - return baseSlice(array, n < 0 ? 0 : n, length); - } - - /** + */function takeRight(array,n,guard){var length=array==null?0:array.length;if(!length){return [];}n=guard||n===undefined$1?1:toInteger(n);n=length-n;return baseSlice(array,n<0?0:n,length);}/** * Creates a slice of `array` with elements taken from the end. Elements are * taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). @@ -9039,14 +3594,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.takeRightWhile(users, 'active'); * // => [] - */ - function takeRightWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3), false, true) - : []; - } - - /** + */function takeRightWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3),false,true):[];}/** * Creates a slice of `array` with elements taken from the beginning. Elements * are taken until `predicate` returns falsey. The predicate is invoked with * three arguments: (value, index, array). @@ -9080,14 +3628,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.takeWhile(users, 'active'); * // => [] - */ - function takeWhile(array, predicate) { - return (array && array.length) - ? baseWhile(array, getIteratee(predicate, 3)) - : []; - } - - /** + */function takeWhile(array,predicate){return array&&array.length?baseWhile(array,getIteratee(predicate,3)):[];}/** * Creates an array of unique values, in order, from all given arrays using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. @@ -9102,12 +3643,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.union([2], [1, 2]); * // => [2, 1] - */ - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); - }); - - /** + */var union=baseRest(function(arrays){return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true));});/** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which uniqueness is computed. Result values are chosen from the first @@ -9129,16 +3665,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] - */ - var unionBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined$1; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); - }); - - /** + */var unionBy=baseRest(function(arrays){var iteratee=last(arrays);if(isArrayLikeObject(iteratee)){iteratee=undefined$1;}return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true),getIteratee(iteratee,2));});/** * This method is like `_.union` except that it accepts `comparator` which * is invoked to compare elements of `arrays`. Result values are chosen from * the first array in which the value occurs. The comparator is invoked @@ -9158,14 +3685,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined$1; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator); - }); - - /** + */var unionWith=baseRest(function(arrays){var comparator=last(arrays);comparator=typeof comparator=='function'?comparator:undefined$1;return baseUniq(baseFlatten(arrays,1,isArrayLikeObject,true),undefined$1,comparator);});/** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each element @@ -9182,12 +3702,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.uniq([2, 1, 2]); * // => [2, 1] - */ - function uniq(array) { - return (array && array.length) ? baseUniq(array) : []; - } - - /** + */function uniq(array){return array&&array.length?baseUniq(array):[];}/** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * uniqueness is computed. The order of result values is determined by the @@ -9209,12 +3724,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] - */ - function uniqBy(array, iteratee) { - return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; - } - - /** + */function uniqBy(array,iteratee){return array&&array.length?baseUniq(array,getIteratee(iteratee,2)):[];}/** * This method is like `_.uniq` except that it accepts `comparator` which * is invoked to compare elements of `array`. The order of result values is * determined by the order they occur in the array.The comparator is invoked @@ -9233,13 +3743,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.uniqWith(objects, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] - */ - function uniqWith(array, comparator) { - comparator = typeof comparator == 'function' ? comparator : undefined$1; - return (array && array.length) ? baseUniq(array, undefined$1, comparator) : []; - } - - /** + */function uniqWith(array,comparator){comparator=typeof comparator=='function'?comparator:undefined$1;return array&&array.length?baseUniq(array,undefined$1,comparator):[];}/** * This method is like `_.zip` except that it accepts an array of grouped * elements and creates an array regrouping the elements to their pre-zip * configuration. @@ -9257,24 +3761,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.unzip(zipped); * // => [['a', 'b'], [1, 2], [true, false]] - */ - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } - }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); - } - - /** + */function unzip(array){if(!(array&&array.length)){return [];}var length=0;array=arrayFilter(array,function(group){if(isArrayLikeObject(group)){length=nativeMax(group.length,length);return true;}});return baseTimes(length,function(index){return arrayMap(array,baseProperty(index));});}/** * This method is like `_.unzip` except that it accepts `iteratee` to specify * how regrouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). @@ -9294,21 +3781,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.unzipWith(zipped, _.add); * // => [3, 30, 300] - */ - function unzipWith(array, iteratee) { - if (!(array && array.length)) { - return []; - } - var result = unzip(array); - if (iteratee == null) { - return result; - } - return arrayMap(result, function(group) { - return apply(iteratee, undefined$1, group); - }); - } - - /** + */function unzipWith(array,iteratee){if(!(array&&array.length)){return [];}var result=unzip(array);if(iteratee==null){return result;}return arrayMap(result,function(group){return apply(iteratee,undefined$1,group);});}/** * Creates an array excluding all given values using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. @@ -9327,14 +3800,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.without([2, 1, 2, 3], 1, 2); * // => [3] - */ - var without = baseRest(function(array, values) { - return isArrayLikeObject(array) - ? baseDifference(array, values) - : []; - }); - - /** + */var without=baseRest(function(array,values){return isArrayLikeObject(array)?baseDifference(array,values):[];});/** * Creates an array of unique values that is the * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) * of the given arrays. The order of result values is determined by the order @@ -9351,12 +3817,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.xor([2, 1], [2, 3]); * // => [1, 3] - */ - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); - - /** + */var xor=baseRest(function(arrays){return baseXor(arrayFilter(arrays,isArrayLikeObject));});/** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by * which by which they're compared. The order of result values is determined @@ -9378,16 +3839,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] - */ - var xorBy = baseRest(function(arrays) { - var iteratee = last(arrays); - if (isArrayLikeObject(iteratee)) { - iteratee = undefined$1; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); - }); - - /** + */var xorBy=baseRest(function(arrays){var iteratee=last(arrays);if(isArrayLikeObject(iteratee)){iteratee=undefined$1;}return baseXor(arrayFilter(arrays,isArrayLikeObject),getIteratee(iteratee,2));});/** * This method is like `_.xor` except that it accepts `comparator` which is * invoked to compare elements of `arrays`. The order of result values is * determined by the order they occur in the arrays. The comparator is invoked @@ -9407,14 +3859,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] - */ - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == 'function' ? comparator : undefined$1; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator); - }); - - /** + */var xorWith=baseRest(function(arrays){var comparator=last(arrays);comparator=typeof comparator=='function'?comparator:undefined$1;return baseXor(arrayFilter(arrays,isArrayLikeObject),undefined$1,comparator);});/** * Creates an array of grouped elements, the first of which contains the * first elements of the given arrays, the second of which contains the * second elements of the given arrays, and so on. @@ -9429,10 +3874,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.zip(['a', 'b'], [1, 2], [true, false]); * // => [['a', 1, true], ['b', 2, false]] - */ - var zip = baseRest(unzip); - - /** + */var zip=baseRest(unzip);/** * This method is like `_.fromPairs` except that it accepts two arrays, * one of property identifiers and one of corresponding values. * @@ -9447,12 +3889,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.zipObject(['a', 'b'], [1, 2]); * // => { 'a': 1, 'b': 2 } - */ - function zipObject(props, values) { - return baseZipObject(props || [], values || [], assignValue); - } - - /** + */function zipObject(props,values){return baseZipObject(props||[],values||[],assignValue);}/** * This method is like `_.zipObject` except that it supports property paths. * * @static @@ -9466,12 +3903,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } - */ - function zipObjectDeep(props, values) { - return baseZipObject(props || [], values || [], baseSet); - } - - /** + */function zipObjectDeep(props,values){return baseZipObject(props||[],values||[],baseSet);}/** * This method is like `_.zip` except that it accepts `iteratee` to specify * how grouped values should be combined. The iteratee is invoked with the * elements of each group: (...group). @@ -9490,18 +3922,7 @@ var lodash = createCommonjsModule(function (module, exports) { * return a + b + c; * }); * // => [111, 222] - */ - var zipWith = baseRest(function(arrays) { - var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined$1; - - iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined$1; - return unzipWith(arrays, iteratee); - }); - - /*------------------------------------------------------------------------*/ - - /** + */var zipWith=baseRest(function(arrays){var length=arrays.length,iteratee=length>1?arrays[length-1]:undefined$1;iteratee=typeof iteratee=='function'?(arrays.pop(),iteratee):undefined$1;return unzipWith(arrays,iteratee);});/*------------------------------------------------------------------------*/ /** * Creates a `lodash` wrapper instance that wraps `value` with explicit method * chain sequences enabled. The result of such sequences must be unwrapped * with `_#value`. @@ -9529,14 +3950,7 @@ var lodash = createCommonjsModule(function (module, exports) { * .head() * .value(); * // => 'pebbles is 1' - */ - function chain(value) { - var result = lodash(value); - result.__chain__ = true; - return result; - } - - /** + */function chain(value){var result=lodash(value);result.__chain__=true;return result;}/** * This method invokes `interceptor` and returns `value`. The interceptor * is invoked with one argument; (value). The purpose of this method is to * "tap into" a method chain sequence in order to modify intermediate results. @@ -9558,13 +3972,7 @@ var lodash = createCommonjsModule(function (module, exports) { * .reverse() * .value(); * // => [2, 1] - */ - function tap(value, interceptor) { - interceptor(value); - return value; - } - - /** + */function tap(value,interceptor){interceptor(value);return value;}/** * This method is like `_.tap` except that it returns the result of `interceptor`. * The purpose of this method is to "pass thru" values replacing intermediate * results in a method chain sequence. @@ -9586,12 +3994,7 @@ var lodash = createCommonjsModule(function (module, exports) { * }) * .value(); * // => ['abc'] - */ - function thru(value, interceptor) { - return interceptor(value); - } - - /** + */function thru(value,interceptor){return interceptor(value);}/** * This method is the wrapper version of `_.at`. * * @name at @@ -9606,32 +4009,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] - */ - var wrapperAt = flatRest(function(paths) { - var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; - - if (length > 1 || this.__actions__.length || - !(value instanceof LazyWrapper) || !isIndex(start)) { - return this.thru(interceptor); - } - value = value.slice(start, +start + (length ? 1 : 0)); - value.__actions__.push({ - 'func': thru, - 'args': [interceptor], - 'thisArg': undefined$1 - }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined$1); - } - return array; - }); - }); - - /** + */var wrapperAt=flatRest(function(paths){var length=paths.length,start=length?paths[0]:0,value=this.__wrapped__,interceptor=function(object){return baseAt(object,paths);};if(length>1||this.__actions__.length||!(value instanceof LazyWrapper)||!isIndex(start)){return this.thru(interceptor);}value=value.slice(start,+start+(length?1:0));value.__actions__.push({'func':thru,'args':[interceptor],'thisArg':undefined$1});return new LodashWrapper(value,this.__chain__).thru(function(array){if(length&&!array.length){array.push(undefined$1);}return array;});});/** * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. * * @name chain @@ -9657,12 +4035,7 @@ var lodash = createCommonjsModule(function (module, exports) { * .pick('user') * .value(); * // => { 'user': 'barney' } - */ - function wrapperChain() { - return chain(this); - } - - /** + */function wrapperChain(){return chain(this);}/** * Executes the chain sequence and returns the wrapped result. * * @name commit @@ -9687,12 +4060,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(array); * // => [1, 2, 3] - */ - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - - /** + */function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__);}/** * Gets the next value on a wrapped object following the * [iterator protocol](https://mdn.io/iteration_protocols#iterator). * @@ -9713,18 +4081,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * wrapped.next(); * // => { 'done': true, 'value': undefined } - */ - function wrapperNext() { - if (this.__values__ === undefined$1) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, - value = done ? undefined$1 : this.__values__[this.__index__++]; - - return { 'done': done, 'value': value }; - } - - /** + */function wrapperNext(){if(this.__values__===undefined$1){this.__values__=toArray(this.value());}var done=this.__index__>=this.__values__.length,value=done?undefined$1:this.__values__[this.__index__++];return {'done':done,'value':value};}/** * Enables the wrapper to be iterable. * * @name Symbol.iterator @@ -9741,12 +4098,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * Array.from(wrapped); * // => [1, 2] - */ - function wrapperToIterator() { - return this; - } - - /** + */function wrapperToIterator(){return this;}/** * Creates a clone of the chain sequence planting `value` as the wrapped value. * * @name plant @@ -9769,28 +4121,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * wrapped.value(); * // => [1, 4] - */ - function wrapperPlant(value) { - var result, - parent = this; - - while (parent instanceof baseLodash) { - var clone = wrapperClone(parent); - clone.__index__ = 0; - clone.__values__ = undefined$1; - if (result) { - previous.__wrapped__ = clone; - } else { - result = clone; - } - var previous = clone; - parent = parent.__wrapped__; - } - previous.__wrapped__ = value; - return result; - } - - /** + */function wrapperPlant(value){var result,parent=this;while(parent instanceof baseLodash){var clone=wrapperClone(parent);clone.__index__=0;clone.__values__=undefined$1;if(result){previous.__wrapped__=clone;}else {result=clone;}var previous=clone;parent=parent.__wrapped__;}previous.__wrapped__=value;return result;}/** * This method is the wrapper version of `_.reverse`. * * **Note:** This method mutates the wrapped array. @@ -9809,26 +4140,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(array); * // => [3, 2, 1] - */ - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); - } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - 'func': thru, - 'args': [reverse], - 'thisArg': undefined$1 - }); - return new LodashWrapper(wrapped, this.__chain__); - } - return this.thru(reverse); - } - - /** + */function wrapperReverse(){var value=this.__wrapped__;if(value instanceof LazyWrapper){var wrapped=value;if(this.__actions__.length){wrapped=new LazyWrapper(this);}wrapped=wrapped.reverse();wrapped.__actions__.push({'func':thru,'args':[reverse],'thisArg':undefined$1});return new LodashWrapper(wrapped,this.__chain__);}return this.thru(reverse);}/** * Executes the chain sequence to resolve the unwrapped value. * * @name value @@ -9841,14 +4153,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _([1, 2, 3]).value(); * // => [1, 2, 3] - */ - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - - /*------------------------------------------------------------------------*/ - - /** + */function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__);}/*------------------------------------------------------------------------*/ /** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the number of times the key was returned by `iteratee`. The @@ -9869,16 +4174,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } - */ - var countBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - ++result[key]; - } else { - baseAssignValue(result, key, 1); - } - }); - - /** + */var countBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){++result[key];}else {baseAssignValue(result,key,1);}});/** * Checks if `predicate` returns truthy for **all** elements of `collection`. * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). @@ -9918,16 +4214,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.every(users, 'active'); * // => false - */ - function every(collection, predicate, guard) { - var func = isArray(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined$1; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** + */function every(collection,predicate,guard){var func=isArray(collection)?arrayEvery:baseEvery;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined$1;}return func(collection,getIteratee(predicate,3));}/** * Iterates over elements of `collection`, returning an array of all elements * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). @@ -9967,13 +4254,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Combining several predicates using `_.overEvery` or `_.overSome`. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); * // => objects for ['fred', 'barney'] - */ - function filter(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } - - /** + */function filter(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,getIteratee(predicate,3));}/** * Iterates over elements of `collection`, returning the first element * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). @@ -10008,10 +4289,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.find(users, 'active'); * // => object for 'barney' - */ - var find = createFind(findIndex); - - /** + */var find=createFind(findIndex);/** * This method is like `_.find` except that it iterates over elements of * `collection` from right to left. * @@ -10029,10 +4307,7 @@ var lodash = createCommonjsModule(function (module, exports) { * return n % 2 == 1; * }); * // => 3 - */ - var findLast = createFind(findLastIndex); - - /** + */var findLast=createFind(findLastIndex);/** * Creates a flattened array of values by running each element in `collection` * thru `iteratee` and flattening the mapped results. The iteratee is invoked * with three arguments: (value, index|key, collection). @@ -10052,12 +4327,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.flatMap([1, 2], duplicate); * // => [1, 1, 2, 2] - */ - function flatMap(collection, iteratee) { - return baseFlatten(map(collection, iteratee), 1); - } - - /** + */function flatMap(collection,iteratee){return baseFlatten(map(collection,iteratee),1);}/** * This method is like `_.flatMap` except that it recursively flattens the * mapped results. * @@ -10076,12 +4346,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.flatMapDeep([1, 2], duplicate); * // => [1, 1, 2, 2] - */ - function flatMapDeep(collection, iteratee) { - return baseFlatten(map(collection, iteratee), INFINITY); - } - - /** + */function flatMapDeep(collection,iteratee){return baseFlatten(map(collection,iteratee),INFINITY);}/** * This method is like `_.flatMap` except that it recursively flattens the * mapped results up to `depth` times. * @@ -10101,13 +4366,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.flatMapDepth([1, 2], duplicate, 2); * // => [[1, 1], [2, 2]] - */ - function flatMapDepth(collection, iteratee, depth) { - depth = depth === undefined$1 ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee), depth); - } - - /** + */function flatMapDepth(collection,iteratee,depth){depth=depth===undefined$1?1:toInteger(depth);return baseFlatten(map(collection,iteratee),depth);}/** * Iterates over elements of `collection` and invokes `iteratee` for each element. * The iteratee is invoked with three arguments: (value, index|key, collection). * Iteratee functions may exit iteration early by explicitly returning `false`. @@ -10136,13 +4395,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forEach(collection, iteratee) { - var func = isArray(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee, 3)); - } - - /** + */function forEach(collection,iteratee){var func=isArray(collection)?arrayEach:baseEach;return func(collection,getIteratee(iteratee,3));}/** * This method is like `_.forEach` except that it iterates over elements of * `collection` from right to left. * @@ -10161,13 +4414,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(value); * }); * // => Logs `2` then `1`. - */ - function forEachRight(collection, iteratee) { - var func = isArray(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee, 3)); - } - - /** + */function forEachRight(collection,iteratee){var func=isArray(collection)?arrayEachRight:baseEachRight;return func(collection,getIteratee(iteratee,3));}/** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The order of grouped values * is determined by the order they occur in `collection`. The corresponding @@ -10189,16 +4436,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } - */ - var groupBy = createAggregator(function(result, value, key) { - if (hasOwnProperty.call(result, key)) { - result[key].push(value); - } else { - baseAssignValue(result, key, [value]); - } - }); - - /** + */var groupBy=createAggregator(function(result,value,key){if(hasOwnProperty.call(result,key)){result[key].push(value);}else {baseAssignValue(result,key,[value]);}});/** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) @@ -10227,21 +4465,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.includes('abcd', 'bc'); * // => true - */ - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; - - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString(collection) - ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) - : (!!length && baseIndexOf(collection, value, fromIndex) > -1); - } - - /** + */function includes(collection,value,fromIndex,guard){collection=isArrayLike(collection)?collection:values(collection);fromIndex=fromIndex&&!guard?toInteger(fromIndex):0;var length=collection.length;if(fromIndex<0){fromIndex=nativeMax(length+fromIndex,0);}return isString(collection)?fromIndex<=length&&collection.indexOf(value,fromIndex)>-1:!!length&&baseIndexOf(collection,value,fromIndex)>-1;}/** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments * are provided to each invoked method. If `path` is a function, it's invoked @@ -10263,19 +4487,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] - */ - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; - - baseEach(collection, function(value) { - result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); - }); - return result; - }); - - /** + */var invokeMap=baseRest(function(collection,path,args){var index=-1,isFunc=typeof path=='function',result=isArrayLike(collection)?Array(collection.length):[];baseEach(collection,function(value){result[++index]=isFunc?apply(path,value,args):baseInvoke(value,path,args);});return result;});/** * Creates an object composed of keys generated from the results of running * each element of `collection` thru `iteratee`. The corresponding value of * each key is the last element responsible for generating the key. The @@ -10302,12 +4514,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } - */ - var keyBy = createAggregator(function(result, value, key) { - baseAssignValue(result, key, value); - }); - - /** + */var keyBy=createAggregator(function(result,value,key){baseAssignValue(result,key,value);});/** * Creates an array of values by running each element in `collection` thru * `iteratee`. The iteratee is invoked with three arguments: * (value, index|key, collection). @@ -10348,13 +4555,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.map(users, 'user'); * // => ['barney', 'fred'] - */ - function map(collection, iteratee) { - var func = isArray(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee, 3)); - } - - /** + */function map(collection,iteratee){var func=isArray(collection)?arrayMap:baseMap;return func(collection,getIteratee(iteratee,3));}/** * This method is like `_.sortBy` except that it allows specifying the sort * orders of the iteratees to sort by. If `orders` is unspecified, all values * are sorted in ascending order. Otherwise, specify an order of "desc" for @@ -10382,22 +4583,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Sort by `user` in ascending order and by `age` in descending order. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] - */ - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined$1 : orders; - if (!isArray(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } - - /** + */function orderBy(collection,iteratees,orders,guard){if(collection==null){return [];}if(!isArray(iteratees)){iteratees=iteratees==null?[]:[iteratees];}orders=guard?undefined$1:orders;if(!isArray(orders)){orders=orders==null?[]:[orders];}return baseOrderBy(collection,iteratees,orders);}/** * Creates an array of elements split into two groups, the first of which * contains elements `predicate` returns truthy for, the second of which * contains elements `predicate` returns falsey for. The predicate is @@ -10432,12 +4618,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] - */ - var partition = createAggregator(function(result, value, key) { - result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); - - /** + */var partition=createAggregator(function(result,value,key){result[key?0:1].push(value);},function(){return [[],[]];});/** * Reduces `collection` to a value which is the accumulated result of running * each element in `collection` thru `iteratee`, where each successive * invocation is supplied the return value of the previous. If `accumulator` @@ -10473,15 +4654,7 @@ var lodash = createCommonjsModule(function (module, exports) { * return result; * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) - */ - function reduce(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); - } - - /** + */function reduce(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduce:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEach);}/** * This method is like `_.reduce` except that it iterates over elements of * `collection` from right to left. * @@ -10502,15 +4675,7 @@ var lodash = createCommonjsModule(function (module, exports) { * return flattened.concat(other); * }, []); * // => [4, 5, 2, 3, 0, 1] - */ - function reduceRight(collection, iteratee, accumulator) { - var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; - - return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); - } - - /** + */function reduceRight(collection,iteratee,accumulator){var func=isArray(collection)?arrayReduceRight:baseReduce,initAccum=arguments.length<3;return func(collection,getIteratee(iteratee,4),accumulator,initAccum,baseEachRight);}/** * The opposite of `_.filter`; this method returns the elements of `collection` * that `predicate` does **not** return truthy for. * @@ -10543,13 +4708,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.reject(users, 'active'); * // => objects for ['barney'] - */ - function reject(collection, predicate) { - var func = isArray(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); - } - - /** + */function reject(collection,predicate){var func=isArray(collection)?arrayFilter:baseFilter;return func(collection,negate(getIteratee(predicate,3)));}/** * Gets a random element from `collection`. * * @static @@ -10562,13 +4721,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sample([1, 2, 3, 4]); * // => 2 - */ - function sample(collection) { - var func = isArray(collection) ? arraySample : baseSample; - return func(collection); - } - - /** + */function sample(collection){var func=isArray(collection)?arraySample:baseSample;return func(collection);}/** * Gets `n` random elements at unique keys from `collection` up to the * size of `collection`. * @@ -10587,18 +4740,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sampleSize([1, 2, 3], 4); * // => [2, 3, 1] - */ - function sampleSize(collection, n, guard) { - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined$1)) { - n = 1; - } else { - n = toInteger(n); - } - var func = isArray(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n); - } - - /** + */function sampleSize(collection,n,guard){if(guard?isIterateeCall(collection,n,guard):n===undefined$1){n=1;}else {n=toInteger(n);}var func=isArray(collection)?arraySampleSize:baseSampleSize;return func(collection,n);}/** * Creates an array of shuffled values, using a version of the * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). * @@ -10612,13 +4754,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.shuffle([1, 2, 3, 4]); * // => [4, 1, 3, 2] - */ - function shuffle(collection) { - var func = isArray(collection) ? arrayShuffle : baseShuffle; - return func(collection); - } - - /** + */function shuffle(collection){var func=isArray(collection)?arrayShuffle:baseShuffle;return func(collection);}/** * Gets the size of `collection` by returning its length for array-like * values or the number of own enumerable string keyed properties for objects. * @@ -10638,22 +4774,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.size('pebbles'); * // => 7 - */ - function size(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; - } - - /** + */function size(collection){if(collection==null){return 0;}if(isArrayLike(collection)){return isString(collection)?stringSize(collection):collection.length;}var tag=getTag(collection);if(tag==mapTag||tag==setTag){return collection.size;}return baseKeys(collection).length;}/** * Checks if `predicate` returns truthy for **any** element of `collection`. * Iteration is stopped once `predicate` returns truthy. The predicate is * invoked with three arguments: (value, index|key, collection). @@ -10688,16 +4809,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.some(users, 'active'); * // => true - */ - function some(collection, predicate, guard) { - var func = isArray(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined$1; - } - return func(collection, getIteratee(predicate, 3)); - } - - /** + */function some(collection,predicate,guard){var func=isArray(collection)?arraySome:baseSome;if(guard&&isIterateeCall(collection,predicate,guard)){predicate=undefined$1;}return func(collection,getIteratee(predicate,3));}/** * Creates an array of elements, sorted in ascending order by the results of * running each element in a collection thru each iteratee. This method * performs a stable sort, that is, it preserves the original sort order of @@ -10725,23 +4837,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] - */ - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); - - /*------------------------------------------------------------------------*/ - - /** + */var sortBy=baseRest(function(collection,iteratees){if(collection==null){return [];}var length=iteratees.length;if(length>1&&isIterateeCall(collection,iteratees[0],iteratees[1])){iteratees=[];}else if(length>2&&isIterateeCall(iteratees[0],iteratees[1],iteratees[2])){iteratees=[iteratees[0]];}return baseOrderBy(collection,baseFlatten(iteratees,1),[]);});/*------------------------------------------------------------------------*/ /** * Gets the timestamp of the number of milliseconds that have elapsed since * the Unix epoch (1 January 1970 00:00:00 UTC). * @@ -10756,14 +4852,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(_.now() - stamp); * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. - */ - var now = ctxNow || function() { - return root.Date.now(); - }; - - /*------------------------------------------------------------------------*/ - - /** + */var now=ctxNow||function(){return root.Date.now();};/*------------------------------------------------------------------------*/ /** * The opposite of `_.before`; this method creates a function that invokes * `func` once it's called `n` or more times. * @@ -10786,20 +4875,7 @@ var lodash = createCommonjsModule(function (module, exports) { * asyncSave({ 'type': type, 'complete': done }); * }); * // => Logs 'done saving!' after the two async saves have completed. - */ - function after(n, func) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n < 1) { - return func.apply(this, arguments); - } - }; - } - - /** + */function after(n,func){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n<1){return func.apply(this,arguments);}};}/** * Creates a function that invokes `func`, with up to `n` arguments, * ignoring any additional arguments. * @@ -10815,14 +4891,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.map(['6', '8', '10'], _.ary(parseInt, 1)); * // => [6, 8, 10] - */ - function ary(func, n, guard) { - n = guard ? undefined$1 : n; - n = (func && n == null) ? func.length : n; - return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n); - } - - /** + */function ary(func,n,guard){n=guard?undefined$1:n;n=func&&n==null?func.length:n;return createWrap(func,WRAP_ARY_FLAG,undefined$1,undefined$1,undefined$1,undefined$1,n);}/** * Creates a function that invokes `func`, with the `this` binding and arguments * of the created function, while it's called less than `n` times. Subsequent * calls to the created function return the result of the last `func` invocation. @@ -10838,25 +4907,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * jQuery(element).on('click', _.before(5, addContactToList)); * // => Allows adding up to 4 contacts to the list. - */ - function before(n, func) { - var result; - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - n = toInteger(n); - return function() { - if (--n > 0) { - result = func.apply(this, arguments); - } - if (n <= 1) { - func = undefined$1; - } - return result; - }; - } - - /** + */function before(n,func){var result;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}n=toInteger(n);return function(){if(--n>0){result=func.apply(this,arguments);}if(n<=1){func=undefined$1;}return result;};}/** * Creates a function that invokes `func` with the `this` binding of `thisArg` * and `partials` prepended to the arguments it receives. * @@ -10890,17 +4941,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var bound = _.bind(greet, object, _, '!'); * bound('hi'); * // => 'hi fred!' - */ - var bind = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(func, bitmask, thisArg, partials, holders); - }); - - /** + */var bind=baseRest(function(func,thisArg,partials){var bitmask=WRAP_BIND_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bind));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(func,bitmask,thisArg,partials,holders);});/** * Creates a function that invokes the method at `object[key]` with `partials` * prepended to the arguments it receives. * @@ -10944,17 +4985,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var bound = _.bindKey(object, 'greet', _, '!'); * bound('hi'); * // => 'hiya fred!' - */ - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); - }); - - /** + */var bindKey=baseRest(function(object,key,partials){var bitmask=WRAP_BIND_FLAG|WRAP_BIND_KEY_FLAG;if(partials.length){var holders=replaceHolders(partials,getHolder(bindKey));bitmask|=WRAP_PARTIAL_FLAG;}return createWrap(key,bitmask,object,partials,holders);});/** * Creates a function that accepts arguments of `func` and either invokes * `func` returning its result, if at least `arity` number of arguments have * been provided, or returns a function that accepts the remaining `func` @@ -10994,15 +5025,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Curried with placeholders. * curried(1)(_, 3)(2); * // => [1, 2, 3] - */ - function curry(func, arity, guard) { - arity = guard ? undefined$1 : arity; - var result = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity); - result.placeholder = curry.placeholder; - return result; - } - - /** + */function curry(func,arity,guard){arity=guard?undefined$1:arity;var result=createWrap(func,WRAP_CURRY_FLAG,undefined$1,undefined$1,undefined$1,undefined$1,undefined$1,arity);result.placeholder=curry.placeholder;return result;}/** * This method is like `_.curry` except that arguments are applied to `func` * in the manner of `_.partialRight` instead of `_.partial`. * @@ -11039,15 +5062,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Curried with placeholders. * curried(3)(1, _)(2); * // => [1, 2, 3] - */ - function curryRight(func, arity, guard) { - arity = guard ? undefined$1 : arity; - var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity); - result.placeholder = curryRight.placeholder; - return result; - } - - /** + */function curryRight(func,arity,guard){arity=guard?undefined$1:arity;var result=createWrap(func,WRAP_CURRY_RIGHT_FLAG,undefined$1,undefined$1,undefined$1,undefined$1,undefined$1,arity);result.placeholder=curryRight.placeholder;return result;}/** * Creates a debounced function that delays invoking `func` until after `wait` * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel @@ -11100,133 +5115,17 @@ var lodash = createCommonjsModule(function (module, exports) { * * // Cancel the trailing debounced invocation. * jQuery(window).on('popstate', debounced.cancel); - */ - function debounce(func, wait, options) { - var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject(options)) { - leading = !!options.leading; - maxing = 'maxWait' in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - - function invokeFunc(time) { - var args = lastArgs, - thisArg = lastThis; - - lastArgs = lastThis = undefined$1; - lastInvokeTime = time; - result = func.apply(thisArg, args); - return result; - } - - function leadingEdge(time) { - // Reset any `maxWait` timer. - lastInvokeTime = time; - // Start the timer for the trailing edge. - timerId = setTimeout(timerExpired, wait); - // Invoke the leading edge. - return leading ? invokeFunc(time) : result; - } - - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; - - return maxing - ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) - : timeWaiting; - } - - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; - - // Either this is the first call, activity has stopped and we're at the - // trailing edge, the system time has gone backwards and we're treating - // it as the trailing edge, or we've hit the `maxWait` limit. - return (lastCallTime === undefined$1 || (timeSinceLastCall >= wait) || - (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); - } - - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); - } - // Restart the timer. - timerId = setTimeout(timerExpired, remainingWait(time)); - } - - function trailingEdge(time) { - timerId = undefined$1; - - // Only invoke if we have `lastArgs` which means `func` has been - // debounced at least once. - if (trailing && lastArgs) { - return invokeFunc(time); - } - lastArgs = lastThis = undefined$1; - return result; - } - - function cancel() { - if (timerId !== undefined$1) { - clearTimeout(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined$1; - } - - function flush() { - return timerId === undefined$1 ? result : trailingEdge(now()); - } - - function debounced() { - var time = now(), - isInvoking = shouldInvoke(time); - - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - - if (isInvoking) { - if (timerId === undefined$1) { - return leadingEdge(lastCallTime); - } - if (maxing) { - // Handle invocations in a tight loop. - clearTimeout(timerId); - timerId = setTimeout(timerExpired, wait); - return invokeFunc(lastCallTime); - } - } - if (timerId === undefined$1) { - timerId = setTimeout(timerExpired, wait); - } - return result; - } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - - /** + */function debounce(func,wait,options){var lastArgs,lastThis,maxWait,result,timerId,lastCallTime,lastInvokeTime=0,leading=false,maxing=false,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}wait=toNumber(wait)||0;if(isObject(options)){leading=!!options.leading;maxing='maxWait'in options;maxWait=maxing?nativeMax(toNumber(options.maxWait)||0,wait):maxWait;trailing='trailing'in options?!!options.trailing:trailing;}function invokeFunc(time){var args=lastArgs,thisArg=lastThis;lastArgs=lastThis=undefined$1;lastInvokeTime=time;result=func.apply(thisArg,args);return result;}function leadingEdge(time){// Reset any `maxWait` timer. +lastInvokeTime=time;// Start the timer for the trailing edge. +timerId=setTimeout(timerExpired,wait);// Invoke the leading edge. +return leading?invokeFunc(time):result;}function remainingWait(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime,timeWaiting=wait-timeSinceLastCall;return maxing?nativeMin(timeWaiting,maxWait-timeSinceLastInvoke):timeWaiting;}function shouldInvoke(time){var timeSinceLastCall=time-lastCallTime,timeSinceLastInvoke=time-lastInvokeTime;// Either this is the first call, activity has stopped and we're at the +// trailing edge, the system time has gone backwards and we're treating +// it as the trailing edge, or we've hit the `maxWait` limit. +return lastCallTime===undefined$1||timeSinceLastCall>=wait||timeSinceLastCall<0||maxing&&timeSinceLastInvoke>=maxWait;}function timerExpired(){var time=now();if(shouldInvoke(time)){return trailingEdge(time);}// Restart the timer. +timerId=setTimeout(timerExpired,remainingWait(time));}function trailingEdge(time){timerId=undefined$1;// Only invoke if we have `lastArgs` which means `func` has been +// debounced at least once. +if(trailing&&lastArgs){return invokeFunc(time);}lastArgs=lastThis=undefined$1;return result;}function cancel(){if(timerId!==undefined$1){clearTimeout(timerId);}lastInvokeTime=0;lastArgs=lastCallTime=lastThis=timerId=undefined$1;}function flush(){return timerId===undefined$1?result:trailingEdge(now());}function debounced(){var time=now(),isInvoking=shouldInvoke(time);lastArgs=arguments;lastThis=this;lastCallTime=time;if(isInvoking){if(timerId===undefined$1){return leadingEdge(lastCallTime);}if(maxing){// Handle invocations in a tight loop. +clearTimeout(timerId);timerId=setTimeout(timerExpired,wait);return invokeFunc(lastCallTime);}}if(timerId===undefined$1){timerId=setTimeout(timerExpired,wait);}return result;}debounced.cancel=cancel;debounced.flush=flush;return debounced;}/** * Defers invoking the `func` until the current call stack has cleared. Any * additional arguments are provided to `func` when it's invoked. * @@ -11243,12 +5142,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(text); * }, 'deferred'); * // => Logs 'deferred' after one millisecond. - */ - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); - - /** + */var defer=baseRest(function(func,args){return baseDelay(func,1,args);});/** * Invokes `func` after `wait` milliseconds. Any additional arguments are * provided to `func` when it's invoked. * @@ -11266,12 +5160,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(text); * }, 1000, 'later'); * // => Logs 'later' after one second. - */ - var delay = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - - /** + */var delay=baseRest(function(func,wait,args){return baseDelay(func,toNumber(wait)||0,args);});/** * Creates a function that invokes `func` with arguments reversed. * * @static @@ -11288,12 +5177,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * flipped('a', 'b', 'c', 'd'); * // => ['d', 'c', 'b', 'a'] - */ - function flip(func) { - return createWrap(func, WRAP_FLIP_FLAG); - } - - /** + */function flip(func){return createWrap(func,WRAP_FLIP_FLAG);}/** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument @@ -11336,31 +5220,8 @@ var lodash = createCommonjsModule(function (module, exports) { * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; - */ - function memoize(func, resolver) { - if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { - throw new TypeError(FUNC_ERROR_TEXT); - } - var memoized = function() { - var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; - - if (cache.has(key)) { - return cache.get(key); - } - var result = func.apply(this, args); - memoized.cache = cache.set(key, result) || cache; - return result; - }; - memoized.cache = new (memoize.Cache || MapCache); - return memoized; - } - - // Expose `MapCache`. - memoize.Cache = MapCache; - - /** + */function memoize(func,resolver){if(typeof func!='function'||resolver!=null&&typeof resolver!='function'){throw new TypeError(FUNC_ERROR_TEXT);}var memoized=function(){var args=arguments,key=resolver?resolver.apply(this,args):args[0],cache=memoized.cache;if(cache.has(key)){return cache.get(key);}var result=func.apply(this,args);memoized.cache=cache.set(key,result)||cache;return result;};memoized.cache=new(memoize.Cache||MapCache)();return memoized;}// Expose `MapCache`. +memoize.Cache=MapCache;/** * Creates a function that negates the result of the predicate `func`. The * `func` predicate is invoked with the `this` binding and arguments of the * created function. @@ -11379,24 +5240,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); * // => [1, 3, 5] - */ - function negate(predicate) { - if (typeof predicate != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: return !predicate.call(this); - case 1: return !predicate.call(this, args[0]); - case 2: return !predicate.call(this, args[0], args[1]); - case 3: return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; - } - - /** + */function negate(predicate){if(typeof predicate!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return function(){var args=arguments;switch(args.length){case 0:return !predicate.call(this);case 1:return !predicate.call(this,args[0]);case 2:return !predicate.call(this,args[0],args[1]);case 3:return !predicate.call(this,args[0],args[1],args[2]);}return !predicate.apply(this,args);};}/** * Creates a function that is restricted to invoking `func` once. Repeat calls * to the function return the value of the first invocation. The `func` is * invoked with the `this` binding and arguments of the created function. @@ -11413,12 +5257,7 @@ var lodash = createCommonjsModule(function (module, exports) { * initialize(); * initialize(); * // => `createApplication` is invoked once - */ - function once(func) { - return before(2, func); - } - - /** + */function once(func){return before(2,func);}/** * Creates a function that invokes `func` with its arguments transformed. * * @static @@ -11448,25 +5287,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * func(10, 5); * // => [100, 10] - */ - var overArgs = castRest(function(func, transforms) { - transforms = (transforms.length == 1 && isArray(transforms[0])) - ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, - length = nativeMin(args.length, funcsLength); - - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); - }); - }); - - /** + */var overArgs=castRest(function(func,transforms){transforms=transforms.length==1&&isArray(transforms[0])?arrayMap(transforms[0],baseUnary(getIteratee())):arrayMap(baseFlatten(transforms,1),baseUnary(getIteratee()));var funcsLength=transforms.length;return baseRest(function(args){var index=-1,length=nativeMin(args.length,funcsLength);while(++index 'hi fred' - */ - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders); - }); - - /** + */var partial=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partial));return createWrap(func,WRAP_PARTIAL_FLAG,undefined$1,partials,holders);});/** * This method is like `_.partial` except that partially applied arguments * are appended to the arguments it receives. * @@ -11535,13 +5350,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var sayHelloTo = _.partialRight(greet, 'hello', _); * sayHelloTo('fred'); * // => 'hello fred' - */ - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders); - }); - - /** + */var partialRight=baseRest(function(func,partials){var holders=replaceHolders(partials,getHolder(partialRight));return createWrap(func,WRAP_PARTIAL_RIGHT_FLAG,undefined$1,partials,holders);});/** * Creates a function that invokes `func` with arguments arranged according * to the specified `indexes` where the argument value at the first index is * provided as the first argument, the argument value at the second index is @@ -11562,12 +5371,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] - */ - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes); - }); - - /** + */var rearg=flatRest(function(func,indexes){return createWrap(func,WRAP_REARG_FLAG,undefined$1,undefined$1,undefined$1,indexes);});/** * Creates a function that invokes `func` with the `this` binding of the * created function and arguments from `start` and beyond provided as * an array. @@ -11591,16 +5395,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * say('hello', 'fred', 'barney', 'pebbles'); * // => 'hello fred, barney, & pebbles' - */ - function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start === undefined$1 ? start : toInteger(start); - return baseRest(func, start); - } - - /** + */function rest(func,start){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}start=start===undefined$1?start:toInteger(start);return baseRest(func,start);}/** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). @@ -11633,24 +5428,7 @@ var lodash = createCommonjsModule(function (module, exports) { * return x + y; * })); * // => a Promise of 76 - */ - function spread(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { - var array = args[start], - otherArgs = castSlice(args, 0, start); - - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } - - /** + */function spread(func,start){if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}start=start==null?0:nativeMax(toInteger(start),0);return baseRest(function(args){var array=args[start],otherArgs=castSlice(args,0,start);if(array){arrayPush(otherArgs,array);}return apply(func,this,otherArgs);});}/** * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to @@ -11693,26 +5471,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * // Cancel the trailing throttled invocation. * jQuery(window).on('popstate', throttled.cancel); - */ - function throttle(func, wait, options) { - var leading = true, - trailing = true; - - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - if (isObject(options)) { - leading = 'leading' in options ? !!options.leading : leading; - trailing = 'trailing' in options ? !!options.trailing : trailing; - } - return debounce(func, wait, { - 'leading': leading, - 'maxWait': wait, - 'trailing': trailing - }); - } - - /** + */function throttle(func,wait,options){var leading=true,trailing=true;if(typeof func!='function'){throw new TypeError(FUNC_ERROR_TEXT);}if(isObject(options)){leading='leading'in options?!!options.leading:leading;trailing='trailing'in options?!!options.trailing:trailing;}return debounce(func,wait,{'leading':leading,'maxWait':wait,'trailing':trailing});}/** * Creates a function that accepts up to one argument, ignoring any * additional arguments. * @@ -11726,12 +5485,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.map(['6', '8', '10'], _.unary(parseInt)); * // => [6, 8, 10] - */ - function unary(func) { - return ary(func, 1); - } - - /** + */function unary(func){return ary(func,1);}/** * Creates a function that provides `value` to `wrapper` as its first * argument. Any additional arguments provided to the function are appended * to those provided to the `wrapper`. The wrapper is invoked with the `this` @@ -11752,14 +5506,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * p('fred, barney, & pebbles'); * // => '

fred, barney, & pebbles

' - */ - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); - } - - /*------------------------------------------------------------------------*/ - - /** + */function wrap(value,wrapper){return partial(castFunction(wrapper),value);}/*------------------------------------------------------------------------*/ /** * Casts `value` as an array if it's not one. * * @static @@ -11791,16 +5538,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var array = [1, 2, 3]; * console.log(_.castArray(array) === array); * // => true - */ - function castArray() { - if (!arguments.length) { - return []; - } - var value = arguments[0]; - return isArray(value) ? value : [value]; - } - - /** + */function castArray(){if(!arguments.length){return [];}var value=arguments[0];return isArray(value)?value:[value];}/** * Creates a shallow clone of `value`. * * **Note:** This method is loosely based on the @@ -11825,12 +5563,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var shallow = _.clone(objects); * console.log(shallow[0] === objects[0]); * // => true - */ - function clone(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); - } - - /** + */function clone(value){return baseClone(value,CLONE_SYMBOLS_FLAG);}/** * This method is like `_.clone` except that it accepts `customizer` which * is invoked to produce the cloned value. If `customizer` returns `undefined`, * cloning is handled by the method instead. The `customizer` is invoked with @@ -11860,13 +5593,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // => 'BODY' * console.log(el.childNodes.length); * // => 0 - */ - function cloneWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined$1; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); - } - - /** + */function cloneWith(value,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;return baseClone(value,CLONE_SYMBOLS_FLAG,customizer);}/** * This method is like `_.clone` except that it recursively clones `value`. * * @static @@ -11883,12 +5610,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var deep = _.cloneDeep(objects); * console.log(deep[0] === objects[0]); * // => false - */ - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - - /** + */function cloneDeep(value){return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG);}/** * This method is like `_.cloneWith` except that it recursively clones `value`. * * @static @@ -11915,13 +5637,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // => 'BODY' * console.log(el.childNodes.length); * // => 20 - */ - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined$1; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } - - /** + */function cloneDeepWith(value,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;return baseClone(value,CLONE_DEEP_FLAG|CLONE_SYMBOLS_FLAG,customizer);}/** * Checks if `object` conforms to `source` by invoking the predicate * properties of `source` with the corresponding property values of `object`. * @@ -11944,12 +5660,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); * // => false - */ - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); - } - - /** + */function conformsTo(object,source){return source==null||baseConformsTo(object,source,keys(source));}/** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. @@ -11980,12 +5691,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.eq(NaN, NaN); * // => true - */ - function eq(value, other) { - return value === other || (value !== value && other !== other); - } - - /** + */function eq(value,other){return value===other||value!==value&&other!==other;}/** * Checks if `value` is greater than `other`. * * @static @@ -12007,10 +5713,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.gt(1, 3); * // => false - */ - var gt = createRelationalOperation(baseGt); - - /** + */var gt=createRelationalOperation(baseGt);/** * Checks if `value` is greater than or equal to `other`. * * @static @@ -12032,12 +5735,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.gte(1, 3); * // => false - */ - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); - - /** + */var gte=createRelationalOperation(function(value,other){return value>=other;});/** * Checks if `value` is likely an `arguments` object. * * @static @@ -12054,13 +5752,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isArguments([1, 2, 3]); * // => false - */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && - !propertyIsEnumerable.call(value, 'callee'); - }; - - /** + */var isArguments=baseIsArguments(function(){return arguments;}())?baseIsArguments:function(value){return isObjectLike(value)&&hasOwnProperty.call(value,'callee')&&!propertyIsEnumerable.call(value,'callee');};/** * Checks if `value` is classified as an `Array` object. * * @static @@ -12082,10 +5774,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isArray(_.noop); * // => false - */ - var isArray = Array.isArray; - - /** + */var isArray=Array.isArray;/** * Checks if `value` is classified as an `ArrayBuffer` object. * * @static @@ -12101,10 +5790,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isArrayBuffer(new Array(2)); * // => false - */ - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; - - /** + */var isArrayBuffer=nodeIsArrayBuffer?baseUnary(nodeIsArrayBuffer):baseIsArrayBuffer;/** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. @@ -12128,12 +5814,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isArrayLike(_.noop); * // => false - */ - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - - /** + */function isArrayLike(value){return value!=null&&isLength(value.length)&&!isFunction(value);}/** * This method is like `_.isArrayLike` except that it also checks if `value` * is an object. * @@ -12157,12 +5838,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isArrayLikeObject(_.noop); * // => false - */ - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - - /** + */function isArrayLikeObject(value){return isObjectLike(value)&&isArrayLike(value);}/** * Checks if `value` is classified as a boolean primitive or object. * * @static @@ -12178,13 +5854,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isBoolean(null); * // => false - */ - function isBoolean(value) { - return value === true || value === false || - (isObjectLike(value) && baseGetTag(value) == boolTag); - } - - /** + */function isBoolean(value){return value===true||value===false||isObjectLike(value)&&baseGetTag(value)==boolTag;}/** * Checks if `value` is a buffer. * * @static @@ -12200,10 +5870,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isBuffer(new Uint8Array(2)); * // => false - */ - var isBuffer = nativeIsBuffer || stubFalse; - - /** + */var isBuffer=nativeIsBuffer||stubFalse;/** * Checks if `value` is classified as a `Date` object. * * @static @@ -12219,10 +5886,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isDate('Mon April 23 2012'); * // => false - */ - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; - - /** + */var isDate=nodeIsDate?baseUnary(nodeIsDate):baseIsDate;/** * Checks if `value` is likely a DOM element. * * @static @@ -12238,12 +5902,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isElement(''); * // => false - */ - function isElement(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); - } - - /** + */function isElement(value){return isObjectLike(value)&&value.nodeType===1&&!isPlainObject(value);}/** * Checks if `value` is an empty object, collection, map, or set. * * Objects are considered empty if they have no own enumerable string keyed @@ -12275,32 +5934,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isEmpty({ 'a': 1 }); * // => false - */ - function isEmpty(value) { - if (value == null) { - return true; - } - if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; - } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty.call(value, key)) { - return false; - } - } - return true; - } - - /** + */function isEmpty(value){if(value==null){return true;}if(isArrayLike(value)&&(isArray(value)||typeof value=='string'||typeof value.splice=='function'||isBuffer(value)||isTypedArray(value)||isArguments(value))){return !value.length;}var tag=getTag(value);if(tag==mapTag||tag==setTag){return !value.size;}if(isPrototype(value)){return !baseKeys(value).length;}for(var key in value){if(hasOwnProperty.call(value,key)){return false;}}return true;}/** * Performs a deep comparison between two values to determine if they are * equivalent. * @@ -12327,12 +5961,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * object === other; * // => false - */ - function isEqual(value, other) { - return baseIsEqual(value, other); - } - - /** + */function isEqual(value,other){return baseIsEqual(value,other);}/** * This method is like `_.isEqual` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with up to @@ -12363,14 +5992,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isEqualWith(array, other, customizer); * // => true - */ - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined$1; - var result = customizer ? customizer(value, other) : undefined$1; - return result === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result; - } - - /** + */function isEqualWith(value,other,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;var result=customizer?customizer(value,other):undefined$1;return result===undefined$1?baseIsEqual(value,other,undefined$1,customizer):!!result;}/** * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, * `SyntaxError`, `TypeError`, or `URIError` object. * @@ -12387,17 +6009,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isError(Error); * // => false - */ - function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || - (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); - } - - /** + */function isError(value){if(!isObjectLike(value)){return false;}var tag=baseGetTag(value);return tag==errorTag||tag==domExcTag||typeof value.message=='string'&&typeof value.name=='string'&&!isPlainObject(value);}/** * Checks if `value` is a finite primitive number. * * **Note:** This method is based on @@ -12422,12 +6034,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isFinite('3'); * // => false - */ - function isFinite(value) { - return typeof value == 'number' && nativeIsFinite(value); - } - - /** + */function isFinite(value){return typeof value=='number'&&nativeIsFinite(value);}/** * Checks if `value` is classified as a `Function` object. * * @static @@ -12443,18 +6050,9 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isFunction(/abc/); * // => false - */ - function isFunction(value) { - if (!isObject(value)) { - return false; - } - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 9 which returns 'object' for typed arrays and other constructors. - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - - /** + */function isFunction(value){if(!isObject(value)){return false;}// The use of `Object#toString` avoids issues with the `typeof` operator +// in Safari 9 which returns 'object' for typed arrays and other constructors. +var tag=baseGetTag(value);return tag==funcTag||tag==genTag||tag==asyncTag||tag==proxyTag;}/** * Checks if `value` is an integer. * * **Note:** This method is based on @@ -12479,12 +6077,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isInteger('3'); * // => false - */ - function isInteger(value) { - return typeof value == 'number' && value == toInteger(value); - } - - /** + */function isInteger(value){return typeof value=='number'&&value==toInteger(value);}/** * Checks if `value` is a valid array-like length. * * **Note:** This method is loosely based on @@ -12509,13 +6102,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isLength('3'); * // => false - */ - function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - - /** + */function isLength(value){return typeof value=='number'&&value>-1&&value%1==0&&value<=MAX_SAFE_INTEGER;}/** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) @@ -12539,13 +6126,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isObject(null); * // => false - */ - function isObject(value) { - var type = typeof value; - return value != null && (type == 'object' || type == 'function'); - } - - /** + */function isObject(value){var type=typeof value;return value!=null&&(type=='object'||type=='function');}/** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * @@ -12568,12 +6149,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isObjectLike(null); * // => false - */ - function isObjectLike(value) { - return value != null && typeof value == 'object'; - } - - /** + */function isObjectLike(value){return value!=null&&typeof value=='object';}/** * Checks if `value` is classified as a `Map` object. * * @static @@ -12589,10 +6165,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isMap(new WeakMap); * // => false - */ - var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - - /** + */var isMap=nodeIsMap?baseUnary(nodeIsMap):baseIsMap;/** * Performs a partial deep comparison between `object` and `source` to * determine if `object` contains equivalent property values. * @@ -12619,12 +6192,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isMatch(object, { 'b': 1 }); * // => false - */ - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } - - /** + */function isMatch(object,source){return object===source||baseIsMatch(object,source,getMatchData(source));}/** * This method is like `_.isMatch` except that it accepts `customizer` which * is invoked to compare values. If `customizer` returns `undefined`, comparisons * are handled by the method instead. The `customizer` is invoked with five @@ -12655,13 +6223,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isMatchWith(object, source, customizer); * // => true - */ - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined$1; - return baseIsMatch(object, source, getMatchData(source), customizer); - } - - /** + */function isMatchWith(object,source,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;return baseIsMatch(object,source,getMatchData(source),customizer);}/** * Checks if `value` is `NaN`. * * **Note:** This method is based on @@ -12688,15 +6250,10 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isNaN(undefined); * // => false - */ - function isNaN(value) { - // An `NaN` primitive is the only value that is not equal to itself. - // Perform the `toStringTag` check first to avoid errors with some - // ActiveX objects in IE. - return isNumber(value) && value != +value; - } - - /** + */function isNaN(value){// An `NaN` primitive is the only value that is not equal to itself. +// Perform the `toStringTag` check first to avoid errors with some +// ActiveX objects in IE. +return isNumber(value)&&value!=+value;}/** * Checks if `value` is a pristine native function. * * **Note:** This method can't reliably detect native functions in the presence @@ -12721,15 +6278,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isNative(_); * // => false - */ - function isNative(value) { - if (isMaskable(value)) { - throw new Error(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } - - /** + */function isNative(value){if(isMaskable(value)){throw new Error(CORE_ERROR_TEXT);}return baseIsNative(value);}/** * Checks if `value` is `null`. * * @static @@ -12745,12 +6294,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isNull(void 0); * // => false - */ - function isNull(value) { - return value === null; - } - - /** + */function isNull(value){return value===null;}/** * Checks if `value` is `null` or `undefined`. * * @static @@ -12769,12 +6313,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isNil(NaN); * // => false - */ - function isNil(value) { - return value == null; - } - - /** + */function isNil(value){return value==null;}/** * Checks if `value` is classified as a `Number` primitive or object. * * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are @@ -12799,13 +6338,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isNumber('3'); * // => false - */ - function isNumber(value) { - return typeof value == 'number' || - (isObjectLike(value) && baseGetTag(value) == numberTag); - } - - /** + */function isNumber(value){return typeof value=='number'||isObjectLike(value)&&baseGetTag(value)==numberTag;}/** * Checks if `value` is a plain object, that is, an object created by the * `Object` constructor or one with a `[[Prototype]]` of `null`. * @@ -12832,21 +6365,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isPlainObject(Object.create(null)); * // => true - */ - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; - return typeof Ctor == 'function' && Ctor instanceof Ctor && - funcToString.call(Ctor) == objectCtorString; - } - - /** + */function isPlainObject(value){if(!isObjectLike(value)||baseGetTag(value)!=objectTag){return false;}var proto=getPrototype(value);if(proto===null){return true;}var Ctor=hasOwnProperty.call(proto,'constructor')&&proto.constructor;return typeof Ctor=='function'&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString;}/** * Checks if `value` is classified as a `RegExp` object. * * @static @@ -12862,10 +6381,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isRegExp('/abc/'); * // => false - */ - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - - /** + */var isRegExp=nodeIsRegExp?baseUnary(nodeIsRegExp):baseIsRegExp;/** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 * double precision number which isn't the result of a rounded unsafe integer. * @@ -12891,12 +6407,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isSafeInteger('3'); * // => false - */ - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } - - /** + */function isSafeInteger(value){return isInteger(value)&&value>=-MAX_SAFE_INTEGER&&value<=MAX_SAFE_INTEGER;}/** * Checks if `value` is classified as a `Set` object. * * @static @@ -12912,10 +6423,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isSet(new WeakSet); * // => false - */ - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - - /** + */var isSet=nodeIsSet?baseUnary(nodeIsSet):baseIsSet;/** * Checks if `value` is classified as a `String` primitive or object. * * @static @@ -12931,13 +6439,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isString(1); * // => false - */ - function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); - } - - /** + */function isString(value){return typeof value=='string'||!isArray(value)&&isObjectLike(value)&&baseGetTag(value)==stringTag;}/** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static @@ -12953,13 +6455,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isSymbol('abc'); * // => false - */ - function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && baseGetTag(value) == symbolTag); - } - - /** + */function isSymbol(value){return typeof value=='symbol'||isObjectLike(value)&&baseGetTag(value)==symbolTag;}/** * Checks if `value` is classified as a typed array. * * @static @@ -12975,10 +6471,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isTypedArray([]); * // => false - */ - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - - /** + */var isTypedArray=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray;/** * Checks if `value` is `undefined`. * * @static @@ -12994,12 +6487,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isUndefined(null); * // => false - */ - function isUndefined(value) { - return value === undefined$1; - } - - /** + */function isUndefined(value){return value===undefined$1;}/** * Checks if `value` is classified as a `WeakMap` object. * * @static @@ -13015,12 +6503,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isWeakMap(new Map); * // => false - */ - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; - } - - /** + */function isWeakMap(value){return isObjectLike(value)&&getTag(value)==weakMapTag;}/** * Checks if `value` is classified as a `WeakSet` object. * * @static @@ -13036,12 +6519,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.isWeakSet(new Set); * // => false - */ - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; - } - - /** + */function isWeakSet(value){return isObjectLike(value)&&baseGetTag(value)==weakSetTag;}/** * Checks if `value` is less than `other`. * * @static @@ -13063,10 +6541,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.lt(3, 1); * // => false - */ - var lt = createRelationalOperation(baseLt); - - /** + */var lt=createRelationalOperation(baseLt);/** * Checks if `value` is less than or equal to `other`. * * @static @@ -13088,12 +6563,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.lte(3, 1); * // => false - */ - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); - - /** + */var lte=createRelationalOperation(function(value,other){return value<=other;});/** * Converts `value` to an array. * * @static @@ -13115,24 +6585,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toArray(null); * // => [] - */ - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); - - return func(value); - } - - /** + */function toArray(value){if(!value){return [];}if(isArrayLike(value)){return isString(value)?stringToArray(value):copyArray(value);}if(symIterator&&value[symIterator]){return iteratorToArray(value[symIterator]());}var tag=getTag(value),func=tag==mapTag?mapToArray:tag==setTag?setToArray:values;return func(value);}/** * Converts `value` to a finite number. * * @static @@ -13154,20 +6607,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toFinite('3.2'); * // => 3.2 - */ - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - - /** + */function toFinite(value){if(!value){return value===0?value:0;}value=toNumber(value);if(value===INFINITY||value===-INFINITY){var sign=value<0?-1:1;return sign*MAX_INTEGER;}return value===value?value:0;}/** * Converts `value` to an integer. * * **Note:** This method is loosely based on @@ -13192,15 +6632,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toInteger('3.2'); * // => 3 - */ - function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; - } - - /** + */function toInteger(value){var result=toFinite(value),remainder=result%1;return result===result?remainder?result-remainder:result:0;}/** * Converts `value` to an integer suitable for use as the length of an * array-like object. * @@ -13226,12 +6658,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toLength('3.2'); * // => 3 - */ - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - - /** + */function toLength(value){return value?baseClamp(toInteger(value),0,MAX_ARRAY_LENGTH):0;}/** * Converts `value` to a number. * * @static @@ -13253,29 +6680,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toNumber('3.2'); * // => 3.2 - */ - function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = typeof value.valueOf == 'function' ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = baseTrim(value); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); - } - - /** + */function toNumber(value){if(typeof value=='number'){return value;}if(isSymbol(value)){return NAN;}if(isObject(value)){var other=typeof value.valueOf=='function'?value.valueOf():value;value=isObject(other)?other+'':other;}if(typeof value!='string'){return value===0?value:+value;}value=baseTrim(value);var isBinary=reIsBinary.test(value);return isBinary||reIsOctal.test(value)?freeParseInt(value.slice(2),isBinary?2:8):reIsBadHex.test(value)?NAN:+value;}/** * Converts `value` to a plain object flattening inherited enumerable string * keyed properties of `value` to own properties of the plain object. * @@ -13298,12 +6703,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); * // => { 'a': 1, 'b': 2, 'c': 3 } - */ - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - - /** + */function toPlainObject(value){return copyObject(value,keysIn(value));}/** * Converts `value` to a safe integer. A safe integer can be compared and * represented correctly. * @@ -13326,14 +6726,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toSafeInteger('3.2'); * // => 3 - */ - function toSafeInteger(value) { - return value - ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) - : (value === 0 ? value : 0); - } - - /** + */function toSafeInteger(value){return value?baseClamp(toInteger(value),-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER):value===0?value:0;}/** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * @@ -13353,14 +6746,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toString([1, 2, 3]); * // => '1,2,3' - */ - function toString(value) { - return value == null ? '' : baseToString(value); - } - - /*------------------------------------------------------------------------*/ - - /** + */function toString(value){return value==null?'':baseToString(value);}/*------------------------------------------------------------------------*/ /** * Assigns own enumerable string keyed properties of source objects to the * destination object. Source objects are applied from left to right. * Subsequent sources overwrite property assignments of previous sources. @@ -13391,20 +6777,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } - */ - var assign = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); - return; - } - for (var key in source) { - if (hasOwnProperty.call(source, key)) { - assignValue(object, key, source[key]); - } - } - }); - - /** + */var assign=createAssigner(function(object,source){if(isPrototype(source)||isArrayLike(source)){copyObject(source,keys(source),object);return;}for(var key in source){if(hasOwnProperty.call(source,key)){assignValue(object,key,source[key]);}}});/** * This method is like `_.assign` except that it iterates over own and * inherited source properties. * @@ -13434,12 +6807,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } - */ - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - - /** + */var assignIn=createAssigner(function(object,source){copyObject(source,keysIn(source),object);});/** * This method is like `_.assignIn` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` @@ -13467,12 +6835,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } - */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - - /** + */var assignInWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keysIn(source),object,customizer);});/** * This method is like `_.assign` except that it accepts `customizer` * which is invoked to produce the assigned values. If `customizer` returns * `undefined`, assignment is handled by the method instead. The `customizer` @@ -13499,12 +6862,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } - */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); - }); - - /** + */var assignWith=createAssigner(function(object,source,srcIndex,customizer){copyObject(source,keys(source),object,customizer);});/** * Creates an array of values corresponding to `paths` of `object`. * * @static @@ -13520,10 +6878,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] - */ - var at = flatRest(baseAt); - - /** + */var at=flatRest(baseAt);/** * Creates an object that inherits from the `prototype` object. If a * `properties` object is given, its own enumerable string keyed properties * are assigned to the created object. @@ -13556,13 +6911,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * circle instanceof Shape; * // => true - */ - function create(prototype, properties) { - var result = baseCreate(prototype); - return properties == null ? result : baseAssign(result, properties); - } - - /** + */function create(prototype,properties){var result=baseCreate(prototype);return properties==null?result:baseAssign(result,properties);}/** * Assigns own and inherited enumerable string keyed properties of source * objects to the destination object for all destination properties that * resolve to `undefined`. Source objects are applied from left to right. @@ -13582,39 +6931,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } - */ - var defaults = baseRest(function(object, sources) { - object = Object(object); - - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined$1; - - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - - if (value === undefined$1 || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { - object[key] = source[key]; - } - } - } - - return object; - }); - - /** + */var defaults=baseRest(function(object,sources){object=Object(object);var index=-1;var length=sources.length;var guard=length>2?sources[2]:undefined$1;if(guard&&isIterateeCall(sources[0],sources[1],guard)){length=1;}while(++index { 'a': { 'b': 2, 'c': 3 } } - */ - var defaultsDeep = baseRest(function(args) { - args.push(undefined$1, customDefaultsMerge); - return apply(mergeWith, undefined$1, args); - }); - - /** + */var defaultsDeep=baseRest(function(args){args.push(undefined$1,customDefaultsMerge);return apply(mergeWith,undefined$1,args);});/** * This method is like `_.find` except that it returns the key of the first * element `predicate` returns truthy for instead of the element itself. * @@ -13672,12 +6983,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.findKey(users, 'active'); * // => 'barney' - */ - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } - - /** + */function findKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwn);}/** * This method is like `_.findKey` except that it iterates over elements of * a collection in the opposite order. * @@ -13711,12 +7017,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.findLastKey(users, 'active'); * // => 'pebbles' - */ - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); - } - - /** + */function findLastKey(object,predicate){return baseFindKey(object,getIteratee(predicate,3),baseForOwnRight);}/** * Iterates over own and inherited enumerable string keyed properties of an * object and invokes `iteratee` for each property. The iteratee is invoked * with three arguments: (value, key, object). Iteratee functions may exit @@ -13743,14 +7044,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(key); * }); * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). - */ - function forIn(object, iteratee) { - return object == null - ? object - : baseFor(object, getIteratee(iteratee, 3), keysIn); - } - - /** + */function forIn(object,iteratee){return object==null?object:baseFor(object,getIteratee(iteratee,3),keysIn);}/** * This method is like `_.forIn` except that it iterates over properties of * `object` in the opposite order. * @@ -13775,14 +7069,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(key); * }); * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. - */ - function forInRight(object, iteratee) { - return object == null - ? object - : baseForRight(object, getIteratee(iteratee, 3), keysIn); - } - - /** + */function forInRight(object,iteratee){return object==null?object:baseForRight(object,getIteratee(iteratee,3),keysIn);}/** * Iterates over own enumerable string keyed properties of an object and * invokes `iteratee` for each property. The iteratee is invoked with three * arguments: (value, key, object). Iteratee functions may exit iteration @@ -13809,12 +7096,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(key); * }); * // => Logs 'a' then 'b' (iteration order is not guaranteed). - */ - function forOwn(object, iteratee) { - return object && baseForOwn(object, getIteratee(iteratee, 3)); - } - - /** + */function forOwn(object,iteratee){return object&&baseForOwn(object,getIteratee(iteratee,3));}/** * This method is like `_.forOwn` except that it iterates over properties of * `object` in the opposite order. * @@ -13839,12 +7121,7 @@ var lodash = createCommonjsModule(function (module, exports) { * console.log(key); * }); * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. - */ - function forOwnRight(object, iteratee) { - return object && baseForOwnRight(object, getIteratee(iteratee, 3)); - } - - /** + */function forOwnRight(object,iteratee){return object&&baseForOwnRight(object,getIteratee(iteratee,3));}/** * Creates an array of function property names from own enumerable properties * of `object`. * @@ -13866,12 +7143,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.functions(new Foo); * // => ['a', 'b'] - */ - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } - - /** + */function functions(object){return object==null?[]:baseFunctions(object,keys(object));}/** * Creates an array of function property names from own and inherited * enumerable properties of `object`. * @@ -13893,12 +7165,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.functionsIn(new Foo); * // => ['a', 'b', 'c'] - */ - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } - - /** + */function functionsIn(object){return object==null?[]:baseFunctions(object,keysIn(object));}/** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * @@ -13922,13 +7189,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.get(object, 'a.b.c', 'default'); * // => 'default' - */ - function get(object, path, defaultValue) { - var result = object == null ? undefined$1 : baseGet(object, path); - return result === undefined$1 ? defaultValue : result; - } - - /** + */function get(object,path,defaultValue){var result=object==null?undefined$1:baseGet(object,path);return result===undefined$1?defaultValue:result;}/** * Checks if `path` is a direct property of `object`. * * @static @@ -13954,12 +7215,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.has(other, 'a'); * // => false - */ - function has(object, path) { - return object != null && hasPath(object, path, baseHas); - } - - /** + */function has(object,path){return object!=null&&hasPath(object,path,baseHas);}/** * Checks if `path` is a direct or inherited property of `object`. * * @static @@ -13984,12 +7240,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.hasIn(object, 'b'); * // => false - */ - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } - - /** + */function hasIn(object,path){return object!=null&&hasPath(object,path,baseHasIn);}/** * Creates an object composed of the inverted keys and values of `object`. * If `object` contains duplicate values, subsequent values overwrite * property assignments of previous values. @@ -14006,17 +7257,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.invert(object); * // => { '1': 'c', '2': 'b' } - */ - var invert = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - result[value] = key; - }, constant(identity)); - - /** + */var invert=createInverter(function(result,value,key){if(value!=null&&typeof value.toString!='function'){value=nativeObjectToString.call(value);}result[value]=key;},constant(identity));/** * This method is like `_.invert` except that the inverted object is generated * from the results of running each element of `object` thru `iteratee`. The * corresponding inverted value of each inverted key is an array of keys @@ -14041,21 +7282,7 @@ var lodash = createCommonjsModule(function (module, exports) { * return 'group' + value; * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } - */ - var invertBy = createInverter(function(result, value, key) { - if (value != null && - typeof value.toString != 'function') { - value = nativeObjectToString.call(value); - } - - if (hasOwnProperty.call(result, value)) { - result[value].push(key); - } else { - result[value] = [key]; - } - }, getIteratee); - - /** + */var invertBy=createInverter(function(result,value,key){if(value!=null&&typeof value.toString!='function'){value=nativeObjectToString.call(value);}if(hasOwnProperty.call(result,value)){result[value].push(key);}else {result[value]=[key];}},getIteratee);/** * Invokes the method at `path` of `object`. * * @static @@ -14072,10 +7299,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] - */ - var invoke = baseRest(baseInvoke); - - /** + */var invoke=baseRest(baseInvoke);/** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the @@ -14102,12 +7326,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.keys('hi'); * // => ['0', '1'] - */ - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - - /** + */function keys(object){return isArrayLike(object)?arrayLikeKeys(object):baseKeys(object);}/** * Creates an array of the own and inherited enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. @@ -14129,12 +7348,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.keysIn(new Foo); * // => ['a', 'b', 'c'] (iteration order is not guaranteed) - */ - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - - /** + */function keysIn(object){return isArrayLike(object)?arrayLikeKeys(object,true):baseKeysIn(object);}/** * The opposite of `_.mapValues`; this method creates an object with the * same values as `object` and keys generated by running each own enumerable * string keyed property of `object` thru `iteratee`. The iteratee is invoked @@ -14154,18 +7368,7 @@ var lodash = createCommonjsModule(function (module, exports) { * return key + value; * }); * // => { 'a1': 1, 'b2': 2 } - */ - function mapKeys(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, iteratee(value, key, object), value); - }); - return result; - } - - /** + */function mapKeys(object,iteratee){var result={};iteratee=getIteratee(iteratee,3);baseForOwn(object,function(value,key,object){baseAssignValue(result,iteratee(value,key,object),value);});return result;}/** * Creates an object with the same keys as `object` and values generated * by running each own enumerable string keyed property of `object` thru * `iteratee`. The iteratee is invoked with three arguments: @@ -14192,18 +7395,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.mapValues(users, 'age'); * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) - */ - function mapValues(object, iteratee) { - var result = {}; - iteratee = getIteratee(iteratee, 3); - - baseForOwn(object, function(value, key, object) { - baseAssignValue(result, key, iteratee(value, key, object)); - }); - return result; - } - - /** + */function mapValues(object,iteratee){var result={};iteratee=getIteratee(iteratee,3);baseForOwn(object,function(value,key,object){baseAssignValue(result,key,iteratee(value,key,object));});return result;}/** * This method is like `_.assign` except that it recursively merges own and * inherited enumerable string keyed properties of source objects into the * destination object. Source properties that resolve to `undefined` are @@ -14233,12 +7425,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } - */ - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - - /** + */var merge=createAssigner(function(object,source,srcIndex){baseMerge(object,source,srcIndex);});/** * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the @@ -14268,12 +7455,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } - */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); - - /** + */var mergeWith=createAssigner(function(object,source,srcIndex,customizer){baseMerge(object,source,srcIndex,customizer);});/** * The opposite of `_.pick`; this method creates an object composed of the * own and inherited enumerable property paths of `object` that are not omitted. * @@ -14292,30 +7474,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.omit(object, ['a', 'c']); * // => { 'b': '2' } - */ - var omit = flatRest(function(object, paths) { - var result = {}; - if (object == null) { - return result; - } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result); - if (isDeep) { - result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); - } - var length = paths.length; - while (length--) { - baseUnset(result, paths[length]); - } - return result; - }); - - /** + */var omit=flatRest(function(object,paths){var result={};if(object==null){return result;}var isDeep=false;paths=arrayMap(paths,function(path){path=castPath(path,object);isDeep||(isDeep=path.length>1);return path;});copyObject(object,getAllKeysIn(object),result);if(isDeep){result=baseClone(result,CLONE_DEEP_FLAG|CLONE_FLAT_FLAG|CLONE_SYMBOLS_FLAG,customOmitClone);}var length=paths.length;while(length--){baseUnset(result,paths[length]);}return result;});/** * The opposite of `_.pickBy`; this method creates an object composed of * the own and inherited enumerable string keyed properties of `object` that * `predicate` doesn't return truthy for. The predicate is invoked with two @@ -14334,12 +7493,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.omitBy(object, _.isNumber); * // => { 'b': '2' } - */ - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); - } - - /** + */function omitBy(object,predicate){return pickBy(object,negate(getIteratee(predicate)));}/** * Creates an object composed of the picked `object` properties. * * @static @@ -14355,12 +7509,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } - */ - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); - - /** + */var pick=flatRest(function(object,paths){return object==null?{}:basePick(object,paths);});/** * Creates an object composed of the `object` properties `predicate` returns * truthy for. The predicate is invoked with two arguments: (value, key). * @@ -14377,21 +7526,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.pickBy(object, _.isNumber); * // => { 'a': 1, 'c': 3 } - */ - function pickBy(object, predicate) { - if (object == null) { - return {}; - } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; - }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); - }); - } - - /** + */function pickBy(object,predicate){if(object==null){return {};}var props=arrayMap(getAllKeysIn(object),function(prop){return [prop];});predicate=getIteratee(predicate);return basePickBy(object,props,function(value,path){return predicate(value,path[0]);});}/** * This method is like `_.get` except that if the resolved value is a * function it's invoked with the `this` binding of its parent object and * its result is returned. @@ -14419,30 +7554,8 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.result(object, 'a[0].b.c3', _.constant('default')); * // => 'default' - */ - function result(object, path, defaultValue) { - path = castPath(path, object); - - var index = -1, - length = path.length; - - // Ensure the loop is entered when path is empty. - if (!length) { - length = 1; - object = undefined$1; - } - while (++index < length) { - var value = object == null ? undefined$1 : object[toKey(path[index])]; - if (value === undefined$1) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } - - /** + */function result(object,path,defaultValue){path=castPath(path,object);var index=-1,length=path.length;// Ensure the loop is entered when path is empty. +if(!length){length=1;object=undefined$1;}while(++index 5 - */ - function set(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } - - /** + */function set(object,path,value){return object==null?object:baseSet(object,path,value);}/** * This method is like `_.set` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked @@ -14497,13 +7605,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.setWith(object, '[0][1]', 'a', Object); * // => { '0': { '1': 'a' } } - */ - function setWith(object, path, value, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined$1; - return object == null ? object : baseSet(object, path, value, customizer); - } - - /** + */function setWith(object,path,value,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;return object==null?object:baseSet(object,path,value,customizer);}/** * Creates an array of own enumerable string keyed-value pairs for `object` * which can be consumed by `_.fromPairs`. If `object` is a map or set, its * entries are returned. @@ -14526,10 +7628,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toPairs(new Foo); * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) - */ - var toPairs = createToPairs(keys); - - /** + */var toPairs=createToPairs(keys);/** * Creates an array of own and inherited enumerable string keyed-value pairs * for `object` which can be consumed by `_.fromPairs`. If `object` is a map * or set, its entries are returned. @@ -14552,10 +7651,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toPairsIn(new Foo); * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) - */ - var toPairsIn = createToPairs(keysIn); - - /** + */var toPairsIn=createToPairs(keysIn);/** * An alternative to `_.reduce`; this method transforms `object` to a new * `accumulator` object which is the result of running each of its own * enumerable string keyed properties thru `iteratee`, with each invocation @@ -14584,31 +7680,7 @@ var lodash = createCommonjsModule(function (module, exports) { * (result[value] || (result[value] = [])).push(key); * }, {}); * // => { '1': ['a', 'c'], '2': ['b'] } - */ - function transform(object, iteratee, accumulator) { - var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); - - iteratee = getIteratee(iteratee, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor : []; - } - else if (isObject(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { - return iteratee(accumulator, value, index, object); - }); - return accumulator; - } - - /** + */function transform(object,iteratee,accumulator){var isArr=isArray(object),isArrLike=isArr||isBuffer(object)||isTypedArray(object);iteratee=getIteratee(iteratee,4);if(accumulator==null){var Ctor=object&&object.constructor;if(isArrLike){accumulator=isArr?new Ctor():[];}else if(isObject(object)){accumulator=isFunction(Ctor)?baseCreate(getPrototype(object)):{};}else {accumulator={};}}(isArrLike?arrayEach:baseForOwn)(object,function(value,index,object){return iteratee(accumulator,value,index,object);});return accumulator;}/** * Removes the property at `path` of `object`. * * **Note:** This method mutates `object`. @@ -14634,12 +7706,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(object); * // => { 'a': [{ 'b': {} }] }; - */ - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } - - /** + */function unset(object,path){return object==null?true:baseUnset(object,path);}/** * This method is like `_.set` except that accepts `updater` to produce the * value to set. Use `_.updateWith` to customize `path` creation. The `updater` * is invoked with one argument: (value). @@ -14665,12 +7732,7 @@ var lodash = createCommonjsModule(function (module, exports) { * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); * console.log(object.x[0].y.z); * // => 0 - */ - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } - - /** + */function update(object,path,updater){return object==null?object:baseUpdate(object,path,castFunction(updater));}/** * This method is like `_.update` except that it accepts `customizer` which is * invoked to produce the objects of `path`. If `customizer` returns `undefined` * path creation is handled by the method instead. The `customizer` is invoked @@ -14693,13 +7755,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.updateWith(object, '[0][1]', _.constant('a'), Object); * // => { '0': { '1': 'a' } } - */ - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == 'function' ? customizer : undefined$1; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); - } - - /** + */function updateWith(object,path,updater,customizer){customizer=typeof customizer=='function'?customizer:undefined$1;return object==null?object:baseUpdate(object,path,castFunction(updater),customizer);}/** * Creates an array of the own enumerable string keyed property values of `object`. * * **Note:** Non-object values are coerced to objects. @@ -14724,12 +7780,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.values('hi'); * // => ['h', 'i'] - */ - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - - /** + */function values(object){return object==null?[]:baseValues(object,keys(object));}/** * Creates an array of the own and inherited enumerable string keyed property * values of `object`. * @@ -14752,14 +7803,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.valuesIn(new Foo); * // => [1, 2, 3] (iteration order is not guaranteed) - */ - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); - } - - /*------------------------------------------------------------------------*/ - - /** + */function valuesIn(object){return object==null?[]:baseValues(object,keysIn(object));}/*------------------------------------------------------------------------*/ /** * Clamps `number` within the inclusive `lower` and `upper` bounds. * * @static @@ -14777,24 +7821,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.clamp(10, -5, 5); * // => 5 - */ - function clamp(number, lower, upper) { - if (upper === undefined$1) { - upper = lower; - lower = undefined$1; - } - if (upper !== undefined$1) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined$1) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } - - /** + */function clamp(number,lower,upper){if(upper===undefined$1){upper=lower;lower=undefined$1;}if(upper!==undefined$1){upper=toNumber(upper);upper=upper===upper?upper:0;}if(lower!==undefined$1){lower=toNumber(lower);lower=lower===lower?lower:0;}return baseClamp(toNumber(number),lower,upper);}/** * Checks if `n` is between `start` and up to, but not including, `end`. If * `end` is not specified, it's set to `start` with `start` then set to `0`. * If `start` is greater than `end` the params are swapped to support @@ -14831,20 +7858,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.inRange(-3, -2, -6); * // => true - */ - function inRange(number, start, end) { - start = toFinite(start); - if (end === undefined$1) { - end = start; - start = 0; - } else { - end = toFinite(end); - } - number = toNumber(number); - return baseInRange(number, start, end); - } - - /** + */function inRange(number,start,end){start=toFinite(start);if(end===undefined$1){end=start;start=0;}else {end=toFinite(end);}number=toNumber(number);return baseInRange(number,start,end);}/** * Produces a random number between the inclusive `lower` and `upper` bounds. * If only one argument is provided a number between `0` and the given number * is returned. If `floating` is `true`, or either `lower` or `upper` are @@ -14874,49 +7888,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.random(1.2, 5.2); * // => a floating-point number between 1.2 and 5.2 - */ - function random(lower, upper, floating) { - if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined$1; - } - if (floating === undefined$1) { - if (typeof upper == 'boolean') { - floating = upper; - upper = undefined$1; - } - else if (typeof lower == 'boolean') { - floating = lower; - lower = undefined$1; - } - } - if (lower === undefined$1 && upper === undefined$1) { - lower = 0; - upper = 1; - } - else { - lower = toFinite(lower); - if (upper === undefined$1) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); - } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); - } - return baseRandom(lower, upper); - } - - /*------------------------------------------------------------------------*/ - - /** + */function random(lower,upper,floating){if(floating&&typeof floating!='boolean'&&isIterateeCall(lower,upper,floating)){upper=floating=undefined$1;}if(floating===undefined$1){if(typeof upper=='boolean'){floating=upper;upper=undefined$1;}else if(typeof lower=='boolean'){floating=lower;lower=undefined$1;}}if(lower===undefined$1&&upper===undefined$1){lower=0;upper=1;}else {lower=toFinite(lower);if(upper===undefined$1){upper=lower;lower=0;}else {upper=toFinite(upper);}}if(lower>upper){var temp=lower;lower=upper;upper=temp;}if(floating||lower%1||upper%1){var rand=nativeRandom();return nativeMin(lower+rand*(upper-lower+freeParseFloat('1e-'+((rand+'').length-1))),upper);}return baseRandom(lower,upper);}/*------------------------------------------------------------------------*/ /** * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). * * @static @@ -14935,13 +7907,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.camelCase('__FOO_BAR__'); * // => 'fooBar' - */ - var camelCase = createCompounder(function(result, word, index) { - word = word.toLowerCase(); - return result + (index ? capitalize(word) : word); - }); - - /** + */var camelCase=createCompounder(function(result,word,index){word=word.toLowerCase();return result+(index?capitalize(word):word);});/** * Converts the first character of `string` to upper case and the remaining * to lower case. * @@ -14955,12 +7921,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.capitalize('FRED'); * // => 'Fred' - */ - function capitalize(string) { - return upperFirst(toString(string).toLowerCase()); - } - - /** + */function capitalize(string){return upperFirst(toString(string).toLowerCase());}/** * Deburrs `string` by converting * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) @@ -14977,13 +7938,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.deburr('déjà vu'); * // => 'deja vu' - */ - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); - } - - /** + */function deburr(string){string=toString(string);return string&&string.replace(reLatin,deburrLetter).replace(reComboMark,'');}/** * Checks if `string` ends with the given target string. * * @static @@ -15005,22 +7960,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.endsWith('abc', 'b', 2); * // => true - */ - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - - var length = string.length; - position = position === undefined$1 - ? length - : baseClamp(toInteger(position), 0, length); - - var end = position; - position -= target.length; - return position >= 0 && string.slice(position, end) == target; - } - - /** + */function endsWith(string,target,position){string=toString(string);target=baseToString(target);var length=string.length;position=position===undefined$1?length:baseClamp(toInteger(position),0,length);var end=position;position-=target.length;return position>=0&&string.slice(position,end)==target;}/** * Converts the characters "&", "<", ">", '"', and "'" in `string` to their * corresponding HTML entities. * @@ -15047,15 +7987,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.escape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' - */ - function escape(string) { - string = toString(string); - return (string && reHasUnescapedHtml.test(string)) - ? string.replace(reUnescapedHtml, escapeHtmlChar) - : string; - } - - /** + */function escape(string){string=toString(string);return string&&reHasUnescapedHtml.test(string)?string.replace(reUnescapedHtml,escapeHtmlChar):string;}/** * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. * @@ -15069,15 +8001,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.escapeRegExp('[lodash](https://lodash.com/)'); * // => '\[lodash\]\(https://lodash\.com/\)' - */ - function escapeRegExp(string) { - string = toString(string); - return (string && reHasRegExpChar.test(string)) - ? string.replace(reRegExpChar, '\\$&') - : string; - } - - /** + */function escapeRegExp(string){string=toString(string);return string&&reHasRegExpChar.test(string)?string.replace(reRegExpChar,'\\$&'):string;}/** * Converts `string` to * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). * @@ -15097,12 +8021,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' - */ - var kebabCase = createCompounder(function(result, word, index) { - return result + (index ? '-' : '') + word.toLowerCase(); - }); - - /** + */var kebabCase=createCompounder(function(result,word,index){return result+(index?'-':'')+word.toLowerCase();});/** * Converts `string`, as space separated words, to lower case. * * @static @@ -15121,12 +8040,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' - */ - var lowerCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toLowerCase(); - }); - - /** + */var lowerCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toLowerCase();});/** * Converts the first character of `string` to lower case. * * @static @@ -15142,10 +8056,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.lowerFirst('FRED'); * // => 'fRED' - */ - var lowerFirst = createCaseFirst('toLowerCase'); - - /** + */var lowerFirst=createCaseFirst('toLowerCase');/** * Pads `string` on the left and right sides if it's shorter than `length`. * Padding characters are truncated if they can't be evenly divided by `length`. * @@ -15167,24 +8078,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.pad('abc', 3); * // => 'abc' - */ - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); - } - - /** + */function pad(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;if(!length||strLength>=length){return string;}var mid=(length-strLength)/2;return createPadding(nativeFloor(mid),chars)+string+createPadding(nativeCeil(mid),chars);}/** * Pads `string` on the right side if it's shorter than `length`. Padding * characters are truncated if they exceed `length`. * @@ -15206,18 +8100,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.padEnd('abc', 3); * // => 'abc' - */ - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; - } - - /** + */function padEnd(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;return length&&strLength 'abc' - */ - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; - } - - /** + */function padStart(string,length,chars){string=toString(string);length=toInteger(length);var strLength=length?stringSize(string):0;return length&&strLength [6, 8, 10] - */ - function parseInt(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); - } - - /** + */function parseInt(string,radix,guard){if(guard||radix==null){radix=0;}else if(radix){radix=+radix;}return nativeParseInt(toString(string).replace(reTrimStart,''),radix||0);}/** * Repeats the given string `n` times. * * @static @@ -15304,17 +8166,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.repeat('abc', 0); * // => '' - */ - function repeat(string, n, guard) { - if ((guard ? isIterateeCall(string, n, guard) : n === undefined$1)) { - n = 1; - } else { - n = toInteger(n); - } - return baseRepeat(toString(string), n); - } - - /** + */function repeat(string,n,guard){if(guard?isIterateeCall(string,n,guard):n===undefined$1){n=1;}else {n=toInteger(n);}return baseRepeat(toString(string),n);}/** * Replaces matches for `pattern` in `string` with `replacement`. * * **Note:** This method is based on @@ -15332,15 +8184,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.replace('Hi Fred', 'Fred', 'Barney'); * // => 'Hi Barney' - */ - function replace() { - var args = arguments, - string = toString(args[0]); - - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - - /** + */function replace(){var args=arguments,string=toString(args[0]);return args.length<3?string:string.replace(args[1],args[2]);}/** * Converts `string` to * [snake case](https://en.wikipedia.org/wiki/Snake_case). * @@ -15360,12 +8204,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' - */ - var snakeCase = createCompounder(function(result, word, index) { - return result + (index ? '_' : '') + word.toLowerCase(); - }); - - /** + */var snakeCase=createCompounder(function(result,word,index){return result+(index?'_':'')+word.toLowerCase();});/** * Splits `string` by `separator`. * * **Note:** This method is based on @@ -15383,29 +8222,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.split('a-b-c', '-', 2); * // => ['a', 'b'] - */ - function split(string, separator, limit) { - if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { - separator = limit = undefined$1; - } - limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); - } - } - return string.split(separator, limit); - } - - /** + */function split(string,separator,limit){if(limit&&typeof limit!='number'&&isIterateeCall(string,separator,limit)){separator=limit=undefined$1;}limit=limit===undefined$1?MAX_ARRAY_LENGTH:limit>>>0;if(!limit){return [];}string=toString(string);if(string&&(typeof separator=='string'||separator!=null&&!isRegExp(separator))){separator=baseToString(separator);if(!separator&&hasUnicode(string)){return castSlice(stringToArray(string),0,limit);}}return string.split(separator,limit);}/** * Converts `string` to * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). * @@ -15425,12 +8242,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' - */ - var startCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + upperFirst(word); - }); - - /** + */var startCase=createCompounder(function(result,word,index){return result+(index?' ':'')+upperFirst(word);});/** * Checks if `string` starts with the given target string. * * @static @@ -15452,18 +8264,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.startsWith('abc', 'b', 1); * // => true - */ - function startsWith(string, target, position) { - string = toString(string); - position = position == null - ? 0 - : baseClamp(toInteger(position), 0, string.length); - - target = baseToString(target); - return string.slice(position, position + target.length) == target; - } - - /** + */function startsWith(string,target,position){string=toString(string);position=position==null?0:baseClamp(toInteger(position),0,string.length);target=baseToString(target);return string.slice(position,position+target.length)==target;}/** * Creates a compiled template function that can interpolate data properties * in "interpolate" delimiters, HTML-escape interpolated data properties in * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data @@ -15566,125 +8367,27 @@ var lodash = createCommonjsModule(function (module, exports) { * "main": ' + _.template(mainText).source + '\ * };\ * '); - */ - function template(string, options, guard) { - // Based on John Resig's `tmpl` implementation - // (http://ejohn.org/blog/javascript-micro-templating/) - // and Laura Doktorova's doT.js (https://github.com/olado/doT). - var settings = lodash.templateSettings; - - if (guard && isIterateeCall(string, options, guard)) { - options = undefined$1; - } - string = toString(string); - options = assignInWith({}, options, settings, customDefaultsAssignIn); - - var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), - importsKeys = keys(imports), - importsValues = baseValues(imports, importsKeys); - - var isEscaping, - isEvaluating, - index = 0, - interpolate = options.interpolate || reNoMatch, - source = "__p += '"; - - // Compile the regexp to match each delimiter. - var reDelimiters = RegExp( - (options.escape || reNoMatch).source + '|' + - interpolate.source + '|' + - (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + - (options.evaluate || reNoMatch).source + '|$' - , 'g'); - - // Use a sourceURL for easier debugging. - // The sourceURL gets injected into the source that's eval-ed, so be careful - // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in - // and escape the comment, thus injecting code that gets evaled. - var sourceURL = '//# sourceURL=' + - (hasOwnProperty.call(options, 'sourceURL') - ? (options.sourceURL + '').replace(/\s/g, ' ') - : ('lodash.templateSources[' + (++templateCounter) + ']') - ) + '\n'; - - string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { - interpolateValue || (interpolateValue = esTemplateValue); - - // Escape characters that can't be included in string literals. - source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); - - // Replace delimiters with snippets. - if (escapeValue) { - isEscaping = true; - source += "' +\n__e(" + escapeValue + ") +\n'"; - } - if (evaluateValue) { - isEvaluating = true; - source += "';\n" + evaluateValue + ";\n__p += '"; - } - if (interpolateValue) { - source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; - } - index = offset + match.length; - - // The JS engine embedded in Adobe products needs `match` returned in - // order to produce the correct `offset` value. - return match; - }); - - source += "';\n"; - - // If `variable` is not specified wrap a with-statement around the generated - // code to add the data object to the top of the scope chain. - var variable = hasOwnProperty.call(options, 'variable') && options.variable; - if (!variable) { - source = 'with (obj) {\n' + source + '\n}\n'; - } - // Throw an error if a forbidden character was found in `variable`, to prevent - // potential command injection attacks. - else if (reForbiddenIdentifierChars.test(variable)) { - throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); - } - - // Cleanup code by stripping empty strings. - source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) - .replace(reEmptyStringMiddle, '$1') - .replace(reEmptyStringTrailing, '$1;'); - - // Frame code as the function body. - source = 'function(' + (variable || 'obj') + ') {\n' + - (variable - ? '' - : 'obj || (obj = {});\n' - ) + - "var __t, __p = ''" + - (isEscaping - ? ', __e = _.escape' - : '' - ) + - (isEvaluating - ? ', __j = Array.prototype.join;\n' + - "function print() { __p += __j.call(arguments, '') }\n" - : ';\n' - ) + - source + - 'return __p\n}'; - - var result = attempt(function() { - return Function(importsKeys, sourceURL + 'return ' + source) - .apply(undefined$1, importsValues); - }); - - // Provide the compiled function's source by its `toString` method or - // the `source` property as a convenience for inlining compiled templates. - result.source = source; - if (isError(result)) { - throw result; - } - return result; - } - - /** + */function template(string,options,guard){// Based on John Resig's `tmpl` implementation +// (http://ejohn.org/blog/javascript-micro-templating/) +// and Laura Doktorova's doT.js (https://github.com/olado/doT). +var settings=lodash.templateSettings;if(guard&&isIterateeCall(string,options,guard)){options=undefined$1;}string=toString(string);options=assignInWith({},options,settings,customDefaultsAssignIn);var imports=assignInWith({},options.imports,settings.imports,customDefaultsAssignIn),importsKeys=keys(imports),importsValues=baseValues(imports,importsKeys);var isEscaping,isEvaluating,index=0,interpolate=options.interpolate||reNoMatch,source="__p += '";// Compile the regexp to match each delimiter. +var reDelimiters=RegExp((options.escape||reNoMatch).source+'|'+interpolate.source+'|'+(interpolate===reInterpolate?reEsTemplate:reNoMatch).source+'|'+(options.evaluate||reNoMatch).source+'|$','g');// Use a sourceURL for easier debugging. +// The sourceURL gets injected into the source that's eval-ed, so be careful +// to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in +// and escape the comment, thus injecting code that gets evaled. +var sourceURL='//# sourceURL='+(hasOwnProperty.call(options,'sourceURL')?(options.sourceURL+'').replace(/\s/g,' '):'lodash.templateSources['+ ++templateCounter+']')+'\n';string.replace(reDelimiters,function(match,escapeValue,interpolateValue,esTemplateValue,evaluateValue,offset){interpolateValue||(interpolateValue=esTemplateValue);// Escape characters that can't be included in string literals. +source+=string.slice(index,offset).replace(reUnescapedString,escapeStringChar);// Replace delimiters with snippets. +if(escapeValue){isEscaping=true;source+="' +\n__e("+escapeValue+") +\n'";}if(evaluateValue){isEvaluating=true;source+="';\n"+evaluateValue+";\n__p += '";}if(interpolateValue){source+="' +\n((__t = ("+interpolateValue+")) == null ? '' : __t) +\n'";}index=offset+match.length;// The JS engine embedded in Adobe products needs `match` returned in +// order to produce the correct `offset` value. +return match;});source+="';\n";// If `variable` is not specified wrap a with-statement around the generated +// code to add the data object to the top of the scope chain. +var variable=hasOwnProperty.call(options,'variable')&&options.variable;if(!variable){source='with (obj) {\n'+source+'\n}\n';}// Throw an error if a forbidden character was found in `variable`, to prevent +// potential command injection attacks. +else if(reForbiddenIdentifierChars.test(variable)){throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);}// Cleanup code by stripping empty strings. +source=(isEvaluating?source.replace(reEmptyStringLeading,''):source).replace(reEmptyStringMiddle,'$1').replace(reEmptyStringTrailing,'$1;');// Frame code as the function body. +source='function('+(variable||'obj')+') {\n'+(variable?'':'obj || (obj = {});\n')+"var __t, __p = ''"+(isEscaping?', __e = _.escape':'')+(isEvaluating?', __j = Array.prototype.join;\n'+"function print() { __p += __j.call(arguments, '') }\n":';\n')+source+'return __p\n}';var result=attempt(function(){return Function(importsKeys,sourceURL+'return '+source).apply(undefined$1,importsValues);});// Provide the compiled function's source by its `toString` method or +// the `source` property as a convenience for inlining compiled templates. +result.source=source;if(isError(result)){throw result;}return result;}/** * Converts `string`, as a whole, to lower case just like * [String#toLowerCase](https://mdn.io/toLowerCase). * @@ -15704,12 +8407,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toLower('__FOO_BAR__'); * // => '__foo_bar__' - */ - function toLower(value) { - return toString(value).toLowerCase(); - } - - /** + */function toLower(value){return toString(value).toLowerCase();}/** * Converts `string`, as a whole, to upper case just like * [String#toUpperCase](https://mdn.io/toUpperCase). * @@ -15729,12 +8427,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.toUpper('__foo_bar__'); * // => '__FOO_BAR__' - */ - function toUpper(value) { - return toString(value).toUpperCase(); - } - - /** + */function toUpper(value){return toString(value).toUpperCase();}/** * Removes leading and trailing whitespace or specified characters from `string`. * * @static @@ -15755,24 +8448,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.map([' foo ', ' bar '], _.trim); * // => ['foo', 'bar'] - */ - function trim(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined$1)) { - return baseTrim(string); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), - chrSymbols = stringToArray(chars), - start = charsStartIndex(strSymbols, chrSymbols), - end = charsEndIndex(strSymbols, chrSymbols) + 1; - - return castSlice(strSymbols, start, end).join(''); - } - - /** + */function trim(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined$1)){return baseTrim(string);}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),chrSymbols=stringToArray(chars),start=charsStartIndex(strSymbols,chrSymbols),end=charsEndIndex(strSymbols,chrSymbols)+1;return castSlice(strSymbols,start,end).join('');}/** * Removes trailing whitespace or specified characters from `string`. * * @static @@ -15790,22 +8466,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.trimEnd('-_-abc-_-', '_-'); * // => '-_-abc' - */ - function trimEnd(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined$1)) { - return string.slice(0, trimmedEndIndex(string) + 1); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), - end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; - - return castSlice(strSymbols, 0, end).join(''); - } - - /** + */function trimEnd(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined$1)){return string.slice(0,trimmedEndIndex(string)+1);}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),end=charsEndIndex(strSymbols,stringToArray(chars))+1;return castSlice(strSymbols,0,end).join('');}/** * Removes leading whitespace or specified characters from `string`. * * @static @@ -15823,22 +8484,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.trimStart('-_-abc-_-', '_-'); * // => 'abc-_-' - */ - function trimStart(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined$1)) { - return string.replace(reTrimStart, ''); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), - start = charsStartIndex(strSymbols, stringToArray(chars)); - - return castSlice(strSymbols, start).join(''); - } - - /** + */function trimStart(string,chars,guard){string=toString(string);if(string&&(guard||chars===undefined$1)){return string.replace(reTrimStart,'');}if(!string||!(chars=baseToString(chars))){return string;}var strSymbols=stringToArray(string),start=charsStartIndex(strSymbols,stringToArray(chars));return castSlice(strSymbols,start).join('');}/** * Truncates `string` if it's longer than the given maximum string length. * The last characters of the truncated string are replaced with the omission * string which defaults to "...". @@ -15874,64 +8520,7 @@ var lodash = createCommonjsModule(function (module, exports) { * 'omission': ' [...]' * }); * // => 'hi-diddly-ho there, neig [...]' - */ - function truncate(string, options) { - var length = DEFAULT_TRUNC_LENGTH, - omission = DEFAULT_TRUNC_OMISSION; - - if (isObject(options)) { - var separator = 'separator' in options ? options.separator : separator; - length = 'length' in options ? toInteger(options.length) : length; - omission = 'omission' in options ? baseToString(options.omission) : omission; - } - string = toString(string); - - var strLength = string.length; - if (hasUnicode(string)) { - var strSymbols = stringToArray(string); - strLength = strSymbols.length; - } - if (length >= strLength) { - return string; - } - var end = length - stringSize(omission); - if (end < 1) { - return omission; - } - var result = strSymbols - ? castSlice(strSymbols, 0, end).join('') - : string.slice(0, end); - - if (separator === undefined$1) { - return result + omission; - } - if (strSymbols) { - end += (result.length - end); - } - if (isRegExp(separator)) { - if (string.slice(end).search(separator)) { - var match, - substring = result; - - if (!separator.global) { - separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); - } - separator.lastIndex = 0; - while ((match = separator.exec(substring))) { - var newEnd = match.index; - } - result = result.slice(0, newEnd === undefined$1 ? end : newEnd); - } - } else if (string.indexOf(baseToString(separator), end) != end) { - var index = result.lastIndexOf(separator); - if (index > -1) { - result = result.slice(0, index); - } - } - return result + omission; - } - - /** + */function truncate(string,options){var length=DEFAULT_TRUNC_LENGTH,omission=DEFAULT_TRUNC_OMISSION;if(isObject(options)){var separator='separator'in options?options.separator:separator;length='length'in options?toInteger(options.length):length;omission='omission'in options?baseToString(options.omission):omission;}string=toString(string);var strLength=string.length;if(hasUnicode(string)){var strSymbols=stringToArray(string);strLength=strSymbols.length;}if(length>=strLength){return string;}var end=length-stringSize(omission);if(end<1){return omission;}var result=strSymbols?castSlice(strSymbols,0,end).join(''):string.slice(0,end);if(separator===undefined$1){return result+omission;}if(strSymbols){end+=result.length-end;}if(isRegExp(separator)){if(string.slice(end).search(separator)){var match,substring=result;if(!separator.global){separator=RegExp(separator.source,toString(reFlags.exec(separator))+'g');}separator.lastIndex=0;while(match=separator.exec(substring)){var newEnd=match.index;}result=result.slice(0,newEnd===undefined$1?end:newEnd);}}else if(string.indexOf(baseToString(separator),end)!=end){var index=result.lastIndexOf(separator);if(index>-1){result=result.slice(0,index);}}return result+omission;}/** * The inverse of `_.escape`; this method converts the HTML entities * `&`, `<`, `>`, `"`, and `'` in `string` to * their corresponding characters. @@ -15949,15 +8538,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.unescape('fred, barney, & pebbles'); * // => 'fred, barney, & pebbles' - */ - function unescape(string) { - string = toString(string); - return (string && reHasEscapedHtml.test(string)) - ? string.replace(reEscapedHtml, unescapeHtmlChar) - : string; - } - - /** + */function unescape(string){string=toString(string);return string&&reHasEscapedHtml.test(string)?string.replace(reEscapedHtml,unescapeHtmlChar):string;}/** * Converts `string`, as space separated words, to upper case. * * @static @@ -15976,12 +8557,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.upperCase('__foo_bar__'); * // => 'FOO BAR' - */ - var upperCase = createCompounder(function(result, word, index) { - return result + (index ? ' ' : '') + word.toUpperCase(); - }); - - /** + */var upperCase=createCompounder(function(result,word,index){return result+(index?' ':'')+word.toUpperCase();});/** * Converts the first character of `string` to upper case. * * @static @@ -15997,10 +8573,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.upperFirst('FRED'); * // => 'FRED' - */ - var upperFirst = createCaseFirst('toUpperCase'); - - /** + */var upperFirst=createCaseFirst('toUpperCase');/** * Splits `string` into an array of its words. * * @static @@ -16018,20 +8591,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.words('fred, barney, & pebbles', /[^, ]+/g); * // => ['fred', 'barney', '&', 'pebbles'] - */ - function words(string, pattern, guard) { - string = toString(string); - pattern = guard ? undefined$1 : pattern; - - if (pattern === undefined$1) { - return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); - } - return string.match(pattern) || []; - } - - /*------------------------------------------------------------------------*/ - - /** + */function words(string,pattern,guard){string=toString(string);pattern=guard?undefined$1:pattern;if(pattern===undefined$1){return hasUnicodeWord(string)?unicodeWords(string):asciiWords(string);}return string.match(pattern)||[];}/*------------------------------------------------------------------------*/ /** * Attempts to invoke `func`, returning either the result or the caught error * object. Any additional arguments are provided to `func` when it's invoked. * @@ -16052,16 +8612,7 @@ var lodash = createCommonjsModule(function (module, exports) { * if (_.isError(elements)) { * elements = []; * } - */ - var attempt = baseRest(function(func, args) { - try { - return apply(func, undefined$1, args); - } catch (e) { - return isError(e) ? e : new Error(e); - } - }); - - /** + */var attempt=baseRest(function(func,args){try{return apply(func,undefined$1,args);}catch(e){return isError(e)?e:new Error(e);}});/** * Binds methods of an object to the object itself, overwriting the existing * method. * @@ -16086,16 +8637,7 @@ var lodash = createCommonjsModule(function (module, exports) { * _.bindAll(view, ['click']); * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. - */ - var bindAll = flatRest(function(object, methodNames) { - arrayEach(methodNames, function(key) { - key = toKey(key); - baseAssignValue(object, key, bind(object[key], object)); - }); - return object; - }); - - /** + */var bindAll=flatRest(function(object,methodNames){arrayEach(methodNames,function(key){key=toKey(key);baseAssignValue(object,key,bind(object[key],object));});return object;});/** * Creates a function that iterates over `pairs` and invokes the corresponding * function of the first predicate to return truthy. The predicate-function * pairs are invoked with the `this` binding and arguments of the created @@ -16123,30 +8665,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * func({ 'a': '1', 'b': '2' }); * // => 'no match' - */ - function cond(pairs) { - var length = pairs == null ? 0 : pairs.length, - toIteratee = getIteratee(); - - pairs = !length ? [] : arrayMap(pairs, function(pair) { - if (typeof pair[1] != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - return [toIteratee(pair[0]), pair[1]]; - }); - - return baseRest(function(args) { - var index = -1; - while (++index < length) { - var pair = pairs[index]; - if (apply(pair[0], this, args)) { - return apply(pair[1], this, args); - } - } - }); - } - - /** + */function cond(pairs){var length=pairs==null?0:pairs.length,toIteratee=getIteratee();pairs=!length?[]:arrayMap(pairs,function(pair){if(typeof pair[1]!='function'){throw new TypeError(FUNC_ERROR_TEXT);}return [toIteratee(pair[0]),pair[1]];});return baseRest(function(args){var index=-1;while(++index 1; } })); * // => [{ 'a': 1, 'b': 2 }] - */ - function conforms(source) { - return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); - } - - /** + */function conforms(source){return baseConforms(baseClone(source,CLONE_DEEP_FLAG));}/** * Creates a function that returns `value`. * * @static @@ -16192,14 +8706,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(objects[0] === objects[1]); * // => true - */ - function constant(value) { - return function() { - return value; - }; - } - - /** + */function constant(value){return function(){return value;};}/** * Checks `value` to determine whether a default value should be returned in * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, * or `undefined`. @@ -16218,12 +8725,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.defaultTo(undefined, 10); * // => 10 - */ - function defaultTo(value, defaultValue) { - return (value == null || value !== value) ? defaultValue : value; - } - - /** + */function defaultTo(value,defaultValue){return value==null||value!==value?defaultValue:value;}/** * Creates a function that returns the result of invoking the given functions * with the `this` binding of the created function, where each successive * invocation is supplied the return value of the previous. @@ -16244,10 +8746,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var addSquare = _.flow([_.add, square]); * addSquare(1, 2); * // => 9 - */ - var flow = createFlow(); - - /** + */var flow=createFlow();/** * This method is like `_.flow` except that it creates a function that * invokes the given functions from right to left. * @@ -16267,10 +8766,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var addSquare = _.flowRight([square, _.add]); * addSquare(1, 2); * // => 9 - */ - var flowRight = createFlow(true); - - /** + */var flowRight=createFlow(true);/** * This method returns the first argument it receives. * * @static @@ -16285,12 +8781,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(_.identity(object) === object); * // => true - */ - function identity(value) { - return value; - } - - /** + */function identity(value){return value;}/** * Creates a function that invokes `func` with the arguments of the created * function. If `func` is a property name, the created function returns the * property value for a given element. If `func` is an array or object, the @@ -16331,12 +8822,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.filter(['abc', 'def'], /ef/); * // => ['def'] - */ - function iteratee(func) { - return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); - } - - /** + */function iteratee(func){return baseIteratee(typeof func=='function'?func:baseClone(func,CLONE_DEEP_FLAG));}/** * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent * property values, else `false`. @@ -16370,12 +8856,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Checking for several possible values * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] - */ - function matches(source) { - return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); - } - - /** + */function matches(source){return baseMatches(baseClone(source,CLONE_DEEP_FLAG));}/** * Creates a function that performs a partial deep comparison between the * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. @@ -16407,12 +8888,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // Checking for several possible values * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] - */ - function matchesProperty(path, srcValue) { - return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); - } - - /** + */function matchesProperty(path,srcValue){return baseMatchesProperty(path,baseClone(srcValue,CLONE_DEEP_FLAG));}/** * Creates a function that invokes the method at `path` of a given object. * Any additional arguments are provided to the invoked method. * @@ -16435,14 +8911,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] - */ - var method = baseRest(function(path, args) { - return function(object) { - return baseInvoke(object, path, args); - }; - }); - - /** + */var method=baseRest(function(path,args){return function(object){return baseInvoke(object,path,args);};});/** * The opposite of `_.method`; this method creates a function that invokes * the method at a given path of `object`. Any additional arguments are * provided to the invoked method. @@ -16464,14 +8933,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] - */ - var methodOf = baseRest(function(object, args) { - return function(path) { - return baseInvoke(object, path, args); - }; - }); - - /** + */var methodOf=baseRest(function(object,args){return function(path){return baseInvoke(object,path,args);};});/** * Adds all own enumerable string keyed function properties of a source * object to the destination object. If `object` is a function, then methods * are added to its prototype as well. @@ -16506,44 +8968,7 @@ var lodash = createCommonjsModule(function (module, exports) { * _.mixin({ 'vowels': vowels }, { 'chain': false }); * _('fred').vowels(); * // => ['e'] - */ - function mixin(object, source, options) { - var props = keys(source), - methodNames = baseFunctions(source, props); - - if (options == null && - !(isObject(source) && (methodNames.length || !props.length))) { - options = source; - source = object; - object = this; - methodNames = baseFunctions(source, keys(source)); - } - var chain = !(isObject(options) && 'chain' in options) || !!options.chain, - isFunc = isFunction(object); - - arrayEach(methodNames, function(methodName) { - var func = source[methodName]; - object[methodName] = func; - if (isFunc) { - object.prototype[methodName] = function() { - var chainAll = this.__chain__; - if (chain || chainAll) { - var result = object(this.__wrapped__), - actions = result.__actions__ = copyArray(this.__actions__); - - actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); - result.__chain__ = chainAll; - return result; - } - return func.apply(object, arrayPush([this.value()], arguments)); - }; - } - }); - - return object; - } - - /** + */function mixin(object,source,options){var props=keys(source),methodNames=baseFunctions(source,props);if(options==null&&!(isObject(source)&&(methodNames.length||!props.length))){options=source;source=object;object=this;methodNames=baseFunctions(source,keys(source));}var chain=!(isObject(options)&&'chain'in options)||!!options.chain,isFunc=isFunction(object);arrayEach(methodNames,function(methodName){var func=source[methodName];object[methodName]=func;if(isFunc){object.prototype[methodName]=function(){var chainAll=this.__chain__;if(chain||chainAll){var result=object(this.__wrapped__),actions=result.__actions__=copyArray(this.__actions__);actions.push({'func':func,'args':arguments,'thisArg':object});result.__chain__=chainAll;return result;}return func.apply(object,arrayPush([this.value()],arguments));};}});return object;}/** * Reverts the `_` variable to its previous value and returns a reference to * the `lodash` function. * @@ -16555,15 +8980,7 @@ var lodash = createCommonjsModule(function (module, exports) { * @example * * var lodash = _.noConflict(); - */ - function noConflict() { - if (root._ === this) { - root._ = oldDash; - } - return this; - } - - /** + */function noConflict(){if(root._===this){root._=oldDash;}return this;}/** * This method returns `undefined`. * * @static @@ -16574,12 +8991,8 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.times(2, _.noop); * // => [undefined, undefined] - */ - function noop() { - // No operation performed. - } - - /** + */function noop(){// No operation performed. +}/** * Creates a function that gets the argument at index `n`. If `n` is negative, * the nth argument from the end is returned. * @@ -16598,15 +9011,7 @@ var lodash = createCommonjsModule(function (module, exports) { * var func = _.nthArg(-2); * func('a', 'b', 'c', 'd'); * // => 'c' - */ - function nthArg(n) { - n = toInteger(n); - return baseRest(function(args) { - return baseNth(args, n); - }); - } - - /** + */function nthArg(n){n=toInteger(n);return baseRest(function(args){return baseNth(args,n);});}/** * Creates a function that invokes `iteratees` with the arguments it receives * and returns their results. * @@ -16623,10 +9028,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * func(1, 2, 3, 4); * // => [4, 1] - */ - var over = createOver(arrayMap); - - /** + */var over=createOver(arrayMap);/** * Creates a function that checks if **all** of the `predicates` return * truthy when invoked with the arguments it receives. * @@ -16653,10 +9055,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * func(NaN); * // => false - */ - var overEvery = createOver(arrayEvery); - - /** + */var overEvery=createOver(arrayEvery);/** * Creates a function that checks if **any** of the `predicates` return * truthy when invoked with the arguments it receives. * @@ -16686,10 +9085,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) - */ - var overSome = createOver(arraySome); - - /** + */var overSome=createOver(arraySome);/** * Creates a function that returns the value at `path` of a given object. * * @static @@ -16710,12 +9106,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); * // => [1, 2] - */ - function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); - } - - /** + */function property(path){return isKey(path)?baseProperty(toKey(path)):basePropertyDeep(path);}/** * The opposite of `_.property`; this method creates a function that returns * the value at a given path of `object`. * @@ -16735,14 +9126,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); * // => [2, 0] - */ - function propertyOf(object) { - return function(path) { - return object == null ? undefined$1 : baseGet(object, path); - }; - } - - /** + */function propertyOf(object){return function(path){return object==null?undefined$1:baseGet(object,path);};}/** * Creates an array of numbers (positive and/or negative) progressing from * `start` up to, but not including, `end`. A step of `-1` is used if a negative * `start` is specified without an `end` or `step`. If `end` is not specified, @@ -16782,10 +9166,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.range(0); * // => [] - */ - var range = createRange(); - - /** + */var range=createRange();/** * This method is like `_.range` except that it populates values in * descending order. * @@ -16820,10 +9201,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.rangeRight(0); * // => [] - */ - var rangeRight = createRange(true); - - /** + */var rangeRight=createRange(true);/** * This method returns a new empty array. * * @static @@ -16840,12 +9218,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(arrays[0] === arrays[1]); * // => false - */ - function stubArray() { - return []; - } - - /** + */function stubArray(){return [];}/** * This method returns `false`. * * @static @@ -16857,12 +9230,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.times(2, _.stubFalse); * // => [false, false] - */ - function stubFalse() { - return false; - } - - /** + */function stubFalse(){return false;}/** * This method returns a new empty object. * * @static @@ -16879,12 +9247,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * console.log(objects[0] === objects[1]); * // => false - */ - function stubObject() { - return {}; - } - - /** + */function stubObject(){return {};}/** * This method returns an empty string. * * @static @@ -16896,12 +9259,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.times(2, _.stubString); * // => ['', ''] - */ - function stubString() { - return ''; - } - - /** + */function stubString(){return '';}/** * This method returns `true`. * * @static @@ -16913,12 +9271,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.times(2, _.stubTrue); * // => [true, true] - */ - function stubTrue() { - return true; - } - - /** + */function stubTrue(){return true;}/** * Invokes the iteratee `n` times, returning an array of the results of * each invocation. The iteratee is invoked with one argument; (index). * @@ -16936,26 +9289,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.times(4, _.constant(0)); * // => [0, 0, 0, 0] - */ - function times(n, iteratee) { - n = toInteger(n); - if (n < 1 || n > MAX_SAFE_INTEGER) { - return []; - } - var index = MAX_ARRAY_LENGTH, - length = nativeMin(n, MAX_ARRAY_LENGTH); - - iteratee = getIteratee(iteratee); - n -= MAX_ARRAY_LENGTH; - - var result = baseTimes(length, iteratee); - while (++index < n) { - iteratee(index); - } - return result; - } - - /** + */function times(n,iteratee){n=toInteger(n);if(n<1||n>MAX_SAFE_INTEGER){return [];}var index=MAX_ARRAY_LENGTH,length=nativeMin(n,MAX_ARRAY_LENGTH);iteratee=getIteratee(iteratee);n-=MAX_ARRAY_LENGTH;var result=baseTimes(length,iteratee);while(++index ['a', '0', 'b', 'c'] - */ - function toPath(value) { - if (isArray(value)) { - return arrayMap(value, toKey); - } - return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); - } - - /** + */function toPath(value){if(isArray(value)){return arrayMap(value,toKey);}return isSymbol(value)?[value]:copyArray(stringToPath(toString(value)));}/** * Generates a unique ID. If `prefix` is given, the ID is appended to it. * * @static @@ -16995,15 +9321,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.uniqueId(); * // => '105' - */ - function uniqueId(prefix) { - var id = ++idCounter; - return toString(prefix) + id; - } - - /*------------------------------------------------------------------------*/ - - /** + */function uniqueId(prefix){var id=++idCounter;return toString(prefix)+id;}/*------------------------------------------------------------------------*/ /** * Adds two numbers. * * @static @@ -17017,12 +9335,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.add(6, 4); * // => 10 - */ - var add = createMathOperation(function(augend, addend) { - return augend + addend; - }, 0); - - /** + */var add=createMathOperation(function(augend,addend){return augend+addend;},0);/** * Computes `number` rounded up to `precision`. * * @static @@ -17042,10 +9355,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.ceil(6040, -2); * // => 6100 - */ - var ceil = createRound('ceil'); - - /** + */var ceil=createRound('ceil');/** * Divide two numbers. * * @static @@ -17059,12 +9369,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.divide(6, 4); * // => 1.5 - */ - var divide = createMathOperation(function(dividend, divisor) { - return dividend / divisor; - }, 1); - - /** + */var divide=createMathOperation(function(dividend,divisor){return dividend/divisor;},1);/** * Computes `number` rounded down to `precision`. * * @static @@ -17084,10 +9389,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.floor(4060, -2); * // => 4000 - */ - var floor = createRound('floor'); - - /** + */var floor=createRound('floor');/** * Computes the maximum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * @@ -17104,14 +9406,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.max([]); * // => undefined - */ - function max(array) { - return (array && array.length) - ? baseExtremum(array, identity, baseGt) - : undefined$1; - } - - /** + */function max(array){return array&&array.length?baseExtremum(array,identity,baseGt):undefined$1;}/** * This method is like `_.max` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). @@ -17133,14 +9428,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.maxBy(objects, 'n'); * // => { 'n': 2 } - */ - function maxBy(array, iteratee) { - return (array && array.length) - ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) - : undefined$1; - } - - /** + */function maxBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseGt):undefined$1;}/** * Computes the mean of the values in `array`. * * @static @@ -17153,12 +9441,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.mean([4, 2, 8, 6]); * // => 5 - */ - function mean(array) { - return baseMean(array, identity); - } - - /** + */function mean(array){return baseMean(array,identity);}/** * This method is like `_.mean` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be averaged. * The iteratee is invoked with one argument: (value). @@ -17180,12 +9463,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.meanBy(objects, 'n'); * // => 5 - */ - function meanBy(array, iteratee) { - return baseMean(array, getIteratee(iteratee, 2)); - } - - /** + */function meanBy(array,iteratee){return baseMean(array,getIteratee(iteratee,2));}/** * Computes the minimum value of `array`. If `array` is empty or falsey, * `undefined` is returned. * @@ -17202,14 +9480,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.min([]); * // => undefined - */ - function min(array) { - return (array && array.length) - ? baseExtremum(array, identity, baseLt) - : undefined$1; - } - - /** + */function min(array){return array&&array.length?baseExtremum(array,identity,baseLt):undefined$1;}/** * This method is like `_.min` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which * the value is ranked. The iteratee is invoked with one argument: (value). @@ -17231,14 +9502,7 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.minBy(objects, 'n'); * // => { 'n': 1 } - */ - function minBy(array, iteratee) { - return (array && array.length) - ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) - : undefined$1; - } - - /** + */function minBy(array,iteratee){return array&&array.length?baseExtremum(array,getIteratee(iteratee,2),baseLt):undefined$1;}/** * Multiply two numbers. * * @static @@ -17252,12 +9516,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.multiply(6, 4); * // => 24 - */ - var multiply = createMathOperation(function(multiplier, multiplicand) { - return multiplier * multiplicand; - }, 1); - - /** + */var multiply=createMathOperation(function(multiplier,multiplicand){return multiplier*multiplicand;},1);/** * Computes `number` rounded to `precision`. * * @static @@ -17277,10 +9536,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.round(4060, -2); * // => 4100 - */ - var round = createRound('round'); - - /** + */var round=createRound('round');/** * Subtract two numbers. * * @static @@ -17294,12 +9550,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.subtract(6, 4); * // => 2 - */ - var subtract = createMathOperation(function(minuend, subtrahend) { - return minuend - subtrahend; - }, 0); - - /** + */var subtract=createMathOperation(function(minuend,subtrahend){return minuend-subtrahend;},0);/** * Computes the sum of the values in `array`. * * @static @@ -17312,14 +9563,7 @@ var lodash = createCommonjsModule(function (module, exports) { * * _.sum([4, 2, 8, 6]); * // => 20 - */ - function sum(array) { - return (array && array.length) - ? baseSum(array, identity) - : 0; - } - - /** + */function sum(array){return array&&array.length?baseSum(array,identity):0;}/** * This method is like `_.sum` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the value to be summed. * The iteratee is invoked with one argument: (value). @@ -17341,10579 +9585,6289 @@ var lodash = createCommonjsModule(function (module, exports) { * // The `_.property` iteratee shorthand. * _.sumBy(objects, 'n'); * // => 20 - */ - function sumBy(array, iteratee) { - return (array && array.length) - ? baseSum(array, getIteratee(iteratee, 2)) - : 0; + */function sumBy(array,iteratee){return array&&array.length?baseSum(array,getIteratee(iteratee,2)):0;}/*------------------------------------------------------------------------*/ // Add methods that return wrapped values in chain sequences. +lodash.after=after;lodash.ary=ary;lodash.assign=assign;lodash.assignIn=assignIn;lodash.assignInWith=assignInWith;lodash.assignWith=assignWith;lodash.at=at;lodash.before=before;lodash.bind=bind;lodash.bindAll=bindAll;lodash.bindKey=bindKey;lodash.castArray=castArray;lodash.chain=chain;lodash.chunk=chunk;lodash.compact=compact;lodash.concat=concat;lodash.cond=cond;lodash.conforms=conforms;lodash.constant=constant;lodash.countBy=countBy;lodash.create=create;lodash.curry=curry;lodash.curryRight=curryRight;lodash.debounce=debounce;lodash.defaults=defaults;lodash.defaultsDeep=defaultsDeep;lodash.defer=defer;lodash.delay=delay;lodash.difference=difference;lodash.differenceBy=differenceBy;lodash.differenceWith=differenceWith;lodash.drop=drop;lodash.dropRight=dropRight;lodash.dropRightWhile=dropRightWhile;lodash.dropWhile=dropWhile;lodash.fill=fill;lodash.filter=filter;lodash.flatMap=flatMap;lodash.flatMapDeep=flatMapDeep;lodash.flatMapDepth=flatMapDepth;lodash.flatten=flatten;lodash.flattenDeep=flattenDeep;lodash.flattenDepth=flattenDepth;lodash.flip=flip;lodash.flow=flow;lodash.flowRight=flowRight;lodash.fromPairs=fromPairs;lodash.functions=functions;lodash.functionsIn=functionsIn;lodash.groupBy=groupBy;lodash.initial=initial;lodash.intersection=intersection;lodash.intersectionBy=intersectionBy;lodash.intersectionWith=intersectionWith;lodash.invert=invert;lodash.invertBy=invertBy;lodash.invokeMap=invokeMap;lodash.iteratee=iteratee;lodash.keyBy=keyBy;lodash.keys=keys;lodash.keysIn=keysIn;lodash.map=map;lodash.mapKeys=mapKeys;lodash.mapValues=mapValues;lodash.matches=matches;lodash.matchesProperty=matchesProperty;lodash.memoize=memoize;lodash.merge=merge;lodash.mergeWith=mergeWith;lodash.method=method;lodash.methodOf=methodOf;lodash.mixin=mixin;lodash.negate=negate;lodash.nthArg=nthArg;lodash.omit=omit;lodash.omitBy=omitBy;lodash.once=once;lodash.orderBy=orderBy;lodash.over=over;lodash.overArgs=overArgs;lodash.overEvery=overEvery;lodash.overSome=overSome;lodash.partial=partial;lodash.partialRight=partialRight;lodash.partition=partition;lodash.pick=pick;lodash.pickBy=pickBy;lodash.property=property;lodash.propertyOf=propertyOf;lodash.pull=pull;lodash.pullAll=pullAll;lodash.pullAllBy=pullAllBy;lodash.pullAllWith=pullAllWith;lodash.pullAt=pullAt;lodash.range=range;lodash.rangeRight=rangeRight;lodash.rearg=rearg;lodash.reject=reject;lodash.remove=remove;lodash.rest=rest;lodash.reverse=reverse;lodash.sampleSize=sampleSize;lodash.set=set;lodash.setWith=setWith;lodash.shuffle=shuffle;lodash.slice=slice;lodash.sortBy=sortBy;lodash.sortedUniq=sortedUniq;lodash.sortedUniqBy=sortedUniqBy;lodash.split=split;lodash.spread=spread;lodash.tail=tail;lodash.take=take;lodash.takeRight=takeRight;lodash.takeRightWhile=takeRightWhile;lodash.takeWhile=takeWhile;lodash.tap=tap;lodash.throttle=throttle;lodash.thru=thru;lodash.toArray=toArray;lodash.toPairs=toPairs;lodash.toPairsIn=toPairsIn;lodash.toPath=toPath;lodash.toPlainObject=toPlainObject;lodash.transform=transform;lodash.unary=unary;lodash.union=union;lodash.unionBy=unionBy;lodash.unionWith=unionWith;lodash.uniq=uniq;lodash.uniqBy=uniqBy;lodash.uniqWith=uniqWith;lodash.unset=unset;lodash.unzip=unzip;lodash.unzipWith=unzipWith;lodash.update=update;lodash.updateWith=updateWith;lodash.values=values;lodash.valuesIn=valuesIn;lodash.without=without;lodash.words=words;lodash.wrap=wrap;lodash.xor=xor;lodash.xorBy=xorBy;lodash.xorWith=xorWith;lodash.zip=zip;lodash.zipObject=zipObject;lodash.zipObjectDeep=zipObjectDeep;lodash.zipWith=zipWith;// Add aliases. +lodash.entries=toPairs;lodash.entriesIn=toPairsIn;lodash.extend=assignIn;lodash.extendWith=assignInWith;// Add methods to `lodash.prototype`. +mixin(lodash,lodash);/*------------------------------------------------------------------------*/ // Add methods that return unwrapped values in chain sequences. +lodash.add=add;lodash.attempt=attempt;lodash.camelCase=camelCase;lodash.capitalize=capitalize;lodash.ceil=ceil;lodash.clamp=clamp;lodash.clone=clone;lodash.cloneDeep=cloneDeep;lodash.cloneDeepWith=cloneDeepWith;lodash.cloneWith=cloneWith;lodash.conformsTo=conformsTo;lodash.deburr=deburr;lodash.defaultTo=defaultTo;lodash.divide=divide;lodash.endsWith=endsWith;lodash.eq=eq;lodash.escape=escape;lodash.escapeRegExp=escapeRegExp;lodash.every=every;lodash.find=find;lodash.findIndex=findIndex;lodash.findKey=findKey;lodash.findLast=findLast;lodash.findLastIndex=findLastIndex;lodash.findLastKey=findLastKey;lodash.floor=floor;lodash.forEach=forEach;lodash.forEachRight=forEachRight;lodash.forIn=forIn;lodash.forInRight=forInRight;lodash.forOwn=forOwn;lodash.forOwnRight=forOwnRight;lodash.get=get;lodash.gt=gt;lodash.gte=gte;lodash.has=has;lodash.hasIn=hasIn;lodash.head=head;lodash.identity=identity;lodash.includes=includes;lodash.indexOf=indexOf;lodash.inRange=inRange;lodash.invoke=invoke;lodash.isArguments=isArguments;lodash.isArray=isArray;lodash.isArrayBuffer=isArrayBuffer;lodash.isArrayLike=isArrayLike;lodash.isArrayLikeObject=isArrayLikeObject;lodash.isBoolean=isBoolean;lodash.isBuffer=isBuffer;lodash.isDate=isDate;lodash.isElement=isElement;lodash.isEmpty=isEmpty;lodash.isEqual=isEqual;lodash.isEqualWith=isEqualWith;lodash.isError=isError;lodash.isFinite=isFinite;lodash.isFunction=isFunction;lodash.isInteger=isInteger;lodash.isLength=isLength;lodash.isMap=isMap;lodash.isMatch=isMatch;lodash.isMatchWith=isMatchWith;lodash.isNaN=isNaN;lodash.isNative=isNative;lodash.isNil=isNil;lodash.isNull=isNull;lodash.isNumber=isNumber;lodash.isObject=isObject;lodash.isObjectLike=isObjectLike;lodash.isPlainObject=isPlainObject;lodash.isRegExp=isRegExp;lodash.isSafeInteger=isSafeInteger;lodash.isSet=isSet;lodash.isString=isString;lodash.isSymbol=isSymbol;lodash.isTypedArray=isTypedArray;lodash.isUndefined=isUndefined;lodash.isWeakMap=isWeakMap;lodash.isWeakSet=isWeakSet;lodash.join=join;lodash.kebabCase=kebabCase;lodash.last=last;lodash.lastIndexOf=lastIndexOf;lodash.lowerCase=lowerCase;lodash.lowerFirst=lowerFirst;lodash.lt=lt;lodash.lte=lte;lodash.max=max;lodash.maxBy=maxBy;lodash.mean=mean;lodash.meanBy=meanBy;lodash.min=min;lodash.minBy=minBy;lodash.stubArray=stubArray;lodash.stubFalse=stubFalse;lodash.stubObject=stubObject;lodash.stubString=stubString;lodash.stubTrue=stubTrue;lodash.multiply=multiply;lodash.nth=nth;lodash.noConflict=noConflict;lodash.noop=noop;lodash.now=now;lodash.pad=pad;lodash.padEnd=padEnd;lodash.padStart=padStart;lodash.parseInt=parseInt;lodash.random=random;lodash.reduce=reduce;lodash.reduceRight=reduceRight;lodash.repeat=repeat;lodash.replace=replace;lodash.result=result;lodash.round=round;lodash.runInContext=runInContext;lodash.sample=sample;lodash.size=size;lodash.snakeCase=snakeCase;lodash.some=some;lodash.sortedIndex=sortedIndex;lodash.sortedIndexBy=sortedIndexBy;lodash.sortedIndexOf=sortedIndexOf;lodash.sortedLastIndex=sortedLastIndex;lodash.sortedLastIndexBy=sortedLastIndexBy;lodash.sortedLastIndexOf=sortedLastIndexOf;lodash.startCase=startCase;lodash.startsWith=startsWith;lodash.subtract=subtract;lodash.sum=sum;lodash.sumBy=sumBy;lodash.template=template;lodash.times=times;lodash.toFinite=toFinite;lodash.toInteger=toInteger;lodash.toLength=toLength;lodash.toLower=toLower;lodash.toNumber=toNumber;lodash.toSafeInteger=toSafeInteger;lodash.toString=toString;lodash.toUpper=toUpper;lodash.trim=trim;lodash.trimEnd=trimEnd;lodash.trimStart=trimStart;lodash.truncate=truncate;lodash.unescape=unescape;lodash.uniqueId=uniqueId;lodash.upperCase=upperCase;lodash.upperFirst=upperFirst;// Add aliases. +lodash.each=forEach;lodash.eachRight=forEachRight;lodash.first=head;mixin(lodash,function(){var source={};baseForOwn(lodash,function(func,methodName){if(!hasOwnProperty.call(lodash.prototype,methodName)){source[methodName]=func;}});return source;}(),{'chain':false});/*------------------------------------------------------------------------*/ /** + * The semantic version number. + * + * @static + * @memberOf _ + * @type {string} + */lodash.VERSION=VERSION;// Assign default placeholders. +arrayEach(['bind','bindKey','curry','curryRight','partial','partialRight'],function(methodName){lodash[methodName].placeholder=lodash;});// Add `LazyWrapper` methods for `_.drop` and `_.take` variants. +arrayEach(['drop','take'],function(methodName,index){LazyWrapper.prototype[methodName]=function(n){n=n===undefined$1?1:nativeMax(toInteger(n),0);var result=this.__filtered__&&!index?new LazyWrapper(this):this.clone();if(result.__filtered__){result.__takeCount__=nativeMin(n,result.__takeCount__);}else {result.__views__.push({'size':nativeMin(n,MAX_ARRAY_LENGTH),'type':methodName+(result.__dir__<0?'Right':'')});}return result;};LazyWrapper.prototype[methodName+'Right']=function(n){return this.reverse()[methodName](n).reverse();};});// Add `LazyWrapper` methods that accept an `iteratee` value. +arrayEach(['filter','map','takeWhile'],function(methodName,index){var type=index+1,isFilter=type==LAZY_FILTER_FLAG||type==LAZY_WHILE_FLAG;LazyWrapper.prototype[methodName]=function(iteratee){var result=this.clone();result.__iteratees__.push({'iteratee':getIteratee(iteratee,3),'type':type});result.__filtered__=result.__filtered__||isFilter;return result;};});// Add `LazyWrapper` methods for `_.head` and `_.last`. +arrayEach(['head','last'],function(methodName,index){var takeName='take'+(index?'Right':'');LazyWrapper.prototype[methodName]=function(){return this[takeName](1).value()[0];};});// Add `LazyWrapper` methods for `_.initial` and `_.tail`. +arrayEach(['initial','tail'],function(methodName,index){var dropName='drop'+(index?'':'Right');LazyWrapper.prototype[methodName]=function(){return this.__filtered__?new LazyWrapper(this):this[dropName](1);};});LazyWrapper.prototype.compact=function(){return this.filter(identity);};LazyWrapper.prototype.find=function(predicate){return this.filter(predicate).head();};LazyWrapper.prototype.findLast=function(predicate){return this.reverse().find(predicate);};LazyWrapper.prototype.invokeMap=baseRest(function(path,args){if(typeof path=='function'){return new LazyWrapper(this);}return this.map(function(value){return baseInvoke(value,path,args);});});LazyWrapper.prototype.reject=function(predicate){return this.filter(negate(getIteratee(predicate)));};LazyWrapper.prototype.slice=function(start,end){start=toInteger(start);var result=this;if(result.__filtered__&&(start>0||end<0)){return new LazyWrapper(result);}if(start<0){result=result.takeRight(-start);}else if(start){result=result.drop(start);}if(end!==undefined$1){end=toInteger(end);result=end<0?result.dropRight(-end):result.take(end-start);}return result;};LazyWrapper.prototype.takeRightWhile=function(predicate){return this.reverse().takeWhile(predicate).reverse();};LazyWrapper.prototype.toArray=function(){return this.take(MAX_ARRAY_LENGTH);};// Add `LazyWrapper` methods to `lodash.prototype`. +baseForOwn(LazyWrapper.prototype,function(func,methodName){var checkIteratee=/^(?:filter|find|map|reject)|While$/.test(methodName),isTaker=/^(?:head|last)$/.test(methodName),lodashFunc=lodash[isTaker?'take'+(methodName=='last'?'Right':''):methodName],retUnwrapped=isTaker||/^find/.test(methodName);if(!lodashFunc){return;}lodash.prototype[methodName]=function(){var value=this.__wrapped__,args=isTaker?[1]:arguments,isLazy=value instanceof LazyWrapper,iteratee=args[0],useLazy=isLazy||isArray(value);var interceptor=function(value){var result=lodashFunc.apply(lodash,arrayPush([value],args));return isTaker&&chainAll?result[0]:result;};if(useLazy&&checkIteratee&&typeof iteratee=='function'&&iteratee.length!=1){// Avoid lazy use if the iteratee has a "length" value other than `1`. +isLazy=useLazy=false;}var chainAll=this.__chain__,isHybrid=!!this.__actions__.length,isUnwrapped=retUnwrapped&&!chainAll,onlyLazy=isLazy&&!isHybrid;if(!retUnwrapped&&useLazy){value=onlyLazy?value:new LazyWrapper(this);var result=func.apply(value,args);result.__actions__.push({'func':thru,'args':[interceptor],'thisArg':undefined$1});return new LodashWrapper(result,chainAll);}if(isUnwrapped&&onlyLazy){return func.apply(this,args);}result=this.thru(interceptor);return isUnwrapped?isTaker?result.value()[0]:result.value():result;};});// Add `Array` methods to `lodash.prototype`. +arrayEach(['pop','push','shift','sort','splice','unshift'],function(methodName){var func=arrayProto[methodName],chainName=/^(?:push|sort|unshift)$/.test(methodName)?'tap':'thru',retUnwrapped=/^(?:pop|shift)$/.test(methodName);lodash.prototype[methodName]=function(){var args=arguments;if(retUnwrapped&&!this.__chain__){var value=this.value();return func.apply(isArray(value)?value:[],args);}return this[chainName](function(value){return func.apply(isArray(value)?value:[],args);});};});// Map minified method names to their real names. +baseForOwn(LazyWrapper.prototype,function(func,methodName){var lodashFunc=lodash[methodName];if(lodashFunc){var key=lodashFunc.name+'';if(!hasOwnProperty.call(realNames,key)){realNames[key]=[];}realNames[key].push({'name':methodName,'func':lodashFunc});}});realNames[createHybrid(undefined$1,WRAP_BIND_KEY_FLAG).name]=[{'name':'wrapper','func':undefined$1}];// Add methods to `LazyWrapper`. +LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;// Add chain sequence methods to the `lodash` wrapper. +lodash.prototype.at=wrapperAt;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.next=wrapperNext;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;// Add lazy aliases. +lodash.prototype.first=lodash.prototype.head;if(symIterator){lodash.prototype[symIterator]=wrapperToIterator;}return lodash;};/*--------------------------------------------------------------------------*/ // Export lodash. +var _=runInContext();// Some AMD build optimizers, like r.js, check for condition patterns like: +if(freeModule){// Export for Node.js. +(freeModule.exports=_)._=_;// Export for CommonJS support. +freeExports._=_;}else {// Export to the global object. +root._=_;}}).call(commonjsGlobal); +}); + +var nearley = createCommonjsModule(function (module) { +(function(root,factory){if(module.exports){module.exports=factory();}else {root.nearley=factory();}})(commonjsGlobal,function(){function Rule(name,symbols,postprocess){this.id=++Rule.highestId;this.name=name;this.symbols=symbols;// a list of literal | regex class | nonterminal +this.postprocess=postprocess;return this;}Rule.highestId=0;Rule.prototype.toString=function(withCursorAt){var symbolSequence=typeof withCursorAt==="undefined"?this.symbols.map(getSymbolShortDisplay).join(' '):this.symbols.slice(0,withCursorAt).map(getSymbolShortDisplay).join(' ')+" ● "+this.symbols.slice(withCursorAt).map(getSymbolShortDisplay).join(' ');return this.name+" → "+symbolSequence;};// a State is a rule at a position from a given starting point in the input stream (reference) +function State(rule,dot,reference,wantedBy){this.rule=rule;this.dot=dot;this.reference=reference;this.data=[];this.wantedBy=wantedBy;this.isComplete=this.dot===rule.symbols.length;}State.prototype.toString=function(){return "{"+this.rule.toString(this.dot)+"}, from: "+(this.reference||0);};State.prototype.nextState=function(child){var state=new State(this.rule,this.dot+1,this.reference,this.wantedBy);state.left=this;state.right=child;if(state.isComplete){state.data=state.build();// Having right set here will prevent the right state and its children +// form being garbage collected +state.right=undefined;}return state;};State.prototype.build=function(){var children=[];var node=this;do{children.push(node.right.data);node=node.left;}while(node.left);children.reverse();return children;};State.prototype.finish=function(){if(this.rule.postprocess){this.data=this.rule.postprocess(this.data,this.reference,Parser.fail);}};function Column(grammar,index){this.grammar=grammar;this.index=index;this.states=[];this.wants={};// states indexed by the non-terminal they expect +this.scannable=[];// list of states that expect a token +this.completed={};// states that are nullable +}Column.prototype.process=function(nextColumn){var states=this.states;var wants=this.wants;var completed=this.completed;for(var w=0;w0){lines.push(' ^ '+sameDisplayCount+' more lines identical to this');}sameDisplayCount=0;lines.push(' '+display);}lastDisplay=display;}};Parser.prototype.getSymbolDisplay=function(symbol){return getSymbolLongDisplay(symbol);};/* + Builds a the first state stack. You can think of a state stack as the call stack + of the recursive-descent parser which the Nearley parse algorithm simulates. + A state stack is represented as an array of state objects. Within a + state stack, the first item of the array will be the starting + state, with each successive item in the array going further back into history. + + This function needs to be given a starting state and an empty array representing + the visited states, and it returns an single state stack. + + */Parser.prototype.buildFirstStateStack=function(state,visited){if(visited.indexOf(state)!==-1){// Found cycle, return null +// to eliminate this path from the results, because +// we don't know how to display it meaningfully +return null;}if(state.wantedBy.length===0){return [state];}var prevState=state.wantedBy[0];var childVisited=[state].concat(visited);var childResult=this.buildFirstStateStack(prevState,childVisited);if(childResult===null){return null;}return [state].concat(childResult);};Parser.prototype.save=function(){var column=this.table[this.current];column.lexerState=this.lexerState;return column;};Parser.prototype.restore=function(column){var index=column.index;this.current=index;this.table[index]=column;this.table.splice(index+1);this.lexerState=column.lexerState;// Incrementally keep track of results +this.results=this.finish();};// nb. deprecated: use save/restore instead! +Parser.prototype.rewind=function(index){if(!this.options.keepHistory){throw new Error('set option `keepHistory` to enable rewinding');}// nb. recall column (table) indicies fall between token indicies. +// col 0 -- token 0 -- col 1 +this.restore(this.table[index]);};Parser.prototype.finish=function(){// Return the possible parsings +var considerations=[];var start=this.grammar.start;var column=this.table[this.table.length-1];column.states.forEach(function(t){if(t.rule.name===start&&t.dot===t.rule.symbols.length&&t.reference===0&&t.data!==Parser.fail){considerations.push(t);}});return considerations.map(function(c){return c.data;});};function getSymbolLongDisplay(symbol){var type=typeof symbol;if(type==="string"){return symbol;}else if(type==="object"){if(symbol.literal){return JSON.stringify(symbol.literal);}else if(symbol instanceof RegExp){return 'character matching '+symbol;}else if(symbol.type){return symbol.type+' token';}else if(symbol.test){return 'token matching '+String(symbol.test);}else {throw new Error('Unknown symbol type: '+symbol);}}}function getSymbolShortDisplay(symbol){var type=typeof symbol;if(type==="string"){return symbol;}else if(type==="object"){if(symbol.literal){return JSON.stringify(symbol.literal);}else if(symbol instanceof RegExp){return symbol.toString();}else if(symbol.type){return '%'+symbol.type;}else if(symbol.test){return '<'+String(symbol.test)+'>';}else {throw new Error('Unknown symbol type: '+symbol);}}}return {Parser:Parser,Grammar:Grammar,Rule:Rule};}); +}); + +const parse = (fileContents, settings) => { + const splitFileContents = fileContents.split(/\n[ \t]*\n/); // Split on blank lines + const results = splitFileContents + .filter((lines) => lines.trim() !== '') + .map((lines) => { + const parser = new nearley.Parser(nearley.Grammar.fromCompiled(grammar)); + try { + const innerresults = parser.feed(lines).finish(); + if (innerresults.length !== 1) { + console.error(`Failed to parse (${innerresults.length} results): "${lines}"`); + return undefined; + } + return innerresults[0]; + } + catch (error) { + console.error(`Failed to parse: "${lines}"`); + console.error(error); + return undefined; + } + }) + .filter((value) => value !== undefined) + .flat(1); + const aliases = []; + const txs = []; + results.forEach((el) => { + switch (el.type) { + case 'alias': + aliases.push(el); + break; + case 'tx': + txs.push(el); + break; + } + }); + const payees = lodash.sortedUniq(txs + .map(({ value }) => value.payee) + .sort((a, b) => (a.toLowerCase() > b.toLowerCase() ? 1 : -1))); + const categories = lodash.sortedUniq(lodash.flatMap(txs, ({ value }) => value.expenselines.flatMap((line) => line.category ? line.category : [])).sort((a, b) => (a.toLowerCase() > b.toLowerCase() ? 1 : -1))); + const aliasMap = parseAliases(aliases); + const assetCategories = []; + const expenseCategories = []; + const incomeCategories = []; + const liabilityCategories = []; + categories.forEach((c) => { + const dealiasedC = dealiasCategory(c, aliasMap); + if (dealiasedC.startsWith(settings.assetAccountsPrefix)) { + assetCategories.push(c); + } + else if (dealiasedC.startsWith(settings.expenseAccountsPrefix)) { + expenseCategories.push(c); + } + else if (dealiasedC.startsWith(settings.incomeAccountsPrefix)) { + incomeCategories.push(c); + } + else if (dealiasedC.startsWith(settings.liabilityAccountsPrefix)) { + liabilityCategories.push(c); + } + }); + return { + aliases: aliasMap, + transactions: txs, + payees, + categories, + assetCategories, + expenseCategories, + incomeCategories, + liabilityCategories, + }; +}; +const dealiasCategory = (category, aliases) => { + const firstDelimeter = category.indexOf(':'); + if (firstDelimeter > 0) { + const prefix = category.substring(0, firstDelimeter); + if (aliases.has(prefix)) { + return aliases.get(prefix) + category.substring(firstDelimeter); + } } + return category; +}; +const parseAliases = (aliases) => { + const aliasMap = new Map(); + aliases.forEach((el) => { + aliasMap.set(el.value.left, el.value.right); + }); + return aliasMap; +}; - /*------------------------------------------------------------------------*/ +const formatExpense = (tx, settings) => { + const symb = settings.currencySymbol; + // The final line needs to have the amount updated so all lines total 0. + const total = tx.value.expenselines + .slice(0, -1) + .map(({ amount }) => amount) + .reduce((prev, curr) => curr + prev, 0); + tx.value.expenselines[tx.value.expenselines.length - 1].amount = total * -1; + const joinedLines = tx.value.expenselines + .map(({ category, amount }, i) => { + if (i !== tx.value.expenselines.length - 1 || + settings.includeFinalLineAmount) { + return ` ${category} ${symb}${amount.toFixed(2)}`; + } + // The amount is optional on the final line + return ` ${category}`; + }) + .join('\n'); + return `\n${tx.value.date} ${tx.value.payee}\n${joinedLines}`; +}; +const appendLedger = async (cache, vault, settings, newExpense) => { + const file = cache.getFirstLinkpathDest(settings.ledgerFile, ''); + if (file) { + const fileContents = await vault.read(file); + const newFileContents = `${fileContents}\n${newExpense}`; + await vault.modify(file, newFileContents); + } + else { + await vault.create(settings.ledgerFile, newExpense); + } +}; +const getTransactionCache = async (cache, vault, settings) => { + const file = cache.getFirstLinkpathDest(settings.ledgerFile, '') || + (await vault.create(settings.ledgerFile, '')); + const fileContents = await vault.read(file); + return parse(fileContents, settings); +}; - // Add methods that return wrapped values in chain sequences. - lodash.after = after; - lodash.ary = ary; - lodash.assign = assign; - lodash.assignIn = assignIn; - lodash.assignInWith = assignInWith; - lodash.assignWith = assignWith; - lodash.at = at; - lodash.before = before; - lodash.bind = bind; - lodash.bindAll = bindAll; - lodash.bindKey = bindKey; - lodash.castArray = castArray; - lodash.chain = chain; - lodash.chunk = chunk; - lodash.compact = compact; - lodash.concat = concat; - lodash.cond = cond; - lodash.conforms = conforms; - lodash.constant = constant; - lodash.countBy = countBy; - lodash.create = create; - lodash.curry = curry; - lodash.curryRight = curryRight; - lodash.debounce = debounce; - lodash.defaults = defaults; - lodash.defaultsDeep = defaultsDeep; - lodash.defer = defer; - lodash.delay = delay; - lodash.difference = difference; - lodash.differenceBy = differenceBy; - lodash.differenceWith = differenceWith; - lodash.drop = drop; - lodash.dropRight = dropRight; - lodash.dropRightWhile = dropRightWhile; - lodash.dropWhile = dropWhile; - lodash.fill = fill; - lodash.filter = filter; - lodash.flatMap = flatMap; - lodash.flatMapDeep = flatMapDeep; - lodash.flatMapDepth = flatMapDepth; - lodash.flatten = flatten; - lodash.flattenDeep = flattenDeep; - lodash.flattenDepth = flattenDepth; - lodash.flip = flip; - lodash.flow = flow; - lodash.flowRight = flowRight; - lodash.fromPairs = fromPairs; - lodash.functions = functions; - lodash.functionsIn = functionsIn; - lodash.groupBy = groupBy; - lodash.initial = initial; - lodash.intersection = intersection; - lodash.intersectionBy = intersectionBy; - lodash.intersectionWith = intersectionWith; - lodash.invert = invert; - lodash.invertBy = invertBy; - lodash.invokeMap = invokeMap; - lodash.iteratee = iteratee; - lodash.keyBy = keyBy; - lodash.keys = keys; - lodash.keysIn = keysIn; - lodash.map = map; - lodash.mapKeys = mapKeys; - lodash.mapValues = mapValues; - lodash.matches = matches; - lodash.matchesProperty = matchesProperty; - lodash.memoize = memoize; - lodash.merge = merge; - lodash.mergeWith = mergeWith; - lodash.method = method; - lodash.methodOf = methodOf; - lodash.mixin = mixin; - lodash.negate = negate; - lodash.nthArg = nthArg; - lodash.omit = omit; - lodash.omitBy = omitBy; - lodash.once = once; - lodash.orderBy = orderBy; - lodash.over = over; - lodash.overArgs = overArgs; - lodash.overEvery = overEvery; - lodash.overSome = overSome; - lodash.partial = partial; - lodash.partialRight = partialRight; - lodash.partition = partition; - lodash.pick = pick; - lodash.pickBy = pickBy; - lodash.property = property; - lodash.propertyOf = propertyOf; - lodash.pull = pull; - lodash.pullAll = pullAll; - lodash.pullAllBy = pullAllBy; - lodash.pullAllWith = pullAllWith; - lodash.pullAt = pullAt; - lodash.range = range; - lodash.rangeRight = rangeRight; - lodash.rearg = rearg; - lodash.reject = reject; - lodash.remove = remove; - lodash.rest = rest; - lodash.reverse = reverse; - lodash.sampleSize = sampleSize; - lodash.set = set; - lodash.setWith = setWith; - lodash.shuffle = shuffle; - lodash.slice = slice; - lodash.sortBy = sortBy; - lodash.sortedUniq = sortedUniq; - lodash.sortedUniqBy = sortedUniqBy; - lodash.split = split; - lodash.spread = spread; - lodash.tail = tail; - lodash.take = take; - lodash.takeRight = takeRight; - lodash.takeRightWhile = takeRightWhile; - lodash.takeWhile = takeWhile; - lodash.tap = tap; - lodash.throttle = throttle; - lodash.thru = thru; - lodash.toArray = toArray; - lodash.toPairs = toPairs; - lodash.toPairsIn = toPairsIn; - lodash.toPath = toPath; - lodash.toPlainObject = toPlainObject; - lodash.transform = transform; - lodash.unary = unary; - lodash.union = union; - lodash.unionBy = unionBy; - lodash.unionWith = unionWith; - lodash.uniq = uniq; - lodash.uniqBy = uniqBy; - lodash.uniqWith = uniqWith; - lodash.unset = unset; - lodash.unzip = unzip; - lodash.unzipWith = unzipWith; - lodash.update = update; - lodash.updateWith = updateWith; - lodash.values = values; - lodash.valuesIn = valuesIn; - lodash.without = without; - lodash.words = words; - lodash.wrap = wrap; - lodash.xor = xor; - lodash.xorBy = xorBy; - lodash.xorWith = xorWith; - lodash.zip = zip; - lodash.zipObject = zipObject; - lodash.zipObjectDeep = zipObjectDeep; - lodash.zipWith = zipWith; +/** + * Icon used in the side ribbon. Viewbox 100x100 + */ +const billIcon = ''; +const buyMeACoffee = ` + + + + + + + + + + + + + + + + + + + + + + + + + + + +`; +const paypal = ` + + + + + + + +`; - // Add aliases. - lodash.entries = toPairs; - lodash.entriesIn = toPairsIn; - lodash.extend = assignIn; - lodash.extendWith = assignInWith; +function ascending(a,b){return ab?1:a>=b?0:NaN;} - // Add methods to `lodash.prototype`. - mixin(lodash, lodash); +function bisector(f){let delta=f;let compare=f;if(f.length===1){delta=(d,x)=>f(d)-x;compare=ascendingComparator(f);}function left(a,x,lo,hi){if(lo==null)lo=0;if(hi==null)hi=a.length;while(lo>>1;if(compare(a[mid],x)<0)lo=mid+1;else hi=mid;}return lo;}function right(a,x,lo,hi){if(lo==null)lo=0;if(hi==null)hi=a.length;while(lo>>1;if(compare(a[mid],x)>0)hi=mid;else lo=mid+1;}return lo;}function center(a,x,lo,hi){if(lo==null)lo=0;if(hi==null)hi=a.length;const i=left(a,x,lo,hi-1);return i>lo&&delta(a[i-1],x)>-delta(a[i],x)?i-1:i;}return {left,center,right};}function ascendingComparator(f){return (d,x)=>ascending(f(d),x);} - /*------------------------------------------------------------------------*/ +function number$1(x){return x===null?NaN:+x;} - // Add methods that return unwrapped values in chain sequences. - lodash.add = add; - lodash.attempt = attempt; - lodash.camelCase = camelCase; - lodash.capitalize = capitalize; - lodash.ceil = ceil; - lodash.clamp = clamp; - lodash.clone = clone; - lodash.cloneDeep = cloneDeep; - lodash.cloneDeepWith = cloneDeepWith; - lodash.cloneWith = cloneWith; - lodash.conformsTo = conformsTo; - lodash.deburr = deburr; - lodash.defaultTo = defaultTo; - lodash.divide = divide; - lodash.endsWith = endsWith; - lodash.eq = eq; - lodash.escape = escape; - lodash.escapeRegExp = escapeRegExp; - lodash.every = every; - lodash.find = find; - lodash.findIndex = findIndex; - lodash.findKey = findKey; - lodash.findLast = findLast; - lodash.findLastIndex = findLastIndex; - lodash.findLastKey = findLastKey; - lodash.floor = floor; - lodash.forEach = forEach; - lodash.forEachRight = forEachRight; - lodash.forIn = forIn; - lodash.forInRight = forInRight; - lodash.forOwn = forOwn; - lodash.forOwnRight = forOwnRight; - lodash.get = get; - lodash.gt = gt; - lodash.gte = gte; - lodash.has = has; - lodash.hasIn = hasIn; - lodash.head = head; - lodash.identity = identity; - lodash.includes = includes; - lodash.indexOf = indexOf; - lodash.inRange = inRange; - lodash.invoke = invoke; - lodash.isArguments = isArguments; - lodash.isArray = isArray; - lodash.isArrayBuffer = isArrayBuffer; - lodash.isArrayLike = isArrayLike; - lodash.isArrayLikeObject = isArrayLikeObject; - lodash.isBoolean = isBoolean; - lodash.isBuffer = isBuffer; - lodash.isDate = isDate; - lodash.isElement = isElement; - lodash.isEmpty = isEmpty; - lodash.isEqual = isEqual; - lodash.isEqualWith = isEqualWith; - lodash.isError = isError; - lodash.isFinite = isFinite; - lodash.isFunction = isFunction; - lodash.isInteger = isInteger; - lodash.isLength = isLength; - lodash.isMap = isMap; - lodash.isMatch = isMatch; - lodash.isMatchWith = isMatchWith; - lodash.isNaN = isNaN; - lodash.isNative = isNative; - lodash.isNil = isNil; - lodash.isNull = isNull; - lodash.isNumber = isNumber; - lodash.isObject = isObject; - lodash.isObjectLike = isObjectLike; - lodash.isPlainObject = isPlainObject; - lodash.isRegExp = isRegExp; - lodash.isSafeInteger = isSafeInteger; - lodash.isSet = isSet; - lodash.isString = isString; - lodash.isSymbol = isSymbol; - lodash.isTypedArray = isTypedArray; - lodash.isUndefined = isUndefined; - lodash.isWeakMap = isWeakMap; - lodash.isWeakSet = isWeakSet; - lodash.join = join; - lodash.kebabCase = kebabCase; - lodash.last = last; - lodash.lastIndexOf = lastIndexOf; - lodash.lowerCase = lowerCase; - lodash.lowerFirst = lowerFirst; - lodash.lt = lt; - lodash.lte = lte; - lodash.max = max; - lodash.maxBy = maxBy; - lodash.mean = mean; - lodash.meanBy = meanBy; - lodash.min = min; - lodash.minBy = minBy; - lodash.stubArray = stubArray; - lodash.stubFalse = stubFalse; - lodash.stubObject = stubObject; - lodash.stubString = stubString; - lodash.stubTrue = stubTrue; - lodash.multiply = multiply; - lodash.nth = nth; - lodash.noConflict = noConflict; - lodash.noop = noop; - lodash.now = now; - lodash.pad = pad; - lodash.padEnd = padEnd; - lodash.padStart = padStart; - lodash.parseInt = parseInt; - lodash.random = random; - lodash.reduce = reduce; - lodash.reduceRight = reduceRight; - lodash.repeat = repeat; - lodash.replace = replace; - lodash.result = result; - lodash.round = round; - lodash.runInContext = runInContext; - lodash.sample = sample; - lodash.size = size; - lodash.snakeCase = snakeCase; - lodash.some = some; - lodash.sortedIndex = sortedIndex; - lodash.sortedIndexBy = sortedIndexBy; - lodash.sortedIndexOf = sortedIndexOf; - lodash.sortedLastIndex = sortedLastIndex; - lodash.sortedLastIndexBy = sortedLastIndexBy; - lodash.sortedLastIndexOf = sortedLastIndexOf; - lodash.startCase = startCase; - lodash.startsWith = startsWith; - lodash.subtract = subtract; - lodash.sum = sum; - lodash.sumBy = sumBy; - lodash.template = template; - lodash.times = times; - lodash.toFinite = toFinite; - lodash.toInteger = toInteger; - lodash.toLength = toLength; - lodash.toLower = toLower; - lodash.toNumber = toNumber; - lodash.toSafeInteger = toSafeInteger; - lodash.toString = toString; - lodash.toUpper = toUpper; - lodash.trim = trim; - lodash.trimEnd = trimEnd; - lodash.trimStart = trimStart; - lodash.truncate = truncate; - lodash.unescape = unescape; - lodash.uniqueId = uniqueId; - lodash.upperCase = upperCase; - lodash.upperFirst = upperFirst; +const ascendingBisect=bisector(ascending);const bisectRight=ascendingBisect.right;const bisectCenter=bisector(number$1).center; - // Add aliases. - lodash.each = forEach; - lodash.eachRight = forEachRight; - lodash.first = head; +var e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function ticks(start,stop,count){var reverse,i=-1,n,ticks,step;stop=+stop,start=+start,count=+count;if(start===stop&&count>0)return [start];if(reverse=stop0){let r0=Math.round(start/step),r1=Math.round(stop/step);if(r0*stepstop)--r1;ticks=new Array(n=r1-r0+1);while(++istop)--r1;ticks=new Array(n=r1-r0+1);while(++i=0?(error>=e10?10:error>=e5?5:error>=e2?2:1)*Math.pow(10,power):-Math.pow(10,-power)/(error>=e10?10:error>=e5?5:error>=e2?2:1);}function tickStep(start,stop,count){var step0=Math.abs(stop-start)/Math.max(0,count),step1=Math.pow(10,Math.floor(Math.log(step0)/Math.LN10)),error=step0/step1;if(error>=e10)step1*=10;else if(error>=e5)step1*=5;else if(error>=e2)step1*=2;return stop{}};function dispatch(){for(var i=0,n=arguments.length,_={},t;i=0)name=t.slice(i+1),t=t.slice(0,i);if(t&&!types.hasOwnProperty(t))throw new Error("unknown type: "+t);return {type:t,name:name};});}Dispatch.prototype=dispatch.prototype={constructor:Dispatch,on:function(typename,callback){var _=this._,T=parseTypenames(typename+"",_),t,i=-1,n=T.length;// If no callback was specified, return the callback of the given type and name. +if(arguments.length<2){while(++i0)for(var args=new Array(n),i=0,n,t;i=0&&(prefix=name.slice(0,i))!=="xmlns")name=name.slice(i+1);return namespaces.hasOwnProperty(prefix)?{space:namespaces[prefix],local:name}:name;// eslint-disable-line no-prototype-builtins +} - // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. - arrayEach(['drop', 'take'], function(methodName, index) { - LazyWrapper.prototype[methodName] = function(n) { - n = n === undefined$1 ? 1 : nativeMax(toInteger(n), 0); +function creatorInherit(name){return function(){var document=this.ownerDocument,uri=this.namespaceURI;return uri===xhtml&&document.documentElement.namespaceURI===xhtml?document.createElement(name):document.createElementNS(uri,name);};}function creatorFixed(fullname){return function(){return this.ownerDocument.createElementNS(fullname.space,fullname.local);};}function creator(name){var fullname=namespace(name);return (fullname.local?creatorFixed:creatorInherit)(fullname);} - var result = (this.__filtered__ && !index) - ? new LazyWrapper(this) - : this.clone(); +function none(){}function selector(selector){return selector==null?none:function(){return this.querySelector(selector);};} - if (result.__filtered__) { - result.__takeCount__ = nativeMin(n, result.__takeCount__); - } else { - result.__views__.push({ - 'size': nativeMin(n, MAX_ARRAY_LENGTH), - 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') - }); - } - return result; - }; +function selection_select(select){if(typeof select!=="function")select=selector(select);for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j=i1)i1=i0+1;while(!(next=updateGroup[i1])&&++i1 0 || end < 0)) { - return new LazyWrapper(result); - } - if (start < 0) { - result = result.takeRight(-start); - } else if (start) { - result = result.drop(start); - } - if (end !== undefined$1) { - end = toInteger(end); - result = end < 0 ? result.dropRight(-end) : result.take(end - start); - } - return result; - }; +function selection_merge(selection){if(!(selection instanceof Selection))throw new Error("invalid merge");for(var groups0=this._groups,groups1=selection._groups,m0=groups0.length,m1=groups1.length,m=Math.min(m0,m1),merges=new Array(m0),j=0;j=0;){if(node=group[i]){if(next&&node.compareDocumentPosition(next)^4)next.parentNode.insertBefore(node,next);next=node;}}}return this;} - LazyWrapper.prototype.toArray = function() { - return this.take(MAX_ARRAY_LENGTH); - }; +function selection_sort(compare){if(!compare)compare=ascending$1;function compareNode(a,b){return a&&b?compare(a.__data__,b.__data__):!a-!b;}for(var groups=this._groups,m=groups.length,sortgroups=new Array(m),j=0;jb?1:a>=b?0:NaN;} - // Add `LazyWrapper` methods to `lodash.prototype`. - baseForOwn(LazyWrapper.prototype, function(func, methodName) { - var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), - isTaker = /^(?:head|last)$/.test(methodName), - lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], - retUnwrapped = isTaker || /^find/.test(methodName); +function selection_call(){var callback=arguments[0];arguments[0]=this;callback.apply(null,arguments);return this;} - if (!lodashFunc) { - return; - } - lodash.prototype[methodName] = function() { - var value = this.__wrapped__, - args = isTaker ? [1] : arguments, - isLazy = value instanceof LazyWrapper, - iteratee = args[0], - useLazy = isLazy || isArray(value); +function selection_nodes(){return Array.from(this);} - var interceptor = function(value) { - var result = lodashFunc.apply(lodash, arrayPush([value], args)); - return (isTaker && chainAll) ? result[0] : result; - }; +function selection_node(){for(var groups=this._groups,j=0,m=groups.length;j1?this.each((value==null?styleRemove:typeof value==="function"?styleFunction:styleConstant)(name,value,priority==null?"":priority)):styleValue(this.node(),name);}function styleValue(node,name){return node.style.getPropertyValue(name)||defaultView(node).getComputedStyle(node,null).getPropertyValue(name);} - // Add methods to `LazyWrapper`. - LazyWrapper.prototype.clone = lazyClone; - LazyWrapper.prototype.reverse = lazyReverse; - LazyWrapper.prototype.value = lazyValue; +function propertyRemove(name){return function(){delete this[name];};}function propertyConstant(name,value){return function(){this[name]=value;};}function propertyFunction(name,value){return function(){var v=value.apply(this,arguments);if(v==null)delete this[name];else this[name]=v;};}function selection_property(name,value){return arguments.length>1?this.each((value==null?propertyRemove:typeof value==="function"?propertyFunction:propertyConstant)(name,value)):this.node()[name];} - // Add chain sequence methods to the `lodash` wrapper. - lodash.prototype.at = wrapperAt; - lodash.prototype.chain = wrapperChain; - lodash.prototype.commit = wrapperCommit; - lodash.prototype.next = wrapperNext; - lodash.prototype.plant = wrapperPlant; - lodash.prototype.reverse = wrapperReverse; - lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; +function classArray(string){return string.trim().split(/^|\s+/);}function classList(node){return node.classList||new ClassList(node);}function ClassList(node){this._node=node;this._names=classArray(node.getAttribute("class")||"");}ClassList.prototype={add:function(name){var i=this._names.indexOf(name);if(i<0){this._names.push(name);this._node.setAttribute("class",this._names.join(" "));}},remove:function(name){var i=this._names.indexOf(name);if(i>=0){this._names.splice(i,1);this._node.setAttribute("class",this._names.join(" "));}},contains:function(name){return this._names.indexOf(name)>=0;}};function classedAdd(node,names){var list=classList(node),i=-1,n=names.length;while(++i=0)name=t.slice(i+1),t=t.slice(0,i);return {type:t,name:name};});}function onRemove(typename){return function(){var on=this.__on;if(!on)return;for(var j=0,i=-1,m=on.length,o;j>8&0xf|m>>4&0xf0,m>>4&0xf|m&0xf0,(m&0xf)<<4|m&0xf,1)// #f00 +:l===8?rgba(m>>24&0xff,m>>16&0xff,m>>8&0xff,(m&0xff)/0xff)// #ff000000 +:l===4?rgba(m>>12&0xf|m>>8&0xf0,m>>8&0xf|m>>4&0xf0,m>>4&0xf|m&0xf0,((m&0xf)<<4|m&0xf)/0xff)// #f000 +:null// invalid hex +):(m=reRgbInteger.exec(format))?new Rgb(m[1],m[2],m[3],1)// rgb(255, 0, 0) +:(m=reRgbPercent.exec(format))?new Rgb(m[1]*255/100,m[2]*255/100,m[3]*255/100,1)// rgb(100%, 0%, 0%) +:(m=reRgbaInteger.exec(format))?rgba(m[1],m[2],m[3],m[4])// rgba(255, 0, 0, 1) +:(m=reRgbaPercent.exec(format))?rgba(m[1]*255/100,m[2]*255/100,m[3]*255/100,m[4])// rgb(100%, 0%, 0%, 1) +:(m=reHslPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,1)// hsl(120, 50%, 50%) +:(m=reHslaPercent.exec(format))?hsla(m[1],m[2]/100,m[3]/100,m[4])// hsla(120, 50%, 50%, 1) +:named.hasOwnProperty(format)?rgbn(named[format])// eslint-disable-line no-prototype-builtins +:format==="transparent"?new Rgb(NaN,NaN,NaN,0):null;}function rgbn(n){return new Rgb(n>>16&0xff,n>>8&0xff,n&0xff,1);}function rgba(r,g,b,a){if(a<=0)r=g=b=NaN;return new Rgb(r,g,b,a);}function rgbConvert(o){if(!(o instanceof Color))o=color(o);if(!o)return new Rgb();o=o.rgb();return new Rgb(o.r,o.g,o.b,o.opacity);}function rgb(r,g,b,opacity){return arguments.length===1?rgbConvert(r):new Rgb(r,g,b,opacity==null?1:opacity);}function Rgb(r,g,b,opacity){this.r=+r;this.g=+g;this.b=+b;this.opacity=+opacity;}define(Rgb,rgb,extend(Color,{brighter:function(k){k=k==null?brighter:Math.pow(brighter,k);return new Rgb(this.r*k,this.g*k,this.b*k,this.opacity);},darker:function(k){k=k==null?darker:Math.pow(darker,k);return new Rgb(this.r*k,this.g*k,this.b*k,this.opacity);},rgb:function(){return this;},displayable:function(){return -0.5<=this.r&&this.r<255.5&&-0.5<=this.g&&this.g<255.5&&-0.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1;},hex:rgb_formatHex,// Deprecated! Use color.formatHex. +formatHex:rgb_formatHex,formatRgb:rgb_formatRgb,toString:rgb_formatRgb}));function rgb_formatHex(){return "#"+hex(this.r)+hex(this.g)+hex(this.b);}function rgb_formatRgb(){var a=this.opacity;a=isNaN(a)?1:Math.max(0,Math.min(1,a));return (a===1?"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))+(a===1?")":", "+a+")");}function hex(value){value=Math.max(0,Math.min(255,Math.round(value)||0));return (value<16?"0":"")+value.toString(16);}function hsla(h,s,l,a){if(a<=0)h=s=l=NaN;else if(l<=0||l>=1)h=s=NaN;else if(s<=0)h=NaN;return new Hsl(h,s,l,a);}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(!(o instanceof Color))o=color(o);if(!o)return new Hsl();if(o instanceof Hsl)return o;o=o.rgb();var r=o.r/255,g=o.g/255,b=o.b/255,min=Math.min(r,g,b),max=Math.max(r,g,b),h=NaN,s=max-min,l=(max+min)/2;if(s){if(r===max)h=(g-b)/s+(g0&&l<1?0:h;}return new Hsl(h,s,l,o.opacity);}function hsl(h,s,l,opacity){return arguments.length===1?hslConvert(h):new Hsl(h,s,l,opacity==null?1:opacity);}function Hsl(h,s,l,opacity){this.h=+h;this.s=+s;this.l=+l;this.opacity=+opacity;}define(Hsl,hsl,extend(Color,{brighter:function(k){k=k==null?brighter:Math.pow(brighter,k);return new Hsl(this.h,this.s,this.l*k,this.opacity);},darker:function(k){k=k==null?darker:Math.pow(darker,k);return new Hsl(this.h,this.s,this.l*k,this.opacity);},rgb:function(){var h=this.h%360+(this.h<0)*360,s=isNaN(h)||isNaN(this.s)?0:this.s,l=this.l,m2=l+(l<0.5?l:1-l)*s,m1=2*l-m2;return new Rgb(hsl2rgb(h>=240?h-240:h+120,m1,m2),hsl2rgb(h,m1,m2),hsl2rgb(h<120?h+240:h-120,m1,m2),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 a=this.opacity;a=isNaN(a)?1:Math.max(0,Math.min(1,a));return (a===1?"hsl(":"hsla(")+(this.h||0)+", "+(this.s||0)*100+"%, "+(this.l||0)*100+"%"+(a===1?")":", "+a+")");}}));/* From FvD 13.37, CSS Color Module Level 3 */function hsl2rgb(h,m1,m2){return (h<60?m1+(m2-m1)*h/60:h<180?m2:h<240?m1+(m2-m1)*(240-h)/60:m1)*255;} - Column.prototype.process = function(nextColumn) { - var states = this.states; - var wants = this.wants; - var completed = this.completed; +var constant$1 = (x=>()=>x); - for (var w = 0; w < states.length; w++) { // nb. we push() during iteration - var state = states[w]; +function linear(a,d){return function(t){return a+t*d;};}function exponential(a,b,y){return a=Math.pow(a,y),b=Math.pow(b,y)-a,y=1/y,function(t){return Math.pow(a+t*b,y);};}function gamma(y){return (y=+y)===1?nogamma:function(a,b){return b-a?exponential(a,b,y):constant$1(isNaN(a)?b:a);};}function nogamma(a,b){var d=b-a;return d?linear(a,d):constant$1(isNaN(a)?b:a);} - if (state.isComplete) { - state.finish(); - if (state.data !== Parser.fail) { - // complete - var wantedBy = state.wantedBy; - for (var i = wantedBy.length; i--; ) { // this line is hot - var left = wantedBy[i]; - this.complete(left, state); - } +var interpolateRgb = (function rgbGamma(y){var color=gamma(y);function rgb$1(start,end){var r=color((start=rgb(start)).r,(end=rgb(end)).r),g=color(start.g,end.g),b=color(start.b,end.b),opacity=nogamma(start.opacity,end.opacity);return function(t){start.r=r(t);start.g=g(t);start.b=b(t);start.opacity=opacity(t);return start+"";};}rgb$1.gamma=rgbGamma;return rgb$1;})(1); - // special-case nullables - if (state.reference === this.index) { - // make sure future predictors of this rule get completed. - var exp = state.rule.name; - (this.completed[exp] = this.completed[exp] || []).push(state); - } - } +function numberArray(a,b){if(!b)b=[];var n=a?Math.min(b.length,a.length):0,c=b.slice(),i;return function(t){for(i=0;ibi){// a string precedes the next number in b +bs=b.slice(bi,bs);if(s[i])s[i]+=bs;// coalesce with previous string +else s[++i]=bs;}if((am=am[0])===(bm=bm[0])){// numbers in a & b match +if(s[i])s[i]+=bm;// coalesce with previous string +else s[++i]=bm;}else {// interpolate non-matching numbers +s[++i]=null;q.push({i:i,x:interpolateNumber(am,bm)});}bi=reB.lastIndex;}// Add remains of b. +if(bi180)b+=360;else if(b-a>180)a+=360;// shortest path +q.push({i:s.push(pop(s)+"rotate(",null,degParen)-2,x:interpolateNumber(a,b)});}else if(b){s.push(pop(s)+"rotate("+b+degParen);}}function skewX(a,b,s,q){if(a!==b){q.push({i:s.push(pop(s)+"skewX(",null,degParen)-2,x:interpolateNumber(a,b)});}else if(b){s.push(pop(s)+"skewX("+b+degParen);}}function scale(xa,ya,xb,yb,s,q){if(xa!==xb||ya!==yb){var i=s.push(pop(s)+"scale(",null,",",null,")");q.push({i:i-4,x:interpolateNumber(xa,xb)},{i:i-2,x:interpolateNumber(ya,yb)});}else if(xb!==1||yb!==1){s.push(pop(s)+"scale("+xb+","+yb+")");}}return function(a,b){var s=[],// string constants and placeholders +q=[];// number interpolators +a=parse(a),b=parse(b);translate(a.translateX,a.translateY,b.translateX,b.translateY,s,q);rotate(a.rotate,b.rotate,s,q);skewX(a.skewX,b.skewX,s,q);scale(a.scaleX,a.scaleY,b.scaleX,b.scaleY,s,q);a=b=null;// gc +return function(t){var i=-1,n=q.length,o;while(++i=0)t._call.call(null,e);t=t._next;}--frame;}function wake(){clockNow=(clockLast=clock.now())+clockSkew;frame=timeout=0;try{timerFlush();}finally{frame=0;nap();clockNow=0;}}function poke(){var now=clock.now(),delay=now-clockLast;if(delay>pokeDelay)clockSkew-=delay,clockLast=now;}function nap(){var t0,t1=taskHead,t2,time=Infinity;while(t1){if(t1._call){if(time>t1._time)time=t1._time;t0=t1,t1=t1._next;}else {t2=t1._next,t1._next=null;t1=t0?t0._next=t2:taskHead=t2;}}taskTail=t0;sleep(time);}function sleep(time){if(frame)return;// Soonest alarm already set, or will be. +if(timeout)timeout=clearTimeout(timeout);var delay=time-clockNow;// Strictly less than if we recomputed clockNow. +if(delay>24){if(time{t.stop();callback(elapsed+delay);},delay,time);return t;} - StreamLexer.prototype.next = function() { - if (this.index < this.buffer.length) { - var ch = this.buffer[this.index++]; - if (ch === '\n') { - this.line += 1; - this.lastLineBreak = this.index; - } - return {value: ch}; - } - }; +var emptyOn=dispatch("start","end","cancel","interrupt");var emptyTween=[];var CREATED=0;var SCHEDULED=1;var STARTING=2;var STARTED=3;var RUNNING=4;var ENDING=5;var ENDED=6;function schedule(node,name,id,index,group,timing){var schedules=node.__transition;if(!schedules)node.__transition={};else if(id in schedules)return;create$1(node,id,{name:name,index:index,// For context during callback. +group:group,// For context during callback. +on:emptyOn,tween:emptyTween,time:timing.time,delay:timing.delay,duration:timing.duration,ease:timing.ease,timer:null,state:CREATED});}function init(node,id){var schedule=get$1(node,id);if(schedule.state>CREATED)throw new Error("too late; already scheduled");return schedule;}function set$1(node,id){var schedule=get$1(node,id);if(schedule.state>STARTED)throw new Error("too late; already running");return schedule;}function get$1(node,id){var schedule=node.__transition;if(!schedule||!(schedule=schedule[id]))throw new Error("transition not found");return schedule;}function create$1(node,id,self){var schedules=node.__transition,tween;// Initialize the self timer when the transition is created. +// Note the actual delay is not known until the first callback! +schedules[id]=self;self.timer=timer(schedule,0,self.time);function schedule(elapsed){self.state=SCHEDULED;self.timer.restart(start,self.delay,self.time);// If the elapsed delay is less than our first sleep, start immediately. +if(self.delay<=elapsed)start(elapsed-self.delay);}function start(elapsed){var i,j,n,o;// If the state is not SCHEDULED, then we previously errored on start. +if(self.state!==SCHEDULED)return stop();for(i in schedules){o=schedules[i];if(o.name!==self.name)continue;// While this element already has a starting transition during this frame, +// defer starting an interrupting transition until that transition has a +// chance to tick (and possibly end); see d3/d3-transition#54! +if(o.state===STARTED)return timeout$1(start);// Interrupt the active transition, if any. +if(o.state===RUNNING){o.state=ENDED;o.timer.stop();o.on.call("interrupt",node,node.__data__,o.index,o.group);delete schedules[i];}// Cancel any pre-empted transitions. +else if(+iSTARTING&&schedule.state=0)t=t.slice(0,i);return !t||t==="start";});}function onFunction(id,name,listener){var on0,on1,sit=start(name)?init:set$1;return function(){var schedule=sit(this,id),on=schedule.on;// If this node shared a dispatch with the previous node, +// just assign the updated shared dispatch and we’re done! +// Otherwise, copy-on-write. +if(on!==on0)(on1=(on0=on).copy()).on(name,listener);schedule.on=on1;};}function transition_on(name,listener){var id=this._id;return arguments.length<2?get$1(this.node(),id).on.on(name):this.each(onFunction(id,name,listener));} - var n = this.current + 1; - var nextColumn = new Column(this.grammar, n); - this.table.push(nextColumn); +function removeFunction(id){return function(){var parent=this.parentNode;for(var i in this.__transition)if(+i!==id)return;if(parent)parent.removeChild(this);};}function transition_remove(){return this.on("end.remove",removeFunction(this._id));} - // Advance all tokens that expect the symbol - var literal = token.text !== undefined ? token.text : token.value; - var value = lexer.constructor === StreamLexer ? token.value : token; - var scannable = column.scannable; - for (var w = scannable.length; w--; ) { - var state = scannable[w]; - var expect = state.rule.symbols[state.dot]; - // Try to consume the token - // either regex or literal - if (expect.test ? expect.test(value) : - expect.type ? expect.type === token.type - : expect.literal === literal) { - // Add it - var next = state.nextState({data: value, token: token, isToken: true, reference: n - 1}); - nextColumn.states.push(next); - } - } +function transition_select(select){var name=this._name,id=this._id;if(typeof select!=="function")select=selector(select);for(var groups=this._groups,m=groups.length,subgroups=new Array(m),j=0;j 0) { - lines.push(' ^ ' + sameDisplayCount + ' more lines identical to this'); - } - sameDisplayCount = 0; - lines.push(' ' + display); - } - lastDisplay = display; - } - }; +var defaultTiming={time:null,// Set on use. +delay:0,duration:250,ease:cubicInOut};function inherit(node,id){var timing;while(!(timing=node.__transition)||!(timing=timing[id])){if(!(node=node.parentNode)){throw new Error(`transition ${id} not found`);}}return timing;}function selection_transition(name){var id,timing;if(name instanceof Transition){id=name._id,name=name._name;}else {id=newId(),(timing=defaultTiming).time=now(),name=name==null?null:name+"";}for(var groups=this._groups,m=groups.length,j=0;j'; - } else { - throw new Error('Unknown symbol type: ' + symbol); - } - } - } - - return { - Parser: Parser, - Grammar: Grammar, - Rule: Rule, - }; - -})); -}); - -const parse = (fileContents) => { - const splitFileContents = fileContents.split(/\n[ \t]*\n/); // Split on blank lines - const results = splitFileContents - .filter((lines) => lines.trim() !== '') - .map((lines) => { - const parser = new nearley.Parser(nearley.Grammar.fromCompiled(grammar)); - try { - const innerresults = parser.feed(lines).finish(); - if (innerresults.length !== 1) { - console.error(`Failed to parse (${innerresults.length} results): "${lines}"`); - return undefined; - } - return innerresults[0]; - } - catch (error) { - console.error(`Failed to parse: "${lines}"`); - return undefined; - } - }) - .filter((value) => value !== undefined) - .flat(1); - // TODO: Use alias rows to convert categories - const txs = results.flatMap((el) => el.type === 'tx' ? el : []); - const payees = lodash.sortedUniq(txs - .map(({ value }) => value.payee) - .sort((a, b) => (a.toLowerCase() > b.toLowerCase() ? 1 : -1))); - const categories = lodash.sortedUniq(lodash.flatMap(txs, ({ value }) => value.expenselines.flatMap((line) => line.category ? line.category : [])).sort((a, b) => (a.toLowerCase() > b.toLowerCase() ? 1 : -1))); - return { - transactions: txs, - payees, - categories, - }; -}; - -const formatExpense = (tx, settings) => { - const symb = settings.currencySymbol; - // The final line needs to have the amount updated so all lines total 0. - const total = tx.value.expenselines - .slice(0, -1) - .map(({ amount }) => amount) - .reduce((prev, curr) => curr + prev, 0); - tx.value.expenselines[tx.value.expenselines.length - 1].amount = total * -1; - const joinedLines = tx.value.expenselines - .map(({ category, amount }, i) => { - if (i !== tx.value.expenselines.length - 1 || - settings.includeFinalLineAmount) { - return ` ${category} ${symb}${amount.toFixed(2)}`; - } - // The amount is optional on the final line - return ` ${category}`; - }) - .join('\n'); - return `\n${tx.value.date} ${tx.value.payee}\n${joinedLines}`; -}; -const appendLedger = (cache, vault, settings, newExpense) => __awaiter(void 0, void 0, void 0, function* () { - const file = cache.getFirstLinkpathDest(settings.ledgerFile, ''); - if (file) { - const fileContents = yield vault.read(file); - const newFileContents = `${fileContents}\n${newExpense}`; - yield vault.modify(file, newFileContents); - } - else { - yield vault.create(settings.ledgerFile, newExpense); - } -}); -const getTransactionCache = (cache, vault, settings) => __awaiter(void 0, void 0, void 0, function* () { - const file = cache.getFirstLinkpathDest(settings.ledgerFile, '') || - (yield vault.create(settings.ledgerFile, '')); - const fileContents = yield vault.read(file); - return parse(fileContents); -}); - -/** - * Icon used in the side ribbon. Viewbox 100x100 - */ -const billIcon = ''; -const buyMeACoffee = ` - - - - - - - - - - - - - - - - - - - - - - - - - - - -`; -const paypal = ` - - - - - - - -`; - -function ascending(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; -} - -function bisector(f) { - let delta = f; - let compare = f; - - if (f.length === 1) { - delta = (d, x) => f(d) - x; - compare = ascendingComparator(f); - } - - function left(a, x, lo, hi) { - if (lo == null) lo = 0; - if (hi == null) hi = a.length; - while (lo < hi) { - const mid = (lo + hi) >>> 1; - if (compare(a[mid], x) < 0) lo = mid + 1; - else hi = mid; - } - return lo; - } - - function right(a, x, lo, hi) { - if (lo == null) lo = 0; - if (hi == null) hi = a.length; - while (lo < hi) { - const mid = (lo + hi) >>> 1; - if (compare(a[mid], x) > 0) hi = mid; - else lo = mid + 1; - } - return lo; - } - - function center(a, x, lo, hi) { - if (lo == null) lo = 0; - if (hi == null) hi = a.length; - const i = left(a, x, lo, hi - 1); - return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i; - } - - return {left, center, right}; -} - -function ascendingComparator(f) { - return (d, x) => ascending(f(d), x); -} - -function number$1(x) { - return x === null ? NaN : +x; -} - -const ascendingBisect = bisector(ascending); -const bisectRight = ascendingBisect.right; -const bisectCenter = bisector(number$1).center; - -var e10 = Math.sqrt(50), - e5 = Math.sqrt(10), - e2 = Math.sqrt(2); - -function ticks(start, stop, count) { - var reverse, - i = -1, - n, - ticks, - step; - - stop = +stop, start = +start, count = +count; - if (start === stop && count > 0) return [start]; - if (reverse = stop < start) n = start, start = stop, stop = n; - if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) return []; - - if (step > 0) { - let r0 = Math.round(start / step), r1 = Math.round(stop / step); - if (r0 * step < start) ++r0; - if (r1 * step > stop) --r1; - ticks = new Array(n = r1 - r0 + 1); - while (++i < n) ticks[i] = (r0 + i) * step; - } else { - step = -step; - let r0 = Math.round(start * step), r1 = Math.round(stop * step); - if (r0 / step < start) ++r0; - if (r1 / step > stop) --r1; - ticks = new Array(n = r1 - r0 + 1); - while (++i < n) ticks[i] = (r0 + i) / step; - } - - if (reverse) ticks.reverse(); - - return ticks; -} - -function tickIncrement(start, stop, count) { - var step = (stop - start) / Math.max(0, count), - power = Math.floor(Math.log(step) / Math.LN10), - error = step / Math.pow(10, power); - return power >= 0 - ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power) - : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1); -} - -function tickStep(start, stop, count) { - var step0 = Math.abs(stop - start) / Math.max(0, count), - step1 = Math.pow(10, Math.floor(Math.log(step0) / Math.LN10)), - error = step0 / step1; - if (error >= e10) step1 *= 10; - else if (error >= e5) step1 *= 5; - else if (error >= e2) step1 *= 2; - return stop < start ? -step1 : step1; -} - -function range(start, stop, step) { - start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step; - - var i = -1, - n = Math.max(0, Math.ceil((stop - start) / step)) | 0, - range = new Array(n); - - while (++i < n) { - range[i] = start + i * step; - } - - return range; -} - -var noop = {value: () => {}}; - -function dispatch() { - for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) { - if (!(t = arguments[i] + "") || (t in _) || /[\s.]/.test(t)) throw new Error("illegal type: " + t); - _[t] = []; - } - return new Dispatch(_); -} - -function Dispatch(_) { - this._ = _; -} - -function parseTypenames(typenames, types) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - if (t && !types.hasOwnProperty(t)) throw new Error("unknown type: " + t); - return {type: t, name: name}; - }); -} - -Dispatch.prototype = dispatch.prototype = { - constructor: Dispatch, - on: function(typename, callback) { - var _ = this._, - T = parseTypenames(typename + "", _), - t, - i = -1, - n = T.length; - - // If no callback was specified, return the callback of the given type and name. - if (arguments.length < 2) { - while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t; - return; - } - - // If a type was specified, set the callback for the given type and name. - // Otherwise, if a null callback was specified, remove callbacks of the given name. - if (callback != null && typeof callback !== "function") throw new Error("invalid callback: " + callback); - while (++i < n) { - if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback); - else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null); - } - - return this; - }, - copy: function() { - var copy = {}, _ = this._; - for (var t in _) copy[t] = _[t].slice(); - return new Dispatch(copy); - }, - call: function(type, that) { - if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2]; - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - }, - apply: function(type, that, args) { - if (!this._.hasOwnProperty(type)) throw new Error("unknown type: " + type); - for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args); - } -}; - -function get(type, name) { - for (var i = 0, n = type.length, c; i < n; ++i) { - if ((c = type[i]).name === name) { - return c.value; - } - } -} - -function set(type, name, callback) { - for (var i = 0, n = type.length; i < n; ++i) { - if (type[i].name === name) { - type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1)); - break; - } - } - if (callback != null) type.push({name: name, value: callback}); - return type; -} - -var xhtml = "http://www.w3.org/1999/xhtml"; - -var namespaces = { - svg: "http://www.w3.org/2000/svg", - xhtml: xhtml, - xlink: "http://www.w3.org/1999/xlink", - xml: "http://www.w3.org/XML/1998/namespace", - xmlns: "http://www.w3.org/2000/xmlns/" -}; - -function namespace(name) { - var prefix = name += "", i = prefix.indexOf(":"); - if (i >= 0 && (prefix = name.slice(0, i)) !== "xmlns") name = name.slice(i + 1); - return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins -} - -function creatorInherit(name) { - return function() { - var document = this.ownerDocument, - uri = this.namespaceURI; - return uri === xhtml && document.documentElement.namespaceURI === xhtml - ? document.createElement(name) - : document.createElementNS(uri, name); - }; -} - -function creatorFixed(fullname) { - return function() { - return this.ownerDocument.createElementNS(fullname.space, fullname.local); - }; -} - -function creator(name) { - var fullname = namespace(name); - return (fullname.local - ? creatorFixed - : creatorInherit)(fullname); -} - -function none() {} - -function selector(selector) { - return selector == null ? none : function() { - return this.querySelector(selector); - }; -} - -function selection_select(select) { - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - } - } - } - - return new Selection(subgroups, this._parents); -} - -function array(x) { - return typeof x === "object" && "length" in x - ? x // Array, TypedArray, NodeList, array-like - : Array.from(x); // Map, Set, iterable, string, or anything else -} - -function empty() { - return []; -} - -function selectorAll(selector) { - return selector == null ? empty : function() { - return this.querySelectorAll(selector); - }; -} - -function arrayAll(select) { - return function() { - var group = select.apply(this, arguments); - return group == null ? [] : array(group); - }; -} - -function selection_selectAll(select) { - if (typeof select === "function") select = arrayAll(select); - else select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - subgroups.push(select.call(node, node.__data__, i, group)); - parents.push(node); - } - } - } - - return new Selection(subgroups, parents); -} - -function matcher(selector) { - return function() { - return this.matches(selector); - }; -} - -function childMatcher(selector) { - return function(node) { - return node.matches(selector); - }; -} - -var find = Array.prototype.find; - -function childFind(match) { - return function() { - return find.call(this.children, match); - }; -} - -function childFirst() { - return this.firstElementChild; -} - -function selection_selectChild(match) { - return this.select(match == null ? childFirst - : childFind(typeof match === "function" ? match : childMatcher(match))); -} - -var filter = Array.prototype.filter; - -function children() { - return this.children; -} - -function childrenFilter(match) { - return function() { - return filter.call(this.children, match); - }; -} - -function selection_selectChildren(match) { - return this.selectAll(match == null ? children - : childrenFilter(typeof match === "function" ? match : childMatcher(match))); -} - -function selection_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Selection(subgroups, this._parents); -} - -function sparse(update) { - return new Array(update.length); -} - -function selection_enter() { - return new Selection(this._enter || this._groups.map(sparse), this._parents); -} - -function EnterNode(parent, datum) { - this.ownerDocument = parent.ownerDocument; - this.namespaceURI = parent.namespaceURI; - this._next = null; - this._parent = parent; - this.__data__ = datum; -} - -EnterNode.prototype = { - constructor: EnterNode, - appendChild: function(child) { return this._parent.insertBefore(child, this._next); }, - insertBefore: function(child, next) { return this._parent.insertBefore(child, next); }, - querySelector: function(selector) { return this._parent.querySelector(selector); }, - querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); } -}; - -function constant(x) { - return function() { - return x; - }; -} - -function bindIndex(parent, group, enter, update, exit, data) { - var i = 0, - node, - groupLength = group.length, - dataLength = data.length; - - // Put any non-null nodes that fit into update. - // Put any null nodes into enter. - // Put any remaining data into enter. - for (; i < dataLength; ++i) { - if (node = group[i]) { - node.__data__ = data[i]; - update[i] = node; - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Put any non-null nodes that don’t fit into exit. - for (; i < groupLength; ++i) { - if (node = group[i]) { - exit[i] = node; - } - } -} - -function bindKey(parent, group, enter, update, exit, data, key) { - var i, - node, - nodeByKeyValue = new Map, - groupLength = group.length, - dataLength = data.length, - keyValues = new Array(groupLength), - keyValue; - - // Compute the key for each node. - // If multiple nodes have the same key, the duplicates are added to exit. - for (i = 0; i < groupLength; ++i) { - if (node = group[i]) { - keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + ""; - if (nodeByKeyValue.has(keyValue)) { - exit[i] = node; - } else { - nodeByKeyValue.set(keyValue, node); - } - } - } - - // Compute the key for each datum. - // If there a node associated with this key, join and add it to update. - // If there is not (or the key is a duplicate), add it to enter. - for (i = 0; i < dataLength; ++i) { - keyValue = key.call(parent, data[i], i, data) + ""; - if (node = nodeByKeyValue.get(keyValue)) { - update[i] = node; - node.__data__ = data[i]; - nodeByKeyValue.delete(keyValue); - } else { - enter[i] = new EnterNode(parent, data[i]); - } - } - - // Add any remaining nodes that were not bound to data to exit. - for (i = 0; i < groupLength; ++i) { - if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) { - exit[i] = node; - } - } -} - -function datum(node) { - return node.__data__; -} - -function selection_data(value, key) { - if (!arguments.length) return Array.from(this, datum); - - var bind = key ? bindKey : bindIndex, - parents = this._parents, - groups = this._groups; - - if (typeof value !== "function") value = constant(value); - - for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) { - var parent = parents[j], - group = groups[j], - groupLength = group.length, - data = array(value.call(parent, parent && parent.__data__, j, parents)), - dataLength = data.length, - enterGroup = enter[j] = new Array(dataLength), - updateGroup = update[j] = new Array(dataLength), - exitGroup = exit[j] = new Array(groupLength); - - bind(parent, group, enterGroup, updateGroup, exitGroup, data, key); - - // Now connect the enter nodes to their following update node, such that - // appendChild can insert the materialized enter node before this node, - // rather than at the end of the parent node. - for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) { - if (previous = enterGroup[i0]) { - if (i0 >= i1) i1 = i0 + 1; - while (!(next = updateGroup[i1]) && ++i1 < dataLength); - previous._next = next || null; - } - } - } - - update = new Selection(update, parents); - update._enter = enter; - update._exit = exit; - return update; -} - -function selection_exit() { - return new Selection(this._exit || this._groups.map(sparse), this._parents); -} - -function selection_join(onenter, onupdate, onexit) { - var enter = this.enter(), update = this, exit = this.exit(); - enter = typeof onenter === "function" ? onenter(enter) : enter.append(onenter + ""); - if (onupdate != null) update = onupdate(update); - if (onexit == null) exit.remove(); else onexit(exit); - return enter && update ? enter.merge(update).order() : update; -} - -function selection_merge(selection) { - if (!(selection instanceof Selection)) throw new Error("invalid merge"); - - for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Selection(merges, this._parents); -} - -function selection_order() { - - for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) { - for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) { - if (node = group[i]) { - if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next); - next = node; - } - } - } - - return this; -} - -function selection_sort(compare) { - if (!compare) compare = ascending$1; - - function compareNode(a, b) { - return a && b ? compare(a.__data__, b.__data__) : !a - !b; - } - - for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group[i]) { - sortgroup[i] = node; - } - } - sortgroup.sort(compareNode); - } - - return new Selection(sortgroups, this._parents).order(); -} - -function ascending$1(a, b) { - return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN; -} - -function selection_call() { - var callback = arguments[0]; - arguments[0] = this; - callback.apply(null, arguments); - return this; -} - -function selection_nodes() { - return Array.from(this); -} - -function selection_node() { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length; i < n; ++i) { - var node = group[i]; - if (node) return node; - } - } - - return null; -} - -function selection_size() { - let size = 0; - for (const node of this) ++size; // eslint-disable-line no-unused-vars - return size; -} - -function selection_empty() { - return !this.node(); -} - -function selection_each(callback) { - - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) callback.call(node, node.__data__, i, group); - } - } - - return this; -} - -function attrRemove(name) { - return function() { - this.removeAttribute(name); - }; -} - -function attrRemoveNS(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} - -function attrConstant(name, value) { - return function() { - this.setAttribute(name, value); - }; -} - -function attrConstantNS(fullname, value) { - return function() { - this.setAttributeNS(fullname.space, fullname.local, value); - }; -} - -function attrFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttribute(name); - else this.setAttribute(name, v); - }; -} - -function attrFunctionNS(fullname, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.removeAttributeNS(fullname.space, fullname.local); - else this.setAttributeNS(fullname.space, fullname.local, v); - }; -} - -function selection_attr(name, value) { - var fullname = namespace(name); - - if (arguments.length < 2) { - var node = this.node(); - return fullname.local - ? node.getAttributeNS(fullname.space, fullname.local) - : node.getAttribute(fullname); - } - - return this.each((value == null - ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === "function" - ? (fullname.local ? attrFunctionNS : attrFunction) - : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value)); -} - -function defaultView(node) { - return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node - || (node.document && node) // node is a Window - || node.defaultView; // node is a Document -} - -function styleRemove(name) { - return function() { - this.style.removeProperty(name); - }; -} - -function styleConstant(name, value, priority) { - return function() { - this.style.setProperty(name, value, priority); - }; -} - -function styleFunction(name, value, priority) { - return function() { - var v = value.apply(this, arguments); - if (v == null) this.style.removeProperty(name); - else this.style.setProperty(name, v, priority); - }; -} - -function selection_style(name, value, priority) { - return arguments.length > 1 - ? this.each((value == null - ? styleRemove : typeof value === "function" - ? styleFunction - : styleConstant)(name, value, priority == null ? "" : priority)) - : styleValue(this.node(), name); -} - -function styleValue(node, name) { - return node.style.getPropertyValue(name) - || defaultView(node).getComputedStyle(node, null).getPropertyValue(name); -} - -function propertyRemove(name) { - return function() { - delete this[name]; - }; -} - -function propertyConstant(name, value) { - return function() { - this[name] = value; - }; -} - -function propertyFunction(name, value) { - return function() { - var v = value.apply(this, arguments); - if (v == null) delete this[name]; - else this[name] = v; - }; -} - -function selection_property(name, value) { - return arguments.length > 1 - ? this.each((value == null - ? propertyRemove : typeof value === "function" - ? propertyFunction - : propertyConstant)(name, value)) - : this.node()[name]; -} - -function classArray(string) { - return string.trim().split(/^|\s+/); -} - -function classList(node) { - return node.classList || new ClassList(node); -} - -function ClassList(node) { - this._node = node; - this._names = classArray(node.getAttribute("class") || ""); -} - -ClassList.prototype = { - add: function(name) { - var i = this._names.indexOf(name); - if (i < 0) { - this._names.push(name); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - remove: function(name) { - var i = this._names.indexOf(name); - if (i >= 0) { - this._names.splice(i, 1); - this._node.setAttribute("class", this._names.join(" ")); - } - }, - contains: function(name) { - return this._names.indexOf(name) >= 0; - } -}; - -function classedAdd(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.add(names[i]); -} - -function classedRemove(node, names) { - var list = classList(node), i = -1, n = names.length; - while (++i < n) list.remove(names[i]); -} - -function classedTrue(names) { - return function() { - classedAdd(this, names); - }; -} - -function classedFalse(names) { - return function() { - classedRemove(this, names); - }; -} - -function classedFunction(names, value) { - return function() { - (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names); - }; -} - -function selection_classed(name, value) { - var names = classArray(name + ""); - - if (arguments.length < 2) { - var list = classList(this.node()), i = -1, n = names.length; - while (++i < n) if (!list.contains(names[i])) return false; - return true; - } - - return this.each((typeof value === "function" - ? classedFunction : value - ? classedTrue - : classedFalse)(names, value)); -} - -function textRemove() { - this.textContent = ""; -} - -function textConstant(value) { - return function() { - this.textContent = value; - }; -} - -function textFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.textContent = v == null ? "" : v; - }; -} - -function selection_text(value) { - return arguments.length - ? this.each(value == null - ? textRemove : (typeof value === "function" - ? textFunction - : textConstant)(value)) - : this.node().textContent; -} - -function htmlRemove() { - this.innerHTML = ""; -} - -function htmlConstant(value) { - return function() { - this.innerHTML = value; - }; -} - -function htmlFunction(value) { - return function() { - var v = value.apply(this, arguments); - this.innerHTML = v == null ? "" : v; - }; -} - -function selection_html(value) { - return arguments.length - ? this.each(value == null - ? htmlRemove : (typeof value === "function" - ? htmlFunction - : htmlConstant)(value)) - : this.node().innerHTML; -} - -function raise() { - if (this.nextSibling) this.parentNode.appendChild(this); -} - -function selection_raise() { - return this.each(raise); -} - -function lower() { - if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild); -} - -function selection_lower() { - return this.each(lower); -} - -function selection_append(name) { - var create = typeof name === "function" ? name : creator(name); - return this.select(function() { - return this.appendChild(create.apply(this, arguments)); - }); -} - -function constantNull() { - return null; -} - -function selection_insert(name, before) { - var create = typeof name === "function" ? name : creator(name), - select = before == null ? constantNull : typeof before === "function" ? before : selector(before); - return this.select(function() { - return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null); - }); -} - -function remove() { - var parent = this.parentNode; - if (parent) parent.removeChild(this); -} - -function selection_remove() { - return this.each(remove); -} - -function selection_cloneShallow() { - var clone = this.cloneNode(false), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} - -function selection_cloneDeep() { - var clone = this.cloneNode(true), parent = this.parentNode; - return parent ? parent.insertBefore(clone, this.nextSibling) : clone; -} - -function selection_clone(deep) { - return this.select(deep ? selection_cloneDeep : selection_cloneShallow); -} - -function selection_datum(value) { - return arguments.length - ? this.property("__data__", value) - : this.node().__data__; -} - -function contextListener(listener) { - return function(event) { - listener.call(this, event, this.__data__); - }; -} - -function parseTypenames$1(typenames) { - return typenames.trim().split(/^|\s+/).map(function(t) { - var name = "", i = t.indexOf("."); - if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i); - return {type: t, name: name}; - }); -} - -function onRemove(typename) { - return function() { - var on = this.__on; - if (!on) return; - for (var j = 0, i = -1, m = on.length, o; j < m; ++j) { - if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - } else { - on[++i] = o; - } - } - if (++i) on.length = i; - else delete this.__on; - }; -} - -function onAdd(typename, value, options) { - return function() { - var on = this.__on, o, listener = contextListener(value); - if (on) for (var j = 0, m = on.length; j < m; ++j) { - if ((o = on[j]).type === typename.type && o.name === typename.name) { - this.removeEventListener(o.type, o.listener, o.options); - this.addEventListener(o.type, o.listener = listener, o.options = options); - o.value = value; - return; - } - } - this.addEventListener(typename.type, listener, options); - o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options}; - if (!on) this.__on = [o]; - else on.push(o); - }; -} - -function selection_on(typename, value, options) { - var typenames = parseTypenames$1(typename + ""), i, n = typenames.length, t; - - if (arguments.length < 2) { - var on = this.node().__on; - if (on) for (var j = 0, m = on.length, o; j < m; ++j) { - for (i = 0, o = on[j]; i < n; ++i) { - if ((t = typenames[i]).type === o.type && t.name === o.name) { - return o.value; - } - } - } - return; - } - - on = value ? onAdd : onRemove; - for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options)); - return this; -} - -function dispatchEvent(node, type, params) { - var window = defaultView(node), - event = window.CustomEvent; - - if (typeof event === "function") { - event = new event(type, params); - } else { - event = window.document.createEvent("Event"); - if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail; - else event.initEvent(type, false, false); - } - - node.dispatchEvent(event); -} - -function dispatchConstant(type, params) { - return function() { - return dispatchEvent(this, type, params); - }; -} - -function dispatchFunction(type, params) { - return function() { - return dispatchEvent(this, type, params.apply(this, arguments)); - }; -} - -function selection_dispatch(type, params) { - return this.each((typeof params === "function" - ? dispatchFunction - : dispatchConstant)(type, params)); -} - -function* selection_iterator() { - for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) { - for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) { - if (node = group[i]) yield node; - } - } -} - -var root = [null]; - -function Selection(groups, parents) { - this._groups = groups; - this._parents = parents; -} - -function selection() { - return new Selection([[document.documentElement]], root); -} - -function selection_selection() { - return this; -} - -Selection.prototype = selection.prototype = { - constructor: Selection, - select: selection_select, - selectAll: selection_selectAll, - selectChild: selection_selectChild, - selectChildren: selection_selectChildren, - filter: selection_filter, - data: selection_data, - enter: selection_enter, - exit: selection_exit, - join: selection_join, - merge: selection_merge, - selection: selection_selection, - order: selection_order, - sort: selection_sort, - call: selection_call, - nodes: selection_nodes, - node: selection_node, - size: selection_size, - empty: selection_empty, - each: selection_each, - attr: selection_attr, - style: selection_style, - property: selection_property, - classed: selection_classed, - text: selection_text, - html: selection_html, - raise: selection_raise, - lower: selection_lower, - append: selection_append, - insert: selection_insert, - remove: selection_remove, - clone: selection_clone, - datum: selection_datum, - on: selection_on, - dispatch: selection_dispatch, - [Symbol.iterator]: selection_iterator -}; - -function select(selector) { - return typeof selector === "string" - ? new Selection([[document.querySelector(selector)]], [document.documentElement]) - : new Selection([[selector]], root); -} - -function create(name) { - return select(creator(name).call(document.documentElement)); -} - -function define(constructor, factory, prototype) { - constructor.prototype = factory.prototype = prototype; - prototype.constructor = constructor; -} - -function extend(parent, definition) { - var prototype = Object.create(parent.prototype); - for (var key in definition) prototype[key] = definition[key]; - return prototype; -} - -function Color() {} - -var darker = 0.7; -var brighter = 1 / darker; - -var reI = "\\s*([+-]?\\d+)\\s*", - reN = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*", - reP = "\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*", - reHex = /^#([0-9a-f]{3,8})$/, - reRgbInteger = new RegExp("^rgb\\(" + [reI, reI, reI] + "\\)$"), - reRgbPercent = new RegExp("^rgb\\(" + [reP, reP, reP] + "\\)$"), - reRgbaInteger = new RegExp("^rgba\\(" + [reI, reI, reI, reN] + "\\)$"), - reRgbaPercent = new RegExp("^rgba\\(" + [reP, reP, reP, reN] + "\\)$"), - reHslPercent = new RegExp("^hsl\\(" + [reN, reP, reP] + "\\)$"), - reHslaPercent = new RegExp("^hsla\\(" + [reN, reP, reP, reN] + "\\)$"); - -var named = { - aliceblue: 0xf0f8ff, - antiquewhite: 0xfaebd7, - aqua: 0x00ffff, - aquamarine: 0x7fffd4, - azure: 0xf0ffff, - beige: 0xf5f5dc, - bisque: 0xffe4c4, - black: 0x000000, - blanchedalmond: 0xffebcd, - blue: 0x0000ff, - blueviolet: 0x8a2be2, - brown: 0xa52a2a, - burlywood: 0xdeb887, - cadetblue: 0x5f9ea0, - chartreuse: 0x7fff00, - chocolate: 0xd2691e, - coral: 0xff7f50, - cornflowerblue: 0x6495ed, - cornsilk: 0xfff8dc, - crimson: 0xdc143c, - cyan: 0x00ffff, - darkblue: 0x00008b, - darkcyan: 0x008b8b, - darkgoldenrod: 0xb8860b, - darkgray: 0xa9a9a9, - darkgreen: 0x006400, - darkgrey: 0xa9a9a9, - darkkhaki: 0xbdb76b, - darkmagenta: 0x8b008b, - darkolivegreen: 0x556b2f, - darkorange: 0xff8c00, - darkorchid: 0x9932cc, - darkred: 0x8b0000, - darksalmon: 0xe9967a, - darkseagreen: 0x8fbc8f, - darkslateblue: 0x483d8b, - darkslategray: 0x2f4f4f, - darkslategrey: 0x2f4f4f, - darkturquoise: 0x00ced1, - darkviolet: 0x9400d3, - deeppink: 0xff1493, - deepskyblue: 0x00bfff, - dimgray: 0x696969, - dimgrey: 0x696969, - dodgerblue: 0x1e90ff, - firebrick: 0xb22222, - floralwhite: 0xfffaf0, - forestgreen: 0x228b22, - fuchsia: 0xff00ff, - gainsboro: 0xdcdcdc, - ghostwhite: 0xf8f8ff, - gold: 0xffd700, - goldenrod: 0xdaa520, - gray: 0x808080, - green: 0x008000, - greenyellow: 0xadff2f, - grey: 0x808080, - honeydew: 0xf0fff0, - hotpink: 0xff69b4, - indianred: 0xcd5c5c, - indigo: 0x4b0082, - ivory: 0xfffff0, - khaki: 0xf0e68c, - lavender: 0xe6e6fa, - lavenderblush: 0xfff0f5, - lawngreen: 0x7cfc00, - lemonchiffon: 0xfffacd, - lightblue: 0xadd8e6, - lightcoral: 0xf08080, - lightcyan: 0xe0ffff, - lightgoldenrodyellow: 0xfafad2, - lightgray: 0xd3d3d3, - lightgreen: 0x90ee90, - lightgrey: 0xd3d3d3, - lightpink: 0xffb6c1, - lightsalmon: 0xffa07a, - lightseagreen: 0x20b2aa, - lightskyblue: 0x87cefa, - lightslategray: 0x778899, - lightslategrey: 0x778899, - lightsteelblue: 0xb0c4de, - lightyellow: 0xffffe0, - lime: 0x00ff00, - limegreen: 0x32cd32, - linen: 0xfaf0e6, - magenta: 0xff00ff, - maroon: 0x800000, - mediumaquamarine: 0x66cdaa, - mediumblue: 0x0000cd, - mediumorchid: 0xba55d3, - mediumpurple: 0x9370db, - mediumseagreen: 0x3cb371, - mediumslateblue: 0x7b68ee, - mediumspringgreen: 0x00fa9a, - mediumturquoise: 0x48d1cc, - mediumvioletred: 0xc71585, - midnightblue: 0x191970, - mintcream: 0xf5fffa, - mistyrose: 0xffe4e1, - moccasin: 0xffe4b5, - navajowhite: 0xffdead, - navy: 0x000080, - oldlace: 0xfdf5e6, - olive: 0x808000, - olivedrab: 0x6b8e23, - orange: 0xffa500, - orangered: 0xff4500, - orchid: 0xda70d6, - palegoldenrod: 0xeee8aa, - palegreen: 0x98fb98, - paleturquoise: 0xafeeee, - palevioletred: 0xdb7093, - papayawhip: 0xffefd5, - peachpuff: 0xffdab9, - peru: 0xcd853f, - pink: 0xffc0cb, - plum: 0xdda0dd, - powderblue: 0xb0e0e6, - purple: 0x800080, - rebeccapurple: 0x663399, - red: 0xff0000, - rosybrown: 0xbc8f8f, - royalblue: 0x4169e1, - saddlebrown: 0x8b4513, - salmon: 0xfa8072, - sandybrown: 0xf4a460, - seagreen: 0x2e8b57, - seashell: 0xfff5ee, - sienna: 0xa0522d, - silver: 0xc0c0c0, - skyblue: 0x87ceeb, - slateblue: 0x6a5acd, - slategray: 0x708090, - slategrey: 0x708090, - snow: 0xfffafa, - springgreen: 0x00ff7f, - steelblue: 0x4682b4, - tan: 0xd2b48c, - teal: 0x008080, - thistle: 0xd8bfd8, - tomato: 0xff6347, - turquoise: 0x40e0d0, - violet: 0xee82ee, - wheat: 0xf5deb3, - white: 0xffffff, - whitesmoke: 0xf5f5f5, - yellow: 0xffff00, - yellowgreen: 0x9acd32 -}; - -define(Color, color, { - copy: function(channels) { - return Object.assign(new this.constructor, this, channels); - }, - displayable: function() { - return this.rgb().displayable(); - }, - hex: color_formatHex, // Deprecated! Use color.formatHex. - formatHex: color_formatHex, - formatHsl: color_formatHsl, - formatRgb: color_formatRgb, - toString: color_formatRgb -}); - -function color_formatHex() { - return this.rgb().formatHex(); -} - -function color_formatHsl() { - return hslConvert(this).formatHsl(); -} - -function color_formatRgb() { - return this.rgb().formatRgb(); -} - -function color(format) { - var m, l; - format = (format + "").trim().toLowerCase(); - return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000 - : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00 - : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000 - : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000 - : null) // invalid hex - : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0) - : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%) - : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1) - : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1) - : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%) - : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1) - : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins - : format === "transparent" ? new Rgb(NaN, NaN, NaN, 0) - : null; -} - -function rgbn(n) { - return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1); -} - -function rgba(r, g, b, a) { - if (a <= 0) r = g = b = NaN; - return new Rgb(r, g, b, a); -} - -function rgbConvert(o) { - if (!(o instanceof Color)) o = color(o); - if (!o) return new Rgb; - o = o.rgb(); - return new Rgb(o.r, o.g, o.b, o.opacity); -} - -function rgb(r, g, b, opacity) { - return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity); -} - -function Rgb(r, g, b, opacity) { - this.r = +r; - this.g = +g; - this.b = +b; - this.opacity = +opacity; -} - -define(Rgb, rgb, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity); - }, - rgb: function() { - return this; - }, - displayable: function() { - return (-0.5 <= this.r && this.r < 255.5) - && (-0.5 <= this.g && this.g < 255.5) - && (-0.5 <= this.b && this.b < 255.5) - && (0 <= this.opacity && this.opacity <= 1); - }, - hex: rgb_formatHex, // Deprecated! Use color.formatHex. - formatHex: rgb_formatHex, - formatRgb: rgb_formatRgb, - toString: rgb_formatRgb -})); - -function rgb_formatHex() { - return "#" + hex(this.r) + hex(this.g) + hex(this.b); -} - -function rgb_formatRgb() { - var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "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)) - + (a === 1 ? ")" : ", " + a + ")"); -} - -function hex(value) { - value = Math.max(0, Math.min(255, Math.round(value) || 0)); - return (value < 16 ? "0" : "") + value.toString(16); -} - -function hsla(h, s, l, a) { - if (a <= 0) h = s = l = NaN; - else if (l <= 0 || l >= 1) h = s = NaN; - else if (s <= 0) h = NaN; - return new Hsl(h, s, l, a); -} - -function hslConvert(o) { - if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity); - if (!(o instanceof Color)) o = color(o); - if (!o) return new Hsl; - if (o instanceof Hsl) return o; - o = o.rgb(); - var r = o.r / 255, - g = o.g / 255, - b = o.b / 255, - min = Math.min(r, g, b), - max = Math.max(r, g, b), - h = NaN, - s = max - min, - l = (max + min) / 2; - if (s) { - if (r === max) h = (g - b) / s + (g < b) * 6; - else if (g === max) h = (b - r) / s + 2; - else h = (r - g) / s + 4; - s /= l < 0.5 ? max + min : 2 - max - min; - h *= 60; - } else { - s = l > 0 && l < 1 ? 0 : h; - } - return new Hsl(h, s, l, o.opacity); -} - -function hsl(h, s, l, opacity) { - return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity); -} - -function Hsl(h, s, l, opacity) { - this.h = +h; - this.s = +s; - this.l = +l; - this.opacity = +opacity; -} - -define(Hsl, hsl, extend(Color, { - brighter: function(k) { - k = k == null ? brighter : Math.pow(brighter, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - darker: function(k) { - k = k == null ? darker : Math.pow(darker, k); - return new Hsl(this.h, this.s, this.l * k, this.opacity); - }, - rgb: function() { - var h = this.h % 360 + (this.h < 0) * 360, - s = isNaN(h) || isNaN(this.s) ? 0 : this.s, - l = this.l, - m2 = l + (l < 0.5 ? l : 1 - l) * s, - m1 = 2 * l - m2; - return new Rgb( - hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2), - hsl2rgb(h, m1, m2), - hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2), - 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 a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a)); - return (a === 1 ? "hsl(" : "hsla(") - + (this.h || 0) + ", " - + (this.s || 0) * 100 + "%, " - + (this.l || 0) * 100 + "%" - + (a === 1 ? ")" : ", " + a + ")"); - } -})); - -/* From FvD 13.37, CSS Color Module Level 3 */ -function hsl2rgb(h, m1, m2) { - return (h < 60 ? m1 + (m2 - m1) * h / 60 - : h < 180 ? m2 - : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60 - : m1) * 255; -} - -var constant$1 = x => () => x; - -function linear(a, d) { - return function(t) { - return a + t * d; - }; -} - -function exponential(a, b, y) { - return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) { - return Math.pow(a + t * b, y); - }; -} - -function gamma(y) { - return (y = +y) === 1 ? nogamma : function(a, b) { - return b - a ? exponential(a, b, y) : constant$1(isNaN(a) ? b : a); - }; -} - -function nogamma(a, b) { - var d = b - a; - return d ? linear(a, d) : constant$1(isNaN(a) ? b : a); -} - -var interpolateRgb = (function rgbGamma(y) { - var color = gamma(y); - - function rgb$1(start, end) { - var r = color((start = rgb(start)).r, (end = rgb(end)).r), - g = color(start.g, end.g), - b = color(start.b, end.b), - opacity = nogamma(start.opacity, end.opacity); - return function(t) { - start.r = r(t); - start.g = g(t); - start.b = b(t); - start.opacity = opacity(t); - return start + ""; - }; - } - - rgb$1.gamma = rgbGamma; - - return rgb$1; -})(1); - -function numberArray(a, b) { - if (!b) b = []; - var n = a ? Math.min(b.length, a.length) : 0, - c = b.slice(), - i; - return function(t) { - for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t; - return c; - }; -} - -function isNumberArray(x) { - return ArrayBuffer.isView(x) && !(x instanceof DataView); -} - -function genericArray(a, b) { - var nb = b ? b.length : 0, - na = a ? Math.min(nb, a.length) : 0, - x = new Array(na), - c = new Array(nb), - i; - - for (i = 0; i < na; ++i) x[i] = interpolate(a[i], b[i]); - for (; i < nb; ++i) c[i] = b[i]; - - return function(t) { - for (i = 0; i < na; ++i) c[i] = x[i](t); - return c; - }; -} - -function date$1(a, b) { - var d = new Date; - return a = +a, b = +b, function(t) { - return d.setTime(a * (1 - t) + b * t), d; - }; -} - -function interpolateNumber(a, b) { - return a = +a, b = +b, function(t) { - return a * (1 - t) + b * t; - }; -} - -function object(a, b) { - var i = {}, - c = {}, - k; - - if (a === null || typeof a !== "object") a = {}; - if (b === null || typeof b !== "object") b = {}; - - for (k in b) { - if (k in a) { - i[k] = interpolate(a[k], b[k]); - } else { - c[k] = b[k]; - } - } - - return function(t) { - for (k in i) c[k] = i[k](t); - return c; - }; -} - -var reA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, - reB = new RegExp(reA.source, "g"); - -function zero(b) { - return function() { - return b; - }; -} - -function one(b) { - return function(t) { - return b(t) + ""; - }; -} - -function interpolateString(a, b) { - var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b - am, // current match in a - bm, // current match in b - bs, // string preceding current number in b, if any - i = -1, // index in s - s = [], // string constants and placeholders - q = []; // number interpolators - - // Coerce inputs to strings. - a = a + "", b = b + ""; - - // Interpolate pairs of numbers in a & b. - while ((am = reA.exec(a)) - && (bm = reB.exec(b))) { - if ((bs = bm.index) > bi) { // a string precedes the next number in b - bs = b.slice(bi, bs); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match - if (s[i]) s[i] += bm; // coalesce with previous string - else s[++i] = bm; - } else { // interpolate non-matching numbers - s[++i] = null; - q.push({i: i, x: interpolateNumber(am, bm)}); - } - bi = reB.lastIndex; - } - - // Add remains of b. - if (bi < b.length) { - bs = b.slice(bi); - if (s[i]) s[i] += bs; // coalesce with previous string - else s[++i] = bs; - } - - // Special optimization for only a single match. - // Otherwise, interpolate each of the numbers and rejoin the string. - return s.length < 2 ? (q[0] - ? one(q[0].x) - : zero(b)) - : (b = q.length, function(t) { - for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }); -} - -function interpolate(a, b) { - var t = typeof b, c; - return b == null || t === "boolean" ? constant$1(b) - : (t === "number" ? interpolateNumber - : t === "string" ? ((c = color(b)) ? (b = c, interpolateRgb) : interpolateString) - : b instanceof color ? interpolateRgb - : b instanceof Date ? date$1 - : isNumberArray(b) ? numberArray - : Array.isArray(b) ? genericArray - : typeof b.valueOf !== "function" && typeof b.toString !== "function" || isNaN(b) ? object - : interpolateNumber)(a, b); -} - -function interpolateRound(a, b) { - return a = +a, b = +b, function(t) { - return Math.round(a * (1 - t) + b * t); - }; -} - -var degrees = 180 / Math.PI; - -var identity = { - translateX: 0, - translateY: 0, - rotate: 0, - skewX: 0, - scaleX: 1, - scaleY: 1 -}; - -function decompose(a, b, c, d, e, f) { - var scaleX, scaleY, skewX; - if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX; - if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX; - if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY; - if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX; - return { - translateX: e, - translateY: f, - rotate: Math.atan2(b, a) * degrees, - skewX: Math.atan(skewX) * degrees, - scaleX: scaleX, - scaleY: scaleY - }; -} - -var svgNode; - -/* eslint-disable no-undef */ -function parseCss(value) { - const m = new (typeof DOMMatrix === "function" ? DOMMatrix : WebKitCSSMatrix)(value + ""); - return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f); -} - -function parseSvg(value) { - if (value == null) return identity; - if (!svgNode) svgNode = document.createElementNS("http://www.w3.org/2000/svg", "g"); - svgNode.setAttribute("transform", value); - if (!(value = svgNode.transform.baseVal.consolidate())) return identity; - value = value.matrix; - return decompose(value.a, value.b, value.c, value.d, value.e, value.f); -} - -function interpolateTransform(parse, pxComma, pxParen, degParen) { - - function pop(s) { - return s.length ? s.pop() + " " : ""; - } - - function translate(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push("translate(", null, pxComma, null, pxParen); - q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)}); - } else if (xb || yb) { - s.push("translate(" + xb + pxComma + yb + pxParen); - } - } - - function rotate(a, b, s, q) { - if (a !== b) { - if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path - q.push({i: s.push(pop(s) + "rotate(", null, degParen) - 2, x: interpolateNumber(a, b)}); - } else if (b) { - s.push(pop(s) + "rotate(" + b + degParen); - } - } - - function skewX(a, b, s, q) { - if (a !== b) { - q.push({i: s.push(pop(s) + "skewX(", null, degParen) - 2, x: interpolateNumber(a, b)}); - } else if (b) { - s.push(pop(s) + "skewX(" + b + degParen); - } - } - - function scale(xa, ya, xb, yb, s, q) { - if (xa !== xb || ya !== yb) { - var i = s.push(pop(s) + "scale(", null, ",", null, ")"); - q.push({i: i - 4, x: interpolateNumber(xa, xb)}, {i: i - 2, x: interpolateNumber(ya, yb)}); - } else if (xb !== 1 || yb !== 1) { - s.push(pop(s) + "scale(" + xb + "," + yb + ")"); - } - } - - return function(a, b) { - var s = [], // string constants and placeholders - q = []; // number interpolators - a = parse(a), b = parse(b); - translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q); - rotate(a.rotate, b.rotate, s, q); - skewX(a.skewX, b.skewX, s, q); - scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q); - a = b = null; // gc - return function(t) { - var i = -1, n = q.length, o; - while (++i < n) s[(o = q[i]).i] = o.x(t); - return s.join(""); - }; - }; -} - -var interpolateTransformCss = interpolateTransform(parseCss, "px, ", "px)", "deg)"); -var interpolateTransformSvg = interpolateTransform(parseSvg, ", ", ")", ")"); - -var frame = 0, // is an animation frame pending? - timeout = 0, // is a timeout pending? - interval = 0, // are any timers active? - pokeDelay = 1000, // how frequently we check for clock skew - taskHead, - taskTail, - clockLast = 0, - clockNow = 0, - clockSkew = 0, - clock = typeof performance === "object" && performance.now ? performance : Date, - setFrame = typeof window === "object" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); }; - -function now() { - return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew); -} - -function clearNow() { - clockNow = 0; -} - -function Timer() { - this._call = - this._time = - this._next = null; -} - -Timer.prototype = timer.prototype = { - constructor: Timer, - restart: function(callback, delay, time) { - if (typeof callback !== "function") throw new TypeError("callback is not a function"); - time = (time == null ? now() : +time) + (delay == null ? 0 : +delay); - if (!this._next && taskTail !== this) { - if (taskTail) taskTail._next = this; - else taskHead = this; - taskTail = this; - } - this._call = callback; - this._time = time; - sleep(); - }, - stop: function() { - if (this._call) { - this._call = null; - this._time = Infinity; - sleep(); - } - } -}; - -function timer(callback, delay, time) { - var t = new Timer; - t.restart(callback, delay, time); - return t; -} - -function timerFlush() { - now(); // Get the current time, if not already set. - ++frame; // Pretend we’ve set an alarm, if we haven’t already. - var t = taskHead, e; - while (t) { - if ((e = clockNow - t._time) >= 0) t._call.call(null, e); - t = t._next; - } - --frame; -} - -function wake() { - clockNow = (clockLast = clock.now()) + clockSkew; - frame = timeout = 0; - try { - timerFlush(); - } finally { - frame = 0; - nap(); - clockNow = 0; - } -} - -function poke() { - var now = clock.now(), delay = now - clockLast; - if (delay > pokeDelay) clockSkew -= delay, clockLast = now; -} - -function nap() { - var t0, t1 = taskHead, t2, time = Infinity; - while (t1) { - if (t1._call) { - if (time > t1._time) time = t1._time; - t0 = t1, t1 = t1._next; - } else { - t2 = t1._next, t1._next = null; - t1 = t0 ? t0._next = t2 : taskHead = t2; - } - } - taskTail = t0; - sleep(time); -} - -function sleep(time) { - if (frame) return; // Soonest alarm already set, or will be. - if (timeout) timeout = clearTimeout(timeout); - var delay = time - clockNow; // Strictly less than if we recomputed clockNow. - if (delay > 24) { - if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew); - if (interval) interval = clearInterval(interval); - } else { - if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay); - frame = 1, setFrame(wake); - } -} - -function timeout$1(callback, delay, time) { - var t = new Timer; - delay = delay == null ? 0 : +delay; - t.restart(elapsed => { - t.stop(); - callback(elapsed + delay); - }, delay, time); - return t; -} - -var emptyOn = dispatch("start", "end", "cancel", "interrupt"); -var emptyTween = []; - -var CREATED = 0; -var SCHEDULED = 1; -var STARTING = 2; -var STARTED = 3; -var RUNNING = 4; -var ENDING = 5; -var ENDED = 6; - -function schedule(node, name, id, index, group, timing) { - var schedules = node.__transition; - if (!schedules) node.__transition = {}; - else if (id in schedules) return; - create$1(node, id, { - name: name, - index: index, // For context during callback. - group: group, // For context during callback. - on: emptyOn, - tween: emptyTween, - time: timing.time, - delay: timing.delay, - duration: timing.duration, - ease: timing.ease, - timer: null, - state: CREATED - }); -} - -function init(node, id) { - var schedule = get$1(node, id); - if (schedule.state > CREATED) throw new Error("too late; already scheduled"); - return schedule; -} - -function set$1(node, id) { - var schedule = get$1(node, id); - if (schedule.state > STARTED) throw new Error("too late; already running"); - return schedule; -} - -function get$1(node, id) { - var schedule = node.__transition; - if (!schedule || !(schedule = schedule[id])) throw new Error("transition not found"); - return schedule; -} - -function create$1(node, id, self) { - var schedules = node.__transition, - tween; - - // Initialize the self timer when the transition is created. - // Note the actual delay is not known until the first callback! - schedules[id] = self; - self.timer = timer(schedule, 0, self.time); - - function schedule(elapsed) { - self.state = SCHEDULED; - self.timer.restart(start, self.delay, self.time); - - // If the elapsed delay is less than our first sleep, start immediately. - if (self.delay <= elapsed) start(elapsed - self.delay); - } - - function start(elapsed) { - var i, j, n, o; - - // If the state is not SCHEDULED, then we previously errored on start. - if (self.state !== SCHEDULED) return stop(); - - for (i in schedules) { - o = schedules[i]; - if (o.name !== self.name) continue; - - // While this element already has a starting transition during this frame, - // defer starting an interrupting transition until that transition has a - // chance to tick (and possibly end); see d3/d3-transition#54! - if (o.state === STARTED) return timeout$1(start); - - // Interrupt the active transition, if any. - if (o.state === RUNNING) { - o.state = ENDED; - o.timer.stop(); - o.on.call("interrupt", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - - // Cancel any pre-empted transitions. - else if (+i < id) { - o.state = ENDED; - o.timer.stop(); - o.on.call("cancel", node, node.__data__, o.index, o.group); - delete schedules[i]; - } - } - - // Defer the first tick to end of the current frame; see d3/d3#1576. - // Note the transition may be canceled after start and before the first tick! - // Note this must be scheduled before the start event; see d3/d3-transition#16! - // Assuming this is successful, subsequent callbacks go straight to tick. - timeout$1(function() { - if (self.state === STARTED) { - self.state = RUNNING; - self.timer.restart(tick, self.delay, self.time); - tick(elapsed); - } - }); - - // Dispatch the start event. - // Note this must be done before the tween are initialized. - self.state = STARTING; - self.on.call("start", node, node.__data__, self.index, self.group); - if (self.state !== STARTING) return; // interrupted - self.state = STARTED; - - // Initialize the tween, deleting null tween. - tween = new Array(n = self.tween.length); - for (i = 0, j = -1; i < n; ++i) { - if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) { - tween[++j] = o; - } - } - tween.length = j + 1; - } - - function tick(elapsed) { - var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1), - i = -1, - n = tween.length; - - while (++i < n) { - tween[i].call(node, t); - } - - // Dispatch the end event. - if (self.state === ENDING) { - self.on.call("end", node, node.__data__, self.index, self.group); - stop(); - } - } - - function stop() { - self.state = ENDED; - self.timer.stop(); - delete schedules[id]; - for (var i in schedules) return; // eslint-disable-line no-unused-vars - delete node.__transition; - } -} - -function interrupt(node, name) { - var schedules = node.__transition, - schedule, - active, - empty = true, - i; - - if (!schedules) return; - - name = name == null ? null : name + ""; - - for (i in schedules) { - if ((schedule = schedules[i]).name !== name) { empty = false; continue; } - active = schedule.state > STARTING && schedule.state < ENDING; - schedule.state = ENDED; - schedule.timer.stop(); - schedule.on.call(active ? "interrupt" : "cancel", node, node.__data__, schedule.index, schedule.group); - delete schedules[i]; - } - - if (empty) delete node.__transition; -} - -function selection_interrupt(name) { - return this.each(function() { - interrupt(this, name); - }); -} - -function tweenRemove(id, name) { - var tween0, tween1; - return function() { - var schedule = set$1(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = tween0 = tween; - for (var i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1 = tween1.slice(); - tween1.splice(i, 1); - break; - } - } - } - - schedule.tween = tween1; - }; -} - -function tweenFunction(id, name, value) { - var tween0, tween1; - if (typeof value !== "function") throw new Error; - return function() { - var schedule = set$1(this, id), - tween = schedule.tween; - - // If this node shared tween with the previous node, - // just assign the updated shared tween and we’re done! - // Otherwise, copy-on-write. - if (tween !== tween0) { - tween1 = (tween0 = tween).slice(); - for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) { - if (tween1[i].name === name) { - tween1[i] = t; - break; - } - } - if (i === n) tween1.push(t); - } - - schedule.tween = tween1; - }; -} - -function transition_tween(name, value) { - var id = this._id; - - name += ""; - - if (arguments.length < 2) { - var tween = get$1(this.node(), id).tween; - for (var i = 0, n = tween.length, t; i < n; ++i) { - if ((t = tween[i]).name === name) { - return t.value; - } - } - return null; - } - - return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value)); -} - -function tweenValue(transition, name, value) { - var id = transition._id; - - transition.each(function() { - var schedule = set$1(this, id); - (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments); - }); - - return function(node) { - return get$1(node, id).value[name]; - }; -} - -function interpolate$1(a, b) { - var c; - return (typeof b === "number" ? interpolateNumber - : b instanceof color ? interpolateRgb - : (c = color(b)) ? (b = c, interpolateRgb) - : interpolateString)(a, b); -} - -function attrRemove$1(name) { - return function() { - this.removeAttribute(name); - }; -} - -function attrRemoveNS$1(fullname) { - return function() { - this.removeAttributeNS(fullname.space, fullname.local); - }; -} - -function attrConstant$1(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttribute(name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function attrConstantNS$1(fullname, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = this.getAttributeNS(fullname.space, fullname.local); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function attrFunction$1(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttribute(name); - string0 = this.getAttribute(name); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function attrFunctionNS$1(fullname, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0, value1 = value(this), string1; - if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local); - string0 = this.getAttributeNS(fullname.space, fullname.local); - string1 = value1 + ""; - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function transition_attr(name, value) { - var fullname = namespace(name), i = fullname === "transform" ? interpolateTransformSvg : interpolate$1; - return this.attrTween(name, typeof value === "function" - ? (fullname.local ? attrFunctionNS$1 : attrFunction$1)(fullname, i, tweenValue(this, "attr." + name, value)) - : value == null ? (fullname.local ? attrRemoveNS$1 : attrRemove$1)(fullname) - : (fullname.local ? attrConstantNS$1 : attrConstant$1)(fullname, i, value)); -} - -function attrInterpolate(name, i) { - return function(t) { - this.setAttribute(name, i.call(this, t)); - }; -} - -function attrInterpolateNS(fullname, i) { - return function(t) { - this.setAttributeNS(fullname.space, fullname.local, i.call(this, t)); - }; -} - -function attrTweenNS(fullname, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i); - return t0; - } - tween._value = value; - return tween; -} - -function attrTween(name, value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i); - return t0; - } - tween._value = value; - return tween; -} - -function transition_attrTween(name, value) { - var key = "attr." + name; - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - var fullname = namespace(name); - return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value)); -} - -function delayFunction(id, value) { - return function() { - init(this, id).delay = +value.apply(this, arguments); - }; -} - -function delayConstant(id, value) { - return value = +value, function() { - init(this, id).delay = value; - }; -} - -function transition_delay(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? delayFunction - : delayConstant)(id, value)) - : get$1(this.node(), id).delay; -} - -function durationFunction(id, value) { - return function() { - set$1(this, id).duration = +value.apply(this, arguments); - }; -} - -function durationConstant(id, value) { - return value = +value, function() { - set$1(this, id).duration = value; - }; -} - -function transition_duration(value) { - var id = this._id; - - return arguments.length - ? this.each((typeof value === "function" - ? durationFunction - : durationConstant)(id, value)) - : get$1(this.node(), id).duration; -} - -function easeConstant(id, value) { - if (typeof value !== "function") throw new Error; - return function() { - set$1(this, id).ease = value; - }; -} - -function transition_ease(value) { - var id = this._id; - - return arguments.length - ? this.each(easeConstant(id, value)) - : get$1(this.node(), id).ease; -} - -function easeVarying(id, value) { - return function() { - var v = value.apply(this, arguments); - if (typeof v !== "function") throw new Error; - set$1(this, id).ease = v; - }; -} - -function transition_easeVarying(value) { - if (typeof value !== "function") throw new Error; - return this.each(easeVarying(this._id, value)); -} - -function transition_filter(match) { - if (typeof match !== "function") match = matcher(match); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) { - if ((node = group[i]) && match.call(node, node.__data__, i, group)) { - subgroup.push(node); - } - } - } - - return new Transition(subgroups, this._parents, this._name, this._id); -} - -function transition_merge(transition) { - if (transition._id !== this._id) throw new Error; - - for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) { - for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) { - if (node = group0[i] || group1[i]) { - merge[i] = node; - } - } - } - - for (; j < m0; ++j) { - merges[j] = groups0[j]; - } - - return new Transition(merges, this._parents, this._name, this._id); -} - -function start(name) { - return (name + "").trim().split(/^|\s+/).every(function(t) { - var i = t.indexOf("."); - if (i >= 0) t = t.slice(0, i); - return !t || t === "start"; - }); -} - -function onFunction(id, name, listener) { - var on0, on1, sit = start(name) ? init : set$1; - return function() { - var schedule = sit(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener); - - schedule.on = on1; - }; -} - -function transition_on(name, listener) { - var id = this._id; - - return arguments.length < 2 - ? get$1(this.node(), id).on.on(name) - : this.each(onFunction(id, name, listener)); -} - -function removeFunction(id) { - return function() { - var parent = this.parentNode; - for (var i in this.__transition) if (+i !== id) return; - if (parent) parent.removeChild(this); - }; -} - -function transition_remove() { - return this.on("end.remove", removeFunction(this._id)); -} - -function transition_select(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selector(select); - - for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) { - if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) { - if ("__data__" in node) subnode.__data__ = node.__data__; - subgroup[i] = subnode; - schedule(subgroup[i], name, id, i, subgroup, get$1(node, id)); - } - } - } - - return new Transition(subgroups, this._parents, name, id); -} - -function transition_selectAll(select) { - var name = this._name, - id = this._id; - - if (typeof select !== "function") select = selectorAll(select); - - for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - for (var children = select.call(node, node.__data__, i, group), child, inherit = get$1(node, id), k = 0, l = children.length; k < l; ++k) { - if (child = children[k]) { - schedule(child, name, id, k, children, inherit); - } - } - subgroups.push(children); - parents.push(node); - } - } - } - - return new Transition(subgroups, parents, name, id); -} - -var Selection$1 = selection.prototype.constructor; - -function transition_selection() { - return new Selection$1(this._groups, this._parents); -} - -function styleNull(name, interpolate) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - string1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, string10 = string1); - }; -} - -function styleRemove$1(name) { - return function() { - this.style.removeProperty(name); - }; -} - -function styleConstant$1(name, interpolate, value1) { - var string00, - string1 = value1 + "", - interpolate0; - return function() { - var string0 = styleValue(this, name); - return string0 === string1 ? null - : string0 === string00 ? interpolate0 - : interpolate0 = interpolate(string00 = string0, value1); - }; -} - -function styleFunction$1(name, interpolate, value) { - var string00, - string10, - interpolate0; - return function() { - var string0 = styleValue(this, name), - value1 = value(this), - string1 = value1 + ""; - if (value1 == null) string1 = value1 = (this.style.removeProperty(name), styleValue(this, name)); - return string0 === string1 ? null - : string0 === string00 && string1 === string10 ? interpolate0 - : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1)); - }; -} - -function styleMaybeRemove(id, name) { - var on0, on1, listener0, key = "style." + name, event = "end." + key, remove; - return function() { - var schedule = set$1(this, id), - on = schedule.on, - listener = schedule.value[key] == null ? remove || (remove = styleRemove$1(name)) : undefined; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener); - - schedule.on = on1; - }; -} - -function transition_style(name, value, priority) { - var i = (name += "") === "transform" ? interpolateTransformCss : interpolate$1; - return value == null ? this - .styleTween(name, styleNull(name, i)) - .on("end.style." + name, styleRemove$1(name)) - : typeof value === "function" ? this - .styleTween(name, styleFunction$1(name, i, tweenValue(this, "style." + name, value))) - .each(styleMaybeRemove(this._id, name)) - : this - .styleTween(name, styleConstant$1(name, i, value), priority) - .on("end.style." + name, null); -} - -function styleInterpolate(name, i, priority) { - return function(t) { - this.style.setProperty(name, i.call(this, t), priority); - }; -} - -function styleTween(name, value, priority) { - var t, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority); - return t; - } - tween._value = value; - return tween; -} - -function transition_styleTween(name, value, priority) { - var key = "style." + (name += ""); - if (arguments.length < 2) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, styleTween(name, value, priority == null ? "" : priority)); -} - -function textConstant$1(value) { - return function() { - this.textContent = value; - }; -} - -function textFunction$1(value) { - return function() { - var value1 = value(this); - this.textContent = value1 == null ? "" : value1; - }; -} - -function transition_text(value) { - return this.tween("text", typeof value === "function" - ? textFunction$1(tweenValue(this, "text", value)) - : textConstant$1(value == null ? "" : value + "")); -} - -function textInterpolate(i) { - return function(t) { - this.textContent = i.call(this, t); - }; -} - -function textTween(value) { - var t0, i0; - function tween() { - var i = value.apply(this, arguments); - if (i !== i0) t0 = (i0 = i) && textInterpolate(i); - return t0; - } - tween._value = value; - return tween; -} - -function transition_textTween(value) { - var key = "text"; - if (arguments.length < 1) return (key = this.tween(key)) && key._value; - if (value == null) return this.tween(key, null); - if (typeof value !== "function") throw new Error; - return this.tween(key, textTween(value)); -} - -function transition_transition() { - var name = this._name, - id0 = this._id, - id1 = newId(); - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - var inherit = get$1(node, id0); - schedule(node, name, id1, i, group, { - time: inherit.time + inherit.delay + inherit.duration, - delay: 0, - duration: inherit.duration, - ease: inherit.ease - }); - } - } - } - - return new Transition(groups, this._parents, name, id1); -} - -function transition_end() { - var on0, on1, that = this, id = that._id, size = that.size(); - return new Promise(function(resolve, reject) { - var cancel = {value: reject}, - end = {value: function() { if (--size === 0) resolve(); }}; - - that.each(function() { - var schedule = set$1(this, id), - on = schedule.on; - - // If this node shared a dispatch with the previous node, - // just assign the updated shared dispatch and we’re done! - // Otherwise, copy-on-write. - if (on !== on0) { - on1 = (on0 = on).copy(); - on1._.cancel.push(cancel); - on1._.interrupt.push(cancel); - on1._.end.push(end); - } - - schedule.on = on1; - }); - - // The selection was empty, resolve end immediately - if (size === 0) resolve(); - }); -} - -var id$1 = 0; - -function Transition(groups, parents, name, id) { - this._groups = groups; - this._parents = parents; - this._name = name; - this._id = id; -} - -function transition(name) { - return selection().transition(name); -} - -function newId() { - return ++id$1; -} - -var selection_prototype = selection.prototype; - -Transition.prototype = transition.prototype = { - constructor: Transition, - select: transition_select, - selectAll: transition_selectAll, - filter: transition_filter, - merge: transition_merge, - selection: transition_selection, - transition: transition_transition, - call: selection_prototype.call, - nodes: selection_prototype.nodes, - node: selection_prototype.node, - size: selection_prototype.size, - empty: selection_prototype.empty, - each: selection_prototype.each, - on: transition_on, - attr: transition_attr, - attrTween: transition_attrTween, - style: transition_style, - styleTween: transition_styleTween, - text: transition_text, - textTween: transition_textTween, - remove: transition_remove, - tween: transition_tween, - delay: transition_delay, - duration: transition_duration, - ease: transition_ease, - easeVarying: transition_easeVarying, - end: transition_end, - [Symbol.iterator]: selection_prototype[Symbol.iterator] -}; - -function cubicInOut(t) { - return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2; -} - -var defaultTiming = { - time: null, // Set on use. - delay: 0, - duration: 250, - ease: cubicInOut -}; - -function inherit(node, id) { - var timing; - while (!(timing = node.__transition) || !(timing = timing[id])) { - if (!(node = node.parentNode)) { - throw new Error(`transition ${id} not found`); - } - } - return timing; -} - -function selection_transition(name) { - var id, - timing; - - if (name instanceof Transition) { - id = name._id, name = name._name; - } else { - id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + ""; - } - - for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) { - for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) { - if (node = group[i]) { - schedule(node, name, id, i, group, timing || inherit(node, id)); - } - } - } - - return new Transition(groups, this._parents, name, id); -} - -selection.prototype.interrupt = selection_interrupt; -selection.prototype.transition = selection_transition; - -function formatDecimal(x) { - return Math.abs(x = Math.round(x)) >= 1e21 - ? x.toLocaleString("en").replace(/,/g, "") - : x.toString(10); -} - -// Computes the decimal coefficient and exponent of the specified number x with -// significant digits p, where x is positive and p is in [1, 21] or undefined. -// For example, formatDecimalParts(1.23) returns ["123", 0]. -function formatDecimalParts(x, p) { - if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf("e")) < 0) return null; // NaN, ±Infinity - var i, coefficient = x.slice(0, i); - - // The string returned by toExponential either has the form \d\.\d+e[-+]\d+ - // (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). - return [ - coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient, - +x.slice(i + 1) - ]; -} - -function exponent(x) { - return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN; -} - -function formatGroup(grouping, thousands) { - return function(value, width) { - var i = value.length, - t = [], - j = 0, - g = grouping[0], - length = 0; - - while (i > 0 && g > 0) { - if (length + g + 1 > width) g = Math.max(1, width - length); - t.push(value.substring(i -= g, i + g)); - if ((length += g + 1) > width) break; - g = grouping[j = (j + 1) % grouping.length]; - } - - return t.reverse().join(thousands); - }; -} - -function formatNumerals(numerals) { - return function(value) { - return value.replace(/[0-9]/g, function(i) { - return numerals[+i]; - }); - }; -} - -// [[fill]align][sign][symbol][0][width][,][.precision][~][type] -var re = /^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i; - -function formatSpecifier(specifier) { - if (!(match = re.exec(specifier))) throw new Error("invalid format: " + specifier); - var match; - return new FormatSpecifier({ - fill: match[1], - align: match[2], - sign: match[3], - symbol: match[4], - zero: match[5], - width: match[6], - comma: match[7], - precision: match[8] && match[8].slice(1), - trim: match[9], - type: match[10] - }); -} - -formatSpecifier.prototype = FormatSpecifier.prototype; // instanceof - -function FormatSpecifier(specifier) { - this.fill = specifier.fill === undefined ? " " : specifier.fill + ""; - this.align = specifier.align === undefined ? ">" : specifier.align + ""; - this.sign = specifier.sign === undefined ? "-" : specifier.sign + ""; - this.symbol = specifier.symbol === undefined ? "" : specifier.symbol + ""; - this.zero = !!specifier.zero; - this.width = specifier.width === undefined ? undefined : +specifier.width; - this.comma = !!specifier.comma; - this.precision = specifier.precision === undefined ? undefined : +specifier.precision; - this.trim = !!specifier.trim; - this.type = specifier.type === undefined ? "" : specifier.type + ""; -} - -FormatSpecifier.prototype.toString = function() { - return this.fill - + this.align - + this.sign - + this.symbol - + (this.zero ? "0" : "") - + (this.width === undefined ? "" : Math.max(1, this.width | 0)) - + (this.comma ? "," : "") - + (this.precision === undefined ? "" : "." + Math.max(0, this.precision | 0)) - + (this.trim ? "~" : "") - + this.type; -}; - -// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. -function formatTrim(s) { - out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) { - switch (s[i]) { - case ".": i0 = i1 = i; break; - case "0": if (i0 === 0) i0 = i; i1 = i; break; - default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break; - } - } - return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s; -} - -var prefixExponent; - -function formatPrefixAuto(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1], - i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1, - n = coefficient.length; - return i === n ? coefficient - : i > n ? coefficient + new Array(i - n + 1).join("0") - : i > 0 ? coefficient.slice(0, i) + "." + coefficient.slice(i) - : "0." + new Array(1 - i).join("0") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y! -} - -function formatRounded(x, p) { - var d = formatDecimalParts(x, p); - if (!d) return x + ""; - var coefficient = d[0], - exponent = d[1]; - return exponent < 0 ? "0." + new Array(-exponent).join("0") + coefficient - : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + "." + coefficient.slice(exponent + 1) - : coefficient + new Array(exponent - coefficient.length + 2).join("0"); -} - -var formatTypes = { - "%": (x, p) => (x * 100).toFixed(p), - "b": (x) => Math.round(x).toString(2), - "c": (x) => x + "", - "d": formatDecimal, - "e": (x, p) => x.toExponential(p), - "f": (x, p) => x.toFixed(p), - "g": (x, p) => x.toPrecision(p), - "o": (x) => Math.round(x).toString(8), - "p": (x, p) => formatRounded(x * 100, p), - "r": formatRounded, - "s": formatPrefixAuto, - "X": (x) => Math.round(x).toString(16).toUpperCase(), - "x": (x) => Math.round(x).toString(16) -}; - -function identity$1(x) { - return x; -} - -var map = Array.prototype.map, - prefixes = ["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"]; - -function formatLocale(locale) { - var group = locale.grouping === undefined || locale.thousands === undefined ? identity$1 : formatGroup(map.call(locale.grouping, Number), locale.thousands + ""), - currencyPrefix = locale.currency === undefined ? "" : locale.currency[0] + "", - currencySuffix = locale.currency === undefined ? "" : locale.currency[1] + "", - decimal = locale.decimal === undefined ? "." : locale.decimal + "", - numerals = locale.numerals === undefined ? identity$1 : formatNumerals(map.call(locale.numerals, String)), - percent = locale.percent === undefined ? "%" : locale.percent + "", - minus = locale.minus === undefined ? "−" : locale.minus + "", - nan = locale.nan === undefined ? "NaN" : locale.nan + ""; - - function newFormat(specifier) { - specifier = formatSpecifier(specifier); - - var fill = specifier.fill, - align = specifier.align, - sign = specifier.sign, - symbol = specifier.symbol, - zero = specifier.zero, - width = specifier.width, - comma = specifier.comma, - precision = specifier.precision, - trim = specifier.trim, - type = specifier.type; - - // The "n" type is an alias for ",g". - if (type === "n") comma = true, type = "g"; - - // The "" type, and any invalid type, is an alias for ".12~g". - else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = "g"; - - // If zero fill is specified, padding goes after sign and before digits. - if (zero || (fill === "0" && align === "=")) zero = true, fill = "0", align = "="; - - // Compute the prefix and suffix. - // For SI-prefix, the suffix is lazily computed. - var prefix = symbol === "$" ? currencyPrefix : symbol === "#" && /[boxX]/.test(type) ? "0" + type.toLowerCase() : "", - suffix = symbol === "$" ? currencySuffix : /[%p]/.test(type) ? percent : ""; - - // What format function should we use? - // Is this an integer type? - // Can this type generate exponential notation? - var formatType = formatTypes[type], - maybeSuffix = /[defgprs%]/.test(type); - - // Set the default precision if not specified, - // or clamp the specified precision to the supported range. - // For significant precision, it must be in [1, 21]. - // For fixed precision, it must be in [0, 20]. - precision = precision === undefined ? 6 - : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision)) - : Math.max(0, Math.min(20, precision)); - - function format(value) { - var valuePrefix = prefix, - valueSuffix = suffix, - i, n, c; - - if (type === "c") { - valueSuffix = formatType(value) + valueSuffix; - value = ""; - } else { - value = +value; - - // Determine the sign. -0 is not less than 0, but 1 / -0 is! - var valueNegative = value < 0 || 1 / value < 0; - - // Perform the initial formatting. - value = isNaN(value) ? nan : formatType(Math.abs(value), precision); - - // Trim insignificant zeros. - if (trim) value = formatTrim(value); - - // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. - if (valueNegative && +value === 0 && sign !== "+") valueNegative = false; - - // Compute the prefix and suffix. - valuePrefix = (valueNegative ? (sign === "(" ? sign : minus) : sign === "-" || sign === "(" ? "" : sign) + valuePrefix; - valueSuffix = (type === "s" ? prefixes[8 + prefixExponent / 3] : "") + valueSuffix + (valueNegative && sign === "(" ? ")" : ""); - - // Break the formatted value into the integer “value” part that can be - // grouped, and fractional or exponential “suffix” part that is not. - if (maybeSuffix) { - i = -1, n = value.length; - while (++i < n) { - if (c = value.charCodeAt(i), 48 > c || c > 57) { - valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix; - value = value.slice(0, i); - break; - } - } - } - } - - // If the fill character is not "0", grouping is applied before padding. - if (comma && !zero) value = group(value, Infinity); - - // Compute the padding. - var length = valuePrefix.length + value.length + valueSuffix.length, - padding = length < width ? new Array(width - length + 1).join(fill) : ""; - - // If the fill character is "0", grouping is applied after padding. - if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = ""; - - // Reconstruct the final output based on the desired alignment. - switch (align) { - case "<": value = valuePrefix + value + valueSuffix + padding; break; - case "=": value = valuePrefix + padding + value + valueSuffix; break; - case "^": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break; - default: value = padding + valuePrefix + value + valueSuffix; break; - } - - return numerals(value); - } - - format.toString = function() { - return specifier + ""; - }; - - return format; - } - - function formatPrefix(specifier, value) { - var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = "f", specifier)), - e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3, - k = Math.pow(10, -e), - prefix = prefixes[8 + e / 3]; - return function(value) { - return f(k * value) + prefix; - }; - } - - return { - format: newFormat, - formatPrefix: formatPrefix - }; -} - -var locale; -var format; -var formatPrefix; - -defaultLocale({ - thousands: ",", - grouping: [3], - currency: ["$", ""] -}); - -function defaultLocale(definition) { - locale = formatLocale(definition); - format = locale.format; - formatPrefix = locale.formatPrefix; - return locale; -} - -function precisionFixed(step) { - return Math.max(0, -exponent(Math.abs(step))); -} - -function precisionPrefix(step, value) { - return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step))); -} - -function precisionRound(step, max) { - step = Math.abs(step), max = Math.abs(max) - step; - return Math.max(0, exponent(max) - exponent(step)) + 1; -} - -function initRange(domain, range) { - switch (arguments.length) { - case 0: break; - case 1: this.range(domain); break; - default: this.range(range).domain(domain); break; - } - return this; -} - -function constants(x) { - return function() { - return x; - }; -} - -function number$2(x) { - return +x; -} - -var unit = [0, 1]; - -function identity$2(x) { - return x; -} - -function normalize(a, b) { - return (b -= (a = +a)) - ? function(x) { return (x - a) / b; } - : constants(isNaN(b) ? NaN : 0.5); -} - -function clamper(a, b) { - var t; - if (a > b) t = a, a = b, b = t; - return function(x) { return Math.max(a, Math.min(b, x)); }; -} - -// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1]. -// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b]. -function bimap(domain, range, interpolate) { - var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1]; - if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0); - else d0 = normalize(d0, d1), r0 = interpolate(r0, r1); - return function(x) { return r0(d0(x)); }; -} - -function polymap(domain, range, interpolate) { - var j = Math.min(domain.length, range.length) - 1, - d = new Array(j), - r = new Array(j), - i = -1; - - // Reverse descending domains. - if (domain[j] < domain[0]) { - domain = domain.slice().reverse(); - range = range.slice().reverse(); - } - - while (++i < j) { - d[i] = normalize(domain[i], domain[i + 1]); - r[i] = interpolate(range[i], range[i + 1]); - } - - return function(x) { - var i = bisectRight(domain, x, 1, j) - 1; - return r[i](d[i](x)); - }; -} - -function copy(source, target) { - return target - .domain(source.domain()) - .range(source.range()) - .interpolate(source.interpolate()) - .clamp(source.clamp()) - .unknown(source.unknown()); -} - -function transformer() { - var domain = unit, - range = unit, - interpolate$1 = interpolate, - transform, - untransform, - unknown, - clamp = identity$2, - piecewise, - output, - input; - - function rescale() { - var n = Math.min(domain.length, range.length); - if (clamp !== identity$2) clamp = clamper(domain[0], domain[n - 1]); - piecewise = n > 2 ? polymap : bimap; - output = input = null; - return scale; - } - - function scale(x) { - return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate$1)))(transform(clamp(x))); - } - - scale.invert = function(y) { - return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y))); - }; - - scale.domain = function(_) { - return arguments.length ? (domain = Array.from(_, number$2), rescale()) : domain.slice(); - }; - - scale.range = function(_) { - return arguments.length ? (range = Array.from(_), rescale()) : range.slice(); - }; - - scale.rangeRound = function(_) { - return range = Array.from(_), interpolate$1 = interpolateRound, rescale(); - }; - - scale.clamp = function(_) { - return arguments.length ? (clamp = _ ? true : identity$2, rescale()) : clamp !== identity$2; - }; - - scale.interpolate = function(_) { - return arguments.length ? (interpolate$1 = _, rescale()) : interpolate$1; - }; - - scale.unknown = function(_) { - return arguments.length ? (unknown = _, scale) : unknown; - }; - - return function(t, u) { - transform = t, untransform = u; - return rescale(); - }; -} - -function continuous() { - return transformer()(identity$2, identity$2); -} - -function tickFormat(start, stop, count, specifier) { - var step = tickStep(start, stop, count), - precision; - specifier = formatSpecifier(specifier == null ? ",f" : specifier); - switch (specifier.type) { - case "s": { - var value = Math.max(Math.abs(start), Math.abs(stop)); - if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision; - return formatPrefix(specifier, value); - } - case "": - case "e": - case "g": - case "p": - case "r": { - if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === "e"); - break; - } - case "f": - case "%": { - if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === "%") * 2; - break; - } - } - return format(specifier); -} - -function linearish(scale) { - var domain = scale.domain; - - scale.ticks = function(count) { - var d = domain(); - return ticks(d[0], d[d.length - 1], count == null ? 10 : count); - }; - - scale.tickFormat = function(count, specifier) { - var d = domain(); - return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier); - }; - - scale.nice = function(count) { - if (count == null) count = 10; - - var d = domain(); - var i0 = 0; - var i1 = d.length - 1; - var start = d[i0]; - var stop = d[i1]; - var prestep; - var step; - var maxIter = 10; - - if (stop < start) { - step = start, start = stop, stop = step; - step = i0, i0 = i1, i1 = step; - } - - while (maxIter-- > 0) { - step = tickIncrement(start, stop, count); - if (step === prestep) { - d[i0] = start; - d[i1] = stop; - return domain(d); - } else if (step > 0) { - start = Math.floor(start / step) * step; - stop = Math.ceil(stop / step) * step; - } else if (step < 0) { - start = Math.ceil(start * step) / step; - stop = Math.floor(stop * step) / step; - } else { - break; - } - prestep = step; - } - - return scale; - }; - - return scale; -} - -function linear$1() { - var scale = continuous(); - - scale.copy = function() { - return copy(scale, linear$1()); - }; - - initRange.apply(scale, arguments); - - return linearish(scale); -} - -const LedgerViewType = 'ledger'; -class LedgerView extends obsidian.ItemView { - constructor(leaf, plugin) { - super(leaf); - this.redraw = () => { - const contentEl = this.containerEl.children[1]; - console.debug('ledger: Rendering preview for ledger file'); - contentEl.empty(); - const p = contentEl.createEl('p'); - p.setText('Hello world 2'); - const div = contentEl.createDiv(); - div.appendChild(this.makeSimpleBarD3()); - }; - this.makeSimpleBarD3 = () => { - // https://www.essycode.com/posts/create-sparkline-charts-d3/ - const WIDTH = 160; - const HEIGHT = 30; - const DATA_COUNT = 40; - const BAR_WIDTH = (WIDTH - DATA_COUNT) / DATA_COUNT; - const data = range(DATA_COUNT).map((d) => Math.random()); - const x = linear$1().domain([0, DATA_COUNT]).range([0, WIDTH]); - const y = linear$1().domain([0, 1]).range([HEIGHT, 0]); - const svg = create('svg').attr('width', WIDTH).attr('height', HEIGHT); - const g = svg.append('g'); - g.selectAll('.bar') - .data(data) - .enter() - .append('rect') - .attr('class', 'bar') - .attr('x', (d, i) => x(i)) - .attr('y', (d) => HEIGHT - y(d)) - .attr('width', BAR_WIDTH) - .attr('height', (d) => y(d)) - .attr('fill', 'MediumSeaGreen'); - return svg.node(); - }; - this.reloadData = () => { - throw new Error('Not Implemented'); - }; - this.plugin = plugin; - this.registerEvent(this.app.vault.on('modify', (file) => { - if (file.path === this.plugin.settings.ledgerFile) { - this.reloadData(); - } - })); - this.reloadData(); - this.redraw(); - } - getViewType() { - return LedgerViewType; - } - getDisplayText() { - return 'Ledger'; - } - getIcon() { - return 'ledger'; - } -} - -const defaultSettings = { - currencySymbol: '$', - ledgerFile: 'Ledger.md', - includeFinalLineAmount: false, - enableLedgerVis: false, -}; -const settingsWithDefaults = (settings) => (Object.assign(Object.assign({}, defaultSettings), settings)); - -function noop$1() { } -function run(fn) { - return fn(); -} -function blank_object() { - return Object.create(null); -} -function run_all(fns) { - fns.forEach(run); -} -function is_function(thing) { - return typeof thing === 'function'; -} -function safe_not_equal(a, b) { - return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); -} -function is_empty(obj) { - return Object.keys(obj).length === 0; -} -function null_to_empty(value) { - return value == null ? '' : value; -} - -function append(target, node) { - target.appendChild(node); -} -function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); -} -function detach(node) { - node.parentNode.removeChild(node); -} -function element(name) { - return document.createElement(name); -} -function svg_element(name) { - return document.createElementNS('http://www.w3.org/2000/svg', name); -} -function text(data) { - return document.createTextNode(data); -} -function space() { - return text(' '); -} -function listen(node, event, handler, options) { - node.addEventListener(event, handler, options); - return () => node.removeEventListener(event, handler, options); -} -function attr(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); -} -function to_number(value) { - return value === '' ? null : +value; -} -function children$1(element) { - return Array.from(element.childNodes); -} -function set_data(text, data) { - data = '' + data; - if (text.wholeText !== data) - text.data = data; -} -function set_input_value(input, value) { - input.value = value == null ? '' : value; -} - -let current_component; -function set_current_component(component) { - current_component = component; -} -function get_current_component() { - if (!current_component) - throw new Error('Function called outside component initialization'); - return current_component; -} -function onMount(fn) { - get_current_component().$$.on_mount.push(fn); -} - -const dirty_components = []; -const binding_callbacks = []; -const render_callbacks = []; -const flush_callbacks = []; -const resolved_promise = Promise.resolve(); -let update_scheduled = false; -function schedule_update() { - if (!update_scheduled) { - update_scheduled = true; - resolved_promise.then(flush); - } -} -function add_render_callback(fn) { - render_callbacks.push(fn); -} -function add_flush_callback(fn) { - flush_callbacks.push(fn); -} -let flushing = false; -const seen_callbacks = new Set(); -function flush() { - if (flushing) - return; - flushing = true; - do { - // first, call beforeUpdate functions - // and update components - for (let i = 0; i < dirty_components.length; i += 1) { - const component = dirty_components[i]; - set_current_component(component); - update(component.$$); - } - set_current_component(null); - dirty_components.length = 0; - while (binding_callbacks.length) - binding_callbacks.pop()(); - // then, once components are updated, call - // afterUpdate functions. This may cause - // subsequent updates... - for (let i = 0; i < render_callbacks.length; i += 1) { - const callback = render_callbacks[i]; - if (!seen_callbacks.has(callback)) { - // ...so guard against infinite loops - seen_callbacks.add(callback); - callback(); - } - } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - flushing = false; - seen_callbacks.clear(); -} -function update($$) { - if ($$.fragment !== null) { - $$.update(); - run_all($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback); - } -} -const outroing = new Set(); -let outros; -function group_outros() { - outros = { - r: 0, - c: [], - p: outros // parent group - }; -} -function check_outros() { - if (!outros.r) { - run_all(outros.c); - } - outros = outros.p; -} -function transition_in(block, local) { - if (block && block.i) { - outroing.delete(block); - block.i(local); - } -} -function transition_out(block, local, detach, callback) { - if (block && block.o) { - if (outroing.has(block)) - return; - outroing.add(block); - outros.c.push(() => { - outroing.delete(block); - if (callback) { - if (detach) - block.d(1); - callback(); - } - }); - block.o(local); - } -} -function outro_and_destroy_block(block, lookup) { - transition_out(block, 1, 1, () => { - lookup.delete(block.key); - }); -} -function update_keyed_each(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) { - let o = old_blocks.length; - let n = list.length; - let i = o; - const old_indexes = {}; - while (i--) - old_indexes[old_blocks[i].key] = i; - const new_blocks = []; - const new_lookup = new Map(); - const deltas = new Map(); - i = n; - while (i--) { - const child_ctx = get_context(ctx, list, i); - const key = get_key(child_ctx); - let block = lookup.get(key); - if (!block) { - block = create_each_block(key, child_ctx); - block.c(); - } - else if (dynamic) { - block.p(child_ctx, dirty); - } - new_lookup.set(key, new_blocks[i] = block); - if (key in old_indexes) - deltas.set(key, Math.abs(i - old_indexes[key])); - } - const will_move = new Set(); - const did_move = new Set(); - function insert(block) { - transition_in(block, 1); - block.m(node, next); - lookup.set(block.key, block); - next = block.first; - n--; - } - while (o && n) { - const new_block = new_blocks[n - 1]; - const old_block = old_blocks[o - 1]; - const new_key = new_block.key; - const old_key = old_block.key; - if (new_block === old_block) { - // do nothing - next = new_block.first; - o--; - n--; - } - else if (!new_lookup.has(old_key)) { - // remove old block - destroy(old_block, lookup); - o--; - } - else if (!lookup.has(new_key) || will_move.has(new_key)) { - insert(new_block); - } - else if (did_move.has(old_key)) { - o--; - } - else if (deltas.get(new_key) > deltas.get(old_key)) { - did_move.add(new_key); - insert(new_block); - } - else { - will_move.add(old_key); - o--; - } - } - while (o--) { - const old_block = old_blocks[o]; - if (!new_lookup.has(old_block.key)) - destroy(old_block, lookup); - } - while (n) - insert(new_blocks[n - 1]); - return new_blocks; -} - -function bind(component, name, callback) { - const index = component.$$.props[name]; - if (index !== undefined) { - component.$$.bound[index] = callback; - callback(component.$$.ctx[index]); - } -} -function create_component(block) { - block && block.c(); -} -function mount_component(component, target, anchor) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; - fragment && fragment.m(target, anchor); - // onMount happens before the initial afterUpdate - add_render_callback(() => { - const new_on_destroy = on_mount.map(run).filter(is_function); - if (on_destroy) { - on_destroy.push(...new_on_destroy); - } - else { - // Edge case - component was destroyed immediately, - // most likely as a result of a binding initialising - run_all(new_on_destroy); - } - component.$$.on_mount = []; - }); - after_update.forEach(add_render_callback); -} -function destroy_component(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - run_all($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - // TODO null out other refs, including component.$$ (but need to - // preserve final state?) - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } -} -function make_dirty(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty.fill(0); - } - component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); -} -function init$1(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { - const parent_component = current_component; - set_current_component(component); - const $$ = component.$$ = { - fragment: null, - ctx: null, - // state - props, - update: noop$1, - not_equal, - bound: blank_object(), - // lifecycle - on_mount: [], - on_destroy: [], - before_update: [], - after_update: [], - context: new Map(parent_component ? parent_component.$$.context : []), - // everything else - callbacks: blank_object(), - dirty, - skip_bound: false - }; - let ready = false; - $$.ctx = instance - ? instance(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready) - make_dirty(component, i); - } - return ret; - }) - : []; - $$.update(); - ready = true; - run_all($$.before_update); - // `false` as a special case of no DOM component - $$.fragment = create_fragment ? create_fragment($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - const nodes = children$1(options.target); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach); - } - else { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor); - flush(); - } - set_current_component(parent_component); -} -/** - * Base class for Svelte components. Used when dev=false. - */ -class SvelteComponent { - $destroy() { - destroy_component(this, 1); - this.$destroy = noop$1; - } - $on(type, callback) { - const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } -} - -var top = 'top'; -var bottom = 'bottom'; -var right = 'right'; -var left = 'left'; -var auto = 'auto'; -var basePlacements = [top, bottom, right, left]; -var start$1 = 'start'; -var end = 'end'; -var clippingParents = 'clippingParents'; -var viewport = 'viewport'; -var popper = 'popper'; -var reference = 'reference'; -var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) { - return acc.concat([placement + "-" + start$1, placement + "-" + end]); -}, []); -var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) { - return acc.concat([placement, placement + "-" + start$1, placement + "-" + end]); -}, []); // modifiers that need to read the DOM - -var beforeRead = 'beforeRead'; -var read = 'read'; -var afterRead = 'afterRead'; // pure-logic modifiers - -var beforeMain = 'beforeMain'; -var main = 'main'; -var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state) - -var beforeWrite = 'beforeWrite'; -var write = 'write'; -var afterWrite = 'afterWrite'; -var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; - -function getNodeName(element) { - return element ? (element.nodeName || '').toLowerCase() : null; -} - -function getWindow(node) { - if (node == null) { - return window; - } - - if (node.toString() !== '[object Window]') { - var ownerDocument = node.ownerDocument; - return ownerDocument ? ownerDocument.defaultView || window : window; - } - - return node; -} - -function isElement(node) { - var OwnElement = getWindow(node).Element; - return node instanceof OwnElement || node instanceof Element; -} - -function isHTMLElement(node) { - var OwnElement = getWindow(node).HTMLElement; - return node instanceof OwnElement || node instanceof HTMLElement; -} - -function isShadowRoot(node) { - // IE 11 has no ShadowRoot - if (typeof ShadowRoot === 'undefined') { - return false; - } - - var OwnElement = getWindow(node).ShadowRoot; - return node instanceof OwnElement || node instanceof ShadowRoot; -} - -// and applies them to the HTMLElements such as popper and arrow - -function applyStyles(_ref) { - var state = _ref.state; - Object.keys(state.elements).forEach(function (name) { - var style = state.styles[name] || {}; - var attributes = state.attributes[name] || {}; - var element = state.elements[name]; // arrow is optional + virtual elements - - if (!isHTMLElement(element) || !getNodeName(element)) { - return; - } // Flow doesn't support to extend this property, but it's the most - // effective way to apply styles to an HTMLElement - // $FlowFixMe[cannot-write] - - - Object.assign(element.style, style); - Object.keys(attributes).forEach(function (name) { - var value = attributes[name]; - - if (value === false) { - element.removeAttribute(name); - } else { - element.setAttribute(name, value === true ? '' : value); - } - }); - }); -} - -function effect(_ref2) { - var state = _ref2.state; - var initialStyles = { - popper: { - position: state.options.strategy, - left: '0', - top: '0', - margin: '0' - }, - arrow: { - position: 'absolute' - }, - reference: {} - }; - Object.assign(state.elements.popper.style, initialStyles.popper); - state.styles = initialStyles; - - if (state.elements.arrow) { - Object.assign(state.elements.arrow.style, initialStyles.arrow); - } - - return function () { - Object.keys(state.elements).forEach(function (name) { - var element = state.elements[name]; - var attributes = state.attributes[name] || {}; - var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them - - var style = styleProperties.reduce(function (style, property) { - style[property] = ''; - return style; - }, {}); // arrow is optional + virtual elements - - if (!isHTMLElement(element) || !getNodeName(element)) { - return; - } - - Object.assign(element.style, style); - Object.keys(attributes).forEach(function (attribute) { - element.removeAttribute(attribute); - }); - }); - }; -} // eslint-disable-next-line import/no-unused-modules - - -var applyStyles$1 = { - name: 'applyStyles', - enabled: true, - phase: 'write', - fn: applyStyles, - effect: effect, - requires: ['computeStyles'] -}; - -function getBasePlacement(placement) { - return placement.split('-')[0]; -} - -function getBoundingClientRect(element) { - var rect = element.getBoundingClientRect(); - return { - width: rect.width, - height: rect.height, - top: rect.top, - right: rect.right, - bottom: rect.bottom, - left: rect.left, - x: rect.left, - y: rect.top - }; -} - -// means it doesn't take into account transforms. - -function getLayoutRect(element) { - var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. - // Fixes https://github.com/popperjs/popper-core/issues/1223 - - var width = element.offsetWidth; - var height = element.offsetHeight; - - if (Math.abs(clientRect.width - width) <= 1) { - width = clientRect.width; - } - - if (Math.abs(clientRect.height - height) <= 1) { - height = clientRect.height; - } - - return { - x: element.offsetLeft, - y: element.offsetTop, - width: width, - height: height - }; -} - -function contains(parent, child) { - var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method - - if (parent.contains(child)) { - return true; - } // then fallback to custom implementation with Shadow DOM support - else if (rootNode && isShadowRoot(rootNode)) { - var next = child; - - do { - if (next && parent.isSameNode(next)) { - return true; - } // $FlowFixMe[prop-missing]: need a better way to handle this... - - - next = next.parentNode || next.host; - } while (next); - } // Give up, the result is false - - - return false; -} - -function getComputedStyle(element) { - return getWindow(element).getComputedStyle(element); -} - -function isTableElement(element) { - return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0; -} - -function getDocumentElement(element) { - // $FlowFixMe[incompatible-return]: assume body is always available - return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing] - element.document) || window.document).documentElement; -} - -function getParentNode(element) { - if (getNodeName(element) === 'html') { - return element; - } - - return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle - // $FlowFixMe[incompatible-return] - // $FlowFixMe[prop-missing] - element.assignedSlot || // step into the shadow DOM of the parent of a slotted node - element.parentNode || ( // DOM Element detected - isShadowRoot(element) ? element.host : null) || // ShadowRoot detected - // $FlowFixMe[incompatible-call]: HTMLElement is a Node - getDocumentElement(element) // fallback - - ); -} - -function getTrueOffsetParent(element) { - if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 - getComputedStyle(element).position === 'fixed') { - return null; - } - - return element.offsetParent; -} // `.offsetParent` reports `null` for fixed elements, while absolute elements -// return the containing block - - -function getContainingBlock(element) { - var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; - var isIE = navigator.userAgent.indexOf('Trident') !== -1; - - if (isIE && isHTMLElement(element)) { - // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport - var elementCss = getComputedStyle(element); - - if (elementCss.position === 'fixed') { - return null; - } - } - - var currentNode = getParentNode(element); - - while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { - var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that - // create a containing block. - // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block - - if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { - return currentNode; - } else { - currentNode = currentNode.parentNode; - } - } - - return null; -} // Gets the closest ancestor positioned element. Handles some edge cases, -// such as table ancestors and cross browser bugs. - - -function getOffsetParent(element) { - var window = getWindow(element); - var offsetParent = getTrueOffsetParent(element); - - while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') { - offsetParent = getTrueOffsetParent(offsetParent); - } - - if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) { - return window; - } - - return offsetParent || getContainingBlock(element) || window; -} - -function getMainAxisFromPlacement(placement) { - return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; -} - -var max = Math.max; -var min = Math.min; -var round = Math.round; - -function within(min$1, value, max$1) { - return max(min$1, min(value, max$1)); -} - -function getFreshSideObject() { - return { - top: 0, - right: 0, - bottom: 0, - left: 0 - }; -} - -function mergePaddingObject(paddingObject) { - return Object.assign({}, getFreshSideObject(), paddingObject); -} - -function expandToHashMap(value, keys) { - return keys.reduce(function (hashMap, key) { - hashMap[key] = value; - return hashMap; - }, {}); -} - -var toPaddingObject = function toPaddingObject(padding, state) { - padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); -}; - -function arrow(_ref) { - var _state$modifiersData$; - - var state = _ref.state, - name = _ref.name, - options = _ref.options; - var arrowElement = state.elements.arrow; - var popperOffsets = state.modifiersData.popperOffsets; - var basePlacement = getBasePlacement(state.placement); - var axis = getMainAxisFromPlacement(basePlacement); - var isVertical = [left, right].indexOf(basePlacement) >= 0; - var len = isVertical ? 'height' : 'width'; - - if (!arrowElement || !popperOffsets) { - return; - } - - var paddingObject = toPaddingObject(options.padding, state); - var arrowRect = getLayoutRect(arrowElement); - var minProp = axis === 'y' ? top : left; - var maxProp = axis === 'y' ? bottom : right; - var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len]; - var startDiff = popperOffsets[axis] - state.rects.reference[axis]; - var arrowOffsetParent = getOffsetParent(arrowElement); - var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; - var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is - // outside of the popper bounds - - var min = paddingObject[minProp]; - var max = clientSize - arrowRect[len] - paddingObject[maxProp]; - var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; - var offset = within(min, center, max); // Prevents breaking syntax highlighting... - - var axisProp = axis; - state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$); -} - -function effect$1(_ref2) { - var state = _ref2.state, - options = _ref2.options; - var _options$element = options.element, - arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; - - if (arrowElement == null) { - return; - } // CSS selector - - - if (typeof arrowElement === 'string') { - arrowElement = state.elements.popper.querySelector(arrowElement); - - if (!arrowElement) { - return; - } - } - - if (process.env.NODE_ENV !== "production") { - if (!isHTMLElement(arrowElement)) { - console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', 'To use an SVG arrow, wrap it in an HTMLElement that will be used as', 'the arrow.'].join(' ')); - } - } - - if (!contains(state.elements.popper, arrowElement)) { - if (process.env.NODE_ENV !== "production") { - console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', 'element.'].join(' ')); - } - - return; - } - - state.elements.arrow = arrowElement; -} // eslint-disable-next-line import/no-unused-modules - - -var arrow$1 = { - name: 'arrow', - enabled: true, - phase: 'main', - fn: arrow, - effect: effect$1, - requires: ['popperOffsets'], - requiresIfExists: ['preventOverflow'] -}; - -var unsetSides = { - top: 'auto', - right: 'auto', - bottom: 'auto', - left: 'auto' -}; // Round the offsets to the nearest suitable subpixel based on the DPR. -// Zooming can change the DPR, but it seems to report a value that will -// cleanly divide the values into the appropriate subpixels. - -function roundOffsetsByDPR(_ref) { - var x = _ref.x, - y = _ref.y; - var win = window; - var dpr = win.devicePixelRatio || 1; - return { - x: round(round(x * dpr) / dpr) || 0, - y: round(round(y * dpr) / dpr) || 0 - }; -} - -function mapToStyles(_ref2) { - var _Object$assign2; - - var popper = _ref2.popper, - popperRect = _ref2.popperRect, - placement = _ref2.placement, - offsets = _ref2.offsets, - position = _ref2.position, - gpuAcceleration = _ref2.gpuAcceleration, - adaptive = _ref2.adaptive, - roundOffsets = _ref2.roundOffsets; - - var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, - _ref3$x = _ref3.x, - x = _ref3$x === void 0 ? 0 : _ref3$x, - _ref3$y = _ref3.y, - y = _ref3$y === void 0 ? 0 : _ref3$y; - - var hasX = offsets.hasOwnProperty('x'); - var hasY = offsets.hasOwnProperty('y'); - var sideX = left; - var sideY = top; - var win = window; - - if (adaptive) { - var offsetParent = getOffsetParent(popper); - var heightProp = 'clientHeight'; - var widthProp = 'clientWidth'; - - if (offsetParent === getWindow(popper)) { - offsetParent = getDocumentElement(popper); - - if (getComputedStyle(offsetParent).position !== 'static') { - heightProp = 'scrollHeight'; - widthProp = 'scrollWidth'; - } - } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it - - - offsetParent = offsetParent; - - if (placement === top) { - sideY = bottom; // $FlowFixMe[prop-missing] - - y -= offsetParent[heightProp] - popperRect.height; - y *= gpuAcceleration ? 1 : -1; - } - - if (placement === left) { - sideX = right; // $FlowFixMe[prop-missing] - - x -= offsetParent[widthProp] - popperRect.width; - x *= gpuAcceleration ? 1 : -1; - } - } - - var commonStyles = Object.assign({ - position: position - }, adaptive && unsetSides); - - if (gpuAcceleration) { - var _Object$assign; - - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); - } - - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); -} - -function computeStyles(_ref4) { - var state = _ref4.state, - options = _ref4.options; - var _options$gpuAccelerat = options.gpuAcceleration, - gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, - _options$adaptive = options.adaptive, - adaptive = _options$adaptive === void 0 ? true : _options$adaptive, - _options$roundOffsets = options.roundOffsets, - roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; - - if (process.env.NODE_ENV !== "production") { - var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || ''; - - if (adaptive && ['transform', 'top', 'right', 'bottom', 'left'].some(function (property) { - return transitionProperty.indexOf(property) >= 0; - })) { - console.warn(['Popper: Detected CSS transitions on at least one of the following', 'CSS properties: "transform", "top", "right", "bottom", "left".', '\n\n', 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', 'for smooth transitions, or remove these properties from the CSS', 'transition declaration on the popper element if only transitioning', 'opacity or background-color for example.', '\n\n', 'We recommend using the popper element as a wrapper around an inner', 'element that can have any CSS property transitioned for animations.'].join(' ')); - } - } - - var commonStyles = { - placement: getBasePlacement(state.placement), - popper: state.elements.popper, - popperRect: state.rects.popper, - gpuAcceleration: gpuAcceleration - }; - - if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.popperOffsets, - position: state.options.strategy, - adaptive: adaptive, - roundOffsets: roundOffsets - }))); - } - - if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.arrow, - position: 'absolute', - adaptive: false, - roundOffsets: roundOffsets - }))); - } - - state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-placement': state.placement - }); -} // eslint-disable-next-line import/no-unused-modules - - -var computeStyles$1 = { - name: 'computeStyles', - enabled: true, - phase: 'beforeWrite', - fn: computeStyles, - data: {} -}; - -var passive = { - passive: true -}; - -function effect$2(_ref) { - var state = _ref.state, - instance = _ref.instance, - options = _ref.options; - var _options$scroll = options.scroll, - scroll = _options$scroll === void 0 ? true : _options$scroll, - _options$resize = options.resize, - resize = _options$resize === void 0 ? true : _options$resize; - var window = getWindow(state.elements.popper); - var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); - - if (scroll) { - scrollParents.forEach(function (scrollParent) { - scrollParent.addEventListener('scroll', instance.update, passive); - }); - } - - if (resize) { - window.addEventListener('resize', instance.update, passive); - } - - return function () { - if (scroll) { - scrollParents.forEach(function (scrollParent) { - scrollParent.removeEventListener('scroll', instance.update, passive); - }); - } - - if (resize) { - window.removeEventListener('resize', instance.update, passive); - } - }; -} // eslint-disable-next-line import/no-unused-modules - - -var eventListeners = { - name: 'eventListeners', - enabled: true, - phase: 'write', - fn: function fn() {}, - effect: effect$2, - data: {} -}; - -var hash = { - left: 'right', - right: 'left', - bottom: 'top', - top: 'bottom' -}; -function getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, function (matched) { - return hash[matched]; - }); -} - -var hash$1 = { - start: 'end', - end: 'start' -}; -function getOppositeVariationPlacement(placement) { - return placement.replace(/start|end/g, function (matched) { - return hash$1[matched]; - }); -} - -function getWindowScroll(node) { - var win = getWindow(node); - var scrollLeft = win.pageXOffset; - var scrollTop = win.pageYOffset; - return { - scrollLeft: scrollLeft, - scrollTop: scrollTop - }; -} - -function getWindowScrollBarX(element) { - // If has a CSS width greater than the viewport, then this will be - // incorrect for RTL. - // Popper 1 is broken in this case and never had a bug report so let's assume - // it's not an issue. I don't think anyone ever specifies width on - // anyway. - // Browsers where the left scrollbar doesn't cause an issue report `0` for - // this (e.g. Edge 2019, IE11, Safari) - return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; -} - -function getViewportRect(element) { - var win = getWindow(element); - var html = getDocumentElement(element); - var visualViewport = win.visualViewport; - var width = html.clientWidth; - var height = html.clientHeight; - var x = 0; - var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper - // can be obscured underneath it. - // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even - // if it isn't open, so if this isn't available, the popper will be detected - // to overflow the bottom of the screen too early. - - if (visualViewport) { - width = visualViewport.width; - height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently) - // In Chrome, it returns a value very close to 0 (+/-) but contains rounding - // errors due to floating point numbers, so we need to check precision. - // Safari returns a number <= 0, usually < -1 when pinch-zoomed - // Feature detection fails in mobile emulation mode in Chrome. - // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < - // 0.001 - // Fallback here: "Not Safari" userAgent - - if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) { - x = visualViewport.offsetLeft; - y = visualViewport.offsetTop; - } - } - - return { - width: width, - height: height, - x: x + getWindowScrollBarX(element), - y: y - }; -} - -// of the `` and `` rect bounds if horizontally scrollable - -function getDocumentRect(element) { - var _element$ownerDocumen; - - var html = getDocumentElement(element); - var winScroll = getWindowScroll(element); - var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); - var x = -winScroll.scrollLeft + getWindowScrollBarX(element); - var y = -winScroll.scrollTop; - - if (getComputedStyle(body || html).direction === 'rtl') { - x += max(html.clientWidth, body ? body.clientWidth : 0) - width; - } - - return { - width: width, - height: height, - x: x, - y: y - }; -} - -function isScrollParent(element) { - // Firefox wants us to check `-x` and `-y` variations as well - var _getComputedStyle = getComputedStyle(element), - overflow = _getComputedStyle.overflow, - overflowX = _getComputedStyle.overflowX, - overflowY = _getComputedStyle.overflowY; - - return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); -} - -function getScrollParent(node) { - if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { - // $FlowFixMe[incompatible-return]: assume body is always available - return node.ownerDocument.body; - } - - if (isHTMLElement(node) && isScrollParent(node)) { - return node; - } - - return getScrollParent(getParentNode(node)); -} - -/* -given a DOM element, return the list of all scroll parents, up the list of ancesors -until we get to the top window object. This list is what we attach scroll listeners -to, because if any of these parent elements scroll, we'll need to re-calculate the -reference element's position. -*/ - -function listScrollParents(element, list) { - var _element$ownerDocumen; - - if (list === void 0) { - list = []; - } - - var scrollParent = getScrollParent(element); - var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); - var win = getWindow(scrollParent); - var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; - var updatedList = list.concat(target); - return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here - updatedList.concat(listScrollParents(getParentNode(target))); -} - -function rectToClientRect(rect) { - return Object.assign({}, rect, { - left: rect.x, - top: rect.y, - right: rect.x + rect.width, - bottom: rect.y + rect.height - }); -} - -function getInnerBoundingClientRect(element) { - var rect = getBoundingClientRect(element); - rect.top = rect.top + element.clientTop; - rect.left = rect.left + element.clientLeft; - rect.bottom = rect.top + element.clientHeight; - rect.right = rect.left + element.clientWidth; - rect.width = element.clientWidth; - rect.height = element.clientHeight; - rect.x = rect.left; - rect.y = rect.top; - return rect; -} - -function getClientRectFromMixedType(element, clippingParent) { - return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isHTMLElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element))); -} // A "clipping parent" is an overflowable container with the characteristic of -// clipping (or hiding) overflowing elements with a position different from -// `initial` - - -function getClippingParents(element) { - var clippingParents = listScrollParents(getParentNode(element)); - var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0; - var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; - - if (!isElement(clipperElement)) { - return []; - } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 - - - return clippingParents.filter(function (clippingParent) { - return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body'; - }); -} // Gets the maximum area that the element is visible in due to any number of -// clipping parents - - -function getClippingRect(element, boundary, rootBoundary) { - var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary); - var clippingParents = [].concat(mainClippingParents, [rootBoundary]); - var firstClippingParent = clippingParents[0]; - var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { - var rect = getClientRectFromMixedType(element, clippingParent); - accRect.top = max(rect.top, accRect.top); - accRect.right = min(rect.right, accRect.right); - accRect.bottom = min(rect.bottom, accRect.bottom); - accRect.left = max(rect.left, accRect.left); - return accRect; - }, getClientRectFromMixedType(element, firstClippingParent)); - clippingRect.width = clippingRect.right - clippingRect.left; - clippingRect.height = clippingRect.bottom - clippingRect.top; - clippingRect.x = clippingRect.left; - clippingRect.y = clippingRect.top; - return clippingRect; -} - -function getVariation(placement) { - return placement.split('-')[1]; -} - -function computeOffsets(_ref) { - var reference = _ref.reference, - element = _ref.element, - placement = _ref.placement; - var basePlacement = placement ? getBasePlacement(placement) : null; - var variation = placement ? getVariation(placement) : null; - var commonX = reference.x + reference.width / 2 - element.width / 2; - var commonY = reference.y + reference.height / 2 - element.height / 2; - var offsets; - - switch (basePlacement) { - case top: - offsets = { - x: commonX, - y: reference.y - element.height - }; - break; - - case bottom: - offsets = { - x: commonX, - y: reference.y + reference.height - }; - break; - - case right: - offsets = { - x: reference.x + reference.width, - y: commonY - }; - break; - - case left: - offsets = { - x: reference.x - element.width, - y: commonY - }; - break; - - default: - offsets = { - x: reference.x, - y: reference.y - }; - } - - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; - - if (mainAxis != null) { - var len = mainAxis === 'y' ? 'height' : 'width'; - - switch (variation) { - case start$1: - offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2); - break; - - case end: - offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2); - break; - } - } - - return offsets; -} - -function detectOverflow(state, options) { - if (options === void 0) { - options = {}; - } - - var _options = options, - _options$placement = _options.placement, - placement = _options$placement === void 0 ? state.placement : _options$placement, - _options$boundary = _options.boundary, - boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, - _options$rootBoundary = _options.rootBoundary, - rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, - _options$elementConte = _options.elementContext, - elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, - _options$altBoundary = _options.altBoundary, - altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, - _options$padding = _options.padding, - padding = _options$padding === void 0 ? 0 : _options$padding; - var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); - var altContext = elementContext === popper ? reference : popper; - var referenceElement = state.elements.reference; - var popperRect = state.rects.popper; - var element = state.elements[altBoundary ? altContext : elementContext]; - var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); - var referenceClientRect = getBoundingClientRect(referenceElement); - var popperOffsets = computeOffsets({ - reference: referenceClientRect, - element: popperRect, - strategy: 'absolute', - placement: placement - }); - var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); - var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect - // 0 or negative = within the clipping rect - - var overflowOffsets = { - top: clippingClientRect.top - elementClientRect.top + paddingObject.top, - bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, - left: clippingClientRect.left - elementClientRect.left + paddingObject.left, - right: elementClientRect.right - clippingClientRect.right + paddingObject.right - }; - var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element - - if (elementContext === popper && offsetData) { - var offset = offsetData[placement]; - Object.keys(overflowOffsets).forEach(function (key) { - var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; - var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x'; - overflowOffsets[key] += offset[axis] * multiply; - }); - } - - return overflowOffsets; -} - -function computeAutoPlacement(state, options) { - if (options === void 0) { - options = {}; - } - - var _options = options, - placement = _options.placement, - boundary = _options.boundary, - rootBoundary = _options.rootBoundary, - padding = _options.padding, - flipVariations = _options.flipVariations, - _options$allowedAutoP = _options.allowedAutoPlacements, - allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; - var variation = getVariation(placement); - var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) { - return getVariation(placement) === variation; - }) : basePlacements; - var allowedPlacements = placements$1.filter(function (placement) { - return allowedAutoPlacements.indexOf(placement) >= 0; - }); - - if (allowedPlacements.length === 0) { - allowedPlacements = placements$1; - - if (process.env.NODE_ENV !== "production") { - console.error(['Popper: The `allowedAutoPlacements` option did not allow any', 'placements. Ensure the `placement` option matches the variation', 'of the allowed placements.', 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(' ')); - } - } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... - - - var overflows = allowedPlacements.reduce(function (acc, placement) { - acc[placement] = detectOverflow(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding - })[getBasePlacement(placement)]; - return acc; - }, {}); - return Object.keys(overflows).sort(function (a, b) { - return overflows[a] - overflows[b]; - }); -} - -function getExpandedFallbackPlacements(placement) { - if (getBasePlacement(placement) === auto) { - return []; - } - - var oppositePlacement = getOppositePlacement(placement); - return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; -} - -function flip(_ref) { - var state = _ref.state, - options = _ref.options, - name = _ref.name; - - if (state.modifiersData[name]._skip) { - return; - } - - var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, - specifiedFallbackPlacements = options.fallbackPlacements, - padding = options.padding, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - _options$flipVariatio = options.flipVariations, - flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, - allowedAutoPlacements = options.allowedAutoPlacements; - var preferredPlacement = state.options.placement; - var basePlacement = getBasePlacement(preferredPlacement); - var isBasePlacement = basePlacement === preferredPlacement; - var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); - var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) { - return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding, - flipVariations: flipVariations, - allowedAutoPlacements: allowedAutoPlacements - }) : placement); - }, []); - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var checksMap = new Map(); - var makeFallbackChecks = true; - var firstFittingPlacement = placements[0]; - - for (var i = 0; i < placements.length; i++) { - var placement = placements[i]; - - var _basePlacement = getBasePlacement(placement); - - var isStartVariation = getVariation(placement) === start$1; - var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; - var len = isVertical ? 'width' : 'height'; - var overflow = detectOverflow(state, { - placement: placement, - boundary: boundary, - rootBoundary: rootBoundary, - altBoundary: altBoundary, - padding: padding - }); - var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; - - if (referenceRect[len] > popperRect[len]) { - mainVariationSide = getOppositePlacement(mainVariationSide); - } - - var altVariationSide = getOppositePlacement(mainVariationSide); - var checks = []; - - if (checkMainAxis) { - checks.push(overflow[_basePlacement] <= 0); - } - - if (checkAltAxis) { - checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); - } - - if (checks.every(function (check) { - return check; - })) { - firstFittingPlacement = placement; - makeFallbackChecks = false; - break; - } - - checksMap.set(placement, checks); - } - - if (makeFallbackChecks) { - // `2` may be desired in some cases – research later - var numberOfChecks = flipVariations ? 3 : 1; - - var _loop = function _loop(_i) { - var fittingPlacement = placements.find(function (placement) { - var checks = checksMap.get(placement); - - if (checks) { - return checks.slice(0, _i).every(function (check) { - return check; - }); - } - }); - - if (fittingPlacement) { - firstFittingPlacement = fittingPlacement; - return "break"; - } - }; - - for (var _i = numberOfChecks; _i > 0; _i--) { - var _ret = _loop(_i); - - if (_ret === "break") break; - } - } - - if (state.placement !== firstFittingPlacement) { - state.modifiersData[name]._skip = true; - state.placement = firstFittingPlacement; - state.reset = true; - } -} // eslint-disable-next-line import/no-unused-modules - - -var flip$1 = { - name: 'flip', - enabled: true, - phase: 'main', - fn: flip, - requiresIfExists: ['offset'], - data: { - _skip: false - } -}; - -function getSideOffsets(overflow, rect, preventedOffsets) { - if (preventedOffsets === void 0) { - preventedOffsets = { - x: 0, - y: 0 - }; - } - - return { - top: overflow.top - rect.height - preventedOffsets.y, - right: overflow.right - rect.width + preventedOffsets.x, - bottom: overflow.bottom - rect.height + preventedOffsets.y, - left: overflow.left - rect.width - preventedOffsets.x - }; -} - -function isAnySideFullyClipped(overflow) { - return [top, right, bottom, left].some(function (side) { - return overflow[side] >= 0; - }); -} - -function hide(_ref) { - var state = _ref.state, - name = _ref.name; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var preventedOffsets = state.modifiersData.preventOverflow; - var referenceOverflow = detectOverflow(state, { - elementContext: 'reference' - }); - var popperAltOverflow = detectOverflow(state, { - altBoundary: true - }); - var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); - var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); - var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); - var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); - state.modifiersData[name] = { - referenceClippingOffsets: referenceClippingOffsets, - popperEscapeOffsets: popperEscapeOffsets, - isReferenceHidden: isReferenceHidden, - hasPopperEscaped: hasPopperEscaped - }; - state.attributes.popper = Object.assign({}, state.attributes.popper, { - 'data-popper-reference-hidden': isReferenceHidden, - 'data-popper-escaped': hasPopperEscaped - }); -} // eslint-disable-next-line import/no-unused-modules - - -var hide$1 = { - name: 'hide', - enabled: true, - phase: 'main', - requiresIfExists: ['preventOverflow'], - fn: hide -}; - -function distanceAndSkiddingToXY(placement, rects, offset) { - var basePlacement = getBasePlacement(placement); - var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; - - var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { - placement: placement - })) : offset, - skidding = _ref[0], - distance = _ref[1]; - - skidding = skidding || 0; - distance = (distance || 0) * invertDistance; - return [left, right].indexOf(basePlacement) >= 0 ? { - x: distance, - y: skidding - } : { - x: skidding, - y: distance - }; -} - -function offset(_ref2) { - var state = _ref2.state, - options = _ref2.options, - name = _ref2.name; - var _options$offset = options.offset, - offset = _options$offset === void 0 ? [0, 0] : _options$offset; - var data = placements.reduce(function (acc, placement) { - acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset); - return acc; - }, {}); - var _data$state$placement = data[state.placement], - x = _data$state$placement.x, - y = _data$state$placement.y; - - if (state.modifiersData.popperOffsets != null) { - state.modifiersData.popperOffsets.x += x; - state.modifiersData.popperOffsets.y += y; - } - - state.modifiersData[name] = data; -} // eslint-disable-next-line import/no-unused-modules - - -var offset$1 = { - name: 'offset', - enabled: true, - phase: 'main', - requires: ['popperOffsets'], - fn: offset -}; - -function popperOffsets(_ref) { - var state = _ref.state, - name = _ref.name; - // Offsets are the actual position the popper needs to have to be - // properly positioned near its reference element - // This is the most basic placement, and will be adjusted by - // the modifiers in the next step - state.modifiersData[name] = computeOffsets({ - reference: state.rects.reference, - element: state.rects.popper, - strategy: 'absolute', - placement: state.placement - }); -} // eslint-disable-next-line import/no-unused-modules - - -var popperOffsets$1 = { - name: 'popperOffsets', - enabled: true, - phase: 'read', - fn: popperOffsets, - data: {} -}; - -function getAltAxis(axis) { - return axis === 'x' ? 'y' : 'x'; -} - -function preventOverflow(_ref) { - var state = _ref.state, - options = _ref.options, - name = _ref.name; - var _options$mainAxis = options.mainAxis, - checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, - _options$altAxis = options.altAxis, - checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, - boundary = options.boundary, - rootBoundary = options.rootBoundary, - altBoundary = options.altBoundary, - padding = options.padding, - _options$tether = options.tether, - tether = _options$tether === void 0 ? true : _options$tether, - _options$tetherOffset = options.tetherOffset, - tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; - var overflow = detectOverflow(state, { - boundary: boundary, - rootBoundary: rootBoundary, - padding: padding, - altBoundary: altBoundary - }); - var basePlacement = getBasePlacement(state.placement); - var variation = getVariation(state.placement); - var isBasePlacement = !variation; - var mainAxis = getMainAxisFromPlacement(basePlacement); - var altAxis = getAltAxis(mainAxis); - var popperOffsets = state.modifiersData.popperOffsets; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { - placement: state.placement - })) : tetherOffset; - var data = { - x: 0, - y: 0 - }; - - if (!popperOffsets) { - return; - } - - if (checkMainAxis || checkAltAxis) { - var mainSide = mainAxis === 'y' ? top : left; - var altSide = mainAxis === 'y' ? bottom : right; - var len = mainAxis === 'y' ? 'height' : 'width'; - var offset = popperOffsets[mainAxis]; - var min$1 = popperOffsets[mainAxis] + overflow[mainSide]; - var max$1 = popperOffsets[mainAxis] - overflow[altSide]; - var additive = tether ? -popperRect[len] / 2 : 0; - var minLen = variation === start$1 ? referenceRect[len] : popperRect[len]; - var maxLen = variation === start$1 ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go - // outside the reference bounds - - var arrowElement = state.elements.arrow; - var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { - width: 0, - height: 0 - }; - var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject(); - var arrowPaddingMin = arrowPaddingObject[mainSide]; - var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want - // to include its full size in the calculation. If the reference is small - // and near the edge of a boundary, the popper can overflow even if the - // reference is not overflowing as well (e.g. virtual elements with no - // width or height) - - var arrowLen = within(0, referenceRect[len], arrowRect[len]); - var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - tetherOffsetValue : minLen - arrowLen - arrowPaddingMin - tetherOffsetValue; - var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + tetherOffsetValue : maxLen + arrowLen + arrowPaddingMax + tetherOffsetValue; - var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); - var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; - var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0; - var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset; - var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue; - - if (checkMainAxis) { - var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1); - popperOffsets[mainAxis] = preventedOffset; - data[mainAxis] = preventedOffset - offset; - } - - if (checkAltAxis) { - var _mainSide = mainAxis === 'x' ? top : left; - - var _altSide = mainAxis === 'x' ? bottom : right; - - var _offset = popperOffsets[altAxis]; - - var _min = _offset + overflow[_mainSide]; - - var _max = _offset - overflow[_altSide]; - - var _preventedOffset = within(tether ? min(_min, tetherMin) : _min, _offset, tether ? max(_max, tetherMax) : _max); - - popperOffsets[altAxis] = _preventedOffset; - data[altAxis] = _preventedOffset - _offset; - } - } - - state.modifiersData[name] = data; -} // eslint-disable-next-line import/no-unused-modules - - -var preventOverflow$1 = { - name: 'preventOverflow', - enabled: true, - phase: 'main', - fn: preventOverflow, - requiresIfExists: ['offset'] -}; - -function getHTMLElementScroll(element) { - return { - scrollLeft: element.scrollLeft, - scrollTop: element.scrollTop - }; -} - -function getNodeScroll(node) { - if (node === getWindow(node) || !isHTMLElement(node)) { - return getWindowScroll(node); - } else { - return getHTMLElementScroll(node); - } -} - -// Composite means it takes into account transforms as well as layout. - -function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { - if (isFixed === void 0) { - isFixed = false; - } - - var documentElement = getDocumentElement(offsetParent); - var rect = getBoundingClientRect(elementOrVirtualElement); - var isOffsetParentAnElement = isHTMLElement(offsetParent); - var scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - var offsets = { - x: 0, - y: 0 - }; - - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078 - isScrollParent(documentElement)) { - scroll = getNodeScroll(offsetParent); - } - - if (isHTMLElement(offsetParent)) { - offsets = getBoundingClientRect(offsetParent); - offsets.x += offsetParent.clientLeft; - offsets.y += offsetParent.clientTop; - } else if (documentElement) { - offsets.x = getWindowScrollBarX(documentElement); - } - } - - return { - x: rect.left + scroll.scrollLeft - offsets.x, - y: rect.top + scroll.scrollTop - offsets.y, - width: rect.width, - height: rect.height - }; -} - -function order(modifiers) { - var map = new Map(); - var visited = new Set(); - var result = []; - modifiers.forEach(function (modifier) { - map.set(modifier.name, modifier); - }); // On visiting object, check for its dependencies and visit them recursively - - function sort(modifier) { - visited.add(modifier.name); - var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); - requires.forEach(function (dep) { - if (!visited.has(dep)) { - var depModifier = map.get(dep); - - if (depModifier) { - sort(depModifier); - } - } - }); - result.push(modifier); - } - - modifiers.forEach(function (modifier) { - if (!visited.has(modifier.name)) { - // check for visited object - sort(modifier); - } - }); - return result; -} - -function orderModifiers(modifiers) { - // order based on dependencies - var orderedModifiers = order(modifiers); // order based on phase - - return modifierPhases.reduce(function (acc, phase) { - return acc.concat(orderedModifiers.filter(function (modifier) { - return modifier.phase === phase; - })); - }, []); -} - -function debounce(fn) { - var pending; - return function () { - if (!pending) { - pending = new Promise(function (resolve) { - Promise.resolve().then(function () { - pending = undefined; - resolve(fn()); - }); - }); - } - - return pending; - }; -} - -function format$1(str) { - for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - args[_key - 1] = arguments[_key]; - } - - return [].concat(args).reduce(function (p, c) { - return p.replace(/%s/, c); - }, str); -} - -var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s'; -var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available'; -var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; -function validateModifiers(modifiers) { - modifiers.forEach(function (modifier) { - Object.keys(modifier).forEach(function (key) { - switch (key) { - case 'name': - if (typeof modifier.name !== 'string') { - console.error(format$1(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', "\"" + String(modifier.name) + "\"")); - } - - break; - - case 'enabled': - if (typeof modifier.enabled !== 'boolean') { - console.error(format$1(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); - } - - case 'phase': - if (modifierPhases.indexOf(modifier.phase) < 0) { - console.error(format$1(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); - } - - break; - - case 'fn': - if (typeof modifier.fn !== 'function') { - console.error(format$1(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', "\"" + String(modifier.fn) + "\"")); - } - - break; - - case 'effect': - if (typeof modifier.effect !== 'function') { - console.error(format$1(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); - } - - break; - - case 'requires': - if (!Array.isArray(modifier.requires)) { - console.error(format$1(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); - } - - break; - - case 'requiresIfExists': - if (!Array.isArray(modifier.requiresIfExists)) { - console.error(format$1(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', "\"" + String(modifier.requiresIfExists) + "\"")); - } - - break; - - case 'options': - case 'data': - break; - - default: - console.error("PopperJS: an invalid property has been provided to the \"" + modifier.name + "\" modifier, valid properties are " + VALID_PROPERTIES.map(function (s) { - return "\"" + s + "\""; - }).join(', ') + "; but \"" + key + "\" was provided."); - } - - modifier.requires && modifier.requires.forEach(function (requirement) { - if (modifiers.find(function (mod) { - return mod.name === requirement; - }) == null) { - console.error(format$1(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement)); - } - }); - }); - }); -} - -function uniqueBy(arr, fn) { - var identifiers = new Set(); - return arr.filter(function (item) { - var identifier = fn(item); - - if (!identifiers.has(identifier)) { - identifiers.add(identifier); - return true; - } - }); -} - -function mergeByName(modifiers) { - var merged = modifiers.reduce(function (merged, current) { - var existing = merged[current.name]; - merged[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) - }) : current; - return merged; - }, {}); // IE11 does not support Object.values - - return Object.keys(merged).map(function (key) { - return merged[key]; - }); -} - -var INVALID_ELEMENT_ERROR = 'Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.'; -var INFINITE_LOOP_ERROR = 'Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.'; -var DEFAULT_OPTIONS = { - placement: 'bottom', - modifiers: [], - strategy: 'absolute' -}; - -function areValidElements() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - return !args.some(function (element) { - return !(element && typeof element.getBoundingClientRect === 'function'); - }); -} - -function popperGenerator(generatorOptions) { - if (generatorOptions === void 0) { - generatorOptions = {}; - } - - var _generatorOptions = generatorOptions, - _generatorOptions$def = _generatorOptions.defaultModifiers, - defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, - _generatorOptions$def2 = _generatorOptions.defaultOptions, - defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; - return function createPopper(reference, popper, options) { - if (options === void 0) { - options = defaultOptions; - } - - var state = { - placement: 'bottom', - orderedModifiers: [], - options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), - modifiersData: {}, - elements: { - reference: reference, - popper: popper - }, - attributes: {}, - styles: {} - }; - var effectCleanupFns = []; - var isDestroyed = false; - var instance = { - state: state, - setOptions: function setOptions(options) { - cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options); - state.scrollParents = { - reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], - popper: listScrollParents(popper) - }; // Orders the modifiers based on their dependencies and `phase` - // properties - - var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers - - state.orderedModifiers = orderedModifiers.filter(function (m) { - return m.enabled; - }); // Validate the provided modifiers so that the consumer will get warned - // if one of the modifiers is invalid for any reason - - if (process.env.NODE_ENV !== "production") { - var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function (_ref) { - var name = _ref.name; - return name; - }); - validateModifiers(modifiers); - - if (getBasePlacement(state.options.placement) === auto) { - var flipModifier = state.orderedModifiers.find(function (_ref2) { - var name = _ref2.name; - return name === 'flip'; - }); - - if (!flipModifier) { - console.error(['Popper: "auto" placements require the "flip" modifier be', 'present and enabled to work.'].join(' ')); - } - } - - var _getComputedStyle = getComputedStyle(popper), - marginTop = _getComputedStyle.marginTop, - marginRight = _getComputedStyle.marginRight, - marginBottom = _getComputedStyle.marginBottom, - marginLeft = _getComputedStyle.marginLeft; // We no longer take into account `margins` on the popper, and it can - // cause bugs with positioning, so we'll warn the consumer - - - if ([marginTop, marginRight, marginBottom, marginLeft].some(function (margin) { - return parseFloat(margin); - })) { - console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', 'between the popper and its reference element or boundary.', 'To replicate margin, use the `offset` modifier, as well as', 'the `padding` option in the `preventOverflow` and `flip`', 'modifiers.'].join(' ')); - } - } - - runModifierEffects(); - return instance.update(); - }, - // Sync update – it will always be executed, even if not necessary. This - // is useful for low frequency updates where sync behavior simplifies the - // logic. - // For high frequency updates (e.g. `resize` and `scroll` events), always - // prefer the async Popper#update method - forceUpdate: function forceUpdate() { - if (isDestroyed) { - return; - } - - var _state$elements = state.elements, - reference = _state$elements.reference, - popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements - // anymore - - if (!areValidElements(reference, popper)) { - if (process.env.NODE_ENV !== "production") { - console.error(INVALID_ELEMENT_ERROR); - } - - return; - } // Store the reference and popper rects to be read by modifiers - - - state.rects = { - reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'), - popper: getLayoutRect(popper) - }; // Modifiers have the ability to reset the current update cycle. The - // most common use case for this is the `flip` modifier changing the - // placement, which then needs to re-run all the modifiers, because the - // logic was previously ran for the previous placement and is therefore - // stale/incorrect - - state.reset = false; - state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier - // is filled with the initial data specified by the modifier. This means - // it doesn't persist and is fresh on each update. - // To ensure persistent data, use `${name}#persistent` - - state.orderedModifiers.forEach(function (modifier) { - return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); - }); - var __debug_loops__ = 0; - - for (var index = 0; index < state.orderedModifiers.length; index++) { - if (process.env.NODE_ENV !== "production") { - __debug_loops__ += 1; - - if (__debug_loops__ > 100) { - console.error(INFINITE_LOOP_ERROR); - break; - } - } - - if (state.reset === true) { - state.reset = false; - index = -1; - continue; - } - - var _state$orderedModifie = state.orderedModifiers[index], - fn = _state$orderedModifie.fn, - _state$orderedModifie2 = _state$orderedModifie.options, - _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, - name = _state$orderedModifie.name; - - if (typeof fn === 'function') { - state = fn({ - state: state, - options: _options, - name: name, - instance: instance - }) || state; - } - } - }, - // Async and optimistically optimized update – it will not be executed if - // not necessary (debounced to run at most once-per-tick) - update: debounce(function () { - return new Promise(function (resolve) { - instance.forceUpdate(); - resolve(state); - }); - }), - destroy: function destroy() { - cleanupModifierEffects(); - isDestroyed = true; - } - }; - - if (!areValidElements(reference, popper)) { - if (process.env.NODE_ENV !== "production") { - console.error(INVALID_ELEMENT_ERROR); - } - - return instance; - } - - instance.setOptions(options).then(function (state) { - if (!isDestroyed && options.onFirstUpdate) { - options.onFirstUpdate(state); - } - }); // Modifiers have the ability to execute arbitrary code before the first - // update cycle runs. They will be executed in the same order as the update - // cycle. This is useful when a modifier adds some persistent data that - // other modifiers need to use, but the modifier is run after the dependent - // one. - - function runModifierEffects() { - state.orderedModifiers.forEach(function (_ref3) { - var name = _ref3.name, - _ref3$options = _ref3.options, - options = _ref3$options === void 0 ? {} : _ref3$options, - effect = _ref3.effect; - - if (typeof effect === 'function') { - var cleanupFn = effect({ - state: state, - name: name, - instance: instance, - options: options - }); - - var noopFn = function noopFn() {}; - - effectCleanupFns.push(cleanupFn || noopFn); - } - }); - } - - function cleanupModifierEffects() { - effectCleanupFns.forEach(function (fn) { - return fn(); - }); - effectCleanupFns = []; - } - - return instance; - }; -} - -var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; -var createPopper = /*#__PURE__*/popperGenerator({ - defaultModifiers: defaultModifiers -}); // eslint-disable-next-line import/no-unused-modules - -const wrapAround = (value, size) => ((value % size) + size) % size; -/** - * Reproduced with permission from - * https://github.com/liamcain/obsidian-periodic-notes/blob/10fa35874d92750508967d4f1e58b3fa0eb87996/src/ui/suggest.ts - * Author: Liam Cain - */ -class Suggest { - constructor(owner, containerEl, scope) { - this.onSuggestionClick = (event, el) => { - event.preventDefault(); - const item = this.suggestions.indexOf(el); - this.setSelectedItem(item, false); - this.useSelectedItem(event); - }; - this.onSuggestionMouseover = (_event, el) => { - const item = this.suggestions.indexOf(el); - this.setSelectedItem(item, false); - }; - this.owner = owner; - this.containerEl = containerEl; - containerEl.on('click', '.suggestion-item', this.onSuggestionClick); - containerEl.on('mousemove', '.suggestion-item', this.onSuggestionMouseover); - scope.register([], 'ArrowUp', (event) => { - if (!event.isComposing) { - this.setSelectedItem(this.selectedItem - 1, true); - return false; - } - }); - scope.register([], 'ArrowDown', (event) => { - if (!event.isComposing) { - this.setSelectedItem(this.selectedItem + 1, true); - return false; - } - }); - scope.register([], 'Enter', (event) => { - if (!event.isComposing) { - this.useSelectedItem(event); - return false; - } - }); - } - setSuggestions(values) { - this.containerEl.empty(); - const suggestionEls = []; - values.forEach((value) => { - const suggestionEl = this.containerEl.createDiv('suggestion-item'); - this.owner.renderSuggestion(value, suggestionEl); - suggestionEls.push(suggestionEl); - }); - this.values = values; - this.suggestions = suggestionEls; - this.setSelectedItem(0, false); - } - useSelectedItem(event) { - const currentValue = this.values[this.selectedItem]; - if (currentValue) { - this.owner.selectSuggestion(currentValue, event); - } - } - setSelectedItem(selectedIndex, scrollIntoView) { - const normalizedIndex = wrapAround(selectedIndex, this.suggestions.length); - const prevSelectedSuggestion = this.suggestions[this.selectedItem]; - const selectedSuggestion = this.suggestions[normalizedIndex]; - prevSelectedSuggestion === null || prevSelectedSuggestion === void 0 ? void 0 : prevSelectedSuggestion.removeClass('is-selected'); - selectedSuggestion === null || selectedSuggestion === void 0 ? void 0 : selectedSuggestion.addClass('is-selected'); - this.selectedItem = normalizedIndex; - if (scrollIntoView) { - selectedSuggestion.scrollIntoView(false); - } - } -} -/** - * Reproduced with permission from - * https://github.com/liamcain/obsidian-periodic-notes/blob/10fa35874d92750508967d4f1e58b3fa0eb87996/src/ui/suggest.ts - * Author: Liam Cain - */ -class TextInputSuggest { - constructor(app, inputEl) { - this.open = (container, inputEl) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.app.keymap.pushScope(this.scope); - container.appendChild(this.suggestEl); - this.popper = createPopper(inputEl, this.suggestEl, { - placement: 'bottom-start', - modifiers: [ - { - name: 'sameWidth', - enabled: true, - fn: ({ state, instance }) => { - // Note: positioning needs to be calculated twice - - // first pass - positioning it according to the width of the popper - // second pass - position it with the width bound to the reference element - // we need to early exit to avoid an infinite loop - const targetWidth = `${state.rects.reference.width}px`; - if (state.styles.popper.width === targetWidth) { - return; - } - state.styles.popper.width = targetWidth; - instance.update(); - }, - phase: 'beforeWrite', - requires: ['computeStyles'], - }, - ], - }); - }; - this.close = () => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.app.keymap.popScope(this.scope); - this.suggest.setSuggestions([]); - this.popper.destroy(); - this.suggestEl.detach(); - }; - this.onInputChanged = () => { - const inputStr = this.inputEl.value; - const suggestions = this.getSuggestions(inputStr); - if (suggestions.length > 0) { - this.suggest.setSuggestions(suggestions); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - this.open(this.app.dom.appContainerEl, this.inputEl); - } - }; - this.app = app; - this.inputEl = inputEl; - this.scope = new obsidian.Scope(); - this.suggestEl = createDiv('suggestion-container'); - const suggestion = this.suggestEl.createDiv('suggestion'); - this.suggest = new Suggest(this, suggestion, this.scope); - this.scope.register([], 'Escape', this.close); - this.inputEl.addEventListener('input', this.onInputChanged); - this.inputEl.addEventListener('focus', this.onInputChanged); - this.inputEl.addEventListener('blur', this.close); - this.suggestEl.on('mousedown', '.suggestion-container', (event) => { - event.preventDefault(); - }); - } -} -class StaticSuggest extends TextInputSuggest { - constructor(app, inputEl, suggestions) { - super(app, inputEl); - this.getSuggestions = (inputStr) => this.suggestions.filter((val) => val.toLowerCase().contains(inputStr.toLowerCase())); - this.renderSuggestion = (string, el) => { - el.setText(string); - }; - this.selectSuggestion = (string) => { - this.inputEl.value = string; - this.inputEl.trigger('input'); - this.close(); - }; - this.suggestions = suggestions; - } -} - -/* src/ui/TextSuggest.svelte generated by Svelte v3.32.3 */ - -function add_css() { - var style = element("style"); - style.id = "svelte-1ob2bqt-style"; - style.textContent = ".expense-payee.svelte-1ob2bqt{width:100%}.expense-category.svelte-1ob2bqt{flex:1}"; - append(document.head, style); -} - -function create_fragment(ctx) { - let input; - let input_class_value; - let mounted; - let dispose; - - return { - c() { - input = element("input"); - attr(input, "class", input_class_value = "" + (null_to_empty(/*classes*/ ctx[2]) + " svelte-1ob2bqt")); - attr(input, "type", "text"); - attr(input, "placeholder", /*placeholder*/ ctx[1]); - }, - m(target, anchor) { - insert(target, input, anchor); - /*input_binding*/ ctx[5](input); - set_input_value(input, /*value*/ ctx[0]); - - if (!mounted) { - dispose = listen(input, "input", /*input_input_handler*/ ctx[6]); - mounted = true; - } - }, - p(ctx, [dirty]) { - if (dirty & /*classes*/ 4 && input_class_value !== (input_class_value = "" + (null_to_empty(/*classes*/ ctx[2]) + " svelte-1ob2bqt"))) { - attr(input, "class", input_class_value); - } - - if (dirty & /*placeholder*/ 2) { - attr(input, "placeholder", /*placeholder*/ ctx[1]); - } - - if (dirty & /*value*/ 1 && input.value !== /*value*/ ctx[0]) { - set_input_value(input, /*value*/ ctx[0]); - } - }, - i: noop$1, - o: noop$1, - d(detaching) { - if (detaching) detach(input); - /*input_binding*/ ctx[5](null); - mounted = false; - dispose(); - } - }; -} - -function instance($$self, $$props, $$invalidate) { - let { suggestions } = $$props; - let { placeholder } = $$props; - let { value } = $$props; - let { classes } = $$props; - let inputEl; - - onMount(() => { - new StaticSuggest(window.app, inputEl, suggestions); - }); - - function input_binding($$value) { - binding_callbacks[$$value ? "unshift" : "push"](() => { - inputEl = $$value; - $$invalidate(3, inputEl); - }); - } - - function input_input_handler() { - value = this.value; - $$invalidate(0, value); - } - - $$self.$$set = $$props => { - if ("suggestions" in $$props) $$invalidate(4, suggestions = $$props.suggestions); - if ("placeholder" in $$props) $$invalidate(1, placeholder = $$props.placeholder); - if ("value" in $$props) $$invalidate(0, value = $$props.value); - if ("classes" in $$props) $$invalidate(2, classes = $$props.classes); - }; - - return [ - value, - placeholder, - classes, - inputEl, - suggestions, - input_binding, - input_input_handler - ]; -} - -class TextSuggest extends SvelteComponent { - constructor(options) { - super(); - if (!document.getElementById("svelte-1ob2bqt-style")) add_css(); - - init$1(this, options, instance, create_fragment, safe_not_equal, { - suggestions: 4, - placeholder: 1, - value: 0, - classes: 2 - }); - } -} - -function noop$2() { } -function assign(tar, src) { - // @ts-ignore - for (const k in src) - tar[k] = src[k]; - return tar; -} -function is_promise(value) { - return value && typeof value === 'object' && typeof value.then === 'function'; -} -function run$1(fn) { - return fn(); -} -function blank_object$1() { - return Object.create(null); -} -function run_all$1(fns) { - fns.forEach(run$1); -} -function is_function$1(thing) { - return typeof thing === 'function'; -} -function safe_not_equal$1(a, b) { - return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function'); -} -function not_equal(a, b) { - return a != a ? b == b : a !== b; -} -function is_empty$1(obj) { - return Object.keys(obj).length === 0; -} -function create_slot(definition, ctx, $$scope, fn) { - if (definition) { - const slot_ctx = get_slot_context(definition, ctx, $$scope, fn); - return definition[0](slot_ctx); - } -} -function get_slot_context(definition, ctx, $$scope, fn) { - return definition[1] && fn - ? assign($$scope.ctx.slice(), definition[1](fn(ctx))) - : $$scope.ctx; -} -function get_slot_changes(definition, $$scope, dirty, fn) { - if (definition[2] && fn) { - const lets = definition[2](fn(dirty)); - if ($$scope.dirty === undefined) { - return lets; - } - if (typeof lets === 'object') { - const merged = []; - const len = Math.max($$scope.dirty.length, lets.length); - for (let i = 0; i < len; i += 1) { - merged[i] = $$scope.dirty[i] | lets[i]; - } - return merged; - } - return $$scope.dirty | lets; - } - return $$scope.dirty; -} -function update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) { - const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn); - if (slot_changes) { - const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn); - slot.p(slot_context, slot_changes); - } -} -function null_to_empty$1(value) { - return value == null ? '' : value; -} - -function append$1(target, node) { - target.appendChild(node); -} -function insert$1(target, node, anchor) { - target.insertBefore(node, anchor || null); -} -function detach$1(node) { - node.parentNode.removeChild(node); -} -function destroy_each(iterations, detaching) { - for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) - iterations[i].d(detaching); - } -} -function element$1(name) { - return document.createElement(name); -} -function svg_element$1(name) { - return document.createElementNS('http://www.w3.org/2000/svg', name); -} -function text$1(data) { - return document.createTextNode(data); -} -function space$1() { - return text$1(' '); -} -function empty$1() { - return text$1(''); -} -function listen$1(node, event, handler, options) { - node.addEventListener(event, handler, options); - return () => node.removeEventListener(event, handler, options); -} -function attr$1(node, attribute, value) { - if (value == null) - node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) - node.setAttribute(attribute, value); -} -function set_attributes(node, attributes) { - // @ts-ignore - const descriptors = Object.getOwnPropertyDescriptors(node.__proto__); - for (const key in attributes) { - if (attributes[key] == null) { - node.removeAttribute(key); - } - else if (key === 'style') { - node.style.cssText = attributes[key]; - } - else if (key === '__value') { - node.value = node[key] = attributes[key]; - } - else if (descriptors[key] && descriptors[key].set) { - node[key] = attributes[key]; - } - else { - attr$1(node, key, attributes[key]); - } - } -} -function children$2(element) { - return Array.from(element.childNodes); -} -function set_data$1(text, data) { - data = '' + data; - if (text.wholeText !== data) - text.data = data; -} -function toggle_class(element, name, toggle) { - element.classList[toggle ? 'add' : 'remove'](name); -} - -let current_component$1; -function set_current_component$1(component) { - current_component$1 = component; -} -function get_current_component$1() { - if (!current_component$1) - throw new Error('Function called outside component initialization'); - return current_component$1; -} - -const dirty_components$1 = []; -const binding_callbacks$1 = []; -const render_callbacks$1 = []; -const flush_callbacks$1 = []; -const resolved_promise$1 = Promise.resolve(); -let update_scheduled$1 = false; -function schedule_update$1() { - if (!update_scheduled$1) { - update_scheduled$1 = true; - resolved_promise$1.then(flush$1); - } -} -function add_render_callback$1(fn) { - render_callbacks$1.push(fn); -} -let flushing$1 = false; -const seen_callbacks$1 = new Set(); -function flush$1() { - if (flushing$1) - return; - flushing$1 = true; - do { - // first, call beforeUpdate functions - // and update components - for (let i = 0; i < dirty_components$1.length; i += 1) { - const component = dirty_components$1[i]; - set_current_component$1(component); - update$1(component.$$); - } - set_current_component$1(null); - dirty_components$1.length = 0; - while (binding_callbacks$1.length) - binding_callbacks$1.pop()(); - // then, once components are updated, call - // afterUpdate functions. This may cause - // subsequent updates... - for (let i = 0; i < render_callbacks$1.length; i += 1) { - const callback = render_callbacks$1[i]; - if (!seen_callbacks$1.has(callback)) { - // ...so guard against infinite loops - seen_callbacks$1.add(callback); - callback(); - } - } - render_callbacks$1.length = 0; - } while (dirty_components$1.length); - while (flush_callbacks$1.length) { - flush_callbacks$1.pop()(); - } - update_scheduled$1 = false; - flushing$1 = false; - seen_callbacks$1.clear(); -} -function update$1($$) { - if ($$.fragment !== null) { - $$.update(); - run_all$1($$.before_update); - const dirty = $$.dirty; - $$.dirty = [-1]; - $$.fragment && $$.fragment.p($$.ctx, dirty); - $$.after_update.forEach(add_render_callback$1); - } -} -const outroing$1 = new Set(); -let outros$1; -function group_outros$1() { - outros$1 = { - r: 0, - c: [], - p: outros$1 // parent group - }; -} -function check_outros$1() { - if (!outros$1.r) { - run_all$1(outros$1.c); - } - outros$1 = outros$1.p; -} -function transition_in$1(block, local) { - if (block && block.i) { - outroing$1.delete(block); - block.i(local); - } -} -function transition_out$1(block, local, detach, callback) { - if (block && block.o) { - if (outroing$1.has(block)) - return; - outroing$1.add(block); - outros$1.c.push(() => { - outroing$1.delete(block); - if (callback) { - if (detach) - block.d(1); - callback(); - } - }); - block.o(local); - } -} - -function handle_promise(promise, info) { - const token = info.token = {}; - function update(type, index, key, value) { - if (info.token !== token) - return; - info.resolved = value; - let child_ctx = info.ctx; - if (key !== undefined) { - child_ctx = child_ctx.slice(); - child_ctx[key] = value; - } - const block = type && (info.current = type)(child_ctx); - let needs_flush = false; - if (info.block) { - if (info.blocks) { - info.blocks.forEach((block, i) => { - if (i !== index && block) { - group_outros$1(); - transition_out$1(block, 1, 1, () => { - if (info.blocks[i] === block) { - info.blocks[i] = null; - } - }); - check_outros$1(); - } - }); - } - else { - info.block.d(1); - } - block.c(); - transition_in$1(block, 1); - block.m(info.mount(), info.anchor); - needs_flush = true; - } - info.block = block; - if (info.blocks) - info.blocks[index] = block; - if (needs_flush) { - flush$1(); - } - } - if (is_promise(promise)) { - const current_component = get_current_component$1(); - promise.then(value => { - set_current_component$1(current_component); - update(info.then, 1, info.value, value); - set_current_component$1(null); - }, error => { - set_current_component$1(current_component); - update(info.catch, 2, info.error, error); - set_current_component$1(null); - if (!info.hasCatch) { - throw error; - } - }); - // if we previously had a then/catch block, destroy it - if (info.current !== info.pending) { - update(info.pending, 0); - return true; - } - } - else { - if (info.current !== info.then) { - update(info.then, 1, info.value, promise); - return true; - } - info.resolved = promise; - } -} -function outro_and_destroy_block$1(block, lookup) { - transition_out$1(block, 1, 1, () => { - lookup.delete(block.key); - }); -} -function update_keyed_each$1(old_blocks, dirty, get_key, dynamic, ctx, list, lookup, node, destroy, create_each_block, next, get_context) { - let o = old_blocks.length; - let n = list.length; - let i = o; - const old_indexes = {}; - while (i--) - old_indexes[old_blocks[i].key] = i; - const new_blocks = []; - const new_lookup = new Map(); - const deltas = new Map(); - i = n; - while (i--) { - const child_ctx = get_context(ctx, list, i); - const key = get_key(child_ctx); - let block = lookup.get(key); - if (!block) { - block = create_each_block(key, child_ctx); - block.c(); - } - else if (dynamic) { - block.p(child_ctx, dirty); - } - new_lookup.set(key, new_blocks[i] = block); - if (key in old_indexes) - deltas.set(key, Math.abs(i - old_indexes[key])); - } - const will_move = new Set(); - const did_move = new Set(); - function insert(block) { - transition_in$1(block, 1); - block.m(node, next); - lookup.set(block.key, block); - next = block.first; - n--; - } - while (o && n) { - const new_block = new_blocks[n - 1]; - const old_block = old_blocks[o - 1]; - const new_key = new_block.key; - const old_key = old_block.key; - if (new_block === old_block) { - // do nothing - next = new_block.first; - o--; - n--; - } - else if (!new_lookup.has(old_key)) { - // remove old block - destroy(old_block, lookup); - o--; - } - else if (!lookup.has(new_key) || will_move.has(new_key)) { - insert(new_block); - } - else if (did_move.has(old_key)) { - o--; - } - else if (deltas.get(new_key) > deltas.get(old_key)) { - did_move.add(new_key); - insert(new_block); - } - else { - will_move.add(old_key); - o--; - } - } - while (o--) { - const old_block = old_blocks[o]; - if (!new_lookup.has(old_block.key)) - destroy(old_block, lookup); - } - while (n) - insert(new_blocks[n - 1]); - return new_blocks; -} - -function get_spread_update(levels, updates) { - const update = {}; - const to_null_out = {}; - const accounted_for = { $$scope: 1 }; - let i = levels.length; - while (i--) { - const o = levels[i]; - const n = updates[i]; - if (n) { - for (const key in o) { - if (!(key in n)) - to_null_out[key] = 1; - } - for (const key in n) { - if (!accounted_for[key]) { - update[key] = n[key]; - accounted_for[key] = 1; - } - } - levels[i] = n; - } - else { - for (const key in o) { - accounted_for[key] = 1; - } - } - } - for (const key in to_null_out) { - if (!(key in update)) - update[key] = undefined; - } - return update; -} -function get_spread_object(spread_props) { - return typeof spread_props === 'object' && spread_props !== null ? spread_props : {}; -} -function create_component$1(block) { - block && block.c(); -} -function mount_component$1(component, target, anchor, customElement) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; - fragment && fragment.m(target, anchor); - if (!customElement) { - // onMount happens before the initial afterUpdate - add_render_callback$1(() => { - const new_on_destroy = on_mount.map(run$1).filter(is_function$1); - if (on_destroy) { - on_destroy.push(...new_on_destroy); - } - else { - // Edge case - component was destroyed immediately, - // most likely as a result of a binding initialising - run_all$1(new_on_destroy); - } - component.$$.on_mount = []; - }); - } - after_update.forEach(add_render_callback$1); -} -function destroy_component$1(component, detaching) { - const $$ = component.$$; - if ($$.fragment !== null) { - run_all$1($$.on_destroy); - $$.fragment && $$.fragment.d(detaching); - // TODO null out other refs, including component.$$ (but need to - // preserve final state?) - $$.on_destroy = $$.fragment = null; - $$.ctx = []; - } -} -function make_dirty$1(component, i) { - if (component.$$.dirty[0] === -1) { - dirty_components$1.push(component); - schedule_update$1(); - component.$$.dirty.fill(0); - } - component.$$.dirty[(i / 31) | 0] |= (1 << (i % 31)); -} -function init$2(component, options, instance, create_fragment, not_equal, props, dirty = [-1]) { - const parent_component = current_component$1; - set_current_component$1(component); - const $$ = component.$$ = { - fragment: null, - ctx: null, - // state - props, - update: noop$2, - not_equal, - bound: blank_object$1(), - // lifecycle - on_mount: [], - on_destroy: [], - on_disconnect: [], - before_update: [], - after_update: [], - context: new Map(parent_component ? parent_component.$$.context : []), - // everything else - callbacks: blank_object$1(), - dirty, - skip_bound: false - }; - let ready = false; - $$.ctx = instance - ? instance(component, options.props || {}, (i, ret, ...rest) => { - const value = rest.length ? rest[0] : ret; - if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) - $$.bound[i](value); - if (ready) - make_dirty$1(component, i); - } - return ret; - }) - : []; - $$.update(); - ready = true; - run_all$1($$.before_update); - // `false` as a special case of no DOM component - $$.fragment = create_fragment ? create_fragment($$.ctx) : false; - if (options.target) { - if (options.hydrate) { - const nodes = children$2(options.target); - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment && $$.fragment.l(nodes); - nodes.forEach(detach$1); - } - else { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment && $$.fragment.c(); - } - if (options.intro) - transition_in$1(component.$$.fragment); - mount_component$1(component, options.target, options.anchor, options.customElement); - flush$1(); - } - set_current_component$1(parent_component); -} -/** - * Base class for Svelte components. Used when dev=false. - */ -class SvelteComponent$1 { - $destroy() { - destroy_component$1(this, 1); - this.$destroy = noop$2; - } - $on(type, callback) { - const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); - callbacks.push(callback); - return () => { - const index = callbacks.indexOf(callback); - if (index !== -1) - callbacks.splice(index, 1); - }; - } - $set($$props) { - if (this.$$set && !is_empty$1($$props)) { - this.$$.skip_bound = true; - this.$$set($$props); - this.$$.skip_bound = false; - } - } -} - -/** - * dateUID is a way of weekly identifying daily/weekly/monthly notes. - * They are prefixed with the granularity to avoid ambiguity. - */ -function getDateUID(date, granularity = "day") { - const ts = date.clone().startOf(granularity).format(); - return `${granularity}-${ts}`; -} -var getDateUID_1 = getDateUID; - -/* src/components/Dot.svelte generated by Svelte v3.35.0 */ - -function add_css$5() { - var style = element$1("style"); - style.id = "svelte-1widvzq-style"; - style.textContent = ".dot.svelte-1widvzq,.hollow.svelte-1widvzq{display:inline-block;height:6px;width:6px;margin:0 1px}.filled.svelte-1widvzq{fill:var(--color-dot)}.active.filled.svelte-1widvzq{fill:var(--text-on-accent)}.hollow.svelte-1widvzq{fill:none;stroke:var(--color-dot)}.active.hollow.svelte-1widvzq{fill:none;stroke:var(--text-on-accent)}"; - append$1(document.head, style); -} - -// (14:0) {:else} -function create_else_block$1(ctx) { - let svg; - let circle; - let svg_class_value; - - return { - c() { - svg = svg_element$1("svg"); - circle = svg_element$1("circle"); - attr$1(circle, "cx", "3"); - attr$1(circle, "cy", "3"); - attr$1(circle, "r", "2"); - attr$1(svg, "class", svg_class_value = "" + (null_to_empty$1(`hollow ${/*className*/ ctx[0]}`) + " svelte-1widvzq")); - attr$1(svg, "viewBox", "0 0 6 6"); - attr$1(svg, "xmlns", "http://www.w3.org/2000/svg"); - toggle_class(svg, "active", /*isActive*/ ctx[2]); - }, - m(target, anchor) { - insert$1(target, svg, anchor); - append$1(svg, circle); - }, - p(ctx, dirty) { - if (dirty & /*className*/ 1 && svg_class_value !== (svg_class_value = "" + (null_to_empty$1(`hollow ${/*className*/ ctx[0]}`) + " svelte-1widvzq"))) { - attr$1(svg, "class", svg_class_value); - } - - if (dirty & /*className, isActive*/ 5) { - toggle_class(svg, "active", /*isActive*/ ctx[2]); - } - }, - d(detaching) { - if (detaching) detach$1(svg); - } - }; -} - -// (6:0) {#if isFilled} -function create_if_block$2(ctx) { - let svg; - let circle; - let svg_class_value; - - return { - c() { - svg = svg_element$1("svg"); - circle = svg_element$1("circle"); - attr$1(circle, "cx", "3"); - attr$1(circle, "cy", "3"); - attr$1(circle, "r", "2"); - attr$1(svg, "class", svg_class_value = "" + (null_to_empty$1(`dot filled ${/*className*/ ctx[0]}`) + " svelte-1widvzq")); - attr$1(svg, "viewBox", "0 0 6 6"); - attr$1(svg, "xmlns", "http://www.w3.org/2000/svg"); - toggle_class(svg, "active", /*isActive*/ ctx[2]); - }, - m(target, anchor) { - insert$1(target, svg, anchor); - append$1(svg, circle); - }, - p(ctx, dirty) { - if (dirty & /*className*/ 1 && svg_class_value !== (svg_class_value = "" + (null_to_empty$1(`dot filled ${/*className*/ ctx[0]}`) + " svelte-1widvzq"))) { - attr$1(svg, "class", svg_class_value); - } - - if (dirty & /*className, isActive*/ 5) { - toggle_class(svg, "active", /*isActive*/ ctx[2]); - } - }, - d(detaching) { - if (detaching) detach$1(svg); - } - }; -} - -function create_fragment$6(ctx) { - let if_block_anchor; - - function select_block_type(ctx, dirty) { - if (/*isFilled*/ ctx[1]) return create_if_block$2; - return create_else_block$1; - } - - let current_block_type = select_block_type(ctx); - let if_block = current_block_type(ctx); - - return { - c() { - if_block.c(); - if_block_anchor = empty$1(); - }, - m(target, anchor) { - if_block.m(target, anchor); - insert$1(target, if_block_anchor, anchor); - }, - p(ctx, [dirty]) { - if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) { - if_block.p(ctx, dirty); - } else { - if_block.d(1); - if_block = current_block_type(ctx); - - if (if_block) { - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - } - }, - i: noop$2, - o: noop$2, - d(detaching) { - if_block.d(detaching); - if (detaching) detach$1(if_block_anchor); - } - }; -} - -function instance$6($$self, $$props, $$invalidate) { - let { className = "" } = $$props; - let { isFilled } = $$props; - let { isActive } = $$props; - - $$self.$$set = $$props => { - if ("className" in $$props) $$invalidate(0, className = $$props.className); - if ("isFilled" in $$props) $$invalidate(1, isFilled = $$props.isFilled); - if ("isActive" in $$props) $$invalidate(2, isActive = $$props.isActive); - }; - - return [className, isFilled, isActive]; -} - -class Dot extends SvelteComponent$1 { - constructor(options) { - super(); - if (!document.getElementById("svelte-1widvzq-style")) add_css$5(); - init$2(this, options, instance$6, create_fragment$6, safe_not_equal$1, { className: 0, isFilled: 1, isActive: 2 }); - } -} - -/* src/components/MetadataResolver.svelte generated by Svelte v3.35.0 */ - -const get_default_slot_changes_1 = dirty => ({}); -const get_default_slot_context_1 = ctx => ({ metadata: null }); -const get_default_slot_changes = dirty => ({ metadata: dirty & /*metadata*/ 1 }); -const get_default_slot_context = ctx => ({ metadata: /*resolvedMeta*/ ctx[3] }); - -// (11:0) {:else} -function create_else_block(ctx) { - let current; - const default_slot_template = /*#slots*/ ctx[2].default; - const default_slot = create_slot(default_slot_template, ctx, /*$$scope*/ ctx[1], get_default_slot_context_1); - - return { - c() { - if (default_slot) default_slot.c(); - }, - m(target, anchor) { - if (default_slot) { - default_slot.m(target, anchor); - } - - current = true; - }, - p(ctx, dirty) { - if (default_slot) { - if (default_slot.p && dirty & /*$$scope*/ 2) { - update_slot(default_slot, default_slot_template, ctx, /*$$scope*/ ctx[1], dirty, get_default_slot_changes_1, get_default_slot_context_1); - } - } - }, - i(local) { - if (current) return; - transition_in$1(default_slot, local); - current = true; - }, - o(local) { - transition_out$1(default_slot, local); - current = false; - }, - d(detaching) { - if (default_slot) default_slot.d(detaching); - } - }; -} - -// (7:0) {#if metadata} -function create_if_block$1(ctx) { - let await_block_anchor; - let promise; - let current; - - let info = { - ctx, - current: null, - token: null, - hasCatch: false, - pending: create_pending_block, - then: create_then_block, - catch: create_catch_block, - value: 3, - blocks: [,,,] - }; - - handle_promise(promise = /*metadata*/ ctx[0], info); - - return { - c() { - await_block_anchor = empty$1(); - info.block.c(); - }, - m(target, anchor) { - insert$1(target, await_block_anchor, anchor); - info.block.m(target, info.anchor = anchor); - info.mount = () => await_block_anchor.parentNode; - info.anchor = await_block_anchor; - current = true; - }, - p(new_ctx, dirty) { - ctx = new_ctx; - info.ctx = ctx; - - if (dirty & /*metadata*/ 1 && promise !== (promise = /*metadata*/ ctx[0]) && handle_promise(promise, info)) ; else { - const child_ctx = ctx.slice(); - child_ctx[3] = info.resolved; - info.block.p(child_ctx, dirty); - } - }, - i(local) { - if (current) return; - transition_in$1(info.block); - current = true; - }, - o(local) { - for (let i = 0; i < 3; i += 1) { - const block = info.blocks[i]; - transition_out$1(block); - } - - current = false; - }, - d(detaching) { - if (detaching) detach$1(await_block_anchor); - info.block.d(detaching); - info.token = null; - info = null; - } - }; -} - -// (1:0) {#if metadata} -function create_catch_block(ctx) { - return { - c: noop$2, - m: noop$2, - p: noop$2, - i: noop$2, - o: noop$2, - d: noop$2 - }; -} - -// (8:37) ; export let metadata; {#if metadata} -function create_pending_block(ctx) { - return { - c: noop$2, - m: noop$2, - p: noop$2, - i: noop$2, - o: noop$2, - d: noop$2 - }; -} - -function create_fragment$5(ctx) { - let current_block_type_index; - let if_block; - let if_block_anchor; - let current; - const if_block_creators = [create_if_block$1, create_else_block]; - const if_blocks = []; - - function select_block_type(ctx, dirty) { - if (/*metadata*/ ctx[0]) return 0; - return 1; - } - - current_block_type_index = select_block_type(ctx); - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - - return { - c() { - if_block.c(); - if_block_anchor = empty$1(); - }, - m(target, anchor) { - if_blocks[current_block_type_index].m(target, anchor); - insert$1(target, if_block_anchor, anchor); - current = true; - }, - p(ctx, [dirty]) { - let previous_block_index = current_block_type_index; - current_block_type_index = select_block_type(ctx); - - if (current_block_type_index === previous_block_index) { - if_blocks[current_block_type_index].p(ctx, dirty); - } else { - group_outros$1(); - - transition_out$1(if_blocks[previous_block_index], 1, 1, () => { - if_blocks[previous_block_index] = null; - }); - - check_outros$1(); - if_block = if_blocks[current_block_type_index]; - - if (!if_block) { - if_block = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - if_block.c(); - } else { - if_block.p(ctx, dirty); - } - - transition_in$1(if_block, 1); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - i(local) { - if (current) return; - transition_in$1(if_block); - current = true; - }, - o(local) { - transition_out$1(if_block); - current = false; - }, - d(detaching) { - if_blocks[current_block_type_index].d(detaching); - if (detaching) detach$1(if_block_anchor); - } - }; -} - -function instance$5($$self, $$props, $$invalidate) { - let { $$slots: slots = {}, $$scope } = $$props; - - let { metadata } = $$props; - - $$self.$$set = $$props => { - if ("metadata" in $$props) $$invalidate(0, metadata = $$props.metadata); - if ("$$scope" in $$props) $$invalidate(1, $$scope = $$props.$$scope); - }; - - return [metadata, $$scope, slots]; -} - -class MetadataResolver extends SvelteComponent$1 { - constructor(options) { - super(); - init$2(this, options, instance$5, create_fragment$5, not_equal, { metadata: 0 }); - } -} - -function isMacOS() { - return navigator.appVersion.indexOf("Mac") !== -1; -} -function isMetaPressed(e) { - return isMacOS() ? e.metaKey : e.ctrlKey; -} -function getDaysOfWeek(..._args) { - return window.moment.weekdaysShort(true); -} -function isWeekend(date) { - return date.isoWeekday() === 6 || date.isoWeekday() === 7; -} -function getStartOfWeek(days) { - return days[0].weekday(0); -} -/** - * Generate a 2D array of daily information to power - * the calendar view. - */ -function getMonth(displayedMonth, ..._args) { - const locale = window.moment().locale(); - const month = []; - let week; - const startOfMonth = displayedMonth.clone().locale(locale).date(1); - const startOffset = startOfMonth.weekday(); - let date = startOfMonth.clone().subtract(startOffset, "days"); - for (let _day = 0; _day < 42; _day++) { - if (_day % 7 === 0) { - week = { - days: [], - weekNum: date.week(), - }; - month.push(week); - } - week.days.push(date); - date = date.clone().add(1, "days"); - } - return month; -} - -/* src/components/Day.svelte generated by Svelte v3.35.0 */ - -function add_css$4() { - var style = element$1("style"); - style.id = "svelte-q3wqg9-style"; - style.textContent = ".day.svelte-q3wqg9{background-color:var(--color-background-day);border-radius:4px;color:var(--color-text-day);cursor:pointer;font-size:0.8em;height:100%;padding:4px;position:relative;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.day.svelte-q3wqg9:hover{background-color:var(--interactive-hover)}.day.active.svelte-q3wqg9:hover{background-color:var(--interactive-accent-hover)}.adjacent-month.svelte-q3wqg9{opacity:0.25}.today.svelte-q3wqg9{color:var(--color-text-today)}.day.svelte-q3wqg9:active,.active.svelte-q3wqg9,.active.today.svelte-q3wqg9{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-q3wqg9{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}"; - append$1(document.head, style); -} - -function get_each_context$2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[11] = list[i]; - return child_ctx; -} - -// (36:8) {#each metadata.dots as dot} -function create_each_block$2(ctx) { - let dot; - let current; - const dot_spread_levels = [/*dot*/ ctx[11]]; - let dot_props = {}; - - for (let i = 0; i < dot_spread_levels.length; i += 1) { - dot_props = assign(dot_props, dot_spread_levels[i]); - } - - dot = new Dot({ props: dot_props }); - - return { - c() { - create_component$1(dot.$$.fragment); - }, - m(target, anchor) { - mount_component$1(dot, target, anchor); - current = true; - }, - p(ctx, dirty) { - const dot_changes = (dirty & /*metadata*/ 128) - ? get_spread_update(dot_spread_levels, [get_spread_object(/*dot*/ ctx[11])]) - : {}; - - dot.$set(dot_changes); - }, - i(local) { - if (current) return; - transition_in$1(dot.$$.fragment, local); - current = true; - }, - o(local) { - transition_out$1(dot.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component$1(dot, detaching); - } - }; -} - -// (22:2) -function create_default_slot$1(ctx) { - let div1; - let t0_value = /*date*/ ctx[0].format("D") + ""; - let t0; - let t1; - let div0; - let div1_class_value; - let current; - let mounted; - let dispose; - let each_value = /*metadata*/ ctx[7].dots; - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$2(get_each_context$2(ctx, each_value, i)); - } - - const out = i => transition_out$1(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - - let div1_levels = [ - { - class: div1_class_value = `day ${/*metadata*/ ctx[7].classes.join(" ")}` - }, - /*metadata*/ ctx[7].dataAttributes || {} - ]; - - let div1_data = {}; - - for (let i = 0; i < div1_levels.length; i += 1) { - div1_data = assign(div1_data, div1_levels[i]); - } - - return { - c() { - div1 = element$1("div"); - t0 = text$1(t0_value); - t1 = space$1(); - div0 = element$1("div"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - attr$1(div0, "class", "dot-container svelte-q3wqg9"); - set_attributes(div1, div1_data); - toggle_class(div1, "active", /*selectedId*/ ctx[6] === getDateUID_1(/*date*/ ctx[0], "day")); - toggle_class(div1, "adjacent-month", !/*date*/ ctx[0].isSame(/*displayedMonth*/ ctx[5], "month")); - toggle_class(div1, "today", /*date*/ ctx[0].isSame(/*today*/ ctx[4], "day")); - toggle_class(div1, "svelte-q3wqg9", true); - }, - m(target, anchor) { - insert$1(target, div1, anchor); - append$1(div1, t0); - append$1(div1, t1); - append$1(div1, div0); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div0, null); - } - - current = true; - - if (!mounted) { - dispose = [ - listen$1(div1, "click", function () { - if (is_function$1(/*onClick*/ ctx[2] && /*click_handler*/ ctx[8])) (/*onClick*/ ctx[2] && /*click_handler*/ ctx[8]).apply(this, arguments); - }), - listen$1(div1, "contextmenu", function () { - if (is_function$1(/*onContextMenu*/ ctx[3] && /*contextmenu_handler*/ ctx[9])) (/*onContextMenu*/ ctx[3] && /*contextmenu_handler*/ ctx[9]).apply(this, arguments); - }), - listen$1(div1, "pointerover", function () { - if (is_function$1(/*onHover*/ ctx[1] && /*pointerover_handler*/ ctx[10])) (/*onHover*/ ctx[1] && /*pointerover_handler*/ ctx[10]).apply(this, arguments); - }) - ]; - - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - if ((!current || dirty & /*date*/ 1) && t0_value !== (t0_value = /*date*/ ctx[0].format("D") + "")) set_data$1(t0, t0_value); - - if (dirty & /*metadata*/ 128) { - each_value = /*metadata*/ ctx[7].dots; - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$2(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in$1(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block$2(child_ctx); - each_blocks[i].c(); - transition_in$1(each_blocks[i], 1); - each_blocks[i].m(div0, null); - } - } - - group_outros$1(); - - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - - check_outros$1(); - } - - set_attributes(div1, div1_data = get_spread_update(div1_levels, [ - (!current || dirty & /*metadata*/ 128 && div1_class_value !== (div1_class_value = `day ${/*metadata*/ ctx[7].classes.join(" ")}`)) && { class: div1_class_value }, - dirty & /*metadata*/ 128 && (/*metadata*/ ctx[7].dataAttributes || {}) - ])); - - toggle_class(div1, "active", /*selectedId*/ ctx[6] === getDateUID_1(/*date*/ ctx[0], "day")); - toggle_class(div1, "adjacent-month", !/*date*/ ctx[0].isSame(/*displayedMonth*/ ctx[5], "month")); - toggle_class(div1, "today", /*date*/ ctx[0].isSame(/*today*/ ctx[4], "day")); - toggle_class(div1, "svelte-q3wqg9", true); - }, - i(local) { - if (current) return; - - for (let i = 0; i < each_value.length; i += 1) { - transition_in$1(each_blocks[i]); - } - - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out$1(each_blocks[i]); - } - - current = false; - }, - d(detaching) { - if (detaching) detach$1(div1); - destroy_each(each_blocks, detaching); - mounted = false; - run_all$1(dispose); - } - }; -} - -function create_fragment$4(ctx) { - let td; - let metadataresolver; - let current; - - metadataresolver = new MetadataResolver({ - props: { - metadata: /*metadata*/ ctx[7], - $$slots: { - default: [ - create_default_slot$1, - ({ metadata }) => ({ 7: metadata }), - ({ metadata }) => metadata ? 128 : 0 - ] - }, - $$scope: { ctx } - } - }); - - return { - c() { - td = element$1("td"); - create_component$1(metadataresolver.$$.fragment); - }, - m(target, anchor) { - insert$1(target, td, anchor); - mount_component$1(metadataresolver, td, null); - current = true; - }, - p(ctx, [dirty]) { - const metadataresolver_changes = {}; - if (dirty & /*metadata*/ 128) metadataresolver_changes.metadata = /*metadata*/ ctx[7]; - - if (dirty & /*$$scope, metadata, selectedId, date, displayedMonth, today, onClick, onContextMenu, onHover*/ 16639) { - metadataresolver_changes.$$scope = { dirty, ctx }; - } - - metadataresolver.$set(metadataresolver_changes); - }, - i(local) { - if (current) return; - transition_in$1(metadataresolver.$$.fragment, local); - current = true; - }, - o(local) { - transition_out$1(metadataresolver.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach$1(td); - destroy_component$1(metadataresolver); - } - }; -} - -function instance$4($$self, $$props, $$invalidate) { - - - let { date } = $$props; - let { metadata } = $$props; - let { onHover } = $$props; - let { onClick } = $$props; - let { onContextMenu } = $$props; - let { today } = $$props; - let { displayedMonth = null } = $$props; - let { selectedId = null } = $$props; - const click_handler = e => onClick(date, isMetaPressed(e)); - const contextmenu_handler = e => onContextMenu(date, e); - const pointerover_handler = e => onHover(date, e.target, isMetaPressed(e)); - - $$self.$$set = $$props => { - if ("date" in $$props) $$invalidate(0, date = $$props.date); - if ("metadata" in $$props) $$invalidate(7, metadata = $$props.metadata); - if ("onHover" in $$props) $$invalidate(1, onHover = $$props.onHover); - if ("onClick" in $$props) $$invalidate(2, onClick = $$props.onClick); - if ("onContextMenu" in $$props) $$invalidate(3, onContextMenu = $$props.onContextMenu); - if ("today" in $$props) $$invalidate(4, today = $$props.today); - if ("displayedMonth" in $$props) $$invalidate(5, displayedMonth = $$props.displayedMonth); - if ("selectedId" in $$props) $$invalidate(6, selectedId = $$props.selectedId); - }; - - return [ - date, - onHover, - onClick, - onContextMenu, - today, - displayedMonth, - selectedId, - metadata, - click_handler, - contextmenu_handler, - pointerover_handler - ]; -} - -class Day extends SvelteComponent$1 { - constructor(options) { - super(); - if (!document.getElementById("svelte-q3wqg9-style")) add_css$4(); - - init$2(this, options, instance$4, create_fragment$4, not_equal, { - date: 0, - metadata: 7, - onHover: 1, - onClick: 2, - onContextMenu: 3, - today: 4, - displayedMonth: 5, - selectedId: 6 - }); - } -} - -/* src/components/Arrow.svelte generated by Svelte v3.35.0 */ - -function add_css$3() { - var style = element$1("style"); - style.id = "svelte-156w7na-style"; - style.textContent = ".arrow.svelte-156w7na.svelte-156w7na{align-items:center;cursor:pointer;display:flex;justify-content:center;width:24px}.arrow.is-mobile.svelte-156w7na.svelte-156w7na{width:32px}.right.svelte-156w7na.svelte-156w7na{transform:rotate(180deg)}.arrow.svelte-156w7na svg.svelte-156w7na{color:var(--color-arrow);height:16px;width:16px}"; - append$1(document.head, style); -} - -function create_fragment$3(ctx) { - let div; - let svg; - let path; - let mounted; - let dispose; - - return { - c() { - div = element$1("div"); - svg = svg_element$1("svg"); - path = svg_element$1("path"); - attr$1(path, "fill", "currentColor"); - attr$1(path, "d", "M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"); - attr$1(svg, "focusable", "false"); - attr$1(svg, "role", "img"); - attr$1(svg, "xmlns", "http://www.w3.org/2000/svg"); - attr$1(svg, "viewBox", "0 0 320 512"); - attr$1(svg, "class", "svelte-156w7na"); - attr$1(div, "class", "arrow svelte-156w7na"); - attr$1(div, "aria-label", /*tooltip*/ ctx[1]); - toggle_class(div, "is-mobile", /*isMobile*/ ctx[3]); - toggle_class(div, "right", /*direction*/ ctx[2] === "right"); - }, - m(target, anchor) { - insert$1(target, div, anchor); - append$1(div, svg); - append$1(svg, path); - - if (!mounted) { - dispose = listen$1(div, "click", function () { - if (is_function$1(/*onClick*/ ctx[0])) /*onClick*/ ctx[0].apply(this, arguments); - }); - - mounted = true; - } - }, - p(new_ctx, [dirty]) { - ctx = new_ctx; - - if (dirty & /*tooltip*/ 2) { - attr$1(div, "aria-label", /*tooltip*/ ctx[1]); - } - - if (dirty & /*direction*/ 4) { - toggle_class(div, "right", /*direction*/ ctx[2] === "right"); - } - }, - i: noop$2, - o: noop$2, - d(detaching) { - if (detaching) detach$1(div); - mounted = false; - dispose(); - } - }; -} - -function instance$3($$self, $$props, $$invalidate) { - let { onClick } = $$props; - let { tooltip } = $$props; - let { direction } = $$props; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let isMobile = window.app.isMobile; - - $$self.$$set = $$props => { - if ("onClick" in $$props) $$invalidate(0, onClick = $$props.onClick); - if ("tooltip" in $$props) $$invalidate(1, tooltip = $$props.tooltip); - if ("direction" in $$props) $$invalidate(2, direction = $$props.direction); - }; - - return [onClick, tooltip, direction, isMobile]; -} - -class Arrow extends SvelteComponent$1 { - constructor(options) { - super(); - if (!document.getElementById("svelte-156w7na-style")) add_css$3(); - init$2(this, options, instance$3, create_fragment$3, safe_not_equal$1, { onClick: 0, tooltip: 1, direction: 2 }); - } -} - -/* src/components/Nav.svelte generated by Svelte v3.35.0 */ - -function add_css$2() { - var style = element$1("style"); - style.id = "svelte-1vwr9dd-style"; - style.textContent = ".nav.svelte-1vwr9dd.svelte-1vwr9dd{align-items:center;display:flex;margin:0.6em 0 1em;padding:0 8px;width:100%}.nav.is-mobile.svelte-1vwr9dd.svelte-1vwr9dd{padding:0}.title.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--color-text-title);font-size:1.5em;margin:0}.is-mobile.svelte-1vwr9dd .title.svelte-1vwr9dd{font-size:1.3em}.month.svelte-1vwr9dd.svelte-1vwr9dd{font-weight:500;text-transform:capitalize}.year.svelte-1vwr9dd.svelte-1vwr9dd{color:var(--interactive-accent)}.right-nav.svelte-1vwr9dd.svelte-1vwr9dd{display:flex;justify-content:center;margin-left:auto}.reset-button.svelte-1vwr9dd.svelte-1vwr9dd{cursor:pointer;border-radius:4px;color:var(--text-muted);font-size:0.7em;font-weight:600;letter-spacing:1px;margin:0 4px;padding:0px 4px;text-transform:uppercase}.is-mobile.svelte-1vwr9dd .reset-button.svelte-1vwr9dd{display:none}"; - append$1(document.head, style); -} - -function create_fragment$2(ctx) { - let div2; - let h3; - let span0; - let t0_value = /*displayedMonth*/ ctx[0].format("MMM") + ""; - let t0; - let t1; - let span1; - let t2_value = /*displayedMonth*/ ctx[0].format("YYYY") + ""; - let t2; - let t3; - let div1; - let arrow0; - let t4; - let div0; - let t6; - let arrow1; - let current; - let mounted; - let dispose; - - arrow0 = new Arrow({ - props: { - direction: "left", - onClick: /*decrementDisplayedMonth*/ ctx[3], - tooltip: "Previous Month" - } - }); - - arrow1 = new Arrow({ - props: { - direction: "right", - onClick: /*incrementDisplayedMonth*/ ctx[2], - tooltip: "Next Month" - } - }); - - return { - c() { - div2 = element$1("div"); - h3 = element$1("h3"); - span0 = element$1("span"); - t0 = text$1(t0_value); - t1 = space$1(); - span1 = element$1("span"); - t2 = text$1(t2_value); - t3 = space$1(); - div1 = element$1("div"); - create_component$1(arrow0.$$.fragment); - t4 = space$1(); - div0 = element$1("div"); - div0.textContent = `${/*todayDisplayStr*/ ctx[4]}`; - t6 = space$1(); - create_component$1(arrow1.$$.fragment); - attr$1(span0, "class", "month svelte-1vwr9dd"); - attr$1(span1, "class", "year svelte-1vwr9dd"); - attr$1(h3, "class", "title svelte-1vwr9dd"); - attr$1(div0, "class", "reset-button svelte-1vwr9dd"); - attr$1(div1, "class", "right-nav svelte-1vwr9dd"); - attr$1(div2, "class", "nav svelte-1vwr9dd"); - toggle_class(div2, "is-mobile", /*isMobile*/ ctx[5]); - }, - m(target, anchor) { - insert$1(target, div2, anchor); - append$1(div2, h3); - append$1(h3, span0); - append$1(span0, t0); - append$1(h3, t1); - append$1(h3, span1); - append$1(span1, t2); - append$1(div2, t3); - append$1(div2, div1); - mount_component$1(arrow0, div1, null); - append$1(div1, t4); - append$1(div1, div0); - append$1(div1, t6); - mount_component$1(arrow1, div1, null); - current = true; - - if (!mounted) { - dispose = [ - listen$1(h3, "click", function () { - if (is_function$1(/*resetDisplayedMonth*/ ctx[1])) /*resetDisplayedMonth*/ ctx[1].apply(this, arguments); - }), - listen$1(div0, "click", function () { - if (is_function$1(/*resetDisplayedMonth*/ ctx[1])) /*resetDisplayedMonth*/ ctx[1].apply(this, arguments); - }) - ]; - - mounted = true; - } - }, - p(new_ctx, [dirty]) { - ctx = new_ctx; - if ((!current || dirty & /*displayedMonth*/ 1) && t0_value !== (t0_value = /*displayedMonth*/ ctx[0].format("MMM") + "")) set_data$1(t0, t0_value); - if ((!current || dirty & /*displayedMonth*/ 1) && t2_value !== (t2_value = /*displayedMonth*/ ctx[0].format("YYYY") + "")) set_data$1(t2, t2_value); - const arrow0_changes = {}; - if (dirty & /*decrementDisplayedMonth*/ 8) arrow0_changes.onClick = /*decrementDisplayedMonth*/ ctx[3]; - arrow0.$set(arrow0_changes); - const arrow1_changes = {}; - if (dirty & /*incrementDisplayedMonth*/ 4) arrow1_changes.onClick = /*incrementDisplayedMonth*/ ctx[2]; - arrow1.$set(arrow1_changes); - }, - i(local) { - if (current) return; - transition_in$1(arrow0.$$.fragment, local); - transition_in$1(arrow1.$$.fragment, local); - current = true; - }, - o(local) { - transition_out$1(arrow0.$$.fragment, local); - transition_out$1(arrow1.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach$1(div2); - destroy_component$1(arrow0); - destroy_component$1(arrow1); - mounted = false; - run_all$1(dispose); - } - }; -} - -function instance$2($$self, $$props, $$invalidate) { - - let { displayedMonth } = $$props; - let { today } = $$props; - let { resetDisplayedMonth } = $$props; - let { incrementDisplayedMonth } = $$props; - let { decrementDisplayedMonth } = $$props; - - // Get the word 'Today' but localized to the current language - const todayDisplayStr = today.calendar().split(/\d|\s/)[0]; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let isMobile = window.app.isMobile; - - $$self.$$set = $$props => { - if ("displayedMonth" in $$props) $$invalidate(0, displayedMonth = $$props.displayedMonth); - if ("today" in $$props) $$invalidate(6, today = $$props.today); - if ("resetDisplayedMonth" in $$props) $$invalidate(1, resetDisplayedMonth = $$props.resetDisplayedMonth); - if ("incrementDisplayedMonth" in $$props) $$invalidate(2, incrementDisplayedMonth = $$props.incrementDisplayedMonth); - if ("decrementDisplayedMonth" in $$props) $$invalidate(3, decrementDisplayedMonth = $$props.decrementDisplayedMonth); - }; - - return [ - displayedMonth, - resetDisplayedMonth, - incrementDisplayedMonth, - decrementDisplayedMonth, - todayDisplayStr, - isMobile, - today - ]; -} - -class Nav extends SvelteComponent$1 { - constructor(options) { - super(); - if (!document.getElementById("svelte-1vwr9dd-style")) add_css$2(); - - init$2(this, options, instance$2, create_fragment$2, safe_not_equal$1, { - displayedMonth: 0, - today: 6, - resetDisplayedMonth: 1, - incrementDisplayedMonth: 2, - decrementDisplayedMonth: 3 - }); - } -} - -/* src/components/WeekNum.svelte generated by Svelte v3.35.0 */ - -function add_css$1() { - var style = element$1("style"); - style.id = "svelte-egt0yd-style"; - style.textContent = "td.svelte-egt0yd{border-right:1px solid var(--background-modifier-border)}.week-num.svelte-egt0yd{background-color:var(--color-background-weeknum);border-radius:4px;color:var(--color-text-weeknum);cursor:pointer;font-size:0.65em;height:100%;padding:4px;text-align:center;transition:background-color 0.1s ease-in, color 0.1s ease-in;vertical-align:baseline}.week-num.svelte-egt0yd:hover{background-color:var(--interactive-hover)}.week-num.active.svelte-egt0yd:hover{background-color:var(--interactive-accent-hover)}.active.svelte-egt0yd{color:var(--text-on-accent);background-color:var(--interactive-accent)}.dot-container.svelte-egt0yd{display:flex;flex-wrap:wrap;justify-content:center;line-height:6px;min-height:6px}"; - append$1(document.head, style); -} - -function get_each_context$1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[11] = list[i]; - return child_ctx; -} - -// (35:8) {#each metadata.dots as dot} -function create_each_block$1(ctx) { - let dot; - let current; - const dot_spread_levels = [/*dot*/ ctx[11]]; - let dot_props = {}; - - for (let i = 0; i < dot_spread_levels.length; i += 1) { - dot_props = assign(dot_props, dot_spread_levels[i]); - } - - dot = new Dot({ props: dot_props }); - - return { - c() { - create_component$1(dot.$$.fragment); - }, - m(target, anchor) { - mount_component$1(dot, target, anchor); - current = true; - }, - p(ctx, dirty) { - const dot_changes = (dirty & /*metadata*/ 64) - ? get_spread_update(dot_spread_levels, [get_spread_object(/*dot*/ ctx[11])]) - : {}; - - dot.$set(dot_changes); - }, - i(local) { - if (current) return; - transition_in$1(dot.$$.fragment, local); - current = true; - }, - o(local) { - transition_out$1(dot.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component$1(dot, detaching); - } - }; -} - -// (24:2) -function create_default_slot(ctx) { - let div1; - let t0; - let t1; - let div0; - let div1_class_value; - let current; - let mounted; - let dispose; - let each_value = /*metadata*/ ctx[6].dots; - let each_blocks = []; - - for (let i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block$1(get_each_context$1(ctx, each_value, i)); - } - - const out = i => transition_out$1(each_blocks[i], 1, 1, () => { - each_blocks[i] = null; - }); - - return { - c() { - div1 = element$1("div"); - t0 = text$1(/*weekNum*/ ctx[0]); - t1 = space$1(); - div0 = element$1("div"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - attr$1(div0, "class", "dot-container svelte-egt0yd"); - attr$1(div1, "class", div1_class_value = "" + (null_to_empty$1(`week-num ${/*metadata*/ ctx[6].classes.join(" ")}`) + " svelte-egt0yd")); - toggle_class(div1, "active", /*selectedId*/ ctx[5] === getDateUID_1(/*days*/ ctx[1][0], "week")); - }, - m(target, anchor) { - insert$1(target, div1, anchor); - append$1(div1, t0); - append$1(div1, t1); - append$1(div1, div0); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div0, null); - } - - current = true; - - if (!mounted) { - dispose = [ - listen$1(div1, "click", function () { - if (is_function$1(/*onClick*/ ctx[3] && /*click_handler*/ ctx[8])) (/*onClick*/ ctx[3] && /*click_handler*/ ctx[8]).apply(this, arguments); - }), - listen$1(div1, "contextmenu", function () { - if (is_function$1(/*onContextMenu*/ ctx[4] && /*contextmenu_handler*/ ctx[9])) (/*onContextMenu*/ ctx[4] && /*contextmenu_handler*/ ctx[9]).apply(this, arguments); - }), - listen$1(div1, "pointerover", function () { - if (is_function$1(/*onHover*/ ctx[2] && /*pointerover_handler*/ ctx[10])) (/*onHover*/ ctx[2] && /*pointerover_handler*/ ctx[10]).apply(this, arguments); - }) - ]; - - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - if (!current || dirty & /*weekNum*/ 1) set_data$1(t0, /*weekNum*/ ctx[0]); - - if (dirty & /*metadata*/ 64) { - each_value = /*metadata*/ ctx[6].dots; - let i; - - for (i = 0; i < each_value.length; i += 1) { - const child_ctx = get_each_context$1(ctx, each_value, i); - - if (each_blocks[i]) { - each_blocks[i].p(child_ctx, dirty); - transition_in$1(each_blocks[i], 1); - } else { - each_blocks[i] = create_each_block$1(child_ctx); - each_blocks[i].c(); - transition_in$1(each_blocks[i], 1); - each_blocks[i].m(div0, null); - } - } - - group_outros$1(); - - for (i = each_value.length; i < each_blocks.length; i += 1) { - out(i); - } - - check_outros$1(); - } - - if (!current || dirty & /*metadata*/ 64 && div1_class_value !== (div1_class_value = "" + (null_to_empty$1(`week-num ${/*metadata*/ ctx[6].classes.join(" ")}`) + " svelte-egt0yd"))) { - attr$1(div1, "class", div1_class_value); - } - - if (dirty & /*metadata, selectedId, getDateUID, days*/ 98) { - toggle_class(div1, "active", /*selectedId*/ ctx[5] === getDateUID_1(/*days*/ ctx[1][0], "week")); - } - }, - i(local) { - if (current) return; - - for (let i = 0; i < each_value.length; i += 1) { - transition_in$1(each_blocks[i]); - } - - current = true; - }, - o(local) { - each_blocks = each_blocks.filter(Boolean); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out$1(each_blocks[i]); - } - - current = false; - }, - d(detaching) { - if (detaching) detach$1(div1); - destroy_each(each_blocks, detaching); - mounted = false; - run_all$1(dispose); - } - }; -} - -function create_fragment$1(ctx) { - let td; - let metadataresolver; - let current; - - metadataresolver = new MetadataResolver({ - props: { - metadata: /*metadata*/ ctx[6], - $$slots: { - default: [ - create_default_slot, - ({ metadata }) => ({ 6: metadata }), - ({ metadata }) => metadata ? 64 : 0 - ] - }, - $$scope: { ctx } - } - }); - - return { - c() { - td = element$1("td"); - create_component$1(metadataresolver.$$.fragment); - attr$1(td, "class", "svelte-egt0yd"); - }, - m(target, anchor) { - insert$1(target, td, anchor); - mount_component$1(metadataresolver, td, null); - current = true; - }, - p(ctx, [dirty]) { - const metadataresolver_changes = {}; - if (dirty & /*metadata*/ 64) metadataresolver_changes.metadata = /*metadata*/ ctx[6]; - - if (dirty & /*$$scope, metadata, selectedId, days, onClick, startOfWeek, onContextMenu, onHover, weekNum*/ 16639) { - metadataresolver_changes.$$scope = { dirty, ctx }; - } - - metadataresolver.$set(metadataresolver_changes); - }, - i(local) { - if (current) return; - transition_in$1(metadataresolver.$$.fragment, local); - current = true; - }, - o(local) { - transition_out$1(metadataresolver.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach$1(td); - destroy_component$1(metadataresolver); - } - }; -} - -function instance$1($$self, $$props, $$invalidate) { - - - let { weekNum } = $$props; - let { days } = $$props; - let { metadata } = $$props; - let { onHover } = $$props; - let { onClick } = $$props; - let { onContextMenu } = $$props; - let { selectedId = null } = $$props; - let startOfWeek; - const click_handler = e => onClick(startOfWeek, isMetaPressed(e)); - const contextmenu_handler = e => onContextMenu(days[0], e); - const pointerover_handler = e => onHover(startOfWeek, e.target, isMetaPressed(e)); - - $$self.$$set = $$props => { - if ("weekNum" in $$props) $$invalidate(0, weekNum = $$props.weekNum); - if ("days" in $$props) $$invalidate(1, days = $$props.days); - if ("metadata" in $$props) $$invalidate(6, metadata = $$props.metadata); - if ("onHover" in $$props) $$invalidate(2, onHover = $$props.onHover); - if ("onClick" in $$props) $$invalidate(3, onClick = $$props.onClick); - if ("onContextMenu" in $$props) $$invalidate(4, onContextMenu = $$props.onContextMenu); - if ("selectedId" in $$props) $$invalidate(5, selectedId = $$props.selectedId); - }; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*days*/ 2) { - $$invalidate(7, startOfWeek = getStartOfWeek(days)); - } - }; - - return [ - weekNum, - days, - onHover, - onClick, - onContextMenu, - selectedId, - metadata, - startOfWeek, - click_handler, - contextmenu_handler, - pointerover_handler - ]; -} - -class WeekNum extends SvelteComponent$1 { - constructor(options) { - super(); - if (!document.getElementById("svelte-egt0yd-style")) add_css$1(); - - init$2(this, options, instance$1, create_fragment$1, not_equal, { - weekNum: 0, - days: 1, - metadata: 6, - onHover: 2, - onClick: 3, - onContextMenu: 4, - selectedId: 5 - }); - } -} - -async function metadataReducer(promisedMetadata) { - const meta = { - dots: [], - classes: [], - dataAttributes: {}, - }; - const metas = await Promise.all(promisedMetadata); - return metas.reduce((acc, meta) => ({ - classes: [...acc.classes, ...(meta.classes || [])], - dataAttributes: Object.assign(acc.dataAttributes, meta.dataAttributes), - dots: [...acc.dots, ...(meta.dots || [])], - }), meta); -} -function getDailyMetadata(sources, date, ..._args) { - return metadataReducer(sources.map((source) => source.getDailyMetadata(date))); -} -function getWeeklyMetadata(sources, date, ..._args) { - return metadataReducer(sources.map((source) => source.getWeeklyMetadata(date))); -} - -/* src/components/Calendar.svelte generated by Svelte v3.35.0 */ - -function add_css$6() { - var style = element$1("style"); - style.id = "svelte-pcimu8-style"; - style.textContent = ".container.svelte-pcimu8{--color-background-heading:transparent;--color-background-day:transparent;--color-background-weeknum:transparent;--color-background-weekend:transparent;--color-dot:var(--text-muted);--color-arrow:var(--text-muted);--color-button:var(--text-muted);--color-text-title:var(--text-normal);--color-text-heading:var(--text-muted);--color-text-day:var(--text-normal);--color-text-today:var(--interactive-accent);--color-text-weeknum:var(--text-muted)}.container.svelte-pcimu8{padding:0 8px}.container.is-mobile.svelte-pcimu8{padding:0}th.svelte-pcimu8{text-align:center}.weekend.svelte-pcimu8{background-color:var(--color-background-weekend)}.calendar.svelte-pcimu8{border-collapse:collapse;width:100%}th.svelte-pcimu8{background-color:var(--color-background-heading);color:var(--color-text-heading);font-size:0.6em;letter-spacing:1px;padding:4px;text-transform:uppercase}"; - append$1(document.head, style); -} - -function get_each_context(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[18] = list[i]; - return child_ctx; -} - -function get_each_context_1(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[21] = list[i]; - return child_ctx; -} - -function get_each_context_2(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[24] = list[i]; - return child_ctx; -} - -function get_each_context_3(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[27] = list[i]; - return child_ctx; -} - -// (55:6) {#if showWeekNums} -function create_if_block_2(ctx) { - let col; - - return { - c() { - col = element$1("col"); - }, - m(target, anchor) { - insert$1(target, col, anchor); - }, - d(detaching) { - if (detaching) detach$1(col); - } - }; -} - -// (58:6) {#each month[1].days as date} -function create_each_block_3(ctx) { - let col; - - return { - c() { - col = element$1("col"); - attr$1(col, "class", "svelte-pcimu8"); - toggle_class(col, "weekend", isWeekend(/*date*/ ctx[27])); - }, - m(target, anchor) { - insert$1(target, col, anchor); - }, - p(ctx, dirty) { - if (dirty & /*isWeekend, month*/ 16384) { - toggle_class(col, "weekend", isWeekend(/*date*/ ctx[27])); - } - }, - d(detaching) { - if (detaching) detach$1(col); - } - }; -} - -// (64:8) {#if showWeekNums} -function create_if_block_1(ctx) { - let th; - - return { - c() { - th = element$1("th"); - th.textContent = "W"; - attr$1(th, "class", "svelte-pcimu8"); - }, - m(target, anchor) { - insert$1(target, th, anchor); - }, - d(detaching) { - if (detaching) detach$1(th); - } - }; -} - -// (67:8) {#each daysOfWeek as dayOfWeek} -function create_each_block_2(ctx) { - let th; - let t_value = /*dayOfWeek*/ ctx[24] + ""; - let t; - - return { - c() { - th = element$1("th"); - t = text$1(t_value); - attr$1(th, "class", "svelte-pcimu8"); - }, - m(target, anchor) { - insert$1(target, th, anchor); - append$1(th, t); - }, - p(ctx, dirty) { - if (dirty & /*daysOfWeek*/ 32768 && t_value !== (t_value = /*dayOfWeek*/ ctx[24] + "")) set_data$1(t, t_value); - }, - d(detaching) { - if (detaching) detach$1(th); - } - }; -} - -// (75:10) {#if showWeekNums} -function create_if_block(ctx) { - let weeknum; - let current; - - const weeknum_spread_levels = [ - /*week*/ ctx[18], - { - metadata: getWeeklyMetadata(/*sources*/ ctx[8], /*week*/ ctx[18].days[0], /*today*/ ctx[10]) - }, - { onClick: /*onClickWeek*/ ctx[7] }, - { - onContextMenu: /*onContextMenuWeek*/ ctx[5] - }, - { onHover: /*onHoverWeek*/ ctx[3] }, - { selectedId: /*selectedId*/ ctx[9] } - ]; - - let weeknum_props = {}; - - for (let i = 0; i < weeknum_spread_levels.length; i += 1) { - weeknum_props = assign(weeknum_props, weeknum_spread_levels[i]); - } - - weeknum = new WeekNum({ props: weeknum_props }); - - return { - c() { - create_component$1(weeknum.$$.fragment); - }, - m(target, anchor) { - mount_component$1(weeknum, target, anchor); - current = true; - }, - p(ctx, dirty) { - const weeknum_changes = (dirty & /*month, getWeeklyMetadata, sources, today, onClickWeek, onContextMenuWeek, onHoverWeek, selectedId*/ 18344) - ? get_spread_update(weeknum_spread_levels, [ - dirty & /*month*/ 16384 && get_spread_object(/*week*/ ctx[18]), - dirty & /*getWeeklyMetadata, sources, month, today*/ 17664 && { - metadata: getWeeklyMetadata(/*sources*/ ctx[8], /*week*/ ctx[18].days[0], /*today*/ ctx[10]) - }, - dirty & /*onClickWeek*/ 128 && { onClick: /*onClickWeek*/ ctx[7] }, - dirty & /*onContextMenuWeek*/ 32 && { - onContextMenu: /*onContextMenuWeek*/ ctx[5] - }, - dirty & /*onHoverWeek*/ 8 && { onHover: /*onHoverWeek*/ ctx[3] }, - dirty & /*selectedId*/ 512 && { selectedId: /*selectedId*/ ctx[9] } - ]) - : {}; - - weeknum.$set(weeknum_changes); - }, - i(local) { - if (current) return; - transition_in$1(weeknum.$$.fragment, local); - current = true; - }, - o(local) { - transition_out$1(weeknum.$$.fragment, local); - current = false; - }, - d(detaching) { - destroy_component$1(weeknum, detaching); - } - }; -} - -// (85:10) {#each week.days as day (day.format())} -function create_each_block_1(key_1, ctx) { - let first; - let day; - let current; - - day = new Day({ - props: { - date: /*day*/ ctx[21], - today: /*today*/ ctx[10], - displayedMonth: /*displayedMonth*/ ctx[0], - onClick: /*onClickDay*/ ctx[6], - onContextMenu: /*onContextMenuDay*/ ctx[4], - onHover: /*onHoverDay*/ ctx[2], - metadata: getDailyMetadata(/*sources*/ ctx[8], /*day*/ ctx[21], /*today*/ ctx[10]), - selectedId: /*selectedId*/ ctx[9] - } - }); - - return { - key: key_1, - first: null, - c() { - first = empty$1(); - create_component$1(day.$$.fragment); - this.first = first; - }, - m(target, anchor) { - insert$1(target, first, anchor); - mount_component$1(day, target, anchor); - current = true; - }, - p(new_ctx, dirty) { - ctx = new_ctx; - const day_changes = {}; - if (dirty & /*month*/ 16384) day_changes.date = /*day*/ ctx[21]; - if (dirty & /*today*/ 1024) day_changes.today = /*today*/ ctx[10]; - if (dirty & /*displayedMonth*/ 1) day_changes.displayedMonth = /*displayedMonth*/ ctx[0]; - if (dirty & /*onClickDay*/ 64) day_changes.onClick = /*onClickDay*/ ctx[6]; - if (dirty & /*onContextMenuDay*/ 16) day_changes.onContextMenu = /*onContextMenuDay*/ ctx[4]; - if (dirty & /*onHoverDay*/ 4) day_changes.onHover = /*onHoverDay*/ ctx[2]; - if (dirty & /*sources, month, today*/ 17664) day_changes.metadata = getDailyMetadata(/*sources*/ ctx[8], /*day*/ ctx[21], /*today*/ ctx[10]); - if (dirty & /*selectedId*/ 512) day_changes.selectedId = /*selectedId*/ ctx[9]; - day.$set(day_changes); - }, - i(local) { - if (current) return; - transition_in$1(day.$$.fragment, local); - current = true; - }, - o(local) { - transition_out$1(day.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach$1(first); - destroy_component$1(day, detaching); - } - }; -} - -// (73:6) {#each month as week (week.weekNum)} -function create_each_block(key_1, ctx) { - let tr; - let t0; - let each_blocks = []; - let each_1_lookup = new Map(); - let t1; - let current; - let if_block = /*showWeekNums*/ ctx[1] && create_if_block(ctx); - let each_value_1 = /*week*/ ctx[18].days; - const get_key = ctx => /*day*/ ctx[21].format(); - - for (let i = 0; i < each_value_1.length; i += 1) { - let child_ctx = get_each_context_1(ctx, each_value_1, i); - let key = get_key(child_ctx); - each_1_lookup.set(key, each_blocks[i] = create_each_block_1(key, child_ctx)); - } - - return { - key: key_1, - first: null, - c() { - tr = element$1("tr"); - if (if_block) if_block.c(); - t0 = space$1(); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - t1 = space$1(); - this.first = tr; - }, - m(target, anchor) { - insert$1(target, tr, anchor); - if (if_block) if_block.m(tr, null); - append$1(tr, t0); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(tr, null); - } - - append$1(tr, t1); - current = true; - }, - p(new_ctx, dirty) { - ctx = new_ctx; - - if (/*showWeekNums*/ ctx[1]) { - if (if_block) { - if_block.p(ctx, dirty); - - if (dirty & /*showWeekNums*/ 2) { - transition_in$1(if_block, 1); - } - } else { - if_block = create_if_block(ctx); - if_block.c(); - transition_in$1(if_block, 1); - if_block.m(tr, t0); - } - } else if (if_block) { - group_outros$1(); - - transition_out$1(if_block, 1, 1, () => { - if_block = null; - }); - - check_outros$1(); - } - - if (dirty & /*month, today, displayedMonth, onClickDay, onContextMenuDay, onHoverDay, getDailyMetadata, sources, selectedId*/ 18261) { - each_value_1 = /*week*/ ctx[18].days; - group_outros$1(); - each_blocks = update_keyed_each$1(each_blocks, dirty, get_key, 1, ctx, each_value_1, each_1_lookup, tr, outro_and_destroy_block$1, create_each_block_1, t1, get_each_context_1); - check_outros$1(); - } - }, - i(local) { - if (current) return; - transition_in$1(if_block); - - for (let i = 0; i < each_value_1.length; i += 1) { - transition_in$1(each_blocks[i]); - } - - current = true; - }, - o(local) { - transition_out$1(if_block); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out$1(each_blocks[i]); - } - - current = false; - }, - d(detaching) { - if (detaching) detach$1(tr); - if (if_block) if_block.d(); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].d(); - } - } - }; -} - -function create_fragment$7(ctx) { - let div; - let nav; - let t0; - let table; - let colgroup; - let t1; - let t2; - let thead; - let tr; - let t3; - let t4; - let tbody; - let each_blocks = []; - let each2_lookup = new Map(); - let current; - - nav = new Nav({ - props: { - today: /*today*/ ctx[10], - displayedMonth: /*displayedMonth*/ ctx[0], - incrementDisplayedMonth: /*incrementDisplayedMonth*/ ctx[11], - decrementDisplayedMonth: /*decrementDisplayedMonth*/ ctx[12], - resetDisplayedMonth: /*resetDisplayedMonth*/ ctx[13] - } - }); - - let if_block0 = /*showWeekNums*/ ctx[1] && create_if_block_2(); - let each_value_3 = /*month*/ ctx[14][1].days; - let each_blocks_2 = []; - - for (let i = 0; i < each_value_3.length; i += 1) { - each_blocks_2[i] = create_each_block_3(get_each_context_3(ctx, each_value_3, i)); - } - - let if_block1 = /*showWeekNums*/ ctx[1] && create_if_block_1(); - let each_value_2 = /*daysOfWeek*/ ctx[15]; - let each_blocks_1 = []; - - for (let i = 0; i < each_value_2.length; i += 1) { - each_blocks_1[i] = create_each_block_2(get_each_context_2(ctx, each_value_2, i)); - } - - let each_value = /*month*/ ctx[14]; - const get_key = ctx => /*week*/ ctx[18].weekNum; - - for (let i = 0; i < each_value.length; i += 1) { - let child_ctx = get_each_context(ctx, each_value, i); - let key = get_key(child_ctx); - each2_lookup.set(key, each_blocks[i] = create_each_block(key, child_ctx)); - } - - return { - c() { - div = element$1("div"); - create_component$1(nav.$$.fragment); - t0 = space$1(); - table = element$1("table"); - colgroup = element$1("colgroup"); - if (if_block0) if_block0.c(); - t1 = space$1(); - - for (let i = 0; i < each_blocks_2.length; i += 1) { - each_blocks_2[i].c(); - } - - t2 = space$1(); - thead = element$1("thead"); - tr = element$1("tr"); - if (if_block1) if_block1.c(); - t3 = space$1(); - - for (let i = 0; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].c(); - } - - t4 = space$1(); - tbody = element$1("tbody"); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - attr$1(table, "class", "calendar svelte-pcimu8"); - attr$1(div, "id", "calendar-container"); - attr$1(div, "class", "container svelte-pcimu8"); - toggle_class(div, "is-mobile", /*isMobile*/ ctx[16]); - }, - m(target, anchor) { - insert$1(target, div, anchor); - mount_component$1(nav, div, null); - append$1(div, t0); - append$1(div, table); - append$1(table, colgroup); - if (if_block0) if_block0.m(colgroup, null); - append$1(colgroup, t1); - - for (let i = 0; i < each_blocks_2.length; i += 1) { - each_blocks_2[i].m(colgroup, null); - } - - append$1(table, t2); - append$1(table, thead); - append$1(thead, tr); - if (if_block1) if_block1.m(tr, null); - append$1(tr, t3); - - for (let i = 0; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].m(tr, null); - } - - append$1(table, t4); - append$1(table, tbody); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(tbody, null); - } - - current = true; - }, - p(ctx, [dirty]) { - const nav_changes = {}; - if (dirty & /*today*/ 1024) nav_changes.today = /*today*/ ctx[10]; - if (dirty & /*displayedMonth*/ 1) nav_changes.displayedMonth = /*displayedMonth*/ ctx[0]; - nav.$set(nav_changes); - - if (/*showWeekNums*/ ctx[1]) { - if (if_block0) ; else { - if_block0 = create_if_block_2(); - if_block0.c(); - if_block0.m(colgroup, t1); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } - - if (dirty & /*isWeekend, month*/ 16384) { - each_value_3 = /*month*/ ctx[14][1].days; - let i; - - for (i = 0; i < each_value_3.length; i += 1) { - const child_ctx = get_each_context_3(ctx, each_value_3, i); - - if (each_blocks_2[i]) { - each_blocks_2[i].p(child_ctx, dirty); - } else { - each_blocks_2[i] = create_each_block_3(child_ctx); - each_blocks_2[i].c(); - each_blocks_2[i].m(colgroup, null); - } - } - - for (; i < each_blocks_2.length; i += 1) { - each_blocks_2[i].d(1); - } - - each_blocks_2.length = each_value_3.length; - } - - if (/*showWeekNums*/ ctx[1]) { - if (if_block1) ; else { - if_block1 = create_if_block_1(); - if_block1.c(); - if_block1.m(tr, t3); - } - } else if (if_block1) { - if_block1.d(1); - if_block1 = null; - } - - if (dirty & /*daysOfWeek*/ 32768) { - each_value_2 = /*daysOfWeek*/ ctx[15]; - let i; - - for (i = 0; i < each_value_2.length; i += 1) { - const child_ctx = get_each_context_2(ctx, each_value_2, i); - - if (each_blocks_1[i]) { - each_blocks_1[i].p(child_ctx, dirty); - } else { - each_blocks_1[i] = create_each_block_2(child_ctx); - each_blocks_1[i].c(); - each_blocks_1[i].m(tr, null); - } - } - - for (; i < each_blocks_1.length; i += 1) { - each_blocks_1[i].d(1); - } - - each_blocks_1.length = each_value_2.length; - } - - if (dirty & /*month, today, displayedMonth, onClickDay, onContextMenuDay, onHoverDay, getDailyMetadata, sources, selectedId, getWeeklyMetadata, onClickWeek, onContextMenuWeek, onHoverWeek, showWeekNums*/ 18431) { - each_value = /*month*/ ctx[14]; - group_outros$1(); - each_blocks = update_keyed_each$1(each_blocks, dirty, get_key, 1, ctx, each_value, each2_lookup, tbody, outro_and_destroy_block$1, create_each_block, null, get_each_context); - check_outros$1(); - } - }, - i(local) { - if (current) return; - transition_in$1(nav.$$.fragment, local); - - for (let i = 0; i < each_value.length; i += 1) { - transition_in$1(each_blocks[i]); - } - - current = true; - }, - o(local) { - transition_out$1(nav.$$.fragment, local); - - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out$1(each_blocks[i]); - } - - current = false; - }, - d(detaching) { - if (detaching) detach$1(div); - destroy_component$1(nav); - if (if_block0) if_block0.d(); - destroy_each(each_blocks_2, detaching); - if (if_block1) if_block1.d(); - destroy_each(each_blocks_1, detaching); - - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].d(); - } - } - }; -} - -function instance$7($$self, $$props, $$invalidate) { - - - let { localeData } = $$props; - let { showWeekNums = false } = $$props; - let { onHoverDay } = $$props; - let { onHoverWeek } = $$props; - let { onContextMenuDay } = $$props; - let { onContextMenuWeek } = $$props; - let { onClickDay } = $$props; - let { onClickWeek } = $$props; - let { sources = [] } = $$props; - let { selectedId } = $$props; - let { today = window.moment() } = $$props; - let { displayedMonth = today } = $$props; - let month; - let daysOfWeek; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let isMobile = window.app.isMobile; - - function incrementDisplayedMonth() { - $$invalidate(0, displayedMonth = displayedMonth.clone().add(1, "month")); - } - - function decrementDisplayedMonth() { - $$invalidate(0, displayedMonth = displayedMonth.clone().subtract(1, "month")); - } - - function resetDisplayedMonth() { - $$invalidate(0, displayedMonth = today.clone()); - } - - $$self.$$set = $$props => { - if ("localeData" in $$props) $$invalidate(17, localeData = $$props.localeData); - if ("showWeekNums" in $$props) $$invalidate(1, showWeekNums = $$props.showWeekNums); - if ("onHoverDay" in $$props) $$invalidate(2, onHoverDay = $$props.onHoverDay); - if ("onHoverWeek" in $$props) $$invalidate(3, onHoverWeek = $$props.onHoverWeek); - if ("onContextMenuDay" in $$props) $$invalidate(4, onContextMenuDay = $$props.onContextMenuDay); - if ("onContextMenuWeek" in $$props) $$invalidate(5, onContextMenuWeek = $$props.onContextMenuWeek); - if ("onClickDay" in $$props) $$invalidate(6, onClickDay = $$props.onClickDay); - if ("onClickWeek" in $$props) $$invalidate(7, onClickWeek = $$props.onClickWeek); - if ("sources" in $$props) $$invalidate(8, sources = $$props.sources); - if ("selectedId" in $$props) $$invalidate(9, selectedId = $$props.selectedId); - if ("today" in $$props) $$invalidate(10, today = $$props.today); - if ("displayedMonth" in $$props) $$invalidate(0, displayedMonth = $$props.displayedMonth); - }; - - $$self.$$.update = () => { - if ($$self.$$.dirty & /*displayedMonth, localeData*/ 131073) { - $$invalidate(14, month = getMonth(displayedMonth, localeData)); - } - - if ($$self.$$.dirty & /*today, localeData*/ 132096) { - $$invalidate(15, daysOfWeek = getDaysOfWeek(today, localeData)); - } - }; +function formatDecimal(x){return Math.abs(x=Math.round(x))>=1e21?x.toLocaleString("en").replace(/,/g,""):x.toString(10);}// Computes the decimal coefficient and exponent of the specified number x with +// significant digits p, where x is positive and p is in [1, 21] or undefined. +// For example, formatDecimalParts(1.23) returns ["123", 0]. +function formatDecimalParts(x,p){if((i=(x=p?x.toExponential(p-1):x.toExponential()).indexOf("e"))<0)return null;// NaN, ±Infinity +var i,coefficient=x.slice(0,i);// The string returned by toExponential either has the form \d\.\d+e[-+]\d+ +// (e.g., 1.2e+3) or the form \de[-+]\d+ (e.g., 1e+3). +return [coefficient.length>1?coefficient[0]+coefficient.slice(2):coefficient,+x.slice(i+1)];} - return [ - displayedMonth, - showWeekNums, - onHoverDay, - onHoverWeek, - onContextMenuDay, - onContextMenuWeek, - onClickDay, - onClickWeek, - sources, - selectedId, - today, - incrementDisplayedMonth, - decrementDisplayedMonth, - resetDisplayedMonth, - month, - daysOfWeek, - isMobile, - localeData - ]; -} +function exponent(x){return x=formatDecimalParts(Math.abs(x)),x?x[1]:NaN;} -class Calendar extends SvelteComponent$1 { - constructor(options) { - super(); - if (!document.getElementById("svelte-pcimu8-style")) add_css$6(); +function formatGroup(grouping,thousands){return function(value,width){var i=value.length,t=[],j=0,g=grouping[0],length=0;while(i>0&&g>0){if(length+g+1>width)g=Math.max(1,width-length);t.push(value.substring(i-=g,i+g));if((length+=g+1)>width)break;g=grouping[j=(j+1)%grouping.length];}return t.reverse().join(thousands);};} - init$2(this, options, instance$7, create_fragment$7, not_equal, { - localeData: 17, - showWeekNums: 1, - onHoverDay: 2, - onHoverWeek: 3, - onContextMenuDay: 4, - onContextMenuWeek: 5, - onClickDay: 6, - onClickWeek: 7, - sources: 8, - selectedId: 9, - today: 10, - displayedMonth: 0, - incrementDisplayedMonth: 11, - decrementDisplayedMonth: 12, - resetDisplayedMonth: 13 - }); - } +function formatNumerals(numerals){return function(value){return value.replace(/[0-9]/g,function(i){return numerals[+i];});};} - get incrementDisplayedMonth() { - return this.$$.ctx[11]; - } +// [[fill]align][sign][symbol][0][width][,][.precision][~][type] +var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(specifier){if(!(match=re.exec(specifier)))throw new Error("invalid format: "+specifier);var match;return new FormatSpecifier({fill:match[1],align:match[2],sign:match[3],symbol:match[4],zero:match[5],width:match[6],comma:match[7],precision:match[8]&&match[8].slice(1),trim:match[9],type:match[10]});}formatSpecifier.prototype=FormatSpecifier.prototype;// instanceof +function FormatSpecifier(specifier){this.fill=specifier.fill===undefined?" ":specifier.fill+"";this.align=specifier.align===undefined?">":specifier.align+"";this.sign=specifier.sign===undefined?"-":specifier.sign+"";this.symbol=specifier.symbol===undefined?"":specifier.symbol+"";this.zero=!!specifier.zero;this.width=specifier.width===undefined?undefined:+specifier.width;this.comma=!!specifier.comma;this.precision=specifier.precision===undefined?undefined:+specifier.precision;this.trim=!!specifier.trim;this.type=specifier.type===undefined?"":specifier.type+"";}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===undefined?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===undefined?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type;}; - get decrementDisplayedMonth() { - return this.$$.ctx[12]; - } +// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k. +function formatTrim(s){out:for(var n=s.length,i=1,i0=-1,i1;i0)i0=0;break;}}return i0>0?s.slice(0,i0)+s.slice(i1+1):s;} - get resetDisplayedMonth() { - return this.$$.ctx[13]; - } +var prefixExponent;function formatPrefixAuto(x,p){var d=formatDecimalParts(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1],i=exponent-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(exponent/3)))*3)+1,n=coefficient.length;return i===n?coefficient:i>n?coefficient+new Array(i-n+1).join("0"):i>0?coefficient.slice(0,i)+"."+coefficient.slice(i):"0."+new Array(1-i).join("0")+formatDecimalParts(x,Math.max(0,p+i-1))[0];// less than 1y! } -/* src/ui/ExpenseLinesInput.svelte generated by Svelte v3.32.3 */ +function formatRounded(x,p){var d=formatDecimalParts(x,p);if(!d)return x+"";var coefficient=d[0],exponent=d[1];return exponent<0?"0."+new Array(-exponent).join("0")+coefficient:coefficient.length>exponent+1?coefficient.slice(0,exponent+1)+"."+coefficient.slice(exponent+1):coefficient+new Array(exponent-coefficient.length+2).join("0");} -function add_css$7() { - var style = element("style"); - style.id = "svelte-gbs5xa-style"; - style.textContent = ".form-row.svelte-gbs5xa.svelte-gbs5xa{padding:5px 0;display:flex}.remove-row.svelte-gbs5xa.svelte-gbs5xa{margin:7px 4px 7px 0}.form-row.svelte-gbs5xa>.svelte-gbs5xa{margin-left:5px}.form-row.svelte-gbs5xa>.svelte-gbs5xa:first-child{margin-left:0}input.expense-amount.svelte-gbs5xa.svelte-gbs5xa{width:24%}.input-icon.svelte-gbs5xa.svelte-gbs5xa{width:100px;position:relative}.input-icon.svelte-gbs5xa>i.svelte-gbs5xa{position:absolute;display:block;transform:translate(0, -50%);top:50%;pointer-events:none;width:25px;text-align:center;font-style:normal}.input-icon.svelte-gbs5xa>input.svelte-gbs5xa{padding-left:25px !important;width:100%}"; - append(document.head, style); -} +var formatTypes = {"%":(x,p)=>(x*100).toFixed(p),"b":x=>Math.round(x).toString(2),"c":x=>x+"","d":formatDecimal,"e":(x,p)=>x.toExponential(p),"f":(x,p)=>x.toFixed(p),"g":(x,p)=>x.toPrecision(p),"o":x=>Math.round(x).toString(8),"p":(x,p)=>formatRounded(x*100,p),"r":formatRounded,"s":formatPrefixAuto,"X":x=>Math.round(x).toString(16).toUpperCase(),"x":x=>Math.round(x).toString(16)}; -function get_each_context$3(ctx, list, i) { - const child_ctx = ctx.slice(); - child_ctx[10] = list[i]; - child_ctx[11] = list; - child_ctx[12] = i; - return child_ctx; -} +function identity$1(x){return x;} -// (31:4) {#if i > 0 && i !== lines.length - 1} -function create_if_block_1$1(ctx) { - let svg; - let path; - let mounted; - let dispose; +var map=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale(locale){var group=locale.grouping===undefined||locale.thousands===undefined?identity$1:formatGroup(map.call(locale.grouping,Number),locale.thousands+""),currencyPrefix=locale.currency===undefined?"":locale.currency[0]+"",currencySuffix=locale.currency===undefined?"":locale.currency[1]+"",decimal=locale.decimal===undefined?".":locale.decimal+"",numerals=locale.numerals===undefined?identity$1:formatNumerals(map.call(locale.numerals,String)),percent=locale.percent===undefined?"%":locale.percent+"",minus=locale.minus===undefined?"−":locale.minus+"",nan=locale.nan===undefined?"NaN":locale.nan+"";function newFormat(specifier){specifier=formatSpecifier(specifier);var fill=specifier.fill,align=specifier.align,sign=specifier.sign,symbol=specifier.symbol,zero=specifier.zero,width=specifier.width,comma=specifier.comma,precision=specifier.precision,trim=specifier.trim,type=specifier.type;// The "n" type is an alias for ",g". +if(type==="n")comma=true,type="g";// The "" type, and any invalid type, is an alias for ".12~g". +else if(!formatTypes[type])precision===undefined&&(precision=12),trim=true,type="g";// If zero fill is specified, padding goes after sign and before digits. +if(zero||fill==="0"&&align==="=")zero=true,fill="0",align="=";// Compute the prefix and suffix. +// For SI-prefix, the suffix is lazily computed. +var prefix=symbol==="$"?currencyPrefix:symbol==="#"&&/[boxX]/.test(type)?"0"+type.toLowerCase():"",suffix=symbol==="$"?currencySuffix:/[%p]/.test(type)?percent:"";// What format function should we use? +// Is this an integer type? +// Can this type generate exponential notation? +var formatType=formatTypes[type],maybeSuffix=/[defgprs%]/.test(type);// Set the default precision if not specified, +// or clamp the specified precision to the supported range. +// For significant precision, it must be in [1, 21]. +// For fixed precision, it must be in [0, 20]. +precision=precision===undefined?6:/[gprs]/.test(type)?Math.max(1,Math.min(21,precision)):Math.max(0,Math.min(20,precision));function format(value){var valuePrefix=prefix,valueSuffix=suffix,i,n,c;if(type==="c"){valueSuffix=formatType(value)+valueSuffix;value="";}else {value=+value;// Determine the sign. -0 is not less than 0, but 1 / -0 is! +var valueNegative=value<0||1/value<0;// Perform the initial formatting. +value=isNaN(value)?nan:formatType(Math.abs(value),precision);// Trim insignificant zeros. +if(trim)value=formatTrim(value);// If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign. +if(valueNegative&&+value===0&&sign!=="+")valueNegative=false;// Compute the prefix and suffix. +valuePrefix=(valueNegative?sign==="("?sign:minus:sign==="-"||sign==="("?"":sign)+valuePrefix;valueSuffix=(type==="s"?prefixes[8+prefixExponent/3]:"")+valueSuffix+(valueNegative&&sign==="("?")":"");// Break the formatted value into the integer “value” part that can be +// grouped, and fractional or exponential “suffix” part that is not. +if(maybeSuffix){i=-1,n=value.length;while(++ic||c>57){valueSuffix=(c===46?decimal+value.slice(i+1):value.slice(i))+valueSuffix;value=value.slice(0,i);break;}}}}// If the fill character is not "0", grouping is applied before padding. +if(comma&&!zero)value=group(value,Infinity);// Compute the padding. +var length=valuePrefix.length+value.length+valueSuffix.length,padding=length>1)+valuePrefix+value+valueSuffix+padding.slice(length);break;default:value=padding+valuePrefix+value+valueSuffix;break;}return numerals(value);}format.toString=function(){return specifier+"";};return format;}function formatPrefix(specifier,value){var f=newFormat((specifier=formatSpecifier(specifier),specifier.type="f",specifier)),e=Math.max(-8,Math.min(8,Math.floor(exponent(value)/3)))*3,k=Math.pow(10,-e),prefix=prefixes[8+e/3];return function(value){return f(k*value)+prefix;};}return {format:newFormat,formatPrefix:formatPrefix};} - function click_handler() { - return /*click_handler*/ ctx[7](/*line*/ ctx[10]); - } +var locale;var format;var formatPrefix;defaultLocale({thousands:",",grouping:[3],currency:["$",""]});function defaultLocale(definition){locale=formatLocale(definition);format=locale.format;formatPrefix=locale.formatPrefix;return locale;} - return { - c() { - svg = svg_element("svg"); - path = svg_element("path"); - attr(path, "fill", "currentColor"); - attr(path, "stroke", "currentColor"); - attr(path, "d", "M18,8C12.5,8,8,12.5,8,18v64c0,5.5,4.5,10,10,10h64c5.5,0,10-4.5,10-10V18c0-5.5-4.5-10-10-10L18,8z M18,12h64 c3.3,0,6,2.7,6,6v64c0,3.3-2.7,6-6,6H18c-3.3,0-6-2.7-6-6V18C12,14.7,14.7,12,18,12z M33.4,30.6l-2.8,2.8L47.2,50L30.6,66.6 l2.8,2.8L50,52.8l16.6,16.6l2.8-2.8L52.8,50l16.6-16.6l-2.8-2.8L50,47.2L33.4,30.6z"); - attr(svg, "class", "remove-row svelte-gbs5xa"); - attr(svg, "viewBox", "0 0 100 100"); - attr(svg, "width", "16"); - attr(svg, "height", "16"); - }, - m(target, anchor) { - insert(target, svg, anchor); - append(svg, path); +function precisionFixed(step){return Math.max(0,-exponent(Math.abs(step)));} - if (!mounted) { - dispose = listen(svg, "click", click_handler); - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; - }, - d(detaching) { - if (detaching) detach(svg); - mounted = false; - dispose(); - } - }; -} +function precisionPrefix(step,value){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(value)/3)))*3-exponent(Math.abs(step)));} -// (62:6) {:else} -function create_else_block$2(ctx) { - let input; - let mounted; - let dispose; +function precisionRound(step,max){step=Math.abs(step),max=Math.abs(max)-step;return Math.max(0,exponent(max)-exponent(step))+1;} - function input_input_handler() { - /*input_input_handler*/ ctx[9].call(input, /*each_value*/ ctx[11], /*i*/ ctx[12]); - } +function initRange(domain,range){switch(arguments.length){case 0:break;case 1:this.range(domain);break;default:this.range(range).domain(domain);break;}return this;} - return { - c() { - input = element("input"); - attr(input, "class", "expense-amount svelte-gbs5xa"); - attr(input, "type", "number"); - attr(input, "placeholder", "Amount"); - }, - m(target, anchor) { - insert(target, input, anchor); - set_input_value(input, /*line*/ ctx[10].amount); +function constants(x){return function(){return x;};} - if (!mounted) { - dispose = [ - listen(input, "blur", /*formatAmount*/ ctx[6]), - listen(input, "input", input_input_handler) - ]; +function number$2(x){return +x;} - mounted = true; - } - }, - p(new_ctx, dirty) { - ctx = new_ctx; +var unit=[0,1];function identity$2(x){return x;}function normalize(a,b){return (b-=a=+a)?function(x){return (x-a)/b;}:constants(isNaN(b)?NaN:0.5);}function clamper(a,b){var t;if(a>b)t=a,a=b,b=t;return function(x){return Math.max(a,Math.min(b,x));};}// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1]. +// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b]. +function bimap(domain,range,interpolate){var d0=domain[0],d1=domain[1],r0=range[0],r1=range[1];if(d12?polymap:bimap;output=input=null;return scale;}function scale(x){return x==null||isNaN(x=+x)?unknown:(output||(output=piecewise(domain.map(transform),range,interpolate$1)))(transform(clamp(x)));}scale.invert=function(y){return clamp(untransform((input||(input=piecewise(range,domain.map(transform),interpolateNumber)))(y)));};scale.domain=function(_){return arguments.length?(domain=Array.from(_,number$2),rescale()):domain.slice();};scale.range=function(_){return arguments.length?(range=Array.from(_),rescale()):range.slice();};scale.rangeRound=function(_){return range=Array.from(_),interpolate$1=interpolateRound,rescale();};scale.clamp=function(_){return arguments.length?(clamp=_?true:identity$2,rescale()):clamp!==identity$2;};scale.interpolate=function(_){return arguments.length?(interpolate$1=_,rescale()):interpolate$1;};scale.unknown=function(_){return arguments.length?(unknown=_,scale):unknown;};return function(t,u){transform=t,untransform=u;return rescale();};}function continuous(){return transformer()(identity$2,identity$2);} - if (dirty & /*lines*/ 1 && to_number(input.value) !== /*line*/ ctx[10].amount) { - set_input_value(input, /*line*/ ctx[10].amount); - } - }, - d(detaching) { - if (detaching) detach(input); - mounted = false; - run_all(dispose); - } - }; -} +function tickFormat(start,stop,count,specifier){var step=tickStep(start,stop,count),precision;specifier=formatSpecifier(specifier==null?",f":specifier);switch(specifier.type){case"s":{var value=Math.max(Math.abs(start),Math.abs(stop));if(specifier.precision==null&&!isNaN(precision=precisionPrefix(step,value)))specifier.precision=precision;return formatPrefix(specifier,value);}case"":case"e":case"g":case"p":case"r":{if(specifier.precision==null&&!isNaN(precision=precisionRound(step,Math.max(Math.abs(start),Math.abs(stop)))))specifier.precision=precision-(specifier.type==="e");break;}case"f":case"%":{if(specifier.precision==null&&!isNaN(precision=precisionFixed(step)))specifier.precision=precision-(specifier.type==="%")*2;break;}}return format(specifier);} -// (54:6) {#if i === lines.length - 1} -function create_if_block$3(ctx) { - let input; - let input_disabled_value; +function linearish(scale){var domain=scale.domain;scale.ticks=function(count){var d=domain();return ticks(d[0],d[d.length-1],count==null?10:count);};scale.tickFormat=function(count,specifier){var d=domain();return tickFormat(d[0],d[d.length-1],count==null?10:count,specifier);};scale.nice=function(count){if(count==null)count=10;var d=domain();var i0=0;var i1=d.length-1;var start=d[i0];var stop=d[i1];var prestep;var step;var maxIter=10;if(stop0){step=tickIncrement(start,stop,count);if(step===prestep){d[i0]=start;d[i1]=stop;return domain(d);}else if(step>0){start=Math.floor(start/step)*step;stop=Math.ceil(stop/step)*step;}else if(step<0){start=Math.ceil(start*step)/step;stop=Math.floor(stop*step)/step;}else {break;}prestep=step;}return scale;};return scale;}function linear$1(){var scale=continuous();scale.copy=function(){return copy(scale,linear$1());};initRange.apply(scale,arguments);return linearish(scale);} - return { - c() { - input = element("input"); - attr(input, "class", "expense-amount svelte-gbs5xa"); - attr(input, "type", "number"); - attr(input, "placeholder", "Amount"); - input.disabled = input_disabled_value = true; - input.value = /*remainder*/ ctx[3]; - }, - m(target, anchor) { - insert(target, input, anchor); - }, - p(ctx, dirty) { - if (dirty & /*remainder*/ 8) { - input.value = /*remainder*/ ctx[3]; - } - }, - d(detaching) { - if (detaching) detach(input); - } - }; +const LedgerViewType = 'ledger'; +class LedgerView extends obsidian.ItemView { + constructor(leaf, plugin) { + super(leaf); + this.redraw = () => { + const contentEl = this.containerEl.children[1]; + console.debug('ledger: Rendering preview for ledger file'); + contentEl.empty(); + const p = contentEl.createEl('p'); + p.setText('Hello world 2'); + const div = contentEl.createDiv(); + div.appendChild(this.makeSimpleBarD3()); + }; + this.makeSimpleBarD3 = () => { + // https://www.essycode.com/posts/create-sparkline-charts-d3/ + const WIDTH = 160; + const HEIGHT = 30; + const DATA_COUNT = 40; + const BAR_WIDTH = (WIDTH - DATA_COUNT) / DATA_COUNT; + const data = range(DATA_COUNT).map((d) => Math.random()); + const x = linear$1().domain([0, DATA_COUNT]).range([0, WIDTH]); + const y = linear$1().domain([0, 1]).range([HEIGHT, 0]); + const svg = create('svg').attr('width', WIDTH).attr('height', HEIGHT); + const g = svg.append('g'); + g.selectAll('.bar') + .data(data) + .enter() + .append('rect') + .attr('class', 'bar') + .attr('x', (d, i) => x(i)) + .attr('y', (d) => HEIGHT - y(d)) + .attr('width', BAR_WIDTH) + .attr('height', (d) => y(d)) + .attr('fill', 'MediumSeaGreen'); + return svg.node(); + }; + this.reloadData = () => { + throw new Error('Not Implemented'); + }; + this.plugin = plugin; + this.registerEvent(this.app.vault.on('modify', (file) => { + if (file.path === this.plugin.settings.ledgerFile) { + this.reloadData(); + } + })); + this.reloadData(); + this.redraw(); + } + getViewType() { + return LedgerViewType; + } + getDisplayText() { + return 'Ledger'; + } + getIcon() { + return 'ledger'; + } } -// (29:0) {#each lines as line, i (line.id)} -function create_each_block$3(key_1, ctx) { - let div1; - let t0; - let textsuggest; - let updating_value; - let t1; - let div0; - let t2; - let i_1; - let t3; - let current; - let if_block0 = /*i*/ ctx[12] > 0 && /*i*/ ctx[12] !== /*lines*/ ctx[0].length - 1 && create_if_block_1$1(ctx); - - function textsuggest_value_binding(value) { - /*textsuggest_value_binding*/ ctx[8](value, /*line*/ ctx[10]); - } - - let textsuggest_props = { - placeholder: "Account", - classes: "expense-category", - suggestions: /*txCache*/ ctx[2].categories - }; - - if (/*line*/ ctx[10].category !== void 0) { - textsuggest_props.value = /*line*/ ctx[10].category; - } - - textsuggest = new TextSuggest({ props: textsuggest_props }); - binding_callbacks.push(() => bind(textsuggest, "value", textsuggest_value_binding)); - - function select_block_type(ctx, dirty) { - if (/*i*/ ctx[12] === /*lines*/ ctx[0].length - 1) return create_if_block$3; - return create_else_block$2; - } +const defaultSettings = { + currencySymbol: '$', + ledgerFile: 'Ledger.md', + includeFinalLineAmount: false, + enableLedgerVis: false, + assetAccountsPrefix: 'a', + expenseAccountsPrefix: 'e', + incomeAccountsPrefix: 'i', + liabilityAccountsPrefix: 'l', +}; +const settingsWithDefaults = (settings) => ({ + ...defaultSettings, + ...settings, +}); - let current_block_type = select_block_type(ctx); - let if_block1 = current_block_type(ctx); +/** @license React v16.13.1 + * react-is.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - return { - key: key_1, - first: null, - c() { - div1 = element("div"); - if (if_block0) if_block0.c(); - t0 = space(); - create_component(textsuggest.$$.fragment); - t1 = space(); - div0 = element("div"); - if_block1.c(); - t2 = space(); - i_1 = element("i"); - t3 = text(/*currencySymbol*/ ctx[1]); - attr(i_1, "class", "svelte-gbs5xa"); - attr(div0, "class", "input-icon svelte-gbs5xa"); - attr(div1, "class", "form-row svelte-gbs5xa"); - this.first = div1; - }, - m(target, anchor) { - insert(target, div1, anchor); - if (if_block0) if_block0.m(div1, null); - append(div1, t0); - mount_component(textsuggest, div1, null); - append(div1, t1); - append(div1, div0); - if_block1.m(div0, null); - append(div0, t2); - append(div0, i_1); - append(i_1, t3); - current = true; - }, - p(new_ctx, dirty) { - ctx = new_ctx; +var reactIs_development = createCommonjsModule(function (module, exports) { +{(function(){// nor polyfill, then a plain number is used for performance. +var hasSymbol=typeof Symbol==='function'&&Symbol.for;var REACT_ELEMENT_TYPE=hasSymbol?Symbol.for('react.element'):0xeac7;var REACT_PORTAL_TYPE=hasSymbol?Symbol.for('react.portal'):0xeaca;var REACT_FRAGMENT_TYPE=hasSymbol?Symbol.for('react.fragment'):0xeacb;var REACT_STRICT_MODE_TYPE=hasSymbol?Symbol.for('react.strict_mode'):0xeacc;var REACT_PROFILER_TYPE=hasSymbol?Symbol.for('react.profiler'):0xead2;var REACT_PROVIDER_TYPE=hasSymbol?Symbol.for('react.provider'):0xeacd;var REACT_CONTEXT_TYPE=hasSymbol?Symbol.for('react.context'):0xeace;// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary +// (unstable) APIs that have been removed. Can we remove the symbols? +var REACT_ASYNC_MODE_TYPE=hasSymbol?Symbol.for('react.async_mode'):0xeacf;var REACT_CONCURRENT_MODE_TYPE=hasSymbol?Symbol.for('react.concurrent_mode'):0xeacf;var REACT_FORWARD_REF_TYPE=hasSymbol?Symbol.for('react.forward_ref'):0xead0;var REACT_SUSPENSE_TYPE=hasSymbol?Symbol.for('react.suspense'):0xead1;var REACT_SUSPENSE_LIST_TYPE=hasSymbol?Symbol.for('react.suspense_list'):0xead8;var REACT_MEMO_TYPE=hasSymbol?Symbol.for('react.memo'):0xead3;var REACT_LAZY_TYPE=hasSymbol?Symbol.for('react.lazy'):0xead4;var REACT_BLOCK_TYPE=hasSymbol?Symbol.for('react.block'):0xead9;var REACT_FUNDAMENTAL_TYPE=hasSymbol?Symbol.for('react.fundamental'):0xead5;var REACT_RESPONDER_TYPE=hasSymbol?Symbol.for('react.responder'):0xead6;var REACT_SCOPE_TYPE=hasSymbol?Symbol.for('react.scope'):0xead7;function isValidElementType(type){return typeof type==='string'||typeof type==='function'||// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. +type===REACT_FRAGMENT_TYPE||type===REACT_CONCURRENT_MODE_TYPE||type===REACT_PROFILER_TYPE||type===REACT_STRICT_MODE_TYPE||type===REACT_SUSPENSE_TYPE||type===REACT_SUSPENSE_LIST_TYPE||typeof type==='object'&&type!==null&&(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_FUNDAMENTAL_TYPE||type.$$typeof===REACT_RESPONDER_TYPE||type.$$typeof===REACT_SCOPE_TYPE||type.$$typeof===REACT_BLOCK_TYPE);}function typeOf(object){if(typeof object==='object'&&object!==null){var $$typeof=object.$$typeof;switch($$typeof){case REACT_ELEMENT_TYPE:var type=object.type;switch(type){case REACT_ASYNC_MODE_TYPE:case REACT_CONCURRENT_MODE_TYPE:case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:return type;default:var $$typeofType=type&&type.$$typeof;switch($$typeofType){case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE:case REACT_MEMO_TYPE:case REACT_PROVIDER_TYPE:return $$typeofType;default:return $$typeof;}}case REACT_PORTAL_TYPE:return $$typeof;}}return undefined;}// AsyncMode is deprecated along with isAsyncMode +var AsyncMode=REACT_ASYNC_MODE_TYPE;var ConcurrentMode=REACT_CONCURRENT_MODE_TYPE;var ContextConsumer=REACT_CONTEXT_TYPE;var ContextProvider=REACT_PROVIDER_TYPE;var Element=REACT_ELEMENT_TYPE;var ForwardRef=REACT_FORWARD_REF_TYPE;var Fragment=REACT_FRAGMENT_TYPE;var Lazy=REACT_LAZY_TYPE;var Memo=REACT_MEMO_TYPE;var Portal=REACT_PORTAL_TYPE;var Profiler=REACT_PROFILER_TYPE;var StrictMode=REACT_STRICT_MODE_TYPE;var Suspense=REACT_SUSPENSE_TYPE;var hasWarnedAboutDeprecatedIsAsyncMode=false;// AsyncMode should be deprecated +function isAsyncMode(object){{if(!hasWarnedAboutDeprecatedIsAsyncMode){hasWarnedAboutDeprecatedIsAsyncMode=true;// Using console['warn'] to evade Babel and ESLint +console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, '+'and will be removed in React 17+. Update your code to use '+'ReactIs.isConcurrentMode() instead. It has the exact same API.');}}return isConcurrentMode(object)||typeOf(object)===REACT_ASYNC_MODE_TYPE;}function isConcurrentMode(object){return typeOf(object)===REACT_CONCURRENT_MODE_TYPE;}function isContextConsumer(object){return typeOf(object)===REACT_CONTEXT_TYPE;}function isContextProvider(object){return typeOf(object)===REACT_PROVIDER_TYPE;}function isElement(object){return typeof object==='object'&&object!==null&&object.$$typeof===REACT_ELEMENT_TYPE;}function isForwardRef(object){return typeOf(object)===REACT_FORWARD_REF_TYPE;}function isFragment(object){return typeOf(object)===REACT_FRAGMENT_TYPE;}function isLazy(object){return typeOf(object)===REACT_LAZY_TYPE;}function isMemo(object){return typeOf(object)===REACT_MEMO_TYPE;}function isPortal(object){return typeOf(object)===REACT_PORTAL_TYPE;}function isProfiler(object){return typeOf(object)===REACT_PROFILER_TYPE;}function isStrictMode(object){return typeOf(object)===REACT_STRICT_MODE_TYPE;}function isSuspense(object){return typeOf(object)===REACT_SUSPENSE_TYPE;}exports.AsyncMode=AsyncMode;exports.ConcurrentMode=ConcurrentMode;exports.ContextConsumer=ContextConsumer;exports.ContextProvider=ContextProvider;exports.Element=Element;exports.ForwardRef=ForwardRef;exports.Fragment=Fragment;exports.Lazy=Lazy;exports.Memo=Memo;exports.Portal=Portal;exports.Profiler=Profiler;exports.StrictMode=StrictMode;exports.Suspense=Suspense;exports.isAsyncMode=isAsyncMode;exports.isConcurrentMode=isConcurrentMode;exports.isContextConsumer=isContextConsumer;exports.isContextProvider=isContextProvider;exports.isElement=isElement;exports.isForwardRef=isForwardRef;exports.isFragment=isFragment;exports.isLazy=isLazy;exports.isMemo=isMemo;exports.isPortal=isPortal;exports.isProfiler=isProfiler;exports.isStrictMode=isStrictMode;exports.isSuspense=isSuspense;exports.isValidElementType=isValidElementType;exports.typeOf=typeOf;})();} +}); - if (/*i*/ ctx[12] > 0 && /*i*/ ctx[12] !== /*lines*/ ctx[0].length - 1) { - if (if_block0) { - if_block0.p(ctx, dirty); - } else { - if_block0 = create_if_block_1$1(ctx); - if_block0.c(); - if_block0.m(div1, t0); - } - } else if (if_block0) { - if_block0.d(1); - if_block0 = null; - } +var reactIs = createCommonjsModule(function (module) { +{module.exports=reactIs_development;} +}); - const textsuggest_changes = {}; - if (dirty & /*txCache*/ 4) textsuggest_changes.suggestions = /*txCache*/ ctx[2].categories; +/* +object-assign +(c) Sindre Sorhus +@license MIT +*/ +/* eslint-disable no-unused-vars */var getOwnPropertySymbols=Object.getOwnPropertySymbols;var hasOwnProperty=Object.prototype.hasOwnProperty;var propIsEnumerable=Object.prototype.propertyIsEnumerable;function toObject(val){if(val===null||val===undefined){throw new TypeError('Object.assign cannot be called with null or undefined');}return Object(val);}function shouldUseNative(){try{if(!Object.assign){return false;}// Detect buggy property enumeration order in older V8 versions. +// https://bugs.chromium.org/p/v8/issues/detail?id=4118 +var test1=new String('abc');// eslint-disable-line no-new-wrappers +test1[5]='de';if(Object.getOwnPropertyNames(test1)[0]==='5'){return false;}// https://bugs.chromium.org/p/v8/issues/detail?id=3056 +var test2={};for(var i=0;i<10;i++){test2['_'+String.fromCharCode(i)]=i;}var order2=Object.getOwnPropertyNames(test2).map(function(n){return test2[n];});if(order2.join('')!=='0123456789'){return false;}// https://bugs.chromium.org/p/v8/issues/detail?id=3056 +var test3={};'abcdefghijklmnopqrst'.split('').forEach(function(letter){test3[letter]=letter;});if(Object.keys(Object.assign({},test3)).join('')!=='abcdefghijklmnopqrst'){return false;}return true;}catch(err){// We don't expect any of the above to throw, but better to be safe. +return false;}}var objectAssign=shouldUseNative()?Object.assign:function(target,source){var from;var to=toObject(target);var symbols;for(var s=1;s updating_value = false); - } +var react_production_min = createCommonjsModule(function (module, exports) { +var n=60103,p=60106;exports.Fragment=60107;exports.StrictMode=60108;exports.Profiler=60114;var q=60109,r=60110,t=60112;exports.Suspense=60113;var u=60115,v=60116;if("function"===typeof Symbol&&Symbol.for){var w=Symbol.for;n=w("react.element");p=w("react.portal");exports.Fragment=w("react.fragment");exports.StrictMode=w("react.strict_mode");exports.Profiler=w("react.profiler");q=w("react.provider");r=w("react.context");t=w("react.forward_ref");exports.Suspense=w("react.suspense");u=w("react.memo");v=w("react.lazy");}var x="function"===typeof Symbol&&Symbol.iterator;function y(a){if(null===a||"object"!==typeof a)return null;a=x&&a[x]||a["@@iterator"];return "function"===typeof a?a:null;}function z(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}printWarning('warn',format,args);}}function error(format){{for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){args[_key2-1]=arguments[_key2];}printWarning('error',format,args);}}function printWarning(level,format,args){// When changing this logic, you might want to also +// update consoleWithStackDev.www.js as well. +{var ReactDebugCurrentFrame=ReactSharedInternals.ReactDebugCurrentFrame;var stack=ReactDebugCurrentFrame.getStackAddendum();if(stack!==''){format+='%s';args=args.concat([stack]);}var argsWithFormat=args.map(function(item){return ''+item;});// Careful: RN currently depends on this prefix +argsWithFormat.unshift('Warning: '+format);// We intentionally don't use spread (or .apply) directly because it +// breaks IE9: https://github.com/facebook/react/issues/13610 +// eslint-disable-next-line react-internal/no-production-logging +Function.prototype.apply.call(console[level],console,argsWithFormat);}}var didWarnStateUpdateForUnmountedComponent={};function warnNoop(publicInstance,callerName){{var _constructor=publicInstance.constructor;var componentName=_constructor&&(_constructor.displayName||_constructor.name)||'ReactClass';var warningKey=componentName+"."+callerName;if(didWarnStateUpdateForUnmountedComponent[warningKey]){return;}error("Can't call %s on a component that is not yet mounted. "+'This is a no-op, but it might indicate a bug in your application. '+'Instead, assign to `this.state` directly or define a `state = {};` '+'class property with the desired state in the %s component.',callerName,componentName);didWarnStateUpdateForUnmountedComponent[warningKey]=true;}}/** + * This is the abstract API for an update queue. + */var ReactNoopUpdateQueue={/** + * Checks whether or not this composite component is mounted. + * @param {ReactClass} publicInstance The instance we want to test. + * @return {boolean} True if mounted, false otherwise. + * @protected + * @final + */isMounted:function(publicInstance){return false;},/** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */enqueueForceUpdate:function(publicInstance,callback,callerName){warnNoop(publicInstance,'forceUpdate');},/** + * Replaces all of the state. Always use this or `setState` to mutate state. + * You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} completeState Next state. + * @param {?function} callback Called after component is updated. + * @param {?string} callerName name of the calling function in the public API. + * @internal + */enqueueReplaceState:function(publicInstance,completeState,callback,callerName){warnNoop(publicInstance,'replaceState');},/** + * Sets a subset of the state. This only exists because _pendingState is + * internal. This provides a merging strategy that is not available to deep + * properties which is confusing. TODO: Expose pendingState or don't use it + * during the merge. + * + * @param {ReactClass} publicInstance The instance that should rerender. + * @param {object} partialState Next partial state to be merged with state. + * @param {?function} callback Called after component is updated. + * @param {?string} Name of the calling function in the public API. + * @internal + */enqueueSetState:function(publicInstance,partialState,callback,callerName){warnNoop(publicInstance,'setState');}};var emptyObject={};{Object.freeze(emptyObject);}/** + * Base class helpers for the updating state of a component. + */function Component(props,context,updater){this.props=props;this.context=context;// If a component has string refs, we will assign a different object later. +this.refs=emptyObject;// We initialize the default updater but the real one gets injected by the +// renderer. +this.updater=updater||ReactNoopUpdateQueue;}Component.prototype.isReactComponent={};/** + * Sets a subset of the state. Always use this to mutate + * state. You should treat `this.state` as immutable. + * + * There is no guarantee that `this.state` will be immediately updated, so + * accessing `this.state` after calling this method may return the old value. + * + * There is no guarantee that calls to `setState` will run synchronously, + * as they may eventually be batched together. You can provide an optional + * callback that will be executed when the call to setState is actually + * completed. + * + * When a function is provided to setState, it will be called at some point in + * the future (not synchronously). It will be called with the up to date + * component arguments (state, props, context). These values can be different + * from this.* because your function may be called after receiveProps but before + * shouldComponentUpdate, and this new state, props, and context will not yet be + * assigned to this. + * + * @param {object|function} partialState Next partial state or function to + * produce next partial state to be merged with current state. + * @param {?function} callback Called after state is updated. + * @final + * @protected + */Component.prototype.setState=function(partialState,callback){if(!(typeof partialState==='object'||typeof partialState==='function'||partialState==null)){{throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");}}this.updater.enqueueSetState(this,partialState,callback,'setState');};/** + * Forces an update. This should only be invoked when it is known with + * certainty that we are **not** in a DOM transaction. + * + * You may want to call this when you know that some deeper aspect of the + * component's state has changed but `setState` was not called. + * + * This will not invoke `shouldComponentUpdate`, but it will invoke + * `componentWillUpdate` and `componentDidUpdate`. + * + * @param {?function} callback Called after update is complete. + * @final + * @protected + */Component.prototype.forceUpdate=function(callback){this.updater.enqueueForceUpdate(this,callback,'forceUpdate');};/** + * Deprecated APIs. These APIs used to exist on classic React classes but since + * we would like to deprecate them, we're not going to move them over to this + * modern base class. Instead, we define a getter that warns if it's accessed. + */{var deprecatedAPIs={isMounted:['isMounted','Instead, make sure to clean up subscriptions and pending requests in '+'componentWillUnmount to prevent memory leaks.'],replaceState:['replaceState','Refactor your code to use setState instead (see '+'https://github.com/facebook/react/issues/3236).']};var defineDeprecationWarning=function(methodName,info){Object.defineProperty(Component.prototype,methodName,{get:function(){warn('%s(...) is deprecated in plain JavaScript React classes. %s',info[0],info[1]);return undefined;}});};for(var fnName in deprecatedAPIs){if(deprecatedAPIs.hasOwnProperty(fnName)){defineDeprecationWarning(fnName,deprecatedAPIs[fnName]);}}}function ComponentDummy(){}ComponentDummy.prototype=Component.prototype;/** + * Convenience component with default shallow equality check for sCU. + */function PureComponent(props,context,updater){this.props=props;this.context=context;// If a component has string refs, we will assign a different object later. +this.refs=emptyObject;this.updater=updater||ReactNoopUpdateQueue;}var pureComponentPrototype=PureComponent.prototype=new ComponentDummy();pureComponentPrototype.constructor=PureComponent;// Avoid an extra prototype jump for these methods. +_assign(pureComponentPrototype,Component.prototype);pureComponentPrototype.isPureReactComponent=true;// an immutable object with a single mutable value +function createRef(){var refObject={current:null};{Object.seal(refObject);}return refObject;}function getWrappedName(outerType,innerType,wrapperName){var functionName=innerType.displayName||innerType.name||'';return outerType.displayName||(functionName!==''?wrapperName+"("+functionName+")":wrapperName);}function getContextName(type){return type.displayName||'Context';}function getComponentName(type){if(type==null){// Host root, text node or just invalid type. +return null;}{if(typeof type.tag==='number'){error('Received an unexpected object in getComponentName(). '+'This is likely a bug in React. Please file an issue.');}}if(typeof type==='function'){return type.displayName||type.name||null;}if(typeof type==='string'){return type;}switch(type){case exports.Fragment:return 'Fragment';case REACT_PORTAL_TYPE:return 'Portal';case exports.Profiler:return 'Profiler';case exports.StrictMode:return 'StrictMode';case exports.Suspense:return 'Suspense';case REACT_SUSPENSE_LIST_TYPE:return 'SuspenseList';}if(typeof type==='object'){switch(type.$$typeof){case REACT_CONTEXT_TYPE:var context=type;return getContextName(context)+'.Consumer';case REACT_PROVIDER_TYPE:var provider=type;return getContextName(provider._context)+'.Provider';case REACT_FORWARD_REF_TYPE:return getWrappedName(type,type.render,'ForwardRef');case REACT_MEMO_TYPE:return getComponentName(type.type);case REACT_BLOCK_TYPE:return getComponentName(type._render);case REACT_LAZY_TYPE:{var lazyComponent=type;var payload=lazyComponent._payload;var init=lazyComponent._init;try{return getComponentName(init(payload));}catch(x){return null;}}}}return null;}var hasOwnProperty=Object.prototype.hasOwnProperty;var RESERVED_PROPS={key:true,ref:true,__self:true,__source:true};var specialPropKeyWarningShown,specialPropRefWarningShown,didWarnAboutStringRefs;{didWarnAboutStringRefs={};}function hasValidRef(config){{if(hasOwnProperty.call(config,'ref')){var getter=Object.getOwnPropertyDescriptor(config,'ref').get;if(getter&&getter.isReactWarning){return false;}}}return config.ref!==undefined;}function hasValidKey(config){{if(hasOwnProperty.call(config,'key')){var getter=Object.getOwnPropertyDescriptor(config,'key').get;if(getter&&getter.isReactWarning){return false;}}}return config.key!==undefined;}function defineKeyPropWarningGetter(props,displayName){var warnAboutAccessingKey=function(){{if(!specialPropKeyWarningShown){specialPropKeyWarningShown=true;error('%s: `key` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://reactjs.org/link/special-props)',displayName);}}};warnAboutAccessingKey.isReactWarning=true;Object.defineProperty(props,'key',{get:warnAboutAccessingKey,configurable:true});}function defineRefPropWarningGetter(props,displayName){var warnAboutAccessingRef=function(){{if(!specialPropRefWarningShown){specialPropRefWarningShown=true;error('%s: `ref` is not a prop. Trying to access it will result '+'in `undefined` being returned. If you need to access the same '+'value within the child component, you should pass it as a different '+'prop. (https://reactjs.org/link/special-props)',displayName);}}};warnAboutAccessingRef.isReactWarning=true;Object.defineProperty(props,'ref',{get:warnAboutAccessingRef,configurable:true});}function warnIfStringRefCannotBeAutoConverted(config){{if(typeof config.ref==='string'&&ReactCurrentOwner.current&&config.__self&&ReactCurrentOwner.current.stateNode!==config.__self){var componentName=getComponentName(ReactCurrentOwner.current.type);if(!didWarnAboutStringRefs[componentName]){error('Component "%s" contains the string ref "%s". '+'Support for string refs will be removed in a future major release. '+'This case cannot be automatically converted to an arrow function. '+'We ask you to manually fix this case by using useRef() or createRef() instead. '+'Learn more about using refs safely here: '+'https://reactjs.org/link/strict-mode-string-ref',componentName,config.ref);didWarnAboutStringRefs[componentName]=true;}}}}/** + * Factory method to create a new React element. This no longer adheres to + * the class pattern, so do not use new to call it. Also, instanceof check + * will not work. Instead test $$typeof field against Symbol.for('react.element') to check + * if something is a React Element. + * + * @param {*} type + * @param {*} props + * @param {*} key + * @param {string|object} ref + * @param {*} owner + * @param {*} self A *temporary* helper to detect places where `this` is + * different from the `owner` when React.createElement is called, so that we + * can warn. We want to get rid of owner and replace string `ref`s with arrow + * functions, and as long as `this` and owner are the same, there will be no + * change in behavior. + * @param {*} source An annotation object (added by a transpiler or otherwise) + * indicating filename, line number, and/or other information. + * @internal + */var ReactElement=function(type,key,ref,self,source,owner,props){var element={// This tag allows us to uniquely identify this as a React Element +$$typeof:REACT_ELEMENT_TYPE,// Built-in properties that belong on the element +type:type,key:key,ref:ref,props:props,// Record the component responsible for creating this element. +_owner:owner};{// The validation flag is currently mutative. We put it on +// an external backing store so that we can freeze the whole object. +// This can be replaced with a WeakMap once they are implemented in +// commonly used development environments. +element._store={};// To make comparing ReactElements easier for testing purposes, we make +// the validation flag non-enumerable (where possible, which should +// include every environment we run tests in), so the test framework +// ignores it. +Object.defineProperty(element._store,'validated',{configurable:false,enumerable:false,writable:true,value:false});// self and source are DEV only properties. +Object.defineProperty(element,'_self',{configurable:false,enumerable:false,writable:false,value:self});// Two elements created in two different places should be considered +// equal for testing purposes and therefore we hide it from enumeration. +Object.defineProperty(element,'_source',{configurable:false,enumerable:false,writable:false,value:source});if(Object.freeze){Object.freeze(element.props);Object.freeze(element);}}return element;};/** + * Create and return a new ReactElement of the given type. + * See https://reactjs.org/docs/react-api.html#createelement + */function createElement(type,config,children){var propName;// Reserved names are extracted +var props={};var key=null;var ref=null;var self=null;var source=null;if(config!=null){if(hasValidRef(config)){ref=config.ref;{warnIfStringRefCannotBeAutoConverted(config);}}if(hasValidKey(config)){key=''+config.key;}self=config.__self===undefined?null:config.__self;source=config.__source===undefined?null:config.__source;// Remaining properties are added to a new props object +for(propName in config){if(hasOwnProperty.call(config,propName)&&!RESERVED_PROPS.hasOwnProperty(propName)){props[propName]=config[propName];}}}// Children can be more than one argument, and those are transferred onto +// the newly allocated props object. +var childrenLength=arguments.length-2;if(childrenLength===1){props.children=children;}else if(childrenLength>1){var childArray=Array(childrenLength);for(var i=0;i1){var childArray=Array(childrenLength);for(var i=0;i is not supported and will be removed in '+'a future major release. Did you mean to render instead?');}return context.Provider;},set:function(_Provider){context.Provider=_Provider;}},_currentValue:{get:function(){return context._currentValue;},set:function(_currentValue){context._currentValue=_currentValue;}},_currentValue2:{get:function(){return context._currentValue2;},set:function(_currentValue2){context._currentValue2=_currentValue2;}},_threadCount:{get:function(){return context._threadCount;},set:function(_threadCount){context._threadCount=_threadCount;}},Consumer:{get:function(){if(!hasWarnedAboutUsingNestedContextConsumers){hasWarnedAboutUsingNestedContextConsumers=true;error('Rendering is not supported and will be removed in '+'a future major release. Did you mean to render instead?');}return context.Consumer;}},displayName:{get:function(){return context.displayName;},set:function(displayName){if(!hasWarnedAboutDisplayNameOnConsumer){warn('Setting `displayName` on Context.Consumer has no effect. '+"You should set it directly on the context with Context.displayName = '%s'.",displayName);hasWarnedAboutDisplayNameOnConsumer=true;}}}});// $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty +context.Consumer=Consumer;}{context._currentRenderer=null;context._currentRenderer2=null;}return context;}var Uninitialized=-1;var Pending=0;var Resolved=1;var Rejected=2;function lazyInitializer(payload){if(payload._status===Uninitialized){var ctor=payload._result;var thenable=ctor();// Transition to the next state. +var pending=payload;pending._status=Pending;pending._result=thenable;thenable.then(function(moduleObject){if(payload._status===Pending){var defaultExport=moduleObject.default;{if(defaultExport===undefined){error('lazy: Expected the result of a dynamic import() call. '+'Instead received: %s\n\nYour code should look like: \n '+// Break up imports to avoid accidentally parsing them as dependencies. +'const MyComponent = lazy(() => imp'+"ort('./MyComponent'))",moduleObject);}}// Transition to the next state. +var resolved=payload;resolved._status=Resolved;resolved._result=defaultExport;}},function(error){if(payload._status===Pending){// Transition to the next state. +var rejected=payload;rejected._status=Rejected;rejected._result=error;}});}if(payload._status===Resolved){return payload._result;}else {throw payload._result;}}function lazy(ctor){var payload={// We use these fields to store the result. +_status:-1,_result:ctor};var lazyType={$$typeof:REACT_LAZY_TYPE,_payload:payload,_init:lazyInitializer};{// In production, this would just set it on the object. +var defaultProps;var propTypes;// $FlowFixMe +Object.defineProperties(lazyType,{defaultProps:{configurable:true,get:function(){return defaultProps;},set:function(newDefaultProps){error('React.lazy(...): It is not supported to assign `defaultProps` to '+'a lazy component import. Either specify them where the component '+'is defined, or create a wrapping component around it.');defaultProps=newDefaultProps;// Match production behavior more closely: +// $FlowFixMe +Object.defineProperty(lazyType,'defaultProps',{enumerable:true});}},propTypes:{configurable:true,get:function(){return propTypes;},set:function(newPropTypes){error('React.lazy(...): It is not supported to assign `propTypes` to '+'a lazy component import. Either specify them where the component '+'is defined, or create a wrapping component around it.');propTypes=newPropTypes;// Match production behavior more closely: +// $FlowFixMe +Object.defineProperty(lazyType,'propTypes',{enumerable:true});}}});}return lazyType;}function forwardRef(render){{if(render!=null&&render.$$typeof===REACT_MEMO_TYPE){error('forwardRef requires a render function but received a `memo` '+'component. Instead of forwardRef(memo(...)), use '+'memo(forwardRef(...)).');}else if(typeof render!=='function'){error('forwardRef requires a render function but was given %s.',render===null?'null':typeof render);}else {if(render.length!==0&&render.length!==2){error('forwardRef render functions accept exactly two parameters: props and ref. %s',render.length===1?'Did you forget to use the ref parameter?':'Any additional parameter will be undefined.');}}if(render!=null){if(render.defaultProps!=null||render.propTypes!=null){error('forwardRef render functions do not support propTypes or defaultProps. '+'Did you accidentally pass a React component?');}}}var elementType={$$typeof:REACT_FORWARD_REF_TYPE,render:render};{var ownName;Object.defineProperty(elementType,'displayName',{enumerable:false,configurable:true,get:function(){return ownName;},set:function(name){ownName=name;if(render.displayName==null){render.displayName=name;}}});}return elementType;}// Filter certain DOM attributes (e.g. src, href) if their values are empty strings. +var enableScopeAPI=false;// Experimental Create Event Handle API. +function isValidElementType(type){if(typeof type==='string'||typeof type==='function'){return true;}// Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill). +if(type===exports.Fragment||type===exports.Profiler||type===REACT_DEBUG_TRACING_MODE_TYPE||type===exports.StrictMode||type===exports.Suspense||type===REACT_SUSPENSE_LIST_TYPE||type===REACT_LEGACY_HIDDEN_TYPE||enableScopeAPI){return true;}if(typeof type==='object'&&type!==null){if(type.$$typeof===REACT_LAZY_TYPE||type.$$typeof===REACT_MEMO_TYPE||type.$$typeof===REACT_PROVIDER_TYPE||type.$$typeof===REACT_CONTEXT_TYPE||type.$$typeof===REACT_FORWARD_REF_TYPE||type.$$typeof===REACT_FUNDAMENTAL_TYPE||type.$$typeof===REACT_BLOCK_TYPE||type[0]===REACT_SERVER_BLOCK_TYPE){return true;}}return false;}function memo(type,compare){{if(!isValidElementType(type)){error('memo: The first argument must be a component. Instead '+'received: %s',type===null?'null':typeof type);}}var elementType={$$typeof:REACT_MEMO_TYPE,type:type,compare:compare===undefined?null:compare};{var ownName;Object.defineProperty(elementType,'displayName',{enumerable:false,configurable:true,get:function(){return ownName;},set:function(name){ownName=name;if(type.displayName==null){type.displayName=name;}}});}return elementType;}function resolveDispatcher(){var dispatcher=ReactCurrentDispatcher.current;if(!(dispatcher!==null)){{throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.");}}return dispatcher;}function useContext(Context,unstable_observedBits){var dispatcher=resolveDispatcher();{if(unstable_observedBits!==undefined){error('useContext() second argument is reserved for future '+'use in React. Passing it is not supported. '+'You passed: %s.%s',unstable_observedBits,typeof unstable_observedBits==='number'&&Array.isArray(arguments[2])?'\n\nDid you call array.map(useContext)? '+'Calling Hooks inside a loop is not supported. '+'Learn more at https://reactjs.org/link/rules-of-hooks':'');}// TODO: add a more generic warning for invalid values. +if(Context._context!==undefined){var realContext=Context._context;// Don't deduplicate because this legitimately causes bugs +// and nobody should be using this in existing code. +if(realContext.Consumer===Context){error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be '+'removed in a future major release. Did you mean to call useContext(Context) instead?');}else if(realContext.Provider===Context){error('Calling useContext(Context.Provider) is not supported. '+'Did you mean to call useContext(Context) instead?');}}}return dispatcher.useContext(Context,unstable_observedBits);}function useState(initialState){var dispatcher=resolveDispatcher();return dispatcher.useState(initialState);}function useReducer(reducer,initialArg,init){var dispatcher=resolveDispatcher();return dispatcher.useReducer(reducer,initialArg,init);}function useRef(initialValue){var dispatcher=resolveDispatcher();return dispatcher.useRef(initialValue);}function useEffect(create,deps){var dispatcher=resolveDispatcher();return dispatcher.useEffect(create,deps);}function useLayoutEffect(create,deps){var dispatcher=resolveDispatcher();return dispatcher.useLayoutEffect(create,deps);}function useCallback(callback,deps){var dispatcher=resolveDispatcher();return dispatcher.useCallback(callback,deps);}function useMemo(create,deps){var dispatcher=resolveDispatcher();return dispatcher.useMemo(create,deps);}function useImperativeHandle(ref,create,deps){var dispatcher=resolveDispatcher();return dispatcher.useImperativeHandle(ref,create,deps);}function useDebugValue(value,formatterFn){{var dispatcher=resolveDispatcher();return dispatcher.useDebugValue(value,formatterFn);}}// Helpers to patch console.logs to avoid logging during side-effect free +// replaying on render function. This currently only patches the object +// lazily which won't cover if the log function was extracted eagerly. +// We could also eagerly patch the method. +var disabledDepth=0;var prevLog;var prevInfo;var prevWarn;var prevError;var prevGroup;var prevGroupCollapsed;var prevGroupEnd;function disabledLog(){}disabledLog.__reactDisabledLog=true;function disableLogs(){{if(disabledDepth===0){/* eslint-disable react-internal/no-production-logging */prevLog=console.log;prevInfo=console.info;prevWarn=console.warn;prevError=console.error;prevGroup=console.group;prevGroupCollapsed=console.groupCollapsed;prevGroupEnd=console.groupEnd;// https://github.com/facebook/react/issues/19099 +var props={configurable:true,enumerable:true,value:disabledLog,writable:true};// $FlowFixMe Flow thinks console is immutable. +Object.defineProperties(console,{info:props,log:props,warn:props,error:props,group:props,groupCollapsed:props,groupEnd:props});/* eslint-enable react-internal/no-production-logging */}disabledDepth++;}}function reenableLogs(){{disabledDepth--;if(disabledDepth===0){/* eslint-disable react-internal/no-production-logging */var props={configurable:true,enumerable:true,writable:true};// $FlowFixMe Flow thinks console is immutable. +Object.defineProperties(console,{log:_assign({},props,{value:prevLog}),info:_assign({},props,{value:prevInfo}),warn:_assign({},props,{value:prevWarn}),error:_assign({},props,{value:prevError}),group:_assign({},props,{value:prevGroup}),groupCollapsed:_assign({},props,{value:prevGroupCollapsed}),groupEnd:_assign({},props,{value:prevGroupEnd})});/* eslint-enable react-internal/no-production-logging */}if(disabledDepth<0){error('disabledDepth fell below zero. '+'This is a bug in React. Please file an issue.');}}}var ReactCurrentDispatcher$1=ReactSharedInternals.ReactCurrentDispatcher;var prefix;function describeBuiltInComponentFrame(name,source,ownerFn){{if(prefix===undefined){// Extract the VM specific prefix used by each line. +try{throw Error();}catch(x){var match=x.stack.trim().match(/\n( *(at )?)/);prefix=match&&match[1]||'';}}// We use the prefix to ensure our stacks line up with native stack frames. +return '\n'+prefix+name;}}var reentry=false;var componentFrameCache;{var PossiblyWeakMap=typeof WeakMap==='function'?WeakMap:Map;componentFrameCache=new PossiblyWeakMap();}function describeNativeComponentFrame(fn,construct){// If something asked for a stack inside a fake render, it should get ignored. +if(!fn||reentry){return '';}{var frame=componentFrameCache.get(fn);if(frame!==undefined){return frame;}}var control;reentry=true;var previousPrepareStackTrace=Error.prepareStackTrace;// $FlowFixMe It does accept undefined. +Error.prepareStackTrace=undefined;var previousDispatcher;{previousDispatcher=ReactCurrentDispatcher$1.current;// Set the dispatcher in DEV because this might be call in the render function +// for warnings. +ReactCurrentDispatcher$1.current=null;disableLogs();}try{// This should throw. +if(construct){// Something should be setting the props in the constructor. +var Fake=function(){throw Error();};// $FlowFixMe +Object.defineProperty(Fake.prototype,'props',{set:function(){// We use a throwing setter instead of frozen or non-writable props +// because that won't throw in a non-strict mode function. +throw Error();}});if(typeof Reflect==='object'&&Reflect.construct){// We construct a different control for this case to include any extra +// frames added by the construct call. +try{Reflect.construct(Fake,[]);}catch(x){control=x;}Reflect.construct(fn,[],Fake);}else {try{Fake.call();}catch(x){control=x;}fn.call(Fake.prototype);}}else {try{throw Error();}catch(x){control=x;}fn();}}catch(sample){// This is inlined manually because closure doesn't do it for us. +if(sample&&control&&typeof sample.stack==='string'){// This extracts the first frame from the sample that isn't also in the control. +// Skipping one frame that we assume is the frame that calls the two. +var sampleLines=sample.stack.split('\n');var controlLines=control.stack.split('\n');var s=sampleLines.length-1;var c=controlLines.length-1;while(s>=1&&c>=0&&sampleLines[s]!==controlLines[c]){// We expect at least one stack frame to be shared. +// Typically this will be the root most one. However, stack frames may be +// cut off due to maximum stack limits. In this case, one maybe cut off +// earlier than the other. We assume that the sample is longer or the same +// and there for cut off earlier. So we should find the root most frame in +// the sample somewhere in the control. +c--;}for(;s>=1&&c>=0;s--,c--){// Next we find the first one that isn't the same which should be the +// frame that called our sample function and the control. +if(sampleLines[s]!==controlLines[c]){// In V8, the first line is describing the message but other VMs don't. +// If we're about to return the first line, and the control is also on the same +// line, that's a pretty good indicator that our sample threw at same line as +// the control. I.e. before we entered the sample frame. So we ignore this result. +// This can happen if you passed a class to function component, or non-function. +if(s!==1||c!==1){do{s--;c--;// We may still have similar intermediate frames from the construct call. +// The next one that isn't the same should be our match though. +if(c<0||sampleLines[s]!==controlLines[c]){// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier. +var _frame='\n'+sampleLines[s].replace(' at new ',' at ');{if(typeof fn==='function'){componentFrameCache.set(fn,_frame);}}// Return the line we found. +return _frame;}}while(s>=1&&c>=0);}break;}}}}finally{reentry=false;{ReactCurrentDispatcher$1.current=previousDispatcher;reenableLogs();}Error.prepareStackTrace=previousPrepareStackTrace;}// Fallback to just using the name if we couldn't make it throw. +var name=fn?fn.displayName||fn.name:'';var syntheticFrame=name?describeBuiltInComponentFrame(name):'';{if(typeof fn==='function'){componentFrameCache.set(fn,syntheticFrame);}}return syntheticFrame;}function describeFunctionComponentFrame(fn,source,ownerFn){{return describeNativeComponentFrame(fn,false);}}function shouldConstruct(Component){var prototype=Component.prototype;return !!(prototype&&prototype.isReactComponent);}function describeUnknownElementTypeFrameInDEV(type,source,ownerFn){if(type==null){return '';}if(typeof type==='function'){{return describeNativeComponentFrame(type,shouldConstruct(type));}}if(typeof type==='string'){return describeBuiltInComponentFrame(type);}switch(type){case exports.Suspense:return describeBuiltInComponentFrame('Suspense');case REACT_SUSPENSE_LIST_TYPE:return describeBuiltInComponentFrame('SuspenseList');}if(typeof type==='object'){switch(type.$$typeof){case REACT_FORWARD_REF_TYPE:return describeFunctionComponentFrame(type.render);case REACT_MEMO_TYPE:// Memo may contain any component type so we recursively resolve it. +return describeUnknownElementTypeFrameInDEV(type.type,source,ownerFn);case REACT_BLOCK_TYPE:return describeFunctionComponentFrame(type._render);case REACT_LAZY_TYPE:{var lazyComponent=type;var payload=lazyComponent._payload;var init=lazyComponent._init;try{// Lazy may contain any component type so we recursively resolve it. +return describeUnknownElementTypeFrameInDEV(init(payload),source,ownerFn);}catch(x){}}}}return '';}var loggedTypeFailures={};var ReactDebugCurrentFrame$1=ReactSharedInternals.ReactDebugCurrentFrame;function setCurrentlyValidatingElement(element){{if(element){var owner=element._owner;var stack=describeUnknownElementTypeFrameInDEV(element.type,element._source,owner?owner.type:null);ReactDebugCurrentFrame$1.setExtraStackFrame(stack);}else {ReactDebugCurrentFrame$1.setExtraStackFrame(null);}}}function checkPropTypes(typeSpecs,values,location,componentName,element){{// $FlowFixMe This is okay but Flow doesn't know it. +var has=Function.call.bind(Object.prototype.hasOwnProperty);for(var typeSpecName in typeSpecs){if(has(typeSpecs,typeSpecName)){var error$1=void 0;// Prop type validation may throw. In case they do, we don't want to +// fail the render phase where it didn't fail before. So we log it. +// After these have been cleaned up, we'll let them throw. +try{// This is intentionally an invariant that gets caught. It's the same +// behavior as without this statement except with a better message. +if(typeof typeSpecs[typeSpecName]!=='function'){var err=Error((componentName||'React class')+': '+location+' type `'+typeSpecName+'` is invalid; '+'it must be a function, usually from the `prop-types` package, but received `'+typeof typeSpecs[typeSpecName]+'`.'+'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');err.name='Invariant Violation';throw err;}error$1=typeSpecs[typeSpecName](values,typeSpecName,componentName,location,null,'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');}catch(ex){error$1=ex;}if(error$1&&!(error$1 instanceof Error)){setCurrentlyValidatingElement(element);error('%s: type specification of %s'+' `%s` is invalid; the type checker '+'function must return `null` or an `Error` but returned a %s. '+'You may have forgotten to pass an argument to the type checker '+'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and '+'shape all require an argument).',componentName||'React class',location,typeSpecName,typeof error$1);setCurrentlyValidatingElement(null);}if(error$1 instanceof Error&&!(error$1.message in loggedTypeFailures)){// Only monitor this failure once because there tends to be a lot of the +// same error. +loggedTypeFailures[error$1.message]=true;setCurrentlyValidatingElement(element);error('Failed %s type: %s',location,error$1.message);setCurrentlyValidatingElement(null);}}}}}function setCurrentlyValidatingElement$1(element){{if(element){var owner=element._owner;var stack=describeUnknownElementTypeFrameInDEV(element.type,element._source,owner?owner.type:null);setExtraStackFrame(stack);}else {setExtraStackFrame(null);}}}var propTypesMisspellWarningShown;{propTypesMisspellWarningShown=false;}function getDeclarationErrorAddendum(){if(ReactCurrentOwner.current){var name=getComponentName(ReactCurrentOwner.current.type);if(name){return '\n\nCheck the render method of `'+name+'`.';}}return '';}function getSourceInfoErrorAddendum(source){if(source!==undefined){var fileName=source.fileName.replace(/^.*[\\\/]/,'');var lineNumber=source.lineNumber;return '\n\nCheck your code at '+fileName+':'+lineNumber+'.';}return '';}function getSourceInfoErrorAddendumForProps(elementProps){if(elementProps!==null&&elementProps!==undefined){return getSourceInfoErrorAddendum(elementProps.__source);}return '';}/** + * Warn if there's no key explicitly set on dynamic arrays of children or + * object keys are not valid. This allows us to keep track of children between + * updates. + */var ownerHasKeyUseWarning={};function getCurrentComponentErrorInfo(parentType){var info=getDeclarationErrorAddendum();if(!info){var parentName=typeof parentType==='string'?parentType:parentType.displayName||parentType.name;if(parentName){info="\n\nCheck the top-level render call using <"+parentName+">.";}}return info;}/** + * Warn if the element doesn't have an explicit key assigned to it. + * This element is in an array. The array could grow and shrink or be + * reordered. All children that haven't already been validated are required to + * have a "key" property assigned to it. Error statuses are cached so a warning + * will only be shown once. + * + * @internal + * @param {ReactElement} element Element that requires a key. + * @param {*} parentType element's parent's type. + */function validateExplicitKey(element,parentType){if(!element._store||element._store.validated||element.key!=null){return;}element._store.validated=true;var currentComponentErrorInfo=getCurrentComponentErrorInfo(parentType);if(ownerHasKeyUseWarning[currentComponentErrorInfo]){return;}ownerHasKeyUseWarning[currentComponentErrorInfo]=true;// Usually the current owner is the offender, but if it accepts children as a +// property, it may be the creator of the child that's responsible for +// assigning it a key. +var childOwner='';if(element&&element._owner&&element._owner!==ReactCurrentOwner.current){// Give the component that originally created this child. +childOwner=" It was passed a child from "+getComponentName(element._owner.type)+".";}{setCurrentlyValidatingElement$1(element);error('Each child in a list should have a unique "key" prop.'+'%s%s See https://reactjs.org/link/warning-keys for more information.',currentComponentErrorInfo,childOwner);setCurrentlyValidatingElement$1(null);}}/** + * Ensure that every element either is passed in a static location, in an + * array with an explicit keys property defined, or in an object literal + * with valid key property. + * + * @internal + * @param {ReactNode} node Statically passed child of any type. + * @param {*} parentType node's parent's type. + */function validateChildKeys(node,parentType){if(typeof node!=='object'){return;}if(Array.isArray(node)){for(var i=0;i";info=' Did you accidentally export a JSX literal instead of a component?';}else {typeString=typeof type;}{error('React.createElement: type is invalid -- expected a string (for '+'built-in components) or a class/function (for composite '+'components) but got: %s.%s',typeString,info);}}var element=createElement.apply(this,arguments);// The result can be nullish if a mock or a custom function is used. +// TODO: Drop this when these are no longer allowed as the type argument. +if(element==null){return element;}// Skip key warning if the type isn't valid since our key validation logic +// doesn't expect a non-string/function type and can throw confusing errors. +// We don't want exception behavior to differ between dev and prod. +// (Rendering will throw with a helpful message and as soon as the type is +// fixed, the key warnings will appear.) +if(validType){for(var i=2;iq)&&(t=(f=f.replace(' ',':')).length),0h&&(h=(c=c.trim()).charCodeAt(0));switch(h){case 38:return c.replace(F,'$1'+d.trim());case 58:return d.trim()+c.replace(F,'$1'+d.trim());default:if(0<1*e&&0b.charCodeAt(8))break;case 115:a=a.replace(b,'-webkit-'+b)+';'+a;break;case 207:case 102:a=a.replace(b,'-webkit-'+(102e.charCodeAt(0)&&(e=e.trim());V=e;e=[V];if(0 /*line*/ ctx[10].id; +var unitlessKeys={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,// SVG-related properties +fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var _default=unitlessKeys; - for (let i = 0; i < each_value.length; i += 1) { - let child_ctx = get_each_context$3(ctx, each_value, i); - let key = get_key(child_ctx); - each_1_lookup.set(key, each_blocks[i] = create_each_block$3(key, child_ctx)); - } +var unitless_cjs_dev = /*#__PURE__*/Object.defineProperty({ + default: _default +}, '__esModule', {value: true}); - return { - c() { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } +var unitless_cjs = createCommonjsModule(function (module) { +{module.exports=unitless_cjs_dev;} +}); - t0 = space(); - button = element("button"); - button.textContent = "Add Row"; - }, - m(target, anchor) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(target, anchor); - } +function memoize(fn){var cache={};return function(arg){if(cache[arg]===undefined)cache[arg]=fn(arg);return cache[arg];};} - insert(target, t0, anchor); - insert(target, button, anchor); - current = true; +var reactPropsRegex=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;// https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 +var index=memoize(function(prop){return reactPropsRegex.test(prop)||prop.charCodeAt(0)===111/* o */&&prop.charCodeAt(1)===110/* n */&&prop.charCodeAt(2)<91;}/* Z+1 */); - if (!mounted) { - dispose = listen(button, "click", /*addRow*/ ctx[4]); - mounted = true; - } - }, - p(ctx, [dirty]) { - if (dirty & /*currencySymbol, remainder, lines, formatAmount, txCache, removeRow*/ 111) { - each_value = /*lines*/ ctx[0]; - group_outros(); - each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, t0.parentNode, outro_and_destroy_block, create_each_block$3, t0, get_each_context$3); - check_outros(); - } - }, - i(local) { - if (current) return; +/** + * Copyright 2015, Yahoo! Inc. + * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. + */var REACT_STATICS={childContextTypes:true,contextType:true,contextTypes:true,defaultProps:true,displayName:true,getDefaultProps:true,getDerivedStateFromError:true,getDerivedStateFromProps:true,mixins:true,propTypes:true,type:true};var KNOWN_STATICS={name:true,length:true,prototype:true,caller:true,callee:true,arguments:true,arity:true};var FORWARD_REF_STATICS={'$$typeof':true,render:true,defaultProps:true,displayName:true,propTypes:true};var MEMO_STATICS={'$$typeof':true,compare:true,defaultProps:true,displayName:true,propTypes:true,type:true};var TYPE_STATICS={};TYPE_STATICS[reactIs.ForwardRef]=FORWARD_REF_STATICS;TYPE_STATICS[reactIs.Memo]=MEMO_STATICS;function getStatics(component){// React v16.11 and below +if(reactIs.isMemo(component)){return MEMO_STATICS;}// React v16.12 and above +return TYPE_STATICS[component['$$typeof']]||REACT_STATICS;}var defineProperty=Object.defineProperty;var getOwnPropertyNames=Object.getOwnPropertyNames;var getOwnPropertySymbols$1=Object.getOwnPropertySymbols;var getOwnPropertyDescriptor=Object.getOwnPropertyDescriptor;var getPrototypeOf=Object.getPrototypeOf;var objectPrototype=Object.prototype;function hoistNonReactStatics(targetComponent,sourceComponent,blacklist){if(typeof sourceComponent!=='string'){// don't hoist over string (html) components +if(objectPrototype){var inheritedComponent=getPrototypeOf(sourceComponent);if(inheritedComponent&&inheritedComponent!==objectPrototype){hoistNonReactStatics(targetComponent,inheritedComponent,blacklist);}}var keys=getOwnPropertyNames(sourceComponent);if(getOwnPropertySymbols$1){keys=keys.concat(getOwnPropertySymbols$1(sourceComponent));}var targetStatics=getStatics(targetComponent);var sourceStatics=getStatics(sourceComponent);for(var i=0;i ({})}\n```\n\n',8:'ThemeProvider: Please make your "theme" prop an object.\n\n',9:"Missing document ``\n\n",10:"Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021\n\n",11:"_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.\n\n",12:"It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n",13:"%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.\n\n",14:'ThemeProvider: "theme" prop is required.\n\n',15:"A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to ``, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n",16:"Reached the limit of how many styled components may be created at group %s.\nYou may only create up to 1,073,741,824 components. If you're creating components dynamically,\nas for instance in your render method then you may be running into this limitation.\n\n",17:"CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"};function D(){for(var e=arguments.length<=0?void 0:arguments[0],t=[],n=1,r=arguments.length;n1?t-1:0),r=1;r=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&j(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var s=r;s=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,s=r;s1<<30)&&j(16,""+t),x.set(e,t),k.set(t,e),t;},z=function(e){return k.get(e);},M=function(e,t){t>=V&&(V=t+1),x.set(e,t),k.set(t,e);},G="style["+A+'][data-styled-version="5.3.3"]',L=new RegExp("^"+A+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),F=function(e,t,n){for(var r,o=n.split(","),s=0,i=o.length;s=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(A))return r;}}(n),s=void 0!==o?o.nextSibling:null;r.setAttribute(A,"active"),r.setAttribute("data-styled-version","5.3.3");var i=q();return i&&r.setAttribute("nonce",i),n.insertBefore(r,s),r;},$=function(){function e(e){var t=this.element=H(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0;}return !1;},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--;},t.getRule=function(e){return e0&&(u+=e+",");}),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n';}}}return r;}(this);},e;}(),K=/(a)(d)/gi,Q=function(e){return String.fromCharCode(e+(e>25?39:97));};function ee(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Q(t%52)+n;return (Q(t%52)+n).replace(K,"$1-$2");}var te=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e;},ne=function(e){return te(5381,e);};var oe=ne("5.3.3"),se=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic="production"===undefined,this.componentId=t,this.baseHash=te(oe,t),this.baseStyle=n,Z.registerId(t);}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,o=[];if(this.baseStyle&&o.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash){if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))o.push(this.staticRulesId);else {var s=Ne(this.rules,e,t,n).join(""),i=ee(te(this.baseHash,s)>>>0);if(!t.hasNameForId(r,i)){var a=n(s,"."+i,void 0,r);t.insertRules(r,i,a);}o.push(i),this.staticRulesId=i;}}else {for(var c=this.rules.length,u=te(this.baseHash,n.hash),l="",d=0;d>>0);if(!t.hasNameForId(r,m)){var y=n(l,"."+m,void 0,r);t.insertRules(r,m,y);}o.push(m);}}return o.join(" ");},e;}(),ie=/^\s*\/\/.*$/gm,ae=[":","[",".","#"];function ce(e){var t,n,r,o,s=void 0===e?E:e,i=s.options,a=void 0===i?E:i,c=s.plugins,u=void 0===c?w:c,l=new stylis_min(a),d=[],h=function(e){function t(t){if(t)try{e(t+"}");}catch(e){}}return function(n,r,o,s,i,a,c,u,l,d){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===d?"/*|*/":"");}case-2:r.split("/*|*/}").forEach(t);}};}(function(e){d.push(e);}),f=function(e,r,s){return 0===r&&-1!==ae.indexOf(s[n.length])||s.match(o)?e:"."+t;};function m(e,s,i,a){void 0===a&&(a="&");var c=e.replace(ie,""),u=s&&i?i+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(i||!s?"":s,u);}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,f));},h,function(e){if(-2===e){var t=d;return d=[],t;}}])),m.hash=u.length?u.reduce(function(e,t){return t.name||j(15),te(e,t.name);},5381).toString():"",m;}var ue=/*#__PURE__*/react.createContext(),le=ue.Consumer,de=/*#__PURE__*/react.createContext(),he=(de.Consumer,new Z()),pe=ce();function fe(){return react.useContext(ue)||he;}function me(){return react.useContext(de)||pe;}var ve=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=pe);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"));},this.toString=function(){return j(12,String(n.name));},this.name=e,this.id="sc-keyframes-"+e,this.rules=t;}return e.prototype.getName=function(e){return void 0===e&&(e=pe),this.name+e.hash;},e;}(),ge=/([A-Z])/,Se=/([A-Z])/g,we=/^ms-/,Ee=function(e){return "-"+e.toLowerCase();};function be(e){return ge.test(e)?e.replace(Se,Ee).replace(we,"-ms-"):e;}var _e=function(e){return null==e||!1===e||""===e;};function Ne(e,n,r,o){if(Array.isArray(e)){for(var s,i=[],a=0,c=e.length;a1?t-1:0),r=1;r1?t-1:0),i=1;i?@[\\\]^`{|}~-]+/g,je=/(^-|-$)/g;function Te(e){return e.replace(De,"-").replace(je,"");}var xe=function(e){return ee(ne(e)>>>0);};function ke(e){return "string"==typeof e&&(e.charAt(0)===e.charAt(0).toLowerCase());}var Ve=function(e){return "function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e);},Be=function(e){return "__proto__"!==e&&"constructor"!==e&&"prototype"!==e;};function ze(e,t,n){var r=e[n];Ve(t)&&Ve(r)?Me(r,t):e[n]=t;}function Me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=0||(o[n]=e[n]);return o;}(t,["componentId"]),s=r&&r+"-"+(ke(e)?e:Te(_(e)));return qe(e,v({},o,{attrs:S,componentId:s}),n);},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps;},set:function(t){this._foldedDefaultProps=o?Me({},e.defaultProps,t):t;}}),(Oe(f,g),C.warnTooManyClasses=function(e,t){var n={},r=!1;return function(o){if(!r&&(n[o]=!0,Object.keys(n).length>=200)){var s=t?' with the id of "'+t+'"':"";console.warn("Over 200 classes were generated for component "+e+s+".\nConsider using the attrs method, together with a style object for frequently changed styles.\nExample:\n const Component = styled.div.attrs(props => ({\n style: {\n background: props.background,\n },\n }))`width: 100%;`\n\n "),r=!0,n={};}};}(f,g)),C.toString=function(){return "."+C.styledComponentId;},i&&hoistNonReactStatics_cjs(C,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),C;}var He=function(e){return function e(t,r,o){if(void 0===o&&(o=E),!reactIs.isValidElementType(r))return j(1,String(r));var s=function(){return t(r,o,Ce.apply(void 0,arguments));};return s.withConfig=function(n){return e(t,r,v({},o,{},n));},s.attrs=function(n){return e(t,r,v({},o,{attrs:Array.prototype.concat(o.attrs,n).filter(Boolean)}));},s;}(qe,e);};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){He[e]=He(e);});"undefined"!=typeof navigator&&"ReactNative"===navigator.product&&console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native"),"undefined"!=typeof window&&(window["__styled-components-init__"]=window["__styled-components-init__"]||0,1===window["__styled-components-init__"]&&console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info."),window["__styled-components-init__"]+=1); - current = true; - }, - o(local) { - for (let i = 0; i < each_blocks.length; i += 1) { - transition_out(each_blocks[i]); - } +const WideInput = He.input ` + width: 100%; +`; - current = false; - }, - d(detaching) { - for (let i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].d(detaching); - } +/** + * Simple ponyfill for Object.fromEntries + */var fromEntries=function fromEntries(entries){return entries.reduce(function(acc,_ref){var key=_ref[0],value=_ref[1];acc[key]=value;return acc;},{});};/** + * Small wrapper around `useLayoutEffect` to get rid of the warning on SSR envs + */var useIsomorphicLayoutEffect=typeof window!=='undefined'&&window.document&&window.document.createElement?react.useLayoutEffect:react.useEffect; - if (detaching) detach(t0); - if (detaching) detach(button); - mounted = false; - dispose(); - } - }; -} +var top='top';var bottom='bottom';var right='right';var left='left';var auto='auto';var basePlacements=[top,bottom,right,left];var start$1='start';var end='end';var clippingParents='clippingParents';var viewport='viewport';var popper='popper';var reference='reference';var variationPlacements=/*#__PURE__*/basePlacements.reduce(function(acc,placement){return acc.concat([placement+"-"+start$1,placement+"-"+end]);},[]);var placements=/*#__PURE__*/[].concat(basePlacements,[auto]).reduce(function(acc,placement){return acc.concat([placement,placement+"-"+start$1,placement+"-"+end]);},[]);// modifiers that need to read the DOM +var beforeRead='beforeRead';var read='read';var afterRead='afterRead';// pure-logic modifiers +var beforeMain='beforeMain';var main='main';var afterMain='afterMain';// modifier with the purpose to write to the DOM (or write into a framework state) +var beforeWrite='beforeWrite';var write='write';var afterWrite='afterWrite';var modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite]; -function instance$8($$self, $$props, $$invalidate) { - let remainder; - - let { currencySymbol } = $$props; - let { txCache } = $$props; - let { lines } = $$props; +function getNodeName(element){return element?(element.nodeName||'').toLowerCase():null;} - const addRow = () => { - lines.splice(lines.length - 1, 0, { - category: "", - amount: 0, - id: lodash.max(lines.map(line => line.id)) + 1, - currency: currencySymbol, - reconcile: "", - comment: undefined - }); +function getWindow(node){if(node==null){return window;}if(node.toString()!=='[object Window]'){var ownerDocument=node.ownerDocument;return ownerDocument?ownerDocument.defaultView||window:window;}return node;} - $$invalidate(0, lines); // Svelte reactivity hack - }; +function isElement(node){var OwnElement=getWindow(node).Element;return node instanceof OwnElement||node instanceof Element;}function isHTMLElement(node){var OwnElement=getWindow(node).HTMLElement;return node instanceof OwnElement||node instanceof HTMLElement;}function isShadowRoot(node){// IE 11 has no ShadowRoot +if(typeof ShadowRoot==='undefined'){return false;}var OwnElement=getWindow(node).ShadowRoot;return node instanceof OwnElement||node instanceof ShadowRoot;} - const removeRow = id => { - $$invalidate(0, lines = lines.filter(line => line.id !== id)); - }; +// and applies them to the HTMLElements such as popper and arrow +function applyStyles(_ref){var state=_ref.state;Object.keys(state.elements).forEach(function(name){var style=state.styles[name]||{};var attributes=state.attributes[name]||{};var element=state.elements[name];// arrow is optional + virtual elements +if(!isHTMLElement(element)||!getNodeName(element)){return;}// Flow doesn't support to extend this property, but it's the most +// effective way to apply styles to an HTMLElement +// $FlowFixMe[cannot-write] +Object.assign(element.style,style);Object.keys(attributes).forEach(function(name){var value=attributes[name];if(value===false){element.removeAttribute(name);}else {element.setAttribute(name,value===true?'':value);}});});}function effect(_ref2){var state=_ref2.state;var initialStyles={popper:{position:state.options.strategy,left:'0',top:'0',margin:'0'},arrow:{position:'absolute'},reference:{}};Object.assign(state.elements.popper.style,initialStyles.popper);state.styles=initialStyles;if(state.elements.arrow){Object.assign(state.elements.arrow.style,initialStyles.arrow);}return function(){Object.keys(state.elements).forEach(function(name){var element=state.elements[name];var attributes=state.attributes[name]||{};var styleProperties=Object.keys(state.styles.hasOwnProperty(name)?state.styles[name]:initialStyles[name]);// Set all values to an empty string to unset them +var style=styleProperties.reduce(function(style,property){style[property]='';return style;},{});// arrow is optional + virtual elements +if(!isHTMLElement(element)||!getNodeName(element)){return;}Object.assign(element.style,style);Object.keys(attributes).forEach(function(attribute){element.removeAttribute(attribute);});});};}// eslint-disable-next-line import/no-unused-modules +var applyStyles$1 = {name:'applyStyles',enabled:true,phase:'write',fn:applyStyles,effect:effect,requires:['computeStyles']}; - const formatAmount = event => { - const target = event.target; - target.value = target.valueAsNumber.toFixed(2); - }; +function getBasePlacement(placement){return placement.split('-')[0];} - const click_handler = line => { - removeRow(line.id); - }; +function getBoundingClientRect(element){var rect=element.getBoundingClientRect();return {width:rect.width,height:rect.height,top:rect.top,right:rect.right,bottom:rect.bottom,left:rect.left,x:rect.left,y:rect.top};} - function textsuggest_value_binding(value, line) { - if ($$self.$$.not_equal(line.category, value)) { - line.category = value; - $$invalidate(0, lines); - } - } +// means it doesn't take into account transforms. +function getLayoutRect(element){var clientRect=getBoundingClientRect(element);// Use the clientRect sizes if it's not been transformed. +// Fixes https://github.com/popperjs/popper-core/issues/1223 +var width=element.offsetWidth;var height=element.offsetHeight;if(Math.abs(clientRect.width-width)<=1){width=clientRect.width;}if(Math.abs(clientRect.height-height)<=1){height=clientRect.height;}return {x:element.offsetLeft,y:element.offsetTop,width:width,height:height};} + +function contains(parent,child){var rootNode=child.getRootNode&&child.getRootNode();// First, attempt with faster native method +if(parent.contains(child)){return true;}// then fallback to custom implementation with Shadow DOM support +else if(rootNode&&isShadowRoot(rootNode)){var next=child;do{if(next&&parent.isSameNode(next)){return true;}// $FlowFixMe[prop-missing]: need a better way to handle this... +next=next.parentNode||next.host;}while(next);}// Give up, the result is false +return false;} + +function getComputedStyle(element){return getWindow(element).getComputedStyle(element);} + +function isTableElement(element){return ['table','td','th'].indexOf(getNodeName(element))>=0;} + +function getDocumentElement(element){// $FlowFixMe[incompatible-return]: assume body is always available +return ((isElement(element)?element.ownerDocument:// $FlowFixMe[prop-missing] +element.document)||window.document).documentElement;} + +function getParentNode(element){if(getNodeName(element)==='html'){return element;}return(// this is a quicker (but less type safe) way to save quite some bytes from the bundle +// $FlowFixMe[incompatible-return] +// $FlowFixMe[prop-missing] +element.assignedSlot||// step into the shadow DOM of the parent of a slotted node +element.parentNode||(// DOM Element detected +isShadowRoot(element)?element.host:null)||// ShadowRoot detected +// $FlowFixMe[incompatible-call]: HTMLElement is a Node +getDocumentElement(element)// fallback +);} + +function getTrueOffsetParent(element){if(!isHTMLElement(element)||// https://github.com/popperjs/popper-core/issues/837 +getComputedStyle(element).position==='fixed'){return null;}return element.offsetParent;}// `.offsetParent` reports `null` for fixed elements, while absolute elements +// return the containing block +function getContainingBlock(element){var isFirefox=navigator.userAgent.toLowerCase().indexOf('firefox')!==-1;var isIE=navigator.userAgent.indexOf('Trident')!==-1;if(isIE&&isHTMLElement(element)){// In IE 9, 10 and 11 fixed elements containing block is always established by the viewport +var elementCss=getComputedStyle(element);if(elementCss.position==='fixed'){return null;}}var currentNode=getParentNode(element);while(isHTMLElement(currentNode)&&['html','body'].indexOf(getNodeName(currentNode))<0){var css=getComputedStyle(currentNode);// This is non-exhaustive but covers the most common CSS properties that +// create a containing block. +// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block +if(css.transform!=='none'||css.perspective!=='none'||css.contain==='paint'||['transform','perspective'].indexOf(css.willChange)!==-1||isFirefox&&css.willChange==='filter'||isFirefox&&css.filter&&css.filter!=='none'){return currentNode;}else {currentNode=currentNode.parentNode;}}return null;}// Gets the closest ancestor positioned element. Handles some edge cases, +// such as table ancestors and cross browser bugs. +function getOffsetParent(element){var window=getWindow(element);var offsetParent=getTrueOffsetParent(element);while(offsetParent&&isTableElement(offsetParent)&&getComputedStyle(offsetParent).position==='static'){offsetParent=getTrueOffsetParent(offsetParent);}if(offsetParent&&(getNodeName(offsetParent)==='html'||getNodeName(offsetParent)==='body'&&getComputedStyle(offsetParent).position==='static')){return window;}return offsetParent||getContainingBlock(element)||window;} - function input_input_handler(each_value, i) { - each_value[i].amount = to_number(this.value); - $$invalidate(0, lines); - } +function getMainAxisFromPlacement(placement){return ['top','bottom'].indexOf(placement)>=0?'x':'y';} - $$self.$$set = $$props => { - if ("currencySymbol" in $$props) $$invalidate(1, currencySymbol = $$props.currencySymbol); - if ("txCache" in $$props) $$invalidate(2, txCache = $$props.txCache); - if ("lines" in $$props) $$invalidate(0, lines = $$props.lines); - }; +var max=Math.max;var min=Math.min;var round=Math.round; - $$self.$$.update = () => { - if ($$self.$$.dirty & /*lines*/ 1) { - $$invalidate(3, remainder = (-1 * lines.map(({ amount }) => amount).reduce((prev, curr) => curr + prev, 0)).toFixed(2)); - } - }; +function within(min$1,value,max$1){return max(min$1,min(value,max$1));} - return [ - lines, - currencySymbol, - txCache, - remainder, - addRow, - removeRow, - formatAmount, - click_handler, - textsuggest_value_binding, - input_input_handler - ]; -} +function getFreshSideObject(){return {top:0,right:0,bottom:0,left:0};} -class ExpenseLinesInput extends SvelteComponent { - constructor(options) { - super(); - if (!document.getElementById("svelte-gbs5xa-style")) add_css$7(); - init$1(this, options, instance$8, create_fragment$8, safe_not_equal, { currencySymbol: 1, txCache: 2, lines: 0 }); - } -} +function mergePaddingObject(paddingObject){return Object.assign({},getFreshSideObject(),paddingObject);} -/* src/ui/AddExpenseUI.svelte generated by Svelte v3.32.3 */ +function expandToHashMap(value,keys){return keys.reduce(function(hashMap,key){hashMap[key]=value;return hashMap;},{});} -function add_css$8() { - var style = element("style"); - style.id = "svelte-14kuf5p-style"; - style.textContent = ".form-row.svelte-14kuf5p{padding:5px 0;display:flex}"; - append(document.head, style); -} +var toPaddingObject=function toPaddingObject(padding,state){padding=typeof padding==='function'?padding(Object.assign({},state.rects,{placement:state.placement})):padding;return mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));};function arrow(_ref){var _state$modifiersData$;var state=_ref.state,name=_ref.name,options=_ref.options;var arrowElement=state.elements.arrow;var popperOffsets=state.modifiersData.popperOffsets;var basePlacement=getBasePlacement(state.placement);var axis=getMainAxisFromPlacement(basePlacement);var isVertical=[left,right].indexOf(basePlacement)>=0;var len=isVertical?'height':'width';if(!arrowElement||!popperOffsets){return;}var paddingObject=toPaddingObject(options.padding,state);var arrowRect=getLayoutRect(arrowElement);var minProp=axis==='y'?top:left;var maxProp=axis==='y'?bottom:right;var endDiff=state.rects.reference[len]+state.rects.reference[axis]-popperOffsets[axis]-state.rects.popper[len];var startDiff=popperOffsets[axis]-state.rects.reference[axis];var arrowOffsetParent=getOffsetParent(arrowElement);var clientSize=arrowOffsetParent?axis==='y'?arrowOffsetParent.clientHeight||0:arrowOffsetParent.clientWidth||0:0;var centerToReference=endDiff/2-startDiff/2;// Make sure the arrow doesn't overflow the popper if the center point is +// outside of the popper bounds +var min=paddingObject[minProp];var max=clientSize-arrowRect[len]-paddingObject[maxProp];var center=clientSize/2-arrowRect[len]/2+centerToReference;var offset=within(min,center,max);// Prevents breaking syntax highlighting... +var axisProp=axis;state.modifiersData[name]=(_state$modifiersData$={},_state$modifiersData$[axisProp]=offset,_state$modifiersData$.centerOffset=offset-center,_state$modifiersData$);}function effect$1(_ref2){var state=_ref2.state,options=_ref2.options;var _options$element=options.element,arrowElement=_options$element===void 0?'[data-popper-arrow]':_options$element;if(arrowElement==null){return;}// CSS selector +if(typeof arrowElement==='string'){arrowElement=state.elements.popper.querySelector(arrowElement);if(!arrowElement){return;}}{if(!isHTMLElement(arrowElement)){console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).','To use an SVG arrow, wrap it in an HTMLElement that will be used as','the arrow.'].join(' '));}}if(!contains(state.elements.popper,arrowElement)){{console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper','element.'].join(' '));}return;}state.elements.arrow=arrowElement;}// eslint-disable-next-line import/no-unused-modules +var arrow$1 = {name:'arrow',enabled:true,phase:'main',fn:arrow,effect:effect$1,requires:['popperOffsets'],requiresIfExists:['preventOverflow']}; -function create_fragment$9(ctx) { - let h2; - let t1; - let div1; - let calendar; - let updating_selectedId; - let t2; - let div0; - let textsuggest; - let updating_value; - let t3; - let expenselinesinput; - let t4; - let button; - let current; - let mounted; - let dispose; +var unsetSides={top:'auto',right:'auto',bottom:'auto',left:'auto'};// Round the offsets to the nearest suitable subpixel based on the DPR. +// Zooming can change the DPR, but it seems to report a value that will +// cleanly divide the values into the appropriate subpixels. +function roundOffsetsByDPR(_ref){var x=_ref.x,y=_ref.y;var win=window;var dpr=win.devicePixelRatio||1;return {x:round(round(x*dpr)/dpr)||0,y:round(round(y*dpr)/dpr)||0};}function mapToStyles(_ref2){var _Object$assign2;var popper=_ref2.popper,popperRect=_ref2.popperRect,placement=_ref2.placement,offsets=_ref2.offsets,position=_ref2.position,gpuAcceleration=_ref2.gpuAcceleration,adaptive=_ref2.adaptive,roundOffsets=_ref2.roundOffsets;var _ref3=roundOffsets===true?roundOffsetsByDPR(offsets):typeof roundOffsets==='function'?roundOffsets(offsets):offsets,_ref3$x=_ref3.x,x=_ref3$x===void 0?0:_ref3$x,_ref3$y=_ref3.y,y=_ref3$y===void 0?0:_ref3$y;var hasX=offsets.hasOwnProperty('x');var hasY=offsets.hasOwnProperty('y');var sideX=left;var sideY=top;var win=window;if(adaptive){var offsetParent=getOffsetParent(popper);var heightProp='clientHeight';var widthProp='clientWidth';if(offsetParent===getWindow(popper)){offsetParent=getDocumentElement(popper);if(getComputedStyle(offsetParent).position!=='static'){heightProp='scrollHeight';widthProp='scrollWidth';}}// $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it +offsetParent=offsetParent;if(placement===top){sideY=bottom;// $FlowFixMe[prop-missing] +y-=offsetParent[heightProp]-popperRect.height;y*=gpuAcceleration?1:-1;}if(placement===left){sideX=right;// $FlowFixMe[prop-missing] +x-=offsetParent[widthProp]-popperRect.width;x*=gpuAcceleration?1:-1;}}var commonStyles=Object.assign({position:position},adaptive&&unsetSides);if(gpuAcceleration){var _Object$assign;return Object.assign({},commonStyles,(_Object$assign={},_Object$assign[sideY]=hasY?'0':'',_Object$assign[sideX]=hasX?'0':'',_Object$assign.transform=(win.devicePixelRatio||1)<2?"translate("+x+"px, "+y+"px)":"translate3d("+x+"px, "+y+"px, 0)",_Object$assign));}return Object.assign({},commonStyles,(_Object$assign2={},_Object$assign2[sideY]=hasY?y+"px":'',_Object$assign2[sideX]=hasX?x+"px":'',_Object$assign2.transform='',_Object$assign2));}function computeStyles(_ref4){var state=_ref4.state,options=_ref4.options;var _options$gpuAccelerat=options.gpuAcceleration,gpuAcceleration=_options$gpuAccelerat===void 0?true:_options$gpuAccelerat,_options$adaptive=options.adaptive,adaptive=_options$adaptive===void 0?true:_options$adaptive,_options$roundOffsets=options.roundOffsets,roundOffsets=_options$roundOffsets===void 0?true:_options$roundOffsets;{var transitionProperty=getComputedStyle(state.elements.popper).transitionProperty||'';if(adaptive&&['transform','top','right','bottom','left'].some(function(property){return transitionProperty.indexOf(property)>=0;})){console.warn(['Popper: Detected CSS transitions on at least one of the following','CSS properties: "transform", "top", "right", "bottom", "left".','\n\n','Disable the "computeStyles" modifier\'s `adaptive` option to allow','for smooth transitions, or remove these properties from the CSS','transition declaration on the popper element if only transitioning','opacity or background-color for example.','\n\n','We recommend using the popper element as a wrapper around an inner','element that can have any CSS property transitioned for animations.'].join(' '));}}var commonStyles={placement:getBasePlacement(state.placement),popper:state.elements.popper,popperRect:state.rects.popper,gpuAcceleration:gpuAcceleration};if(state.modifiersData.popperOffsets!=null){state.styles.popper=Object.assign({},state.styles.popper,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.popperOffsets,position:state.options.strategy,adaptive:adaptive,roundOffsets:roundOffsets})));}if(state.modifiersData.arrow!=null){state.styles.arrow=Object.assign({},state.styles.arrow,mapToStyles(Object.assign({},commonStyles,{offsets:state.modifiersData.arrow,position:'absolute',adaptive:false,roundOffsets:roundOffsets})));}state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-placement':state.placement});}// eslint-disable-next-line import/no-unused-modules +var computeStyles$1 = {name:'computeStyles',enabled:true,phase:'beforeWrite',fn:computeStyles,data:{}}; + +var passive={passive:true};function effect$2(_ref){var state=_ref.state,instance=_ref.instance,options=_ref.options;var _options$scroll=options.scroll,scroll=_options$scroll===void 0?true:_options$scroll,_options$resize=options.resize,resize=_options$resize===void 0?true:_options$resize;var window=getWindow(state.elements.popper);var scrollParents=[].concat(state.scrollParents.reference,state.scrollParents.popper);if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.addEventListener('scroll',instance.update,passive);});}if(resize){window.addEventListener('resize',instance.update,passive);}return function(){if(scroll){scrollParents.forEach(function(scrollParent){scrollParent.removeEventListener('scroll',instance.update,passive);});}if(resize){window.removeEventListener('resize',instance.update,passive);}};}// eslint-disable-next-line import/no-unused-modules +var eventListeners = {name:'eventListeners',enabled:true,phase:'write',fn:function fn(){},effect:effect$2,data:{}}; + +var hash={left:'right',right:'left',bottom:'top',top:'bottom'};function getOppositePlacement(placement){return placement.replace(/left|right|bottom|top/g,function(matched){return hash[matched];});} + +var hash$1={start:'end',end:'start'};function getOppositeVariationPlacement(placement){return placement.replace(/start|end/g,function(matched){return hash$1[matched];});} + +function getWindowScroll(node){var win=getWindow(node);var scrollLeft=win.pageXOffset;var scrollTop=win.pageYOffset;return {scrollLeft:scrollLeft,scrollTop:scrollTop};} + +function getWindowScrollBarX(element){// If has a CSS width greater than the viewport, then this will be +// incorrect for RTL. +// Popper 1 is broken in this case and never had a bug report so let's assume +// it's not an issue. I don't think anyone ever specifies width on +// anyway. +// Browsers where the left scrollbar doesn't cause an issue report `0` for +// this (e.g. Edge 2019, IE11, Safari) +return getBoundingClientRect(getDocumentElement(element)).left+getWindowScroll(element).scrollLeft;} + +function getViewportRect(element){var win=getWindow(element);var html=getDocumentElement(element);var visualViewport=win.visualViewport;var width=html.clientWidth;var height=html.clientHeight;var x=0;var y=0;// NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper +// can be obscured underneath it. +// Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even +// if it isn't open, so if this isn't available, the popper will be detected +// to overflow the bottom of the screen too early. +if(visualViewport){width=visualViewport.width;height=visualViewport.height;// Uses Layout Viewport (like Chrome; Safari does not currently) +// In Chrome, it returns a value very close to 0 (+/-) but contains rounding +// errors due to floating point numbers, so we need to check precision. +// Safari returns a number <= 0, usually < -1 when pinch-zoomed +// Feature detection fails in mobile emulation mode in Chrome. +// Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < +// 0.001 +// Fallback here: "Not Safari" userAgent +if(!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)){x=visualViewport.offsetLeft;y=visualViewport.offsetTop;}}return {width:width,height:height,x:x+getWindowScrollBarX(element),y:y};} - function calendar_selectedId_binding(value) { - /*calendar_selectedId_binding*/ ctx[10](value); - } +// of the `` and `` rect bounds if horizontally scrollable +function getDocumentRect(element){var _element$ownerDocumen;var html=getDocumentElement(element);var winScroll=getWindowScroll(element);var body=(_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body;var width=max(html.scrollWidth,html.clientWidth,body?body.scrollWidth:0,body?body.clientWidth:0);var height=max(html.scrollHeight,html.clientHeight,body?body.scrollHeight:0,body?body.clientHeight:0);var x=-winScroll.scrollLeft+getWindowScrollBarX(element);var y=-winScroll.scrollTop;if(getComputedStyle(body||html).direction==='rtl'){x+=max(html.clientWidth,body?body.clientWidth:0)-width;}return {width:width,height:height,x:x,y:y};} - let calendar_props = { - today: /*today*/ ctx[4], - onClickDay: /*selectDay*/ ctx[6], - showWeekNums: false - }; +function isScrollParent(element){// Firefox wants us to check `-x` and `-y` variations as well +var _getComputedStyle=getComputedStyle(element),overflow=_getComputedStyle.overflow,overflowX=_getComputedStyle.overflowX,overflowY=_getComputedStyle.overflowY;return /auto|scroll|overlay|hidden/.test(overflow+overflowY+overflowX);} - if (/*selectedDay*/ ctx[2] !== void 0) { - calendar_props.selectedId = /*selectedDay*/ ctx[2]; - } +function getScrollParent(node){if(['html','body','#document'].indexOf(getNodeName(node))>=0){// $FlowFixMe[incompatible-return]: assume body is always available +return node.ownerDocument.body;}if(isHTMLElement(node)&&isScrollParent(node)){return node;}return getScrollParent(getParentNode(node));} - calendar = new Calendar({ props: calendar_props }); - binding_callbacks.push(() => bind(calendar, "selectedId", calendar_selectedId_binding)); +/* +given a DOM element, return the list of all scroll parents, up the list of ancesors +until we get to the top window object. This list is what we attach scroll listeners +to, because if any of these parent elements scroll, we'll need to re-calculate the +reference element's position. +*/function listScrollParents(element,list){var _element$ownerDocumen;if(list===void 0){list=[];}var scrollParent=getScrollParent(element);var isBody=scrollParent===((_element$ownerDocumen=element.ownerDocument)==null?void 0:_element$ownerDocumen.body);var win=getWindow(scrollParent);var target=isBody?[win].concat(win.visualViewport||[],isScrollParent(scrollParent)?scrollParent:[]):scrollParent;var updatedList=list.concat(target);return isBody?updatedList:// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here +updatedList.concat(listScrollParents(getParentNode(target)));} - function textsuggest_value_binding(value) { - /*textsuggest_value_binding*/ ctx[11](value); - } +function rectToClientRect(rect){return Object.assign({},rect,{left:rect.x,top:rect.y,right:rect.x+rect.width,bottom:rect.y+rect.height});} - let textsuggest_props = { - placeholder: "Payee", - suggestions: /*txCache*/ ctx[1].payees, - classes: "expense-payee" - }; +function getInnerBoundingClientRect(element){var rect=getBoundingClientRect(element);rect.top=rect.top+element.clientTop;rect.left=rect.left+element.clientLeft;rect.bottom=rect.top+element.clientHeight;rect.right=rect.left+element.clientWidth;rect.width=element.clientWidth;rect.height=element.clientHeight;rect.x=rect.left;rect.y=rect.top;return rect;}function getClientRectFromMixedType(element,clippingParent){return clippingParent===viewport?rectToClientRect(getViewportRect(element)):isHTMLElement(clippingParent)?getInnerBoundingClientRect(clippingParent):rectToClientRect(getDocumentRect(getDocumentElement(element)));}// A "clipping parent" is an overflowable container with the characteristic of +// clipping (or hiding) overflowing elements with a position different from +// `initial` +function getClippingParents(element){var clippingParents=listScrollParents(getParentNode(element));var canEscapeClipping=['absolute','fixed'].indexOf(getComputedStyle(element).position)>=0;var clipperElement=canEscapeClipping&&isHTMLElement(element)?getOffsetParent(element):element;if(!isElement(clipperElement)){return [];}// $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414 +return clippingParents.filter(function(clippingParent){return isElement(clippingParent)&&contains(clippingParent,clipperElement)&&getNodeName(clippingParent)!=='body';});}// Gets the maximum area that the element is visible in due to any number of +// clipping parents +function getClippingRect(element,boundary,rootBoundary){var mainClippingParents=boundary==='clippingParents'?getClippingParents(element):[].concat(boundary);var clippingParents=[].concat(mainClippingParents,[rootBoundary]);var firstClippingParent=clippingParents[0];var clippingRect=clippingParents.reduce(function(accRect,clippingParent){var rect=getClientRectFromMixedType(element,clippingParent);accRect.top=max(rect.top,accRect.top);accRect.right=min(rect.right,accRect.right);accRect.bottom=min(rect.bottom,accRect.bottom);accRect.left=max(rect.left,accRect.left);return accRect;},getClientRectFromMixedType(element,firstClippingParent));clippingRect.width=clippingRect.right-clippingRect.left;clippingRect.height=clippingRect.bottom-clippingRect.top;clippingRect.x=clippingRect.left;clippingRect.y=clippingRect.top;return clippingRect;} - if (/*payee*/ ctx[3] !== void 0) { - textsuggest_props.value = /*payee*/ ctx[3]; - } +function getVariation(placement){return placement.split('-')[1];} - textsuggest = new TextSuggest({ props: textsuggest_props }); - binding_callbacks.push(() => bind(textsuggest, "value", textsuggest_value_binding)); +function computeOffsets(_ref){var reference=_ref.reference,element=_ref.element,placement=_ref.placement;var basePlacement=placement?getBasePlacement(placement):null;var variation=placement?getVariation(placement):null;var commonX=reference.x+reference.width/2-element.width/2;var commonY=reference.y+reference.height/2-element.height/2;var offsets;switch(basePlacement){case top:offsets={x:commonX,y:reference.y-element.height};break;case bottom:offsets={x:commonX,y:reference.y+reference.height};break;case right:offsets={x:reference.x+reference.width,y:commonY};break;case left:offsets={x:reference.x-element.width,y:commonY};break;default:offsets={x:reference.x,y:reference.y};}var mainAxis=basePlacement?getMainAxisFromPlacement(basePlacement):null;if(mainAxis!=null){var len=mainAxis==='y'?'height':'width';switch(variation){case start$1:offsets[mainAxis]=offsets[mainAxis]-(reference[len]/2-element[len]/2);break;case end:offsets[mainAxis]=offsets[mainAxis]+(reference[len]/2-element[len]/2);break;}}return offsets;} - expenselinesinput = new ExpenseLinesInput({ - props: { - currencySymbol: /*currencySymbol*/ ctx[0], - txCache: /*txCache*/ ctx[1], - lines: /*lines*/ ctx[5] - } - }); +function detectOverflow(state,options){if(options===void 0){options={};}var _options=options,_options$placement=_options.placement,placement=_options$placement===void 0?state.placement:_options$placement,_options$boundary=_options.boundary,boundary=_options$boundary===void 0?clippingParents:_options$boundary,_options$rootBoundary=_options.rootBoundary,rootBoundary=_options$rootBoundary===void 0?viewport:_options$rootBoundary,_options$elementConte=_options.elementContext,elementContext=_options$elementConte===void 0?popper:_options$elementConte,_options$altBoundary=_options.altBoundary,altBoundary=_options$altBoundary===void 0?false:_options$altBoundary,_options$padding=_options.padding,padding=_options$padding===void 0?0:_options$padding;var paddingObject=mergePaddingObject(typeof padding!=='number'?padding:expandToHashMap(padding,basePlacements));var altContext=elementContext===popper?reference:popper;var referenceElement=state.elements.reference;var popperRect=state.rects.popper;var element=state.elements[altBoundary?altContext:elementContext];var clippingClientRect=getClippingRect(isElement(element)?element:element.contextElement||getDocumentElement(state.elements.popper),boundary,rootBoundary);var referenceClientRect=getBoundingClientRect(referenceElement);var popperOffsets=computeOffsets({reference:referenceClientRect,element:popperRect,strategy:'absolute',placement:placement});var popperClientRect=rectToClientRect(Object.assign({},popperRect,popperOffsets));var elementClientRect=elementContext===popper?popperClientRect:referenceClientRect;// positive = overflowing the clipping rect +// 0 or negative = within the clipping rect +var overflowOffsets={top:clippingClientRect.top-elementClientRect.top+paddingObject.top,bottom:elementClientRect.bottom-clippingClientRect.bottom+paddingObject.bottom,left:clippingClientRect.left-elementClientRect.left+paddingObject.left,right:elementClientRect.right-clippingClientRect.right+paddingObject.right};var offsetData=state.modifiersData.offset;// Offsets can be applied only to the popper element +if(elementContext===popper&&offsetData){var offset=offsetData[placement];Object.keys(overflowOffsets).forEach(function(key){var multiply=[right,bottom].indexOf(key)>=0?1:-1;var axis=[top,bottom].indexOf(key)>=0?'y':'x';overflowOffsets[key]+=offset[axis]*multiply;});}return overflowOffsets;} - return { - c() { - h2 = element("h2"); - h2.textContent = "Add to Ledger"; - t1 = space(); - div1 = element("div"); - create_component(calendar.$$.fragment); - t2 = space(); - div0 = element("div"); - create_component(textsuggest.$$.fragment); - t3 = space(); - create_component(expenselinesinput.$$.fragment); - t4 = space(); - button = element("button"); - button.textContent = "Save"; - attr(div0, "class", "form-row svelte-14kuf5p"); - attr(div1, "class", "ledger-add-expense-form"); - }, - m(target, anchor) { - insert(target, h2, anchor); - insert(target, t1, anchor); - insert(target, div1, anchor); - mount_component(calendar, div1, null); - append(div1, t2); - append(div1, div0); - mount_component(textsuggest, div0, null); - append(div1, t3); - mount_component(expenselinesinput, div1, null); - append(div1, t4); - append(div1, button); - current = true; +function computeAutoPlacement(state,options){if(options===void 0){options={};}var _options=options,placement=_options.placement,boundary=_options.boundary,rootBoundary=_options.rootBoundary,padding=_options.padding,flipVariations=_options.flipVariations,_options$allowedAutoP=_options.allowedAutoPlacements,allowedAutoPlacements=_options$allowedAutoP===void 0?placements:_options$allowedAutoP;var variation=getVariation(placement);var placements$1=variation?flipVariations?variationPlacements:variationPlacements.filter(function(placement){return getVariation(placement)===variation;}):basePlacements;var allowedPlacements=placements$1.filter(function(placement){return allowedAutoPlacements.indexOf(placement)>=0;});if(allowedPlacements.length===0){allowedPlacements=placements$1;{console.error(['Popper: The `allowedAutoPlacements` option did not allow any','placements. Ensure the `placement` option matches the variation','of the allowed placements.','For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(' '));}}// $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions... +var overflows=allowedPlacements.reduce(function(acc,placement){acc[placement]=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding})[getBasePlacement(placement)];return acc;},{});return Object.keys(overflows).sort(function(a,b){return overflows[a]-overflows[b];});} - if (!mounted) { - dispose = listen(button, "click", /*save*/ ctx[7]); - mounted = true; - } - }, - p(ctx, [dirty]) { - const calendar_changes = {}; +function getExpandedFallbackPlacements(placement){if(getBasePlacement(placement)===auto){return [];}var oppositePlacement=getOppositePlacement(placement);return [getOppositeVariationPlacement(placement),oppositePlacement,getOppositeVariationPlacement(oppositePlacement)];}function flip(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;if(state.modifiersData[name]._skip){return;}var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?true:_options$altAxis,specifiedFallbackPlacements=options.fallbackPlacements,padding=options.padding,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,_options$flipVariatio=options.flipVariations,flipVariations=_options$flipVariatio===void 0?true:_options$flipVariatio,allowedAutoPlacements=options.allowedAutoPlacements;var preferredPlacement=state.options.placement;var basePlacement=getBasePlacement(preferredPlacement);var isBasePlacement=basePlacement===preferredPlacement;var fallbackPlacements=specifiedFallbackPlacements||(isBasePlacement||!flipVariations?[getOppositePlacement(preferredPlacement)]:getExpandedFallbackPlacements(preferredPlacement));var placements=[preferredPlacement].concat(fallbackPlacements).reduce(function(acc,placement){return acc.concat(getBasePlacement(placement)===auto?computeAutoPlacement(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,padding:padding,flipVariations:flipVariations,allowedAutoPlacements:allowedAutoPlacements}):placement);},[]);var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var checksMap=new Map();var makeFallbackChecks=true;var firstFittingPlacement=placements[0];for(var i=0;i=0;var len=isVertical?'width':'height';var overflow=detectOverflow(state,{placement:placement,boundary:boundary,rootBoundary:rootBoundary,altBoundary:altBoundary,padding:padding});var mainVariationSide=isVertical?isStartVariation?right:left:isStartVariation?bottom:top;if(referenceRect[len]>popperRect[len]){mainVariationSide=getOppositePlacement(mainVariationSide);}var altVariationSide=getOppositePlacement(mainVariationSide);var checks=[];if(checkMainAxis){checks.push(overflow[_basePlacement]<=0);}if(checkAltAxis){checks.push(overflow[mainVariationSide]<=0,overflow[altVariationSide]<=0);}if(checks.every(function(check){return check;})){firstFittingPlacement=placement;makeFallbackChecks=false;break;}checksMap.set(placement,checks);}if(makeFallbackChecks){// `2` may be desired in some cases – research later +var numberOfChecks=flipVariations?3:1;var _loop=function _loop(_i){var fittingPlacement=placements.find(function(placement){var checks=checksMap.get(placement);if(checks){return checks.slice(0,_i).every(function(check){return check;});}});if(fittingPlacement){firstFittingPlacement=fittingPlacement;return "break";}};for(var _i=numberOfChecks;_i>0;_i--){var _ret=_loop(_i);if(_ret==="break")break;}}if(state.placement!==firstFittingPlacement){state.modifiersData[name]._skip=true;state.placement=firstFittingPlacement;state.reset=true;}}// eslint-disable-next-line import/no-unused-modules +var flip$1 = {name:'flip',enabled:true,phase:'main',fn:flip,requiresIfExists:['offset'],data:{_skip:false}}; - if (!updating_selectedId && dirty & /*selectedDay*/ 4) { - updating_selectedId = true; - calendar_changes.selectedId = /*selectedDay*/ ctx[2]; - add_flush_callback(() => updating_selectedId = false); - } +function getSideOffsets(overflow,rect,preventedOffsets){if(preventedOffsets===void 0){preventedOffsets={x:0,y:0};}return {top:overflow.top-rect.height-preventedOffsets.y,right:overflow.right-rect.width+preventedOffsets.x,bottom:overflow.bottom-rect.height+preventedOffsets.y,left:overflow.left-rect.width-preventedOffsets.x};}function isAnySideFullyClipped(overflow){return [top,right,bottom,left].some(function(side){return overflow[side]>=0;});}function hide(_ref){var state=_ref.state,name=_ref.name;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var preventedOffsets=state.modifiersData.preventOverflow;var referenceOverflow=detectOverflow(state,{elementContext:'reference'});var popperAltOverflow=detectOverflow(state,{altBoundary:true});var referenceClippingOffsets=getSideOffsets(referenceOverflow,referenceRect);var popperEscapeOffsets=getSideOffsets(popperAltOverflow,popperRect,preventedOffsets);var isReferenceHidden=isAnySideFullyClipped(referenceClippingOffsets);var hasPopperEscaped=isAnySideFullyClipped(popperEscapeOffsets);state.modifiersData[name]={referenceClippingOffsets:referenceClippingOffsets,popperEscapeOffsets:popperEscapeOffsets,isReferenceHidden:isReferenceHidden,hasPopperEscaped:hasPopperEscaped};state.attributes.popper=Object.assign({},state.attributes.popper,{'data-popper-reference-hidden':isReferenceHidden,'data-popper-escaped':hasPopperEscaped});}// eslint-disable-next-line import/no-unused-modules +var hide$1 = {name:'hide',enabled:true,phase:'main',requiresIfExists:['preventOverflow'],fn:hide}; - calendar.$set(calendar_changes); - const textsuggest_changes = {}; - if (dirty & /*txCache*/ 2) textsuggest_changes.suggestions = /*txCache*/ ctx[1].payees; +function distanceAndSkiddingToXY(placement,rects,offset){var basePlacement=getBasePlacement(placement);var invertDistance=[left,top].indexOf(basePlacement)>=0?-1:1;var _ref=typeof offset==='function'?offset(Object.assign({},rects,{placement:placement})):offset,skidding=_ref[0],distance=_ref[1];skidding=skidding||0;distance=(distance||0)*invertDistance;return [left,right].indexOf(basePlacement)>=0?{x:distance,y:skidding}:{x:skidding,y:distance};}function offset(_ref2){var state=_ref2.state,options=_ref2.options,name=_ref2.name;var _options$offset=options.offset,offset=_options$offset===void 0?[0,0]:_options$offset;var data=placements.reduce(function(acc,placement){acc[placement]=distanceAndSkiddingToXY(placement,state.rects,offset);return acc;},{});var _data$state$placement=data[state.placement],x=_data$state$placement.x,y=_data$state$placement.y;if(state.modifiersData.popperOffsets!=null){state.modifiersData.popperOffsets.x+=x;state.modifiersData.popperOffsets.y+=y;}state.modifiersData[name]=data;}// eslint-disable-next-line import/no-unused-modules +var offset$1 = {name:'offset',enabled:true,phase:'main',requires:['popperOffsets'],fn:offset}; - if (!updating_value && dirty & /*payee*/ 8) { - updating_value = true; - textsuggest_changes.value = /*payee*/ ctx[3]; - add_flush_callback(() => updating_value = false); - } +function popperOffsets(_ref){var state=_ref.state,name=_ref.name;// Offsets are the actual position the popper needs to have to be +// properly positioned near its reference element +// This is the most basic placement, and will be adjusted by +// the modifiers in the next step +state.modifiersData[name]=computeOffsets({reference:state.rects.reference,element:state.rects.popper,strategy:'absolute',placement:state.placement});}// eslint-disable-next-line import/no-unused-modules +var popperOffsets$1 = {name:'popperOffsets',enabled:true,phase:'read',fn:popperOffsets,data:{}}; - textsuggest.$set(textsuggest_changes); - const expenselinesinput_changes = {}; - if (dirty & /*currencySymbol*/ 1) expenselinesinput_changes.currencySymbol = /*currencySymbol*/ ctx[0]; - if (dirty & /*txCache*/ 2) expenselinesinput_changes.txCache = /*txCache*/ ctx[1]; - expenselinesinput.$set(expenselinesinput_changes); - }, - i(local) { - if (current) return; - transition_in(calendar.$$.fragment, local); - transition_in(textsuggest.$$.fragment, local); - transition_in(expenselinesinput.$$.fragment, local); - current = true; - }, - o(local) { - transition_out(calendar.$$.fragment, local); - transition_out(textsuggest.$$.fragment, local); - transition_out(expenselinesinput.$$.fragment, local); - current = false; - }, - d(detaching) { - if (detaching) detach(h2); - if (detaching) detach(t1); - if (detaching) detach(div1); - destroy_component(calendar); - destroy_component(textsuggest); - destroy_component(expenselinesinput); - mounted = false; - dispose(); - } - }; -} +function getAltAxis(axis){return axis==='x'?'y':'x';} -function instance$9($$self, $$props, $$invalidate) { - - - let { currencySymbol } = $$props; - let { txCache } = $$props; - let { saveFn } = $$props; - let { close } = $$props; - let today = window.moment(); - let selectedDay; - let payee; +function preventOverflow(_ref){var state=_ref.state,options=_ref.options,name=_ref.name;var _options$mainAxis=options.mainAxis,checkMainAxis=_options$mainAxis===void 0?true:_options$mainAxis,_options$altAxis=options.altAxis,checkAltAxis=_options$altAxis===void 0?false:_options$altAxis,boundary=options.boundary,rootBoundary=options.rootBoundary,altBoundary=options.altBoundary,padding=options.padding,_options$tether=options.tether,tether=_options$tether===void 0?true:_options$tether,_options$tetherOffset=options.tetherOffset,tetherOffset=_options$tetherOffset===void 0?0:_options$tetherOffset;var overflow=detectOverflow(state,{boundary:boundary,rootBoundary:rootBoundary,padding:padding,altBoundary:altBoundary});var basePlacement=getBasePlacement(state.placement);var variation=getVariation(state.placement);var isBasePlacement=!variation;var mainAxis=getMainAxisFromPlacement(basePlacement);var altAxis=getAltAxis(mainAxis);var popperOffsets=state.modifiersData.popperOffsets;var referenceRect=state.rects.reference;var popperRect=state.rects.popper;var tetherOffsetValue=typeof tetherOffset==='function'?tetherOffset(Object.assign({},state.rects,{placement:state.placement})):tetherOffset;var data={x:0,y:0};if(!popperOffsets){return;}if(checkMainAxis||checkAltAxis){var mainSide=mainAxis==='y'?top:left;var altSide=mainAxis==='y'?bottom:right;var len=mainAxis==='y'?'height':'width';var offset=popperOffsets[mainAxis];var min$1=popperOffsets[mainAxis]+overflow[mainSide];var max$1=popperOffsets[mainAxis]-overflow[altSide];var additive=tether?-popperRect[len]/2:0;var minLen=variation===start$1?referenceRect[len]:popperRect[len];var maxLen=variation===start$1?-popperRect[len]:-referenceRect[len];// We need to include the arrow in the calculation so the arrow doesn't go +// outside the reference bounds +var arrowElement=state.elements.arrow;var arrowRect=tether&&arrowElement?getLayoutRect(arrowElement):{width:0,height:0};var arrowPaddingObject=state.modifiersData['arrow#persistent']?state.modifiersData['arrow#persistent'].padding:getFreshSideObject();var arrowPaddingMin=arrowPaddingObject[mainSide];var arrowPaddingMax=arrowPaddingObject[altSide];// If the reference length is smaller than the arrow length, we don't want +// to include its full size in the calculation. If the reference is small +// and near the edge of a boundary, the popper can overflow even if the +// reference is not overflowing as well (e.g. virtual elements with no +// width or height) +var arrowLen=within(0,referenceRect[len],arrowRect[len]);var minOffset=isBasePlacement?referenceRect[len]/2-additive-arrowLen-arrowPaddingMin-tetherOffsetValue:minLen-arrowLen-arrowPaddingMin-tetherOffsetValue;var maxOffset=isBasePlacement?-referenceRect[len]/2+additive+arrowLen+arrowPaddingMax+tetherOffsetValue:maxLen+arrowLen+arrowPaddingMax+tetherOffsetValue;var arrowOffsetParent=state.elements.arrow&&getOffsetParent(state.elements.arrow);var clientOffset=arrowOffsetParent?mainAxis==='y'?arrowOffsetParent.clientTop||0:arrowOffsetParent.clientLeft||0:0;var offsetModifierValue=state.modifiersData.offset?state.modifiersData.offset[state.placement][mainAxis]:0;var tetherMin=popperOffsets[mainAxis]+minOffset-offsetModifierValue-clientOffset;var tetherMax=popperOffsets[mainAxis]+maxOffset-offsetModifierValue;if(checkMainAxis){var preventedOffset=within(tether?min(min$1,tetherMin):min$1,offset,tether?max(max$1,tetherMax):max$1);popperOffsets[mainAxis]=preventedOffset;data[mainAxis]=preventedOffset-offset;}if(checkAltAxis){var _mainSide=mainAxis==='x'?top:left;var _altSide=mainAxis==='x'?bottom:right;var _offset=popperOffsets[altAxis];var _min=_offset+overflow[_mainSide];var _max=_offset-overflow[_altSide];var _preventedOffset=within(tether?min(_min,tetherMin):_min,_offset,tether?max(_max,tetherMax):_max);popperOffsets[altAxis]=_preventedOffset;data[altAxis]=_preventedOffset-_offset;}}state.modifiersData[name]=data;}// eslint-disable-next-line import/no-unused-modules +var preventOverflow$1 = {name:'preventOverflow',enabled:true,phase:'main',fn:preventOverflow,requiresIfExists:['offset']}; - let lines = [ - { - category: "", - amount: 0, - id: 1, - currency: currencySymbol, - reconcile: "", - comment: undefined - }, - { - category: "", - amount: 0, - id: 2, - currency: currencySymbol, - reconcile: "", - comment: undefined - } - ]; +function getHTMLElementScroll(element){return {scrollLeft:element.scrollLeft,scrollTop:element.scrollTop};} - const selectDay = date => { - $$invalidate(2, selectedDay = `day-` + date.startOf("day").format()); - }; +function getNodeScroll(node){if(node===getWindow(node)||!isHTMLElement(node)){return getWindowScroll(node);}else {return getHTMLElementScroll(node);}} - selectDay(window.moment().clone()); +// Composite means it takes into account transforms as well as layout. +function getCompositeRect(elementOrVirtualElement,offsetParent,isFixed){if(isFixed===void 0){isFixed=false;}var documentElement=getDocumentElement(offsetParent);var rect=getBoundingClientRect(elementOrVirtualElement);var isOffsetParentAnElement=isHTMLElement(offsetParent);var scroll={scrollLeft:0,scrollTop:0};var offsets={x:0,y:0};if(isOffsetParentAnElement||!isOffsetParentAnElement&&!isFixed){if(getNodeName(offsetParent)!=='body'||// https://github.com/popperjs/popper-core/issues/1078 +isScrollParent(documentElement)){scroll=getNodeScroll(offsetParent);}if(isHTMLElement(offsetParent)){offsets=getBoundingClientRect(offsetParent);offsets.x+=offsetParent.clientLeft;offsets.y+=offsetParent.clientTop;}else if(documentElement){offsets.x=getWindowScrollBarX(documentElement);}}return {x:rect.left+scroll.scrollLeft-offsets.x,y:rect.top+scroll.scrollTop-offsets.y,width:rect.width,height:rect.height};} + +function order(modifiers){var map=new Map();var visited=new Set();var result=[];modifiers.forEach(function(modifier){map.set(modifier.name,modifier);});// On visiting object, check for its dependencies and visit them recursively +function sort(modifier){visited.add(modifier.name);var requires=[].concat(modifier.requires||[],modifier.requiresIfExists||[]);requires.forEach(function(dep){if(!visited.has(dep)){var depModifier=map.get(dep);if(depModifier){sort(depModifier);}}});result.push(modifier);}modifiers.forEach(function(modifier){if(!visited.has(modifier.name)){// check for visited object +sort(modifier);}});return result;}function orderModifiers(modifiers){// order based on dependencies +var orderedModifiers=order(modifiers);// order based on phase +return modifierPhases.reduce(function(acc,phase){return acc.concat(orderedModifiers.filter(function(modifier){return modifier.phase===phase;}));},[]);} + +function debounce(fn){var pending;return function(){if(!pending){pending=new Promise(function(resolve){Promise.resolve().then(function(){pending=undefined;resolve(fn());});});}return pending;};} + +function format$1(str){for(var _len=arguments.length,args=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){args[_key-1]=arguments[_key];}return [].concat(args).reduce(function(p,c){return p.replace(/%s/,c);},str);} + +var INVALID_MODIFIER_ERROR='Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';var MISSING_DEPENDENCY_ERROR='Popper: modifier "%s" requires "%s", but "%s" modifier is not available';var VALID_PROPERTIES=['name','enabled','phase','fn','effect','requires','options'];function validateModifiers(modifiers){modifiers.forEach(function(modifier){Object.keys(modifier).forEach(function(key){switch(key){case'name':if(typeof modifier.name!=='string'){console.error(format$1(INVALID_MODIFIER_ERROR,String(modifier.name),'"name"','"string"',"\""+String(modifier.name)+"\""));}break;case'enabled':if(typeof modifier.enabled!=='boolean'){console.error(format$1(INVALID_MODIFIER_ERROR,modifier.name,'"enabled"','"boolean"',"\""+String(modifier.enabled)+"\""));}case'phase':if(modifierPhases.indexOf(modifier.phase)<0){console.error(format$1(INVALID_MODIFIER_ERROR,modifier.name,'"phase"',"either "+modifierPhases.join(', '),"\""+String(modifier.phase)+"\""));}break;case'fn':if(typeof modifier.fn!=='function'){console.error(format$1(INVALID_MODIFIER_ERROR,modifier.name,'"fn"','"function"',"\""+String(modifier.fn)+"\""));}break;case'effect':if(typeof modifier.effect!=='function'){console.error(format$1(INVALID_MODIFIER_ERROR,modifier.name,'"effect"','"function"',"\""+String(modifier.fn)+"\""));}break;case'requires':if(!Array.isArray(modifier.requires)){console.error(format$1(INVALID_MODIFIER_ERROR,modifier.name,'"requires"','"array"',"\""+String(modifier.requires)+"\""));}break;case'requiresIfExists':if(!Array.isArray(modifier.requiresIfExists)){console.error(format$1(INVALID_MODIFIER_ERROR,modifier.name,'"requiresIfExists"','"array"',"\""+String(modifier.requiresIfExists)+"\""));}break;case'options':case'data':break;default:console.error("PopperJS: an invalid property has been provided to the \""+modifier.name+"\" modifier, valid properties are "+VALID_PROPERTIES.map(function(s){return "\""+s+"\"";}).join(', ')+"; but \""+key+"\" was provided.");}modifier.requires&&modifier.requires.forEach(function(requirement){if(modifiers.find(function(mod){return mod.name===requirement;})==null){console.error(format$1(MISSING_DEPENDENCY_ERROR,String(modifier.name),requirement,requirement));}});});});} + +function uniqueBy(arr,fn){var identifiers=new Set();return arr.filter(function(item){var identifier=fn(item);if(!identifiers.has(identifier)){identifiers.add(identifier);return true;}});} + +function mergeByName(modifiers){var merged=modifiers.reduce(function(merged,current){var existing=merged[current.name];merged[current.name]=existing?Object.assign({},existing,current,{options:Object.assign({},existing.options,current.options),data:Object.assign({},existing.data,current.data)}):current;return merged;},{});// IE11 does not support Object.values +return Object.keys(merged).map(function(key){return merged[key];});} + +var INVALID_ELEMENT_ERROR='Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.';var INFINITE_LOOP_ERROR='Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.';var DEFAULT_OPTIONS={placement:'bottom',modifiers:[],strategy:'absolute'};function areValidElements(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++){args[_key]=arguments[_key];}return !args.some(function(element){return !(element&&typeof element.getBoundingClientRect==='function');});}function popperGenerator(generatorOptions){if(generatorOptions===void 0){generatorOptions={};}var _generatorOptions=generatorOptions,_generatorOptions$def=_generatorOptions.defaultModifiers,defaultModifiers=_generatorOptions$def===void 0?[]:_generatorOptions$def,_generatorOptions$def2=_generatorOptions.defaultOptions,defaultOptions=_generatorOptions$def2===void 0?DEFAULT_OPTIONS:_generatorOptions$def2;return function createPopper(reference,popper,options){if(options===void 0){options=defaultOptions;}var state={placement:'bottom',orderedModifiers:[],options:Object.assign({},DEFAULT_OPTIONS,defaultOptions),modifiersData:{},elements:{reference:reference,popper:popper},attributes:{},styles:{}};var effectCleanupFns=[];var isDestroyed=false;var instance={state:state,setOptions:function setOptions(options){cleanupModifierEffects();state.options=Object.assign({},defaultOptions,state.options,options);state.scrollParents={reference:isElement(reference)?listScrollParents(reference):reference.contextElement?listScrollParents(reference.contextElement):[],popper:listScrollParents(popper)};// Orders the modifiers based on their dependencies and `phase` +// properties +var orderedModifiers=orderModifiers(mergeByName([].concat(defaultModifiers,state.options.modifiers)));// Strip out disabled modifiers +state.orderedModifiers=orderedModifiers.filter(function(m){return m.enabled;});// Validate the provided modifiers so that the consumer will get warned +// if one of the modifiers is invalid for any reason +{var modifiers=uniqueBy([].concat(orderedModifiers,state.options.modifiers),function(_ref){var name=_ref.name;return name;});validateModifiers(modifiers);if(getBasePlacement(state.options.placement)===auto){var flipModifier=state.orderedModifiers.find(function(_ref2){var name=_ref2.name;return name==='flip';});if(!flipModifier){console.error(['Popper: "auto" placements require the "flip" modifier be','present and enabled to work.'].join(' '));}}var _getComputedStyle=getComputedStyle(popper),marginTop=_getComputedStyle.marginTop,marginRight=_getComputedStyle.marginRight,marginBottom=_getComputedStyle.marginBottom,marginLeft=_getComputedStyle.marginLeft;// We no longer take into account `margins` on the popper, and it can +// cause bugs with positioning, so we'll warn the consumer +if([marginTop,marginRight,marginBottom,marginLeft].some(function(margin){return parseFloat(margin);})){console.warn(['Popper: CSS "margin" styles cannot be used to apply padding','between the popper and its reference element or boundary.','To replicate margin, use the `offset` modifier, as well as','the `padding` option in the `preventOverflow` and `flip`','modifiers.'].join(' '));}}runModifierEffects();return instance.update();},// Sync update – it will always be executed, even if not necessary. This +// is useful for low frequency updates where sync behavior simplifies the +// logic. +// For high frequency updates (e.g. `resize` and `scroll` events), always +// prefer the async Popper#update method +forceUpdate:function forceUpdate(){if(isDestroyed){return;}var _state$elements=state.elements,reference=_state$elements.reference,popper=_state$elements.popper;// Don't proceed if `reference` or `popper` are not valid elements +// anymore +if(!areValidElements(reference,popper)){{console.error(INVALID_ELEMENT_ERROR);}return;}// Store the reference and popper rects to be read by modifiers +state.rects={reference:getCompositeRect(reference,getOffsetParent(popper),state.options.strategy==='fixed'),popper:getLayoutRect(popper)};// Modifiers have the ability to reset the current update cycle. The +// most common use case for this is the `flip` modifier changing the +// placement, which then needs to re-run all the modifiers, because the +// logic was previously ran for the previous placement and is therefore +// stale/incorrect +state.reset=false;state.placement=state.options.placement;// On each update cycle, the `modifiersData` property for each modifier +// is filled with the initial data specified by the modifier. This means +// it doesn't persist and is fresh on each update. +// To ensure persistent data, use `${name}#persistent` +state.orderedModifiers.forEach(function(modifier){return state.modifiersData[modifier.name]=Object.assign({},modifier.data);});var __debug_loops__=0;for(var index=0;index100){console.error(INFINITE_LOOP_ERROR);break;}}if(state.reset===true){state.reset=false;index=-1;continue;}var _state$orderedModifie=state.orderedModifiers[index],fn=_state$orderedModifie.fn,_state$orderedModifie2=_state$orderedModifie.options,_options=_state$orderedModifie2===void 0?{}:_state$orderedModifie2,name=_state$orderedModifie.name;if(typeof fn==='function'){state=fn({state:state,options:_options,name:name,instance:instance})||state;}}},// Async and optimistically optimized update – it will not be executed if +// not necessary (debounced to run at most once-per-tick) +update:debounce(function(){return new Promise(function(resolve){instance.forceUpdate();resolve(state);});}),destroy:function destroy(){cleanupModifierEffects();isDestroyed=true;}};if(!areValidElements(reference,popper)){{console.error(INVALID_ELEMENT_ERROR);}return instance;}instance.setOptions(options).then(function(state){if(!isDestroyed&&options.onFirstUpdate){options.onFirstUpdate(state);}});// Modifiers have the ability to execute arbitrary code before the first +// update cycle runs. They will be executed in the same order as the update +// cycle. This is useful when a modifier adds some persistent data that +// other modifiers need to use, but the modifier is run after the dependent +// one. +function runModifierEffects(){state.orderedModifiers.forEach(function(_ref3){var name=_ref3.name,_ref3$options=_ref3.options,options=_ref3$options===void 0?{}:_ref3$options,effect=_ref3.effect;if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});}function cleanupModifierEffects(){effectCleanupFns.forEach(function(fn){return fn();});effectCleanupFns=[];}return instance;};} + +var defaultModifiers=[eventListeners,popperOffsets$1,computeStyles$1,applyStyles$1,offset$1,flip$1,preventOverflow$1,arrow$1,hide$1];var createPopper=/*#__PURE__*/popperGenerator({defaultModifiers:defaultModifiers});// eslint-disable-next-line import/no-unused-modules + +/* global Map:readonly, Set:readonly, ArrayBuffer:readonly */ +var hasElementType=typeof Element!=='undefined';var hasMap=typeof Map==='function';var hasSet=typeof Set==='function';var hasArrayBuffer=typeof ArrayBuffer==='function'&&!!ArrayBuffer.isView;// Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js +function equal$1(a,b){// START: fast-deep-equal es6/index.js 3.1.1 +if(a===b)return true;if(a&&b&&typeof a=='object'&&typeof b=='object'){if(a.constructor!==b.constructor)return false;var length,i,keys;if(Array.isArray(a)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(!equal$1(a[i],b[i]))return false;return true;}// START: Modifications: +// 1. Extra `has &&` helpers in initial condition allow es6 code +// to co-exist with es5. +// 2. Replace `for of` with es5 compliant iteration using `for`. +// Basically, take: +// +// ```js +// for (i of a.entries()) +// if (!b.has(i[0])) return false; +// ``` +// +// ... and convert to: +// +// ```js +// it = a.entries(); +// while (!(i = it.next()).done) +// if (!b.has(i.value[0])) return false; +// ``` +// +// **Note**: `i` access switches to `i.value`. +var it;if(hasMap&&a instanceof Map&&b instanceof Map){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;it=a.entries();while(!(i=it.next()).done)if(!equal$1(i.value[1],b.get(i.value[0])))return false;return true;}if(hasSet&&a instanceof Set&&b instanceof Set){if(a.size!==b.size)return false;it=a.entries();while(!(i=it.next()).done)if(!b.has(i.value[0]))return false;return true;}// END: Modifications +if(hasArrayBuffer&&ArrayBuffer.isView(a)&&ArrayBuffer.isView(b)){length=a.length;if(length!=b.length)return false;for(i=length;i--!==0;)if(a[i]!==b[i])return false;return true;}if(a.constructor===RegExp)return a.source===b.source&&a.flags===b.flags;if(a.valueOf!==Object.prototype.valueOf)return a.valueOf()===b.valueOf();if(a.toString!==Object.prototype.toString)return a.toString()===b.toString();keys=Object.keys(a);length=keys.length;if(length!==Object.keys(b).length)return false;for(i=length;i--!==0;)if(!Object.prototype.hasOwnProperty.call(b,keys[i]))return false;// END: fast-deep-equal +// START: react-fast-compare +// custom handling for DOM elements +if(hasElementType&&a instanceof Element)return false;// custom handling for React/Preact +for(i=length;i--!==0;){if((keys[i]==='_owner'||keys[i]==='__v'||keys[i]==='__o')&&a.$$typeof){// React-specific: avoid traversing React elements' _owner +// Preact-specific: avoid traversing Preact elements' __v and __o +// __v = $_original / $_vnode +// __o = $_owner +// These properties contain circular references and are not needed when +// comparing the actual elements (and not their owners) +// .$$typeof and ._store on just reasonable markers of elements +continue;}// all other properties should be traversed as usual +if(!equal$1(a[keys[i]],b[keys[i]]))return false;}// END: react-fast-compare +// START: fast-deep-equal +return true;}return a!==a&&b!==b;}// end fast-deep-equal +var reactFastCompare=function isEqual(a,b){try{return equal$1(a,b);}catch(error){if((error.message||'').match(/stack|recursion/i)){// warn on circular references, don't crash +// browsers give this different errors name and messages: +// chrome/safari: "RangeError", "Maximum call stack size exceeded" +// firefox: "InternalError", too much recursion" +// edge: "Error", "Out of stack space" +console.warn('react-fast-compare cannot handle circular refs');return false;}// some other error. we should definitely know about these +throw error;}}; + +var EMPTY_MODIFIERS=[];var usePopper=function usePopper(referenceElement,popperElement,options){if(options===void 0){options={};}var prevOptions=react.useRef(null);var optionsWithDefaults={onFirstUpdate:options.onFirstUpdate,placement:options.placement||'bottom',strategy:options.strategy||'absolute',modifiers:options.modifiers||EMPTY_MODIFIERS};var _React$useState=react.useState({styles:{popper:{position:optionsWithDefaults.strategy,left:'0',top:'0'},arrow:{position:'absolute'}},attributes:{}}),state=_React$useState[0],setState=_React$useState[1];var updateStateModifier=react.useMemo(function(){return {name:'updateState',enabled:true,phase:'write',fn:function fn(_ref){var state=_ref.state;var elements=Object.keys(state.elements);setState({styles:fromEntries(elements.map(function(element){return [element,state.styles[element]||{}];})),attributes:fromEntries(elements.map(function(element){return [element,state.attributes[element]];}))});},requires:['computeStyles']};},[]);var popperOptions=react.useMemo(function(){var newOptions={onFirstUpdate:optionsWithDefaults.onFirstUpdate,placement:optionsWithDefaults.placement,strategy:optionsWithDefaults.strategy,modifiers:[].concat(optionsWithDefaults.modifiers,[updateStateModifier,{name:'applyStyles',enabled:false}])};if(reactFastCompare(prevOptions.current,newOptions)){return prevOptions.current||newOptions;}else {prevOptions.current=newOptions;return newOptions;}},[optionsWithDefaults.onFirstUpdate,optionsWithDefaults.placement,optionsWithDefaults.strategy,optionsWithDefaults.modifiers,updateStateModifier]);var popperInstanceRef=react.useRef();useIsomorphicLayoutEffect(function(){if(popperInstanceRef.current){popperInstanceRef.current.setOptions(popperOptions);}},[popperOptions]);useIsomorphicLayoutEffect(function(){if(referenceElement==null||popperElement==null){return;}var createPopper$1=options.createPopper||createPopper;var popperInstance=createPopper$1(referenceElement,popperElement,popperOptions);popperInstanceRef.current=popperInstance;return function(){popperInstance.destroy();popperInstanceRef.current=null;};},[referenceElement,popperElement,options.createPopper]);return {state:popperInstanceRef.current?popperInstanceRef.current.state:null,styles:state.styles,attributes:state.attributes,update:popperInstanceRef.current?popperInstanceRef.current.update:null,forceUpdate:popperInstanceRef.current?popperInstanceRef.current.forceUpdate:null};}; - const save = () => __awaiter(void 0, void 0, void 0, function* () { - const dateMatches = (/[\d]{4}-[\d]{2}-[\d]{2}/).exec(selectedDay); +/** + * Fuse.js v6.4.6 - Lightweight fuzzy-search (http://fusejs.io) + * + * Copyright (c) 2021 Kiro Risk (http://kiro.me) + * All Rights Reserved. Apache Software License 2.0 + * + * http://www.apache.org/licenses/LICENSE-2.0 + */function isArray(value){return !Array.isArray?getTag(value)==='[object Array]':Array.isArray(value);}// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/baseToString.js +const INFINITY=1/0;function baseToString(value){// Exit early for strings to avoid a performance hit in some environments. +if(typeof value=='string'){return value;}let result=value+'';return result=='0'&&1/value==-INFINITY?'-0':result;}function toString(value){return value==null?'':baseToString(value);}function isString(value){return typeof value==='string';}function isNumber(value){return typeof value==='number';}// Adapted from: https://github.com/lodash/lodash/blob/master/isBoolean.js +function isBoolean(value){return value===true||value===false||isObjectLike(value)&&getTag(value)=='[object Boolean]';}function isObject(value){return typeof value==='object';}// Checks if `value` is object-like. +function isObjectLike(value){return isObject(value)&&value!==null;}function isDefined(value){return value!==undefined&&value!==null;}function isBlank(value){return !value.trim().length;}// Gets the `toStringTag` of `value`. +// Adapted from: https://github.com/lodash/lodash/blob/master/.internal/getTag.js +function getTag(value){return value==null?value===undefined?'[object Undefined]':'[object Null]':Object.prototype.toString.call(value);}const EXTENDED_SEARCH_UNAVAILABLE='Extended search is not available';const INCORRECT_INDEX_TYPE="Incorrect 'index' type";const LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY=key=>`Invalid value for key ${key}`;const PATTERN_LENGTH_TOO_LARGE=max=>`Pattern length exceeds max of ${max}.`;const MISSING_KEY_PROPERTY=name=>`Missing ${name} property in key`;const INVALID_KEY_WEIGHT_VALUE=key=>`Property 'weight' in key '${key}' must be a positive integer`;const hasOwn=Object.prototype.hasOwnProperty;class KeyStore{constructor(keys){this._keys=[];this._keyMap={};let totalWeight=0;keys.forEach(key=>{let obj=createKey(key);totalWeight+=obj.weight;this._keys.push(obj);this._keyMap[obj.id]=obj;totalWeight+=obj.weight;});// Normalize weights so that their sum is equal to 1 +this._keys.forEach(key=>{key.weight/=totalWeight;});}get(keyId){return this._keyMap[keyId];}keys(){return this._keys;}toJSON(){return JSON.stringify(this._keys);}}function createKey(key){let path=null;let id=null;let src=null;let weight=1;if(isString(key)||isArray(key)){src=key;path=createKeyPath(key);id=createKeyId(key);}else {if(!hasOwn.call(key,'name')){throw new Error(MISSING_KEY_PROPERTY('name'));}const name=key.name;src=name;if(hasOwn.call(key,'weight')){weight=key.weight;if(weight<=0){throw new Error(INVALID_KEY_WEIGHT_VALUE(name));}}path=createKeyPath(name);id=createKeyId(name);}return {path,id,weight,src};}function createKeyPath(key){return isArray(key)?key:key.split('.');}function createKeyId(key){return isArray(key)?key.join('.'):key;}function get$2(obj,path){let list=[];let arr=false;const deepGet=(obj,path,index)=>{if(!isDefined(obj)){return;}if(!path[index]){// If there's no path left, we've arrived at the object we care about. +list.push(obj);}else {let key=path[index];const value=obj[key];if(!isDefined(value)){return;}// If we're at the last value in the path, and if it's a string/number/bool, +// add it to the list +if(index===path.length-1&&(isString(value)||isNumber(value)||isBoolean(value))){list.push(toString(value));}else if(isArray(value)){arr=true;// Search each item in the array. +for(let i=0,len=value.length;ia.score===b.score?a.idx{this._keysMap[key.id]=idx;});}create(){if(this.isCreated||!this.docs.length){return;}this.isCreated=true;// List is Array +if(isString(this.docs[0])){this.docs.forEach((doc,docIndex)=>{this._addString(doc,docIndex);});}else {// List is Array +this.docs.forEach((doc,docIndex)=>{this._addObject(doc,docIndex);});}this.norm.clear();}// Adds a doc to the end of the index +add(doc){const idx=this.size();if(isString(doc)){this._addString(doc,idx);}else {this._addObject(doc,idx);}}// Removes the doc at the specified index of the index +removeAt(idx){this.records.splice(idx,1);// Change ref index of every subsquent doc +for(let i=idx,len=this.size();i{// console.log(key) +let value=this.getFn(doc,key.path);if(!isDefined(value)){return;}if(isArray(value)){let subRecords=[];const stack=[{nestedArrIndex:-1,value}];while(stack.length){const{nestedArrIndex,value}=stack.pop();if(!isDefined(value)){continue;}if(isString(value)&&!isBlank(value)){let subRecord={v:value,i:nestedArrIndex,n:this.norm.get(value)};subRecords.push(subRecord);}else if(isArray(value)){value.forEach((item,k)=>{stack.push({nestedArrIndex:k,value:item});});}}record.$[keyIndex]=subRecords;}else if(!isBlank(value)){let subRecord={v:value,n:this.norm.get(value)};record.$[keyIndex]=subRecord;}});this.records.push(record);}toJSON(){return {keys:this.keys,records:this.records};}}function createIndex(keys,docs,{getFn=Config.getFn}={}){const myIndex=new FuseIndex({getFn});myIndex.setKeys(keys.map(createKey));myIndex.setSources(docs);myIndex.create();return myIndex;}function parseIndex(data,{getFn=Config.getFn}={}){const{keys,records}=data;const myIndex=new FuseIndex({getFn});myIndex.setKeys(keys);myIndex.setIndexRecords(records);return myIndex;}function computeScore(pattern,{errors=0,currentLocation=0,expectedLocation=0,distance=Config.distance,ignoreLocation=Config.ignoreLocation}={}){const accuracy=errors/pattern.length;if(ignoreLocation){return accuracy;}const proximity=Math.abs(expectedLocation-currentLocation);if(!distance){// Dodge divide by zero error. +return proximity?1.0:accuracy;}return accuracy+proximity/distance;}function convertMaskToIndices(matchmask=[],minMatchCharLength=Config.minMatchCharLength){let indices=[];let start=-1;let end=-1;let i=0;for(let len=matchmask.length;i=minMatchCharLength){indices.push([start,end]);}start=-1;}}// (i-1 - start) + 1 => i - start +if(matchmask[i-1]&&i-start>=minMatchCharLength){indices.push([start,i-1]);}return indices;}// Machine word size +const MAX_BITS=32;function search(text,pattern,patternAlphabet,{location=Config.location,distance=Config.distance,threshold=Config.threshold,findAllMatches=Config.findAllMatches,minMatchCharLength=Config.minMatchCharLength,includeMatches=Config.includeMatches,ignoreLocation=Config.ignoreLocation}={}){if(pattern.length>MAX_BITS){throw new Error(PATTERN_LENGTH_TOO_LARGE(MAX_BITS));}const patternLen=pattern.length;// Set starting location at beginning text and initialize the alphabet. +const textLen=text.length;// Handle the case when location > text.length +const expectedLocation=Math.max(0,Math.min(location,textLen));// Highest score beyond which we give up. +let currentThreshold=threshold;// Is there a nearby exact match? (speedup) +let bestLocation=expectedLocation;// Performance: only computer matches when the minMatchCharLength > 1 +// OR if `includeMatches` is true. +const computeMatches=minMatchCharLength>1||includeMatches;// A mask of the matches, used for building the indices +const matchMask=computeMatches?Array(textLen):[];let index;// Get all exact matches, here for speed up +while((index=text.indexOf(pattern,bestLocation))>-1){let score=computeScore(pattern,{currentLocation:index,expectedLocation,distance,ignoreLocation});currentThreshold=Math.min(score,currentThreshold);bestLocation=index+patternLen;if(computeMatches){let i=0;while(i=start;j-=1){let currentLocation=j-1;let charMatch=patternAlphabet[text.charAt(currentLocation)];if(computeMatches){// Speed up: quick bool to int conversion (i.e, `charMatch ? 1 : 0`) +matchMask[currentLocation]=+!!charMatch;}// First pass: exact match +bitArr[j]=(bitArr[j+1]<<1|1)&charMatch;// Subsequent passes: fuzzy match +if(i){bitArr[j]|=(lastBitArr[j+1]|lastBitArr[j])<<1|1|lastBitArr[j+1];}if(bitArr[j]&mask){finalScore=computeScore(pattern,{errors:i,currentLocation,expectedLocation,distance,ignoreLocation});// This match will almost certainly be better than any existing match. +// But check anyway. +if(finalScore<=currentThreshold){// Indeed it is +currentThreshold=finalScore;bestLocation=currentLocation;// Already passed `loc`, downhill from here on in. +if(bestLocation<=expectedLocation){break;}// When passing `bestLocation`, don't exceed our current distance from `expectedLocation`. +start=Math.max(1,2*expectedLocation-bestLocation);}}}// No hope for a (better) match at greater error levels. +const score=computeScore(pattern,{errors:i+1,currentLocation:expectedLocation,expectedLocation,distance,ignoreLocation});if(score>currentThreshold){break;}lastBitArr=bitArr;}const result={isMatch:bestLocation>=0,// Count exact matches (those with a score of 0) to be "almost" exact +score:Math.max(0.001,finalScore)};if(computeMatches){const indices=convertMaskToIndices(matchMask,minMatchCharLength);if(!indices.length){result.isMatch=false;}else if(includeMatches){result.indices=indices;}}return result;}function createPatternAlphabet(pattern){let mask={};for(let i=0,len=pattern.length;i{this.chunks.push({pattern,alphabet:createPatternAlphabet(pattern),startIndex});};const len=this.pattern.length;if(len>MAX_BITS){let i=0;const remainder=len%MAX_BITS;const end=len-remainder;while(i{const{isMatch,score,indices}=search(text,pattern,alphabet,{location:location+startIndex,distance,threshold,findAllMatches,minMatchCharLength,includeMatches,ignoreLocation});if(isMatch){hasMatches=true;}totalScore+=score;if(isMatch&&indices){allIndices=[...allIndices,...indices];}});let result={isMatch:hasMatches,score:hasMatches?totalScore/this.chunks.length:1};if(hasMatches&&includeMatches){result.indices=allIndices;}return result;}}class BaseMatch{constructor(pattern){this.pattern=pattern;}static isMultiMatch(pattern){return getMatch(pattern,this.multiRegex);}static isSingleMatch(pattern){return getMatch(pattern,this.singleRegex);}search(){}}function getMatch(pattern,exp){const matches=pattern.match(exp);return matches?matches[1]:null;}// Token: 'file +class ExactMatch extends BaseMatch{constructor(pattern){super(pattern);}static get type(){return 'exact';}static get multiRegex(){return /^="(.*)"$/;}static get singleRegex(){return /^=(.*)$/;}search(text){const isMatch=text===this.pattern;return {isMatch,score:isMatch?0:1,indices:[0,this.pattern.length-1]};}}// Token: !fire +class InverseExactMatch extends BaseMatch{constructor(pattern){super(pattern);}static get type(){return 'inverse-exact';}static get multiRegex(){return /^!"(.*)"$/;}static get singleRegex(){return /^!(.*)$/;}search(text){const index=text.indexOf(this.pattern);const isMatch=index===-1;return {isMatch,score:isMatch?0:1,indices:[0,text.length-1]};}}// Token: ^file +class PrefixExactMatch extends BaseMatch{constructor(pattern){super(pattern);}static get type(){return 'prefix-exact';}static get multiRegex(){return /^\^"(.*)"$/;}static get singleRegex(){return /^\^(.*)$/;}search(text){const isMatch=text.startsWith(this.pattern);return {isMatch,score:isMatch?0:1,indices:[0,this.pattern.length-1]};}}// Token: !^fire +class InversePrefixExactMatch extends BaseMatch{constructor(pattern){super(pattern);}static get type(){return 'inverse-prefix-exact';}static get multiRegex(){return /^!\^"(.*)"$/;}static get singleRegex(){return /^!\^(.*)$/;}search(text){const isMatch=!text.startsWith(this.pattern);return {isMatch,score:isMatch?0:1,indices:[0,text.length-1]};}}// Token: .file$ +class SuffixExactMatch extends BaseMatch{constructor(pattern){super(pattern);}static get type(){return 'suffix-exact';}static get multiRegex(){return /^"(.*)"\$$/;}static get singleRegex(){return /^(.*)\$$/;}search(text){const isMatch=text.endsWith(this.pattern);return {isMatch,score:isMatch?0:1,indices:[text.length-this.pattern.length,text.length-1]};}}// Token: !.file$ +class InverseSuffixExactMatch extends BaseMatch{constructor(pattern){super(pattern);}static get type(){return 'inverse-suffix-exact';}static get multiRegex(){return /^!"(.*)"\$$/;}static get singleRegex(){return /^!(.*)\$$/;}search(text){const isMatch=!text.endsWith(this.pattern);return {isMatch,score:isMatch?0:1,indices:[0,text.length-1]};}}class FuzzyMatch extends BaseMatch{constructor(pattern,{location=Config.location,threshold=Config.threshold,distance=Config.distance,includeMatches=Config.includeMatches,findAllMatches=Config.findAllMatches,minMatchCharLength=Config.minMatchCharLength,isCaseSensitive=Config.isCaseSensitive,ignoreLocation=Config.ignoreLocation}={}){super(pattern);this._bitapSearch=new BitapSearch(pattern,{location,threshold,distance,includeMatches,findAllMatches,minMatchCharLength,isCaseSensitive,ignoreLocation});}static get type(){return 'fuzzy';}static get multiRegex(){return /^"(.*)"$/;}static get singleRegex(){return /^(.*)$/;}search(text){return this._bitapSearch.searchIn(text);}}// Token: 'file +class IncludeMatch extends BaseMatch{constructor(pattern){super(pattern);}static get type(){return 'include';}static get multiRegex(){return /^'"(.*)"$/;}static get singleRegex(){return /^'(.*)$/;}search(text){let location=0;let index;const indices=[];const patternLen=this.pattern.length;// Get all exact matches +while((index=text.indexOf(this.pattern,location))>-1){location=index+patternLen;indices.push([index,location-1]);}const isMatch=!!indices.length;return {isMatch,score:isMatch?0:1,indices};}}// ❗Order is important. DO NOT CHANGE. +const searchers=[ExactMatch,IncludeMatch,PrefixExactMatch,InversePrefixExactMatch,InverseSuffixExactMatch,SuffixExactMatch,InverseExactMatch,FuzzyMatch];const searchersLen=searchers.length;// Regex to split by spaces, but keep anything in quotes together +const SPACE_RE=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;const OR_TOKEN='|';// Return a 2D array representation of the query, for simpler parsing. +// Example: +// "^core go$ | rb$ | py$ xy$" => [["^core", "go$"], ["rb$"], ["py$", "xy$"]] +function parseQuery(pattern,options={}){return pattern.split(OR_TOKEN).map(item=>{let query=item.trim().split(SPACE_RE).filter(item=>item&&!!item.trim());let results=[];for(let i=0,len=query.length;i!!(query[LogicalOperator.AND]||query[LogicalOperator.OR]);const isPath=query=>!!query[KeyType.PATH];const isLeaf=query=>!isArray(query)&&isObject(query)&&!isExpression(query);const convertToExplicit=query=>({[LogicalOperator.AND]:Object.keys(query).map(key=>({[key]:query[key]}))});// When `auto` is `true`, the parse function will infer and initialize and add +// the appropriate `Searcher` instance +function parse$1(query,options,{auto=true}={}){const next=query=>{let keys=Object.keys(query);const isQueryPath=isPath(query);if(!isQueryPath&&keys.length>1&&!isExpression(query)){return next(convertToExplicit(query));}if(isLeaf(query)){const key=isQueryPath?query[KeyType.PATH]:keys[0];const pattern=isQueryPath?query[KeyType.PATTERN]:query[key];if(!isString(pattern)){throw new Error(LOGICAL_SEARCH_INVALID_QUERY_FOR_KEY(key));}const obj={keyId:createKeyId(key),pattern};if(auto){obj.searcher=createSearcher(pattern,options);}return obj;}let node={children:[],operator:keys[0]};keys.forEach(key=>{const value=query[key];if(isArray(value)){value.forEach(item=>{node.children.push(next(item));});}});return node;};if(!isExpression(query)){query=convertToExplicit(query);}return next(query);}// Practical scoring function +function computeScore$1(results,{ignoreFieldNorm=Config.ignoreFieldNorm}){results.forEach(result=>{let totalScore=1;result.matches.forEach(({key,norm,score})=>{const weight=key?key.weight:null;totalScore*=Math.pow(score===0&&weight?Number.EPSILON:score,(weight||1)*(ignoreFieldNorm?1:norm));});result.score=totalScore;});}function transformMatches(result,data){const matches=result.matches;data.matches=[];if(!isDefined(matches)){return;}matches.forEach(match=>{if(!isDefined(match.indices)||!match.indices.length){return;}const{indices,value}=match;let obj={indices,value};if(match.key){obj.key=match.key.src;}if(match.idx>-1){obj.refIndex=match.idx;}data.matches.push(obj);});}function transformScore(result,data){data.score=result.score;}function format$2(results,docs,{includeMatches=Config.includeMatches,includeScore=Config.includeScore}={}){const transformers=[];if(includeMatches)transformers.push(transformMatches);if(includeScore)transformers.push(transformScore);return results.map(result=>{const{idx}=result;const data={item:docs[idx],refIndex:idx};if(transformers.length){transformers.forEach(transformer=>{transformer(result,data);});}return data;});}class Fuse{constructor(docs,options={},index){this.options={...Config,...options};if(this.options.useExtendedSearch&&!true){throw new Error(EXTENDED_SEARCH_UNAVAILABLE);}this._keyStore=new KeyStore(this.options.keys);this.setCollection(docs,index);}setCollection(docs,index){this._docs=docs;if(index&&!(index instanceof FuseIndex)){throw new Error(INCORRECT_INDEX_TYPE);}this._myIndex=index||createIndex(this.options.keys,this._docs,{getFn:this.options.getFn});}add(doc){if(!isDefined(doc)){return;}this._docs.push(doc);this._myIndex.add(doc);}remove(predicate=()=>false){const results=[];for(let i=0,len=this._docs.length;i-1){results=results.slice(0,limit);}return format$2(results,this._docs,{includeMatches,includeScore});}_searchStringList(query){const searcher=createSearcher(query,this.options);const{records}=this._myIndex;const results=[];// Iterate over every string in the index +records.forEach(({v:text,i:idx,n:norm})=>{if(!isDefined(text)){return;}const{isMatch,score,indices}=searcher.searchIn(text);if(isMatch){results.push({item:text,idx,matches:[{score,value:text,norm,indices}]});}});return results;}_searchLogical(query){const expression=parse$1(query,this.options);const evaluate=(node,item,idx)=>{if(!node.children){const{keyId,searcher}=node;const matches=this._findMatches({key:this._keyStore.get(keyId),value:this._myIndex.getValueForItemAtKeyId(item,keyId),searcher});if(matches&&matches.length){return [{idx,item,matches}];}return [];}/*eslint indent: [2, 2, {"SwitchCase": 1}]*/switch(node.operator){case LogicalOperator.AND:{const res=[];for(let i=0,len=node.children.length;i{if(isDefined(item)){let expResults=evaluate(expression,item,idx);if(expResults.length){// Dedupe when adding +if(!resultMap[idx]){resultMap[idx]={idx,item,matches:[]};results.push(resultMap[idx]);}expResults.forEach(({matches})=>{resultMap[idx].matches.push(...matches);});}}});return results;}_searchObjectList(query){const searcher=createSearcher(query,this.options);const{keys,records}=this._myIndex;const results=[];// List is Array +records.forEach(({$:item,i:idx})=>{if(!isDefined(item)){return;}let matches=[];// Iterate over every key (i.e, path), and fetch the value at that key +keys.forEach((key,keyIndex)=>{matches.push(...this._findMatches({key,value:item[keyIndex],searcher}));});if(matches.length){results.push({idx,item,matches});}});return results;}_findMatches({key,value,searcher}){if(!isDefined(value)){return [];}let matches=[];if(isArray(value)){value.forEach(({v:text,i:idx,n:norm})=>{if(!isDefined(text)){return;}const{isMatch,score,indices}=searcher.searchIn(text);if(isMatch){matches.push({score,key,value:text,idx,norm,indices});}});}else {const{v:text,n:norm}=value;const{isMatch,score,indices}=searcher.searchIn(text);if(isMatch){matches.push({score,key,value:text,norm,indices});}}return matches;}}Fuse.version='6.4.6';Fuse.createIndex=createIndex;Fuse.parseIndex=parseIndex;Fuse.config=Config;{Fuse.parseQuery=parse$1;}{register(ExtendedSearch);} + +const TextSuggest = ({ placeholder, suggestions, value, setValue }) => { + const [currentSuggestions, setCurrentSuggestions] = react.useState(suggestions); + const [fuse, _] = react.useState(new Fuse(suggestions, { threshold: 0.5 })); + const [selectedIndex, setSelectedIndex] = react.useState(0); + const [visible, setVisibility] = react.useState(false); + const [referenceElement, setReferenceElement] = react.useState(null); + const [popperElement, setPopperElement] = react.useState(null); + const { styles, attributes } = usePopper(referenceElement, popperElement, { + placement: 'bottom-start', + }); + const updateValue = (newValue) => { + setValue(newValue); + const newSuggestions = fuse.search(newValue).map((result) => result.item); + setCurrentSuggestions(newSuggestions); + setSelectedIndex(Math.max(selectedIndex, newSuggestions.length - 1)); + }; + const makeSelectSuggestion = (s) => () => { + setValue(s); + setVisibility(false); + }; + return (react.createElement("div", null, + react.createElement(WideInput, { ref: setReferenceElement, type: "text", value: value, placeholder: placeholder, onChange: (e) => updateValue(e.target.value), onFocus: () => { + setVisibility(true); + setSelectedIndex(0); + }, onBlur: () => setVisibility(false), onKeyDown: (e) => { + switch (e.key) { + case 'ArrowUp': + setSelectedIndex(selectedIndex - 1); + e.preventDefault(); + return; + case 'ArrowDown': + setSelectedIndex(selectedIndex + 1); + e.preventDefault(); + return; + case 'Enter': + setVisibility(false); + updateValue(currentSuggestions[selectedIndex]); + e.preventDefault(); + return; + } + } }), + visible ? (react.createElement("div", Object.assign({ className: "suggestion-container", ref: setPopperElement, style: styles.popper }, attributes.popper), currentSuggestions.map((s, i) => (react.createElement(Suggestion, { value: s, key: s, selected: i === selectedIndex, onClick: makeSelectSuggestion(s), onHover: () => { + setSelectedIndex(i); + } }))))) : null)); +}; +const Suggestion = ({ value, selected, onClick, onHover }) => (react.createElement("div", { className: 'suggestion-item ' + (selected ? 'is-selected' : ''), onMouseDown: onClick, onMouseOver: onHover }, value)); + +const Margin = He.div ` + margin: 5px 0; +`; +const DatePicker = He(WideInput) ` + background: var(--background-modifier-form-field); + border: 1px solid var(--background-modifier-border); + color: var(--text-normal); + padding: 5px 14px; + border-radius: 4px; + height: 30px; +`; +const DatePickerMobile = He(DatePicker) ` + display: block; + padding: 8px 14px; + height: auto; + font-size: 17px; +`; +const InputWithIconWrapper = He.div ` + position: relative; +`; +const InputWithIcon = He(WideInput) ` + /* important required to override mobile stylesheet */ + padding-left: 25px !important; +`; +const InputIcon = He.i ` + position: absolute; + display: block; + transform: translate(0, -50%); + top: 50%; + pointer-events: none; + width: 25px; + text-align: center; + font-style: normal; +`; +const CreateLedgerEntry = ({ currencySymbol, saveFn, txCache, close }) => { + const [payee, setPayee] = react.useState(''); + const [total, setTotal] = react.useState(0); + const [date, setDate] = react.useState(''); + const [expenseCategory, setExpenseCategory] = react.useState(''); + const [assetAccount, setAssetAccount] = react.useState(''); + const save = async () => { + if (payee === '') { + new obsidian.Notice('Payee must not be empty'); + return; + } + else if (date === '') { + // TODO: Default to today + new obsidian.Notice('Must select a date'); + return; + } + else if (expenseCategory === '') { + new obsidian.Notice('Expense category must not be empty'); + return; + } + else if (assetAccount === '') { + new obsidian.Notice('Asset account must not be empty'); + return; + } + const formattedDate = date.replace(/-/g, '/'); + const tx = { + type: 'tx', + value: { + date: formattedDate, + payee, + expenselines: [ + { + category: expenseCategory, + amount: total, + currency: currencySymbol, + }, + { + category: assetAccount, + }, + ], + }, + }; + await saveFn(tx); + close(); + }; + // TODO: Make this support income or transfers as well + // TODO: Filter categories based on whether entering an expense, income, or transfer + // TODO: Support splitting transactions + return (react.createElement(react.Fragment, null, + react.createElement("h2", null, "Add to Ledger"), + react.createElement(Margin, null, obsidian.Platform.isMobile ? (react.createElement(DatePickerMobile, { type: "date", value: date, onChange: (e) => setDate(e.target.value) })) : (react.createElement(DatePicker, { type: "date", value: date, onChange: (e) => setDate(e.target.value) }))), + react.createElement(Margin, null, + react.createElement(InputWithIconWrapper, null, + react.createElement(InputWithIcon, { placeholder: "Amount", type: "number", value: total, onChange: (e) => setTotal(parseFloat(e.target.value)) }), + react.createElement(InputIcon, null, currencySymbol))), + react.createElement(Margin, null, + react.createElement(TextSuggest, { placeholder: "Payee", suggestions: txCache.payees, value: payee, setValue: setPayee })), + react.createElement(Margin, null, + react.createElement(TextSuggest, { placeholder: "Expense Category", suggestions: txCache.categories, value: expenseCategory, setValue: setExpenseCategory })), + react.createElement(Margin, null, + react.createElement(TextSuggest, { placeholder: "Asset Account", suggestions: txCache.categories, value: assetAccount, setValue: setAssetAccount })), + react.createElement(Margin, null, + react.createElement("button", { onClick: () => { + save(); // async + } }, "Save")))); +}; - if (!dateMatches || dateMatches.length !== 1) { - new obsidian.Notice("Unable to determine selected date"); - console.error("ledger: Unable to process selected date: " + selectedDay); - return; - } +/** @license React v0.20.2 + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - const date = dateMatches[0].replace(/-/g, "/"); +var scheduler_production_min = createCommonjsModule(function (module, exports) { +var f,g,h,k;if("object"===typeof performance&&"function"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now();};}else {var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q;};}if("undefined"===typeof window||"function"!==typeof MessageChannel){var t=null,u=null,w=function(){if(null!==t)try{var a=exports.unstable_now();t(!0,a);t=null;}catch(b){throw setTimeout(w,0),b;}};f=function(a){null!==t?setTimeout(f,0,a):(t=a,setTimeout(w,0));};g=function(a,b){u=setTimeout(a,b);};h=function(){clearTimeout(u);};exports.unstable_shouldYield=function(){return !1;};k=exports.unstable_forceFrameRate=function(){};}else {var x=window.setTimeout,y=window.clearTimeout;if("undefined"!==typeof console){var z=window.cancelAnimationFrame;"function"!==typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");"function"!==typeof z&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills");}var A=!1,B=null,C=-1,D=5,E=0;exports.unstable_shouldYield=function(){return exports.unstable_now()>=E;};k=function(){};exports.unstable_forceFrameRate=function(a){0>a||125>>1,e=a[d];if(void 0!==e&&0I(n,c))void 0!==r&&0>I(r,n)?(a[d]=r,a[v]=c,d=v):(a[d]=n,a[m]=c,d=m);else if(void 0!==r&&0>I(r,c))a[d]=r,a[v]=c,d=v;else break a;}}return b;}return null;}function I(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id;}var L=[],M=[],N=1,O=null,P=3,Q=!1,R=!1,S=!1;function T(a){for(var b=J(M);null!==b;){if(null===b.callback)K(M);else if(b.startTime<=a)K(M),b.sortIndex=b.expirationTime,H(L,b);else break;b=J(M);}}function U(a){S=!1;T(a);if(!R)if(null!==J(L))R=!0,f(V);else {var b=J(M);null!==b&&g(U,b.startTime-a);}}function V(a,b){R=!1;S&&(S=!1,h());Q=!0;var c=P;try{T(b);for(O=J(L);null!==O&&(!(O.expirationTime>b)||a&&!exports.unstable_shouldYield());){var d=O.callback;if("function"===typeof d){O.callback=null;P=O.priorityLevel;var e=d(O.expirationTime<=b);b=exports.unstable_now();"function"===typeof e?O.callback=e:O===J(L)&&K(L);T(b);}else K(L);O=J(L);}if(null!==O)var m=!0;else {var n=J(M);null!==n&&g(U,n.startTime-b);m=!1;}return m;}finally{O=null,P=c,Q=!1;}}var W=k;exports.unstable_IdlePriority=5;exports.unstable_ImmediatePriority=1;exports.unstable_LowPriority=4;exports.unstable_NormalPriority=3;exports.unstable_Profiling=null;exports.unstable_UserBlockingPriority=2;exports.unstable_cancelCallback=function(a){a.callback=null;};exports.unstable_continueExecution=function(){R||Q||(R=!0,f(V));};exports.unstable_getCurrentPriorityLevel=function(){return P;};exports.unstable_getFirstCallbackNode=function(){return J(L);};exports.unstable_next=function(a){switch(P){case 1:case 2:case 3:var b=3;break;default:b=P;}var c=P;P=b;try{return a();}finally{P=c;}};exports.unstable_pauseExecution=function(){};exports.unstable_requestPaint=W;exports.unstable_runWithPriority=function(a,b){switch(a){case 1:case 2:case 3:case 4:case 5:break;default:a=3;}var c=P;P=a;try{return b();}finally{P=c;}};exports.unstable_scheduleCallback=function(a,b,c){var d=exports.unstable_now();"object"===typeof c&&null!==c?(c=c.delay,c="number"===typeof c&&0d?(a.sortIndex=c,H(M,a),null===J(L)&&a===J(M)&&(S?h():S=!0,g(U,c-d))):(a.sortIndex=e,H(L,a),R||Q||(R=!0,f(V)));return a;};exports.unstable_wrapCallback=function(a){var b=P;return function(){var c=P;P=b;try{return a.apply(this,arguments);}finally{P=c;}};}; +}); - if (!payee || payee === "") { - new obsidian.Notice("Payee must not be empty"); - return; - } else if (lines.some(({ category }) => category === "")) { - new obsidian.Notice("Transaction lines must have a category"); - return; - } +/** @license React v0.20.2 + * scheduler.development.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ - const tx = { - type: "tx", - value: { - check: undefined, - date, - payee, - expenselines: lines - } - }; +var scheduler_development = createCommonjsModule(function (module, exports) { +{(function(){var enableSchedulerDebugging=false;var enableProfiling=false;var requestHostCallback;var requestHostTimeout;var cancelHostTimeout;var requestPaint;var hasPerformanceNow=typeof performance==='object'&&typeof performance.now==='function';if(hasPerformanceNow){var localPerformance=performance;exports.unstable_now=function(){return localPerformance.now();};}else {var localDate=Date;var initialTime=localDate.now();exports.unstable_now=function(){return localDate.now()-initialTime;};}if(// If Scheduler runs in a non-DOM environment, it falls back to a naive +// implementation using setTimeout. +typeof window==='undefined'||// Check if MessageChannel is supported, too. +typeof MessageChannel!=='function'){// If this accidentally gets imported in a non-browser environment, e.g. JavaScriptCore, +// fallback to a naive implementation. +var _callback=null;var _timeoutID=null;var _flushCallback=function(){if(_callback!==null){try{var currentTime=exports.unstable_now();var hasRemainingTime=true;_callback(hasRemainingTime,currentTime);_callback=null;}catch(e){setTimeout(_flushCallback,0);throw e;}}};requestHostCallback=function(cb){if(_callback!==null){// Protect against re-entrancy. +setTimeout(requestHostCallback,0,cb);}else {_callback=cb;setTimeout(_flushCallback,0);}};requestHostTimeout=function(cb,ms){_timeoutID=setTimeout(cb,ms);};cancelHostTimeout=function(){clearTimeout(_timeoutID);};exports.unstable_shouldYield=function(){return false;};requestPaint=exports.unstable_forceFrameRate=function(){};}else {// Capture local references to native APIs, in case a polyfill overrides them. +var _setTimeout=window.setTimeout;var _clearTimeout=window.clearTimeout;if(typeof console!=='undefined'){// TODO: Scheduler no longer requires these methods to be polyfilled. But +// maybe we want to continue warning if they don't exist, to preserve the +// option to rely on it in the future? +var requestAnimationFrame=window.requestAnimationFrame;var cancelAnimationFrame=window.cancelAnimationFrame;if(typeof requestAnimationFrame!=='function'){// Using console['error'] to evade Babel and ESLint +console['error']("This browser doesn't support requestAnimationFrame. "+'Make sure that you load a '+'polyfill in older browsers. https://reactjs.org/link/react-polyfills');}if(typeof cancelAnimationFrame!=='function'){// Using console['error'] to evade Babel and ESLint +console['error']("This browser doesn't support cancelAnimationFrame. "+'Make sure that you load a '+'polyfill in older browsers. https://reactjs.org/link/react-polyfills');}}var isMessageLoopRunning=false;var scheduledHostCallback=null;var taskTimeoutID=-1;// Scheduler periodically yields in case there is other work on the main +// thread, like user events. By default, it yields multiple times per frame. +// It does not attempt to align with frame boundaries, since most tasks don't +// need to be frame aligned; for those that do, use requestAnimationFrame. +var yieldInterval=5;var deadline=0;// TODO: Make this configurable +{// `isInputPending` is not available. Since we have no way of knowing if +// there's pending input, always yield at the end of the frame. +exports.unstable_shouldYield=function(){return exports.unstable_now()>=deadline;};// Since we yield every frame regardless, `requestPaint` has no effect. +requestPaint=function(){};}exports.unstable_forceFrameRate=function(fps){if(fps<0||fps>125){// Using console['error'] to evade Babel and ESLint +console['error']('forceFrameRate takes a positive int between 0 and 125, '+'forcing frame rates higher than 125 fps is not supported');return;}if(fps>0){yieldInterval=Math.floor(1000/fps);}else {// reset the framerate +yieldInterval=5;}};var performWorkUntilDeadline=function(){if(scheduledHostCallback!==null){var currentTime=exports.unstable_now();// Yield after `yieldInterval` ms, regardless of where we are in the vsync +// cycle. This means there's always time remaining at the beginning of +// the message event. +deadline=currentTime+yieldInterval;var hasTimeRemaining=true;try{var hasMoreWork=scheduledHostCallback(hasTimeRemaining,currentTime);if(!hasMoreWork){isMessageLoopRunning=false;scheduledHostCallback=null;}else {// If there's more work, schedule the next message event at the end +// of the preceding one. +port.postMessage(null);}}catch(error){// If a scheduler task throws, exit the current browser task so the +// error can be observed. +port.postMessage(null);throw error;}}else {isMessageLoopRunning=false;}// Yielding to the browser will give it a chance to paint, so we can +};var channel=new MessageChannel();var port=channel.port2;channel.port1.onmessage=performWorkUntilDeadline;requestHostCallback=function(callback){scheduledHostCallback=callback;if(!isMessageLoopRunning){isMessageLoopRunning=true;port.postMessage(null);}};requestHostTimeout=function(callback,ms){taskTimeoutID=_setTimeout(function(){callback(exports.unstable_now());},ms);};cancelHostTimeout=function(){_clearTimeout(taskTimeoutID);taskTimeoutID=-1;};}function push(heap,node){var index=heap.length;heap.push(node);siftUp(heap,node,index);}function peek(heap){var first=heap[0];return first===undefined?null:first;}function pop(heap){var first=heap[0];if(first!==undefined){var last=heap.pop();if(last!==first){heap[0]=last;siftDown(heap,last,0);}return first;}else {return null;}}function siftUp(heap,node,i){var index=i;while(true){var parentIndex=index-1>>>1;var parent=heap[parentIndex];if(parent!==undefined&&compare(parent,node)>0){// The parent is larger. Swap positions. +heap[parentIndex]=node;heap[index]=parent;index=parentIndex;}else {// The parent is smaller. Exit. +return;}}}function siftDown(heap,node,i){var index=i;var length=heap.length;while(indexcurrentTime&&(!hasTimeRemaining||exports.unstable_shouldYield())){// This currentTask hasn't expired, and we've reached the deadline. +break;}var callback=currentTask.callback;if(typeof callback==='function'){currentTask.callback=null;currentPriorityLevel=currentTask.priorityLevel;var didUserCallbackTimeout=currentTask.expirationTime<=currentTime;var continuationCallback=callback(didUserCallbackTimeout);currentTime=exports.unstable_now();if(typeof continuationCallback==='function'){currentTask.callback=continuationCallback;}else {if(currentTask===peek(taskQueue)){pop(taskQueue);}}advanceTimers(currentTime);}else {pop(taskQueue);}currentTask=peek(taskQueue);}// Return whether there's additional work +if(currentTask!==null){return true;}else {var firstTimer=peek(timerQueue);if(firstTimer!==null){requestHostTimeout(handleTimeout,firstTimer.startTime-currentTime);}return false;}}function unstable_runWithPriority(priorityLevel,eventHandler){switch(priorityLevel){case ImmediatePriority:case UserBlockingPriority:case NormalPriority:case LowPriority:case IdlePriority:break;default:priorityLevel=NormalPriority;}var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=priorityLevel;try{return eventHandler();}finally{currentPriorityLevel=previousPriorityLevel;}}function unstable_next(eventHandler){var priorityLevel;switch(currentPriorityLevel){case ImmediatePriority:case UserBlockingPriority:case NormalPriority:// Shift down to normal priority +priorityLevel=NormalPriority;break;default:// Anything lower than normal priority should remain at the current level. +priorityLevel=currentPriorityLevel;break;}var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=priorityLevel;try{return eventHandler();}finally{currentPriorityLevel=previousPriorityLevel;}}function unstable_wrapCallback(callback){var parentPriorityLevel=currentPriorityLevel;return function(){// This is a fork of runWithPriority, inlined for performance. +var previousPriorityLevel=currentPriorityLevel;currentPriorityLevel=parentPriorityLevel;try{return callback.apply(this,arguments);}finally{currentPriorityLevel=previousPriorityLevel;}};}function unstable_scheduleCallback(priorityLevel,callback,options){var currentTime=exports.unstable_now();var startTime;if(typeof options==='object'&&options!==null){var delay=options.delay;if(typeof delay==='number'&&delay>0){startTime=currentTime+delay;}else {startTime=currentTime;}}else {startTime=currentTime;}var timeout;switch(priorityLevel){case ImmediatePriority:timeout=IMMEDIATE_PRIORITY_TIMEOUT;break;case UserBlockingPriority:timeout=USER_BLOCKING_PRIORITY_TIMEOUT;break;case IdlePriority:timeout=IDLE_PRIORITY_TIMEOUT;break;case LowPriority:timeout=LOW_PRIORITY_TIMEOUT;break;case NormalPriority:default:timeout=NORMAL_PRIORITY_TIMEOUT;break;}var expirationTime=startTime+timeout;var newTask={id:taskIdCounter++,callback:callback,priorityLevel:priorityLevel,startTime:startTime,expirationTime:expirationTime,sortIndex:-1};if(startTime>currentTime){// This is a delayed task. +newTask.sortIndex=startTime;push(timerQueue,newTask);if(peek(taskQueue)===null&&newTask===peek(timerQueue)){// All tasks are delayed, and this is the task with the earliest delay. +if(isHostTimeoutScheduled){// Cancel an existing timeout. +cancelHostTimeout();}else {isHostTimeoutScheduled=true;}// Schedule a timeout. +requestHostTimeout(handleTimeout,startTime-currentTime);}}else {newTask.sortIndex=expirationTime;push(taskQueue,newTask);// wait until the next time we yield. +if(!isHostCallbackScheduled&&!isPerformingWork){isHostCallbackScheduled=true;requestHostCallback(flushWork);}}return newTask;}function unstable_pauseExecution(){}function unstable_continueExecution(){if(!isHostCallbackScheduled&&!isPerformingWork){isHostCallbackScheduled=true;requestHostCallback(flushWork);}}function unstable_getFirstCallbackNode(){return peek(taskQueue);}function unstable_cancelCallback(task){// remove from the queue because you can't remove arbitrary nodes from an +// array based heap, only the first one.) +task.callback=null;}function unstable_getCurrentPriorityLevel(){return currentPriorityLevel;}var unstable_requestPaint=requestPaint;var unstable_Profiling=null;exports.unstable_IdlePriority=IdlePriority;exports.unstable_ImmediatePriority=ImmediatePriority;exports.unstable_LowPriority=LowPriority;exports.unstable_NormalPriority=NormalPriority;exports.unstable_Profiling=unstable_Profiling;exports.unstable_UserBlockingPriority=UserBlockingPriority;exports.unstable_cancelCallback=unstable_cancelCallback;exports.unstable_continueExecution=unstable_continueExecution;exports.unstable_getCurrentPriorityLevel=unstable_getCurrentPriorityLevel;exports.unstable_getFirstCallbackNode=unstable_getFirstCallbackNode;exports.unstable_next=unstable_next;exports.unstable_pauseExecution=unstable_pauseExecution;exports.unstable_requestPaint=unstable_requestPaint;exports.unstable_runWithPriority=unstable_runWithPriority;exports.unstable_scheduleCallback=unstable_scheduleCallback;exports.unstable_wrapCallback=unstable_wrapCallback;})();} +}); - yield saveFn(tx); - close(); - }); +var scheduler = createCommonjsModule(function (module) { +{module.exports=scheduler_development;} +}); - function calendar_selectedId_binding(value) { - selectedDay = value; - $$invalidate(2, selectedDay); - } +/** @license React v17.0.2 + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +function y(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c