From 6201c476162df1af6ab66fa4bb1de4fc70eaeca6 Mon Sep 17 00:00:00 2001 From: kevmodrome Date: Tue, 14 Apr 2020 12:03:22 +0200 Subject: [PATCH] change isRecord to isModel --- .../bootstrap-components/public/bundle.js | 2916 +-- .../bootstrap-components/public/bundle.js.map | 4 +- .../builder/src/builderStore/store/backend.js | 6 +- .../builder/src/components/common/core.js | 4 +- .../modals/CreateEditView.svelte | 2 +- .../src/authApi/generateFullPermissions.js | 4 +- .../core/src/authApi/validateAccessLevels.js | 4 +- packages/core/src/indexApi/buildIndex.js | 4 +- packages/core/src/indexing/relevant.js | 4 +- .../core/src/recordApi/initialiseChildren.js | 8 +- packages/core/src/recordApi/save.js | 2 +- .../core/src/templateApi/canDeleteIndex.js | 6 +- .../core/src/templateApi/canDeleteModel.js | 2 +- packages/core/src/templateApi/createNodes.js | 10 +- .../core/src/templateApi/diffHierarchy.js | 12 +- packages/core/src/templateApi/hierarchy.js | 16 +- packages/core/src/templateApi/indexes.js | 6 +- packages/core/src/templateApi/validate.js | 10 +- packages/server/yarn.lock | 272 +- packages/standard-components/public/bundle.js | 21782 ++++++++-------- .../standard-components/public/bundle.js.map | 6 +- yarn.lock | 40 +- 22 files changed, 12543 insertions(+), 12577 deletions(-) diff --git a/packages/bootstrap-components/public/bundle.js b/packages/bootstrap-components/public/bundle.js index 0ce8731d37..e406984883 100644 --- a/packages/bootstrap-components/public/bundle.js +++ b/packages/bootstrap-components/public/bundle.js @@ -1,4 +1,4 @@ -;(function(l, i, v, e) { +; (function (l, i, v, e) { v = l.createElement(i) v.async = 1 v.src = @@ -8,10 +8,10 @@ e = l.getElementsByTagName(i)[0] e.parentNode.insertBefore(v, e) })(document, "script") -var app = (function() { +var app = (function () { "use strict" - function noop() {} + function noop() { } function assign(tar, src) { // @ts-ignore for (const k in src) tar[k] = src[k] @@ -58,12 +58,12 @@ var app = (function() { function get_slot_changes(definition, ctx, changed, fn) { return definition[1] ? assign( - {}, - assign( - ctx.$$scope.changed || {}, - definition[1](fn ? fn(changed) : {}) - ) + {}, + assign( + ctx.$$scope.changed || {}, + definition[1](fn ? fn(changed) : {}) ) + ) : ctx.$$scope.changed || {} } function null_to_empty(value) { @@ -386,12 +386,12 @@ var app = (function() { let ready = false $$.ctx = instance ? instance(component, props, (key, ret, value = ret) => { - if ($$.ctx && not_equal($$.ctx[key], ($$.ctx[key] = value))) { - if ($$.bound[key]) $$.bound[key](value) - if (ready) make_dirty(component, key) - } - return ret - }) + if ($$.ctx && not_equal($$.ctx[key], ($$.ctx[key] = value))) { + if ($$.bound[key]) $$.bound[key](value) + if (ready) make_dirty(component, key) + } + return ret + }) : props $$.update() ready = true @@ -493,8 +493,8 @@ var app = (function() { options === true ? ["capture"] : options - ? Array.from(Object.keys(options)) - : [] + ? Array.from(Object.keys(options)) + : [] if (has_prevent_default) modifiers.push("preventDefault") if (has_stop_propagation) modifiers.push("stopPropagation") dispatch_dev("SvelteDOMAddEventListener", { @@ -645,8 +645,8 @@ var app = (function() { if ( changed.className && input_class_value !== - (input_class_value = - "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") + (input_class_value = + "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") ) { attr_dev(input, "class", input_class_value) } @@ -716,8 +716,8 @@ var app = (function() { if ( changed.className && input_class_value !== - (input_class_value = - "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") + (input_class_value = + "" + null_to_empty(ctx.className) + " svelte-1ec4wqj") ) { attr_dev(input, "class", input_class_value) } @@ -775,7 +775,7 @@ var app = (function() { p: function update(changed, ctx) { if ( current_block_type === - (current_block_type = select_block_type(changed, ctx)) && + (current_block_type = select_block_type(changed, ctx)) && if_block ) { if_block.p(changed, ctx) @@ -1121,8 +1121,8 @@ var app = (function() { if ( changed.containerClass && div_class_value !== - (div_class_value = - "form-root " + ctx.containerClass + " svelte-m9d6ue") + (div_class_value = + "form-root " + ctx.containerClass + " svelte-m9d6ue") ) { attr_dev(div, "class", div_class_value) } @@ -1535,8 +1535,8 @@ var app = (function() { if ( (!current || changed.className) && button_class_value !== - (button_class_value = - "" + null_to_empty(ctx.className) + " svelte-1q8lga0") + (button_class_value = + "" + null_to_empty(ctx.className) + " svelte-1q8lga0") ) { attr_dev(button, "class", button_class_value) } @@ -1582,7 +1582,7 @@ var app = (function() { disabled = false, contentText, contentComponent, - onClick = () => {}, + onClick = () => { }, } = $$props let { _bb } = $$props @@ -2162,8 +2162,8 @@ var app = (function() { if ( changed._inputClass && input0_class_value !== - (input0_class_value = - "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a") + (input0_class_value = + "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a") ) { attr_dev(input0, "class", input0_class_value) } @@ -2178,8 +2178,8 @@ var app = (function() { if ( changed._inputClass && input1_class_value !== - (input1_class_value = - "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a") + (input1_class_value = + "" + null_to_empty(ctx._inputClass) + " svelte-crnq0a") ) { attr_dev(input1, "class", input1_class_value) } @@ -2195,8 +2195,8 @@ var app = (function() { if ( changed._buttonClass && button_class_value !== - (button_class_value = - "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a") + (button_class_value = + "" + null_to_empty(ctx._buttonClass) + " svelte-crnq0a") ) { attr_dev(button, "class", button_class_value) } @@ -2615,8 +2615,8 @@ var app = (function() { if ( changed.itemContainerClass && div_class_value !== - (div_class_value = - "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to") + (div_class_value = + "" + null_to_empty(ctx.itemContainerClass) + " svelte-10kw8to") ) { attr_dev(div, "class", div_class_value) } @@ -2734,7 +2734,7 @@ var app = (function() { if ( changed.containerClass && div_class_value !== - (div_class_value = "root " + ctx.containerClass + " svelte-10kw8to") + (div_class_value = "root " + ctx.containerClass + " svelte-10kw8to") ) { attr_dev(div, "class", div_class_value) } @@ -4235,8 +4235,8 @@ var app = (function() { if ( (changed.component || changed.text) && t_value !== - (t_value = - ctx.component && ctx.component._component ? "" : ctx.text + "") + (t_value = + ctx.component && ctx.component._component ? "" : ctx.text + "") ) { set_data_dev(t, t_value) } @@ -4244,8 +4244,8 @@ var app = (function() { if ( changed.containerClass && div_class_value !== - (div_class_value = - "" + ctx.containerClass + " panel" + " svelte-6yfcjx") + (div_class_value = + "" + ctx.containerClass + " panel" + " svelte-6yfcjx") ) { attr_dev(div, "class", div_class_value) } @@ -4981,8 +4981,8 @@ var app = (function() { if ( changed.itemContainerClass && div0_class_value !== - (div0_class_value = - "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") + (div0_class_value = + "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") ) { attr_dev(div0, "class", div0_class_value) } @@ -4990,8 +4990,8 @@ var app = (function() { if ( changed.direction && div1_class_value !== - (div1_class_value = - "" + null_to_empty(ctx.direction) + " svelte-osi0db") + (div1_class_value = + "" + null_to_empty(ctx.direction) + " svelte-osi0db") ) { attr_dev(div1, "class", div1_class_value) } @@ -5169,8 +5169,8 @@ var app = (function() { if ( changed.itemContainerClass && div0_class_value !== - (div0_class_value = - "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") + (div0_class_value = + "" + null_to_empty(ctx.itemContainerClass) + " svelte-osi0db") ) { attr_dev(div0, "class", div0_class_value) } @@ -5178,8 +5178,8 @@ var app = (function() { if ( changed.direction && div1_class_value !== - (div1_class_value = - "" + null_to_empty(ctx.direction) + " svelte-osi0db") + (div1_class_value = + "" + null_to_empty(ctx.direction) + " svelte-osi0db") ) { attr_dev(div1, "class", div1_class_value) } @@ -5278,7 +5278,7 @@ var app = (function() { if ( changed.containerClass && div_class_value !== - (div_class_value = "root " + ctx.containerClass + " svelte-osi0db") + (div_class_value = "root " + ctx.containerClass + " svelte-osi0db") ) { attr_dev(div, "class", div_class_value) } @@ -5791,8 +5791,8 @@ var app = (function() { if ( changed.thClass && th_class_value !== - (th_class_value = - "" + null_to_empty(ctx.thClass) + " svelte-h8rqk6") + (th_class_value = + "" + null_to_empty(ctx.thClass) + " svelte-h8rqk6") ) { attr_dev(th, "class", th_class_value) } @@ -5855,7 +5855,7 @@ var app = (function() { if ( (changed._bb || changed.columns || changed.data) && t_value !== - (t_value = ctx._bb.getStateOrValue(ctx.col.value, ctx.row) + "") + (t_value = ctx._bb.getStateOrValue(ctx.col.value, ctx.row) + "") ) { set_data_dev(t, t_value) } @@ -5863,8 +5863,8 @@ var app = (function() { if ( changed.thClass && th_class_value !== - (th_class_value = - "" + null_to_empty(ctx.thClass) + " svelte-h8rqk6") + (th_class_value = + "" + null_to_empty(ctx.thClass) + " svelte-h8rqk6") ) { attr_dev(th, "class", th_class_value) } @@ -5972,8 +5972,8 @@ var app = (function() { if ( changed.trClass && tr_class_value !== - (tr_class_value = - "" + null_to_empty(ctx.trClass) + " svelte-h8rqk6") + (tr_class_value = + "" + null_to_empty(ctx.trClass) + " svelte-h8rqk6") ) { attr_dev(tr, "class", tr_class_value) } @@ -6152,8 +6152,8 @@ var app = (function() { if ( changed.trClass && tr_class_value !== - (tr_class_value = - "" + null_to_empty(ctx.trClass) + " svelte-h8rqk6") + (tr_class_value = + "" + null_to_empty(ctx.trClass) + " svelte-h8rqk6") ) { attr_dev(tr, "class", tr_class_value) } @@ -6161,8 +6161,8 @@ var app = (function() { if ( changed.theadClass && thead_class_value !== - (thead_class_value = - "" + null_to_empty(ctx.theadClass) + " svelte-h8rqk6") + (thead_class_value = + "" + null_to_empty(ctx.theadClass) + " svelte-h8rqk6") ) { attr_dev(thead, "class", thead_class_value) } @@ -6198,8 +6198,8 @@ var app = (function() { if ( changed.tbodyClass && tbody_class_value !== - (tbody_class_value = - "" + null_to_empty(ctx.tbodyClass) + " svelte-h8rqk6") + (tbody_class_value = + "" + null_to_empty(ctx.tbodyClass) + " svelte-h8rqk6") ) { attr_dev(tbody, "class", tbody_class_value) } @@ -6207,8 +6207,8 @@ var app = (function() { if ( changed.tableClass && table_class_value !== - (table_class_value = - "" + null_to_empty(ctx.tableClass) + " svelte-h8rqk6") + (table_class_value = + "" + null_to_empty(ctx.tableClass) + " svelte-h8rqk6") ) { attr_dev(table, "class", table_class_value) } @@ -6480,12 +6480,12 @@ var app = (function() { typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" - ? window - : typeof global !== "undefined" - ? global - : typeof self !== "undefined" - ? self - : {} + ? window + : typeof global !== "undefined" + ? global + : typeof self !== "undefined" + ? self + : {} function createCommonjsModule(fn, module) { return ( @@ -6493,8 +6493,8 @@ var app = (function() { ) } - var lodash_min = createCommonjsModule(function(module, exports) { - ;(function() { + var lodash_min = createCommonjsModule(function (module, exports) { + ; (function () { function n(n, t, r) { switch (r.length) { case 0: @@ -6509,7 +6509,7 @@ var app = (function() { return n.apply(t, r) } function t(n, t, r, e) { - for (var u = -1, i = null == n ? 0 : n.length; ++u < i; ) { + for (var u = -1, i = null == n ? 0 : n.length; ++u < i;) { var o = n[u] t(e, o, r(o), n) } @@ -6532,7 +6532,7 @@ var app = (function() { return n } function u(n, t) { - for (var r = -1, e = null == n ? 0 : n.length; ++r < e; ) + for (var r = -1, e = null == n ? 0 : n.length; ++r < e;) if (!t(n[r], r, n)) return false return true } @@ -6551,39 +6551,39 @@ var app = (function() { return !(null == n || !n.length) && -1 < v(n, t, 0) } function f(n, t, r) { - for (var e = -1, u = null == n ? 0 : n.length; ++e < u; ) + for (var e = -1, u = null == n ? 0 : n.length; ++e < u;) if (r(t, n[e])) return true return false } function c(n, t) { - for (var r = -1, e = null == n ? 0 : n.length, u = Array(e); ++r < e; ) + for (var r = -1, e = null == n ? 0 : n.length, u = Array(e); ++r < e;) u[r] = t(n[r], r, n) return u } function a(n, t) { - for (var r = -1, e = t.length, u = n.length; ++r < e; ) n[u + r] = t[r] + for (var r = -1, e = t.length, u = n.length; ++r < e;) n[u + r] = t[r] return n } function l(n, t, r, e) { var u = -1, i = null == n ? 0 : n.length - for (e && i && (r = n[++u]); ++u < i; ) r = t(r, n[u], u, n) + for (e && i && (r = n[++u]); ++u < i;) r = t(r, n[u], u, n) return r } function s(n, t, r, e) { var u = null == n ? 0 : n.length - for (e && u && (r = n[--u]); u--; ) r = t(r, n[u], u, n) + for (e && u && (r = n[--u]); u--;) r = t(r, n[u], u, n) return r } function h(n, t) { - for (var r = -1, e = null == n ? 0 : n.length; ++r < e; ) + for (var r = -1, e = null == n ? 0 : n.length; ++r < e;) if (t(n[r], r, n)) return true return false } function p(n, t, r) { var e return ( - r(n, function(n, r, u) { + r(n, function (n, r, u) { if (t(n, r, u)) return (e = r), false }), e @@ -6591,14 +6591,14 @@ var app = (function() { } function _(n, t, r, e) { var u = n.length - for (r += e ? 1 : -1; e ? r-- : ++r < u; ) if (t(n[r], r, n)) return r + for (r += e ? 1 : -1; e ? r-- : ++r < u;) if (t(n[r], r, n)) return r return -1 } function v(n, t, r) { if (t === t) n: { --r - for (var e = n.length; ++r < e; ) + for (var e = n.length; ++r < e;) if (n[r] === t) { n = r break n @@ -6610,7 +6610,7 @@ var app = (function() { } function g(n, t, r, e) { --r - for (var u = n.length; ++r < u; ) if (e(n[r], t)) return r + for (var u = n.length; ++r < u;) if (e(n[r], t)) return r return -1 } function d(n) { @@ -6621,18 +6621,18 @@ var app = (function() { return r ? m(n, t) / r : F } function b(n) { - return function(t) { + return function (t) { return null == t ? T : t[n] } } function x(n) { - return function(t) { + return function (t) { return null == n ? T : n[t] } } function j(n, t, r, e, u) { return ( - u(n, function(n, u, i) { + u(n, function (n, u, i) { r = e ? ((e = false), n) : t(r, n, u, i) }), r @@ -6640,32 +6640,32 @@ var app = (function() { } function w(n, t) { var r = n.length - for (n.sort(t); r--; ) n[r] = n[r].c + for (n.sort(t); r--;) n[r] = n[r].c return n } function m(n, t) { - for (var r, e = -1, u = n.length; ++e < u; ) { + for (var r, e = -1, u = n.length; ++e < u;) { var i = t(n[e]) i !== T && (r = r === T ? i : r + i) } return r } function A(n, t) { - for (var r = -1, e = Array(n); ++r < n; ) e[r] = t(r) + for (var r = -1, e = Array(n); ++r < n;) e[r] = t(r) return e } function E(n, t) { - return c(t, function(t) { + return c(t, function (t) { return [t, n[t]] }) } function k(n) { - return function(t) { + return function (t) { return n(t) } } function S(n, t) { - return c(t, function(t) { + return c(t, function (t) { return n[t] }) } @@ -6673,11 +6673,11 @@ var app = (function() { return n.has(t) } function I(n, t) { - for (var r = -1, e = n.length; ++r < e && -1 < v(t, n[r], 0); ); + for (var r = -1, e = n.length; ++r < e && -1 < v(t, n[r], 0);); return r } function R(n, t) { - for (var r = n.length; r-- && -1 < v(t, n[r], 0); ); + for (var r = n.length; r-- && -1 < v(t, n[r], 0);); return r } function z(n) { @@ -6687,22 +6687,22 @@ var app = (function() { var t = -1, r = Array(n.size) return ( - n.forEach(function(n, e) { + n.forEach(function (n, e) { r[++t] = [e, n] }), r ) } function B(n, t) { - return function(r) { + return function (r) { return n(t(r)) } } function L(n, t) { - for (var r = -1, e = n.length, u = 0, i = []; ++r < e; ) { + for (var r = -1, e = n.length, u = 0, i = []; ++r < e;) { var o = n[r] - ;(o !== t && "__lodash_placeholder__" !== o) || - ((n[r] = "__lodash_placeholder__"), (i[u++] = r)) + ; (o !== t && "__lodash_placeholder__" !== o) || + ((n[r] = "__lodash_placeholder__"), (i[u++] = r)) } return i } @@ -6710,7 +6710,7 @@ var app = (function() { var t = -1, r = Array(n.size) return ( - n.forEach(function(n) { + n.forEach(function (n) { r[++t] = n }), r @@ -6720,7 +6720,7 @@ var app = (function() { var t = -1, r = Array(n.size) return ( - n.forEach(function(n) { + n.forEach(function (n) { r[++t] = [n, n] }), r @@ -6728,7 +6728,7 @@ var app = (function() { } function D(n) { if (Rn.test(n)) { - for (var t = (On.lastIndex = 0); On.test(n); ) ++t + for (var t = (On.lastIndex = 0); On.test(n);) ++t n = t } else n = Qn(n) return n @@ -6811,51 +6811,51 @@ var app = (function() { " " ), Bn = {} - ;(Bn["[object Float32Array]"] = Bn["[object Float64Array]"] = Bn[ - "[object Int8Array]" - ] = Bn["[object Int16Array]"] = Bn["[object Int32Array]"] = Bn[ + ; (Bn["[object Float32Array]"] = Bn["[object Float64Array]"] = Bn[ + "[object Int8Array]" + ] = Bn["[object Int16Array]"] = Bn["[object Int32Array]"] = Bn[ "[object Uint8Array]" - ] = Bn["[object Uint8ClampedArray]"] = Bn["[object Uint16Array]"] = Bn[ + ] = Bn["[object Uint8ClampedArray]"] = Bn["[object Uint16Array]"] = Bn[ "[object Uint32Array]" - ] = true), - (Bn["[object Arguments]"] = Bn["[object Array]"] = Bn[ - "[object ArrayBuffer]" - ] = Bn["[object Boolean]"] = Bn["[object DataView]"] = Bn[ + ] = true), + (Bn["[object Arguments]"] = Bn["[object Array]"] = Bn[ + "[object ArrayBuffer]" + ] = Bn["[object Boolean]"] = Bn["[object DataView]"] = Bn[ "[object Date]" - ] = Bn["[object Error]"] = Bn["[object Function]"] = Bn[ + ] = Bn["[object Error]"] = Bn["[object Function]"] = Bn[ "[object Map]" - ] = Bn["[object Number]"] = Bn["[object Object]"] = Bn[ + ] = Bn["[object Number]"] = Bn["[object Object]"] = Bn[ "[object RegExp]" - ] = Bn["[object Set]"] = Bn["[object String]"] = Bn[ + ] = Bn["[object Set]"] = Bn["[object String]"] = Bn[ "[object WeakMap]" - ] = false) + ] = false) var Ln = {} - ;(Ln["[object Arguments]"] = Ln["[object Array]"] = Ln[ - "[object ArrayBuffer]" - ] = Ln["[object DataView]"] = Ln["[object Boolean]"] = Ln[ + ; (Ln["[object Arguments]"] = Ln["[object Array]"] = Ln[ + "[object ArrayBuffer]" + ] = Ln["[object DataView]"] = Ln["[object Boolean]"] = Ln[ "[object Date]" - ] = Ln["[object Float32Array]"] = Ln["[object Float64Array]"] = Ln[ + ] = Ln["[object Float32Array]"] = Ln["[object Float64Array]"] = Ln[ "[object Int8Array]" - ] = Ln["[object Int16Array]"] = Ln["[object Int32Array]"] = Ln[ + ] = Ln["[object Int16Array]"] = Ln["[object Int32Array]"] = Ln[ "[object Map]" - ] = Ln["[object Number]"] = Ln["[object Object]"] = Ln[ + ] = Ln["[object Number]"] = Ln["[object Object]"] = Ln[ "[object RegExp]" - ] = Ln["[object Set]"] = Ln["[object String]"] = Ln[ + ] = Ln["[object Set]"] = Ln["[object String]"] = Ln[ "[object Symbol]" - ] = Ln["[object Uint8Array]"] = Ln["[object Uint8ClampedArray]"] = Ln[ + ] = Ln["[object Uint8Array]"] = Ln["[object Uint8ClampedArray]"] = Ln[ "[object Uint16Array]" - ] = Ln["[object Uint32Array]"] = true), - (Ln["[object Error]"] = Ln["[object Function]"] = Ln[ - "[object WeakMap]" - ] = false) + ] = Ln["[object Uint32Array]"] = true), + (Ln["[object Error]"] = Ln["[object Function]"] = Ln[ + "[object WeakMap]" + ] = false) var Un = { - "\\": "\\", - "'": "'", - "\n": "n", - "\r": "r", - "\u2028": "u2028", - "\u2029": "u2029", - }, + "\\": "\\", + "'": "'", + "\n": "n", + "\r": "r", + "\u2028": "u2028", + "\u2029": "u2029", + }, Cn = parseFloat, Dn = parseInt, Mn = @@ -6869,11 +6869,11 @@ var app = (function() { Nn = Fn && "object" == "object" && module && !module.nodeType && module, Pn = Nn && Nn.exports === Fn, Zn = Pn && Mn.process, - qn = (function() { + qn = (function () { try { var n = Nn && Nn.f && Nn.f("util").types return n ? n : Zn && Zn.binding && Zn.binding("util") - } catch (n) {} + } catch (n) { } })(), Vn = qn && qn.isArrayBuffer, Kn = qn && qn.isDate, @@ -7096,16 +7096,16 @@ var app = (function() { } return new On(n) } - function En() {} + function En() { } function On(n, t) { - ;(this.__wrapped__ = n), + ; (this.__wrapped__ = n), (this.__actions__ = []), (this.__chain__ = !!t), (this.__index__ = 0), (this.__values__ = T) } function Un(n) { - ;(this.__wrapped__ = n), + ; (this.__wrapped__ = n), (this.__actions__ = []), (this.__dir__ = 1), (this.__filtered__ = false), @@ -7116,7 +7116,7 @@ var app = (function() { function Mn(n) { var t = -1, r = null == n ? 0 : n.length - for (this.clear(); ++t < r; ) { + for (this.clear(); ++t < r;) { var e = n[t] this.set(e[0], e[1]) } @@ -7124,7 +7124,7 @@ var app = (function() { function Tn(n) { var t = -1, r = null == n ? 0 : n.length - for (this.clear(); ++t < r; ) { + for (this.clear(); ++t < r;) { var e = n[t] this.set(e[0], e[1]) } @@ -7132,7 +7132,7 @@ var app = (function() { function Fn(n) { var t = -1, r = null == n ? 0 : n.length - for (this.clear(); ++t < r; ) { + for (this.clear(); ++t < r;) { var e = n[t] this.set(e[0], e[1]) } @@ -7140,7 +7140,7 @@ var app = (function() { function Nn(n) { var t = -1, r = null == n ? 0 : n.length - for (this.__data__ = new Fn(); ++t < r; ) this.add(n[t]) + for (this.__data__ = new Fn(); ++t < r;) this.add(n[t]) } function Zn(n) { this.size = (this.__data__ = new Tn(n)).size @@ -7177,19 +7177,19 @@ var app = (function() { return De(Ur(n)) } function it(n, t, r) { - ;((r === T || lu(n[t], r)) && (r !== T || t in n)) || st(n, t, r) + ; ((r === T || lu(n[t], r)) && (r !== T || t in n)) || st(n, t, r) } function ot(n, t, r) { var e = n[t] - ;(oi.call(n, t) && lu(e, r) && (r !== T || t in n)) || st(n, t, r) + ; (oi.call(n, t) && lu(e, r) && (r !== T || t in n)) || st(n, t, r) } function ft(n, t) { - for (var r = n.length; r--; ) if (lu(n[r][0], t)) return r + for (var r = n.length; r--;) if (lu(n[r][0], t)) return r return -1 } function ct(n, t, r, e) { return ( - uo(n, function(n, u, i) { + uo(n, function (n, u, i) { t(e, n, r(n), i) }), e @@ -7204,22 +7204,22 @@ var app = (function() { function st(n, t, r) { "__proto__" == t && Ai ? Ai(n, t, { - configurable: true, - enumerable: true, - value: r, - writable: true, - }) + configurable: true, + enumerable: true, + value: r, + writable: true, + }) : (n[t] = r) } function ht(n, t) { - for (var r = -1, e = t.length, u = Ku(e), i = null == n; ++r < e; ) + for (var r = -1, e = t.length, u = Ku(e), i = null == n; ++r < e;) u[r] = i ? T : Ru(n, t[r]) return u } function pt(n, t, r) { return ( n === n && - (r !== T && (n = n <= r ? n : r), + (r !== T && (n = n <= r ? n : r), t !== T && (n = n >= t ? n : t)), n ) @@ -7253,17 +7253,17 @@ var app = (function() { if ((o || (o = new Zn()), (i = o.get(n)))) return i o.set(n, f), pf(n) - ? n.forEach(function(r) { - f.add(_t(r, t, e, r, n, o)) - }) + ? n.forEach(function (r) { + f.add(_t(r, t, e, r, n, o)) + }) : sf(n) && - n.forEach(function(r, u) { - f.set(u, _t(r, t, e, u, n, o)) - }) + n.forEach(function (r, u) { + f.set(u, _t(r, t, e, u, n, o)) + }) var a = l ? (a ? ve : _e) : a ? Bu : Wu, p = u ? T : a(n) return ( - r(p || n, function(r, u) { + r(p || n, function (r, u) { p && ((u = r), (r = n[u])), ot(f, u, _t(r, t, e, u, n, o)) }), f @@ -7271,14 +7271,14 @@ var app = (function() { } function vt(n) { var t = Wu(n) - return function(r) { + return function (r) { return gt(r, n, t) } } function gt(n, t, r) { var e = r.length if (null == n) return !e - for (n = Qu(n); e--; ) { + for (n = Qu(n); e--;) { var u = r[e], i = t[u], o = n[u] @@ -7288,7 +7288,7 @@ var app = (function() { } function dt(n, t, r) { if (typeof n != "function") throw new ti("Expected a function") - return bo(function() { + return bo(function () { n.apply(T, r) }, t) } @@ -7304,12 +7304,12 @@ var app = (function() { e ? ((i = f), (a = false)) : 200 <= t.length && ((i = O), (a = false), (t = new Nn(t))) - n: for (; ++u < l; ) { + n: for (; ++u < l;) { var p = n[u], _ = null == r ? p : r(p), p = e || 0 !== p ? p : 0 if (a && _ === _) { - for (var v = h; v--; ) if (t[v] === _) continue n + for (var v = h; v--;) if (t[v] === _) continue n s.push(p) } else i(t, _, e) || s.push(p) } @@ -7318,14 +7318,14 @@ var app = (function() { function bt(n, t) { var r = true return ( - uo(n, function(n, e, u) { + uo(n, function (n, e, u) { return (r = !!t(n, e, u)) }), r ) } function xt(n, t, r) { - for (var e = -1, u = n.length; ++e < u; ) { + for (var e = -1, u = n.length; ++e < u;) { var i = n[e], o = t(i) if (null != o && (f === T ? o === o && !wu(o) : r(o, f))) @@ -7337,7 +7337,7 @@ var app = (function() { function jt(n, t) { var r = [] return ( - uo(n, function(n, e, u) { + uo(n, function (n, e, u) { t(n, e, u) && r.push(n) }), r @@ -7346,7 +7346,7 @@ var app = (function() { function wt(n, t, r, e, u) { var i = -1, o = n.length - for (r || (r = ke), u || (u = []); ++i < o; ) { + for (r || (r = ke), u || (u = []); ++i < o;) { var f = n[i] 0 < t && r(f) ? 1 < t @@ -7363,13 +7363,13 @@ var app = (function() { return n && fo(n, t, Wu) } function Et(n, t) { - return i(t, function(t) { + return i(t, function (t) { return _u(n[t]) }) } function kt(n, t) { t = Sr(t, n) - for (var r = 0, e = t.length; null != n && r < e; ) + for (var r = 0, e = t.length; null != n && r < e;) n = n[Me(t[r++])] return r && r == e ? n : T } @@ -7384,7 +7384,7 @@ var app = (function() { try { n[mi] = T var e = true - } catch (n) {} + } catch (n) { } var u = ai.call(n) e && (t ? (n[mi] = r) : delete n[mi]), (n = u) } else n = ai.call(n) @@ -7402,12 +7402,12 @@ var app = (function() { function Wt(n, t, r) { for ( var e = r ? f : o, - u = n[0].length, - i = n.length, - a = i, - l = Ku(i), - s = 1 / 0, - h = []; + u = n[0].length, + i = n.length, + a = i, + l = Ku(i), + s = 1 / 0, + h = []; a--; ) { @@ -7422,12 +7422,12 @@ var app = (function() { var p = n[0], _ = -1, v = l[0] - n: for (; ++_ < u && h.length < s; ) { + n: for (; ++_ < u && h.length < s;) { var g = p[_], d = t ? t(g) : g, g = r || 0 !== g ? g : 0 if (v ? !O(v, d) : !e(h, d, r)) { - for (a = i; --a; ) { + for (a = i; --a;) { var y = l[a] if (y ? !O(y, d) : !e(n[a], d, r)) continue n } @@ -7439,7 +7439,7 @@ var app = (function() { function Bt(n, t, r) { var e = {} return ( - mt(n, function(n, u, i) { + mt(n, function (n, u, i) { t(e, r(n), u, i) }), e @@ -7481,7 +7481,7 @@ var app = (function() { t = false break n } - ;(i = true), (a = false) + ; (i = true), (a = false) } if (c && !a) u || (u = new Zn()), @@ -7493,10 +7493,10 @@ var app = (function() { if ( !(1 & r) && ((i = a && oi.call(n, "__wrapped__")), - (f = o && oi.call(t, "__wrapped__")), - i || f) + (f = o && oi.call(t, "__wrapped__")), + i || f) ) { - ;(n = i ? n.value() : n), + ; (n = i ? n.value() : n), (t = f ? t.value() : t), u || (u = new Zn()), (t = Mt(n, t, r, e, u)) @@ -7505,13 +7505,13 @@ var app = (function() { if (c) t: if ( (u || (u = new Zn()), - (i = 1 & r), - (f = _e(n)), - (o = f.length), - (c = _e(t).length), - o == c || i) + (i = 1 & r), + (f = _e(n)), + (o = f.length), + (c = _e(t).length), + o == c || i) ) { - for (a = o; a--; ) { + for (a = o; a--;) { var l = f[a] if (!(i ? l in t : oi.call(t, l))) { t = false @@ -7520,8 +7520,8 @@ var app = (function() { } if ((c = u.get(n)) && u.get(t)) t = c == t else { - ;(c = true), u.set(n, t), u.set(t, n) - for (var s = i; ++a < o; ) { + ; (c = true), u.set(n, t), u.set(t, n) + for (var s = i; ++a < o;) { var l = f[a], h = n[l], p = t[l] @@ -7538,8 +7538,8 @@ var app = (function() { c && !s && ((r = n.constructor), - (e = t.constructor), - r != e && + (e = t.constructor), + r != e && "constructor" in n && "constructor" in t && !( @@ -7567,11 +7567,11 @@ var app = (function() { i = u, o = !e if (null == n) return !i - for (n = Qu(n); u--; ) { + for (n = Qu(n); u--;) { var f = r[u] if (o && f[2] ? f[1] !== n[f[0]] : !(f[0] in n)) return false } - for (; ++u < i; ) { + for (; ++u < i;) { var f = r[u], c = f[0], a = n[c], @@ -7601,12 +7601,12 @@ var app = (function() { return typeof n == "function" ? n : null == n - ? $u - : typeof n == "object" - ? ff(n) - ? Jt(n[0], n[1]) - : Ht(n) - : Zu(n) + ? $u + : typeof n == "object" + ? ff(n) + ? Jt(n[0], n[1]) + : Ht(n) + : Zu(n) } function Vt(n) { if (!ze(n)) return Li(n) @@ -7622,7 +7622,7 @@ var app = (function() { var r = -1, e = su(n) ? Ku(n.length) : [] return ( - uo(n, function(n, u, i) { + uo(n, function (n, u, i) { e[++r] = t(n, u, i) }), e @@ -7632,23 +7632,23 @@ var app = (function() { var t = xe(n) return 1 == t.length && t[0][2] ? We(t[0][0], t[0][1]) - : function(r) { - return r === n || $t(r, n, t) - } + : function (r) { + return r === n || $t(r, n, t) + } } function Jt(n, t) { return Ie(n) && t === t && !du(t) ? We(Me(n), t) - : function(r) { - var e = Ru(r, n) - return e === T && e === t ? zu(r, n) : Mt(t, e, 3) - } + : function (r) { + var e = Ru(r, n) + return e === T && e === t ? zu(r, n) : Mt(t, e, 3) + } } function Yt(n, t, r, e, u) { n !== t && oo( t, - function(i, o) { + function (i, o) { if ((u || (u = new Zn()), du(i))) { var f = u, c = Le(n, o), @@ -7667,18 +7667,18 @@ var app = (function() { ? ff(c) ? (l = c) : hu(c) - ? (l = Ur(c)) - : p - ? ((s = false), (l = Ir(a, true))) - : _ - ? ((s = false), (l = zr(a, true))) - : (l = []) + ? (l = Ur(c)) + : p + ? ((s = false), (l = Ir(a, true))) + : _ + ? ((s = false), (l = zr(a, true))) + : (l = []) : xu(a) || of(a) - ? ((l = c), - of(c) - ? (l = Ou(c)) - : (du(c) && !_u(c)) || (l = Ae(a))) - : (s = false) + ? ((l = c), + of(c) + ? (l = Ou(c)) + : (du(c) && !_u(c)) || (l = Ae(a))) + : (s = false) } s && (f.set(a, l), Yt(l, a, r, e, f), f.delete(a)), it(n, o, l) @@ -7699,16 +7699,16 @@ var app = (function() { var e = -1 return ( (t = c(t.length ? t : [$u], k(ye()))), - (n = Gt(n, function(n) { + (n = Gt(n, function (n) { return { - a: c(t, function(t) { + a: c(t, function (t) { return t(n) }), b: ++e, c: n, } })), - w(n, function(n, t) { + w(n, function (n, t) { var e n: { e = -1 @@ -7730,12 +7730,12 @@ var app = (function() { ) } function nr(n, t) { - return tr(n, t, function(t, r) { + return tr(n, t, function (t, r) { return zu(n, r) }) } function tr(n, t, r) { - for (var e = -1, u = t.length, i = {}; ++e < u; ) { + for (var e = -1, u = t.length, i = {}; ++e < u;) { var o = t[e], f = kt(n, o) r(f, o) && lr(i, Sr(o, n), f) @@ -7743,7 +7743,7 @@ var app = (function() { return i } function rr(n) { - return function(t) { + return function (t) { return kt(t, n) } } @@ -7752,7 +7752,7 @@ var app = (function() { i = -1, o = t.length, f = n - for (n === t && (t = Ur(t)), r && (f = c(n, k(r))); ++i < o; ) + for (n === t && (t = Ur(t)), r && (f = c(n, k(r))); ++i < o;) for ( var a = 0, l = t[i], l = r ? r(l) : l; -1 < (a = u(f, l, a, e)); @@ -7762,7 +7762,7 @@ var app = (function() { return n } function ur(n, t) { - for (var r = n ? t.length : 0, e = r - 1; r--; ) { + for (var r = n ? t.length : 0, e = r - 1; r--;) { var u = t[r] if (r == e || u !== i) { var i = u @@ -7817,11 +7817,11 @@ var app = (function() { u = n.length for ( 0 > t && (t = -t > u ? 0 : u + t), - r = r > u ? u : r, - 0 > r && (r += u), - u = t > r ? 0 : (r - t) >>> 0, - t >>>= 0, - r = Ku(u); + r = r > u ? u : r, + 0 > r && (r += u), + u = t > r ? 0 : (r - t) >>> 0, + t >>>= 0, + r = Ku(u); ++e < u; ) @@ -7831,7 +7831,7 @@ var app = (function() { function pr(n, t) { var r return ( - uo(n, function(n, e, u) { + uo(n, function (n, e, u) { return (r = t(n, e, u)), !r }), !!r @@ -7841,7 +7841,7 @@ var app = (function() { var e = 0, u = null == n ? e : n.length if (typeof t == "number" && t === t && 2147483647 >= u) { - for (; e < u; ) { + for (; e < u;) { var i = (e + u) >>> 1, o = n[i] null !== o && !wu(o) && (r ? o <= t : o < t) @@ -7856,11 +7856,11 @@ var app = (function() { t = r(t) for ( var u = 0, - i = null == n ? 0 : n.length, - o = t !== t, - f = null === t, - c = wu(t), - a = t === T; + i = null == n ? 0 : n.length, + o = t !== t, + f = null === t, + c = wu(t), + a = t === T; u < i; ) { @@ -7870,26 +7870,26 @@ var app = (function() { p = null === s, _ = s === s, v = wu(s) - ;(o - ? e || _ - : a - ? _ && (e || h) - : f - ? _ && h && (e || !p) - : c - ? _ && h && !p && (e || !v) - : p || v - ? 0 - : e - ? s <= t - : s < t) - ? (u = l + 1) - : (i = l) + ; (o + ? e || _ + : a + ? _ && (e || h) + : f + ? _ && h && (e || !p) + : c + ? _ && h && !p && (e || !v) + : p || v + ? 0 + : e + ? s <= t + : s < t) + ? (u = l + 1) + : (i = l) } return Ci(i, 4294967294) } function gr(n, t) { - for (var r = -1, e = n.length, u = 0, i = []; ++r < e; ) { + for (var r = -1, e = n.length, u = 0, i = []; ++r < e;) { var o = n[r], f = t ? t(o) : o if (!r || !lu(f, c)) { @@ -7919,14 +7919,14 @@ var app = (function() { if (r) (c = false), (u = f) else if (200 <= i) { if ((u = t ? null : so(n))) return U(u) - ;(c = false), (u = O), (l = new Nn()) + ; (c = false), (u = O), (l = new Nn()) } else l = t ? [] : a - n: for (; ++e < i; ) { + n: for (; ++e < i;) { var s = n[e], h = t ? t(s) : s, s = r || 0 !== s ? s : 0 if (c && h === h) { - for (var p = l.length; p--; ) if (l[p] === h) continue n + for (var p = l.length; p--;) if (l[p] === h) continue n t && l.push(h), a.push(s) } else u(l, h, r) || (l !== a && l.push(h), a.push(s)) } @@ -7955,7 +7955,7 @@ var app = (function() { r instanceof Un && (r = r.value()), l( t, - function(n, t) { + function (n, t) { return t.func.apply(t.thisArg, a([n], t.args)) }, r @@ -7965,13 +7965,13 @@ var app = (function() { function mr(n, t, r) { var e = n.length if (2 > e) return e ? br(n[0]) : [] - for (var u = -1, i = Ku(e); ++u < e; ) - for (var o = n[u], f = -1; ++f < e; ) + for (var u = -1, i = Ku(e); ++u < e;) + for (var o = n[u], f = -1; ++f < e;) f != u && (i[u] = yt(i[u] || o, n[f], t, r)) return br(wt(i, 1), t, r) } function Ar(n, t, r) { - for (var e = -1, u = n.length, i = t.length, o = {}; ++e < u; ) + for (var e = -1, u = n.length, i = t.length, o = {}; ++e < u;) r(o, n[e], e < i ? t[e] : T) return o } @@ -8042,9 +8042,9 @@ var app = (function() { c = t.length, a = Ui(i - o, 0), l = Ku(c + a) - for (e = !e; ++f < c; ) l[f] = t[f] - for (; ++u < o; ) (e || u < i) && (l[r[u]] = n[u]) - for (; a--; ) l[f++] = n[u++] + for (e = !e; ++f < c;) l[f] = t[f] + for (; ++u < o;) (e || u < i) && (l[r[u]] = n[u]) + for (; a--;) l[f++] = n[u++] return l } function Lr(n, t, r, e) { @@ -8056,21 +8056,21 @@ var app = (function() { a = t.length, l = Ui(i - f, 0), s = Ku(l + a) - for (e = !e; ++u < l; ) s[u] = n[u] - for (l = u; ++c < a; ) s[l + c] = t[c] - for (; ++o < f; ) (e || u < i) && (s[l + r[o]] = n[u++]) + for (e = !e; ++u < l;) s[u] = n[u] + for (l = u; ++c < a;) s[l + c] = t[c] + for (; ++o < f;) (e || u < i) && (s[l + r[o]] = n[u++]) return s } function Ur(n, t) { var r = -1, e = n.length - for (t || (t = Ku(e)); ++r < e; ) t[r] = n[r] + for (t || (t = Ku(e)); ++r < e;) t[r] = n[r] return t } function Cr(n, t, r, e) { var u = !r r || (r = {}) - for (var i = -1, o = t.length; ++i < o; ) { + for (var i = -1, o = t.length; ++i < o;) { var f = t[i], c = e ? e(r[f], n[f], f, r, n) : T c === T && (c = n[f]), u ? st(r, f, c) : ot(r, f, c) @@ -8084,14 +8084,14 @@ var app = (function() { return Cr(n, _o(n), t) } function Tr(n, r) { - return function(e, u) { + return function (e, u) { var i = ff(e) ? t : ct, o = r ? r() : {} return i(e, n, ye(u, 2), o) } } function $r(n) { - return fr(function(t, r) { + return fr(function (t, r) { var e = -1, u = r.length, i = 1 < u ? r[u - 1] : T, @@ -8099,7 +8099,7 @@ var app = (function() { i = 3 < n.length && typeof i == "function" ? (u--, i) : T for ( o && Oe(r[0], r[1], o) && ((i = 3 > u ? T : i), (u = 1)), - t = Qu(t); + t = Qu(t); ++e < u; ) @@ -8108,7 +8108,7 @@ var app = (function() { }) } function Fr(n, t) { - return function(r, e) { + return function (r, e) { if (null == r) return r if (!su(r)) return n(r, e) for ( @@ -8120,11 +8120,11 @@ var app = (function() { } } function Nr(n) { - return function(t, r, e) { + return function (t, r, e) { var u = -1, i = Qu(t) e = e(t) - for (var o = e.length; o--; ) { + for (var o = e.length; o--;) { var f = e[n ? o : ++u] if (false === r(i[f], f, i)) break } @@ -8143,7 +8143,7 @@ var app = (function() { return e } function Zr(n) { - return function(t) { + return function (t) { t = Iu(t) var r = Rn.test(t) ? M(t) : T, e = r ? r[0] : t.charAt(0) @@ -8151,12 +8151,12 @@ var app = (function() { } } function qr(n) { - return function(t) { + return function (t) { return l(Mu(Du(t).replace(kn, "")), n, "") } } function Vr(n) { - return function() { + return function () { var t = arguments switch (t.length) { case 0: @@ -8183,7 +8183,7 @@ var app = (function() { } function Kr(t, r, e) { function u() { - for (var o = arguments.length, f = Ku(o), c = o, a = de(u); c--; ) + for (var o = arguments.length, f = Ku(o), c = o, a = de(u); c--;) f[c] = arguments[c] return ( (c = 3 > o && f[0] !== a && f[o - 1] !== a ? [] : L(f, a)), @@ -8197,29 +8197,29 @@ var app = (function() { return u } function Gr(n) { - return function(t, r, e) { + return function (t, r, e) { var u = Qu(t) if (!su(t)) { var i = ye(r, 3) - ;(t = Wu(t)), - (r = function(n) { - return i(u[n], n, u) - }) + ; (t = Wu(t)), + (r = function (n) { + return i(u[n], n, u) + }) } return (r = n(t, r, e)), -1 < r ? u[i ? t[r] : r] : T } } function Hr(n) { - return pe(function(t) { + return pe(function (t) { var r = t.length, e = r, u = On.prototype.thru - for (n && t.reverse(); e--; ) { + for (n && t.reverse(); e--;) { var i = t[e] if (typeof i != "function") throw new ti("Expected a function") if (u && !o && "wrapper" == ge(i)) var o = new On([], true) } - for (e = o ? e : r; ++e < r; ) + for (e = o ? e : r; ++e < r;) var i = t[e], u = ge(i), f = "wrapper" == u ? ho(i) : T, @@ -8227,13 +8227,13 @@ var app = (function() { f && Re(f[0]) && 424 == f[1] && !f[4].length && 1 == f[9] ? o[ge(f[0])].apply(o, f[3]) : 1 == i.length && Re(i) - ? o[u]() - : o.thru(i) - return function() { + ? o[u]() + : o.thru(i) + return function () { var n = arguments, e = n[0] if (o && 1 == n.length && ff(e)) return o.plant(e).value() - for (var u = 0, n = r ? t[u].apply(this, n) : e; ++u < r; ) + for (var u = 0, n = r ? t[u].apply(this, n) : e; ++u < r;) n = t[u].call(this, n) return n } @@ -8241,19 +8241,19 @@ var app = (function() { } function Jr(n, t, r, e, u, i, o, f, c, a) { function l() { - for (var d = arguments.length, y = Ku(d), b = d; b--; ) + for (var d = arguments.length, y = Ku(d), b = d; b--;) y[b] = arguments[b] if (_) { var x, j = de(l), b = y.length - for (x = 0; b--; ) y[b] === j && ++x + for (x = 0; b--;) y[b] === j && ++x } if ( (e && (y = Br(y, e, u, _)), - i && (y = Lr(y, i, o, _)), - (d -= x), - _ && d < a) + i && (y = Lr(y, i, o, _)), + (d -= x), + _ && d < a) ) return ( (j = L(y, j)), @@ -8261,7 +8261,7 @@ var app = (function() { ) if (((j = h ? r : this), (b = p ? j[n] : n), (d = y.length), f)) { x = y.length - for (var w = Ci(f.length, x), m = Ur(y); w--; ) { + for (var w = Ci(f.length, x), m = Ur(y); w--;) { var A = f[w] y[w] = Se(A, x) ? m[A] : T } @@ -8281,12 +8281,12 @@ var app = (function() { return l } function Yr(n, t) { - return function(r, e) { + return function (r, e) { return Bt(r, n, t(e)) } } function Qr(n, t) { - return function(r, e) { + return function (r, e) { var u if (r === T && e === T) return t if ((r !== T && (u = r), e !== T)) { @@ -8300,12 +8300,12 @@ var app = (function() { } } function Xr(t) { - return pe(function(r) { + return pe(function (r) { return ( (r = c(r, k(ye()))), - fr(function(e) { + fr(function (e) { var u = this - return t(r, function(t) { + return t(r, function (t) { return n(t, u, e) }) }) @@ -8326,16 +8326,16 @@ var app = (function() { function i() { for ( var r = -1, - c = arguments.length, - a = -1, - l = u.length, - s = Ku(l + c), - h = this && this !== $n && this instanceof i ? f : t; + c = arguments.length, + a = -1, + l = u.length, + s = Ku(l + c), + h = this && this !== $n && this instanceof i ? f : t; ++a < l; ) s[a] = u[a] - for (; c--; ) s[a++] = arguments[++r] + for (; c--;) s[a++] = arguments[++r] return n(h, o ? e : this, s) } var o = 1 & r, @@ -8343,22 +8343,22 @@ var app = (function() { return i } function re(n) { - return function(t, r, e) { + return function (t, r, e) { e && typeof e != "number" && Oe(t, r, e) && (r = e = T), (t = Au(t)), r === T ? ((r = t), (t = 0)) : (r = Au(r)), (e = e === T ? (t < r ? 1 : -1) : Au(e)) var u = -1 r = Ui(Oi((r - t) / (e || 1)), 0) - for (var i = Ku(r); r--; ) (i[n ? r : ++u] = t), (t += e) + for (var i = Ku(r); r--;) (i[n ? r : ++u] = t), (t += e) return i } } function ee(n) { - return function(t, r) { + return function (t, r) { return ( (typeof t == "string" && typeof r == "string") || - ((t = Su(t)), (r = Su(r))), + ((t = Su(t)), (r = Su(r))), n(t, r) ) } @@ -8381,7 +8381,7 @@ var app = (function() { } function ie(n) { var t = Yu[n] - return function(n, r) { + return function (n, r) { if ( ((n = Su(n)), (r = null == r ? 0 : Ci(Eu(r), 292)) && Wi(n)) ) { @@ -8394,13 +8394,13 @@ var app = (function() { } } function oe(n) { - return function(t) { + return function (t) { var r = vo(t) return "[object Map]" == r ? W(t) : "[object Set]" == r - ? C(t) - : E(t, n(t)) + ? C(t) + : E(t, n(t)) } } function fe(n, t, r, e, u, i, o, f) { @@ -8410,10 +8410,10 @@ var app = (function() { var a = e ? e.length : 0 if ( (a || ((t &= -97), (e = u = T)), - (o = o === T ? o : Ui(Eu(o), 0)), - (f = f === T ? f : Eu(f)), - (a -= u ? u.length : 0), - 64 & t) + (o = o === T ? o : Ui(Eu(o), 0)), + (f = f === T ? f : Eu(f)), + (a -= u ? u.length : 0), + 64 & t) ) { var l = e, s = u @@ -8423,7 +8423,7 @@ var app = (function() { return ( (i = [n, t, r, e, u, l, s, i, o, f]), h && - ((r = i[1]), + ((r = i[1]), (n = h[1]), (t = r | n), (e = @@ -8431,13 +8431,13 @@ var app = (function() { (128 == n && 256 == r && i[7].length <= h[8]) || (384 == n && h[7].length <= h[8] && 8 == r)), 131 > t || e) && - (1 & n && ((i[2] = h[2]), (t |= 1 & r ? 0 : 4)), + (1 & n && ((i[2] = h[2]), (t |= 1 & r ? 0 : 4)), (r = h[3]) && - ((e = i[3]), + ((e = i[3]), (i[3] = e ? Br(e, r, h[4]) : r), (i[4] = e ? L(i[3], "__lodash_placeholder__") : h[4])), (r = h[5]) && - ((e = i[5]), + ((e = i[5]), (i[5] = e ? Lr(e, r, h[6]) : r), (i[6] = e ? L(i[5], "__lodash_placeholder__") : h[6])), (r = h[7]) && (i[7] = r), @@ -8458,8 +8458,8 @@ var app = (function() { ? 8 == t || 16 == t ? Kr(n, t, f) : (32 != t && 33 != t) || u.length - ? Jr.apply(T, i) - : te(n, t, r, e) + ? Jr.apply(T, i) + : te(n, t, r, e) : Pr(n, t, r), i ), @@ -8489,7 +8489,7 @@ var app = (function() { var c = -1, a = true, l = 2 & r ? new Nn() : T - for (i.set(n, t), i.set(t, n); ++c < f; ) { + for (i.set(n, t), i.set(t, n); ++c < f;) { var s = n[c], p = t[c] if (e) var _ = o ? e(p, s, c, t, n, i) : e(s, p, c, n, t, i) @@ -8500,7 +8500,7 @@ var app = (function() { } if (l) { if ( - !h(t, function(n, t) { + !h(t, function (n, t) { if (!O(l, t) && (s === n || u(s, n, r, e, i))) return l.push(t) }) @@ -8523,7 +8523,7 @@ var app = (function() { n.byteOffset != t.byteOffset ) break - ;(n = n.buffer), (t = t.buffer) + ; (n = n.buffer), (t = t.buffer) case "[object ArrayBuffer]": if (n.byteLength != t.byteLength || !i(new vi(n), new vi(t))) break @@ -8586,16 +8586,16 @@ var app = (function() { var r = n.__data__, e = typeof t return ("string" == e || - "number" == e || - "symbol" == e || - "boolean" == e - ? "__proto__" !== t - : null === t) + "number" == e || + "symbol" == e || + "boolean" == e + ? "__proto__" !== t + : null === t) ? r[typeof t == "string" ? "string" : "hash"] : r.map } function xe(n) { - for (var t = Wu(n), r = t.length; r--; ) { + for (var t = Wu(n), r = t.length; r--;) { var e = t[r], u = n[e] t[r] = [e, u, u === u && !du(u)] @@ -8608,7 +8608,7 @@ var app = (function() { } function we(n, t, r) { t = Sr(t, n) - for (var e = -1, u = t.length, i = false; ++e < u; ) { + for (var e = -1, u = t.length, i = false; ++e < u;) { var o = Me(t[e]) if (!(i = null != n && r(n, o))) break n = n[o] @@ -8623,9 +8623,9 @@ var app = (function() { r = new n.constructor(t) return ( t && - "string" == typeof n[0] && - oi.call(n, "index") && - ((r.index = n.index), (r.input = n.input)), + "string" == typeof n[0] && + oi.call(n, "index") && + ((r.index = n.index), (r.input = n.input)), r ) } @@ -8680,10 +8680,10 @@ var app = (function() { return ( (t = null == t ? 9007199254740991 : t), !!t && - ("number" == r || ("symbol" != r && bn.test(n))) && - -1 < n && - 0 == n % 1 && - n < t + ("number" == r || ("symbol" != r && bn.test(n))) && + -1 < n && + 0 == n % 1 && + n < t ) } function Oe(n, t, r) { @@ -8725,21 +8725,21 @@ var app = (function() { return n === ((typeof t == "function" && t.prototype) || ei) } function We(n, t) { - return function(r) { + return function (r) { return null != r && r[n] === t && (t !== T || n in Qu(r)) } } function Be(t, r, e) { return ( (r = Ui(r === T ? t.length - 1 : r, 0)), - function() { + function () { for ( var u = arguments, i = -1, o = Ui(u.length - r, 0), f = Ku(o); ++i < o; ) f[i] = u[r + i] - for (i = -1, o = Ku(r + 1); ++i < r; ) o[i] = u[i] + for (i = -1, o = Ku(r + 1); ++i < r;) o[i] = u[i] return (o[r] = e(f)), n(t, this, o) } ) @@ -8760,7 +8760,7 @@ var app = (function() { (u = (u = e.match(an)) ? u[1].split(ln) : []), (r = i(u, r)), (i = r.length) && - ((u = i - 1), + ((u = i - 1), (r[u] = (1 < i ? "& " : "") + r[u]), (r = r.join(2 < i ? ", " : " ")), (e = e.replace(cn, "{\n/* [wrapped with " + r + "] */\n"))), @@ -8770,7 +8770,7 @@ var app = (function() { function Ce(n) { var t = 0, r = 0 - return function() { + return function () { var e = Di(), u = 16 - (e - r) if (((r = e), 0 < u)) { @@ -8783,10 +8783,10 @@ var app = (function() { var r = -1, e = n.length, u = e - 1 - for (t = t === T ? e : t; ++r < t; ) { + for (t = t === T ? e : t; ++r < t;) { var e = ir(r, u), i = n[e] - ;(n[e] = n[r]), (n[r] = i) + ; (n[e] = n[r]), (n[r] = i) } return (n.length = t), n } @@ -8799,14 +8799,14 @@ var app = (function() { if (null != n) { try { return ii.call(n) - } catch (n) {} + } catch (n) { } return n + "" } return "" } function $e(n, t) { return ( - r(N, function(r) { + r(N, function (r) { var e = "_." + r[0] t & r[1] && !o(n, e) && n.push(e) }), @@ -8837,7 +8837,7 @@ var app = (function() { var u = e - 1 return ( r !== T && - ((u = Eu(r)), (u = 0 > r ? Ui(e + u, 0) : Ci(u, e - 1))), + ((u = Eu(r)), (u = 0 > r ? Ui(e + u, 0) : Ci(u, e - 1))), _(n, ye(t, 3), u, true) ) } @@ -8861,10 +8861,10 @@ var app = (function() { if (!n || !n.length) return [] var t = 0 return ( - (n = i(n, function(n) { + (n = i(n, function (n) { if (hu(n)) return (t = Ui(n.length, t)), true })), - A(t, function(t) { + A(t, function (t) { return c(n, b(t)) }) ) @@ -8874,9 +8874,9 @@ var app = (function() { var e = He(t) return null == r ? e - : c(e, function(t) { - return n(r, T, t) - }) + : c(e, function (t) { + return n(r, T, t) + }) } function Ye(n) { return (n = An(n)), (n.__chain__ = true), n @@ -8908,7 +8908,7 @@ var app = (function() { if (typeof t != "function") throw new ti("Expected a function") return ( (n = Eu(n)), - function() { + function () { return ( 0 < --n && (r = t.apply(this, arguments)), 1 >= n && (t = T), @@ -8948,10 +8948,10 @@ var app = (function() { if (u(n)) return o(n) var r, e = bo - ;(r = n - _), - (n = t - (n - p)), - (r = g ? Ci(n, l - r) : n), - (h = e(i, r)) + ; (r = n - _), + (n = t - (n - p)), + (r = g ? Ci(n, l - r) : n), + (h = e(i, r)) } function o(n) { return (h = T), d && c ? e(n) : ((c = a = T), s) @@ -8979,13 +8979,13 @@ var app = (function() { return ( (t = Su(t) || 0), du(r) && - ((v = !!r.leading), + ((v = !!r.leading), (l = (g = "maxWait" in r) ? Ui(Su(r.maxWait) || 0, t) : l), (d = "trailing" in r ? !!r.trailing : d)), - (f.cancel = function() { + (f.cancel = function () { h !== T && lo(h), (_ = 0), (c = p = a = h = T) }), - (f.flush = function() { + (f.flush = function () { return h === T ? s : o(Go()) }), f @@ -9006,7 +9006,7 @@ var app = (function() { } function au(n) { if (typeof n != "function") throw new ti("Expected a function") - return function() { + return function () { var t = arguments switch (t.length) { case 0: @@ -9045,7 +9045,7 @@ var app = (function() { return ( !!du(n) && ((n = Ot(n)), - "[object Function]" == n || + "[object Function]" == n || "[object GeneratorFunction]" == n || "[object AsyncFunction]" == n || "[object Proxy]" == n) @@ -9076,9 +9076,9 @@ var app = (function() { return ( !(!yu(n) || "[object Object]" != Ot(n)) && ((n = di(n)), - null === n || + null === n || ((n = oi.call(n, "constructor") && n.constructor), - typeof n == "function" && n instanceof n && ii.call(n) == li)) + typeof n == "function" && n instanceof n && ii.call(n) == li)) ) } function ju(n) { @@ -9095,7 +9095,7 @@ var app = (function() { if (su(n)) return ju(n) ? M(n) : Ur(n) if (wi && n[wi]) { n = n[wi]() - for (var t, r = []; !(t = n.next()).done; ) r.push(t.value) + for (var t, r = []; !(t = n.next()).done;) r.push(t.value) return r } return ( @@ -9109,11 +9109,11 @@ var app = (function() { n === $ || n === -$ ? 1.7976931348623157e308 * (0 > n ? -1 : 1) : n === n - ? n - : 0) + ? n + : 0) : 0 === n - ? n - : 0 + ? n + : 0 } function Eu(n) { n = Au(n) @@ -9129,8 +9129,8 @@ var app = (function() { if ( (du(n) && ((n = typeof n.valueOf == "function" ? n.valueOf() : n), - (n = du(n) ? n + "" : n)), - typeof n != "string") + (n = du(n) ? n + "" : n)), + typeof n != "string") ) return 0 === n ? n : +n n = n.replace(un, "") @@ -9138,8 +9138,8 @@ var app = (function() { return t || yn.test(n) ? Dn(n.slice(2), t ? 2 : 8) : vn.test(n) - ? F - : +n + ? F + : +n } function Ou(n) { return Cr(n, Bu(n)) @@ -9173,12 +9173,12 @@ var app = (function() { } function Lu(n, t) { if (null == n) return {} - var r = c(ve(n), function(n) { + var r = c(ve(n), function (n) { return [n] }) return ( (t = ye(t)), - tr(n, r, function(n, r) { + tr(n, r, function (n, r) { return t(n, r[0]) }) ) @@ -9204,7 +9204,7 @@ var app = (function() { ) } function Tu(n) { - return function() { + return function () { return n } } @@ -9223,11 +9223,11 @@ var app = (function() { var o = !(du(e) && "chain" in e && !e.chain), f = _u(n) return ( - r(i, function(r) { + r(i, function (r) { var e = t[r] - ;(n[r] = e), - f && - (n.prototype[r] = function() { + ; (n[r] = e), + f && + (n.prototype[r] = function () { var t = this.__chain__ if (o || t) { var r = n(this.__wrapped__) @@ -9247,7 +9247,7 @@ var app = (function() { n ) } - function Pu() {} + function Pu() { } function Zu(n) { return Ie(n) ? b(Me(n)) : rr(n) } @@ -9273,7 +9273,7 @@ var app = (function() { ii = Ju.prototype.toString, oi = ei.hasOwnProperty, fi = 0, - ci = (function() { + ci = (function () { var n = /[^.]+$/.exec((ui && ui.keys && ui.keys.IE_PROTO) || "") return n ? "Symbol(src)_1." + n : "" })(), @@ -9282,14 +9282,14 @@ var app = (function() { si = $n._, hi = Xu( "^" + - ii - .call(oi) - .replace(rn, "\\$&") - .replace( - /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, - "$1.*?" - ) + - "$" + ii + .call(oi) + .replace(rn, "\\$&") + .replace( + /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, + "$1.*?" + ) + + "$" ), pi = Pn ? mn.Buffer : T, _i = mn.Symbol, @@ -9302,11 +9302,11 @@ var app = (function() { ji = _i ? _i.isConcatSpreadable : T, wi = _i ? _i.iterator : T, mi = _i ? _i.toStringTag : T, - Ai = (function() { + Ai = (function () { try { var n = je(Qu, "defineProperty") return n({}, "", {}), n - } catch (n) {} + } catch (n) { } })(), Ei = mn.clearTimeout !== $n.clearTimeout && mn.clearTimeout, ki = Gu && Gu.now !== $n.Date.now && Gu.now, @@ -9340,9 +9340,9 @@ var app = (function() { no = _i ? _i.prototype : T, to = no ? no.valueOf : T, ro = no ? no.toString : T, - eo = (function() { - function n() {} - return function(t) { + eo = (function () { + function n() { } + return function (t) { return du(t) ? yi ? yi(t) @@ -9350,248 +9350,248 @@ var app = (function() { : {} } })() - ;(An.templateSettings = { - escape: J, - evaluate: Y, - interpolate: Q, - variable: "", - imports: { _: An }, - }), - (An.prototype = En.prototype), - (An.prototype.constructor = An), - (On.prototype = eo(En.prototype)), - (On.prototype.constructor = On), - (Un.prototype = eo(En.prototype)), - (Un.prototype.constructor = Un), - (Mn.prototype.clear = function() { - ;(this.__data__ = Vi ? Vi(null) : {}), (this.size = 0) + ; (An.templateSettings = { + escape: J, + evaluate: Y, + interpolate: Q, + variable: "", + imports: { _: An }, }), - (Mn.prototype.delete = function(n) { - return ( - (n = this.has(n) && delete this.__data__[n]), - (this.size -= n ? 1 : 0), - n - ) - }), - (Mn.prototype.get = function(n) { - var t = this.__data__ - return Vi - ? ((n = t[n]), "__lodash_hash_undefined__" === n ? T : n) - : oi.call(t, n) - ? t[n] - : T - }), - (Mn.prototype.has = function(n) { - var t = this.__data__ - return Vi ? t[n] !== T : oi.call(t, n) - }), - (Mn.prototype.set = function(n, t) { - var r = this.__data__ - return ( - (this.size += this.has(n) ? 0 : 1), - (r[n] = Vi && t === T ? "__lodash_hash_undefined__" : t), - this - ) - }), - (Tn.prototype.clear = function() { - ;(this.__data__ = []), (this.size = 0) - }), - (Tn.prototype.delete = function(n) { - var t = this.__data__ - return ( - (n = ft(t, n)), - !(0 > n) && + (An.prototype = En.prototype), + (An.prototype.constructor = An), + (On.prototype = eo(En.prototype)), + (On.prototype.constructor = On), + (Un.prototype = eo(En.prototype)), + (Un.prototype.constructor = Un), + (Mn.prototype.clear = function () { + ; (this.__data__ = Vi ? Vi(null) : {}), (this.size = 0) + }), + (Mn.prototype.delete = function (n) { + return ( + (n = this.has(n) && delete this.__data__[n]), + (this.size -= n ? 1 : 0), + n + ) + }), + (Mn.prototype.get = function (n) { + var t = this.__data__ + return Vi + ? ((n = t[n]), "__lodash_hash_undefined__" === n ? T : n) + : oi.call(t, n) + ? t[n] + : T + }), + (Mn.prototype.has = function (n) { + var t = this.__data__ + return Vi ? t[n] !== T : oi.call(t, n) + }), + (Mn.prototype.set = function (n, t) { + var r = this.__data__ + return ( + (this.size += this.has(n) ? 0 : 1), + (r[n] = Vi && t === T ? "__lodash_hash_undefined__" : t), + this + ) + }), + (Tn.prototype.clear = function () { + ; (this.__data__ = []), (this.size = 0) + }), + (Tn.prototype.delete = function (n) { + var t = this.__data__ + return ( + (n = ft(t, n)), + !(0 > n) && (n == t.length - 1 ? t.pop() : xi.call(t, n, 1), - --this.size, - true) - ) - }), - (Tn.prototype.get = function(n) { - var t = this.__data__ - return (n = ft(t, n)), 0 > n ? T : t[n][1] - }), - (Tn.prototype.has = function(n) { - return -1 < ft(this.__data__, n) - }), - (Tn.prototype.set = function(n, t) { - var r = this.__data__, - e = ft(r, n) - return 0 > e ? (++this.size, r.push([n, t])) : (r[e][1] = t), this - }), - (Fn.prototype.clear = function() { - ;(this.size = 0), - (this.__data__ = { - hash: new Mn(), - map: new (Ni || Tn)(), - string: new Mn(), - }) - }), - (Fn.prototype.delete = function(n) { - return (n = be(this, n).delete(n)), (this.size -= n ? 1 : 0), n - }), - (Fn.prototype.get = function(n) { - return be(this, n).get(n) - }), - (Fn.prototype.has = function(n) { - return be(this, n).has(n) - }), - (Fn.prototype.set = function(n, t) { - var r = be(this, n), - e = r.size - return r.set(n, t), (this.size += r.size == e ? 0 : 1), this - }), - (Nn.prototype.add = Nn.prototype.push = function(n) { - return this.__data__.set(n, "__lodash_hash_undefined__"), this - }), - (Nn.prototype.has = function(n) { - return this.__data__.has(n) - }), - (Zn.prototype.clear = function() { - ;(this.__data__ = new Tn()), (this.size = 0) - }), - (Zn.prototype.delete = function(n) { - var t = this.__data__ - return (n = t.delete(n)), (this.size = t.size), n - }), - (Zn.prototype.get = function(n) { - return this.__data__.get(n) - }), - (Zn.prototype.has = function(n) { - return this.__data__.has(n) - }), - (Zn.prototype.set = function(n, t) { - var r = this.__data__ - if (r instanceof Tn) { - var e = r.__data__ - if (!Ni || 199 > e.length) - return e.push([n, t]), (this.size = ++r.size), this - r = this.__data__ = new Fn(e) - } - return r.set(n, t), (this.size = r.size), this - }) + --this.size, + true) + ) + }), + (Tn.prototype.get = function (n) { + var t = this.__data__ + return (n = ft(t, n)), 0 > n ? T : t[n][1] + }), + (Tn.prototype.has = function (n) { + return -1 < ft(this.__data__, n) + }), + (Tn.prototype.set = function (n, t) { + var r = this.__data__, + e = ft(r, n) + return 0 > e ? (++this.size, r.push([n, t])) : (r[e][1] = t), this + }), + (Fn.prototype.clear = function () { + ; (this.size = 0), + (this.__data__ = { + hash: new Mn(), + map: new (Ni || Tn)(), + string: new Mn(), + }) + }), + (Fn.prototype.delete = function (n) { + return (n = be(this, n).delete(n)), (this.size -= n ? 1 : 0), n + }), + (Fn.prototype.get = function (n) { + return be(this, n).get(n) + }), + (Fn.prototype.has = function (n) { + return be(this, n).has(n) + }), + (Fn.prototype.set = function (n, t) { + var r = be(this, n), + e = r.size + return r.set(n, t), (this.size += r.size == e ? 0 : 1), this + }), + (Nn.prototype.add = Nn.prototype.push = function (n) { + return this.__data__.set(n, "__lodash_hash_undefined__"), this + }), + (Nn.prototype.has = function (n) { + return this.__data__.has(n) + }), + (Zn.prototype.clear = function () { + ; (this.__data__ = new Tn()), (this.size = 0) + }), + (Zn.prototype.delete = function (n) { + var t = this.__data__ + return (n = t.delete(n)), (this.size = t.size), n + }), + (Zn.prototype.get = function (n) { + return this.__data__.get(n) + }), + (Zn.prototype.has = function (n) { + return this.__data__.has(n) + }), + (Zn.prototype.set = function (n, t) { + var r = this.__data__ + if (r instanceof Tn) { + var e = r.__data__ + if (!Ni || 199 > e.length) + return e.push([n, t]), (this.size = ++r.size), this + r = this.__data__ = new Fn(e) + } + return r.set(n, t), (this.size = r.size), this + }) var uo = Fr(mt), io = Fr(At, true), oo = Nr(), fo = Nr(true), co = Ki - ? function(n, t) { - return Ki.set(n, t), n - } + ? function (n, t) { + return Ki.set(n, t), n + } : $u, ao = Ai - ? function(n, t) { - return Ai(n, "toString", { - configurable: true, - enumerable: false, - value: Tu(t), - writable: true, - }) - } + ? function (n, t) { + return Ai(n, "toString", { + configurable: true, + enumerable: false, + value: Tu(t), + writable: true, + }) + } : $u, lo = Ei || - function(n) { + function (n) { return $n.clearTimeout(n) }, so = Zi && 1 / U(new Zi([, -0]))[1] == $ - ? function(n) { - return new Zi(n) - } + ? function (n) { + return new Zi(n) + } : Pu, ho = Ki - ? function(n) { - return Ki.get(n) - } + ? function (n) { + return Ki.get(n) + } : Pu, po = Ri - ? function(n) { - return null == n - ? [] - : ((n = Qu(n)), - i(Ri(n), function(t) { - return bi.call(n, t) - })) - } + ? function (n) { + return null == n + ? [] + : ((n = Qu(n)), + i(Ri(n), function (t) { + return bi.call(n, t) + })) + } : qu, _o = Ri - ? function(n) { - for (var t = []; n; ) a(t, po(n)), (n = di(n)) - return t - } + ? function (n) { + for (var t = []; n;) a(t, po(n)), (n = di(n)) + return t + } : qu, vo = Ot - ;((Fi && "[object DataView]" != vo(new Fi(new ArrayBuffer(1)))) || - (Ni && "[object Map]" != vo(new Ni())) || - (Pi && "[object Promise]" != vo(Pi.resolve())) || - (Zi && "[object Set]" != vo(new Zi())) || - (qi && "[object WeakMap]" != vo(new qi()))) && - (vo = function(n) { - var t = Ot(n) - if ( - (n = (n = "[object Object]" == t ? n.constructor : T) - ? Te(n) - : "") - ) - switch (n) { - case Hi: - return "[object DataView]" - case Ji: - return "[object Map]" - case Yi: - return "[object Promise]" - case Qi: - return "[object Set]" - case Xi: - return "[object WeakMap]" - } - return t - }) + ; ((Fi && "[object DataView]" != vo(new Fi(new ArrayBuffer(1)))) || + (Ni && "[object Map]" != vo(new Ni())) || + (Pi && "[object Promise]" != vo(Pi.resolve())) || + (Zi && "[object Set]" != vo(new Zi())) || + (qi && "[object WeakMap]" != vo(new qi()))) && + (vo = function (n) { + var t = Ot(n) + if ( + (n = (n = "[object Object]" == t ? n.constructor : T) + ? Te(n) + : "") + ) + switch (n) { + case Hi: + return "[object DataView]" + case Ji: + return "[object Map]" + case Yi: + return "[object Promise]" + case Qi: + return "[object Set]" + case Xi: + return "[object WeakMap]" + } + return t + }) var go = ui ? _u : Vu, yo = Ce(co), bo = Si || - function(n, t) { + function (n, t) { return $n.setTimeout(n, t) }, xo = Ce(ao), - jo = (function(n) { - n = cu(n, function(n) { + jo = (function (n) { + n = cu(n, function (n) { return 500 === t.size && t.clear(), n }) var t = n.cache return n - })(function(n) { + })(function (n) { var t = [] return ( 46 === n.charCodeAt(0) && t.push(""), - n.replace(tn, function(n, r, e, u) { + n.replace(tn, function (n, r, e, u) { t.push(e ? u.replace(hn, "$1") : r || n) }), t ) }), - wo = fr(function(n, t) { + wo = fr(function (n, t) { return hu(n) ? yt(n, wt(t, 1, hu, true)) : [] }), - mo = fr(function(n, t) { + mo = fr(function (n, t) { var r = Ve(t) return ( hu(r) && (r = T), hu(n) ? yt(n, wt(t, 1, hu, true), ye(r, 2)) : [] ) }), - Ao = fr(function(n, t) { + Ao = fr(function (n, t) { var r = Ve(t) return ( hu(r) && (r = T), hu(n) ? yt(n, wt(t, 1, hu, true), T, r) : [] ) }), - Eo = fr(function(n) { + Eo = fr(function (n) { var t = c(n, Er) return t.length && t[0] === n[0] ? Wt(t) : [] }), - ko = fr(function(n) { + ko = fr(function (n) { var t = Ve(n), r = c(n, Er) return ( @@ -9599,7 +9599,7 @@ var app = (function() { r.length && r[0] === n[0] ? Wt(r, ye(t, 2)) : [] ) }), - So = fr(function(n) { + So = fr(function (n) { var t = Ve(n), r = c(n, Er) return ( @@ -9608,54 +9608,54 @@ var app = (function() { ) }), Oo = fr(Ke), - Io = pe(function(n, t) { + Io = pe(function (n, t) { var r = null == n ? 0 : n.length, e = ht(n, t) return ( ur( n, - c(t, function(n) { + c(t, function (n) { return Se(n, r) ? +n : n }).sort(Wr) ), e ) }), - Ro = fr(function(n) { + Ro = fr(function (n) { return br(wt(n, 1, hu, true)) }), - zo = fr(function(n) { + zo = fr(function (n) { var t = Ve(n) return hu(t) && (t = T), br(wt(n, 1, hu, true), ye(t, 2)) }), - Wo = fr(function(n) { + Wo = fr(function (n) { var t = Ve(n), t = typeof t == "function" ? t : T return br(wt(n, 1, hu, true), T, t) }), - Bo = fr(function(n, t) { + Bo = fr(function (n, t) { return hu(n) ? yt(n, t) : [] }), - Lo = fr(function(n) { + Lo = fr(function (n) { return mr(i(n, hu)) }), - Uo = fr(function(n) { + Uo = fr(function (n) { var t = Ve(n) return hu(t) && (t = T), mr(i(n, hu), ye(t, 2)) }), - Co = fr(function(n) { + Co = fr(function (n) { var t = Ve(n), t = typeof t == "function" ? t : T return mr(i(n, hu), T, t) }), Do = fr(He), - Mo = fr(function(n) { + Mo = fr(function (n) { var t = n.length, t = 1 < t ? n[t - 1] : T, t = typeof t == "function" ? (n.pop(), t) : T return Je(n, t) }), - To = pe(function(n) { + To = pe(function (n) { function t(t) { return ht(t, n) } @@ -9667,42 +9667,42 @@ var app = (function() { Se(e) ? ((u = u.slice(e, +e + (r ? 1 : 0))), u.__actions__.push({ func: Qe, args: [t], thisArg: T }), - new On(u, this.__chain__).thru(function(n) { + new On(u, this.__chain__).thru(function (n) { return r && !n.length && n.push(T), n })) : this.thru(t) }), - $o = Tr(function(n, t, r) { + $o = Tr(function (n, t, r) { oi.call(n, r) ? ++n[r] : st(n, r, 1) }), Fo = Gr(Ne), No = Gr(Pe), - Po = Tr(function(n, t, r) { + Po = Tr(function (n, t, r) { oi.call(n, r) ? n[r].push(t) : st(n, r, [t]) }), - Zo = fr(function(t, r, e) { + Zo = fr(function (t, r, e) { var u = -1, i = typeof r == "function", o = su(t) ? Ku(t.length) : [] return ( - uo(t, function(t) { + uo(t, function (t) { o[++u] = i ? n(r, t, e) : Lt(t, r, e) }), o ) }), - qo = Tr(function(n, t, r) { + qo = Tr(function (n, t, r) { st(n, r, t) }), Vo = Tr( - function(n, t, r) { + function (n, t, r) { n[r ? 0 : 1].push(t) }, - function() { + function () { return [[], []] } ), - Ko = fr(function(n, t) { + Ko = fr(function (n, t) { if (null == n) return [] var r = t.length return ( @@ -9714,64 +9714,64 @@ var app = (function() { }), Go = ki || - function() { + function () { return $n.Date.now() }, - Ho = fr(function(n, t, r) { + Ho = fr(function (n, t, r) { var e = 1 if (r.length) var u = L(r, de(Ho)), e = 32 | e return fe(n, e, t, r, u) }), - Jo = fr(function(n, t, r) { + Jo = fr(function (n, t, r) { var e = 3 if (r.length) var u = L(r, de(Jo)), e = 32 | e return fe(t, e, n, r, u) }), - Yo = fr(function(n, t) { + Yo = fr(function (n, t) { return dt(n, 1, t) }), - Qo = fr(function(n, t, r) { + Qo = fr(function (n, t, r) { return dt(n, Su(t) || 0, r) }) cu.Cache = Fn - var Xo = fr(function(t, r) { - r = - 1 == r.length && ff(r[0]) - ? c(r[0], k(ye())) - : c(wt(r, 1), k(ye())) - var e = r.length - return fr(function(u) { - for (var i = -1, o = Ci(u.length, e); ++i < o; ) - u[i] = r[i].call(this, u[i]) - return n(t, this, u) - }) - }), - nf = fr(function(n, t) { + var Xo = fr(function (t, r) { + r = + 1 == r.length && ff(r[0]) + ? c(r[0], k(ye())) + : c(wt(r, 1), k(ye())) + var e = r.length + return fr(function (u) { + for (var i = -1, o = Ci(u.length, e); ++i < o;) + u[i] = r[i].call(this, u[i]) + return n(t, this, u) + }) + }), + nf = fr(function (n, t) { return fe(n, 32, T, t, L(t, de(nf))) }), - tf = fr(function(n, t) { + tf = fr(function (n, t) { return fe(n, 64, T, t, L(t, de(tf))) }), - rf = pe(function(n, t) { + rf = pe(function (n, t) { return fe(n, 256, T, T, T, t) }), ef = ee(It), - uf = ee(function(n, t) { + uf = ee(function (n, t) { return n >= t }), of = Ut( - (function() { + (function () { return arguments })() ) ? Ut - : function(n) { - return yu(n) && oi.call(n, "callee") && !bi.call(n, "callee") - }, + : function (n) { + return yu(n) && oi.call(n, "callee") && !bi.call(n, "callee") + }, ff = Ku.isArray, cf = Vn ? k(Vn) : Ct, af = zi || Vu, @@ -9781,116 +9781,116 @@ var app = (function() { pf = Jn ? k(Jn) : Pt, _f = Yn ? k(Yn) : Zt, vf = ee(Kt), - gf = ee(function(n, t) { + gf = ee(function (n, t) { return n <= t }), - df = $r(function(n, t) { + df = $r(function (n, t) { if (ze(t) || su(t)) Cr(t, Wu(t), n) else for (var r in t) oi.call(t, r) && ot(n, r, t[r]) }), - yf = $r(function(n, t) { + yf = $r(function (n, t) { Cr(t, Bu(t), n) }), - bf = $r(function(n, t, r, e) { + bf = $r(function (n, t, r, e) { Cr(t, Bu(t), n, e) }), - xf = $r(function(n, t, r, e) { + xf = $r(function (n, t, r, e) { Cr(t, Wu(t), n, e) }), jf = pe(ht), - wf = fr(function(n, t) { + wf = fr(function (n, t) { n = Qu(n) var r = -1, e = t.length, u = 2 < e ? t[2] : T - for (u && Oe(t[0], t[1], u) && (e = 1); ++r < e; ) - for (var u = t[r], i = Bu(u), o = -1, f = i.length; ++o < f; ) { + for (u && Oe(t[0], t[1], u) && (e = 1); ++r < e;) + for (var u = t[r], i = Bu(u), o = -1, f = i.length; ++o < f;) { var c = i[o], a = n[c] - ;(a === T || (lu(a, ei[c]) && !oi.call(n, c))) && - (n[c] = u[c]) + ; (a === T || (lu(a, ei[c]) && !oi.call(n, c))) && + (n[c] = u[c]) } return n }), - mf = fr(function(t) { + mf = fr(function (t) { return t.push(T, ae), n(Of, T, t) }), - Af = Yr(function(n, t, r) { + Af = Yr(function (n, t, r) { null != t && typeof t.toString != "function" && (t = ai.call(t)), (n[t] = r) }, Tu($u)), - Ef = Yr(function(n, t, r) { + Ef = Yr(function (n, t, r) { null != t && typeof t.toString != "function" && (t = ai.call(t)), oi.call(n, t) ? n[t].push(r) : (n[t] = [r]) }, ye), kf = fr(Lt), - Sf = $r(function(n, t, r) { + Sf = $r(function (n, t, r) { Yt(n, t, r) }), - Of = $r(function(n, t, r, e) { + Of = $r(function (n, t, r, e) { Yt(n, t, r, e) }), - If = pe(function(n, t) { + If = pe(function (n, t) { var r = {} if (null == n) return r var e = false - ;(t = c(t, function(t) { - return (t = Sr(t, n)), e || (e = 1 < t.length), t - })), - Cr(n, ve(n), r), - e && (r = _t(r, 7, le)) - for (var u = t.length; u--; ) xr(r, t[u]) + ; (t = c(t, function (t) { + return (t = Sr(t, n)), e || (e = 1 < t.length), t + })), + Cr(n, ve(n), r), + e && (r = _t(r, 7, le)) + for (var u = t.length; u--;) xr(r, t[u]) return r }), - Rf = pe(function(n, t) { + Rf = pe(function (n, t) { return null == n ? {} : nr(n, t) }), zf = oe(Wu), Wf = oe(Bu), - Bf = qr(function(n, t, r) { + Bf = qr(function (n, t, r) { return (t = t.toLowerCase()), n + (r ? Cu(t) : t) }), - Lf = qr(function(n, t, r) { + Lf = qr(function (n, t, r) { return n + (r ? "-" : "") + t.toLowerCase() }), - Uf = qr(function(n, t, r) { + Uf = qr(function (n, t, r) { return n + (r ? " " : "") + t.toLowerCase() }), Cf = Zr("toLowerCase"), - Df = qr(function(n, t, r) { + Df = qr(function (n, t, r) { return n + (r ? "_" : "") + t.toLowerCase() }), - Mf = qr(function(n, t, r) { + Mf = qr(function (n, t, r) { return n + (r ? " " : "") + $f(t) }), - Tf = qr(function(n, t, r) { + Tf = qr(function (n, t, r) { return n + (r ? " " : "") + t.toUpperCase() }), $f = Zr("toUpperCase"), - Ff = fr(function(t, r) { + Ff = fr(function (t, r) { try { return n(t, T, r) } catch (n) { return pu(n) ? n : new Hu(n) } }), - Nf = pe(function(n, t) { + Nf = pe(function (n, t) { return ( - r(t, function(t) { - ;(t = Me(t)), st(n, t, Ho(n[t], n)) + r(t, function (t) { + ; (t = Me(t)), st(n, t, Ho(n[t], n)) }), n ) }), Pf = Hr(), Zf = Hr(true), - qf = fr(function(n, t) { - return function(r) { + qf = fr(function (n, t) { + return function (r) { return Lt(r, n, t) } }), - Vf = fr(function(n, t) { - return function(r) { + Vf = fr(function (n, t) { + return function (r) { return Lt(n, r, t) } }), @@ -9899,27 +9899,27 @@ var app = (function() { Hf = Xr(h), Jf = re(), Yf = re(true), - Qf = Qr(function(n, t) { + Qf = Qr(function (n, t) { return n + t }, 0), Xf = ie("ceil"), - nc = Qr(function(n, t) { + nc = Qr(function (n, t) { return n / t }, 1), tc = ie("floor"), - rc = Qr(function(n, t) { + rc = Qr(function (n, t) { return n * t }, 1), ec = ie("round"), - uc = Qr(function(n, t) { + uc = Qr(function (n, t) { return n - t }, 0) return ( - (An.after = function(n, t) { + (An.after = function (n, t) { if (typeof t != "function") throw new ti("Expected a function") return ( (n = Eu(n)), - function() { + function () { if (1 > --n) return t.apply(this, arguments) } ) @@ -9934,24 +9934,24 @@ var app = (function() { (An.bind = Ho), (An.bindAll = Nf), (An.bindKey = Jo), - (An.castArray = function() { + (An.castArray = function () { if (!arguments.length) return [] var n = arguments[0] return ff(n) ? n : [n] }), (An.chain = Ye), - (An.chunk = function(n, t, r) { + (An.chunk = function (n, t, r) { if ( ((t = (r ? Oe(n, t, r) : t === T) ? 1 : Ui(Eu(t), 0)), - (r = null == n ? 0 : n.length), - !r || 1 > t) + (r = null == n ? 0 : n.length), + !r || 1 > t) ) return [] - for (var e = 0, u = 0, i = Ku(Oi(r / t)); e < r; ) + for (var e = 0, u = 0, i = Ku(Oi(r / t)); e < r;) i[u++] = hr(n, e, (e += t)) return i }), - (An.compact = function(n) { + (An.compact = function (n) { for ( var t = -1, r = null == n ? 0 : n.length, e = 0, u = []; ++t < r; @@ -9962,38 +9962,38 @@ var app = (function() { } return u }), - (An.concat = function() { + (An.concat = function () { var n = arguments.length if (!n) return [] - for (var t = Ku(n - 1), r = arguments[0]; n--; ) + for (var t = Ku(n - 1), r = arguments[0]; n--;) t[n - 1] = arguments[n] return a(ff(r) ? Ur(r) : [r], wt(t, 1)) }), - (An.cond = function(t) { + (An.cond = function (t) { var r = null == t ? 0 : t.length, e = ye() return ( (t = r - ? c(t, function(n) { - if ("function" != typeof n[1]) - throw new ti("Expected a function") - return [e(n[0]), n[1]] - }) + ? c(t, function (n) { + if ("function" != typeof n[1]) + throw new ti("Expected a function") + return [e(n[0]), n[1]] + }) : []), - fr(function(e) { - for (var u = -1; ++u < r; ) { + fr(function (e) { + for (var u = -1; ++u < r;) { var i = t[u] if (n(i[0], this, e)) return n(i[1], this, e) } }) ) }), - (An.conforms = function(n) { + (An.conforms = function (n) { return vt(_t(n, 1)) }), (An.constant = Tu), (An.countBy = $o), - (An.create = function(n, t) { + (An.create = function (n, t) { var r = eo(n) return null == t ? r : at(r, t) }), @@ -10007,13 +10007,13 @@ var app = (function() { (An.difference = wo), (An.differenceBy = mo), (An.differenceWith = Ao), - (An.drop = function(n, t, r) { + (An.drop = function (n, t, r) { var e = null == n ? 0 : n.length return e ? ((t = r || t === T ? 1 : Eu(t)), hr(n, 0 > t ? 0 : t, e)) : [] }), - (An.dropRight = function(n, t, r) { + (An.dropRight = function (n, t, r) { var e = null == n ? 0 : n.length return e ? ((t = r || t === T ? 1 : Eu(t)), @@ -10021,56 +10021,56 @@ var app = (function() { hr(n, 0, 0 > t ? 0 : t)) : [] }), - (An.dropRightWhile = function(n, t) { + (An.dropRightWhile = function (n, t) { return n && n.length ? jr(n, ye(t, 3), true, true) : [] }), - (An.dropWhile = function(n, t) { + (An.dropWhile = function (n, t) { return n && n.length ? jr(n, ye(t, 3), true) : [] }), - (An.fill = function(n, t, r, e) { + (An.fill = function (n, t, r, e) { var u = null == n ? 0 : n.length if (!u) return [] for ( r && typeof r != "number" && Oe(n, t, r) && ((r = 0), (e = u)), - u = n.length, - r = Eu(r), - 0 > r && (r = -r > u ? 0 : u + r), - e = e === T || e > u ? u : Eu(e), - 0 > e && (e += u), - e = r > e ? 0 : ku(e); + u = n.length, + r = Eu(r), + 0 > r && (r = -r > u ? 0 : u + r), + e = e === T || e > u ? u : Eu(e), + 0 > e && (e += u), + e = r > e ? 0 : ku(e); r < e; ) n[r++] = t return n }), - (An.filter = function(n, t) { + (An.filter = function (n, t) { return (ff(n) ? i : jt)(n, ye(t, 3)) }), - (An.flatMap = function(n, t) { + (An.flatMap = function (n, t) { return wt(ru(n, t), 1) }), - (An.flatMapDeep = function(n, t) { + (An.flatMapDeep = function (n, t) { return wt(ru(n, t), $) }), - (An.flatMapDepth = function(n, t, r) { + (An.flatMapDepth = function (n, t, r) { return (r = r === T ? 1 : Eu(r)), wt(ru(n, t), r) }), (An.flatten = Ze), - (An.flattenDeep = function(n) { + (An.flattenDeep = function (n) { return (null == n ? 0 : n.length) ? wt(n, $) : [] }), - (An.flattenDepth = function(n, t) { + (An.flattenDepth = function (n, t) { return null != n && n.length ? ((t = t === T ? 1 : Eu(t)), wt(n, t)) : [] }), - (An.flip = function(n) { + (An.flip = function (n) { return fe(n, 512) }), (An.flow = Pf), (An.flowRight = Zf), - (An.fromPairs = function(n) { + (An.fromPairs = function (n) { for ( var t = -1, r = null == n ? 0 : n.length, e = {}; ++t < r; @@ -10081,14 +10081,14 @@ var app = (function() { } return e }), - (An.functions = function(n) { + (An.functions = function (n) { return null == n ? [] : Et(n, Wu(n)) }), - (An.functionsIn = function(n) { + (An.functionsIn = function (n) { return null == n ? [] : Et(n, Bu(n)) }), (An.groupBy = Po), - (An.initial = function(n) { + (An.initial = function (n) { return (null == n ? 0 : n.length) ? hr(n, 0, -1) : [] }), (An.intersection = Eo), @@ -10102,30 +10102,30 @@ var app = (function() { (An.keys = Wu), (An.keysIn = Bu), (An.map = ru), - (An.mapKeys = function(n, t) { + (An.mapKeys = function (n, t) { var r = {} return ( (t = ye(t, 3)), - mt(n, function(n, e, u) { + mt(n, function (n, e, u) { st(r, t(n, e, u), n) }), r ) }), - (An.mapValues = function(n, t) { + (An.mapValues = function (n, t) { var r = {} return ( (t = ye(t, 3)), - mt(n, function(n, e, u) { + mt(n, function (n, e, u) { st(r, e, t(n, e, u)) }), r ) }), - (An.matches = function(n) { + (An.matches = function (n) { return Ht(_t(n, 1)) }), - (An.matchesProperty = function(n, t) { + (An.matchesProperty = function (n, t) { return Jt(n, _t(t, 1)) }), (An.memoize = cu), @@ -10135,22 +10135,22 @@ var app = (function() { (An.methodOf = Vf), (An.mixin = Nu), (An.negate = au), - (An.nthArg = function(n) { + (An.nthArg = function (n) { return ( (n = Eu(n)), - fr(function(t) { + fr(function (t) { return Qt(t, n) }) ) }), (An.omit = If), - (An.omitBy = function(n, t) { + (An.omitBy = function (n, t) { return Lu(n, au(ye(t))) }), - (An.once = function(n) { + (An.once = function (n) { return uu(2, n) }), - (An.orderBy = function(n, t, r, e) { + (An.orderBy = function (n, t, r, e) { return null == n ? [] : (ff(t) || (t = null == t ? [] : [t]), @@ -10168,78 +10168,78 @@ var app = (function() { (An.pick = Rf), (An.pickBy = Lu), (An.property = Zu), - (An.propertyOf = function(n) { - return function(t) { + (An.propertyOf = function (n) { + return function (t) { return null == n ? T : kt(n, t) } }), (An.pull = Oo), (An.pullAll = Ke), - (An.pullAllBy = function(n, t, r) { + (An.pullAllBy = function (n, t, r) { return n && n.length && t && t.length ? er(n, t, ye(r, 2)) : n }), - (An.pullAllWith = function(n, t, r) { + (An.pullAllWith = function (n, t, r) { return n && n.length && t && t.length ? er(n, t, T, r) : n }), (An.pullAt = Io), (An.range = Jf), (An.rangeRight = Yf), (An.rearg = rf), - (An.reject = function(n, t) { + (An.reject = function (n, t) { return (ff(n) ? i : jt)(n, au(ye(t, 3))) }), - (An.remove = function(n, t) { + (An.remove = function (n, t) { var r = [] if (!n || !n.length) return r var e = -1, u = [], i = n.length - for (t = ye(t, 3); ++e < i; ) { + for (t = ye(t, 3); ++e < i;) { var o = n[e] t(o, e, n) && (r.push(o), u.push(e)) } return ur(n, u), r }), - (An.rest = function(n, t) { + (An.rest = function (n, t) { if (typeof n != "function") throw new ti("Expected a function") return (t = t === T ? t : Eu(t)), fr(n, t) }), (An.reverse = Ge), - (An.sampleSize = function(n, t, r) { + (An.sampleSize = function (n, t, r) { return ( (t = (r ? Oe(n, t, r) : t === T) ? 1 : Eu(t)), (ff(n) ? et : ar)(n, t) ) }), - (An.set = function(n, t, r) { + (An.set = function (n, t, r) { return null == n ? n : lr(n, t, r) }), - (An.setWith = function(n, t, r, e) { + (An.setWith = function (n, t, r, e) { return ( (e = typeof e == "function" ? e : T), null == n ? n : lr(n, t, r, e) ) }), - (An.shuffle = function(n) { + (An.shuffle = function (n) { return (ff(n) ? ut : sr)(n) }), - (An.slice = function(n, t, r) { + (An.slice = function (n, t, r) { var e = null == n ? 0 : n.length return e ? (r && typeof r != "number" && Oe(n, t, r) - ? ((t = 0), (r = e)) - : ((t = null == t ? 0 : Eu(t)), (r = r === T ? e : Eu(r))), + ? ((t = 0), (r = e)) + : ((t = null == t ? 0 : Eu(t)), (r = r === T ? e : Eu(r))), hr(n, t, r)) : [] }), (An.sortBy = Ko), - (An.sortedUniq = function(n) { + (An.sortedUniq = function (n) { return n && n.length ? gr(n) : [] }), - (An.sortedUniqBy = function(n, t) { + (An.sortedUniqBy = function (n, t) { return n && n.length ? gr(n, ye(t, 2)) : [] }), - (An.split = function(n, t, r) { + (An.split = function (n, t, r) { return ( r && typeof r != "number" && Oe(n, t, r) && (t = r = T), (r = r === T ? 4294967295 : r >>> 0), @@ -10252,26 +10252,26 @@ var app = (function() { : [] ) }), - (An.spread = function(t, r) { + (An.spread = function (t, r) { if (typeof t != "function") throw new ti("Expected a function") return ( (r = null == r ? 0 : Ui(Eu(r), 0)), - fr(function(e) { + fr(function (e) { var u = e[r] return (e = Or(e, 0, r)), u && a(e, u), n(t, this, e) }) ) }), - (An.tail = function(n) { + (An.tail = function (n) { var t = null == n ? 0 : n.length return t ? hr(n, 1, t) : [] }), - (An.take = function(n, t, r) { + (An.take = function (n, t, r) { return n && n.length ? ((t = r || t === T ? 1 : Eu(t)), hr(n, 0, 0 > t ? 0 : t)) : [] }), - (An.takeRight = function(n, t, r) { + (An.takeRight = function (n, t, r) { var e = null == n ? 0 : n.length return e ? ((t = r || t === T ? 1 : Eu(t)), @@ -10279,22 +10279,22 @@ var app = (function() { hr(n, 0 > t ? 0 : t, e)) : [] }), - (An.takeRightWhile = function(n, t) { + (An.takeRightWhile = function (n, t) { return n && n.length ? jr(n, ye(t, 3), false, true) : [] }), - (An.takeWhile = function(n, t) { + (An.takeWhile = function (n, t) { return n && n.length ? jr(n, ye(t, 3)) : [] }), - (An.tap = function(n, t) { + (An.tap = function (n, t) { return t(n), n }), - (An.throttle = function(n, t, r) { + (An.throttle = function (n, t, r) { var e = true, u = true if (typeof n != "function") throw new ti("Expected a function") return ( du(r) && - ((e = "leading" in r ? !!r.leading : e), + ((e = "leading" in r ? !!r.leading : e), (u = "trailing" in r ? !!r.trailing : u)), fu(n, t, { leading: e, maxWait: t, trailing: u }) ) @@ -10303,11 +10303,11 @@ var app = (function() { (An.toArray = mu), (An.toPairs = zf), (An.toPairsIn = Wf), - (An.toPath = function(n) { + (An.toPath = function (n) { return ff(n) ? c(n, Me) : wu(n) ? [n] : Ur(jo(Iu(n))) }), (An.toPlainObject = Ou), - (An.transform = function(n, t, e) { + (An.transform = function (n, t, e) { var u = ff(n), i = u || af(n) || _f(n) if (((t = ye(t, 4)), null == e)) { @@ -10315,39 +10315,39 @@ var app = (function() { e = i ? (u ? new o() : []) : du(n) && _u(o) ? eo(di(n)) : {} } return ( - (i ? r : mt)(n, function(n, r, u) { + (i ? r : mt)(n, function (n, r, u) { return t(e, n, r, u) }), e ) }), - (An.unary = function(n) { + (An.unary = function (n) { return eu(n, 1) }), (An.union = Ro), (An.unionBy = zo), (An.unionWith = Wo), - (An.uniq = function(n) { + (An.uniq = function (n) { return n && n.length ? br(n) : [] }), - (An.uniqBy = function(n, t) { + (An.uniqBy = function (n, t) { return n && n.length ? br(n, ye(t, 2)) : [] }), - (An.uniqWith = function(n, t) { + (An.uniqWith = function (n, t) { return ( (t = typeof t == "function" ? t : T), n && n.length ? br(n, T, t) : [] ) }), - (An.unset = function(n, t) { + (An.unset = function (n, t) { return null == n || xr(n, t) }), (An.unzip = He), (An.unzipWith = Je), - (An.update = function(n, t, r) { + (An.update = function (n, t, r) { return null == n ? n : lr(n, t, kr(r)(kt(n, t)), void 0) }), - (An.updateWith = function(n, t, r, e) { + (An.updateWith = function (n, t, r, e) { return ( (e = typeof e == "function" ? e : T), null != n && (n = lr(n, t, kr(r)(kt(n, t)), e)), @@ -10355,22 +10355,22 @@ var app = (function() { ) }), (An.values = Uu), - (An.valuesIn = function(n) { + (An.valuesIn = function (n) { return null == n ? [] : S(n, Bu(n)) }), (An.without = Bo), (An.words = Mu), - (An.wrap = function(n, t) { + (An.wrap = function (n, t) { return nf(kr(t), n) }), (An.xor = Lo), (An.xorBy = Uo), (An.xorWith = Co), (An.zip = Do), - (An.zipObject = function(n, t) { + (An.zipObject = function (n, t) { return Ar(n || [], t || [], ot) }), - (An.zipObjectDeep = function(n, t) { + (An.zipObjectDeep = function (n, t) { return Ar(n || [], t || [], lr) }), (An.zipWith = Mo), @@ -10384,7 +10384,7 @@ var app = (function() { (An.camelCase = Bf), (An.capitalize = Cu), (An.ceil = Xf), - (An.clamp = function(n, t, r) { + (An.clamp = function (n, t, r) { return ( r === T && ((r = t), (t = T)), r !== T && ((r = Su(r)), (r = r === r ? r : 0)), @@ -10392,78 +10392,78 @@ var app = (function() { pt(Su(n), t, r) ) }), - (An.clone = function(n) { + (An.clone = function (n) { return _t(n, 4) }), - (An.cloneDeep = function(n) { + (An.cloneDeep = function (n) { return _t(n, 5) }), - (An.cloneDeepWith = function(n, t) { + (An.cloneDeepWith = function (n, t) { return (t = typeof t == "function" ? t : T), _t(n, 5, t) }), - (An.cloneWith = function(n, t) { + (An.cloneWith = function (n, t) { return (t = typeof t == "function" ? t : T), _t(n, 4, t) }), - (An.conformsTo = function(n, t) { + (An.conformsTo = function (n, t) { return null == t || gt(n, t, Wu(t)) }), (An.deburr = Du), - (An.defaultTo = function(n, t) { + (An.defaultTo = function (n, t) { return null == n || n !== n ? t : n }), (An.divide = nc), - (An.endsWith = function(n, t, r) { - ;(n = Iu(n)), (t = yr(t)) + (An.endsWith = function (n, t, r) { + ; (n = Iu(n)), (t = yr(t)) var e = n.length, e = (r = r === T ? e : pt(Eu(r), 0, e)) return (r -= t.length), 0 <= r && n.slice(r, e) == t }), (An.eq = lu), - (An.escape = function(n) { + (An.escape = function (n) { return (n = Iu(n)) && H.test(n) ? n.replace(K, nt) : n }), - (An.escapeRegExp = function(n) { + (An.escapeRegExp = function (n) { return (n = Iu(n)) && en.test(n) ? n.replace(rn, "\\$&") : n }), - (An.every = function(n, t, r) { + (An.every = function (n, t, r) { var e = ff(n) ? u : bt return r && Oe(n, t, r) && (t = T), e(n, ye(t, 3)) }), (An.find = Fo), (An.findIndex = Ne), - (An.findKey = function(n, t) { + (An.findKey = function (n, t) { return p(n, ye(t, 3), mt) }), (An.findLast = No), (An.findLastIndex = Pe), - (An.findLastKey = function(n, t) { + (An.findLastKey = function (n, t) { return p(n, ye(t, 3), At) }), (An.floor = tc), (An.forEach = nu), (An.forEachRight = tu), - (An.forIn = function(n, t) { + (An.forIn = function (n, t) { return null == n ? n : oo(n, ye(t, 3), Bu) }), - (An.forInRight = function(n, t) { + (An.forInRight = function (n, t) { return null == n ? n : fo(n, ye(t, 3), Bu) }), - (An.forOwn = function(n, t) { + (An.forOwn = function (n, t) { return n && mt(n, ye(t, 3)) }), - (An.forOwnRight = function(n, t) { + (An.forOwnRight = function (n, t) { return n && At(n, ye(t, 3)) }), (An.get = Ru), (An.gt = ef), (An.gte = uf), - (An.has = function(n, t) { + (An.has = function (n, t) { return null != n && we(n, t, Rt) }), (An.hasIn = zu), (An.head = qe), (An.identity = $u), - (An.includes = function(n, t, r, e) { + (An.includes = function (n, t, r, e) { return ( (n = su(n) ? n : Uu(n)), (r = r && !e ? Eu(r) : 0), @@ -10472,7 +10472,7 @@ var app = (function() { ju(n) ? r <= e && -1 < n.indexOf(t, r) : !!e && -1 < v(n, t, r) ) }), - (An.indexOf = function(n, t, r) { + (An.indexOf = function (n, t, r) { var e = null == n ? 0 : n.length return e ? ((r = null == r ? 0 : Eu(r)), @@ -10480,7 +10480,7 @@ var app = (function() { v(n, t, r)) : -1 }), - (An.inRange = function(n, t, r) { + (An.inRange = function (n, t, r) { return ( (t = Au(t)), r === T ? ((r = t), (t = 0)) : (r = Au(r)), @@ -10494,7 +10494,7 @@ var app = (function() { (An.isArrayBuffer = cf), (An.isArrayLike = su), (An.isArrayLikeObject = hu), - (An.isBoolean = function(n) { + (An.isBoolean = function (n) { return ( true === n || false === n || @@ -10503,10 +10503,10 @@ var app = (function() { }), (An.isBuffer = af), (An.isDate = lf), - (An.isElement = function(n) { + (An.isElement = function (n) { return yu(n) && 1 === n.nodeType && !xu(n) }), - (An.isEmpty = function(n) { + (An.isEmpty = function (n) { if (null == n) return true if ( su(n) && @@ -10524,41 +10524,41 @@ var app = (function() { for (var r in n) if (oi.call(n, r)) return false return true }), - (An.isEqual = function(n, t) { + (An.isEqual = function (n, t) { return Mt(n, t) }), - (An.isEqualWith = function(n, t, r) { + (An.isEqualWith = function (n, t, r) { var e = (r = typeof r == "function" ? r : T) ? r(n, t) : T return e === T ? Mt(n, t, T, r) : !!e }), (An.isError = pu), - (An.isFinite = function(n) { + (An.isFinite = function (n) { return typeof n == "number" && Wi(n) }), (An.isFunction = _u), (An.isInteger = vu), (An.isLength = gu), (An.isMap = sf), - (An.isMatch = function(n, t) { + (An.isMatch = function (n, t) { return n === t || $t(n, t, xe(t)) }), - (An.isMatchWith = function(n, t, r) { + (An.isMatchWith = function (n, t, r) { return (r = typeof r == "function" ? r : T), $t(n, t, xe(t), r) }), - (An.isNaN = function(n) { + (An.isNaN = function (n) { return bu(n) && n != +n }), - (An.isNative = function(n) { + (An.isNative = function (n) { if (go(n)) throw new Hu( "Unsupported core-js use. Try https://npms.io/search?q=ponyfill." ) return Ft(n) }), - (An.isNil = function(n) { + (An.isNil = function (n) { return null == n }), - (An.isNull = function(n) { + (An.isNull = function (n) { return null === n }), (An.isNumber = bu), @@ -10566,37 +10566,37 @@ var app = (function() { (An.isObjectLike = yu), (An.isPlainObject = xu), (An.isRegExp = hf), - (An.isSafeInteger = function(n) { + (An.isSafeInteger = function (n) { return vu(n) && -9007199254740991 <= n && 9007199254740991 >= n }), (An.isSet = pf), (An.isString = ju), (An.isSymbol = wu), (An.isTypedArray = _f), - (An.isUndefined = function(n) { + (An.isUndefined = function (n) { return n === T }), - (An.isWeakMap = function(n) { + (An.isWeakMap = function (n) { return yu(n) && "[object WeakMap]" == vo(n) }), - (An.isWeakSet = function(n) { + (An.isWeakSet = function (n) { return yu(n) && "[object WeakSet]" == Ot(n) }), - (An.join = function(n, t) { + (An.join = function (n, t) { return null == n ? "" : Bi.call(n, t) }), (An.kebabCase = Lf), (An.last = Ve), - (An.lastIndexOf = function(n, t, r) { + (An.lastIndexOf = function (n, t, r) { var e = null == n ? 0 : n.length if (!e) return -1 var u = e if ( (r !== T && ((u = Eu(r)), (u = 0 > u ? Ui(e + u, 0) : Ci(u, e - 1))), - t === t) + t === t) ) { - for (r = u + 1; r-- && n[r] !== t; ); + for (r = u + 1; r-- && n[r] !== t;); n = r } else n = _(n, d, u, true) return n @@ -10605,110 +10605,110 @@ var app = (function() { (An.lowerFirst = Cf), (An.lt = vf), (An.lte = gf), - (An.max = function(n) { + (An.max = function (n) { return n && n.length ? xt(n, $u, It) : T }), - (An.maxBy = function(n, t) { + (An.maxBy = function (n, t) { return n && n.length ? xt(n, ye(t, 2), It) : T }), - (An.mean = function(n) { + (An.mean = function (n) { return y(n, $u) }), - (An.meanBy = function(n, t) { + (An.meanBy = function (n, t) { return y(n, ye(t, 2)) }), - (An.min = function(n) { + (An.min = function (n) { return n && n.length ? xt(n, $u, Kt) : T }), - (An.minBy = function(n, t) { + (An.minBy = function (n, t) { return n && n.length ? xt(n, ye(t, 2), Kt) : T }), (An.stubArray = qu), (An.stubFalse = Vu), - (An.stubObject = function() { + (An.stubObject = function () { return {} }), - (An.stubString = function() { + (An.stubString = function () { return "" }), - (An.stubTrue = function() { + (An.stubTrue = function () { return true }), (An.multiply = rc), - (An.nth = function(n, t) { + (An.nth = function (n, t) { return n && n.length ? Qt(n, Eu(t)) : T }), - (An.noConflict = function() { + (An.noConflict = function () { return $n._ === this && ($n._ = si), this }), (An.noop = Pu), (An.now = Go), - (An.pad = function(n, t, r) { + (An.pad = function (n, t, r) { n = Iu(n) var e = (t = Eu(t)) ? D(n) : 0 return !t || e >= t ? n : ((t = (t - e) / 2), ne(Ii(t), r) + n + ne(Oi(t), r)) }), - (An.padEnd = function(n, t, r) { + (An.padEnd = function (n, t, r) { n = Iu(n) var e = (t = Eu(t)) ? D(n) : 0 return t && e < t ? n + ne(t - e, r) : n }), - (An.padStart = function(n, t, r) { + (An.padStart = function (n, t, r) { n = Iu(n) var e = (t = Eu(t)) ? D(n) : 0 return t && e < t ? ne(t - e, r) + n : n }), - (An.parseInt = function(n, t, r) { + (An.parseInt = function (n, t, r) { return ( r || null == t ? (t = 0) : t && (t = +t), Mi(Iu(n).replace(on, ""), t || 0) ) }), - (An.random = function(n, t, r) { + (An.random = function (n, t, r) { if ( (r && typeof r != "boolean" && Oe(n, t, r) && (t = r = T), - r === T && + r === T && (typeof t == "boolean" ? ((r = t), (t = T)) : typeof n == "boolean" && ((r = n), (n = T))), - n === T && t === T - ? ((n = 0), (t = 1)) - : ((n = Au(n)), t === T ? ((t = n), (n = 0)) : (t = Au(t))), - n > t) + n === T && t === T + ? ((n = 0), (t = 1)) + : ((n = Au(n)), t === T ? ((t = n), (n = 0)) : (t = Au(t))), + n > t) ) { var e = n - ;(n = t), (t = e) + ; (n = t), (t = e) } return r || n % 1 || t % 1 ? ((r = Ti()), Ci(n + r * (t - n + Cn("1e-" + ((r + "").length - 1))), t)) : ir(n, t) }), - (An.reduce = function(n, t, r) { + (An.reduce = function (n, t, r) { var e = ff(n) ? l : j, u = 3 > arguments.length return e(n, ye(t, 4), r, u, uo) }), - (An.reduceRight = function(n, t, r) { + (An.reduceRight = function (n, t, r) { var e = ff(n) ? s : j, u = 3 > arguments.length return e(n, ye(t, 4), r, u, io) }), - (An.repeat = function(n, t, r) { + (An.repeat = function (n, t, r) { return (t = (r ? Oe(n, t, r) : t === T) ? 1 : Eu(t)), or(Iu(n), t) }), - (An.replace = function() { + (An.replace = function () { var n = arguments, t = Iu(n[0]) return 3 > n.length ? t : t.replace(n[1], n[2]) }), - (An.result = function(n, t, r) { + (An.result = function (n, t, r) { t = Sr(t, n) var e = -1, u = t.length - for (u || ((u = 1), (n = T)); ++e < u; ) { + for (u || ((u = 1), (n = T)); ++e < u;) { var i = null == n ? T : n[Me(t[e])] i === T && ((e = u), (i = r)), (n = _u(i) ? i.call(n) : i) } @@ -10716,10 +10716,10 @@ var app = (function() { }), (An.round = ec), (An.runInContext = x), - (An.sample = function(n) { + (An.sample = function (n) { return (ff(n) ? Qn : cr)(n) }), - (An.size = function(n) { + (An.size = function (n) { if (null == n) return 0 if (su(n)) return ju(n) ? D(n) : n.length var t = vo(n) @@ -10728,17 +10728,17 @@ var app = (function() { : Vt(n).length }), (An.snakeCase = Df), - (An.some = function(n, t, r) { + (An.some = function (n, t, r) { var e = ff(n) ? h : pr return r && Oe(n, t, r) && (t = T), e(n, ye(t, 3)) }), - (An.sortedIndex = function(n, t) { + (An.sortedIndex = function (n, t) { return _r(n, t) }), - (An.sortedIndexBy = function(n, t, r) { + (An.sortedIndexBy = function (n, t, r) { return vr(n, t, ye(r, 2)) }), - (An.sortedIndexOf = function(n, t) { + (An.sortedIndexOf = function (n, t) { var r = null == n ? 0 : n.length if (r) { var e = _r(n, t) @@ -10746,13 +10746,13 @@ var app = (function() { } return -1 }), - (An.sortedLastIndex = function(n, t) { + (An.sortedLastIndex = function (n, t) { return _r(n, t, true) }), - (An.sortedLastIndexBy = function(n, t, r) { + (An.sortedLastIndexBy = function (n, t, r) { return vr(n, t, ye(r, 2), true) }), - (An.sortedLastIndexOf = function(n, t) { + (An.sortedLastIndexOf = function (n, t) { if (null == n ? 0 : n.length) { var r = _r(n, t, true) - 1 if (lu(n[r], t)) return r @@ -10760,7 +10760,7 @@ var app = (function() { return -1 }), (An.startCase = Mf), - (An.startsWith = function(n, t, r) { + (An.startsWith = function (n, t, r) { return ( (n = Iu(n)), (r = null == r ? 0 : pt(Eu(r), 0, n.length)), @@ -10769,13 +10769,13 @@ var app = (function() { ) }), (An.subtract = uc), - (An.sum = function(n) { + (An.sum = function (n) { return n && n.length ? m(n, $u) : 0 }), - (An.sumBy = function(n, t) { + (An.sumBy = function (n, t) { return n && n.length ? m(n, ye(t, 2)) : 0 }), - (An.template = function(n, t, r) { + (An.template = function (n, t, r) { var e = An.templateSettings r && Oe(n, t, r) && (t = T), (n = Iu(n)), @@ -10790,22 +10790,22 @@ var app = (function() { var a = "__p+='" r = Xu( (t.escape || jn).source + - "|" + - r.source + - "|" + - (r === Q ? pn : jn).source + - "|" + - (t.evaluate || jn).source + - "|$", + "|" + + r.source + + "|" + + (r === Q ? pn : jn).source + + "|" + + (t.evaluate || jn).source + + "|$", "g" ) var l = oi.call(t, "sourceURL") ? "//# sourceURL=" + - (t.sourceURL + "").replace(/[\r\n]/g, " ") + - "\n" + (t.sourceURL + "").replace(/[\r\n]/g, " ") + + "\n" : "" if ( - (n.replace(r, function(t, r, e, o, f, l) { + (n.replace(r, function (t, r, e, o, f, l) { return ( e || (e = o), (a += n.slice(c, l).replace(wn, z)), @@ -10816,84 +10816,84 @@ var app = (function() { t ) }), - (a += "';"), - (t = oi.call(t, "variable") && t.variable) || + (a += "';"), + (t = oi.call(t, "variable") && t.variable) || (a = "with(obj){" + a + "}"), - (a = (i ? a.replace(P, "") : a) - .replace(Z, "$1") - .replace(q, "$1;")), - (a = - "function(" + - (t || "obj") + - "){" + - (t ? "" : "obj||(obj={});") + - "var __t,__p=''" + - (u ? ",__e=_.escape" : "") + - (i - ? ",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}" - : ";") + - a + - "return __p}"), - (t = Ff(function() { - return Ju(o, l + "return " + a).apply(T, f) - })), - (t.source = a), - pu(t)) + (a = (i ? a.replace(P, "") : a) + .replace(Z, "$1") + .replace(q, "$1;")), + (a = + "function(" + + (t || "obj") + + "){" + + (t ? "" : "obj||(obj={});") + + "var __t,__p=''" + + (u ? ",__e=_.escape" : "") + + (i + ? ",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}" + : ";") + + a + + "return __p}"), + (t = Ff(function () { + return Ju(o, l + "return " + a).apply(T, f) + })), + (t.source = a), + pu(t)) ) throw t return t }), - (An.times = function(n, t) { + (An.times = function (n, t) { if (((n = Eu(n)), 1 > n || 9007199254740991 < n)) return [] var r = 4294967295, e = Ci(n, 4294967295) - for (t = ye(t), n -= 4294967295, e = A(e, t); ++r < n; ) t(r) + for (t = ye(t), n -= 4294967295, e = A(e, t); ++r < n;) t(r) return e }), (An.toFinite = Au), (An.toInteger = Eu), (An.toLength = ku), - (An.toLower = function(n) { + (An.toLower = function (n) { return Iu(n).toLowerCase() }), (An.toNumber = Su), - (An.toSafeInteger = function(n) { + (An.toSafeInteger = function (n) { return n ? pt(Eu(n), -9007199254740991, 9007199254740991) : 0 === n - ? n - : 0 + ? n + : 0 }), (An.toString = Iu), - (An.toUpper = function(n) { + (An.toUpper = function (n) { return Iu(n).toUpperCase() }), - (An.trim = function(n, t, r) { + (An.trim = function (n, t, r) { return (n = Iu(n)) && (r || t === T) ? n.replace(un, "") : n && (t = yr(t)) - ? ((n = M(n)), - (r = M(t)), - (t = I(n, r)), - (r = R(n, r) + 1), - Or(n, t, r).join("")) - : n + ? ((n = M(n)), + (r = M(t)), + (t = I(n, r)), + (r = R(n, r) + 1), + Or(n, t, r).join("")) + : n }), - (An.trimEnd = function(n, t, r) { + (An.trimEnd = function (n, t, r) { return (n = Iu(n)) && (r || t === T) ? n.replace(fn, "") : n && (t = yr(t)) - ? ((n = M(n)), (t = R(n, M(t)) + 1), Or(n, 0, t).join("")) - : n + ? ((n = M(n)), (t = R(n, M(t)) + 1), Or(n, 0, t).join("")) + : n }), - (An.trimStart = function(n, t, r) { + (An.trimStart = function (n, t, r) { return (n = Iu(n)) && (r || t === T) ? n.replace(on, "") : n && (t = yr(t)) - ? ((n = M(n)), (t = I(n, M(t))), Or(n, t).join("")) - : n + ? ((n = M(n)), (t = I(n, M(t))), Or(n, t).join("")) + : n }), - (An.truncate = function(n, t) { + (An.truncate = function (n, t) { var r = 30, e = "..." if (du(t)) @@ -10914,7 +10914,7 @@ var app = (function() { var f = r for ( u.global || (u = Xu(u.source, Iu(_n.exec(u)) + "g")), - u.lastIndex = 0; + u.lastIndex = 0; (o = u.exec(f)); ) @@ -10926,10 +10926,10 @@ var app = (function() { ((u = r.lastIndexOf(u)), -1 < u && (r = r.slice(0, u))) return r + e }), - (An.unescape = function(n) { + (An.unescape = function (n) { return (n = Iu(n)) && G.test(n) ? n.replace(V, tt) : n }), - (An.uniqueId = function(n) { + (An.uniqueId = function (n) { var t = ++fi return Iu(n) + t }), @@ -10940,10 +10940,10 @@ var app = (function() { (An.first = qe), Nu( An, - (function() { + (function () { var n = {} return ( - mt(An, function(t, r) { + mt(An, function (t, r) { oi.call(An.prototype, r) || (n[r] = t) }), n @@ -10954,34 +10954,34 @@ var app = (function() { (An.VERSION = "4.17.15"), r( "bind bindKey curry curryRight partial partialRight".split(" "), - function(n) { + function (n) { An[n].placeholder = An } ), - r(["drop", "take"], function(n, t) { - ;(Un.prototype[n] = function(r) { + r(["drop", "take"], function (n, t) { + ; (Un.prototype[n] = function (r) { r = r === T ? 1 : Ui(Eu(r), 0) var e = this.__filtered__ && !t ? new Un(this) : this.clone() return ( e.__filtered__ ? (e.__takeCount__ = Ci(r, e.__takeCount__)) : e.__views__.push({ - size: Ci(r, 4294967295), - type: n + (0 > e.__dir__ ? "Right" : ""), - }), + size: Ci(r, 4294967295), + type: n + (0 > e.__dir__ ? "Right" : ""), + }), e ) }), - (Un.prototype[n + "Right"] = function(t) { + (Un.prototype[n + "Right"] = function (t) { return this.reverse() - [n](t) + [n](t) .reverse() }) }), - r(["filter", "map", "takeWhile"], function(n, t) { + r(["filter", "map", "takeWhile"], function (n, t) { var r = t + 1, e = 1 == r || 3 == r - Un.prototype[n] = function(n) { + Un.prototype[n] = function (n) { var t = this.clone() return ( t.__iteratees__.push({ iteratee: ye(n, 3), type: r }), @@ -10990,63 +10990,63 @@ var app = (function() { ) } }), - r(["head", "last"], function(n, t) { + r(["head", "last"], function (n, t) { var r = "take" + (t ? "Right" : "") - Un.prototype[n] = function() { + Un.prototype[n] = function () { return this[r](1).value()[0] } }), - r(["initial", "tail"], function(n, t) { + r(["initial", "tail"], function (n, t) { var r = "drop" + (t ? "" : "Right") - Un.prototype[n] = function() { + Un.prototype[n] = function () { return this.__filtered__ ? new Un(this) : this[r](1) } }), - (Un.prototype.compact = function() { + (Un.prototype.compact = function () { return this.filter($u) }), - (Un.prototype.find = function(n) { + (Un.prototype.find = function (n) { return this.filter(n).head() }), - (Un.prototype.findLast = function(n) { + (Un.prototype.findLast = function (n) { return this.reverse().find(n) }), - (Un.prototype.invokeMap = fr(function(n, t) { + (Un.prototype.invokeMap = fr(function (n, t) { return typeof n == "function" ? new Un(this) - : this.map(function(r) { - return Lt(r, n, t) - }) + : this.map(function (r) { + return Lt(r, n, t) + }) })), - (Un.prototype.reject = function(n) { + (Un.prototype.reject = function (n) { return this.filter(au(ye(n))) }), - (Un.prototype.slice = function(n, t) { + (Un.prototype.slice = function (n, t) { n = Eu(n) var r = this return r.__filtered__ && (0 < n || 0 > t) ? new Un(r) : (0 > n ? (r = r.takeRight(-n)) : n && (r = r.drop(n)), t !== T && - ((t = Eu(t)), + ((t = Eu(t)), (r = 0 > t ? r.dropRight(-t) : r.take(t - n))), r) }), - (Un.prototype.takeRightWhile = function(n) { + (Un.prototype.takeRightWhile = function (n) { return this.reverse() .takeWhile(n) .reverse() }), - (Un.prototype.toArray = function() { + (Un.prototype.toArray = function () { return this.take(4294967295) }), - mt(Un.prototype, function(n, t) { + mt(Un.prototype, function (n, t) { var r = /^(?:filter|find|map|reject)|While$/.test(t), e = /^(?:head|last)$/.test(t), u = An[e ? "take" + ("last" == t ? "Right" : "") : t], i = e || /^find/.test(t) u && - (An.prototype[t] = function() { + (An.prototype[t] = function () { function t(n) { return (n = u.apply(An, a([n], f))), e && h ? n[0] : n } @@ -11070,27 +11070,27 @@ var app = (function() { o.__actions__.push({ func: Qe, args: [t], thisArg: T }), new On(o, h)) : l && c - ? n.apply(this, f) - : ((o = this.thru(t)), - l ? (e ? o.value()[0] : o.value()) : o) + ? n.apply(this, f) + : ((o = this.thru(t)), + l ? (e ? o.value()[0] : o.value()) : o) }) }), - r("pop push shift sort splice unshift".split(" "), function(n) { + r("pop push shift sort splice unshift".split(" "), function (n) { var t = ri[n], r = /^(?:push|sort|unshift)$/.test(n) ? "tap" : "thru", e = /^(?:pop|shift)$/.test(n) - An.prototype[n] = function() { + An.prototype[n] = function () { var n = arguments if (e && !this.__chain__) { var u = this.value() return t.apply(ff(u) ? u : [], n) } - return this[r](function(r) { + return this[r](function (r) { return t.apply(ff(r) ? r : [], n) }) } }), - mt(Un.prototype, function(n, t) { + mt(Un.prototype, function (n, t) { var r = An[t] if (r) { var e = r.name + "" @@ -11098,7 +11098,7 @@ var app = (function() { } }), (Gi[Jr(T, 2).name] = [{ name: "wrapper", func: T }]), - (Un.prototype.clone = function() { + (Un.prototype.clone = function () { var n = new Un(this.__wrapped__) return ( (n.__actions__ = Ur(this.__actions__)), @@ -11110,14 +11110,14 @@ var app = (function() { n ) }), - (Un.prototype.reverse = function() { + (Un.prototype.reverse = function () { if (this.__filtered__) { var n = new Un(this) - ;(n.__dir__ = -1), (n.__filtered__ = true) + ; (n.__dir__ = -1), (n.__filtered__ = true) } else (n = this.clone()), (n.__dir__ *= -1) return n }), - (Un.prototype.value = function() { + (Un.prototype.value = function () { var n, t = this.__wrapped__.value(), r = this.__dir__, @@ -11148,20 +11148,20 @@ var app = (function() { } if ( ((n = { start: f, end: n }), - (o = n.start), - (f = n.end), - (n = f - o), - (o = u ? f : o - 1), - (f = this.__iteratees__), - (c = f.length), - (a = 0), - (l = Ci(n, this.__takeCount__)), - !e || (!u && i == n && l == n)) + (o = n.start), + (f = n.end), + (n = f - o), + (o = u ? f : o - 1), + (f = this.__iteratees__), + (c = f.length), + (a = 0), + (l = Ci(n, this.__takeCount__)), + !e || (!u && i == n && l == n)) ) return wr(t, this.__actions__) e = [] - n: for (; n-- && a < l; ) { - for (o += r, u = -1, i = t[o]; ++u < c; ) { + n: for (; n-- && a < l;) { + for (o += r, u = -1, i = t[o]; ++u < c;) { var h = f[u], s = h.type, h = (0, h.iteratee)(i) @@ -11176,13 +11176,13 @@ var app = (function() { return e }), (An.prototype.at = To), - (An.prototype.chain = function() { + (An.prototype.chain = function () { return Ye(this) }), - (An.prototype.commit = function() { + (An.prototype.commit = function () { return new On(this.value(), this.__chain__) }), - (An.prototype.next = function() { + (An.prototype.next = function () { this.__values__ === T && (this.__values__ = mu(this.value())) var n = this.__index__ >= this.__values__.length return { @@ -11190,18 +11190,18 @@ var app = (function() { value: n ? T : this.__values__[this.__index__++], } }), - (An.prototype.plant = function(n) { - for (var t, r = this; r instanceof En; ) { + (An.prototype.plant = function (n) { + for (var t, r = this; r instanceof En;) { var e = Fe(r) - ;(e.__index__ = 0), - (e.__values__ = T), - t ? (u.__wrapped__ = e) : (t = e) + ; (e.__index__ = 0), + (e.__values__ = T), + t ? (u.__wrapped__ = e) : (t = e) var u = e, r = r.__wrapped__ } return (u.__wrapped__ = n), t }), - (An.prototype.reverse = function() { + (An.prototype.reverse = function () { var n = this.__wrapped__ return n instanceof Un ? (this.__actions__.length && (n = new Un(this)), @@ -11210,7 +11210,7 @@ var app = (function() { new On(n, this.__chain__)) : this.thru(Ge) }), - (An.prototype.toJSON = An.prototype.valueOf = An.prototype.value = function() { + (An.prototype.toJSON = An.prototype.valueOf = An.prototype.value = function () { return wr(this.__wrapped__, this.__actions__) }), (An.prototype.first = An.prototype.head), @@ -11222,7 +11222,7 @@ var app = (function() { }.call(commonjsGlobal)) }) - var _mapping = createCommonjsModule(function(module, exports) { + var _mapping = createCommonjsModule(function (module, exports) { /** Used to map aliases to their real names. */ exports.aliasToReal = { // Lodash aliases. @@ -11669,7 +11669,7 @@ var app = (function() { } /** Used to map real names to their aliases. */ - exports.realToAlias = (function() { + exports.realToAlias = (function () { var hasOwnProperty = Object.prototype.hasOwnProperty, object = exports.aliasToReal, result = {} @@ -11798,12 +11798,12 @@ var app = (function() { */ function baseArity(func, n) { return n == 2 - ? function(a, b) { - return func.apply(undefined, arguments) - } - : function(a) { - return func.apply(undefined, arguments) - } + ? function (a, b) { + return func.apply(undefined, arguments) + } + : function (a) { + return func.apply(undefined, arguments) + } } /** @@ -11817,12 +11817,12 @@ var app = (function() { */ function baseAry(func, n) { return n == 2 - ? function(a, b) { - return func(a, b) - } - : function(a) { - return func(a) - } + ? function (a, b) { + return func(a, b) + } + : function (a) { + return func(a) + } } /** @@ -11850,7 +11850,7 @@ var app = (function() { * @returns {Function} Returns the new cloner function. */ function createCloner(func) { - return function(object) { + return function (object) { return func({}, object) } } @@ -11865,7 +11865,7 @@ var app = (function() { * @returns {Function} Returns the new function. */ function flatSpread(func, start) { - return function() { + return function () { var length = arguments.length, lastIndex = length - 1, args = Array(length) @@ -11896,7 +11896,7 @@ var app = (function() { * @returns {Function} Returns the new immutable function. */ function wrapImmutable(func, cloner) { - return function() { + return function () { var length = arguments.length if (!length) { return @@ -11957,21 +11957,21 @@ var app = (function() { var helpers = isLib ? func : { - ary: util.ary, - assign: util.assign, - clone: util.clone, - curry: util.curry, - forEach: util.forEach, - isArray: util.isArray, - isError: util.isError, - isFunction: util.isFunction, - isWeakMap: util.isWeakMap, - iteratee: util.iteratee, - keys: util.keys, - rearg: util.rearg, - toInteger: util.toInteger, - toPath: util.toPath, - } + ary: util.ary, + assign: util.assign, + clone: util.clone, + curry: util.curry, + forEach: util.forEach, + isArray: util.isArray, + isError: util.isError, + isFunction: util.isFunction, + isWeakMap: util.isWeakMap, + iteratee: util.iteratee, + keys: util.keys, + rearg: util.rearg, + toInteger: util.toInteger, + toPath: util.toPath, + } var ary = helpers.ary, assign = helpers.assign, @@ -11990,16 +11990,16 @@ var app = (function() { var aryMethodKeys = keys(_mapping.aryMethod) var wrappers = { - castArray: function(castArray) { - return function() { + castArray: function (castArray) { + return function () { var value = arguments[0] return isArray(value) ? castArray(cloneArray(value)) : castArray.apply(undefined, arguments) } }, - iteratee: function(iteratee) { - return function() { + iteratee: function (iteratee) { + return function () { var func = arguments[0], arity = arguments[1], result = iteratee(func, arity), @@ -12012,14 +12012,14 @@ var app = (function() { return result } }, - mixin: function(mixin) { - return function(source) { + mixin: function (mixin) { + return function (source) { var func = this if (!isFunction(func)) { return mixin(func, Object(source)) } var pairs = [] - each(keys(source), function(key) { + each(keys(source), function (key) { if (isFunction(source[key])) { pairs.push([key, func.prototype[key]]) } @@ -12027,7 +12027,7 @@ var app = (function() { mixin(func, Object(source)) - each(pairs, function(pair) { + each(pairs, function (pair) { var value = pair[1] if (isFunction(value)) { func.prototype[pair[0]] = value @@ -12038,20 +12038,20 @@ var app = (function() { return func } }, - nthArg: function(nthArg) { - return function(n) { + nthArg: function (nthArg) { + return function (n) { var arity = n < 0 ? 1 : toInteger(n) + 1 return curry(nthArg(n), arity) } }, - rearg: function(rearg) { - return function(func, indexes) { + rearg: function (rearg) { + return function (func, indexes) { var arity = indexes ? indexes.length : 0 return curry(rearg(func, indexes), arity) } }, - runInContext: function(runInContext) { - return function(context) { + runInContext: function (runInContext) { + return function (context) { return baseConvert(util, runInContext(context), options) } }, @@ -12183,7 +12183,7 @@ var app = (function() { methodName = _mapping.remap[realName] || realName, oldOptions = options - return function(options) { + return function (options) { var newUtil = isLib ? pristine : helpers, newFunc = isLib ? pristine[methodName] : func, newOptions = assign(assign({}, oldOptions), options) @@ -12202,7 +12202,7 @@ var app = (function() { * @returns {Function} Returns the new function. */ function iterateeAry(func, n) { - return overArg(func, function(func) { + return overArg(func, function (func) { return typeof func == "function" ? baseAry(func, n) : func }) } @@ -12219,7 +12219,7 @@ var app = (function() { * @returns {Function} Returns the new function. */ function iterateeRearg(func, indexes) { - return overArg(func, function(func) { + return overArg(func, function (func) { var n = indexes.length return baseArity(rearg(baseAry(func, n), indexes), n) }) @@ -12234,7 +12234,7 @@ var app = (function() { * @returns {Function} Returns the new function. */ function overArg(func, transform) { - return function() { + return function () { var length = arguments.length if (!length) { return func() @@ -12275,23 +12275,23 @@ var app = (function() { wrapped = wrapImmutable(func, cloneByPath) } } - each(aryMethodKeys, function(aryKey) { - each(_mapping.aryMethod[aryKey], function(otherName) { + each(aryMethodKeys, function (aryKey) { + each(_mapping.aryMethod[aryKey], function (otherName) { if (realName == otherName) { var data = _mapping.methodSpread[realName], afterRearg = data && data.afterRearg result = afterRearg ? castFixed( - realName, - castRearg(realName, wrapped, aryKey), - aryKey - ) + realName, + castRearg(realName, wrapped, aryKey), + aryKey + ) : castRearg( - realName, - castFixed(realName, wrapped, aryKey), - aryKey - ) + realName, + castFixed(realName, wrapped, aryKey), + aryKey + ) result = castCap(realName, result) result = castCurry(realName, result, aryKey) @@ -12305,9 +12305,9 @@ var app = (function() { if (result == func) { result = forceCurry ? curry(result, 1) - : function() { - return func.apply(this, arguments) - } + : function () { + return func.apply(this, arguments) + } } result.convert = createConverter(realName, func) result.placeholder = func.placeholder = placeholder @@ -12324,8 +12324,8 @@ var app = (function() { // Convert methods by ary cap. var pairs = [] - each(aryMethodKeys, function(aryKey) { - each(_mapping.aryMethod[aryKey], function(key) { + each(aryMethodKeys, function (aryKey) { + each(_mapping.aryMethod[aryKey], function (key) { var func = _[_mapping.remap[key] || key] if (func) { pairs.push([key, wrap(key, func, _)]) @@ -12334,7 +12334,7 @@ var app = (function() { }) // Convert remaining methods. - each(keys(_), function(key) { + each(keys(_), function (key) { var func = _[key] if (typeof func == "function") { var length = pairs.length @@ -12349,7 +12349,7 @@ var app = (function() { }) // Assign to `_` leaving `_.prototype` unchanged to allow chaining. - each(pairs, function(pair) { + each(pairs, function (pair) { _[pair[0]] = pair[1] }) @@ -12357,8 +12357,8 @@ var app = (function() { _.placeholder = _ // Assign aliases. - each(keys(_), function(key) { - each(_mapping.realToAlias[key] || [], function(alias) { + each(keys(_), function (key) { + each(_mapping.realToAlias[key] || [], function (alias) { _[alias] = _[key] }) }) @@ -12408,8 +12408,8 @@ var app = (function() { var fp_36 = fp.isInteger var fp_37 = fp.toNumber - var lodash = createCommonjsModule(function(module, exports) { - ;(function() { + var lodash = createCommonjsModule(function (module, exports) { + ; (function () { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined$1 @@ -12421,7 +12421,7 @@ var app = (function() { /** Error message constants. */ var CORE_ERROR_TEXT = - "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", + "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function" /** Used to stand-in for `undefined` hash values. */ @@ -12699,19 +12699,19 @@ var app = (function() { var reUnicodeWord = RegExp( [ rsUpper + - "?" + - rsLower + - "+" + - rsOptContrLower + - "(?=" + - [rsBreak, rsUpper, "$"].join("|") + - ")", + "?" + + rsLower + + "+" + + rsOptContrLower + + "(?=" + + [rsBreak, rsUpper, "$"].join("|") + + ")", rsMiscUpper + - "+" + - rsOptContrUpper + - "(?=" + - [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + - ")", + "+" + + rsOptContrUpper + + "(?=" + + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + + ")", rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, rsUpper + "+" + rsOptContrUpper, rsOrdUpper, @@ -12772,20 +12772,20 @@ var app = (function() { typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[ int8Tag ] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[ - uint8Tag + uint8Tag ] = typedArrayTags[uint8ClampedTag] = typedArrayTags[ - uint16Tag + uint16Tag ] = typedArrayTags[uint32Tag] = true typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[ arrayBufferTag ] = typedArrayTags[boolTag] = typedArrayTags[ - dataViewTag + dataViewTag ] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[ - funcTag + funcTag ] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[ - objectTag + objectTag ] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[ - stringTag + stringTag ] = typedArrayTags[weakMapTag] = false /** Used to identify `toStringTag` values supported by `_.clone`. */ @@ -12793,17 +12793,17 @@ var app = (function() { cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[ arrayBufferTag ] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[ - dateTag + dateTag ] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[ - int8Tag + int8Tag ] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[ - mapTag + mapTag ] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[ - regexpTag + regexpTag ] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[ - symbolTag + symbolTag ] = cloneableTags[uint8Tag] = cloneableTags[ - uint8ClampedTag + uint8ClampedTag ] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[ weakMapTag @@ -13069,7 +13069,7 @@ var app = (function() { var freeProcess = moduleExports && freeGlobal.process /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { + var nodeUtil = (function () { try { // Use `util.types` for Node.js 10+. var types = @@ -13083,7 +13083,7 @@ var app = (function() { return ( freeProcess && freeProcess.binding && freeProcess.binding("util") ) - } catch (e) {} + } catch (e) { } })() /* Node.js helper references. */ @@ -13416,7 +13416,7 @@ var app = (function() { */ function baseFindKey(collection, predicate, eachFunc) { var result - eachFunc(collection, function(value, key, collection) { + eachFunc(collection, function (value, key, collection) { if (predicate(value, key, collection)) { result = key return false @@ -13518,7 +13518,7 @@ var app = (function() { * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { - return function(object) { + return function (object) { return object == null ? undefined$1 : object[key] } } @@ -13531,7 +13531,7 @@ var app = (function() { * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { - return function(key) { + return function (key) { return object == null ? undefined$1 : object[key] } } @@ -13556,7 +13556,7 @@ var app = (function() { initAccum, eachFunc ) { - eachFunc(collection, function(value, index, collection) { + eachFunc(collection, function (value, index, collection) { accumulator = initAccum ? ((initAccum = false), value) : iteratee(accumulator, value, index, collection) @@ -13636,7 +13636,7 @@ var app = (function() { * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { - return arrayMap(props, function(key) { + return arrayMap(props, function (key) { return [key, object[key]] }) } @@ -13649,7 +13649,7 @@ var app = (function() { * @returns {Function} Returns the new capped function. */ function baseUnary(func) { - return function(value) { + return function (value) { return func(value) } } @@ -13665,7 +13665,7 @@ var app = (function() { * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { - return arrayMap(props, function(key) { + return arrayMap(props, function (key) { return object[key] }) } @@ -13698,7 +13698,7 @@ var app = (function() { while ( ++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1 - ) {} + ) { } return index } @@ -13714,7 +13714,7 @@ var app = (function() { function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index } @@ -13830,7 +13830,7 @@ var app = (function() { var index = -1, result = Array(map.size) - map.forEach(function(value, key) { + map.forEach(function (value, key) { result[++index] = [key, value] }) return result @@ -13845,7 +13845,7 @@ var app = (function() { * @returns {Function} Returns the new function. */ function overArg(func, transform) { - return function(arg) { + return function (arg) { return func(transform(arg)) } } @@ -13886,7 +13886,7 @@ var app = (function() { var index = -1, result = Array(set.size) - set.forEach(function(value) { + set.forEach(function (value) { result[++index] = value }) return result @@ -13903,7 +13903,7 @@ var app = (function() { var index = -1, result = Array(set.size) - set.forEach(function(value) { + set.forEach(function (value) { result[++index] = [value, value] }) return result @@ -14087,7 +14087,7 @@ var app = (function() { var idCounter = 0 /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { + var maskSrcKey = (function () { var uid = /[^.]+$/.exec( (coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO) || "" ) @@ -14110,14 +14110,14 @@ var app = (function() { /** Used to detect if a method is native. */ var reIsNative = RegExp( "^" + - funcToString - .call(hasOwnProperty) - .replace(reRegExpChar, "\\$&") - .replace( - /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, - "$1.*?" - ) + - "$" + funcToString + .call(hasOwnProperty) + .replace(reRegExpChar, "\\$&") + .replace( + /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, + "$1.*?" + ) + + "$" ) /** Built-in value references. */ @@ -14133,17 +14133,17 @@ var app = (function() { symIterator = Symbol ? Symbol.iterator : undefined$1, symToStringTag = Symbol ? Symbol.toStringTag : undefined$1 - var defineProperty = (function() { + var defineProperty = (function () { try { var func = getNative(Object, "defineProperty") func({}, "", {}) return func - } catch (e) {} + } catch (e) { } })() /** Mocked built-ins. */ var ctxClearTimeout = - context.clearTimeout !== root.clearTimeout && context.clearTimeout, + context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout @@ -14332,9 +14332,9 @@ var app = (function() { * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ - var baseCreate = (function() { - function object() {} - return function(proto) { + var baseCreate = (function () { + function object() { } + return function (proto) { if (!isObject(proto)) { return {} } @@ -15186,7 +15186,7 @@ var app = (function() { * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { + baseEach(collection, function (value, key, collection) { setter(accumulator, value, iteratee(value), collection) }) return accumulator @@ -15350,13 +15350,13 @@ var app = (function() { stack.set(value, result) if (isSet(value)) { - value.forEach(function(subValue) { + value.forEach(function (subValue) { result.add( baseClone(subValue, bitmask, customizer, subValue, value, stack) ) }) } else if (isMap(value)) { - value.forEach(function(subValue, key) { + value.forEach(function (subValue, key) { result.set( key, baseClone(subValue, bitmask, customizer, key, value, stack) @@ -15369,11 +15369,11 @@ var app = (function() { ? getAllKeysIn : getAllKeys : isFlat - ? keysIn - : keys + ? keysIn + : keys var props = isArr ? undefined$1 : keysFunc(value) - arrayEach(props || value, function(subValue, key) { + arrayEach(props || value, function (subValue, key) { if (props) { key = subValue subValue = value[key] @@ -15397,7 +15397,7 @@ var app = (function() { */ function baseConforms(source) { var props = keys(source) - return function(object) { + return function (object) { return baseConformsTo(object, source, props) } } @@ -15445,7 +15445,7 @@ var app = (function() { if (typeof func != "function") { throw new TypeError(FUNC_ERROR_TEXT) } - return setTimeout(function() { + return setTimeout(function () { func.apply(undefined$1, args) }, wait) } @@ -15534,7 +15534,7 @@ var app = (function() { */ function baseEvery(collection, predicate) { var result = true - baseEach(collection, function(value, index, collection) { + baseEach(collection, function (value, index, collection) { result = !!predicate(value, index, collection) return result }) @@ -15610,7 +15610,7 @@ var app = (function() { */ function baseFilter(collection, predicate) { var result = [] - baseEach(collection, function(value, index, collection) { + baseEach(collection, function (value, index, collection) { if (predicate(value, index, collection)) { result.push(value) } @@ -15711,7 +15711,7 @@ var app = (function() { * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { - return arrayFilter(props, function(key) { + return arrayFilter(props, function (key) { return isFunction(object[key]) }) } @@ -15849,7 +15849,7 @@ var app = (function() { maxLength = nativeMin(array.length, maxLength) caches[othIndex] = !comparator && - (iteratee || (length >= 120 && array.length >= 120)) + (iteratee || (length >= 120 && array.length >= 120)) ? new SetCache(othIndex && array) : undefined$1 } @@ -15900,7 +15900,7 @@ var app = (function() { * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { + baseForOwn(object, function (value, key, object) { setter(accumulator, iteratee(value), key, object) }) return accumulator @@ -16036,26 +16036,26 @@ var app = (function() { stack || (stack = new Stack()) return objIsArr || isTypedArray(object) ? equalArrays( - object, - other, - bitmask, - customizer, - equalFunc, - stack - ) + object, + other, + bitmask, + customizer, + equalFunc, + stack + ) : equalByTag( - object, - other, - objTag, - bitmask, - customizer, - equalFunc, - stack - ) + object, + other, + objTag, + bitmask, + customizer, + equalFunc, + stack + ) } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = - objIsObj && hasOwnProperty.call(object, "__wrapped__"), + objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__") @@ -16152,12 +16152,12 @@ var app = (function() { if ( !(result === undefined$1 ? baseIsEqual( - srcValue, - objValue, - COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, - customizer, - stack - ) + srcValue, + objValue, + COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, + customizer, + stack + ) : result) ) { return false @@ -16316,7 +16316,7 @@ var app = (function() { var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [] - baseEach(collection, function(value, key, collection) { + baseEach(collection, function (value, key, collection) { result[++index] = iteratee(value, key, collection) }) return result @@ -16334,7 +16334,7 @@ var app = (function() { if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]) } - return function(object) { + return function (object) { return object === source || baseIsMatch(object, source, matchData) } } @@ -16351,15 +16351,15 @@ var app = (function() { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue) } - return function(object) { + return function (object) { var objValue = get(object, path) return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual( - srcValue, - objValue, - COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG - ) + srcValue, + objValue, + COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG + ) } } @@ -16380,7 +16380,7 @@ var app = (function() { } baseFor( source, - function(srcValue, key) { + function (srcValue, key) { stack || (stack = new Stack()) if (isObject(srcValue)) { baseMergeDeep( @@ -16395,13 +16395,13 @@ var app = (function() { } else { var newValue = customizer ? customizer( - safeGet(object, key), - srcValue, - key + "", - object, - source, - stack - ) + safeGet(object, key), + srcValue, + key + "", + object, + source, + stack + ) : undefined$1 if (newValue === undefined$1) { @@ -16525,14 +16525,14 @@ var app = (function() { baseUnary(getIteratee()) ) - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { + var result = baseMap(collection, function (value, key, collection) { + var criteria = arrayMap(iteratees, function (iteratee) { return iteratee(value) }) return { criteria: criteria, index: ++index, value: value } }) - return baseSortBy(result, function(object, other) { + return baseSortBy(result, function (object, other) { return compareMultiple(object, other, orders) }) } @@ -16547,7 +16547,7 @@ var app = (function() { * @returns {Object} Returns the new object. */ function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { + return basePickBy(object, paths, function (value, path) { return hasIn(object, path) }) } @@ -16585,7 +16585,7 @@ var app = (function() { * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { - return function(object) { + return function (object) { return baseGet(object, path) } } @@ -16791,8 +16791,8 @@ var app = (function() { newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) - ? [] - : {} + ? [] + : {} } } assignValue(nested, key, newValue) @@ -16811,10 +16811,10 @@ var app = (function() { */ var baseSetData = !metaMap ? identity - : function(func, data) { - metaMap.set(func, data) - return func - } + : function (func, data) { + metaMap.set(func, data) + return func + } /** * The base implementation of `setToString` without support for hot loop shorting. @@ -16826,14 +16826,14 @@ var app = (function() { */ var baseSetToString = !defineProperty ? identity - : function(func, string) { - return defineProperty(func, "toString", { - configurable: true, - enumerable: false, - value: constant(string), - writable: true, - }) - } + : function (func, string) { + return defineProperty(func, "toString", { + configurable: true, + enumerable: false, + value: constant(string), + writable: true, + }) + } /** * The base implementation of `_.shuffle`. @@ -16888,7 +16888,7 @@ var app = (function() { function baseSome(collection, predicate) { var result - baseEach(collection, function(value, index, collection) { + baseEach(collection, function (value, index, collection) { result = predicate(value, index, collection) return !result }) @@ -17170,19 +17170,19 @@ var app = (function() { while ( (fromRight ? index-- : ++index < length) && predicate(array[index], index, array) - ) {} + ) { } return isDrop ? baseSlice( - array, - fromRight ? 0 : index, - fromRight ? index + 1 : length - ) + array, + fromRight ? 0 : index, + fromRight ? index + 1 : length + ) : baseSlice( - array, - fromRight ? index + 1 : 0, - fromRight ? length : index - ) + array, + fromRight ? index + 1 : 0, + fromRight ? length : index + ) } /** @@ -17202,7 +17202,7 @@ var app = (function() { } return arrayReduce( actions, - function(result, action) { + function (result, action) { return action.func.apply( action.thisArg, arrayPush([result], action.args) @@ -17341,7 +17341,7 @@ var app = (function() { */ var clearTimeout = ctxClearTimeout || - function(id) { + function (id) { return root.clearTimeout(id) } @@ -17698,7 +17698,7 @@ var app = (function() { * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { - return function(collection, iteratee) { + return function (collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {} @@ -17719,7 +17719,7 @@ var app = (function() { * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { - return baseRest(function(object, sources) { + return baseRest(function (object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, @@ -17754,7 +17754,7 @@ var app = (function() { * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { + return function (collection, iteratee) { if (collection == null) { return collection } @@ -17782,7 +17782,7 @@ var app = (function() { * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { + return function (object, iteratee, keysFunc) { var index = -1, iterable = Object(object), props = keysFunc(object), @@ -17828,7 +17828,7 @@ var app = (function() { * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { - return function(string) { + return function (string) { string = toString(string) var strSymbols = hasUnicode(string) @@ -17853,7 +17853,7 @@ var app = (function() { * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { - return function(string) { + return function (string) { return arrayReduce( words(deburr(string).replace(reApos, "")), callback, @@ -17871,7 +17871,7 @@ var app = (function() { * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { - return function() { + return function () { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. @@ -17941,8 +17941,8 @@ var app = (function() { } var holders = length < 3 && - args[0] !== placeholder && - args[length - 1] !== placeholder + args[0] !== placeholder && + args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder) @@ -17976,12 +17976,12 @@ var app = (function() { * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { + return function (collection, predicate, fromIndex) { var iterable = Object(collection) if (!isArrayLike(collection)) { var iteratee = getIteratee(predicate, 3) collection = keys(collection) - predicate = function(key) { + predicate = function (key) { return iteratee(iterable[key], key, iterable) } } @@ -18000,7 +18000,7 @@ var app = (function() { * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { - return flatRest(function(funcs) { + return flatRest(function (funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru @@ -18028,10 +18028,10 @@ var app = (function() { data && isLaziable(data[0]) && data[1] == - (WRAP_ARY_FLAG | - WRAP_CURRY_FLAG | - WRAP_PARTIAL_FLAG | - WRAP_REARG_FLAG) && + (WRAP_ARY_FLAG | + WRAP_CURRY_FLAG | + WRAP_PARTIAL_FLAG | + WRAP_REARG_FLAG) && !data[4].length && data[9] == 1 ) { @@ -18043,7 +18043,7 @@ var app = (function() { : wrapper.thru(func) } } - return function() { + return function () { var args = arguments, value = args[0] @@ -18167,7 +18167,7 @@ var app = (function() { * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { - return function(object, iteratee) { + return function (object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}) } } @@ -18181,7 +18181,7 @@ var app = (function() { * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { - return function(value, other) { + return function (value, other) { var result if (value === undefined$1 && other === undefined$1) { return defaultValue @@ -18214,11 +18214,11 @@ var app = (function() { * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { - return flatRest(function(iteratees) { + return flatRest(function (iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())) - return baseRest(function(args) { + return baseRest(function (args) { var thisArg = this - return arrayFunc(iteratees, function(iteratee) { + return arrayFunc(iteratees, function (iteratee) { return apply(iteratee, thisArg, args) }) }) @@ -18291,7 +18291,7 @@ var app = (function() { * @returns {Function} Returns the new range function. */ function createRange(fromRight) { - return function(start, end, step) { + return function (start, end, step) { if ( step && typeof step != "number" && @@ -18321,7 +18321,7 @@ var app = (function() { * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { - return function(value, other) { + return function (value, other) { if (!(typeof value == "string" && typeof other == "string")) { value = toNumber(value) other = toNumber(other) @@ -18401,7 +18401,7 @@ var app = (function() { */ function createRound(methodName) { var func = Math[methodName] - return function(number, precision) { + return function (number, precision) { number = toNumber(number) precision = precision == null ? 0 : nativeMin(toInteger(precision), 292) @@ -18427,9 +18427,9 @@ var app = (function() { */ var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop - : function(values) { - return new Set(values) - } + : function (values) { + return new Set(values) + } /** * Creates a `_.toPairs` or `_.toPairsIn` function. @@ -18439,7 +18439,7 @@ var app = (function() { * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { - return function(object) { + return function (object) { var tag = getTag(object) if (tag == mapTag) { return mapToArray(object) @@ -18692,7 +18692,7 @@ var app = (function() { // Recursively compare arrays (susceptible to call stack limits). if (seen) { if ( - !arraySome(other, function(othValue, othIndex) { + !arraySome(other, function (othValue, othIndex) { if ( !cacheHas(seen, othIndex) && (arrValue === othValue || @@ -18884,7 +18884,7 @@ var app = (function() { if ( !(compared === undefined$1 ? objValue === othValue || - equalFunc(objValue, othValue, bitmask, customizer, stack) + equalFunc(objValue, othValue, bitmask, customizer, stack) : compared) ) { result = false @@ -18959,9 +18959,9 @@ var app = (function() { */ var getData = !metaMap ? noop - : function(func) { - return metaMap.get(func) - } + : function (func) { + return metaMap.get(func) + } /** * Gets the name of `func`. @@ -19078,7 +19078,7 @@ var app = (function() { try { value[symToStringTag] = undefined$1 var unmasked = true - } catch (e) {} + } catch (e) { } var result = nativeObjectToString.call(value) if (unmasked) { @@ -19100,15 +19100,15 @@ var app = (function() { */ var getSymbols = !nativeGetSymbols ? stubArray - : function(object) { - if (object == null) { - return [] - } - object = Object(object) - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol) - }) + : function (object) { + if (object == null) { + return [] } + object = Object(object) + return arrayFilter(nativeGetSymbols(object), function (symbol) { + return propertyIsEnumerable.call(object, symbol) + }) + } /** * Creates an array of the own and inherited enumerable symbols of `object`. @@ -19119,14 +19119,14 @@ var app = (function() { */ var getSymbolsIn = !nativeGetSymbols ? stubArray - : function(object) { - var result = [] - while (object) { - arrayPush(result, getSymbols(object)) - object = getPrototype(object) - } - return result + : function (object) { + var result = [] + while (object) { + arrayPush(result, getSymbols(object)) + object = getPrototype(object) } + return result + } /** * Gets the `toStringTag` of `value`. @@ -19146,7 +19146,7 @@ var app = (function() { (Set && getTag(new Set()) != setTag) || (WeakMap && getTag(new WeakMap()) != weakMapTag) ) { - getTag = function(value) { + getTag = function (value) { var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "" @@ -19552,7 +19552,7 @@ var app = (function() { * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { - return function(object) { + return function (object) { if (object == null) { return false } @@ -19572,7 +19572,7 @@ var app = (function() { * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { - var result = memoize(func, function(key) { + var result = memoize(func, function (key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear() } @@ -19707,7 +19707,7 @@ var app = (function() { */ function overRest(func, start, transform) { start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0) - return function() { + return function () { var args = arguments, index = -1, length = nativeMax(args.length - start, 0), @@ -19810,7 +19810,7 @@ var app = (function() { */ var setTimeout = ctxSetTimeout || - function(func, wait) { + function (func, wait) { return root.setTimeout(func, wait) } @@ -19858,7 +19858,7 @@ var app = (function() { var count = 0, lastCalled = 0 - return function() { + return function () { var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled) @@ -19906,12 +19906,12 @@ var app = (function() { * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ - var stringToPath = memoizeCapped(function(string) { + var stringToPath = memoizeCapped(function (string) { var result = [] if (string.charCodeAt(0) === 46 /* . */) { result.push("") } - string.replace(rePropName, function(match, number, quote, subString) { + string.replace(rePropName, function (match, number, quote, subString) { result.push( quote ? subString.replace(reEscapeChar, "$1") : number || match ) @@ -19945,10 +19945,10 @@ var app = (function() { if (func != null) { try { return funcToString.call(func) - } catch (e) {} + } catch (e) { } try { return func + "" - } catch (e) {} + } catch (e) { } } return "" } @@ -19962,7 +19962,7 @@ var app = (function() { * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { + arrayEach(wrapFlags, function (pair) { var value = "_." + pair[0] if (bitmask & pair[1] && !arrayIncludes(details, value)) { details.push(value) @@ -20125,12 +20125,12 @@ var app = (function() { * _.difference([2, 1], [2, 3]); * // => [1] */ - var difference = baseRest(function(array, values) { + var difference = baseRest(function (array, values) { return isArrayLikeObject(array) ? baseDifference( - array, - baseFlatten(values, 1, isArrayLikeObject, true) - ) + array, + baseFlatten(values, 1, isArrayLikeObject, true) + ) : [] }) @@ -20160,17 +20160,17 @@ var app = (function() { * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var differenceBy = baseRest(function(array, values) { + 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) - ) + array, + baseFlatten(values, 1, isArrayLikeObject, true), + getIteratee(iteratee, 2) + ) : [] }) @@ -20197,18 +20197,18 @@ var app = (function() { * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ - var differenceWith = baseRest(function(array, values) { + 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 - ) + array, + baseFlatten(values, 1, isArrayLikeObject, true), + undefined$1, + comparator + ) : [] }) @@ -20693,7 +20693,7 @@ var app = (function() { * _.intersection([2, 1], [2, 3]); * // => [2] */ - var intersection = baseRest(function(arrays) { + var intersection = baseRest(function (arrays) { var mapped = arrayMap(arrays, castArrayLikeObject) return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) @@ -20723,7 +20723,7 @@ var app = (function() { * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ - var intersectionBy = baseRest(function(arrays) { + var intersectionBy = baseRest(function (arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject) @@ -20758,7 +20758,7 @@ var app = (function() { * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ - var intersectionWith = baseRest(function(arrays) { + var intersectionWith = baseRest(function (arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject) @@ -21009,13 +21009,13 @@ var app = (function() { * console.log(pulled); * // => ['b', 'd'] */ - var pullAt = flatRest(function(array, indexes) { + var pullAt = flatRest(function (array, indexes) { var length = array == null ? 0 : array.length, result = baseAt(array, indexes) basePullAt( array, - arrayMap(indexes, function(index) { + arrayMap(indexes, function (index) { return isIndex(index, length) ? +index : index }).sort(compareAscending) ) @@ -21515,7 +21515,7 @@ var app = (function() { * _.union([2], [1, 2]); * // => [2, 1] */ - var union = baseRest(function(arrays) { + var union = baseRest(function (arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)) }) @@ -21542,7 +21542,7 @@ var app = (function() { * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ - var unionBy = baseRest(function(arrays) { + var unionBy = baseRest(function (arrays) { var iteratee = last(arrays) if (isArrayLikeObject(iteratee)) { iteratee = undefined$1 @@ -21574,7 +21574,7 @@ var app = (function() { * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var unionWith = baseRest(function(arrays) { + var unionWith = baseRest(function (arrays) { var comparator = last(arrays) comparator = typeof comparator == "function" ? comparator : undefined$1 @@ -21688,13 +21688,13 @@ var app = (function() { return [] } var length = 0 - array = arrayFilter(array, function(group) { + array = arrayFilter(array, function (group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length) return true } }) - return baseTimes(length, function(index) { + return baseTimes(length, function (index) { return arrayMap(array, baseProperty(index)) }) } @@ -21728,7 +21728,7 @@ var app = (function() { if (iteratee == null) { return result } - return arrayMap(result, function(group) { + return arrayMap(result, function (group) { return apply(iteratee, undefined$1, group) }) } @@ -21753,7 +21753,7 @@ var app = (function() { * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ - var without = baseRest(function(array, values) { + var without = baseRest(function (array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : [] }) @@ -21775,7 +21775,7 @@ var app = (function() { * _.xor([2, 1], [2, 3]); * // => [1, 3] */ - var xor = baseRest(function(arrays) { + var xor = baseRest(function (arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)) }) @@ -21802,7 +21802,7 @@ var app = (function() { * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var xorBy = baseRest(function(arrays) { + var xorBy = baseRest(function (arrays) { var iteratee = last(arrays) if (isArrayLikeObject(iteratee)) { iteratee = undefined$1 @@ -21834,7 +21834,7 @@ var app = (function() { * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var xorWith = baseRest(function(arrays) { + var xorWith = baseRest(function (arrays) { var comparator = last(arrays) comparator = typeof comparator == "function" ? comparator : undefined$1 @@ -21922,7 +21922,7 @@ var app = (function() { * }); * // => [111, 222] */ - var zipWith = baseRest(function(arrays) { + var zipWith = baseRest(function (arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined$1 @@ -22041,11 +22041,11 @@ var app = (function() { * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ - var wrapperAt = flatRest(function(paths) { + var wrapperAt = flatRest(function (paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, - interceptor = function(object) { + interceptor = function (object) { return baseAt(object, paths) } @@ -22063,7 +22063,7 @@ var app = (function() { args: [interceptor], thisArg: undefined$1, }) - return new LodashWrapper(value, this.__chain__).thru(function(array) { + return new LodashWrapper(value, this.__chain__).thru(function (array) { if (length && !array.length) { array.push(undefined$1) } @@ -22310,7 +22310,7 @@ var app = (function() { * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ - var countBy = createAggregator(function(result, value, key) { + var countBy = createAggregator(function (result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key] } else { @@ -22626,7 +22626,7 @@ var app = (function() { * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ - var groupBy = createAggregator(function(result, value, key) { + var groupBy = createAggregator(function (result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value) } else { @@ -22700,12 +22700,12 @@ var app = (function() { * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ - var invokeMap = baseRest(function(collection, path, args) { + var invokeMap = baseRest(function (collection, path, args) { var index = -1, isFunc = typeof path == "function", result = isArrayLike(collection) ? Array(collection.length) : [] - baseEach(collection, function(value) { + baseEach(collection, function (value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args) @@ -22741,7 +22741,7 @@ var app = (function() { * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ - var keyBy = createAggregator(function(result, value, key) { + var keyBy = createAggregator(function (result, value, key) { baseAssignValue(result, key, value) }) @@ -22872,10 +22872,10 @@ var app = (function() { * // => objects for [['fred'], ['barney', 'pebbles']] */ var partition = createAggregator( - function(result, value, key) { + function (result, value, key) { result[key ? 0 : 1].push(value) }, - function() { + function () { return [[], []] } ) @@ -23185,7 +23185,7 @@ var app = (function() { * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ - var sortBy = baseRest(function(collection, iteratees) { + var sortBy = baseRest(function (collection, iteratees) { if (collection == null) { return [] } @@ -23224,7 +23224,7 @@ var app = (function() { */ var now = ctxNow || - function() { + function () { return root.Date.now() } @@ -23259,7 +23259,7 @@ var app = (function() { throw new TypeError(FUNC_ERROR_TEXT) } n = toInteger(n) - return function() { + return function () { if (--n < 1) { return func.apply(this, arguments) } @@ -23320,7 +23320,7 @@ var app = (function() { throw new TypeError(FUNC_ERROR_TEXT) } n = toInteger(n) - return function() { + return function () { if (--n > 0) { result = func.apply(this, arguments) } @@ -23366,7 +23366,7 @@ var app = (function() { * bound('hi'); * // => 'hi fred!' */ - var bind = baseRest(function(func, thisArg, partials) { + var bind = baseRest(function (func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)) @@ -23420,7 +23420,7 @@ var app = (function() { * bound('hi'); * // => 'hiya fred!' */ - var bindKey = baseRest(function(object, key, partials) { + 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)) @@ -23743,7 +23743,7 @@ var app = (function() { * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ - var defer = baseRest(function(func, args) { + var defer = baseRest(function (func, args) { return baseDelay(func, 1, args) }) @@ -23766,7 +23766,7 @@ var app = (function() { * }, 1000, 'later'); * // => Logs 'later' after one second. */ - var delay = baseRest(function(func, wait, args) { + var delay = baseRest(function (func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args) }) @@ -23843,7 +23843,7 @@ var app = (function() { ) { throw new TypeError(FUNC_ERROR_TEXT) } - var memoized = function() { + var memoized = function () { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache @@ -23886,7 +23886,7 @@ var app = (function() { if (typeof predicate != "function") { throw new TypeError(FUNC_ERROR_TEXT) } - return function() { + return function () { var args = arguments switch (args.length) { case 0: @@ -23955,14 +23955,14 @@ var app = (function() { * func(10, 5); * // => [100, 10] */ - var overArgs = castRest(function(func, transforms) { + 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) { + return baseRest(function (args) { var index = -1, length = nativeMin(args.length, funcsLength) @@ -24006,7 +24006,7 @@ var app = (function() { * greetFred('hi'); * // => 'hi fred' */ - var partial = baseRest(function(func, partials) { + var partial = baseRest(function (func, partials) { var holders = replaceHolders(partials, getHolder(partial)) return createWrap( func, @@ -24049,7 +24049,7 @@ var app = (function() { * sayHelloTo('fred'); * // => 'hello fred' */ - var partialRight = baseRest(function(func, partials) { + var partialRight = baseRest(function (func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)) return createWrap( func, @@ -24082,7 +24082,7 @@ var app = (function() { * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ - var rearg = flatRest(function(func, indexes) { + var rearg = flatRest(function (func, indexes) { return createWrap( func, WRAP_REARG_FLAG, @@ -24165,7 +24165,7 @@ var app = (function() { throw new TypeError(FUNC_ERROR_TEXT) } start = start == null ? 0 : nativeMax(toInteger(start), 0) - return baseRest(function(args) { + return baseRest(function (args) { var array = args[start], otherArgs = castSlice(args, 0, start) @@ -24565,7 +24565,7 @@ var app = (function() { * _.gte(1, 3); * // => false */ - var gte = createRelationalOperation(function(value, other) { + var gte = createRelationalOperation(function (value, other) { return value >= other }) @@ -24588,18 +24588,18 @@ var app = (function() { * // => false */ var isArguments = baseIsArguments( - (function() { + (function () { return arguments })() ) ? baseIsArguments - : function(value) { - return ( - isObjectLike(value) && - hasOwnProperty.call(value, "callee") && - !propertyIsEnumerable.call(value, "callee") - ) - } + : function (value) { + return ( + isObjectLike(value) && + hasOwnProperty.call(value, "callee") && + !propertyIsEnumerable.call(value, "callee") + ) + } /** * Checks if `value` is classified as an `Array` object. @@ -25682,7 +25682,7 @@ var app = (function() { * _.lte(3, 1); * // => false */ - var lte = createRelationalOperation(function(value, other) { + var lte = createRelationalOperation(function (value, other) { return value <= other }) @@ -25872,8 +25872,8 @@ var app = (function() { return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) - ? NAN - : +value + ? NAN + : +value } /** @@ -25932,8 +25932,8 @@ var app = (function() { return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 - ? value - : 0 + ? value + : 0 } /** @@ -25995,7 +25995,7 @@ var app = (function() { * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ - var assign = createAssigner(function(object, source) { + var assign = createAssigner(function (object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object) return @@ -26038,7 +26038,7 @@ var app = (function() { * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ - var assignIn = createAssigner(function(object, source) { + var assignIn = createAssigner(function (object, source) { copyObject(source, keysIn(source), object) }) @@ -26071,7 +26071,7 @@ var app = (function() { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignInWith = createAssigner(function( + var assignInWith = createAssigner(function ( object, source, srcIndex, @@ -26108,7 +26108,7 @@ var app = (function() { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignWith = createAssigner(function( + var assignWith = createAssigner(function ( object, source, srcIndex, @@ -26196,7 +26196,7 @@ var app = (function() { * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var defaults = baseRest(function(object, sources) { + var defaults = baseRest(function (object, sources) { object = Object(object) var index = -1 @@ -26249,7 +26249,7 @@ var app = (function() { * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ - var defaultsDeep = baseRest(function(args) { + var defaultsDeep = baseRest(function (args) { args.push(undefined$1, customDefaultsMerge) return apply(mergeWith, undefined$1, args) }) @@ -26623,7 +26623,7 @@ var app = (function() { * _.invert(object); * // => { '1': 'c', '2': 'b' } */ - var invert = createInverter(function(result, value, key) { + var invert = createInverter(function (result, value, key) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value) } @@ -26657,7 +26657,7 @@ var app = (function() { * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ - var invertBy = createInverter(function(result, value, key) { + var invertBy = createInverter(function (result, value, key) { if (value != null && typeof value.toString != "function") { value = nativeObjectToString.call(value) } @@ -26775,7 +26775,7 @@ var app = (function() { var result = {} iteratee = getIteratee(iteratee, 3) - baseForOwn(object, function(value, key, object) { + baseForOwn(object, function (value, key, object) { baseAssignValue(result, iteratee(value, key, object), value) }) return result @@ -26813,7 +26813,7 @@ var app = (function() { var result = {} iteratee = getIteratee(iteratee, 3) - baseForOwn(object, function(value, key, object) { + baseForOwn(object, function (value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)) }) return result @@ -26850,7 +26850,7 @@ var app = (function() { * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ - var merge = createAssigner(function(object, source, srcIndex) { + var merge = createAssigner(function (object, source, srcIndex) { baseMerge(object, source, srcIndex) }) @@ -26885,7 +26885,7 @@ var app = (function() { * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ - var mergeWith = createAssigner(function( + var mergeWith = createAssigner(function ( object, source, srcIndex, @@ -26914,13 +26914,13 @@ var app = (function() { * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ - var omit = flatRest(function(object, paths) { + var omit = flatRest(function (object, paths) { var result = {} if (object == null) { return result } var isDeep = false - paths = arrayMap(paths, function(path) { + paths = arrayMap(paths, function (path) { path = castPath(path, object) isDeep || (isDeep = path.length > 1) return path @@ -26981,7 +26981,7 @@ var app = (function() { * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ - var pick = flatRest(function(object, paths) { + var pick = flatRest(function (object, paths) { return object == null ? {} : basePick(object, paths) }) @@ -27007,11 +27007,11 @@ var app = (function() { if (object == null) { return {} } - var props = arrayMap(getAllKeysIn(object), function(prop) { + var props = arrayMap(getAllKeysIn(object), function (prop) { return [prop] }) predicate = getIteratee(predicate) - return basePickBy(object, props, function(value, path) { + return basePickBy(object, props, function (value, path) { return predicate(value, path[0]) }) } @@ -27231,7 +27231,7 @@ var app = (function() { accumulator = {} } } - ;(isArrLike ? arrayEach : baseForOwn)(object, function( + ; (isArrLike ? arrayEach : baseForOwn)(object, function ( value, index, object @@ -27551,10 +27551,10 @@ var app = (function() { var rand = nativeRandom() return nativeMin( lower + - rand * - (upper - - lower + - freeParseFloat("1e-" + ((rand + "").length - 1))), + rand * + (upper - + lower + + freeParseFloat("1e-" + ((rand + "").length - 1))), upper ) } @@ -27583,7 +27583,7 @@ var app = (function() { * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ - var camelCase = createCompounder(function(result, word, index) { + var camelCase = createCompounder(function (result, word, index) { word = word.toLowerCase() return result + (index ? capitalize(word) : word) }) @@ -27749,7 +27749,7 @@ var app = (function() { * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ - var kebabCase = createCompounder(function(result, word, index) { + var kebabCase = createCompounder(function (result, word, index) { return result + (index ? "-" : "") + word.toLowerCase() }) @@ -27773,7 +27773,7 @@ var app = (function() { * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ - var lowerCase = createCompounder(function(result, word, index) { + var lowerCase = createCompounder(function (result, word, index) { return result + (index ? " " : "") + word.toLowerCase() }) @@ -28015,7 +28015,7 @@ var app = (function() { * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ - var snakeCase = createCompounder(function(result, word, index) { + var snakeCase = createCompounder(function (result, word, index) { return result + (index ? "_" : "") + word.toLowerCase() }) @@ -28085,7 +28085,7 @@ var app = (function() { * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ - var startCase = createCompounder(function(result, word, index) { + var startCase = createCompounder(function (result, word, index) { return result + (index ? " " : "") + upperFirst(word) }) @@ -28240,11 +28240,11 @@ var app = (function() { options = assignInWith({}, options, settings, customDefaultsAssignIn) var imports = assignInWith( - {}, - options.imports, - settings.imports, - customDefaultsAssignIn - ), + {}, + options.imports, + settings.imports, + customDefaultsAssignIn + ), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys) @@ -28257,14 +28257,14 @@ var app = (function() { // 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 + - "|$", + "|" + + interpolate.source + + "|" + + (interpolate === reInterpolate ? reEsTemplate : reNoMatch) + .source + + "|" + + (options.evaluate || reNoMatch).source + + "|$", "g" ) @@ -28279,7 +28279,7 @@ var app = (function() { : "lodash.templateSources[" + ++templateCounter + "]") + "\n" - string.replace(reDelimiters, function( + string.replace(reDelimiters, function ( match, escapeValue, interpolateValue, @@ -28345,12 +28345,12 @@ var app = (function() { (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\n" + - "function print() { __p += __j.call(arguments, '') }\n" + "function print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}" - var result = attempt(function() { + var result = attempt(function () { return Function(importsKeys, sourceURL + "return " + source).apply( undefined$1, importsValues @@ -28664,7 +28664,7 @@ var app = (function() { * _.upperCase('__foo_bar__'); * // => 'FOO BAR' */ - var upperCase = createCompounder(function(result, word, index) { + var upperCase = createCompounder(function (result, word, index) { return result + (index ? " " : "") + word.toUpperCase() }) @@ -28742,7 +28742,7 @@ var app = (function() { * elements = []; * } */ - var attempt = baseRest(function(func, args) { + var attempt = baseRest(function (func, args) { try { return apply(func, undefined$1, args) } catch (e) { @@ -28776,8 +28776,8 @@ var app = (function() { * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ - var bindAll = flatRest(function(object, methodNames) { - arrayEach(methodNames, function(key) { + var bindAll = flatRest(function (object, methodNames) { + arrayEach(methodNames, function (key) { key = toKey(key) baseAssignValue(object, key, bind(object[key], object)) }) @@ -28819,14 +28819,14 @@ var app = (function() { pairs = !length ? [] - : arrayMap(pairs, function(pair) { - if (typeof pair[1] != "function") { - throw new TypeError(FUNC_ERROR_TEXT) - } - return [toIteratee(pair[0]), pair[1]] - }) + : 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) { + return baseRest(function (args) { var index = -1 while (++index < length) { var pair = pairs[index] @@ -28885,7 +28885,7 @@ var app = (function() { * // => true */ function constant(value) { - return function() { + return function () { return value } } @@ -29115,8 +29115,8 @@ var app = (function() { * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ - var method = baseRest(function(path, args) { - return function(object) { + var method = baseRest(function (path, args) { + return function (object) { return baseInvoke(object, path, args) } }) @@ -29144,8 +29144,8 @@ var app = (function() { * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] */ - var methodOf = baseRest(function(object, args) { - return function(path) { + var methodOf = baseRest(function (object, args) { + return function (path) { return baseInvoke(object, path, args) } }) @@ -29200,14 +29200,14 @@ var app = (function() { methodNames = baseFunctions(source, keys(source)) } var chain = - !(isObject(options) && "chain" in options) || !!options.chain, + !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object) - arrayEach(methodNames, function(methodName) { + arrayEach(methodNames, function (methodName) { var func = source[methodName] object[methodName] = func if (isFunc) { - object.prototype[methodName] = function() { + object.prototype[methodName] = function () { var chainAll = this.__chain__ if (chain || chainAll) { var result = object(this.__wrapped__), @@ -29283,7 +29283,7 @@ var app = (function() { */ function nthArg(n) { n = toInteger(n) - return baseRest(function(args) { + return baseRest(function (args) { return baseNth(args, n) }) } @@ -29410,7 +29410,7 @@ var app = (function() { * // => [2, 0] */ function propertyOf(object) { - return function(path) { + return function (path) { return object == null ? undefined$1 : baseGet(object, path) } } @@ -29693,7 +29693,7 @@ var app = (function() { * _.add(6, 4); * // => 10 */ - var add = createMathOperation(function(augend, addend) { + var add = createMathOperation(function (augend, addend) { return augend + addend }, 0) @@ -29735,7 +29735,7 @@ var app = (function() { * _.divide(6, 4); * // => 1.5 */ - var divide = createMathOperation(function(dividend, divisor) { + var divide = createMathOperation(function (dividend, divisor) { return dividend / divisor }, 1) @@ -29928,7 +29928,7 @@ var app = (function() { * _.multiply(6, 4); * // => 24 */ - var multiply = createMathOperation(function(multiplier, multiplicand) { + var multiply = createMathOperation(function (multiplier, multiplicand) { return multiplier * multiplicand }, 1) @@ -29970,7 +29970,7 @@ var app = (function() { * _.subtract(6, 4); * // => 2 */ - var subtract = createMathOperation(function(minuend, subtrahend) { + var subtract = createMathOperation(function (minuend, subtrahend) { return minuend - subtrahend }, 0) @@ -30343,9 +30343,9 @@ var app = (function() { mixin( lodash, - (function() { + (function () { var source = {} - baseForOwn(lodash, function(func, methodName) { + baseForOwn(lodash, function (func, methodName) { if (!hasOwnProperty.call(lodash.prototype, methodName)) { source[methodName] = func } @@ -30369,14 +30369,14 @@ var app = (function() { // Assign default placeholders. arrayEach( ["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], - function(methodName) { + 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) { + arrayEach(["drop", "take"], function (methodName, index) { + LazyWrapper.prototype[methodName] = function (n) { n = n === undefined$1 ? 1 : nativeMax(toInteger(n), 0) var result = @@ -30393,19 +30393,19 @@ var app = (function() { return result } - LazyWrapper.prototype[methodName + "Right"] = function(n) { + LazyWrapper.prototype[methodName + "Right"] = function (n) { return this.reverse() - [methodName](n) + [methodName](n) .reverse() } }) // Add `LazyWrapper` methods that accept an `iteratee` value. - arrayEach(["filter", "map", "takeWhile"], function(methodName, index) { + 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) { + LazyWrapper.prototype[methodName] = function (iteratee) { var result = this.clone() result.__iteratees__.push({ iteratee: getIteratee(iteratee, 3), @@ -30417,49 +30417,49 @@ var app = (function() { }) // Add `LazyWrapper` methods for `_.head` and `_.last`. - arrayEach(["head", "last"], function(methodName, index) { + arrayEach(["head", "last"], function (methodName, index) { var takeName = "take" + (index ? "Right" : "") - LazyWrapper.prototype[methodName] = function() { + LazyWrapper.prototype[methodName] = function () { return this[takeName](1).value()[0] } }) // Add `LazyWrapper` methods for `_.initial` and `_.tail`. - arrayEach(["initial", "tail"], function(methodName, index) { + arrayEach(["initial", "tail"], function (methodName, index) { var dropName = "drop" + (index ? "" : "Right") - LazyWrapper.prototype[methodName] = function() { + LazyWrapper.prototype[methodName] = function () { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1) } }) - LazyWrapper.prototype.compact = function() { + LazyWrapper.prototype.compact = function () { return this.filter(identity) } - LazyWrapper.prototype.find = function(predicate) { + LazyWrapper.prototype.find = function (predicate) { return this.filter(predicate).head() } - LazyWrapper.prototype.findLast = function(predicate) { + LazyWrapper.prototype.findLast = function (predicate) { return this.reverse().find(predicate) } - LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { + LazyWrapper.prototype.invokeMap = baseRest(function (path, args) { if (typeof path == "function") { return new LazyWrapper(this) } - return this.map(function(value) { + return this.map(function (value) { return baseInvoke(value, path, args) }) }) - LazyWrapper.prototype.reject = function(predicate) { + LazyWrapper.prototype.reject = function (predicate) { return this.filter(negate(getIteratee(predicate))) } - LazyWrapper.prototype.slice = function(start, end) { + LazyWrapper.prototype.slice = function (start, end) { start = toInteger(start) var result = this @@ -30478,41 +30478,41 @@ var app = (function() { return result } - LazyWrapper.prototype.takeRightWhile = function(predicate) { + LazyWrapper.prototype.takeRightWhile = function (predicate) { return this.reverse() .takeWhile(predicate) .reverse() } - LazyWrapper.prototype.toArray = function() { + LazyWrapper.prototype.toArray = function () { return this.take(MAX_ARRAY_LENGTH) } // Add `LazyWrapper` methods to `lodash.prototype`. - baseForOwn(LazyWrapper.prototype, function(func, methodName) { + baseForOwn(LazyWrapper.prototype, function (func, methodName) { var checkIteratee = /^(?:filter|find|map|reject)|While$/.test( - methodName - ), + methodName + ), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[ - isTaker - ? "take" + (methodName == "last" ? "Right" : "") - : methodName + isTaker + ? "take" + (methodName == "last" ? "Right" : "") + : methodName ], retUnwrapped = isTaker || /^find/.test(methodName) if (!lodashFunc) { return } - lodash.prototype[methodName] = function() { + 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 interceptor = function (value) { var result = lodashFunc.apply(lodash, arrayPush([value], args)) return isTaker && chainAll ? result[0] : result } @@ -30556,20 +30556,20 @@ var app = (function() { // Add `Array` methods to `lodash.prototype`. arrayEach( ["pop", "push", "shift", "sort", "splice", "unshift"], - function(methodName) { + function (methodName) { var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName) - lodash.prototype[methodName] = function() { + 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 this[chainName](function (value) { return func.apply(isArray(value) ? value : [], args) }) } @@ -30577,7 +30577,7 @@ var app = (function() { ) // Map minified method names to their real names. - baseForOwn(LazyWrapper.prototype, function(func, methodName) { + baseForOwn(LazyWrapper.prototype, function (func, methodName) { var lodashFunc = lodash[methodName] if (lodashFunc) { var key = lodashFunc.name + "" @@ -30626,7 +30626,7 @@ var app = (function() { // Some AMD build optimizers, like r.js, check for condition patterns like: if (freeModule) { // Export for Node.js. - ;(freeModule.exports = _)._ = _ + ; (freeModule.exports = _)._ = _ // Export for CommonJS support. freeExports._ = _ } else { @@ -30779,24 +30779,24 @@ var app = (function() { if (_alphabet_.length !== ORIGINAL.length) { throw new Error( "Custom alphabet for shortid must be " + - ORIGINAL.length + - " unique characters. You submitted " + - _alphabet_.length + - " characters: " + - _alphabet_ + ORIGINAL.length + + " unique characters. You submitted " + + _alphabet_.length + + " characters: " + + _alphabet_ ) } - var unique = _alphabet_.split("").filter(function(item, ind, arr) { + var unique = _alphabet_.split("").filter(function (item, ind, arr) { return ind !== arr.lastIndexOf(item) }) if (unique.length) { throw new Error( "Custom alphabet for shortid must be " + - ORIGINAL.length + - " unique characters. These characters were not unique: " + - unique.join(", ") + ORIGINAL.length + + " unique characters. These characters were not unique: " + + unique.join(", ") ) } @@ -30870,7 +30870,7 @@ var app = (function() { var randomByte if (!crypto || !crypto.getRandomValues) { - randomByte = function(size) { + randomByte = function (size) { var bytes = [] for (var i = 0; i < size; i++) { bytes.push(Math.floor(Math.random() * 256)) @@ -30878,7 +30878,7 @@ var app = (function() { return bytes } } else { - randomByte = function(size) { + randomByte = function (size) { return crypto.getRandomValues(new Uint8Array(size)) } } @@ -30913,7 +30913,7 @@ var app = (function() { * @name format * @function */ - var format = function(random, alphabet, size) { + var format = function (random, alphabet, size) { var mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1 var step = Math.ceil((1.6 * mask * size) / alphabet.length) size = +size @@ -31002,7 +31002,7 @@ var app = (function() { var isValid = isShortId - var lib = createCommonjsModule(function(module) { + var lib = createCommonjsModule(function (module) { // if you are using cluster or multiple servers use this to make each instance // has a unique value for worker // Note: I don't know if this is automatically set when using third @@ -31587,7 +31587,7 @@ var app = (function() { const isEventType = prop => fp_10(prop) && prop.length > 0 && !fp_2(prop[0][EVENT_TYPE_MEMBER_NAME]) - const doNothing = () => {} + const doNothing = () => { } doNothing.isPlaceholder = true const setupBinding = (store, rootProps, coreApi, context, rootPath) => { @@ -31688,20 +31688,20 @@ var app = (function() { parameters[pname] = !isBound(p) ? p : takeStateFromStore(p) - ? getState(s, p[BB_STATE_BINDINGPATH], p[BB_STATE_FALLBACK]) - : takeStateFromEventParameters(p) - ? getState( - eventContext, - p[BB_STATE_BINDINGPATH], - p[BB_STATE_FALLBACK] - ) - : takeStateFromContext(p) - ? getState( - context, - p[BB_STATE_BINDINGPATH], - p[BB_STATE_FALLBACK] - ) - : p[BB_STATE_FALLBACK] + ? getState(s, p[BB_STATE_BINDINGPATH], p[BB_STATE_FALLBACK]) + : takeStateFromEventParameters(p) + ? getState( + eventContext, + p[BB_STATE_BINDINGPATH], + p[BB_STATE_FALLBACK] + ) + : takeStateFromContext(p) + ? getState( + context, + p[BB_STATE_BINDINGPATH], + p[BB_STATE_FALLBACK] + ) + : p[BB_STATE_FALLBACK] } handlerType.execute(parameters) }) @@ -31753,7 +31753,7 @@ var app = (function() { const app = { datastore: null, crypto: null, - publish: () => {}, + publish: () => { }, hierarchy: appDefinition.hierarchy, actions: appDefinition.actions, user, @@ -31772,8 +31772,8 @@ var app = (function() { "context", "tempVars", // eslint-disable-line "const sandbox = $nxCompileToSandbox(context, tempVars)\n try { with (sandbox) { return " + - src + - " } } catch (err) {\n if (!(err instanceof TypeError)) throw err\n }\n $nxClearSandbox()" + src + + " } } catch (err) {\n if (!(err instanceof TypeError)) throw err\n }\n $nxClearSandbox()" ) } @@ -31782,8 +31782,8 @@ var app = (function() { "context", "tempVars", // eslint-disable-line "const sandbox = $nxCompileToSandbox(context, tempVars)\n with (sandbox) { " + - src + - " }\n $nxClearSandbox()" + src + + " }\n $nxClearSandbox()" ) } @@ -31981,7 +31981,7 @@ var app = (function() { "indexType", "reference index may only exist on a record node", index => - isRecord(index.parent()) || index.indexType !== indexTypes.reference + isModel(index.parent()) || index.indexType !== indexTypes.reference ), makerule( "indexType", @@ -32064,8 +32064,8 @@ var app = (function() { const isNode = (appHierarchy, key) => isSomething(getExactNodeForPath(appHierarchy)(key)) - const isRecord = node => isSomething(node) && node.type === "record" - const isCollectionRecord = node => isRecord(node) && !node.isSingle + const isModel = node => isSomething(node) && node.type === "record" + const isCollectionRecord = node => isModel(node) && !node.isSingle const getSafeFieldParser = (tryParse, defaultValueFunctions) => ( field, @@ -32301,7 +32301,7 @@ var app = (function() { val === null || opts.minValue === null || val >= opts.minValue, (val, opts) => `value (${val.toString()}) must be greater than or equal to ${ - opts.minValue + opts.minValue }` ), makerule$1( @@ -32309,7 +32309,7 @@ var app = (function() { val === null || opts.maxValue === null || val <= opts.maxValue, (val, opts) => `value (${val.toString()}) must be less than or equal to ${ - opts.minValue + opts.minValue } options` ), makerule$1( @@ -32317,7 +32317,7 @@ var app = (function() { val === null || opts.decimalPlaces >= getDecimalPlaces(val), (val, opts) => `value (${val.toString()}) must have ${ - opts.decimalPlaces + opts.decimalPlaces } decimal places or less` ), ] @@ -32373,7 +32373,7 @@ var app = (function() { val === null || opts.minValue === null || val >= opts.minValue, (val, opts) => `value (${val.toString()}) must be greater than or equal to ${ - opts.minValue + opts.minValue }` ), makerule$1( @@ -32381,7 +32381,7 @@ var app = (function() { val === null || opts.maxValue === null || val <= opts.maxValue, (val, opts) => `value (${val.toString()}) must be less than or equal to ${ - opts.minValue + opts.minValue } options` ), ] @@ -32511,7 +32511,7 @@ var app = (function() { ensureReferenceExists, (val, opts) => `"${val[opts.displayValue]}" does not exist in options list (key: ${ - val.key + val.key })` ), ] @@ -32661,8 +32661,8 @@ var app = (function() { const nodeKey = isNothing(resourceKey) ? null : isNode(app.hierarchy, resourceKey) - ? getNodeByKeyOrNodeKey(app.hierarchy, resourceKey).nodeKey() - : resourceKey + ? getNodeByKeyOrNodeKey(app.hierarchy, resourceKey).nodeKey() + : resourceKey return ( userperm.type === permissionType && diff --git a/packages/bootstrap-components/public/bundle.js.map b/packages/bootstrap-components/public/bundle.js.map index 6458690a19..14af62c502 100644 --- a/packages/bootstrap-components/public/bundle.js.map +++ b/packages/bootstrap-components/public/bundle.js.map @@ -123,8 +123,8 @@ "import { filter, map } from 'lodash/fp';\nimport { $, isSomething } from './index';\n\nexport const stringNotEmpty = s => isSomething(s) && s.trim().length > 0;\n\nexport const makerule = (field, error, isValid) => ({ field, error, isValid });\n\nexport const validationError = (rule, item) => ({ ...rule, item });\n\nexport const applyRuleSet = ruleSet => itemToValidate => $(ruleSet, [\n map(applyRule(itemToValidate)),\n filter(isSomething),\n]);\n\nexport const applyRule = itemTovalidate => rule => (rule.isValid(itemTovalidate)\n ? null\n : validationError(rule, itemTovalidate));\n", "var filters = new Map();\nvar limiters = new Map();\n\nfunction filter(name, handler) {\n if (typeof name !== 'string') {\n throw new TypeError('First argument must be a string.');\n }\n if (typeof handler !== 'function') {\n throw new TypeError('Second argument must be a function.');\n }\n if (filters.has(name)) {\n throw new Error((\"A filter named \" + name + \" is already registered.\"));\n }\n filters.set(name, handler);\n}\n\nfunction limiter(name, handler) {\n if (typeof name !== 'string') {\n throw new TypeError('First argument must be a string.');\n }\n if (typeof handler !== 'function') {\n throw new TypeError('Second argument must be a function.');\n }\n if (limiters.has(name)) {\n throw new Error((\"A limiter named \" + name + \" is already registered.\"));\n }\n limiters.set(name, handler);\n}\n\nfunction compileRawExpression(src) {\n return new Function('context', 'tempVars', // eslint-disable-line\n (\"const sandbox = $nxCompileToSandbox(context, tempVars)\\n try { with (sandbox) { return \" + src + \" } } catch (err) {\\n if (!(err instanceof TypeError)) throw err\\n }\\n $nxClearSandbox()\"));\n}\n\nfunction compileRawCode(src) {\n return new Function('context', 'tempVars', // eslint-disable-line\n (\"const sandbox = $nxCompileToSandbox(context, tempVars)\\n with (sandbox) { \" + src + \" }\\n $nxClearSandbox()\"));\n}\n\nvar filterRegex = /(?:[^\\|]|\\|\\|)+/g;\nvar limiterRegex = /(?:[^&]|&&)+/g;\nvar argsRegex = /\\S+/g;\n\nfunction parseExpression(src) {\n var tokens = src.match(filterRegex);\n if (tokens.length === 1) {\n return compileRawExpression(tokens[0]);\n }\n\n var expression = {\n exec: compileRawExpression(tokens[0]),\n filters: []\n };\n for (var i = 1; i < tokens.length; i++) {\n var filterTokens = tokens[i].match(argsRegex);\n var filterName = filterTokens.shift();\n var effect = filters.get(filterName);\n if (!effect) {\n throw new Error((\"There is no filter named: \" + filterName + \".\"));\n }\n expression.filters.push({ effect: effect, argExpressions: filterTokens.map(compileRawExpression) });\n }\n return expression;\n}\n\nfunction parseCode(src) {\n var tokens = src.match(limiterRegex);\n if (tokens.length === 1) {\n return compileRawCode(tokens[0]);\n }\n\n var code = {\n exec: compileRawCode(tokens[0]),\n limiters: []\n };\n for (var i = 1; i < tokens.length; i++) {\n var limiterTokens = tokens[i].match(argsRegex);\n var limiterName = limiterTokens.shift();\n var effect = limiters.get(limiterName);\n if (!effect) {\n throw new Error((\"There is no limiter named: \" + limiterName + \".\"));\n }\n code.limiters.push({ effect: effect, argExpressions: limiterTokens.map(compileRawExpression) });\n }\n return code;\n}\n\nvar expressionCache = new Map();\nvar codeCache = new Map();\n\nfunction compileExpression(src) {\n if (typeof src !== 'string') {\n throw new TypeError('First argument must be a string.');\n }\n var expression = expressionCache.get(src);\n if (!expression) {\n expression = parseExpression(src);\n expressionCache.set(src, expression);\n }\n\n if (typeof expression === 'function') {\n return expression;\n }\n\n return function evaluateExpression(context, tempVars) {\n var value = expression.exec(context, tempVars);\n for (var i = 0, list = expression.filters; i < list.length; i += 1) {\n var filter = list[i];\n\n var args = filter.argExpressions.map(evaluateArgExpression, context);\n value = filter.effect.apply(filter, [ value ].concat( args ));\n }\n return value;\n };\n}\n\nfunction compileCode(src) {\n if (typeof src !== 'string') {\n throw new TypeError('First argument must be a string.');\n }\n var code = codeCache.get(src);\n if (!code) {\n code = parseCode(src);\n codeCache.set(src, code);\n }\n\n if (typeof code === 'function') {\n return code;\n }\n\n var context = {};\n return function evaluateCode(state, tempVars) {\n var i = 0;\n function next() {\n Object.assign(context, tempVars);\n if (i < code.limiters.length) {\n var limiter = code.limiters[i++];\n var args = limiter.argExpressions.map(evaluateArgExpression, state);\n limiter.effect.apply(limiter, [ next, context ].concat( args ));\n } else {\n code.exec(state, tempVars);\n }\n }\n next();\n };\n}\n\nfunction evaluateArgExpression(argExpression) {\n return argExpression(this);\n}\n\nvar hasHandler = { has: has };\nvar allHandlers = { has: has, get: get };\nvar globals = new Set();\nvar temp;\n\nvar globalObj;\nif (typeof window !== 'undefined') { globalObj = window; } // eslint-disable-line\nelse if (typeof global !== 'undefined') { globalObj = global; } // eslint-disable-line\n else if (typeof self !== 'undefined') { globalObj = self; } // eslint-disable-line\nglobalObj.$nxCompileToSandbox = toSandbox;\nglobalObj.$nxClearSandbox = clearSandbox;\n\nfunction expose() {\n var globalNames = [], len = arguments.length;\n while ( len-- ) globalNames[ len ] = arguments[ len ];\n\n for (var i = 0, list = globalNames; i < list.length; i += 1) {\n var globalName = list[i];\n\n globals.add(globalName);\n }\n}\n\nfunction hide() {\n var globalNames = [], len = arguments.length;\n while ( len-- ) globalNames[ len ] = arguments[ len ];\n\n for (var i = 0, list = globalNames; i < list.length; i += 1) {\n var globalName = list[i];\n\n globals.delete(globalName);\n }\n}\n\nfunction hideAll() {\n globals.clear();\n}\n\nfunction has(target, key) {\n return globals.has(key) ? key in target : true;\n}\n\nfunction get(target, key) {\n return key in temp ? temp[key] : target[key];\n}\n\nfunction toSandbox(obj, tempVars) {\n if (tempVars) {\n temp = tempVars;\n return new Proxy(obj, allHandlers);\n }\n return new Proxy(obj, hasHandler);\n}\n\nfunction clearSandbox() {\n temp = undefined;\n}\n\nexport { compileExpression, compileCode, compileRawExpression, compileRawCode, expose, hide, hideAll, filters, limiters, filter, limiter };\n", "import { compileExpression, compileCode } from '@nx-js/compiler-util';\nimport {\n isUndefined, keys, \n cloneDeep, isFunction,\n} from 'lodash/fp';\nimport { defineError } from '../common';\n\nexport const filterEval = 'FILTER_EVALUATE';\nexport const filterCompile = 'FILTER_COMPILE';\nexport const mapEval = 'MAP_EVALUATE';\nexport const mapCompile = 'MAP_COMPILE';\nexport const removeUndeclaredFields = 'REMOVE_UNDECLARED_FIELDS';\nexport const addUnMappedFields = 'ADD_UNMAPPED_FIELDS';\nexport const addTheKey = 'ADD_KEY';\n\n\nconst getEvaluateResult = () => ({\n isError: false,\n passedFilter: true,\n result: null,\n});\n\nexport const compileFilter = index => compileExpression(index.filter);\n\nexport const compileMap = index => compileCode(index.map);\n\nexport const passesFilter = (record, index) => {\n const context = { record };\n if (!index.filter) return true;\n\n const compiledFilter = defineError(\n () => compileFilter(index),\n filterCompile,\n );\n\n return defineError(\n () => compiledFilter(context),\n filterEval,\n );\n};\n\nexport const mapRecord = (record, index) => {\n const recordClone = cloneDeep(record);\n const context = { record: recordClone };\n\n const map = index.map ? index.map : 'return {...record};';\n\n const compiledMap = defineError(\n () => compileCode(map),\n mapCompile,\n );\n\n const mapped = defineError(\n () => compiledMap(context),\n mapEval,\n );\n\n const mappedKeys = keys(mapped);\n for (let i = 0; i < mappedKeys.length; i++) {\n const key = mappedKeys[i];\n mapped[key] = isUndefined(mapped[key]) ? null : mapped[key];\n if (isFunction(mapped[key])) {\n delete mapped[key];\n }\n }\n\n mapped.key = record.key;\n mapped.sortKey = index.getSortKey\n ? compileCode(index.getSortKey)(context)\n : record.id;\n\n return mapped;\n};\n\nexport const evaluate = record => (index) => {\n const result = getEvaluateResult();\n\n try {\n result.passedFilter = passesFilter(record, index);\n } catch (err) {\n result.isError = true;\n result.passedFilter = false;\n result.result = err.message;\n }\n\n if (!result.passedFilter) return result;\n\n try {\n result.result = mapRecord(record, index);\n } catch (err) {\n result.isError = true;\n result.result = err.message;\n }\n\n return result;\n};\n\nexport default evaluate;\n", - "import {\n map, isEmpty, countBy, \n flatten, includes, join, keys\n} from 'lodash/fp';\nimport { } from 'lodash';\nimport { applyRuleSet, makerule } from '../common/validationCommon';\nimport { compileFilter, compileMap } from '../indexing/evaluate';\nimport { isNonEmptyString, executesWithoutException, $ } from '../common';\nimport { isRecord } from './hierarchy';\n\nexport const indexTypes = { reference: 'reference', ancestor: 'ancestor' };\n\nexport const indexRuleSet = [\n makerule('map', 'index has no map function',\n index => isNonEmptyString(index.map)),\n makerule('map', \"index's map function does not compile\",\n index => !isNonEmptyString(index.map)\n || executesWithoutException(() => compileMap(index))),\n makerule('filter', \"index's filter function does not compile\",\n index => !isNonEmptyString(index.filter)\n || executesWithoutException(() => compileFilter(index))),\n makerule('name', 'must declare a name for index',\n index => isNonEmptyString(index.name)),\n makerule('name', 'there is a duplicate named index on this node',\n index => isEmpty(index.name)\n || countBy('name')(index.parent().indexes)[index.name] === 1),\n makerule('indexType', 'reference index may only exist on a record node',\n index => isRecord(index.parent())\n || index.indexType !== indexTypes.reference),\n makerule('indexType', `index type must be one of: ${join(', ')(keys(indexTypes))}`,\n index => includes(index.indexType)(keys(indexTypes))),\n];\n\nexport const validateIndex = (index, allReferenceIndexesOnNode) => applyRuleSet(indexRuleSet(allReferenceIndexesOnNode))(index);\n\nexport const validateAllIndexes = node => $(node.indexes, [\n map(i => validateIndex(i, node.indexes)),\n flatten,\n]);\n", - "import {\n find, constant, map, last,\n first, split, intersection, take,\n union, includes, filter, some,\n} from 'lodash/fp';\nimport {\n $, switchCase, isNothing, isSomething,\n defaultCase, splitKey, isNonEmptyString,\n joinKey, getHashCode,\n} from '../common';\nimport { indexTypes } from './indexes';\n\nexport const getFlattenedHierarchy = (appHierarchy, useCached = true) => {\n if (isSomething(appHierarchy.getFlattenedHierarchy) && useCached) { return appHierarchy.getFlattenedHierarchy(); }\n\n const flattenHierarchy = (currentNode, flattened) => {\n flattened.push(currentNode);\n if ((!currentNode.children\n || currentNode.children.length === 0)\n && (!currentNode.indexes\n || currentNode.indexes.length === 0)\n && (!currentNode.aggregateGroups\n || currentNode.aggregateGroups.length === 0)) {\n return flattened;\n }\n\n const unionIfAny = l2 => l1 => union(l1)(!l2 ? [] : l2);\n\n const children = $([], [\n unionIfAny(currentNode.children),\n unionIfAny(currentNode.indexes),\n unionIfAny(currentNode.aggregateGroups),\n ]);\n\n for (const child of children) {\n flattenHierarchy(child, flattened);\n }\n return flattened;\n };\n\n appHierarchy.getFlattenedHierarchy = () => flattenHierarchy(appHierarchy, []);\n return appHierarchy.getFlattenedHierarchy();\n};\n\nexport const getLastPartInKey = key => last(splitKey(key));\n\nexport const getNodesInPath = appHierarchy => key => $(appHierarchy, [\n getFlattenedHierarchy,\n filter(n => new RegExp(`${n.pathRegx()}`).test(key)),\n]);\n\nexport const getExactNodeForPath = appHierarchy => key => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => new RegExp(`${n.pathRegx()}$`).test(key)),\n]);\n\nexport const getNodeForCollectionPath = appHierarchy => collectionKey => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => (isCollectionRecord(n)\n && new RegExp(`${n.collectionPathRegx()}$`).test(collectionKey))),\n]);\n\nexport const hasMatchingAncestor = ancestorPredicate => decendantNode => switchCase(\n\n [node => isNothing(node.parent()),\n constant(false)],\n\n [node => ancestorPredicate(node.parent()),\n constant(true)],\n\n [defaultCase,\n node => hasMatchingAncestor(ancestorPredicate)(node.parent())],\n\n)(decendantNode);\n\nexport const getNode = (appHierarchy, nodeKey) => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => n.nodeKey() === nodeKey\n || (isCollectionRecord(n)\n && n.collectionNodeKey() === nodeKey)),\n]);\n\nexport const getCollectionNode = (appHierarchy, nodeKey) => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => (isCollectionRecord(n)\n && n.collectionNodeKey() === nodeKey)),\n]);\n\nexport const getNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => {\n const nodeByKey = getExactNodeForPath(appHierarchy)(keyOrNodeKey);\n return isNothing(nodeByKey)\n ? getNode(appHierarchy, keyOrNodeKey)\n : nodeByKey;\n};\n\nexport const getCollectionNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => {\n const nodeByKey = getNodeForCollectionPath(appHierarchy)(keyOrNodeKey);\n return isNothing(nodeByKey)\n ? getCollectionNode(appHierarchy, keyOrNodeKey)\n : nodeByKey;\n};\n\nexport const isNode = (appHierarchy, key) => isSomething(getExactNodeForPath(appHierarchy)(key));\n\nexport const getActualKeyOfParent = (parentNodeKey, actualChildKey) => $(actualChildKey, [\n splitKey,\n take(splitKey(parentNodeKey).length),\n ks => joinKey(...ks),\n]);\n\nexport const getParentKey = (key) => {\n return $(key, [\n splitKey,\n take(splitKey(key).length - 1),\n joinKey,\n ]);\n};\n\nexport const isKeyAncestorOf = ancestorKey => decendantNode => hasMatchingAncestor(p => p.nodeKey() === ancestorKey)(decendantNode);\n\nexport const hasNoMatchingAncestors = parentPredicate => node => !hasMatchingAncestor(parentPredicate)(node);\n\nexport const findField = (recordNode, fieldName) => find(f => f.name == fieldName)(recordNode.fields);\n\nexport const isAncestor = decendant => ancestor => isKeyAncestorOf(ancestor.nodeKey())(decendant);\n\nexport const isDecendant = ancestor => decendant => isAncestor(decendant)(ancestor);\n\nexport const getRecordNodeId = recordKey => $(recordKey, [\n splitKey,\n last,\n getRecordNodeIdFromId,\n]);\n\nexport const getRecordNodeIdFromId = recordId => $(recordId, [split('-'), first, parseInt]);\n\nexport const getRecordNodeById = (hierarchy, recordId) => $(hierarchy, [\n getFlattenedHierarchy,\n find(n => isRecord(n)\n && n.nodeId === getRecordNodeIdFromId(recordId)),\n]);\n\nexport const recordNodeIdIsAllowed = indexNode => nodeId => indexNode.allowedModelNodeIds.length === 0\n || includes(nodeId)(indexNode.allowedModelNodeIds);\n\nexport const recordNodeIsAllowed = indexNode => recordNode => recordNodeIdIsAllowed(indexNode)(recordNode.nodeId);\n\nexport const getAllowedRecordNodesForIndex = (appHierarchy, indexNode) => {\n const recordNodes = $(appHierarchy, [\n getFlattenedHierarchy,\n filter(isRecord),\n ]);\n\n if (isGlobalIndex(indexNode)) {\n return $(recordNodes, [\n filter(recordNodeIsAllowed(indexNode)),\n ]);\n }\n\n if (isAncestorIndex(indexNode)) {\n return $(recordNodes, [\n filter(isDecendant(indexNode.parent())),\n filter(recordNodeIsAllowed(indexNode)),\n ]);\n }\n\n if (isReferenceIndex(indexNode)) {\n return $(recordNodes, [\n filter(n => some(fieldReversesReferenceToIndex(indexNode))(n.fields)),\n ]);\n }\n};\n\nexport const getNodeFromNodeKeyHash = hierarchy => hash => $(hierarchy, [\n getFlattenedHierarchy,\n find(n => getHashCode(n.nodeKey()) === hash),\n]);\n\nexport const isRecord = node => isSomething(node) && node.type === 'record';\nexport const isSingleRecord = node => isRecord(node) && node.isSingle;\nexport const isCollectionRecord = node => isRecord(node) && !node.isSingle;\nexport const isIndex = node => isSomething(node) && node.type === 'index';\nexport const isaggregateGroup = node => isSomething(node) && node.type === 'aggregateGroup';\nexport const isShardedIndex = node => isIndex(node) && isNonEmptyString(node.getShardName);\nexport const isRoot = node => isSomething(node) && node.isRoot();\nexport const isDecendantOfARecord = hasMatchingAncestor(isRecord);\nexport const isGlobalIndex = node => isIndex(node) && isRoot(node.parent());\nexport const isReferenceIndex = node => isIndex(node) && node.indexType === indexTypes.reference;\nexport const isAncestorIndex = node => isIndex(node) && node.indexType === indexTypes.ancestor;\n\nexport const fieldReversesReferenceToNode = node => field => field.type === 'reference'\n && intersection(field.typeOptions.reverseIndexNodeKeys)(map(i => i.nodeKey())(node.indexes))\n .length > 0;\n\nexport const fieldReversesReferenceToIndex = indexNode => field => field.type === 'reference'\n && intersection(field.typeOptions.reverseIndexNodeKeys)([indexNode.nodeKey()])\n .length > 0;\n\nexport default {\n getLastPartInKey,\n getNodesInPath,\n getExactNodeForPath,\n hasMatchingAncestor,\n getNode,\n getNodeByKeyOrNodeKey,\n isNode,\n getActualKeyOfParent,\n getParentKey,\n isKeyAncestorOf,\n hasNoMatchingAncestors,\n findField,\n isAncestor,\n isDecendant,\n getRecordNodeId,\n getRecordNodeIdFromId,\n getRecordNodeById,\n recordNodeIdIsAllowed,\n recordNodeIsAllowed,\n getAllowedRecordNodesForIndex,\n getNodeFromNodeKeyHash,\n isRecord,\n isCollectionRecord,\n isIndex,\n isaggregateGroup,\n isShardedIndex,\n isRoot,\n isDecendantOfARecord,\n isGlobalIndex,\n isReferenceIndex,\n isAncestorIndex,\n fieldReversesReferenceToNode,\n fieldReversesReferenceToIndex,\n getFlattenedHierarchy,\n};\n", + "import {\n map, isEmpty, countBy, \n flatten, includes, join, keys\n} from 'lodash/fp';\nimport { } from 'lodash';\nimport { applyRuleSet, makerule } from '../common/validationCommon';\nimport { compileFilter, compileMap } from '../indexing/evaluate';\nimport { isNonEmptyString, executesWithoutException, $ } from '../common';\nimport { isModel } from './hierarchy';\n\nexport const indexTypes = { reference: 'reference', ancestor: 'ancestor' };\n\nexport const indexRuleSet = [\n makerule('map', 'index has no map function',\n index => isNonEmptyString(index.map)),\n makerule('map', \"index's map function does not compile\",\n index => !isNonEmptyString(index.map)\n || executesWithoutException(() => compileMap(index))),\n makerule('filter', \"index's filter function does not compile\",\n index => !isNonEmptyString(index.filter)\n || executesWithoutException(() => compileFilter(index))),\n makerule('name', 'must declare a name for index',\n index => isNonEmptyString(index.name)),\n makerule('name', 'there is a duplicate named index on this node',\n index => isEmpty(index.name)\n || countBy('name')(index.parent().indexes)[index.name] === 1),\n makerule('indexType', 'reference index may only exist on a record node',\n index => isModel(index.parent())\n || index.indexType !== indexTypes.reference),\n makerule('indexType', `index type must be one of: ${join(', ')(keys(indexTypes))}`,\n index => includes(index.indexType)(keys(indexTypes))),\n];\n\nexport const validateIndex = (index, allReferenceIndexesOnNode) => applyRuleSet(indexRuleSet(allReferenceIndexesOnNode))(index);\n\nexport const validateAllIndexes = node => $(node.indexes, [\n map(i => validateIndex(i, node.indexes)),\n flatten,\n]);\n", + "import {\n find, constant, map, last,\n first, split, intersection, take,\n union, includes, filter, some,\n} from 'lodash/fp';\nimport {\n $, switchCase, isNothing, isSomething,\n defaultCase, splitKey, isNonEmptyString,\n joinKey, getHashCode,\n} from '../common';\nimport { indexTypes } from './indexes';\n\nexport const getFlattenedHierarchy = (appHierarchy, useCached = true) => {\n if (isSomething(appHierarchy.getFlattenedHierarchy) && useCached) { return appHierarchy.getFlattenedHierarchy(); }\n\n const flattenHierarchy = (currentNode, flattened) => {\n flattened.push(currentNode);\n if ((!currentNode.children\n || currentNode.children.length === 0)\n && (!currentNode.indexes\n || currentNode.indexes.length === 0)\n && (!currentNode.aggregateGroups\n || currentNode.aggregateGroups.length === 0)) {\n return flattened;\n }\n\n const unionIfAny = l2 => l1 => union(l1)(!l2 ? [] : l2);\n\n const children = $([], [\n unionIfAny(currentNode.children),\n unionIfAny(currentNode.indexes),\n unionIfAny(currentNode.aggregateGroups),\n ]);\n\n for (const child of children) {\n flattenHierarchy(child, flattened);\n }\n return flattened;\n };\n\n appHierarchy.getFlattenedHierarchy = () => flattenHierarchy(appHierarchy, []);\n return appHierarchy.getFlattenedHierarchy();\n};\n\nexport const getLastPartInKey = key => last(splitKey(key));\n\nexport const getNodesInPath = appHierarchy => key => $(appHierarchy, [\n getFlattenedHierarchy,\n filter(n => new RegExp(`${n.pathRegx()}`).test(key)),\n]);\n\nexport const getExactNodeForPath = appHierarchy => key => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => new RegExp(`${n.pathRegx()}$`).test(key)),\n]);\n\nexport const getNodeForCollectionPath = appHierarchy => collectionKey => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => (isCollectionRecord(n)\n && new RegExp(`${n.collectionPathRegx()}$`).test(collectionKey))),\n]);\n\nexport const hasMatchingAncestor = ancestorPredicate => decendantNode => switchCase(\n\n [node => isNothing(node.parent()),\n constant(false)],\n\n [node => ancestorPredicate(node.parent()),\n constant(true)],\n\n [defaultCase,\n node => hasMatchingAncestor(ancestorPredicate)(node.parent())],\n\n)(decendantNode);\n\nexport const getNode = (appHierarchy, nodeKey) => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => n.nodeKey() === nodeKey\n || (isCollectionRecord(n)\n && n.collectionNodeKey() === nodeKey)),\n]);\n\nexport const getCollectionNode = (appHierarchy, nodeKey) => $(appHierarchy, [\n getFlattenedHierarchy,\n find(n => (isCollectionRecord(n)\n && n.collectionNodeKey() === nodeKey)),\n]);\n\nexport const getNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => {\n const nodeByKey = getExactNodeForPath(appHierarchy)(keyOrNodeKey);\n return isNothing(nodeByKey)\n ? getNode(appHierarchy, keyOrNodeKey)\n : nodeByKey;\n};\n\nexport const getCollectionNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => {\n const nodeByKey = getNodeForCollectionPath(appHierarchy)(keyOrNodeKey);\n return isNothing(nodeByKey)\n ? getCollectionNode(appHierarchy, keyOrNodeKey)\n : nodeByKey;\n};\n\nexport const isNode = (appHierarchy, key) => isSomething(getExactNodeForPath(appHierarchy)(key));\n\nexport const getActualKeyOfParent = (parentNodeKey, actualChildKey) => $(actualChildKey, [\n splitKey,\n take(splitKey(parentNodeKey).length),\n ks => joinKey(...ks),\n]);\n\nexport const getParentKey = (key) => {\n return $(key, [\n splitKey,\n take(splitKey(key).length - 1),\n joinKey,\n ]);\n};\n\nexport const isKeyAncestorOf = ancestorKey => decendantNode => hasMatchingAncestor(p => p.nodeKey() === ancestorKey)(decendantNode);\n\nexport const hasNoMatchingAncestors = parentPredicate => node => !hasMatchingAncestor(parentPredicate)(node);\n\nexport const findField = (recordNode, fieldName) => find(f => f.name == fieldName)(recordNode.fields);\n\nexport const isAncestor = decendant => ancestor => isKeyAncestorOf(ancestor.nodeKey())(decendant);\n\nexport const isDecendant = ancestor => decendant => isAncestor(decendant)(ancestor);\n\nexport const getRecordNodeId = recordKey => $(recordKey, [\n splitKey,\n last,\n getRecordNodeIdFromId,\n]);\n\nexport const getRecordNodeIdFromId = recordId => $(recordId, [split('-'), first, parseInt]);\n\nexport const getRecordNodeById = (hierarchy, recordId) => $(hierarchy, [\n getFlattenedHierarchy,\n find(n => isModel(n)\n && n.nodeId === getRecordNodeIdFromId(recordId)),\n]);\n\nexport const recordNodeIdIsAllowed = indexNode => nodeId => indexNode.allowedModelNodeIds.length === 0\n || includes(nodeId)(indexNode.allowedModelNodeIds);\n\nexport const recordNodeIsAllowed = indexNode => recordNode => recordNodeIdIsAllowed(indexNode)(recordNode.nodeId);\n\nexport const getAllowedRecordNodesForIndex = (appHierarchy, indexNode) => {\n const recordNodes = $(appHierarchy, [\n getFlattenedHierarchy,\n filter(isModel),\n ]);\n\n if (isGlobalIndex(indexNode)) {\n return $(recordNodes, [\n filter(recordNodeIsAllowed(indexNode)),\n ]);\n }\n\n if (isAncestorIndex(indexNode)) {\n return $(recordNodes, [\n filter(isDecendant(indexNode.parent())),\n filter(recordNodeIsAllowed(indexNode)),\n ]);\n }\n\n if (isReferenceIndex(indexNode)) {\n return $(recordNodes, [\n filter(n => some(fieldReversesReferenceToIndex(indexNode))(n.fields)),\n ]);\n }\n};\n\nexport const getNodeFromNodeKeyHash = hierarchy => hash => $(hierarchy, [\n getFlattenedHierarchy,\n find(n => getHashCode(n.nodeKey()) === hash),\n]);\n\nexport const isModel = node => isSomething(node) && node.type === 'record';\nexport const isSingleRecord = node => isModel(node) && node.isSingle;\nexport const isCollectionRecord = node => isModel(node) && !node.isSingle;\nexport const isIndex = node => isSomething(node) && node.type === 'index';\nexport const isaggregateGroup = node => isSomething(node) && node.type === 'aggregateGroup';\nexport const isShardedIndex = node => isIndex(node) && isNonEmptyString(node.getShardName);\nexport const isRoot = node => isSomething(node) && node.isRoot();\nexport const isDecendantOfARecord = hasMatchingAncestor(isModel);\nexport const isGlobalIndex = node => isIndex(node) && isRoot(node.parent());\nexport const isReferenceIndex = node => isIndex(node) && node.indexType === indexTypes.reference;\nexport const isAncestorIndex = node => isIndex(node) && node.indexType === indexTypes.ancestor;\n\nexport const fieldReversesReferenceToNode = node => field => field.type === 'reference'\n && intersection(field.typeOptions.reverseIndexNodeKeys)(map(i => i.nodeKey())(node.indexes))\n .length > 0;\n\nexport const fieldReversesReferenceToIndex = indexNode => field => field.type === 'reference'\n && intersection(field.typeOptions.reverseIndexNodeKeys)([indexNode.nodeKey()])\n .length > 0;\n\nexport default {\n getLastPartInKey,\n getNodesInPath,\n getExactNodeForPath,\n hasMatchingAncestor,\n getNode,\n getNodeByKeyOrNodeKey,\n isNode,\n getActualKeyOfParent,\n getParentKey,\n isKeyAncestorOf,\n hasNoMatchingAncestors,\n findField,\n isAncestor,\n isDecendant,\n getRecordNodeId,\n getRecordNodeIdFromId,\n getRecordNodeById,\n recordNodeIdIsAllowed,\n recordNodeIsAllowed,\n getAllowedRecordNodesForIndex,\n getNodeFromNodeKeyHash,\n isModel,\n isCollectionRecord,\n isIndex,\n isaggregateGroup,\n isShardedIndex,\n isRoot,\n isDecendantOfARecord,\n isGlobalIndex,\n isReferenceIndex,\n isAncestorIndex,\n fieldReversesReferenceToNode,\n fieldReversesReferenceToIndex,\n getFlattenedHierarchy,\n};\n", "import { merge } from 'lodash';\nimport {\n constant, isUndefined, has,\n mapValues, cloneDeep,\n} from 'lodash/fp';\nimport { isNotEmpty } from '../common';\n\nexport const getSafeFieldParser = (tryParse, defaultValueFunctions) => (field, record) => {\n if (has(field.name)(record)) {\n return getSafeValueParser(tryParse, defaultValueFunctions)(record[field.name]);\n }\n return defaultValueFunctions[field.getUndefinedValue]();\n};\n\nexport const getSafeValueParser = (tryParse, defaultValueFunctions) => (value) => {\n const parsed = tryParse(value);\n if (parsed.success) {\n return parsed.value;\n }\n return defaultValueFunctions.default();\n};\n\nexport const getNewValue = (tryParse, defaultValueFunctions) => (field) => {\n const getInitialValue = isUndefined(field) || isUndefined(field.getInitialValue)\n ? 'default'\n : field.getInitialValue;\n\n return has(getInitialValue)(defaultValueFunctions)\n ? defaultValueFunctions[getInitialValue]()\n : getSafeValueParser(tryParse, defaultValueFunctions)(getInitialValue);\n};\n\nexport const typeFunctions = specificFunctions => merge({\n value: constant,\n null: constant(null),\n}, specificFunctions);\n\nexport const validateTypeConstraints = validationRules => async (field, record, context) => {\n const fieldValue = record[field.name];\n const validateRule = async r => (!await r.isValid(fieldValue, field.typeOptions, context)\n ? r.getMessage(fieldValue, field.typeOptions)\n : '');\n\n const errors = [];\n for (const r of validationRules) {\n const err = await validateRule(r);\n if (isNotEmpty(err)) errors.push(err);\n }\n\n return errors;\n};\n\nconst getDefaultOptions = mapValues(v => v.defaultValue);\n\nexport const makerule = (isValid, getMessage) => ({ isValid, getMessage });\nexport const parsedFailed = val => ({ success: false, value: val });\nexport const parsedSuccess = val => ({ success: true, value: val });\nexport const getDefaultExport = (name, tryParse, functions, options, validationRules, sampleValue, stringify) => ({\n getNew: getNewValue(tryParse, functions),\n safeParseField: getSafeFieldParser(tryParse, functions),\n safeParseValue: getSafeValueParser(tryParse, functions),\n tryParse,\n name,\n getDefaultOptions: () => getDefaultOptions(cloneDeep(options)),\n optionDefinitions: options,\n validateTypeConstraints: validateTypeConstraints(validationRules),\n sampleValue,\n stringify: val => (val === null || val === undefined\n ? '' : stringify(val)),\n getDefaultValue: functions.default,\n});\n", "import {\n constant, isString,\n isNull, includes, isBoolean,\n} from 'lodash/fp';\nimport {\n typeFunctions,\n makerule, parsedSuccess, getDefaultExport,\n} from './typeHelpers';\nimport {\n switchCase, defaultCase, toBoolOrNull, toNumberOrNull,\n isSafeInteger, isArrayOfString,\n} from '../common';\n\nconst stringFunctions = typeFunctions({\n default: constant(null),\n});\n\nconst stringTryParse = switchCase(\n [isString, parsedSuccess],\n [isNull, parsedSuccess],\n [defaultCase, v => parsedSuccess(v.toString())],\n);\n\nconst options = {\n maxLength: {\n defaultValue: null,\n isValid: n => n === null || isSafeInteger(n) && n > 0,\n requirementDescription: 'max length must be null (no limit) or a greater than zero integer',\n parse: toNumberOrNull,\n },\n values: {\n defaultValue: null,\n isValid: v => v === null || (isArrayOfString(v) && v.length > 0 && v.length < 10000),\n requirementDescription: \"'values' must be null (no values) or an arry of at least one string\",\n parse: s => s,\n },\n allowDeclaredValuesOnly: {\n defaultValue: false,\n isValid: isBoolean,\n requirementDescription: 'allowDeclaredValuesOnly must be true or false',\n parse: toBoolOrNull,\n },\n};\n\nconst typeConstraints = [\n makerule(async (val, opts) => val === null || opts.maxLength === null || val.length <= opts.maxLength,\n (val, opts) => `value exceeds maximum length of ${opts.maxLength}`),\n makerule(async (val, opts) => val === null\n || opts.allowDeclaredValuesOnly === false\n || includes(val)(opts.values),\n (val) => `\"${val}\" does not exist in the list of allowed values`),\n];\n\nexport default getDefaultExport(\n 'string',\n stringTryParse,\n stringFunctions,\n options,\n typeConstraints,\n 'abcde',\n str => str,\n);\n", "import { constant, isBoolean, isNull } from 'lodash/fp';\nimport {\n typeFunctions,\n makerule, parsedFailed, parsedSuccess,\n getDefaultExport,\n} from './typeHelpers';\nimport {\n switchCase, defaultCase, isOneOf, toBoolOrNull,\n} from '../common';\n\nconst boolFunctions = typeFunctions({\n default: constant(null),\n});\n\nconst boolTryParse = switchCase(\n [isBoolean, parsedSuccess],\n [isNull, parsedSuccess],\n [isOneOf('true', '1', 'yes', 'on'), () => parsedSuccess(true)],\n [isOneOf('false', '0', 'no', 'off'), () => parsedSuccess(false)],\n [defaultCase, parsedFailed],\n);\n\nconst options = {\n allowNulls: {\n defaultValue: true,\n isValid: isBoolean,\n requirementDescription: 'must be a true or false',\n parse: toBoolOrNull,\n },\n};\n\nconst typeConstraints = [\n makerule(async (val, opts) => opts.allowNulls === true || val !== null,\n () => 'field cannot be null'),\n];\n\nexport default getDefaultExport(\n 'bool', boolTryParse, boolFunctions,\n options, typeConstraints, true, JSON.stringify,\n);\n", diff --git a/packages/builder/src/builderStore/store/backend.js b/packages/builder/src/builderStore/store/backend.js index 10e1c7bb75..34b3212a58 100644 --- a/packages/builder/src/builderStore/store/backend.js +++ b/packages/builder/src/builderStore/store/backend.js @@ -214,9 +214,9 @@ export const deleteCurrentNode = store => () => { ? state.hierarchy.children.find(node => node !== state.currentNode) : nodeToDelete.parent() - const isRecord = hierarchyFunctions.isRecord(nodeToDelete) + const isModel = hierarchyFunctions.isModel(nodeToDelete) - const check = isRecord + const check = isModel ? canDeleteModel(nodeToDelete) : canDeleteIndex(nodeToDelete) @@ -225,7 +225,7 @@ export const deleteCurrentNode = store => () => { return state } - const recordOrIndexKey = isRecord ? "children" : "indexes" + const recordOrIndexKey = isModel ? "children" : "indexes" // remove the selected record or index const newCollection = remove( diff --git a/packages/builder/src/components/common/core.js b/packages/builder/src/components/common/core.js index 66b6e93014..2f2134f23f 100644 --- a/packages/builder/src/components/common/core.js +++ b/packages/builder/src/components/common/core.js @@ -78,7 +78,7 @@ export const getPotentialReferenceIndexes = (hierarchy, record) => ]) export const isIndex = hierarchyFunctions.isIndex -export const isRecord = hierarchyFunctions.isRecord +export const isModel = hierarchyFunctions.isModel export const nodeNameFromNodeKey = hierarchyFunctions.nodeNameFromNodeKey export const getDefaultTypeOptions = type => @@ -109,7 +109,7 @@ export const getIndexNodes = hierarchy => export const getRecordNodes = hierarchy => pipe(hierarchy, [ hierarchyFunctions.getFlattenedHierarchy, - filter(hierarchyFunctions.isRecord), + filter(hierarchyFunctions.isModel), ]) export const getIndexSchema = hierarchy => index => diff --git a/packages/builder/src/components/database/ModelDataTable/modals/CreateEditView.svelte b/packages/builder/src/components/database/ModelDataTable/modals/CreateEditView.svelte index b15cbed927..aeab7f8ce7 100644 --- a/packages/builder/src/components/database/ModelDataTable/modals/CreateEditView.svelte +++ b/packages/builder/src/components/database/ModelDataTable/modals/CreateEditView.svelte @@ -29,7 +29,7 @@ index.allowedModelNodeIds && index.allowedModelNodeIds.some(id => node.nodeId === id), })), - filter(hierarchyFunctions.isRecord), + filter(hierarchyFunctions.isModel), filter(hierarchyFunctions.isDecendant($store.currentNode.parent())), hierarchyFunctions.getFlattenedHierarchy ) diff --git a/packages/core/src/authApi/generateFullPermissions.js b/packages/core/src/authApi/generateFullPermissions.js index f962316425..74b16317b9 100644 --- a/packages/core/src/authApi/generateFullPermissions.js +++ b/packages/core/src/authApi/generateFullPermissions.js @@ -3,7 +3,7 @@ import { permission } from "./permissions" import { getFlattenedHierarchy, isIndex, - isRecord, + isModel, } from "../templateApi/hierarchy" import { $ } from "../common" @@ -11,7 +11,7 @@ export const generateFullPermissions = app => { const allNodes = getFlattenedHierarchy(app.hierarchy) const accessLevel = { permissions: [] } - const recordNodes = $(allNodes, [filter(isRecord)]) + const recordNodes = $(allNodes, [filter(isModel)]) for (const n of recordNodes) { permission.createRecord.add(n.nodeKey(), accessLevel) diff --git a/packages/core/src/authApi/validateAccessLevels.js b/packages/core/src/authApi/validateAccessLevels.js index 7442a60f53..bd22cd73b0 100644 --- a/packages/core/src/authApi/validateAccessLevels.js +++ b/packages/core/src/authApi/validateAccessLevels.js @@ -24,7 +24,7 @@ import { alwaysAuthorized } from "./permissions" const isAllowedType = t => $(permissionTypes, [values, includes(t)]) -const isRecordOrIndexType = t => +const isModelOrIndexType = t => some(p => p === t)([ permissionTypes.CREATE_RECORD, permissionTypes.UPDATE_RECORD, @@ -42,7 +42,7 @@ const permissionRules = app => [ "nodeKey", "record and index permissions must include a valid nodeKey", p => - !isRecordOrIndexType(p.type) || + !isModelOrIndexType(p.type) || isSomething(getNode(app.hierarchy, p.nodeKey)) ), ] diff --git a/packages/core/src/indexApi/buildIndex.js b/packages/core/src/indexApi/buildIndex.js index 35b86e0203..76a5ba1826 100644 --- a/packages/core/src/indexApi/buildIndex.js +++ b/packages/core/src/indexApi/buildIndex.js @@ -5,7 +5,7 @@ import { getRecordNodeById, getNode, isIndex, - isRecord, + isModel, getActualKeyOfParent, getAllowedRecordNodesForIndex, fieldReversesReferenceToIndex, @@ -62,7 +62,7 @@ const buildReverseReferenceIndex = async (app, indexNode) => { getFlattenedHierarchy, filter( n => - isRecord(n) && some(fieldReversesReferenceToIndex(indexNode))(n.fields) + isModel(n) && some(fieldReversesReferenceToIndex(indexNode))(n.fields) ), ]) diff --git a/packages/core/src/indexing/relevant.js b/packages/core/src/indexing/relevant.js index 2126b527a8..850869920f 100644 --- a/packages/core/src/indexing/relevant.js +++ b/packages/core/src/indexing/relevant.js @@ -23,7 +23,7 @@ import { getRecordNodeId, getExactNodeForKey, recordNodeIdIsAllowed, - isRecord, + isModel, isGlobalIndex, } from "../templateApi/hierarchy" import { indexTypes } from "../templateApi/indexes" @@ -57,7 +57,7 @@ export const getRelevantAncestorIndexes = (hierarchy, record) => { return acc } - if (!isRecord(nodeMatch) || nodeMatch.indexes.length === 0) { + if (!isModel(nodeMatch) || nodeMatch.indexes.length === 0) { return acc } diff --git a/packages/core/src/recordApi/initialiseChildren.js b/packages/core/src/recordApi/initialiseChildren.js index 732888dadb..f65ad6a33f 100644 --- a/packages/core/src/recordApi/initialiseChildren.js +++ b/packages/core/src/recordApi/initialiseChildren.js @@ -4,7 +4,7 @@ import { _loadFromInfo } from "./load" import { $, joinKey } from "../common" import { getFlattenedHierarchy, - isRecord, + isModel, getNode, isTopLevelRecord, fieldReversesReferenceToNode, @@ -53,7 +53,7 @@ const initialiseAncestorIndexes = async (app, recordInfo) => { const initialiseReverseReferenceIndexes = async (app, recordInfo) => { const indexNodes = $( - fieldsThatReferenceThisRecord(app, recordInfo.recordNode), + fieldsThatReferenceThisModel(app, recordInfo.recordNode), [ map(f => $(f.typeOptions.reverseIndexNodeKeys, [ @@ -69,10 +69,10 @@ const initialiseReverseReferenceIndexes = async (app, recordInfo) => { } } -const fieldsThatReferenceThisRecord = (app, recordNode) => +const fieldsThatReferenceThisModel = (app, recordNode) => $(app.hierarchy, [ getFlattenedHierarchy, - filter(isRecord), + filter(isModel), map(n => n.fields), flatten, filter(fieldReversesReferenceToNode(recordNode)), diff --git a/packages/core/src/recordApi/save.js b/packages/core/src/recordApi/save.js index d69e0e205d..476790f782 100644 --- a/packages/core/src/recordApi/save.js +++ b/packages/core/src/recordApi/save.js @@ -4,7 +4,7 @@ import { _loadFromInfo } from "./load" import { apiWrapper, events, $, joinKey } from "../common" import { getFlattenedHierarchy, - isRecord, + isModel, getNode, fieldReversesReferenceToNode, } from "../templateApi/hierarchy" diff --git a/packages/core/src/templateApi/canDeleteIndex.js b/packages/core/src/templateApi/canDeleteIndex.js index d6c8d2ad39..7857b470c4 100644 --- a/packages/core/src/templateApi/canDeleteIndex.js +++ b/packages/core/src/templateApi/canDeleteIndex.js @@ -2,7 +2,7 @@ import { findRoot, getFlattenedHierarchy, fieldReversesReferenceToIndex, - isRecord, + isModel, } from "./hierarchy" import { $ } from "../common" import { map, filter, reduce } from "lodash/fp" @@ -11,7 +11,7 @@ export const canDeleteIndex = indexNode => { const flatHierarchy = $(indexNode, [findRoot, getFlattenedHierarchy]) const reverseIndexes = $(flatHierarchy, [ - filter(isRecord), + filter(isModel), reduce((obj, r) => { for (let field of r.fields) { if (fieldReversesReferenceToIndex(indexNode)(field)) { @@ -27,7 +27,7 @@ export const canDeleteIndex = indexNode => { ]) const lookupIndexes = $(flatHierarchy, [ - filter(isRecord), + filter(isModel), reduce((obj, r) => { for (let field of r.fields) { if ( diff --git a/packages/core/src/templateApi/canDeleteModel.js b/packages/core/src/templateApi/canDeleteModel.js index 95d9dec1da..811a6501e9 100644 --- a/packages/core/src/templateApi/canDeleteModel.js +++ b/packages/core/src/templateApi/canDeleteModel.js @@ -2,7 +2,7 @@ import { findRoot, getFlattenedHierarchy, fieldReversesReferenceToIndex, - isRecord, + isModel, isAncestorIndex, isAncestor, } from "./hierarchy" diff --git a/packages/core/src/templateApi/createNodes.js b/packages/core/src/templateApi/createNodes.js index 560d7385f4..a232fb68f2 100644 --- a/packages/core/src/templateApi/createNodes.js +++ b/packages/core/src/templateApi/createNodes.js @@ -13,7 +13,7 @@ import { isRoot, isSingleRecord, isCollectionRecord, - isRecord, + isModel, isaggregateGroup, getFlattenedHierarchy, } from "./hierarchy" @@ -34,7 +34,7 @@ const pathRegxMaker = node => () => const nodeKeyMaker = node => () => switchCase( [ - n => isRecord(n) && !isSingleRecord(n), + n => isModel(n) && !isSingleRecord(n), n => joinKey( node.parent().nodeKey(), @@ -58,7 +58,7 @@ const validate = parent => node => { isIndex(node) && isSomething(parent) && !isRoot(parent) && - !isRecord(parent) + !isModel(parent) ) { throw new BadRequestError(createNodeErrors.indexParentMustBeRecordOrRoot) } @@ -103,7 +103,7 @@ const addToParent = obj => { parent.children.push(obj) } - if (isRecord(obj)) { + if (isModel(obj)) { const defaultIndex = find( parent.indexes, i => i.name === `${parent.name}_index` @@ -175,7 +175,7 @@ const _getNewModelTemplate = (parent, name, createDefaultIndex, isSingle) => { validationRules: [], nodeId: nodeId, indexes: [], - estimatedRecordCount: isRecord(parent) ? 500 : 1000000, + estimatedRecordCount: isModel(parent) ? 500 : 1000000, collectionName: (nodeId || "").toString(), isSingle, }) diff --git a/packages/core/src/templateApi/diffHierarchy.js b/packages/core/src/templateApi/diffHierarchy.js index 611fedea54..074e2e20a7 100644 --- a/packages/core/src/templateApi/diffHierarchy.js +++ b/packages/core/src/templateApi/diffHierarchy.js @@ -1,6 +1,6 @@ import { getFlattenedHierarchy, - isRecord, + isModel, isIndex, isAncestor, } from "./hierarchy" @@ -48,7 +48,7 @@ const changeItem = (type, oldNode, newNode) => ({ const findCreatedRecords = (oldHierarchyFlat, newHierarchyFlat) => { const allCreated = $(newHierarchyFlat, [ - filter(isRecord), + filter(isModel), filter(nodeDoesNotExistIn(oldHierarchyFlat)), map(n => changeItem(HierarchyChangeTypes.recordCreated, null, n)), ]) @@ -60,7 +60,7 @@ const findCreatedRecords = (oldHierarchyFlat, newHierarchyFlat) => { const findDeletedRecords = (oldHierarchyFlat, newHierarchyFlat) => { const allDeleted = $(oldHierarchyFlat, [ - filter(isRecord), + filter(isModel), filter(nodeDoesNotExistIn(newHierarchyFlat)), map(n => changeItem(HierarchyChangeTypes.recordDeleted, n, null)), ]) @@ -72,7 +72,7 @@ const findDeletedRecords = (oldHierarchyFlat, newHierarchyFlat) => { const findRenamedRecords = (oldHierarchyFlat, newHierarchyFlat) => $(oldHierarchyFlat, [ - filter(isRecord), + filter(isModel), filter(nodeExistsIn(newHierarchyFlat)), filter( nodeChanged( @@ -91,7 +91,7 @@ const findRenamedRecords = (oldHierarchyFlat, newHierarchyFlat) => const findRecordsWithFieldsChanged = (oldHierarchyFlat, newHierarchyFlat) => $(oldHierarchyFlat, [ - filter(isRecord), + filter(isModel), filter(nodeExistsIn(newHierarchyFlat)), filter(hasDifferentFields(newHierarchyFlat)), map(n => @@ -108,7 +108,7 @@ const findRecordsWithEstimatedRecordTypeChanged = ( newHierarchyFlat ) => $(oldHierarchyFlat, [ - filter(isRecord), + filter(isModel), filter(nodeExistsIn(newHierarchyFlat)), filter( nodeChanged( diff --git a/packages/core/src/templateApi/hierarchy.js b/packages/core/src/templateApi/hierarchy.js index aef48535b4..9d7bc3fc6b 100644 --- a/packages/core/src/templateApi/hierarchy.js +++ b/packages/core/src/templateApi/hierarchy.js @@ -160,7 +160,7 @@ export const getRecordNodeIdFromId = recordId => export const getRecordNodeById = (hierarchy, recordId) => $(hierarchy, [ getFlattenedHierarchy, - find(n => isRecord(n) && n.nodeId === getRecordNodeIdFromId(recordId)), + find(n => isModel(n) && n.nodeId === getRecordNodeIdFromId(recordId)), ]) export const recordNodeIdIsAllowed = indexNode => nodeId => @@ -171,7 +171,7 @@ export const recordNodeIsAllowed = indexNode => recordNode => recordNodeIdIsAllowed(indexNode)(recordNode.nodeId) export const getAllowedRecordNodesForIndex = (appHierarchy, indexNode) => { - const recordNodes = $(appHierarchy, [getFlattenedHierarchy, filter(isRecord)]) + const recordNodes = $(appHierarchy, [getFlattenedHierarchy, filter(isModel)]) if (isGlobalIndex(indexNode)) { return $(recordNodes, [filter(recordNodeIsAllowed(indexNode))]) @@ -213,9 +213,9 @@ export const getNodeFromNodeKeyHash = hierarchy => hash => find(n => getHashCode(n.nodeKey()) === hash), ]) -export const isRecord = node => isSomething(node) && node.type === "record" -export const isSingleRecord = node => isRecord(node) && node.isSingle -export const isCollectionRecord = node => isRecord(node) && !node.isSingle +export const isModel = node => isSomething(node) && node.type === "record" +export const isSingleRecord = node => isModel(node) && node.isSingle +export const isCollectionRecord = node => isModel(node) && !node.isSingle export const isIndex = node => isSomething(node) && node.type === "index" export const isaggregateGroup = node => isSomething(node) && node.type === "aggregateGroup" @@ -223,13 +223,13 @@ export const isShardedIndex = node => isIndex(node) && isNonEmptyString(node.getShardName) export const isRoot = node => isSomething(node) && node.isRoot() export const findRoot = node => (isRoot(node) ? node : findRoot(node.parent())) -export const isDecendantOfARecord = hasMatchingAncestor(isRecord) +export const isDecendantOfARecord = hasMatchingAncestor(isModel) export const isGlobalIndex = node => isIndex(node) && isRoot(node.parent()) export const isReferenceIndex = node => isIndex(node) && node.indexType === indexTypes.reference export const isAncestorIndex = node => isIndex(node) && node.indexType === indexTypes.ancestor -export const isTopLevelRecord = node => isRoot(node.parent()) && isRecord(node) +export const isTopLevelRecord = node => isRoot(node.parent()) && isModel(node) export const isTopLevelIndex = node => isRoot(node.parent()) && isIndex(node) export const getCollectionKey = recordKey => $(recordKey, [splitKey, parts => joinKey(parts.slice(0, parts.length - 1))]) @@ -271,7 +271,7 @@ export default { recordNodeIsAllowed, getAllowedRecordNodesForIndex, getNodeFromNodeKeyHash, - isRecord, + isModel, isCollectionRecord, isIndex, isaggregateGroup, diff --git a/packages/core/src/templateApi/indexes.js b/packages/core/src/templateApi/indexes.js index 6c829315b2..a59e638990 100644 --- a/packages/core/src/templateApi/indexes.js +++ b/packages/core/src/templateApi/indexes.js @@ -1,9 +1,9 @@ import { map, isEmpty, countBy, flatten, includes, join, keys } from "lodash/fp" -import {} from "lodash" +import { } from "lodash" import { applyRuleSet, makerule } from "../common/validationCommon" import { compileFilter, compileMap } from "../indexing/evaluate" import { isNonEmptyString, executesWithoutException, $ } from "../common" -import { isRecord } from "./hierarchy" +import { isModel } from "./hierarchy" export const indexTypes = { reference: "reference", ancestor: "ancestor" } @@ -39,7 +39,7 @@ export const indexRuleSet = [ "indexType", "reference index may only exist on a record node", index => - isRecord(index.parent()) || index.indexType !== indexTypes.reference + isModel(index.parent()) || index.indexType !== indexTypes.reference ), makerule( "indexType", diff --git a/packages/core/src/templateApi/validate.js b/packages/core/src/templateApi/validate.js index 14e4edbba9..071b42c191 100644 --- a/packages/core/src/templateApi/validate.js +++ b/packages/core/src/templateApi/validate.js @@ -23,7 +23,7 @@ import { defaultCase, } from "../common" import { - isRecord, + isModel, isRoot, isaggregateGroup, isIndex, @@ -47,7 +47,7 @@ const commonRules = [ makerule( "type", "node type not recognised", - anyTrue(isRecord, isRoot, isIndex, isaggregateGroup) + anyTrue(isModel, isRoot, isIndex, isaggregateGroup) ), ] @@ -79,7 +79,7 @@ const aggregateGroupRules = [ const getRuleSet = node => switchCase( - [isRecord, ruleSet(commonRules, recordRules)], + [isModel, ruleSet(commonRules, recordRules)], [isIndex, ruleSet(commonRules, indexRuleSet)], @@ -108,7 +108,7 @@ export const validateAll = appHierarchy => { ]) const fieldErrors = $(flattened, [ - filter(isRecord), + filter(isModel), map(validateAllFields), flatten, ]) @@ -140,7 +140,7 @@ const actionRules = [ ), ] -const duplicateActionRule = makerule("", "action name must be unique", () => {}) +const duplicateActionRule = makerule("", "action name must be unique", () => { }) const validateAction = action => applyRuleSet(actionRules)(action) diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index de31b9e9fc..35d62d0aa6 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -131,33 +131,6 @@ lodash "^4.17.13" to-fast-properties "^2.0.0" -"@budibase/client@^0.0.32": - version "0.0.32" - resolved "https://registry.yarnpkg.com/@budibase/client/-/client-0.0.32.tgz#76d9f147563a0bf939eae7f32ce75b2a527ba496" - integrity sha512-jmCCLn0CUoQbL6h623S5IqK6+GYLqX3WzUTZInSb1SCBOM3pI0eLP5HwTR6s7r42SfD0v9jTWRdyTnHiElNj8A== - dependencies: - "@nx-js/compiler-util" "^2.0.0" - bcryptjs "^2.4.3" - deep-equal "^2.0.1" - lodash "^4.17.15" - lunr "^2.3.5" - regexparam "^1.3.0" - shortid "^2.2.8" - svelte "^3.9.2" - -"@budibase/core@^0.0.32": - version "0.0.32" - resolved "https://registry.yarnpkg.com/@budibase/core/-/core-0.0.32.tgz#c5d9ab869c5e9596a1ac337aaf041e795b1cc7fa" - integrity sha512-B6DHlz/C/m3jrxHbImT4bphdJlL7r2qmGrmcVBSc9mGHvwcRh1xfFGrsPCOU2IEJow+DWD63BIjyHzLPI3cerQ== - dependencies: - "@nx-js/compiler-util" "^2.0.0" - bcryptjs "^2.4.3" - date-fns "^1.29.0" - lodash "^4.17.13" - lunr "^2.3.5" - safe-buffer "^5.1.2" - shortid "^2.2.8" - "@cnakazawa/watch@^1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@cnakazawa/watch/-/watch-1.0.3.tgz#099139eaec7ebf07a27c1786a3ff64f39464d2ef" @@ -326,11 +299,6 @@ path-to-regexp "^1.1.1" urijs "^1.19.0" -"@nx-js/compiler-util@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@nx-js/compiler-util/-/compiler-util-2.0.0.tgz#c74c12165fa2f017a292bb79af007e8fce0af297" - integrity sha512-AxSQbwj9zqt8DYPZ6LwZdytqnwfiOEdcFdq4l8sdjkZmU2clTht7RDLCI8xvkp7KqgcNaOGlTeCM55TULWruyQ== - "@types/babel__core@^7.1.0": version "7.1.2" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.2.tgz#608c74f55928033fce18b99b213c16be4b3d114f" @@ -678,11 +646,6 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -bcryptjs@^2.4.3: - version "2.4.3" - resolved "https://registry.yarnpkg.com/bcryptjs/-/bcryptjs-2.4.3.tgz#9ab5627b93e60621ff7cdac5da9733027df1d0cb" - integrity sha1-mrVie5PmBiH/fNrF2pczAn3x0Ms= - binary-extensions@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.0.0.tgz#23c0df14f6a88077f5f986c0d167ec03c3d5537c" @@ -1082,11 +1045,6 @@ data-urls@^1.0.0: whatwg-mimetype "^2.2.0" whatwg-url "^7.0.0" -date-fns@^1.29.0: - version "1.30.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" - integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== - debug@^2.2.0, debug@^2.3.3: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -1125,24 +1083,6 @@ decode-uri-component@^0.2.0: resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= -deep-equal@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.0.1.tgz#fc12bbd6850e93212f21344748682ccc5a8813cf" - integrity sha512-7Et6r6XfNW61CPPCIYfm1YPGSmh6+CliYeL4km7GWJcpX5LTAflGF8drLLR+MZX+2P3NZfAfSduutBbSWqER4g== - dependencies: - es-abstract "^1.16.3" - es-get-iterator "^1.0.1" - is-arguments "^1.0.4" - is-date-object "^1.0.1" - is-regex "^1.0.4" - isarray "^2.0.5" - object-is "^1.0.1" - object-keys "^1.1.1" - regexp.prototype.flags "^1.2.0" - side-channel "^1.0.1" - which-boxed-primitive "^1.0.1" - which-collection "^1.0.0" - deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -1158,7 +1098,7 @@ deep-is@~0.1.3: resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= -define-properties@^1.1.2, define-properties@^1.1.3: +define-properties@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1" integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ== @@ -1278,23 +1218,6 @@ error-inject@^1.0.0: resolved "https://registry.yarnpkg.com/error-inject/-/error-inject-1.0.0.tgz#e2b3d91b54aed672f309d950d154850fa11d4f37" integrity sha1-4rPZG1Su1nLzCdlQ0VSFD6EdTzc= -es-abstract@^1.16.3, es-abstract@^1.17.0-next.1, es-abstract@^1.17.4: - version "1.17.4" - resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.17.4.tgz#e3aedf19706b20e7c2594c35fc0d57605a79e184" - integrity sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ== - dependencies: - es-to-primitive "^1.2.1" - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - is-callable "^1.1.5" - is-regex "^1.0.5" - object-inspect "^1.7.0" - object-keys "^1.1.1" - object.assign "^4.1.0" - string.prototype.trimleft "^2.1.1" - string.prototype.trimright "^2.1.1" - es-abstract@^1.5.1: version "1.13.0" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9" @@ -1307,19 +1230,6 @@ es-abstract@^1.5.1: is-regex "^1.0.4" object-keys "^1.0.12" -es-get-iterator@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.0.tgz#bb98ad9d6d63b31aacdc8f89d5d0ee57bcb5b4c8" - integrity sha512-UfrmHuWQlNMTs35e1ypnvikg6jCz3SK8v8ImvmDsh36fCVUR1MqoFDiyn0/k52C8NqO3YsO8Oe0azeesNuqSsQ== - dependencies: - es-abstract "^1.17.4" - has-symbols "^1.0.1" - is-arguments "^1.0.4" - is-map "^2.0.1" - is-set "^2.0.1" - is-string "^1.0.5" - isarray "^2.0.5" - es-to-primitive@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377" @@ -1329,15 +1239,6 @@ es-to-primitive@^1.2.0: is-date-object "^1.0.1" is-symbol "^1.0.2" -es-to-primitive@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" - integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== - dependencies: - is-callable "^1.1.4" - is-date-object "^1.0.1" - is-symbol "^1.0.2" - escape-html@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -1750,11 +1651,6 @@ has-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.0.tgz#ba1a8f1af2a0fc39650f5c850367704122063b44" integrity sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q= -has-symbols@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.1.tgz#9f5214758a44196c406d9bd76cebf81ec2dd31e8" - integrity sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg== - has-unicode@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -1939,21 +1835,11 @@ is-accessor-descriptor@^1.0.0: dependencies: kind-of "^6.0.0" -is-arguments@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.0.4.tgz#3faf966c7cba0ff437fb31f6250082fcf0448cf3" - integrity sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA== - is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= -is-bigint@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.0.tgz#73da8c33208d00f130e9b5e15d23eac9215601c4" - integrity sha512-t5mGUXC/xRheCK431ylNiSkGGpBp8bHENBcENTkDT6ppwPzEVxNGZRvgvmOEfbWkFhA7D2GEuE2mmQTr78sl2g== - is-binary-path@~2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" @@ -1961,11 +1847,6 @@ is-binary-path@~2.1.0: dependencies: binary-extensions "^2.0.0" -is-boolean-object@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.0.1.tgz#10edc0900dd127697a92f6f9807c7617d68ac48e" - integrity sha512-TqZuVwa/sppcrhUCAYkGBk7w0yxfQQnxq28fjkO53tnK9FQXmdwz2JS5+GjsWQ6RByES1K40nI+yDic5c9/aAQ== - is-buffer@^1.1.5: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -1976,11 +1857,6 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-callable@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.5.tgz#f7e46b596890456db74e7f6e976cb3273d06faab" - integrity sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q== - is-ci@^1.0.10: version "1.2.1" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" @@ -2091,21 +1967,11 @@ is-installed-globally@^0.1.0: global-dirs "^0.1.0" is-path-inside "^1.0.0" -is-map@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.1.tgz#520dafc4307bb8ebc33b813de5ce7c9400d644a1" - integrity sha512-T/S49scO8plUiAOA2DBTBG3JHpn1yiw0kRp6dgiZ0v2/6twi5eiB0rHtHFH9ZIrvlWc6+4O+m4zg5+Z833aXgw== - is-npm@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-npm/-/is-npm-1.0.0.tgz#f2fb63a65e4905b406c86072765a1a4dc793b9f4" integrity sha1-8vtjpl5JBbQGyGBydloaTceTufQ= -is-number-object@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.4.tgz#36ac95e741cf18b283fc1ddf5e83da798e3ec197" - integrity sha512-zohwelOAur+5uXtk8O3GPQ1eAcu4ZX3UwxQhUlfFFMNpUd83gXgjbhJh6HmB6LUNV/ieOLQuDwJO3dWJosUeMw== - is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" @@ -2149,33 +2015,16 @@ is-regex@^1.0.4: dependencies: has "^1.0.1" -is-regex@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.5.tgz#39d589a358bf18967f726967120b8fc1aed74eae" - integrity sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ== - dependencies: - has "^1.0.3" - is-retry-allowed@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4" integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg== -is-set@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.1.tgz#d1604afdab1724986d30091575f54945da7e5f43" - integrity sha512-eJEzOtVyenDs1TMzSQ3kU3K+E0GUS9sno+F0OBT97xsgcJsF9nXMBtkT9/kut5JEpM7oL7X/0qxR17K3mcwIAA== - is-stream@^1.0.0, is-stream@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= -is-string@^1.0.4, is-string@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" - integrity sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ== - is-symbol@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38" @@ -2197,16 +2046,6 @@ is-typedarray@~1.0.0: resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= -is-weakmap@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.1.tgz#5008b59bdc43b698201d18f62b37b2ca243e8cf2" - integrity sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA== - -is-weakset@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-weakset/-/is-weakset-2.0.1.tgz#e9a0af88dbd751589f5e50d80f4c98b780884f83" - integrity sha512-pi4vhbhVHGLxohUw7PhGsueT4vRGFoXhP7+RGN0jKIv9+8PWYCQTqtADngrxOm2g46hoH0+g8uZZBzMrvVGDmw== - is-windows@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" @@ -2227,11 +2066,6 @@ isarray@1.0.0, isarray@~1.0.0: resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= -isarray@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" - integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== - isexe@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" @@ -2918,7 +2752,7 @@ lodash.sortby@^4.7.0: resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" integrity sha1-7dFMgk4sycHgsKG0K7UhBRakJDg= -lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.15: +lodash@^4.17.11, lodash@^4.17.13: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -2943,11 +2777,6 @@ lru-cache@^4.0.1: pseudomap "^1.0.2" yallist "^2.1.2" -lunr@^2.3.5: - version "2.3.8" - resolved "https://registry.yarnpkg.com/lunr/-/lunr-2.3.8.tgz#a8b89c31f30b5a044b97d2d28e2da191b6ba2072" - integrity sha512-oxMeX/Y35PNFuZoHp+jUj5OSEmLCaIH4KTFJh7a93cHBoFmpw2IoPs22VIz7vyO2YUnx2Tn9dzIwO2P/4quIRg== - make-dir@^1.0.0: version "1.3.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.3.0.tgz#79c1033b80515bd6d24ec9933e860ca75ee27f0c" @@ -3109,11 +2938,6 @@ nan@^2.12.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.0.tgz#7818f722027b2459a86f0295d434d1fc2336c52c" integrity sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg== -nanoid@^2.1.0: - version "2.1.11" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" - integrity sha512-s/snB+WGm6uwi0WjsZdaVcuf3KJXlfGl2LcxgwkEwJF0D/BWzVWAZW/XY4bFaiR7s0Jk3FPvlnepg1H1b1UwlA== - nanomatch@^1.2.9: version "1.2.13" resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" @@ -3309,17 +3133,7 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.7.0.tgz#f4f6bd181ad77f006b5ece60bd0b6f398ff74a67" - integrity sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw== - -object-is@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.0.2.tgz#6b80eb84fe451498f65007982f035a5b445edec4" - integrity sha512-Epah+btZd5wrrfjkJZq1AOB9O6OxUQto45hzFd7lXGrpHPGE0W1k+426yrZV+k6NJOzLNNW/nVsmZdIWsAqoOQ== - -object-keys@^1.0.11, object-keys@^1.0.12, object-keys@^1.1.1: +object-keys@^1.0.12: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== @@ -3331,16 +3145,6 @@ object-visit@^1.0.0: dependencies: isobject "^3.0.0" -object.assign@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.0.tgz#968bf1100d7956bb3ca086f006f846b3bc4008da" - integrity sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w== - dependencies: - define-properties "^1.1.2" - function-bind "^1.1.1" - has-symbols "^1.0.0" - object-keys "^1.0.11" - object.getownpropertydescriptors@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16" @@ -3727,19 +3531,6 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexp.prototype.flags@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.3.0.tgz#7aba89b3c13a64509dabcf3ca8d9fbb9bdf5cb75" - integrity sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ== - dependencies: - define-properties "^1.1.3" - es-abstract "^1.17.0-next.1" - -regexparam@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/regexparam/-/regexparam-1.3.0.tgz#2fe42c93e32a40eff6235d635e0ffa344b92965f" - integrity sha512-6IQpFBv6e5vz1QAqI+V4k8P2e/3gRrqfCJ9FI+O1FLQTO+Uz6RXZEZOPmTJ6hlGj7gkERzY5BRCv09whKP96/g== - registry-auth-token@^3.0.1: version "3.4.0" resolved "https://registry.yarnpkg.com/registry-auth-token/-/registry-auth-token-3.4.0.tgz#d7446815433f5d5ed6431cd5dca21048f66b397e" @@ -3982,21 +3773,6 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -shortid@^2.2.8: - version "2.2.15" - resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.15.tgz#2b902eaa93a69b11120373cd42a1f1fe4437c122" - integrity sha512-5EaCy2mx2Jgc/Fdn9uuDuNIIfWBpzY4XIlhoqtXF6qsf+/+SGZ+FxDdX/ZsMZiWupIWNqAEmiNY4RC+LSmCeOw== - dependencies: - nanoid "^2.1.0" - -side-channel@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" - integrity sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA== - dependencies: - es-abstract "^1.17.0-next.1" - object-inspect "^1.7.0" - signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" @@ -4186,22 +3962,6 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string.prototype.trimleft@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz#9bdb8ac6abd6d602b17a4ed321870d2f8dcefc74" - integrity sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - -string.prototype.trimright@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz#440314b15996c866ce8a0341894d45186200c5d9" - integrity sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g== - dependencies: - define-properties "^1.1.3" - function-bind "^1.1.1" - string_decoder@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" @@ -4290,11 +4050,6 @@ supports-color@^6.1.0: dependencies: has-flag "^3.0.0" -svelte@^3.9.2: - version "3.19.2" - resolved "https://registry.yarnpkg.com/svelte/-/svelte-3.19.2.tgz#4b0169ee33b37399f08eb92163593a0a46c242c7" - integrity sha512-Jswg065u8R9QYcN0rdpTQSFIr0hFq7YUzcPpEY6ZpFSAWkJKZG9AJvHE1d8+NJDTfr7SzKrO6EYssYYkUmszpA== - symbol-tree@^3.2.2: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -4673,27 +4428,6 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" -which-boxed-primitive@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.1.tgz#cbe8f838ebe91ba2471bb69e9edbda67ab5a5ec1" - integrity sha512-7BT4TwISdDGBgaemWU0N0OU7FeAEJ9Oo2P1PHRm/FCWoEi2VLWC9b6xvxAA3C/NMpxg3HXVgi0sMmGbNUbNepQ== - dependencies: - is-bigint "^1.0.0" - is-boolean-object "^1.0.0" - is-number-object "^1.0.3" - is-string "^1.0.4" - is-symbol "^1.0.2" - -which-collection@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.1.tgz#70eab71ebbbd2aefaf32f917082fc62cdcb70906" - integrity sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A== - dependencies: - is-map "^2.0.1" - is-set "^2.0.1" - is-weakmap "^2.0.1" - is-weakset "^2.0.1" - which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" diff --git a/packages/standard-components/public/bundle.js b/packages/standard-components/public/bundle.js index 2dc0de6c5b..e88c503dc1 100644 --- a/packages/standard-components/public/bundle.js +++ b/packages/standard-components/public/bundle.js @@ -1,707 +1,965 @@ -(function(l, i, v, e) { v = l.createElement(i); v.async = 1; v.src = '//' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; e = l.getElementsByTagName(i)[0]; e.parentNode.insertBefore(v, e)})(document, 'script'); +(function (l, i, v, e) { v = l.createElement(i); v.async = 1; v.src = '//' + (location.host || 'localhost').split(':')[0] + ':35729/livereload.js?snipver=1'; e = l.getElementsByTagName(i)[0]; e.parentNode.insertBefore(v, e) })(document, 'script'); var app = (function (crypto$1) { - 'use strict'; + 'use strict'; - crypto$1 = crypto$1 && crypto$1.hasOwnProperty('default') ? crypto$1['default'] : crypto$1; + crypto$1 = crypto$1 && crypto$1.hasOwnProperty('default') ? crypto$1['default'] : crypto$1; - function noop() { } - 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 add_location(element, file, line, column, char) { - element.__svelte_meta = { - loc: { file, line, column, char } - }; - } - 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 null_to_empty(value) { - return value == null ? '' : value; - } + function noop() { } + 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 add_location(element, file, line, column, char) { + element.__svelte_meta = { + loc: { file, line, column, char } + }; + } + 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 null_to_empty(value) { + return value == null ? '' : value; + } - function append(target, node) { - target.appendChild(node); + 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 destroy_each(iterations, detaching) { + for (let i = 0; i < iterations.length; i += 1) { + if (iterations[i]) + iterations[i].d(detaching); } - function insert(target, node, anchor) { - target.insertBefore(node, anchor || null); - } - function detach(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(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 empty() { + 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 + node.setAttribute(attribute, value); + } + function children(element) { + return Array.from(element.childNodes); + } + function claim_element(nodes, name, attributes, svg) { + for (let i = 0; i < nodes.length; i += 1) { + const node = nodes[i]; + if (node.nodeName === name) { + for (let j = 0; j < node.attributes.length; j += 1) { + const attribute = node.attributes[j]; + if (!attributes[attribute.name]) + node.removeAttribute(attribute.name); } + return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes + } } - function element(name) { - return document.createElement(name); + return svg ? svg_element(name) : element(name); + } + function claim_text(nodes, data) { + for (let i = 0; i < nodes.length; i += 1) { + const node = nodes[i]; + if (node.nodeType === 3) { + node.data = '' + data; + return nodes.splice(i, 1)[0]; + } } - 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 empty() { - 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 - node.setAttribute(attribute, value); - } - function children(element) { - return Array.from(element.childNodes); - } - function claim_element(nodes, name, attributes, svg) { - for (let i = 0; i < nodes.length; i += 1) { - const node = nodes[i]; - if (node.nodeName === name) { - for (let j = 0; j < node.attributes.length; j += 1) { - const attribute = node.attributes[j]; - if (!attributes[attribute.name]) - node.removeAttribute(attribute.name); - } - return nodes.splice(i, 1)[0]; // TODO strip unwanted attributes - } - } - return svg ? svg_element(name) : element(name); - } - function claim_text(nodes, data) { - for (let i = 0; i < nodes.length; i += 1) { - const node = nodes[i]; - if (node.nodeType === 3) { - node.data = '' + data; - return nodes.splice(i, 1)[0]; - } - } - return text(data); - } - function claim_space(nodes) { - return claim_text(nodes, ' '); - } - function set_input_value(input, value) { - if (value != null || input.value) { - input.value = value; - } - } - function toggle_class(element, name, toggle) { - element.classList[toggle ? 'add' : 'remove'](name); - } - function custom_event(type, detail) { - const e = document.createEvent('CustomEvent'); - e.initCustomEvent(type, false, false, detail); - return e; + return text(data); + } + function claim_space(nodes) { + return claim_text(nodes, ' '); + } + function set_input_value(input, value) { + if (value != null || input.value) { + input.value = value; } + } + function toggle_class(element, name, toggle) { + element.classList[toggle ? 'add' : 'remove'](name); + } + function custom_event(type, detail) { + const e = document.createEvent('CustomEvent'); + e.initCustomEvent(type, false, false, detail); + return e; + } - 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; - } + 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; + } - 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); + 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 flush() { + const seen_callbacks = new Set(); + do { + // first, call beforeUpdate functions + // and update components + while (dirty_components.length) { + const component = dirty_components.shift(); + set_current_component(component); + update(component.$$); + } + 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)) { + callback(); + // ...so guard against infinite loops + seen_callbacks.add(callback); } + } + render_callbacks.length = 0; + } while (dirty_components.length); + while (flush_callbacks.length) { + flush_callbacks.pop()(); } - function add_render_callback(fn) { - render_callbacks.push(fn); + update_scheduled = false; + } + function update($$) { + if ($$.fragment) { + $$.update($$.dirty); + run_all($$.before_update); + $$.fragment.p($$.dirty, $$.ctx); + $$.dirty = null; + $$.after_update.forEach(add_render_callback); } - function flush() { - const seen_callbacks = new Set(); - do { - // first, call beforeUpdate functions - // and update components - while (dirty_components.length) { - const component = dirty_components.shift(); - set_current_component(component); - update(component.$$); - } - 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)) { - callback(); - // ...so guard against infinite loops - seen_callbacks.add(callback); - } - } - render_callbacks.length = 0; - } while (dirty_components.length); - while (flush_callbacks.length) { - flush_callbacks.pop()(); - } - update_scheduled = false; - } - function update($$) { - if ($$.fragment) { - $$.update($$.dirty); - run_all($$.before_update); - $$.fragment.p($$.dirty, $$.ctx); - $$.dirty = null; - $$.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); + } + 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 handle_promise(promise, info) { - const token = info.token = {}; - function update(type, index, key, value) { - if (info.token !== token) - return; - info.resolved = key && { [key]: value }; - const child_ctx = assign(assign({}, info.ctx), info.resolved); - const block = type && (info.current = type)(child_ctx); - if (info.block) { - if (info.blocks) { - info.blocks.forEach((block, i) => { - if (i !== index && block) { - group_outros(); - transition_out(block, 1, 1, () => { - info.blocks[i] = null; - }); - check_outros(); - } - }); - } - else { - info.block.d(1); - } - block.c(); - transition_in(block, 1); - block.m(info.mount(), info.anchor); - flush(); - } - info.block = block; - if (info.blocks) - info.blocks[index] = block; - } - if (is_promise(promise)) { - const current_component = get_current_component(); - promise.then(value => { - set_current_component(current_component); - update(info.then, 1, info.value, value); - set_current_component(null); - }, error => { - set_current_component(current_component); - update(info.catch, 2, info.error, error); - set_current_component(null); - }); - // if we previously had a then/catch block, destroy it - if (info.current !== info.pending) { - update(info.pending, 0); - return true; + function handle_promise(promise, info) { + const token = info.token = {}; + function update(type, index, key, value) { + if (info.token !== token) + return; + info.resolved = key && { [key]: value }; + const child_ctx = assign(assign({}, info.ctx), info.resolved); + const block = type && (info.current = type)(child_ctx); + if (info.block) { + if (info.blocks) { + info.blocks.forEach((block, i) => { + if (i !== index && block) { + group_outros(); + transition_out(block, 1, 1, () => { + info.blocks[i] = null; + }); + check_outros(); } + }); } else { - if (info.current !== info.then) { - update(info.then, 1, info.value, promise); - return true; - } - info.resolved = { [info.value]: promise }; + info.block.d(1); } + block.c(); + transition_in(block, 1); + block.m(info.mount(), info.anchor); + flush(); + } + info.block = block; + if (info.blocks) + info.blocks[index] = block; } + if (is_promise(promise)) { + const current_component = get_current_component(); + promise.then(value => { + set_current_component(current_component); + update(info.then, 1, info.value, value); + set_current_component(null); + }, error => { + set_current_component(current_component); + update(info.catch, 2, info.error, error); + set_current_component(null); + }); + // 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 = { [info.value]: promise }; + } + } - const globals = (typeof window !== 'undefined' ? window : global); - function mount_component(component, target, anchor) { - const { fragment, on_mount, on_destroy, after_update } = component.$$; - 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); + const globals = (typeof window !== 'undefined' ? window : global); + function mount_component(component, target, anchor) { + const { fragment, on_mount, on_destroy, after_update } = component.$$; + 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) { + if (component.$$.fragment) { + run_all(component.$$.on_destroy); + component.$$.fragment.d(detaching); + // TODO null out other refs, including component.$$ (but need to + // preserve final state?) + component.$$.on_destroy = component.$$.fragment = null; + component.$$.ctx = {}; } - function destroy_component(component, detaching) { - if (component.$$.fragment) { - run_all(component.$$.on_destroy); - component.$$.fragment.d(detaching); - // TODO null out other refs, including component.$$ (but need to - // preserve final state?) - component.$$.on_destroy = component.$$.fragment = null; - component.$$.ctx = {}; + } + function make_dirty(component, key) { + if (!component.$$.dirty) { + dirty_components.push(component); + schedule_update(); + component.$$.dirty = blank_object(); + } + component.$$.dirty[key] = true; + } + function init(component, options, instance, create_fragment, not_equal, prop_names) { + const parent_component = current_component; + set_current_component(component); + const props = options.props || {}; + const $$ = component.$$ = { + fragment: null, + ctx: null, + // state + props: prop_names, + update: noop, + 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: null + }; + let ready = false; + $$.ctx = instance + ? instance(component, props, (key, ret, value = ret) => { + if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) { + if ($$.bound[key]) + $$.bound[key](value); + if (ready) + make_dirty(component, key); } + return ret; + }) + : props; + $$.update(); + ready = true; + run_all($$.before_update); + $$.fragment = create_fragment($$.ctx); + if (options.target) { + if (options.hydrate) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment.l(children(options.target)); + } + else { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + $$.fragment.c(); + } + if (options.intro) + transition_in(component.$$.fragment); + mount_component(component, options.target, options.anchor); + flush(); } - function make_dirty(component, key) { - if (!component.$$.dirty) { - dirty_components.push(component); - schedule_update(); - component.$$.dirty = blank_object(); + set_current_component(parent_component); + } + let SvelteElement; + if (typeof HTMLElement !== 'undefined') { + SvelteElement = class extends HTMLElement { + constructor() { + super(); + this.attachShadow({ mode: 'open' }); + } + connectedCallback() { + // @ts-ignore todo: improve typings + for (const key in this.$$.slotted) { + // @ts-ignore todo: improve typings + this.appendChild(this.$$.slotted[key]); } - component.$$.dirty[key] = true; - } - function init(component, options, instance, create_fragment, not_equal, prop_names) { - const parent_component = current_component; - set_current_component(component); - const props = options.props || {}; - const $$ = component.$$ = { - fragment: null, - ctx: null, - // state - props: prop_names, - update: noop, - 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: null - }; - let ready = false; - $$.ctx = instance - ? instance(component, props, (key, ret, value = ret) => { - if ($$.ctx && not_equal($$.ctx[key], $$.ctx[key] = value)) { - if ($$.bound[key]) - $$.bound[key](value); - if (ready) - make_dirty(component, key); - } - return ret; - }) - : props; - $$.update(); - ready = true; - run_all($$.before_update); - $$.fragment = create_fragment($$.ctx); - if (options.target) { - if (options.hydrate) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment.l(children(options.target)); - } - else { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - $$.fragment.c(); - } - if (options.intro) - transition_in(component.$$.fragment); - mount_component(component, options.target, options.anchor); - flush(); - } - set_current_component(parent_component); - } - let SvelteElement; - if (typeof HTMLElement !== 'undefined') { - SvelteElement = class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: 'open' }); - } - connectedCallback() { - // @ts-ignore todo: improve typings - for (const key in this.$$.slotted) { - // @ts-ignore todo: improve typings - this.appendChild(this.$$.slotted[key]); - } - } - attributeChangedCallback(attr, _oldValue, newValue) { - this[attr] = newValue; - } - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $on(type, callback) { - // TODO should this delegate to addEventListener? - 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() { - // overridden by instance, if it has props - } - }; - } - class SvelteComponent { - $destroy() { - destroy_component(this, 1); - this.$destroy = noop; - } - $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() { - // overridden by instance, if it has props - } - } - - function dispatch_dev(type, detail) { - document.dispatchEvent(custom_event(type, detail)); - } - function append_dev(target, node) { - dispatch_dev("SvelteDOMInsert", { target, node }); - append(target, node); - } - function insert_dev(target, node, anchor) { - dispatch_dev("SvelteDOMInsert", { target, node, anchor }); - insert(target, node, anchor); - } - function detach_dev(node) { - dispatch_dev("SvelteDOMRemove", { node }); - detach(node); - } - function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) { - const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : []; - if (has_prevent_default) - modifiers.push('preventDefault'); - if (has_stop_propagation) - modifiers.push('stopPropagation'); - dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers }); - const dispose = listen(node, event, handler, options); + } + attributeChangedCallback(attr, _oldValue, newValue) { + this[attr] = newValue; + } + $destroy() { + destroy_component(this, 1); + this.$destroy = noop; + } + $on(type, callback) { + // TODO should this delegate to addEventListener? + const callbacks = (this.$$.callbacks[type] || (this.$$.callbacks[type] = [])); + callbacks.push(callback); return () => { - dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers }); - dispose(); + const index = callbacks.indexOf(callback); + if (index !== -1) + callbacks.splice(index, 1); }; + } + $set() { + // overridden by instance, if it has props + } + }; + } + class SvelteComponent { + $destroy() { + destroy_component(this, 1); + this.$destroy = noop; } - function attr_dev(node, attribute, value) { - attr(node, attribute, value); - if (value == null) - dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute }); - else - dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value }); - } - function prop_dev(node, property, value) { - node[property] = value; - dispatch_dev("SvelteDOMSetProperty", { node, property, value }); - } - function set_data_dev(text, data) { - data = '' + data; - if (text.data === data) - return; - dispatch_dev("SvelteDOMSetData", { node: text, data }); - text.data = data; - } - class SvelteComponentDev extends SvelteComponent { - constructor(options) { - if (!options || (!options.target && !options.$$inline)) { - throw new Error(`'target' is a required option`); - } - super(); - } - $destroy() { - super.$destroy(); - this.$destroy = () => { - console.warn(`Component was already destroyed`); // eslint-disable-line no-console - }; - } - } - - const subscriber_queue = []; - /** - * Create a `Writable` store that allows both updating and reading by subscription. - * @param {*=}value initial value - * @param {StartStopNotifier=}start start and stop notifications for subscriptions - */ - function writable(value, start = noop) { - let stop; - const subscribers = []; - function set(new_value) { - if (safe_not_equal(value, new_value)) { - value = new_value; - if (stop) { // store is ready - const run_queue = !subscriber_queue.length; - for (let i = 0; i < subscribers.length; i += 1) { - const s = subscribers[i]; - s[1](); - subscriber_queue.push(s, value); - } - if (run_queue) { - for (let i = 0; i < subscriber_queue.length; i += 2) { - subscriber_queue[i][0](subscriber_queue[i + 1]); - } - subscriber_queue.length = 0; - } - } - } - } - function update(fn) { - set(fn(value)); - } - function subscribe(run, invalidate = noop) { - const subscriber = [run, invalidate]; - subscribers.push(subscriber); - if (subscribers.length === 1) { - stop = start(set) || noop; - } - run(value); - return () => { - const index = subscribers.indexOf(subscriber); - if (index !== -1) { - subscribers.splice(index, 1); - } - if (subscribers.length === 0) { - stop(); - stop = null; - } - }; - } - return { set, update, subscribe }; - } - - const createCoreApp = (backendDefinition, user) => { - const app = { - datastore: null, - crypto: null, - publish: () => {}, - hierarchy: backendDefinition.hierarchy, - actions: backendDefinition.actions, - user, + $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() { + // overridden by instance, if it has props + } + } - return app + function dispatch_dev(type, detail) { + document.dispatchEvent(custom_event(type, detail)); + } + function append_dev(target, node) { + dispatch_dev("SvelteDOMInsert", { target, node }); + append(target, node); + } + function insert_dev(target, node, anchor) { + dispatch_dev("SvelteDOMInsert", { target, node, anchor }); + insert(target, node, anchor); + } + function detach_dev(node) { + dispatch_dev("SvelteDOMRemove", { node }); + detach(node); + } + function listen_dev(node, event, handler, options, has_prevent_default, has_stop_propagation) { + const modifiers = options === true ? ["capture"] : options ? Array.from(Object.keys(options)) : []; + if (has_prevent_default) + modifiers.push('preventDefault'); + if (has_stop_propagation) + modifiers.push('stopPropagation'); + dispatch_dev("SvelteDOMAddEventListener", { node, event, handler, modifiers }); + const dispose = listen(node, event, handler, options); + return () => { + dispatch_dev("SvelteDOMRemoveEventListener", { node, event, handler, modifiers }); + dispose(); + }; + } + function attr_dev(node, attribute, value) { + attr(node, attribute, value); + if (value == null) + dispatch_dev("SvelteDOMRemoveAttribute", { node, attribute }); + else + dispatch_dev("SvelteDOMSetAttribute", { node, attribute, value }); + } + function prop_dev(node, property, value) { + node[property] = value; + dispatch_dev("SvelteDOMSetProperty", { node, property, value }); + } + function set_data_dev(text, data) { + data = '' + data; + if (text.data === data) + return; + dispatch_dev("SvelteDOMSetData", { node: text, data }); + text.data = data; + } + class SvelteComponentDev extends SvelteComponent { + constructor(options) { + if (!options || (!options.target && !options.$$inline)) { + throw new Error(`'target' is a required option`); + } + super(); + } + $destroy() { + super.$destroy(); + this.$destroy = () => { + console.warn(`Component was already destroyed`); // eslint-disable-line no-console + }; + } + } + + const subscriber_queue = []; + /** + * Create a `Writable` store that allows both updating and reading by subscription. + * @param {*=}value initial value + * @param {StartStopNotifier=}start start and stop notifications for subscriptions + */ + function writable(value, start = noop) { + let stop; + const subscribers = []; + function set(new_value) { + if (safe_not_equal(value, new_value)) { + value = new_value; + if (stop) { // store is ready + const run_queue = !subscriber_queue.length; + for (let i = 0; i < subscribers.length; i += 1) { + const s = subscribers[i]; + s[1](); + subscriber_queue.push(s, value); + } + if (run_queue) { + for (let i = 0; i < subscriber_queue.length; i += 2) { + subscriber_queue[i][0](subscriber_queue[i + 1]); + } + subscriber_queue.length = 0; + } + } + } + } + function update(fn) { + set(fn(value)); + } + function subscribe(run, invalidate = noop) { + const subscriber = [run, invalidate]; + subscribers.push(subscriber); + if (subscribers.length === 1) { + stop = start(set) || noop; + } + run(value); + return () => { + const index = subscribers.indexOf(subscriber); + if (index !== -1) { + subscribers.splice(index, 1); + } + if (subscribers.length === 0) { + stop(); + stop = null; + } + }; + } + return { set, update, subscribe }; + } + + const createCoreApp = (backendDefinition, user) => { + const app = { + datastore: null, + crypto: null, + publish: () => { }, + hierarchy: backendDefinition.hierarchy, + actions: backendDefinition.actions, + user, }; - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + return app + }; - function commonjsRequire () { - throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); - } + var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } + function commonjsRequire() { + throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); + } - var lodash_min = createCommonjsModule(function (module, exports) { - (function(){function n(n,t,r){switch(r.length){case 0:return n.call(t);case 1:return n.call(t,r[0]);case 2:return n.call(t,r[0],r[1]);case 3:return n.call(t,r[0],r[1],r[2])}return n.apply(t,r)}function t(n,t,r,e){for(var u=-1,i=null==n?0:n.length;++u"']/g,G=RegExp(V.source),H=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,Y=/<%([\s\S]+?)%>/g,Q=/<%=([\s\S]+?)%>/g,X=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nn=/^\w*$/,tn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rn=/[\\^$.*+?()[\]{}|]/g,en=RegExp(rn.source),un=/^\s+|\s+$/g,on=/^\s+/,fn=/\s+$/,cn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,an=/\{\n\/\* \[wrapped with (.+)\] \*/,ln=/,? & /,sn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,hn=/\\(\\)?/g,pn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_n=/\w*$/,vn=/^[-+]0x[0-9a-f]+$/i,gn=/^0b[01]+$/i,dn=/^\[object .+?Constructor\]$/,yn=/^0o[0-7]+$/i,bn=/^(?:0|[1-9]\d*)$/,xn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,jn=/($^)/,wn=/['\n\r\u2028\u2029\\]/g,mn="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*",An="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+mn,En="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",kn=RegExp("['\u2019]","g"),Sn=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]","g"),On=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+En+mn,"g"),In=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+",An].join("|"),"g"),Rn=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"),zn=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wn="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".split(" "),Bn={}; - Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=true,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object DataView]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object WeakMap]"]=false; - var Ln={};Ln["[object Arguments]"]=Ln["[object Array]"]=Ln["[object ArrayBuffer]"]=Ln["[object DataView]"]=Ln["[object Boolean]"]=Ln["[object Date]"]=Ln["[object Float32Array]"]=Ln["[object Float64Array]"]=Ln["[object Int8Array]"]=Ln["[object Int16Array]"]=Ln["[object Int32Array]"]=Ln["[object Map]"]=Ln["[object Number]"]=Ln["[object Object]"]=Ln["[object RegExp]"]=Ln["[object Set]"]=Ln["[object String]"]=Ln["[object Symbol]"]=Ln["[object Uint8Array]"]=Ln["[object Uint8ClampedArray]"]=Ln["[object Uint16Array]"]=Ln["[object Uint32Array]"]=true, - Ln["[object Error]"]=Ln["[object Function]"]=Ln["[object WeakMap]"]=false;var Un={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Cn=parseFloat,Dn=parseInt,Mn=typeof commonjsGlobal=="object"&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,Tn=typeof self=="object"&&self&&self.Object===Object&&self,$n=Mn||Tn||Function("return this")(),Fn=exports&&!exports.nodeType&&exports,Nn=Fn&&'object'=="object"&&module&&!module.nodeType&&module,Pn=Nn&&Nn.exports===Fn,Zn=Pn&&Mn.process,qn=function(){ - try{var n=Nn&&Nn.f&&Nn.f("util").types;return n?n:Zn&&Zn.binding&&Zn.binding("util")}catch(n){}}(),Vn=qn&&qn.isArrayBuffer,Kn=qn&&qn.isDate,Gn=qn&&qn.isMap,Hn=qn&&qn.isRegExp,Jn=qn&&qn.isSet,Yn=qn&&qn.isTypedArray,Qn=b("length"),Xn=x({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I", - "\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C", - "\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i", - "\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r", - "\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij", - "\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),nt=x({"&":"&","<":"<",">":">",'"':""","'":"'"}),tt=x({"&":"&","<":"<",">":">",""":'"',"'":"'"}),rt=function x(mn){function An(n){if(yu(n)&&!ff(n)&&!(n instanceof Un)){if(n instanceof On)return n;if(oi.call(n,"__wrapped__"))return Fe(n)}return new On(n)}function En(){}function On(n,t){this.__wrapped__=n,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=T;}function Un(n){this.__wrapped__=n, - this.__actions__=[],this.__dir__=1,this.__filtered__=false,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[];}function Mn(n){var t=-1,r=null==n?0:n.length;for(this.clear();++t=t?n:t)),n}function _t(n,t,e,u,i,o){var f,c=1&t,a=2&t,l=4&t;if(e&&(f=i?e(n,u,i,o):e(n)),f!==T)return f;if(!du(n))return n;if(u=ff(n)){if(f=me(n),!c)return Ur(n,f)}else{var s=vo(n),h="[object Function]"==s||"[object GeneratorFunction]"==s;if(af(n))return Ir(n,c);if("[object Object]"==s||"[object Arguments]"==s||h&&!i){if(f=a||h?{}:Ae(n),!c)return a?Mr(n,lt(f,n)):Dr(n,at(f,n))}else{if(!Ln[s])return i?n:{};f=Ee(n,s,c);}}if(o||(o=new Zn), - i=o.get(n))return i;o.set(n,f),pf(n)?n.forEach(function(r){f.add(_t(r,t,e,r,n,o));}):sf(n)&&n.forEach(function(r,u){f.set(u,_t(r,t,e,u,n,o));});var a=l?a?ve:_e:a?Bu:Wu,p=u?T:a(n);return r(p||n,function(r,u){p&&(u=r,r=n[u]),ot(f,u,_t(r,t,e,u,n,o));}),f}function vt(n){var t=Wu(n);return function(r){return gt(r,n,t)}}function gt(n,t,r){var e=r.length;if(null==n)return !e;for(n=Qu(n);e--;){var u=r[e],i=t[u],o=n[u];if(o===T&&!(u in n)||!i(o))return false}return true}function dt(n,t,r){if(typeof n!="function")throw new ti("Expected a function"); - return bo(function(){n.apply(T,r);},t)}function yt(n,t,r,e){var u=-1,i=o,a=true,l=n.length,s=[],h=t.length;if(!l)return s;r&&(t=c(t,k(r))),e?(i=f,a=false):200<=t.length&&(i=O,a=false,t=new Nn(t));n:for(;++ut}function Rt(n,t){return null!=n&&oi.call(n,t)}function zt(n,t){return null!=n&&t in Qu(n)}function Wt(n,t,r){for(var e=r?f:o,u=n[0].length,i=n.length,a=i,l=Ku(i),s=1/0,h=[];a--;){var p=n[a];a&&t&&(p=c(p,k(t))),s=Ci(p.length,s), - l[a]=!r&&(t||120<=u&&120<=p.length)?new Nn(a&&p):T;}var p=n[0],_=-1,v=l[0];n:for(;++_r.length?t:kt(t,hr(r,0,-1)),r=null==t?t:t[Me(Ve(r))],null==r?T:n(r,t,e)}function Ut(n){return yu(n)&&"[object Arguments]"==Ot(n)}function Ct(n){ - return yu(n)&&"[object ArrayBuffer]"==Ot(n)}function Dt(n){return yu(n)&&"[object Date]"==Ot(n)}function Mt(n,t,r,e,u){if(n===t)t=true;else if(null==n||null==t||!yu(n)&&!yu(t))t=n!==n&&t!==t;else n:{var i=ff(n),o=ff(t),f=i?"[object Array]":vo(n),c=o?"[object Array]":vo(t),f="[object Arguments]"==f?"[object Object]":f,c="[object Arguments]"==c?"[object Object]":c,a="[object Object]"==f,o="[object Object]"==c;if((c=f==c)&&af(n)){if(!af(t)){t=false;break n}i=true,a=false;}if(c&&!a)u||(u=new Zn),t=i||_f(n)?se(n,t,r,e,Mt,u):he(n,t,f,r,e,Mt,u);else{ - if(!(1&r)&&(i=a&&oi.call(n,"__wrapped__"),f=o&&oi.call(t,"__wrapped__"),i||f)){n=i?n.value():n,t=f?t.value():t,u||(u=new Zn),t=Mt(n,t,r,e,u);break n}if(c)t:if(u||(u=new Zn),i=1&r,f=_e(n),o=f.length,c=_e(t).length,o==c||i){for(a=o;a--;){var l=f[a];if(!(i?l in t:oi.call(t,l))){t=false;break t}}if((c=u.get(n))&&u.get(t))t=c==t;else{c=true,u.set(n,t),u.set(t,n);for(var s=i;++at?r:0,Se(t,r)?n[t]:T}function Xt(n,t,r){var e=-1;return t=c(t.length?t:[$u],k(ye())),n=Gt(n,function(n){return { - a:c(t,function(t){return t(n)}),b:++e,c:n}}),w(n,function(n,t){var e;n:{e=-1;for(var u=n.a,i=t.a,o=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break n}}e=n.b-t.b;}return e})}function nr(n,t){return tr(n,t,function(t,r){return zu(n,r)})}function tr(n,t,r){for(var e=-1,u=t.length,i={};++et||9007199254740991t&&(t=-t>u?0:u+t),r=r>u?u:r,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Ku(u);++e=u){for(;e>>1,o=n[i];null!==o&&!wu(o)&&(r?o<=t:ot.length?n:kt(n,hr(t,0,-1)),null==n||delete n[Me(Ve(t))]}function jr(n,t,r,e){for(var u=n.length,i=e?u:-1;(e?i--:++ie)return e?br(n[0]):[];for(var u=-1,i=Ku(e);++u=e?n:hr(n,t,r)}function Ir(n,t){if(t)return n.slice();var r=n.length,r=gi?gi(r):new n.constructor(r);return n.copy(r),r}function Rr(n){var t=new n.constructor(n.byteLength);return new vi(t).set(new vi(n)), - t}function zr(n,t){return new n.constructor(t?Rr(n.buffer):n.buffer,n.byteOffset,n.length)}function Wr(n,t){if(n!==t){var r=n!==T,e=null===n,u=n===n,i=wu(n),o=t!==T,f=null===t,c=t===t,a=wu(t);if(!f&&!a&&!i&&n>t||i&&o&&c&&!f&&!a||e&&o&&c||!r&&c||!u)return 1;if(!e&&!i&&!a&&nu?T:i,u=1),t=Qu(t);++eo&&f[0]!==a&&f[o-1]!==a?[]:L(f,a), - o-=c.length,or?r?or(t,n):t:(r=or(t,Oi(n/D(t))),Rn.test(t)?Or(M(r),0,n).join(""):r.slice(0,n))}function te(t,r,e,u){function i(){for(var r=-1,c=arguments.length,a=-1,l=u.length,s=Ku(l+c),h=this&&this!==$n&&this instanceof i?f:t;++at||e)&&(1&n&&(i[2]=h[2],t|=1&r?0:4),(r=h[3])&&(e=i[3],i[3]=e?Br(e,r,h[4]):r,i[4]=e?L(i[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=i[5],i[5]=e?Lr(e,r,h[6]):r,i[6]=e?L(i[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(i[7]=r),128&n&&(i[8]=null==i[8]?h[8]:Ci(i[8],h[8])),null==i[9]&&(i[9]=h[9]),i[0]=h[0],i[1]=t),n=i[0], - t=i[1],r=i[2],e=i[3],u=i[4],f=i[9]=i[9]===T?c?0:n.length:Ui(i[9]-a,0),!f&&24&t&&(t&=-25),Ue((h?co:yo)(t&&1!=t?8==t||16==t?Kr(n,t,f):32!=t&&33!=t||u.length?Jr.apply(T,i):te(n,t,r,e):Pr(n,t,r),i),n,t)}function ce(n,t,r,e){return n===T||lu(n,ei[r])&&!oi.call(e,r)?t:n}function ae(n,t,r,e,u,i){return du(n)&&du(t)&&(i.set(t,n),Yt(n,t,T,ae,i),i.delete(t)),n}function le(n){return xu(n)?T:n}function se(n,t,r,e,u,i){var o=1&r,f=n.length,c=t.length;if(f!=c&&!(o&&c>f))return false;if((c=i.get(n))&&i.get(t))return c==t; - var c=-1,a=true,l=2&r?new Nn:T;for(i.set(n,t),i.set(t,n);++cr&&(r=Ui(e+r,0)),_(n,ye(t,3),r)):-1}function Pe(n,t,r){var e=null==n?0:n.length;if(!e)return -1;var u=e-1;return r!==T&&(u=Eu(r),u=0>r?Ui(e+u,0):Ci(u,e-1)), - _(n,ye(t,3),u,true)}function Ze(n){return (null==n?0:n.length)?wt(n,1):[]}function qe(n){return n&&n.length?n[0]:T}function Ve(n){var t=null==n?0:n.length;return t?n[t-1]:T}function Ke(n,t){return n&&n.length&&t&&t.length?er(n,t):n}function Ge(n){return null==n?n:$i.call(n)}function He(n){if(!n||!n.length)return [];var t=0;return n=i(n,function(n){if(hu(n))return t=Ui(n.length,t),true}),A(t,function(t){return c(n,b(t))})}function Je(t,r){if(!t||!t.length)return [];var e=He(t);return null==r?e:c(e,function(t){ - return n(r,T,t)})}function Ye(n){return n=An(n),n.__chain__=true,n}function Qe(n,t){return t(n)}function Xe(){return this}function nu(n,t){return (ff(n)?r:uo)(n,ye(t,3))}function tu(n,t){return (ff(n)?e:io)(n,ye(t,3))}function ru(n,t){return (ff(n)?c:Gt)(n,ye(t,3))}function eu(n,t,r){return t=r?T:t,t=n&&null==t?n.length:t,fe(n,128,T,T,T,T,t)}function uu(n,t){var r;if(typeof t!="function")throw new ti("Expected a function");return n=Eu(n),function(){return 0<--n&&(r=t.apply(this,arguments)),1>=n&&(t=T), - r}}function iu(n,t,r){return t=r?T:t,n=fe(n,8,T,T,T,T,T,t),n.placeholder=iu.placeholder,n}function ou(n,t,r){return t=r?T:t,n=fe(n,16,T,T,T,T,T,t),n.placeholder=ou.placeholder,n}function fu(n,t,r){function e(t){var r=c,e=a;return c=a=T,_=t,s=n.apply(e,r)}function u(n){var r=n-p;return n-=_,p===T||r>=t||0>r||g&&n>=l}function i(){var n=Go();if(u(n))return o(n);var r,e=bo;r=n-_,n=t-(n-p),r=g?Ci(n,l-r):n,h=e(i,r);}function o(n){return h=T,d&&c?e(n):(c=a=T,s)}function f(){var n=Go(),r=u(n);if(c=arguments, - a=this,p=n,r){if(h===T)return _=n=p,h=bo(i,t),v?e(n):s;if(g)return lo(h),h=bo(i,t),e(p)}return h===T&&(h=bo(i,t)),s}var c,a,l,s,h,p,_=0,v=false,g=false,d=true;if(typeof n!="function")throw new ti("Expected a function");return t=Su(t)||0,du(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Ui(Su(r.maxWait)||0,t):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==T&&lo(h),_=0,c=p=a=h=T;},f.flush=function(){return h===T?s:o(Go())},f}function cu(n,t){function r(){var e=arguments,u=t?t.apply(this,e):e[0],i=r.cache; - return i.has(u)?i.get(u):(e=n.apply(this,e),r.cache=i.set(u,e)||i,e)}if(typeof n!="function"||null!=t&&typeof t!="function")throw new ti("Expected a function");return r.cache=new(cu.Cache||Fn),r}function au(n){if(typeof n!="function")throw new ti("Expected a function");return function(){var t=arguments;switch(t.length){case 0:return !n.call(this);case 1:return !n.call(this,t[0]);case 2:return !n.call(this,t[0],t[1]);case 3:return !n.call(this,t[0],t[1],t[2])}return !n.apply(this,t)}}function lu(n,t){return n===t||n!==n&&t!==t; - }function su(n){return null!=n&&gu(n.length)&&!_u(n)}function hu(n){return yu(n)&&su(n)}function pu(n){if(!yu(n))return false;var t=Ot(n);return "[object Error]"==t||"[object DOMException]"==t||typeof n.message=="string"&&typeof n.name=="string"&&!xu(n)}function _u(n){return !!du(n)&&(n=Ot(n),"[object Function]"==n||"[object GeneratorFunction]"==n||"[object AsyncFunction]"==n||"[object Proxy]"==n)}function vu(n){return typeof n=="number"&&n==Eu(n)}function gu(n){return typeof n=="number"&&-1=n; - }function du(n){var t=typeof n;return null!=n&&("object"==t||"function"==t)}function yu(n){return null!=n&&typeof n=="object"}function bu(n){return typeof n=="number"||yu(n)&&"[object Number]"==Ot(n)}function xu(n){return !(!yu(n)||"[object Object]"!=Ot(n))&&(n=di(n),null===n||(n=oi.call(n,"constructor")&&n.constructor,typeof n=="function"&&n instanceof n&&ii.call(n)==li))}function ju(n){return typeof n=="string"||!ff(n)&&yu(n)&&"[object String]"==Ot(n)}function wu(n){return typeof n=="symbol"||yu(n)&&"[object Symbol]"==Ot(n); - }function mu(n){if(!n)return [];if(su(n))return ju(n)?M(n):Ur(n);if(wi&&n[wi]){n=n[wi]();for(var t,r=[];!(t=n.next()).done;)r.push(t.value);return r}return t=vo(n),("[object Map]"==t?W:"[object Set]"==t?U:Uu)(n)}function Au(n){return n?(n=Su(n),n===$||n===-$?1.7976931348623157e308*(0>n?-1:1):n===n?n:0):0===n?n:0}function Eu(n){n=Au(n);var t=n%1;return n===n?t?n-t:n:0}function ku(n){return n?pt(Eu(n),0,4294967295):0}function Su(n){if(typeof n=="number")return n;if(wu(n))return F;if(du(n)&&(n=typeof n.valueOf=="function"?n.valueOf():n, - n=du(n)?n+"":n),typeof n!="string")return 0===n?n:+n;n=n.replace(un,"");var t=gn.test(n);return t||yn.test(n)?Dn(n.slice(2),t?2:8):vn.test(n)?F:+n}function Ou(n){return Cr(n,Bu(n))}function Iu(n){return null==n?"":yr(n)}function Ru(n,t,r){return n=null==n?T:kt(n,t),n===T?r:n}function zu(n,t){return null!=n&&we(n,t,zt)}function Wu(n){return su(n)?qn(n):Vt(n)}function Bu(n){if(su(n))n=qn(n,true);else if(du(n)){var t,r=ze(n),e=[];for(t in n)("constructor"!=t||!r&&oi.call(n,t))&&e.push(t);n=e;}else{if(t=[], - null!=n)for(r in Qu(n))t.push(r);n=t;}return n}function Lu(n,t){if(null==n)return {};var r=c(ve(n),function(n){return [n]});return t=ye(t),tr(n,r,function(n,r){return t(n,r[0])})}function Uu(n){return null==n?[]:S(n,Wu(n))}function Cu(n){return $f(Iu(n).toLowerCase())}function Du(n){return (n=Iu(n))&&n.replace(xn,Xn).replace(Sn,"")}function Mu(n,t,r){return n=Iu(n),t=r?T:t,t===T?zn.test(n)?n.match(In)||[]:n.match(sn)||[]:n.match(t)||[]}function Tu(n){return function(){return n}}function $u(n){return n; - }function Fu(n){return qt(typeof n=="function"?n:_t(n,1))}function Nu(n,t,e){var u=Wu(t),i=Et(t,u);null!=e||du(t)&&(i.length||!u.length)||(e=t,t=n,n=this,i=Et(t,Wu(t)));var o=!(du(e)&&"chain"in e&&!e.chain),f=_u(n);return r(i,function(r){var e=t[r];n[r]=e,f&&(n.prototype[r]=function(){var t=this.__chain__;if(o||t){var r=n(this.__wrapped__);return (r.__actions__=Ur(this.__actions__)).push({func:e,args:arguments,thisArg:n}),r.__chain__=t,r}return e.apply(n,a([this.value()],arguments))});}),n}function Pu(){} - function Zu(n){return Ie(n)?b(Me(n)):rr(n)}function qu(){return []}function Vu(){return false}mn=null==mn?$n:rt.defaults($n.Object(),mn,rt.pick($n,Wn));var Ku=mn.Array,Gu=mn.Date,Hu=mn.Error,Ju=mn.Function,Yu=mn.Math,Qu=mn.Object,Xu=mn.RegExp,ni=mn.String,ti=mn.TypeError,ri=Ku.prototype,ei=Qu.prototype,ui=mn["__core-js_shared__"],ii=Ju.prototype.toString,oi=ei.hasOwnProperty,fi=0,ci=function(){var n=/[^.]+$/.exec(ui&&ui.keys&&ui.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),ai=ei.toString,li=ii.call(Qu),si=$n._,hi=Xu("^"+ii.call(oi).replace(rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),pi=Pn?mn.Buffer:T,_i=mn.Symbol,vi=mn.Uint8Array,gi=pi?pi.g:T,di=B(Qu.getPrototypeOf,Qu),yi=Qu.create,bi=ei.propertyIsEnumerable,xi=ri.splice,ji=_i?_i.isConcatSpreadable:T,wi=_i?_i.iterator:T,mi=_i?_i.toStringTag:T,Ai=function(){ - try{var n=je(Qu,"defineProperty");return n({},"",{}),n}catch(n){}}(),Ei=mn.clearTimeout!==$n.clearTimeout&&mn.clearTimeout,ki=Gu&&Gu.now!==$n.Date.now&&Gu.now,Si=mn.setTimeout!==$n.setTimeout&&mn.setTimeout,Oi=Yu.ceil,Ii=Yu.floor,Ri=Qu.getOwnPropertySymbols,zi=pi?pi.isBuffer:T,Wi=mn.isFinite,Bi=ri.join,Li=B(Qu.keys,Qu),Ui=Yu.max,Ci=Yu.min,Di=Gu.now,Mi=mn.parseInt,Ti=Yu.random,$i=ri.reverse,Fi=je(mn,"DataView"),Ni=je(mn,"Map"),Pi=je(mn,"Promise"),Zi=je(mn,"Set"),qi=je(mn,"WeakMap"),Vi=je(Qu,"create"),Ki=qi&&new qi,Gi={},Hi=Te(Fi),Ji=Te(Ni),Yi=Te(Pi),Qi=Te(Zi),Xi=Te(qi),no=_i?_i.prototype:T,to=no?no.valueOf:T,ro=no?no.toString:T,eo=function(){ - function n(){}return function(t){return du(t)?yi?yi(t):(n.prototype=t,t=new n,n.prototype=T,t):{}}}();An.templateSettings={escape:J,evaluate:Y,interpolate:Q,variable:"",imports:{_:An}},An.prototype=En.prototype,An.prototype.constructor=An,On.prototype=eo(En.prototype),On.prototype.constructor=On,Un.prototype=eo(En.prototype),Un.prototype.constructor=Un,Mn.prototype.clear=function(){this.__data__=Vi?Vi(null):{},this.size=0;},Mn.prototype.delete=function(n){return n=this.has(n)&&delete this.__data__[n], - this.size-=n?1:0,n},Mn.prototype.get=function(n){var t=this.__data__;return Vi?(n=t[n],"__lodash_hash_undefined__"===n?T:n):oi.call(t,n)?t[n]:T},Mn.prototype.has=function(n){var t=this.__data__;return Vi?t[n]!==T:oi.call(t,n)},Mn.prototype.set=function(n,t){var r=this.__data__;return this.size+=this.has(n)?0:1,r[n]=Vi&&t===T?"__lodash_hash_undefined__":t,this},Tn.prototype.clear=function(){this.__data__=[],this.size=0;},Tn.prototype.delete=function(n){var t=this.__data__;return n=ft(t,n),!(0>n)&&(n==t.length-1?t.pop():xi.call(t,n,1), - --this.size,true)},Tn.prototype.get=function(n){var t=this.__data__;return n=ft(t,n),0>n?T:t[n][1]},Tn.prototype.has=function(n){return -1e?(++this.size,r.push([n,t])):r[e][1]=t,this},Fn.prototype.clear=function(){this.size=0,this.__data__={hash:new Mn,map:new(Ni||Tn),string:new Mn};},Fn.prototype.delete=function(n){return n=be(this,n).delete(n),this.size-=n?1:0,n},Fn.prototype.get=function(n){return be(this,n).get(n); - },Fn.prototype.has=function(n){return be(this,n).has(n)},Fn.prototype.set=function(n,t){var r=be(this,n),e=r.size;return r.set(n,t),this.size+=r.size==e?0:1,this},Nn.prototype.add=Nn.prototype.push=function(n){return this.__data__.set(n,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.clear=function(){this.__data__=new Tn,this.size=0;},Zn.prototype.delete=function(n){var t=this.__data__;return n=t.delete(n),this.size=t.size,n},Zn.prototype.get=function(n){ - return this.__data__.get(n)},Zn.prototype.has=function(n){return this.__data__.has(n)},Zn.prototype.set=function(n,t){var r=this.__data__;if(r instanceof Tn){var e=r.__data__;if(!Ni||199>e.length)return e.push([n,t]),this.size=++r.size,this;r=this.__data__=new Fn(e);}return r.set(n,t),this.size=r.size,this};var uo=Fr(mt),io=Fr(At,true),oo=Nr(),fo=Nr(true),co=Ki?function(n,t){return Ki.set(n,t),n}:$u,ao=Ai?function(n,t){return Ai(n,"toString",{configurable:true,enumerable:false,value:Tu(t),writable:true})}:$u,lo=Ei||function(n){ - return $n.clearTimeout(n)},so=Zi&&1/U(new Zi([,-0]))[1]==$?function(n){return new Zi(n)}:Pu,ho=Ki?function(n){return Ki.get(n)}:Pu,po=Ri?function(n){return null==n?[]:(n=Qu(n),i(Ri(n),function(t){return bi.call(n,t)}))}:qu,_o=Ri?function(n){for(var t=[];n;)a(t,po(n)),n=di(n);return t}:qu,vo=Ot;(Fi&&"[object DataView]"!=vo(new Fi(new ArrayBuffer(1)))||Ni&&"[object Map]"!=vo(new Ni)||Pi&&"[object Promise]"!=vo(Pi.resolve())||Zi&&"[object Set]"!=vo(new Zi)||qi&&"[object WeakMap]"!=vo(new qi))&&(vo=function(n){ - var t=Ot(n);if(n=(n="[object Object]"==t?n.constructor:T)?Te(n):"")switch(n){case Hi:return "[object DataView]";case Ji:return "[object Map]";case Yi:return "[object Promise]";case Qi:return "[object Set]";case Xi:return "[object WeakMap]"}return t});var go=ui?_u:Vu,yo=Ce(co),bo=Si||function(n,t){return $n.setTimeout(n,t)},xo=Ce(ao),jo=function(n){n=cu(n,function(n){return 500===t.size&&t.clear(),n});var t=n.cache;return n}(function(n){var t=[];return 46===n.charCodeAt(0)&&t.push(""),n.replace(tn,function(n,r,e,u){ - t.push(e?u.replace(hn,"$1"):r||n);}),t}),wo=fr(function(n,t){return hu(n)?yt(n,wt(t,1,hu,true)):[]}),mo=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),ye(r,2)):[]}),Ao=fr(function(n,t){var r=Ve(t);return hu(r)&&(r=T),hu(n)?yt(n,wt(t,1,hu,true),T,r):[]}),Eo=fr(function(n){var t=c(n,Er);return t.length&&t[0]===n[0]?Wt(t):[]}),ko=fr(function(n){var t=Ve(n),r=c(n,Er);return t===Ve(r)?t=T:r.pop(),r.length&&r[0]===n[0]?Wt(r,ye(t,2)):[]}),So=fr(function(n){var t=Ve(n),r=c(n,Er);return (t=typeof t=="function"?t:T)&&r.pop(), - r.length&&r[0]===n[0]?Wt(r,T,t):[]}),Oo=fr(Ke),Io=pe(function(n,t){var r=null==n?0:n.length,e=ht(n,t);return ur(n,c(t,function(n){return Se(n,r)?+n:n}).sort(Wr)),e}),Ro=fr(function(n){return br(wt(n,1,hu,true))}),zo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T),br(wt(n,1,hu,true),ye(t,2))}),Wo=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return br(wt(n,1,hu,true),T,t)}),Bo=fr(function(n,t){return hu(n)?yt(n,t):[]}),Lo=fr(function(n){return mr(i(n,hu))}),Uo=fr(function(n){var t=Ve(n);return hu(t)&&(t=T), - mr(i(n,hu),ye(t,2))}),Co=fr(function(n){var t=Ve(n),t=typeof t=="function"?t:T;return mr(i(n,hu),T,t)}),Do=fr(He),Mo=fr(function(n){var t=n.length,t=1=t}),of=Ut(function(){return arguments}())?Ut:function(n){return yu(n)&&oi.call(n,"callee")&&!bi.call(n,"callee")},ff=Ku.isArray,cf=Vn?k(Vn):Ct,af=zi||Vu,lf=Kn?k(Kn):Dt,sf=Gn?k(Gn):Tt,hf=Hn?k(Hn):Nt,pf=Jn?k(Jn):Pt,_f=Yn?k(Yn):Zt,vf=ee(Kt),gf=ee(function(n,t){return n<=t}),df=$r(function(n,t){ - if(ze(t)||su(t))Cr(t,Wu(t),n);else for(var r in t)oi.call(t,r)&&ot(n,r,t[r]);}),yf=$r(function(n,t){Cr(t,Bu(t),n);}),bf=$r(function(n,t,r,e){Cr(t,Bu(t),n,e);}),xf=$r(function(n,t,r,e){Cr(t,Wu(t),n,e);}),jf=pe(ht),wf=fr(function(n,t){n=Qu(n);var r=-1,e=t.length,u=2--n)return t.apply(this,arguments)}},An.ary=eu,An.assign=df,An.assignIn=yf,An.assignInWith=bf,An.assignWith=xf,An.at=jf,An.before=uu,An.bind=Ho,An.bindAll=Nf,An.bindKey=Jo,An.castArray=function(){if(!arguments.length)return [];var n=arguments[0];return ff(n)?n:[n]},An.chain=Ye,An.chunk=function(n,t,r){if(t=(r?Oe(n,t,r):t===T)?1:Ui(Eu(t),0),r=null==n?0:n.length,!r||1>t)return [];for(var e=0,u=0,i=Ku(Oi(r/t));et?0:t,e)):[]},An.dropRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Eu(t),t=e-t,hr(n,0,0>t?0:t)):[]},An.dropRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true,true):[]; - },An.dropWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),true):[]},An.fill=function(n,t,r,e){var u=null==n?0:n.length;if(!u)return [];for(r&&typeof r!="number"&&Oe(n,t,r)&&(r=0,e=u),u=n.length,r=Eu(r),0>r&&(r=-r>u?0:u+r),e=e===T||e>u?u:Eu(e),0>e&&(e+=u),e=r>e?0:ku(e);r>>0,r?(n=Iu(n))&&(typeof t=="string"||null!=t&&!hf(t))&&(t=yr(t),!t&&Rn.test(n))?Or(M(n),0,r):n.split(t,r):[]},An.spread=function(t,r){if(typeof t!="function")throw new ti("Expected a function");return r=null==r?0:Ui(Eu(r),0), - fr(function(e){var u=e[r];return e=Or(e,0,r),u&&a(e,u),n(t,this,e)})},An.tail=function(n){var t=null==n?0:n.length;return t?hr(n,1,t):[]},An.take=function(n,t,r){return n&&n.length?(t=r||t===T?1:Eu(t),hr(n,0,0>t?0:t)):[]},An.takeRight=function(n,t,r){var e=null==n?0:n.length;return e?(t=r||t===T?1:Eu(t),t=e-t,hr(n,0>t?0:t,e)):[]},An.takeRightWhile=function(n,t){return n&&n.length?jr(n,ye(t,3),false,true):[]},An.takeWhile=function(n,t){return n&&n.length?jr(n,ye(t,3)):[]},An.tap=function(n,t){return t(n), - n},An.throttle=function(n,t,r){var e=true,u=true;if(typeof n!="function")throw new ti("Expected a function");return du(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),fu(n,t,{leading:e,maxWait:t,trailing:u})},An.thru=Qe,An.toArray=mu,An.toPairs=zf,An.toPairsIn=Wf,An.toPath=function(n){return ff(n)?c(n,Me):wu(n)?[n]:Ur(jo(Iu(n)))},An.toPlainObject=Ou,An.transform=function(n,t,e){var u=ff(n),i=u||af(n)||_f(n);if(t=ye(t,4),null==e){var o=n&&n.constructor;e=i?u?new o:[]:du(n)&&_u(o)?eo(di(n)):{}; - }return (i?r:mt)(n,function(n,r,u){return t(e,n,r,u)}),e},An.unary=function(n){return eu(n,1)},An.union=Ro,An.unionBy=zo,An.unionWith=Wo,An.uniq=function(n){return n&&n.length?br(n):[]},An.uniqBy=function(n,t){return n&&n.length?br(n,ye(t,2)):[]},An.uniqWith=function(n,t){return t=typeof t=="function"?t:T,n&&n.length?br(n,T,t):[]},An.unset=function(n,t){return null==n||xr(n,t)},An.unzip=He,An.unzipWith=Je,An.update=function(n,t,r){return null==n?n:lr(n,t,kr(r)(kt(n,t)),void 0)},An.updateWith=function(n,t,r,e){ - return e=typeof e=="function"?e:T,null!=n&&(n=lr(n,t,kr(r)(kt(n,t)),e)),n},An.values=Uu,An.valuesIn=function(n){return null==n?[]:S(n,Bu(n))},An.without=Bo,An.words=Mu,An.wrap=function(n,t){return nf(kr(t),n)},An.xor=Lo,An.xorBy=Uo,An.xorWith=Co,An.zip=Do,An.zipObject=function(n,t){return Ar(n||[],t||[],ot)},An.zipObjectDeep=function(n,t){return Ar(n||[],t||[],lr)},An.zipWith=Mo,An.entries=zf,An.entriesIn=Wf,An.extend=yf,An.extendWith=bf,Nu(An,An),An.add=Qf,An.attempt=Ff,An.camelCase=Bf,An.capitalize=Cu, - An.ceil=Xf,An.clamp=function(n,t,r){return r===T&&(r=t,t=T),r!==T&&(r=Su(r),r=r===r?r:0),t!==T&&(t=Su(t),t=t===t?t:0),pt(Su(n),t,r)},An.clone=function(n){return _t(n,4)},An.cloneDeep=function(n){return _t(n,5)},An.cloneDeepWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,5,t)},An.cloneWith=function(n,t){return t=typeof t=="function"?t:T,_t(n,4,t)},An.conformsTo=function(n,t){return null==t||gt(n,t,Wu(t))},An.deburr=Du,An.defaultTo=function(n,t){return null==n||n!==n?t:n},An.divide=nc,An.endsWith=function(n,t,r){ - n=Iu(n),t=yr(t);var e=n.length,e=r=r===T?e:pt(Eu(r),0,e);return r-=t.length,0<=r&&n.slice(r,e)==t},An.eq=lu,An.escape=function(n){return (n=Iu(n))&&H.test(n)?n.replace(K,nt):n},An.escapeRegExp=function(n){return (n=Iu(n))&&en.test(n)?n.replace(rn,"\\$&"):n},An.every=function(n,t,r){var e=ff(n)?u:bt;return r&&Oe(n,t,r)&&(t=T),e(n,ye(t,3))},An.find=Fo,An.findIndex=Ne,An.findKey=function(n,t){return p(n,ye(t,3),mt)},An.findLast=No,An.findLastIndex=Pe,An.findLastKey=function(n,t){return p(n,ye(t,3),At); - },An.floor=tc,An.forEach=nu,An.forEachRight=tu,An.forIn=function(n,t){return null==n?n:oo(n,ye(t,3),Bu)},An.forInRight=function(n,t){return null==n?n:fo(n,ye(t,3),Bu)},An.forOwn=function(n,t){return n&&mt(n,ye(t,3))},An.forOwnRight=function(n,t){return n&&At(n,ye(t,3))},An.get=Ru,An.gt=ef,An.gte=uf,An.has=function(n,t){return null!=n&&we(n,t,Rt)},An.hasIn=zu,An.head=qe,An.identity=$u,An.includes=function(n,t,r,e){return n=su(n)?n:Uu(n),r=r&&!e?Eu(r):0,e=n.length,0>r&&(r=Ui(e+r,0)),ju(n)?r<=e&&-1r&&(r=Ui(e+r,0)),v(n,t,r)):-1},An.inRange=function(n,t,r){return t=Au(t),r===T?(r=t,t=0):r=Au(r),n=Su(n),n>=Ci(t,r)&&n=n},An.isSet=pf,An.isString=ju,An.isSymbol=wu,An.isTypedArray=_f,An.isUndefined=function(n){return n===T},An.isWeakMap=function(n){return yu(n)&&"[object WeakMap]"==vo(n)},An.isWeakSet=function(n){return yu(n)&&"[object WeakSet]"==Ot(n)},An.join=function(n,t){return null==n?"":Bi.call(n,t)},An.kebabCase=Lf,An.last=Ve,An.lastIndexOf=function(n,t,r){var e=null==n?0:n.length;if(!e)return -1;var u=e;if(r!==T&&(u=Eu(r),u=0>u?Ui(e+u,0):Ci(u,e-1)), - t===t){for(r=u+1;r--&&n[r]!==t;);n=r;}else n=_(n,d,u,true);return n},An.lowerCase=Uf,An.lowerFirst=Cf,An.lt=vf,An.lte=gf,An.max=function(n){return n&&n.length?xt(n,$u,It):T},An.maxBy=function(n,t){return n&&n.length?xt(n,ye(t,2),It):T},An.mean=function(n){return y(n,$u)},An.meanBy=function(n,t){return y(n,ye(t,2))},An.min=function(n){return n&&n.length?xt(n,$u,Kt):T},An.minBy=function(n,t){return n&&n.length?xt(n,ye(t,2),Kt):T},An.stubArray=qu,An.stubFalse=Vu,An.stubObject=function(){return {}},An.stubString=function(){ - return ""},An.stubTrue=function(){return true},An.multiply=rc,An.nth=function(n,t){return n&&n.length?Qt(n,Eu(t)):T},An.noConflict=function(){return $n._===this&&($n._=si),this},An.noop=Pu,An.now=Go,An.pad=function(n,t,r){n=Iu(n);var e=(t=Eu(t))?D(n):0;return !t||e>=t?n:(t=(t-e)/2,ne(Ii(t),r)+n+ne(Oi(t),r))},An.padEnd=function(n,t,r){n=Iu(n);var e=(t=Eu(t))?D(n):0;return t&&et){var e=n;n=t,t=e;}return r||n%1||t%1?(r=Ti(),Ci(n+r*(t-n+Cn("1e-"+((r+"").length-1))),t)):ir(n,t)},An.reduce=function(n,t,r){var e=ff(n)?l:j,u=3>arguments.length;return e(n,ye(t,4),r,u,uo)},An.reduceRight=function(n,t,r){var e=ff(n)?s:j,u=3>arguments.length; - return e(n,ye(t,4),r,u,io)},An.repeat=function(n,t,r){return t=(r?Oe(n,t,r):t===T)?1:Eu(t),or(Iu(n),t)},An.replace=function(){var n=arguments,t=Iu(n[0]);return 3>n.length?t:t.replace(n[1],n[2])},An.result=function(n,t,r){t=Sr(t,n);var e=-1,u=t.length;for(u||(u=1,n=T);++en||9007199254740991=i)return n;if(i=r-D(e),1>i)return e;if(r=o?Or(o,0,i).join(""):n.slice(0,i),u===T)return r+e;if(o&&(i+=r.length-i),hf(u)){if(n.slice(i).search(u)){ - var f=r;for(u.global||(u=Xu(u.source,Iu(_n.exec(u))+"g")),u.lastIndex=0;o=u.exec(f);)var c=o.index;r=r.slice(0,c===T?i:c);}}else n.indexOf(yr(u),i)!=i&&(u=r.lastIndexOf(u),-1e.__dir__?"Right":"")}),e},Un.prototype[n+"Right"]=function(t){return this.reverse()[n](t).reverse()};}),r(["filter","map","takeWhile"],function(n,t){ - var r=t+1,e=1==r||3==r;Un.prototype[n]=function(n){var t=this.clone();return t.__iteratees__.push({iteratee:ye(n,3),type:r}),t.__filtered__=t.__filtered__||e,t};}),r(["head","last"],function(n,t){var r="take"+(t?"Right":"");Un.prototype[n]=function(){return this[r](1).value()[0]};}),r(["initial","tail"],function(n,t){var r="drop"+(t?"":"Right");Un.prototype[n]=function(){return this.__filtered__?new Un(this):this[r](1)};}),Un.prototype.compact=function(){return this.filter($u)},Un.prototype.find=function(n){ - return this.filter(n).head()},Un.prototype.findLast=function(n){return this.reverse().find(n)},Un.prototype.invokeMap=fr(function(n,t){return typeof n=="function"?new Un(this):this.map(function(r){return Lt(r,n,t)})}),Un.prototype.reject=function(n){return this.filter(au(ye(n)))},Un.prototype.slice=function(n,t){n=Eu(n);var r=this;return r.__filtered__&&(0t)?new Un(r):(0>n?r=r.takeRight(-n):n&&(r=r.drop(n)),t!==T&&(t=Eu(t),r=0>t?r.dropRight(-t):r.take(t-n)),r)},Un.prototype.takeRightWhile=function(n){ - return this.reverse().takeWhile(n).reverse()},Un.prototype.toArray=function(){return this.take(4294967295)},mt(Un.prototype,function(n,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),e=/^(?:head|last)$/.test(t),u=An[e?"take"+("last"==t?"Right":""):t],i=e||/^find/.test(t);u&&(An.prototype[t]=function(){function t(n){return n=u.apply(An,a([n],f)),e&&h?n[0]:n}var o=this.__wrapped__,f=e?[1]:arguments,c=o instanceof Un,l=f[0],s=c||ff(o);s&&r&&typeof l=="function"&&1!=l.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,l=i&&!h,c=c&&!p; - return !i&&s?(o=c?o:new Un(this),o=n.apply(o,f),o.__actions__.push({func:Qe,args:[t],thisArg:T}),new On(o,h)):l&&c?n.apply(this,f):(o=this.thru(t),l?e?o.value()[0]:o.value():o)});}),r("pop push shift sort splice unshift".split(" "),function(n){var t=ri[n],r=/^(?:push|sort|unshift)$/.test(n)?"tap":"thru",e=/^(?:pop|shift)$/.test(n);An.prototype[n]=function(){var n=arguments;if(e&&!this.__chain__){var u=this.value();return t.apply(ff(u)?u:[],n)}return this[r](function(r){return t.apply(ff(r)?r:[],n)}); - };}),mt(Un.prototype,function(n,t){var r=An[t];if(r){var e=r.name+"";oi.call(Gi,e)||(Gi[e]=[]),Gi[e].push({name:t,func:r});}}),Gi[Jr(T,2).name]=[{name:"wrapper",func:T}],Un.prototype.clone=function(){var n=new Un(this.__wrapped__);return n.__actions__=Ur(this.__actions__),n.__dir__=this.__dir__,n.__filtered__=this.__filtered__,n.__iteratees__=Ur(this.__iteratees__),n.__takeCount__=this.__takeCount__,n.__views__=Ur(this.__views__),n},Un.prototype.reverse=function(){if(this.__filtered__){var n=new Un(this); - n.__dir__=-1,n.__filtered__=true;}else n=this.clone(),n.__dir__*=-1;return n},Un.prototype.value=function(){var n,t=this.__wrapped__.value(),r=this.__dir__,e=ff(t),u=0>r,i=e?t.length:0;n=i;for(var o=this.__views__,f=0,c=-1,a=o.length;++c=this.__values__.length;return {done:n,value:n?T:this.__values__[this.__index__++]}},An.prototype.plant=function(n){ - for(var t,r=this;r instanceof En;){var e=Fe(r);e.__index__=0,e.__values__=T,t?u.__wrapped__=e:t=e;var u=e,r=r.__wrapped__;}return u.__wrapped__=n,t},An.prototype.reverse=function(){var n=this.__wrapped__;return n instanceof Un?(this.__actions__.length&&(n=new Un(this)),n=n.reverse(),n.__actions__.push({func:Qe,args:[Ge],thisArg:T}),new On(n,this.__chain__)):this.thru(Ge)},An.prototype.toJSON=An.prototype.valueOf=An.prototype.value=function(){return wr(this.__wrapped__,this.__actions__)},An.prototype.first=An.prototype.head, - wi&&(An.prototype[wi]=Xe),An}();Nn?((Nn.exports=rt)._=rt,Fn._=rt):$n._=rt;}).call(commonjsGlobal); - }); + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; + } - var _mapping = createCommonjsModule(function (module, exports) { + var lodash_min = createCommonjsModule(function (module, exports) { + (function () { + function n(n, t, r) { switch (r.length) { case 0: return n.call(t); case 1: return n.call(t, r[0]); case 2: return n.call(t, r[0], r[1]); case 3: return n.call(t, r[0], r[1], r[2]) }return n.apply(t, r) } function t(n, t, r, e) { for (var u = -1, i = null == n ? 0 : n.length; ++u < i;) { var o = n[u]; t(e, o, r(o), n); } return e } function r(n, t) { for (var r = -1, e = null == n ? 0 : n.length; ++r < e && false !== t(n[r], r, n);); return n } function e(n, t) { for (var r = null == n ? 0 : n.length; r-- && false !== t(n[r], r, n);); return n } function u(n, t) { + for (var r = -1, e = null == n ? 0 : n.length; ++r < e;)if (!t(n[r], r, n)) return false; + return true + } function i(n, t) { for (var r = -1, e = null == n ? 0 : n.length, u = 0, i = []; ++r < e;) { var o = n[r]; t(o, r, n) && (i[u++] = o); } return i } function o(n, t) { return !(null == n || !n.length) && -1 < v(n, t, 0) } function f(n, t, r) { for (var e = -1, u = null == n ? 0 : n.length; ++e < u;)if (r(t, n[e])) return true; return false } function c(n, t) { for (var r = -1, e = null == n ? 0 : n.length, u = Array(e); ++r < e;)u[r] = t(n[r], r, n); return u } function a(n, t) { for (var r = -1, e = t.length, u = n.length; ++r < e;)n[u + r] = t[r]; return n } function l(n, t, r, e) { + var u = -1, i = null == n ? 0 : n.length; for (e && i && (r = n[++u]); ++u < i;)r = t(r, n[u], u, n); + return r + } function s(n, t, r, e) { var u = null == n ? 0 : n.length; for (e && u && (r = n[--u]); u--;)r = t(r, n[u], u, n); return r } function h(n, t) { for (var r = -1, e = null == n ? 0 : n.length; ++r < e;)if (t(n[r], r, n)) return true; return false } function p(n, t, r) { var e; return r(n, function (n, r, u) { if (t(n, r, u)) return e = r, false }), e } function _(n, t, r, e) { var u = n.length; for (r += e ? 1 : -1; e ? r-- : ++r < u;)if (t(n[r], r, n)) return r; return -1 } function v(n, t, r) { if (t === t) n: { --r; for (var e = n.length; ++r < e;)if (n[r] === t) { n = r; break n } n = -1; } else n = _(n, d, r); return n } function g(n, t, r, e) { + --r; for (var u = n.length; ++r < u;)if (e(n[r], t)) return r; return -1 + } function d(n) { return n !== n } function y(n, t) { var r = null == n ? 0 : n.length; return r ? m(n, t) / r : F } function b(n) { return function (t) { return null == t ? T : t[n] } } function x(n) { return function (t) { return null == n ? T : n[t] } } function j(n, t, r, e, u) { return u(n, function (n, u, i) { r = e ? (e = false, n) : t(r, n, u, i); }), r } function w(n, t) { var r = n.length; for (n.sort(t); r--;)n[r] = n[r].c; return n } function m(n, t) { + for (var r, e = -1, u = n.length; ++e < u;) { var i = t(n[e]); i !== T && (r = r === T ? i : r + i); } return r; + } function A(n, t) { for (var r = -1, e = Array(n); ++r < n;)e[r] = t(r); return e } function E(n, t) { return c(t, function (t) { return [t, n[t]] }) } function k(n) { return function (t) { return n(t) } } function S(n, t) { return c(t, function (t) { return n[t] }) } function O(n, t) { return n.has(t) } function I(n, t) { for (var r = -1, e = n.length; ++r < e && -1 < v(t, n[r], 0);); return r } function R(n, t) { for (var r = n.length; r-- && -1 < v(t, n[r], 0);); return r } function z(n) { return "\\" + Un[n] } function W(n) { + var t = -1, r = Array(n.size); return n.forEach(function (n, e) { + r[++t] = [e, n]; + }), r + } function B(n, t) { return function (r) { return n(t(r)) } } function L(n, t) { for (var r = -1, e = n.length, u = 0, i = []; ++r < e;) { var o = n[r]; o !== t && "__lodash_placeholder__" !== o || (n[r] = "__lodash_placeholder__", i[u++] = r); } return i } function U(n) { var t = -1, r = Array(n.size); return n.forEach(function (n) { r[++t] = n; }), r } function C(n) { var t = -1, r = Array(n.size); return n.forEach(function (n) { r[++t] = [n, n]; }), r } function D(n) { if (Rn.test(n)) { for (var t = On.lastIndex = 0; On.test(n);)++t; n = t; } else n = Qn(n); return n } function M(n) { + return Rn.test(n) ? n.match(On) || [] : n.split(""); + } var T, $ = 1 / 0, F = NaN, N = [["ary", 128], ["bind", 1], ["bindKey", 2], ["curry", 8], ["curryRight", 16], ["flip", 512], ["partial", 32], ["partialRight", 64], ["rearg", 256]], P = /\b__p\+='';/g, Z = /\b(__p\+=)''\+/g, q = /(__e\(.*?\)|\b__t\))\+'';/g, V = /&(?:amp|lt|gt|quot|#39);/g, K = /[&<>"']/g, G = RegExp(V.source), H = RegExp(K.source), J = /<%-([\s\S]+?)%>/g, Y = /<%([\s\S]+?)%>/g, Q = /<%=([\s\S]+?)%>/g, X = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, nn = /^\w*$/, tn = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, rn = /[\\^$.*+?()[\]{}|]/g, en = RegExp(rn.source), un = /^\s+|\s+$/g, on = /^\s+/, fn = /\s+$/, cn = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, an = /\{\n\/\* \[wrapped with (.+)\] \*/, ln = /,? & /, sn = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, hn = /\\(\\)?/g, pn = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, _n = /\w*$/, vn = /^[-+]0x[0-9a-f]+$/i, gn = /^0b[01]+$/i, dn = /^\[object .+?Constructor\]$/, yn = /^0o[0-7]+$/i, bn = /^(?:0|[1-9]\d*)$/, xn = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, jn = /($^)/, wn = /['\n\r\u2028\u2029\\]/g, mn = "[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?)*", An = "(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])" + mn, En = "(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]?|[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])", kn = RegExp("['\u2019]", "g"), Sn = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g"), On = RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|" + En + mn, "g"), In = RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])|\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])|\\d+", An].join("|"), "g"), Rn = RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]"), zn = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Wn = "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".split(" "), Bn = {}; + Bn["[object Float32Array]"] = Bn["[object Float64Array]"] = Bn["[object Int8Array]"] = Bn["[object Int16Array]"] = Bn["[object Int32Array]"] = Bn["[object Uint8Array]"] = Bn["[object Uint8ClampedArray]"] = Bn["[object Uint16Array]"] = Bn["[object Uint32Array]"] = true, Bn["[object Arguments]"] = Bn["[object Array]"] = Bn["[object ArrayBuffer]"] = Bn["[object Boolean]"] = Bn["[object DataView]"] = Bn["[object Date]"] = Bn["[object Error]"] = Bn["[object Function]"] = Bn["[object Map]"] = Bn["[object Number]"] = Bn["[object Object]"] = Bn["[object RegExp]"] = Bn["[object Set]"] = Bn["[object String]"] = Bn["[object WeakMap]"] = false; + var Ln = {}; Ln["[object Arguments]"] = Ln["[object Array]"] = Ln["[object ArrayBuffer]"] = Ln["[object DataView]"] = Ln["[object Boolean]"] = Ln["[object Date]"] = Ln["[object Float32Array]"] = Ln["[object Float64Array]"] = Ln["[object Int8Array]"] = Ln["[object Int16Array]"] = Ln["[object Int32Array]"] = Ln["[object Map]"] = Ln["[object Number]"] = Ln["[object Object]"] = Ln["[object RegExp]"] = Ln["[object Set]"] = Ln["[object String]"] = Ln["[object Symbol]"] = Ln["[object Uint8Array]"] = Ln["[object Uint8ClampedArray]"] = Ln["[object Uint16Array]"] = Ln["[object Uint32Array]"] = true, + Ln["[object Error]"] = Ln["[object Function]"] = Ln["[object WeakMap]"] = false; var Un = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, Cn = parseFloat, Dn = parseInt, Mn = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal, Tn = typeof self == "object" && self && self.Object === Object && self, $n = Mn || Tn || Function("return this")(), Fn = exports && !exports.nodeType && exports, Nn = Fn && 'object' == "object" && module && !module.nodeType && module, Pn = Nn && Nn.exports === Fn, Zn = Pn && Mn.process, qn = function () { + try { var n = Nn && Nn.f && Nn.f("util").types; return n ? n : Zn && Zn.binding && Zn.binding("util") } catch (n) { } + }(), Vn = qn && qn.isArrayBuffer, Kn = qn && qn.isDate, Gn = qn && qn.isMap, Hn = qn && qn.isRegExp, Jn = qn && qn.isSet, Yn = qn && qn.isTypedArray, Qn = b("length"), Xn = x({ + "\xc0": "A", "\xc1": "A", "\xc2": "A", "\xc3": "A", "\xc4": "A", "\xc5": "A", "\xe0": "a", "\xe1": "a", "\xe2": "a", "\xe3": "a", "\xe4": "a", "\xe5": "a", "\xc7": "C", "\xe7": "c", "\xd0": "D", "\xf0": "d", "\xc8": "E", "\xc9": "E", "\xca": "E", "\xcb": "E", "\xe8": "e", "\xe9": "e", "\xea": "e", "\xeb": "e", "\xcc": "I", + "\xcd": "I", "\xce": "I", "\xcf": "I", "\xec": "i", "\xed": "i", "\xee": "i", "\xef": "i", "\xd1": "N", "\xf1": "n", "\xd2": "O", "\xd3": "O", "\xd4": "O", "\xd5": "O", "\xd6": "O", "\xd8": "O", "\xf2": "o", "\xf3": "o", "\xf4": "o", "\xf5": "o", "\xf6": "o", "\xf8": "o", "\xd9": "U", "\xda": "U", "\xdb": "U", "\xdc": "U", "\xf9": "u", "\xfa": "u", "\xfb": "u", "\xfc": "u", "\xdd": "Y", "\xfd": "y", "\xff": "y", "\xc6": "Ae", "\xe6": "ae", "\xde": "Th", "\xfe": "th", "\xdf": "ss", "\u0100": "A", "\u0102": "A", "\u0104": "A", "\u0101": "a", "\u0103": "a", "\u0105": "a", "\u0106": "C", + "\u0108": "C", "\u010a": "C", "\u010c": "C", "\u0107": "c", "\u0109": "c", "\u010b": "c", "\u010d": "c", "\u010e": "D", "\u0110": "D", "\u010f": "d", "\u0111": "d", "\u0112": "E", "\u0114": "E", "\u0116": "E", "\u0118": "E", "\u011a": "E", "\u0113": "e", "\u0115": "e", "\u0117": "e", "\u0119": "e", "\u011b": "e", "\u011c": "G", "\u011e": "G", "\u0120": "G", "\u0122": "G", "\u011d": "g", "\u011f": "g", "\u0121": "g", "\u0123": "g", "\u0124": "H", "\u0126": "H", "\u0125": "h", "\u0127": "h", "\u0128": "I", "\u012a": "I", "\u012c": "I", "\u012e": "I", "\u0130": "I", "\u0129": "i", + "\u012b": "i", "\u012d": "i", "\u012f": "i", "\u0131": "i", "\u0134": "J", "\u0135": "j", "\u0136": "K", "\u0137": "k", "\u0138": "k", "\u0139": "L", "\u013b": "L", "\u013d": "L", "\u013f": "L", "\u0141": "L", "\u013a": "l", "\u013c": "l", "\u013e": "l", "\u0140": "l", "\u0142": "l", "\u0143": "N", "\u0145": "N", "\u0147": "N", "\u014a": "N", "\u0144": "n", "\u0146": "n", "\u0148": "n", "\u014b": "n", "\u014c": "O", "\u014e": "O", "\u0150": "O", "\u014d": "o", "\u014f": "o", "\u0151": "o", "\u0154": "R", "\u0156": "R", "\u0158": "R", "\u0155": "r", "\u0157": "r", "\u0159": "r", + "\u015a": "S", "\u015c": "S", "\u015e": "S", "\u0160": "S", "\u015b": "s", "\u015d": "s", "\u015f": "s", "\u0161": "s", "\u0162": "T", "\u0164": "T", "\u0166": "T", "\u0163": "t", "\u0165": "t", "\u0167": "t", "\u0168": "U", "\u016a": "U", "\u016c": "U", "\u016e": "U", "\u0170": "U", "\u0172": "U", "\u0169": "u", "\u016b": "u", "\u016d": "u", "\u016f": "u", "\u0171": "u", "\u0173": "u", "\u0174": "W", "\u0175": "w", "\u0176": "Y", "\u0177": "y", "\u0178": "Y", "\u0179": "Z", "\u017b": "Z", "\u017d": "Z", "\u017a": "z", "\u017c": "z", "\u017e": "z", "\u0132": "IJ", "\u0133": "ij", + "\u0152": "Oe", "\u0153": "oe", "\u0149": "'n", "\u017f": "s" + }), nt = x({ "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }), tt = x({ "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }), rt = function x(mn) { + function An(n) { if (yu(n) && !ff(n) && !(n instanceof Un)) { if (n instanceof On) return n; if (oi.call(n, "__wrapped__")) return Fe(n) } return new On(n) } function En() { } function On(n, t) { this.__wrapped__ = n, this.__actions__ = [], this.__chain__ = !!t, this.__index__ = 0, this.__values__ = T; } function Un(n) { + this.__wrapped__ = n, + this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = 4294967295, this.__views__ = []; + } function Mn(n) { var t = -1, r = null == n ? 0 : n.length; for (this.clear(); ++t < r;) { var e = n[t]; this.set(e[0], e[1]); } } function Tn(n) { var t = -1, r = null == n ? 0 : n.length; for (this.clear(); ++t < r;) { var e = n[t]; this.set(e[0], e[1]); } } function Fn(n) { var t = -1, r = null == n ? 0 : n.length; for (this.clear(); ++t < r;) { var e = n[t]; this.set(e[0], e[1]); } } function Nn(n) { + var t = -1, r = null == n ? 0 : n.length; for (this.__data__ = new Fn; ++t < r;)this.add(n[t]); + } function Zn(n) { this.size = (this.__data__ = new Tn(n)).size; } function qn(n, t) { var r, e = ff(n), u = !e && of(n), i = !e && !u && af(n), o = !e && !u && !i && _f(n), u = (e = e || u || i || o) ? A(n.length, ni) : [], f = u.length; for (r in n) !t && !oi.call(n, r) || e && ("length" == r || i && ("offset" == r || "parent" == r) || o && ("buffer" == r || "byteLength" == r || "byteOffset" == r) || Se(r, f)) || u.push(r); return u } function Qn(n) { var t = n.length; return t ? n[ir(0, t - 1)] : T } function et(n, t) { return De(Ur(n), pt(t, 0, n.length)) } function ut(n) { return De(Ur(n)) } function it(n, t, r) { + (r === T || lu(n[t], r)) && (r !== T || t in n) || st(n, t, r); + } function ot(n, t, r) { var e = n[t]; oi.call(n, t) && lu(e, r) && (r !== T || t in n) || st(n, t, r); } function ft(n, t) { for (var r = n.length; r--;)if (lu(n[r][0], t)) return r; return -1 } function ct(n, t, r, e) { return uo(n, function (n, u, i) { t(e, n, r(n), i); }), e } function at(n, t) { return n && Cr(t, Wu(t), n) } function lt(n, t) { return n && Cr(t, Bu(t), n) } function st(n, t, r) { "__proto__" == t && Ai ? Ai(n, t, { configurable: true, enumerable: true, value: r, writable: true }) : n[t] = r; } function ht(n, t) { + for (var r = -1, e = t.length, u = Ku(e), i = null == n; ++r < e;)u[r] = i ? T : Ru(n, t[r]); return u; + } function pt(n, t, r) { return n === n && (r !== T && (n = n <= r ? n : r), t !== T && (n = n >= t ? n : t)), n } function _t(n, t, e, u, i, o) { + var f, c = 1 & t, a = 2 & t, l = 4 & t; if (e && (f = i ? e(n, u, i, o) : e(n)), f !== T) return f; if (!du(n)) return n; if (u = ff(n)) { if (f = me(n), !c) return Ur(n, f) } else { var s = vo(n), h = "[object Function]" == s || "[object GeneratorFunction]" == s; if (af(n)) return Ir(n, c); if ("[object Object]" == s || "[object Arguments]" == s || h && !i) { if (f = a || h ? {} : Ae(n), !c) return a ? Mr(n, lt(f, n)) : Dr(n, at(f, n)) } else { if (!Ln[s]) return i ? n : {}; f = Ee(n, s, c); } } if (o || (o = new Zn), + i = o.get(n)) return i; o.set(n, f), pf(n) ? n.forEach(function (r) { f.add(_t(r, t, e, r, n, o)); }) : sf(n) && n.forEach(function (r, u) { f.set(u, _t(r, t, e, u, n, o)); }); var a = l ? a ? ve : _e : a ? Bu : Wu, p = u ? T : a(n); return r(p || n, function (r, u) { p && (u = r, r = n[u]), ot(f, u, _t(r, t, e, u, n, o)); }), f + } function vt(n) { var t = Wu(n); return function (r) { return gt(r, n, t) } } function gt(n, t, r) { var e = r.length; if (null == n) return !e; for (n = Qu(n); e--;) { var u = r[e], i = t[u], o = n[u]; if (o === T && !(u in n) || !i(o)) return false } return true } function dt(n, t, r) { + if (typeof n != "function") throw new ti("Expected a function"); + return bo(function () { n.apply(T, r); }, t) + } function yt(n, t, r, e) { var u = -1, i = o, a = true, l = n.length, s = [], h = t.length; if (!l) return s; r && (t = c(t, k(r))), e ? (i = f, a = false) : 200 <= t.length && (i = O, a = false, t = new Nn(t)); n: for (; ++u < l;) { var p = n[u], _ = null == r ? p : r(p), p = e || 0 !== p ? p : 0; if (a && _ === _) { for (var v = h; v--;)if (t[v] === _) continue n; s.push(p); } else i(t, _, e) || s.push(p); } return s } function bt(n, t) { var r = true; return uo(n, function (n, e, u) { return r = !!t(n, e, u) }), r } function xt(n, t, r) { + for (var e = -1, u = n.length; ++e < u;) { + var i = n[e], o = t(i); if (null != o && (f === T ? o === o && !wu(o) : r(o, f))) var f = o, c = i; + } return c + } function jt(n, t) { var r = []; return uo(n, function (n, e, u) { t(n, e, u) && r.push(n); }), r } function wt(n, t, r, e, u) { var i = -1, o = n.length; for (r || (r = ke), u || (u = []); ++i < o;) { var f = n[i]; 0 < t && r(f) ? 1 < t ? wt(f, t - 1, r, e, u) : a(u, f) : e || (u[u.length] = f); } return u } function mt(n, t) { return n && oo(n, t, Wu) } function At(n, t) { return n && fo(n, t, Wu) } function Et(n, t) { return i(t, function (t) { return _u(n[t]) }) } function kt(n, t) { t = Sr(t, n); for (var r = 0, e = t.length; null != n && r < e;)n = n[Me(t[r++])]; return r && r == e ? n : T } function St(n, t, r) { + return t = t(n), + ff(n) ? t : a(t, r(n)) + } function Ot(n) { if (null == n) n = n === T ? "[object Undefined]" : "[object Null]"; else if (mi && mi in Qu(n)) { var t = oi.call(n, mi), r = n[mi]; try { n[mi] = T; var e = true; } catch (n) { } var u = ai.call(n); e && (t ? n[mi] = r : delete n[mi]), n = u; } else n = ai.call(n); return n } function It(n, t) { return n > t } function Rt(n, t) { return null != n && oi.call(n, t) } function zt(n, t) { return null != n && t in Qu(n) } function Wt(n, t, r) { + for (var e = r ? f : o, u = n[0].length, i = n.length, a = i, l = Ku(i), s = 1 / 0, h = []; a--;) { + var p = n[a]; a && t && (p = c(p, k(t))), s = Ci(p.length, s), + l[a] = !r && (t || 120 <= u && 120 <= p.length) ? new Nn(a && p) : T; + } var p = n[0], _ = -1, v = l[0]; n: for (; ++_ < u && h.length < s;) { var g = p[_], d = t ? t(g) : g, g = r || 0 !== g ? g : 0; if (v ? !O(v, d) : !e(h, d, r)) { for (a = i; --a;) { var y = l[a]; if (y ? !O(y, d) : !e(n[a], d, r)) continue n } v && v.push(d), h.push(g); } } return h + } function Bt(n, t, r) { var e = {}; return mt(n, function (n, u, i) { t(e, r(n), u, i); }), e } function Lt(t, r, e) { return r = Sr(r, t), t = 2 > r.length ? t : kt(t, hr(r, 0, -1)), r = null == t ? t : t[Me(Ve(r))], null == r ? T : n(r, t, e) } function Ut(n) { return yu(n) && "[object Arguments]" == Ot(n) } function Ct(n) { + return yu(n) && "[object ArrayBuffer]" == Ot(n) + } function Dt(n) { return yu(n) && "[object Date]" == Ot(n) } function Mt(n, t, r, e, u) { + if (n === t) t = true; else if (null == n || null == t || !yu(n) && !yu(t)) t = n !== n && t !== t; else n: { + var i = ff(n), o = ff(t), f = i ? "[object Array]" : vo(n), c = o ? "[object Array]" : vo(t), f = "[object Arguments]" == f ? "[object Object]" : f, c = "[object Arguments]" == c ? "[object Object]" : c, a = "[object Object]" == f, o = "[object Object]" == c; if ((c = f == c) && af(n)) { if (!af(t)) { t = false; break n } i = true, a = false; } if (c && !a) u || (u = new Zn), t = i || _f(n) ? se(n, t, r, e, Mt, u) : he(n, t, f, r, e, Mt, u); else { + if (!(1 & r) && (i = a && oi.call(n, "__wrapped__"), f = o && oi.call(t, "__wrapped__"), i || f)) { n = i ? n.value() : n, t = f ? t.value() : t, u || (u = new Zn), t = Mt(n, t, r, e, u); break n } if (c) t: if (u || (u = new Zn), i = 1 & r, f = _e(n), o = f.length, c = _e(t).length, o == c || i) { + for (a = o; a--;) { var l = f[a]; if (!(i ? l in t : oi.call(t, l))) { t = false; break t } } if ((c = u.get(n)) && u.get(t)) t = c == t; else { + c = true, u.set(n, t), u.set(t, n); for (var s = i; ++a < o;) { + var l = f[a], h = n[l], p = t[l]; if (e) var _ = i ? e(p, h, l, t, n, u) : e(h, p, l, n, t, u); if (_ === T ? h !== p && !Mt(h, p, r, e, u) : !_) { c = false; break } s || (s = "constructor" == l); + } c && !s && (r = n.constructor, e = t.constructor, r != e && "constructor" in n && "constructor" in t && !(typeof r == "function" && r instanceof r && typeof e == "function" && e instanceof e) && (c = false)), u.delete(n), u.delete(t), t = c; + } + } else t = false; else t = false; + } + } return t + } function Tt(n) { return yu(n) && "[object Map]" == vo(n) } function $t(n, t, r, e) { + var u = r.length, i = u, o = !e; if (null == n) return !i; for (n = Qu(n); u--;) { var f = r[u]; if (o && f[2] ? f[1] !== n[f[0]] : !(f[0] in n)) return false } for (; ++u < i;) { + var f = r[u], c = f[0], a = n[c], l = f[1]; if (o && f[2]) { + if (a === T && !(c in n)) return false; + } else { if (f = new Zn, e) var s = e(a, l, c, n, t, f); if (s === T ? !Mt(l, a, 3, e, f) : !s) return false } + } return true + } function Ft(n) { return !(!du(n) || ci && ci in n) && (_u(n) ? hi : dn).test(Te(n)) } function Nt(n) { return yu(n) && "[object RegExp]" == Ot(n) } function Pt(n) { return yu(n) && "[object Set]" == vo(n) } function Zt(n) { return yu(n) && gu(n.length) && !!Bn[Ot(n)] } function qt(n) { return typeof n == "function" ? n : null == n ? $u : typeof n == "object" ? ff(n) ? Jt(n[0], n[1]) : Ht(n) : Zu(n) } function Vt(n) { + if (!ze(n)) return Li(n); var t, r = []; for (t in Qu(n)) oi.call(n, t) && "constructor" != t && r.push(t); + return r + } function Kt(n, t) { return n < t } function Gt(n, t) { var r = -1, e = su(n) ? Ku(n.length) : []; return uo(n, function (n, u, i) { e[++r] = t(n, u, i); }), e } function Ht(n) { var t = xe(n); return 1 == t.length && t[0][2] ? We(t[0][0], t[0][1]) : function (r) { return r === n || $t(r, n, t) } } function Jt(n, t) { return Ie(n) && t === t && !du(t) ? We(Me(n), t) : function (r) { var e = Ru(r, n); return e === T && e === t ? zu(r, n) : Mt(t, e, 3) } } function Yt(n, t, r, e, u) { + n !== t && oo(t, function (i, o) { + if (u || (u = new Zn), du(i)) { + var f = u, c = Le(n, o), a = Le(t, o), l = f.get(a); if (l) it(n, o, l); else { + var l = e ? e(c, a, o + "", n, t, f) : T, s = l === T; if (s) { var h = ff(a), p = !h && af(a), _ = !h && !p && _f(a), l = a; h || p || _ ? ff(c) ? l = c : hu(c) ? l = Ur(c) : p ? (s = false, l = Ir(a, true)) : _ ? (s = false, l = zr(a, true)) : l = [] : xu(a) || of(a) ? (l = c, of(c) ? l = Ou(c) : du(c) && !_u(c) || (l = Ae(a))) : s = false; } s && (f.set(a, l), Yt(l, a, r, e, f), f.delete(a)), it(n, o, l); + } + } else f = e ? e(Le(n, o), i, o + "", n, t, u) : T, f === T && (f = i), it(n, o, f); + }, Bu); + } function Qt(n, t) { var r = n.length; if (r) return t += 0 > t ? r : 0, Se(t, r) ? n[t] : T } function Xt(n, t, r) { + var e = -1; return t = c(t.length ? t : [$u], k(ye())), n = Gt(n, function (n) { + return { + a: c(t, function (t) { return t(n) }), b: ++e, c: n + } + }), w(n, function (n, t) { var e; n: { e = -1; for (var u = n.a, i = t.a, o = u.length, f = r.length; ++e < o;) { var c = Wr(u[e], i[e]); if (c) { e = e >= f ? c : c * ("desc" == r[e] ? -1 : 1); break n } } e = n.b - t.b; } return e }) + } function nr(n, t) { return tr(n, t, function (t, r) { return zu(n, r) }) } function tr(n, t, r) { for (var e = -1, u = t.length, i = {}; ++e < u;) { var o = t[e], f = kt(n, o); r(f, o) && lr(i, Sr(o, n), f); } return i } function rr(n) { return function (t) { return kt(t, n) } } function er(n, t, r, e) { + var u = e ? g : v, i = -1, o = t.length, f = n; for (n === t && (t = Ur(t)), + r && (f = c(n, k(r))); ++i < o;)for (var a = 0, l = t[i], l = r ? r(l) : l; -1 < (a = u(f, l, a, e));)f !== n && xi.call(f, a, 1), xi.call(n, a, 1); return n + } function ur(n, t) { for (var r = n ? t.length : 0, e = r - 1; r--;) { var u = t[r]; if (r == e || u !== i) { var i = u; Se(u) ? xi.call(n, u, 1) : xr(n, u); } } } function ir(n, t) { return n + Ii(Ti() * (t - n + 1)) } function or(n, t) { var r = ""; if (!n || 1 > t || 9007199254740991 < t) return r; do t % 2 && (r += n), (t = Ii(t / 2)) && (n += n); while (t); return r } function fr(n, t) { return xo(Be(n, t, $u), n + "") } function cr(n) { return Qn(Uu(n)) } function ar(n, t) { + var r = Uu(n); + return De(r, pt(t, 0, r.length)) + } function lr(n, t, r, e) { if (!du(n)) return n; t = Sr(t, n); for (var u = -1, i = t.length, o = i - 1, f = n; null != f && ++u < i;) { var c = Me(t[u]), a = r; if (u != o) { var l = f[c], a = e ? e(l, c, f) : T; a === T && (a = du(l) ? l : Se(t[u + 1]) ? [] : {}); } ot(f, c, a), f = f[c]; } return n } function sr(n) { return De(Uu(n)) } function hr(n, t, r) { var e = -1, u = n.length; for (0 > t && (t = -t > u ? 0 : u + t), r = r > u ? u : r, 0 > r && (r += u), u = t > r ? 0 : r - t >>> 0, t >>>= 0, r = Ku(u); ++e < u;)r[e] = n[e + t]; return r } function pr(n, t) { var r; return uo(n, function (n, e, u) { return r = t(n, e, u), !r }), !!r } + function _r(n, t, r) { var e = 0, u = null == n ? e : n.length; if (typeof t == "number" && t === t && 2147483647 >= u) { for (; e < u;) { var i = e + u >>> 1, o = n[i]; null !== o && !wu(o) && (r ? o <= t : o < t) ? e = i + 1 : u = i; } return u } return vr(n, t, $u, r) } function vr(n, t, r, e) { t = r(t); for (var u = 0, i = null == n ? 0 : n.length, o = t !== t, f = null === t, c = wu(t), a = t === T; u < i;) { var l = Ii((u + i) / 2), s = r(n[l]), h = s !== T, p = null === s, _ = s === s, v = wu(s); (o ? e || _ : a ? _ && (e || h) : f ? _ && h && (e || !p) : c ? _ && h && !p && (e || !v) : p || v ? 0 : e ? s <= t : s < t) ? u = l + 1 : i = l; } return Ci(i, 4294967294) } function gr(n, t) { + for (var r = -1, e = n.length, u = 0, i = []; ++r < e;) { + var o = n[r], f = t ? t(o) : o; if (!r || !lu(f, c)) { var c = f; i[u++] = 0 === o ? 0 : o; } + } return i + } function dr(n) { return typeof n == "number" ? n : wu(n) ? F : +n } function yr(n) { if (typeof n == "string") return n; if (ff(n)) return c(n, yr) + ""; if (wu(n)) return ro ? ro.call(n) : ""; var t = n + ""; return "0" == t && 1 / n == -$ ? "-0" : t } function br(n, t, r) { + var e = -1, u = o, i = n.length, c = true, a = [], l = a; if (r) c = false, u = f; else if (200 <= i) { if (u = t ? null : so(n)) return U(u); c = false, u = O, l = new Nn; } else l = t ? [] : a; n: for (; ++e < i;) { + var s = n[e], h = t ? t(s) : s, s = r || 0 !== s ? s : 0; if (c && h === h) { + for (var p = l.length; p--;)if (l[p] === h) continue n; + t && l.push(h), a.push(s); + } else u(l, h, r) || (l !== a && l.push(h), a.push(s)); + } return a + } function xr(n, t) { return t = Sr(t, n), n = 2 > t.length ? n : kt(n, hr(t, 0, -1)), null == n || delete n[Me(Ve(t))] } function jr(n, t, r, e) { for (var u = n.length, i = e ? u : -1; (e ? i-- : ++i < u) && t(n[i], i, n);); return r ? hr(n, e ? 0 : i, e ? i + 1 : u) : hr(n, e ? i + 1 : 0, e ? u : i) } function wr(n, t) { var r = n; return r instanceof Un && (r = r.value()), l(t, function (n, t) { return t.func.apply(t.thisArg, a([n], t.args)) }, r) } function mr(n, t, r) { + var e = n.length; if (2 > e) return e ? br(n[0]) : []; for (var u = -1, i = Ku(e); ++u < e;)for (var o = n[u], f = -1; ++f < e;)f != u && (i[u] = yt(i[u] || o, n[f], t, r)); + return br(wt(i, 1), t, r) + } function Ar(n, t, r) { for (var e = -1, u = n.length, i = t.length, o = {}; ++e < u;)r(o, n[e], e < i ? t[e] : T); return o } function Er(n) { return hu(n) ? n : [] } function kr(n) { return typeof n == "function" ? n : $u } function Sr(n, t) { return ff(n) ? n : Ie(n, t) ? [n] : jo(Iu(n)) } function Or(n, t, r) { var e = n.length; return r = r === T ? e : r, !t && r >= e ? n : hr(n, t, r) } function Ir(n, t) { if (t) return n.slice(); var r = n.length, r = gi ? gi(r) : new n.constructor(r); return n.copy(r), r } function Rr(n) { + var t = new n.constructor(n.byteLength); return new vi(t).set(new vi(n)), + t + } function zr(n, t) { return new n.constructor(t ? Rr(n.buffer) : n.buffer, n.byteOffset, n.length) } function Wr(n, t) { if (n !== t) { var r = n !== T, e = null === n, u = n === n, i = wu(n), o = t !== T, f = null === t, c = t === t, a = wu(t); if (!f && !a && !i && n > t || i && o && c && !f && !a || e && o && c || !r && c || !u) return 1; if (!e && !i && !a && n < t || a && r && u && !e && !i || f && r && u || !o && u || !c) return -1 } return 0 } function Br(n, t, r, e) { + var u = -1, i = n.length, o = r.length, f = -1, c = t.length, a = Ui(i - o, 0), l = Ku(c + a); for (e = !e; ++f < c;)l[f] = t[f]; for (; ++u < o;)(e || u < i) && (l[r[u]] = n[u]); for (; a--;)l[f++] = n[u++]; + return l + } function Lr(n, t, r, e) { var u = -1, i = n.length, o = -1, f = r.length, c = -1, a = t.length, l = Ui(i - f, 0), s = Ku(l + a); for (e = !e; ++u < l;)s[u] = n[u]; for (l = u; ++c < a;)s[l + c] = t[c]; for (; ++o < f;)(e || u < i) && (s[l + r[o]] = n[u++]); return s } function Ur(n, t) { var r = -1, e = n.length; for (t || (t = Ku(e)); ++r < e;)t[r] = n[r]; return t } function Cr(n, t, r, e) { var u = !r; r || (r = {}); for (var i = -1, o = t.length; ++i < o;) { var f = t[i], c = e ? e(r[f], n[f], f, r, n) : T; c === T && (c = n[f]), u ? st(r, f, c) : ot(r, f, c); } return r } function Dr(n, t) { return Cr(n, po(n), t) } function Mr(n, t) { + return Cr(n, _o(n), t); + } function Tr(n, r) { return function (e, u) { var i = ff(e) ? t : ct, o = r ? r() : {}; return i(e, n, ye(u, 2), o) } } function $r(n) { return fr(function (t, r) { var e = -1, u = r.length, i = 1 < u ? r[u - 1] : T, o = 2 < u ? r[2] : T, i = 3 < n.length && typeof i == "function" ? (u--, i) : T; for (o && Oe(r[0], r[1], o) && (i = 3 > u ? T : i, u = 1), t = Qu(t); ++e < u;)(o = r[e]) && n(t, o, e, i); return t }) } function Fr(n, t) { return function (r, e) { if (null == r) return r; if (!su(r)) return n(r, e); for (var u = r.length, i = t ? u : -1, o = Qu(r); (t ? i-- : ++i < u) && false !== e(o[i], i, o);); return r } } function Nr(n) { + return function (t, r, e) { + var u = -1, i = Qu(t); e = e(t); for (var o = e.length; o--;) { var f = e[n ? o : ++u]; if (false === r(i[f], f, i)) break } return t + } + } function Pr(n, t, r) { function e() { return (this && this !== $n && this instanceof e ? i : n).apply(u ? r : this, arguments) } var u = 1 & t, i = Vr(n); return e } function Zr(n) { return function (t) { t = Iu(t); var r = Rn.test(t) ? M(t) : T, e = r ? r[0] : t.charAt(0); return t = r ? Or(r, 1).join("") : t.slice(1), e[n]() + t } } function qr(n) { return function (t) { return l(Mu(Du(t).replace(kn, "")), n, "") } } function Vr(n) { + return function () { + var t = arguments; switch (t.length) { + case 0: return new n; case 1: return new n(t[0]); case 2: return new n(t[0], t[1]); case 3: return new n(t[0], t[1], t[2]); case 4: return new n(t[0], t[1], t[2], t[3]); case 5: return new n(t[0], t[1], t[2], t[3], t[4]); case 6: return new n(t[0], t[1], t[2], t[3], t[4], t[5]); case 7: return new n(t[0], t[1], t[2], t[3], t[4], t[5], t[6]) + }var r = eo(n.prototype), t = n.apply(r, t); return du(t) ? t : r + } + } function Kr(t, r, e) { + function u() { + for (var o = arguments.length, f = Ku(o), c = o, a = de(u); c--;)f[c] = arguments[c]; return c = 3 > o && f[0] !== a && f[o - 1] !== a ? [] : L(f, a), + o -= c.length, o < e ? ue(t, r, Jr, u.placeholder, T, f, c, T, T, e - o) : n(this && this !== $n && this instanceof u ? i : t, this, f) + } var i = Vr(t); return u + } function Gr(n) { return function (t, r, e) { var u = Qu(t); if (!su(t)) { var i = ye(r, 3); t = Wu(t), r = function (n) { return i(u[n], n, u) }; } return r = n(t, r, e), -1 < r ? u[i ? t[r] : r] : T } } function Hr(n) { + return pe(function (t) { + var r = t.length, e = r, u = On.prototype.thru; for (n && t.reverse(); e--;) { var i = t[e]; if (typeof i != "function") throw new ti("Expected a function"); if (u && !o && "wrapper" == ge(i)) var o = new On([], true); } for (e = o ? e : r; ++e < r;)var i = t[e], u = ge(i), f = "wrapper" == u ? ho(i) : T, o = f && Re(f[0]) && 424 == f[1] && !f[4].length && 1 == f[9] ? o[ge(f[0])].apply(o, f[3]) : 1 == i.length && Re(i) ? o[u]() : o.thru(i); + return function () { var n = arguments, e = n[0]; if (o && 1 == n.length && ff(e)) return o.plant(e).value(); for (var u = 0, n = r ? t[u].apply(this, n) : e; ++u < r;)n = t[u].call(this, n); return n } + }) + } function Jr(n, t, r, e, u, i, o, f, c, a) { + function l() { + for (var d = arguments.length, y = Ku(d), b = d; b--;)y[b] = arguments[b]; if (_) { var x, j = de(l), b = y.length; for (x = 0; b--;)y[b] === j && ++x; } if (e && (y = Br(y, e, u, _)), i && (y = Lr(y, i, o, _)), d -= x, _ && d < a) return j = L(y, j), ue(n, t, Jr, l.placeholder, r, y, j, f, c, a - d); if (j = h ? r : this, b = p ? j[n] : n, d = y.length, f) { + x = y.length; for (var w = Ci(f.length, x), m = Ur(y); w--;) { + var A = f[w]; y[w] = Se(A, x) ? m[A] : T; + } + } else v && 1 < d && y.reverse(); return s && c < d && (y.length = c), this && this !== $n && this instanceof l && (b = g || Vr(b)), b.apply(j, y) + } var s = 128 & t, h = 1 & t, p = 2 & t, _ = 24 & t, v = 512 & t, g = p ? T : Vr(n); return l + } function Yr(n, t) { return function (r, e) { return Bt(r, n, t(e)) } } function Qr(n, t) { return function (r, e) { var u; if (r === T && e === T) return t; if (r !== T && (u = r), e !== T) { if (u === T) return e; typeof r == "string" || typeof e == "string" ? (r = yr(r), e = yr(e)) : (r = dr(r), e = dr(e)), u = n(r, e); } return u } } function Xr(t) { + return pe(function (r) { + return r = c(r, k(ye())), fr(function (e) { var u = this; return t(r, function (t) { return n(t, u, e) }) }) + }) + } function ne(n, t) { t = t === T ? " " : yr(t); var r = t.length; return 2 > r ? r ? or(t, n) : t : (r = or(t, Oi(n / D(t))), Rn.test(t) ? Or(M(r), 0, n).join("") : r.slice(0, n)) } function te(t, r, e, u) { function i() { for (var r = -1, c = arguments.length, a = -1, l = u.length, s = Ku(l + c), h = this && this !== $n && this instanceof i ? f : t; ++a < l;)s[a] = u[a]; for (; c--;)s[a++] = arguments[++r]; return n(h, o ? e : this, s) } var o = 1 & r, f = Vr(t); return i } function re(n) { + return function (t, r, e) { + e && typeof e != "number" && Oe(t, r, e) && (r = e = T), t = Au(t), r === T ? (r = t, t = 0) : r = Au(r), e = e === T ? t < r ? 1 : -1 : Au(e); var u = -1; r = Ui(Oi((r - t) / (e || 1)), 0); for (var i = Ku(r); r--;)i[n ? r : ++u] = t, t += e; return i + } + } function ee(n) { return function (t, r) { return typeof t == "string" && typeof r == "string" || (t = Su(t), r = Su(r)), n(t, r) } } function ue(n, t, r, e, u, i, o, f, c, a) { var l = 8 & t, s = l ? o : T; o = l ? T : o; var h = l ? i : T; return i = l ? T : i, t = (t | (l ? 32 : 64)) & ~(l ? 64 : 32), 4 & t || (t &= -4), u = [n, t, u, h, s, i, o, f, c, a], r = r.apply(T, u), Re(n) && yo(r, u), r.placeholder = e, Ue(r, n, t) } function ie(n) { + var t = Yu[n]; return function (n, r) { if (n = Su(n), (r = null == r ? 0 : Ci(Eu(r), 292)) && Wi(n)) { var e = (Iu(n) + "e").split("e"), e = t(e[0] + "e" + (+e[1] + r)), e = (Iu(e) + "e").split("e"); return +(e[0] + "e" + (+e[1] - r)) } return t(n) } + } function oe(n) { return function (t) { var r = vo(t); return "[object Map]" == r ? W(t) : "[object Set]" == r ? C(t) : E(t, n(t)) } } function fe(n, t, r, e, u, i, o, f) { + var c = 2 & t; if (!c && typeof n != "function") throw new ti("Expected a function"); var a = e ? e.length : 0; if (a || (t &= -97, e = u = T), o = o === T ? o : Ui(Eu(o), 0), f = f === T ? f : Eu(f), a -= u ? u.length : 0, + 64 & t) { var l = e, s = u; e = u = T; } var h = c ? T : ho(n); return i = [n, t, r, e, u, l, s, i, o, f], h && (r = i[1], n = h[1], t = r | n, e = 128 == n && 8 == r || 128 == n && 256 == r && i[7].length <= h[8] || 384 == n && h[7].length <= h[8] && 8 == r, 131 > t || e) && (1 & n && (i[2] = h[2], t |= 1 & r ? 0 : 4), (r = h[3]) && (e = i[3], i[3] = e ? Br(e, r, h[4]) : r, i[4] = e ? L(i[3], "__lodash_placeholder__") : h[4]), (r = h[5]) && (e = i[5], i[5] = e ? Lr(e, r, h[6]) : r, i[6] = e ? L(i[5], "__lodash_placeholder__") : h[6]), (r = h[7]) && (i[7] = r), 128 & n && (i[8] = null == i[8] ? h[8] : Ci(i[8], h[8])), null == i[9] && (i[9] = h[9]), i[0] = h[0], i[1] = t), n = i[0], + t = i[1], r = i[2], e = i[3], u = i[4], f = i[9] = i[9] === T ? c ? 0 : n.length : Ui(i[9] - a, 0), !f && 24 & t && (t &= -25), Ue((h ? co : yo)(t && 1 != t ? 8 == t || 16 == t ? Kr(n, t, f) : 32 != t && 33 != t || u.length ? Jr.apply(T, i) : te(n, t, r, e) : Pr(n, t, r), i), n, t) + } function ce(n, t, r, e) { return n === T || lu(n, ei[r]) && !oi.call(e, r) ? t : n } function ae(n, t, r, e, u, i) { return du(n) && du(t) && (i.set(t, n), Yt(n, t, T, ae, i), i.delete(t)), n } function le(n) { return xu(n) ? T : n } function se(n, t, r, e, u, i) { + var o = 1 & r, f = n.length, c = t.length; if (f != c && !(o && c > f)) return false; if ((c = i.get(n)) && i.get(t)) return c == t; + var c = -1, a = true, l = 2 & r ? new Nn : T; for (i.set(n, t), i.set(t, n); ++c < f;) { var s = n[c], p = t[c]; if (e) var _ = o ? e(p, s, c, t, n, i) : e(s, p, c, n, t, i); if (_ !== T) { if (_) continue; a = false; break } if (l) { if (!h(t, function (n, t) { if (!O(l, t) && (s === n || u(s, n, r, e, i))) return l.push(t) })) { a = false; break } } else if (s !== p && !u(s, p, r, e, i)) { a = false; break } } return i.delete(n), i.delete(t), a + } function he(n, t, r, e, u, i, o) { + switch (r) { + case "[object DataView]": if (n.byteLength != t.byteLength || n.byteOffset != t.byteOffset) break; n = n.buffer, t = t.buffer; case "[object ArrayBuffer]": + if (n.byteLength != t.byteLength || !i(new vi(n), new vi(t))) break; return true; case "[object Boolean]": case "[object Date]": case "[object Number]": return lu(+n, +t); case "[object Error]": return n.name == t.name && n.message == t.message; case "[object RegExp]": case "[object String]": return n == t + ""; case "[object Map]": var f = W; case "[object Set]": if (f || (f = U), n.size != t.size && !(1 & e)) break; return (r = o.get(n)) ? r == t : (e |= 2, o.set(n, t), t = se(f(n), f(t), e, u, i, o), o.delete(n), t); case "[object Symbol]": if (to) return to.call(n) == to.call(t) + } + return false + } function pe(n) { return xo(Be(n, T, Ze), n + "") } function _e(n) { return St(n, Wu, po) } function ve(n) { return St(n, Bu, _o) } function ge(n) { for (var t = n.name + "", r = Gi[t], e = oi.call(Gi, t) ? r.length : 0; e--;) { var u = r[e], i = u.func; if (null == i || i == n) return u.name } return t } function de(n) { return (oi.call(An, "placeholder") ? An : n).placeholder } function ye() { var n = An.iteratee || Fu, n = n === Fu ? qt : n; return arguments.length ? n(arguments[0], arguments[1]) : n } function be(n, t) { + var r = n.__data__, e = typeof t; return ("string" == e || "number" == e || "symbol" == e || "boolean" == e ? "__proto__" !== t : null === t) ? r[typeof t == "string" ? "string" : "hash"] : r.map; + } function xe(n) { for (var t = Wu(n), r = t.length; r--;) { var e = t[r], u = n[e]; t[r] = [e, u, u === u && !du(u)]; } return t } function je(n, t) { var r = null == n ? T : n[t]; return Ft(r) ? r : T } function we(n, t, r) { t = Sr(t, n); for (var e = -1, u = t.length, i = false; ++e < u;) { var o = Me(t[e]); if (!(i = null != n && r(n, o))) break; n = n[o]; } return i || ++e != u ? i : (u = null == n ? 0 : n.length, !!u && gu(u) && Se(o, u) && (ff(n) || of(n))) } function me(n) { var t = n.length, r = new n.constructor(t); return t && "string" == typeof n[0] && oi.call(n, "index") && (r.index = n.index, r.input = n.input), r } function Ae(n) { + return typeof n.constructor != "function" || ze(n) ? {} : eo(di(n)) + } function Ee(n, t, r) { + var e = n.constructor; switch (t) { + case "[object ArrayBuffer]": return Rr(n); case "[object Boolean]": case "[object Date]": return new e(+n); case "[object DataView]": return t = r ? Rr(n.buffer) : n.buffer, new n.constructor(t, n.byteOffset, n.byteLength); case "[object Float32Array]": case "[object Float64Array]": case "[object Int8Array]": case "[object Int16Array]": case "[object Int32Array]": case "[object Uint8Array]": case "[object Uint8ClampedArray]": + case "[object Uint16Array]": case "[object Uint32Array]": return zr(n, r); case "[object Map]": return new e; case "[object Number]": case "[object String]": return new e(n); case "[object RegExp]": return t = new n.constructor(n.source, _n.exec(n)), t.lastIndex = n.lastIndex, t; case "[object Set]": return new e; case "[object Symbol]": return to ? Qu(to.call(n)) : {} + } + } function ke(n) { return ff(n) || of(n) || !!(ji && n && n[ji]) } function Se(n, t) { + var r = typeof n; return t = null == t ? 9007199254740991 : t, !!t && ("number" == r || "symbol" != r && bn.test(n)) && -1 < n && 0 == n % 1 && n < t; + } function Oe(n, t, r) { if (!du(r)) return false; var e = typeof t; return !!("number" == e ? su(r) && Se(t, r.length) : "string" == e && t in r) && lu(r[t], n) } function Ie(n, t) { if (ff(n)) return false; var r = typeof n; return !("number" != r && "symbol" != r && "boolean" != r && null != n && !wu(n)) || (nn.test(n) || !X.test(n) || null != t && n in Qu(t)) } function Re(n) { var t = ge(n), r = An[t]; return typeof r == "function" && t in Un.prototype && (n === r || (t = ho(r), !!t && n === t[0])) } function ze(n) { var t = n && n.constructor; return n === (typeof t == "function" && t.prototype || ei) } function We(n, t) { + return function (r) { return null != r && (r[n] === t && (t !== T || n in Qu(r))) } + } function Be(t, r, e) { return r = Ui(r === T ? t.length - 1 : r, 0), function () { for (var u = arguments, i = -1, o = Ui(u.length - r, 0), f = Ku(o); ++i < o;)f[i] = u[r + i]; for (i = -1, o = Ku(r + 1); ++i < r;)o[i] = u[i]; return o[r] = e(f), n(t, this, o) } } function Le(n, t) { if (("constructor" !== t || "function" != typeof n[t]) && "__proto__" != t) return n[t] } function Ue(n, t, r) { + var e = t + ""; t = xo; var u, i = $e; return u = (u = e.match(an)) ? u[1].split(ln) : [], r = i(u, r), (i = r.length) && (u = i - 1, r[u] = (1 < i ? "& " : "") + r[u], + r = r.join(2 < i ? ", " : " "), e = e.replace(cn, "{\n/* [wrapped with " + r + "] */\n")), t(n, e) + } function Ce(n) { var t = 0, r = 0; return function () { var e = Di(), u = 16 - (e - r); if (r = e, 0 < u) { if (800 <= ++t) return arguments[0] } else t = 0; return n.apply(T, arguments) } } function De(n, t) { var r = -1, e = n.length, u = e - 1; for (t = t === T ? e : t; ++r < t;) { var e = ir(r, u), i = n[e]; n[e] = n[r], n[r] = i; } return n.length = t, n } function Me(n) { if (typeof n == "string" || wu(n)) return n; var t = n + ""; return "0" == t && 1 / n == -$ ? "-0" : t } function Te(n) { + if (null != n) { + try { return ii.call(n) } catch (n) { } + return n + "" + } return "" + } function $e(n, t) { return r(N, function (r) { var e = "_." + r[0]; t & r[1] && !o(n, e) && n.push(e); }), n.sort() } function Fe(n) { if (n instanceof Un) return n.clone(); var t = new On(n.__wrapped__, n.__chain__); return t.__actions__ = Ur(n.__actions__), t.__index__ = n.__index__, t.__values__ = n.__values__, t } function Ne(n, t, r) { var e = null == n ? 0 : n.length; return e ? (r = null == r ? 0 : Eu(r), 0 > r && (r = Ui(e + r, 0)), _(n, ye(t, 3), r)) : -1 } function Pe(n, t, r) { + var e = null == n ? 0 : n.length; if (!e) return -1; var u = e - 1; return r !== T && (u = Eu(r), u = 0 > r ? Ui(e + u, 0) : Ci(u, e - 1)), + _(n, ye(t, 3), u, true) + } function Ze(n) { return (null == n ? 0 : n.length) ? wt(n, 1) : [] } function qe(n) { return n && n.length ? n[0] : T } function Ve(n) { var t = null == n ? 0 : n.length; return t ? n[t - 1] : T } function Ke(n, t) { return n && n.length && t && t.length ? er(n, t) : n } function Ge(n) { return null == n ? n : $i.call(n) } function He(n) { if (!n || !n.length) return []; var t = 0; return n = i(n, function (n) { if (hu(n)) return t = Ui(n.length, t), true }), A(t, function (t) { return c(n, b(t)) }) } function Je(t, r) { + if (!t || !t.length) return []; var e = He(t); return null == r ? e : c(e, function (t) { + return n(r, T, t) + }) + } function Ye(n) { return n = An(n), n.__chain__ = true, n } function Qe(n, t) { return t(n) } function Xe() { return this } function nu(n, t) { return (ff(n) ? r : uo)(n, ye(t, 3)) } function tu(n, t) { return (ff(n) ? e : io)(n, ye(t, 3)) } function ru(n, t) { return (ff(n) ? c : Gt)(n, ye(t, 3)) } function eu(n, t, r) { return t = r ? T : t, t = n && null == t ? n.length : t, fe(n, 128, T, T, T, T, t) } function uu(n, t) { + var r; if (typeof t != "function") throw new ti("Expected a function"); return n = Eu(n), function () { + return 0 < --n && (r = t.apply(this, arguments)), 1 >= n && (t = T), + r + } + } function iu(n, t, r) { return t = r ? T : t, n = fe(n, 8, T, T, T, T, T, t), n.placeholder = iu.placeholder, n } function ou(n, t, r) { return t = r ? T : t, n = fe(n, 16, T, T, T, T, T, t), n.placeholder = ou.placeholder, n } function fu(n, t, r) { + function e(t) { var r = c, e = a; return c = a = T, _ = t, s = n.apply(e, r) } function u(n) { var r = n - p; return n -= _, p === T || r >= t || 0 > r || g && n >= l } function i() { var n = Go(); if (u(n)) return o(n); var r, e = bo; r = n - _, n = t - (n - p), r = g ? Ci(n, l - r) : n, h = e(i, r); } function o(n) { return h = T, d && c ? e(n) : (c = a = T, s) } function f() { + var n = Go(), r = u(n); if (c = arguments, + a = this, p = n, r) { if (h === T) return _ = n = p, h = bo(i, t), v ? e(n) : s; if (g) return lo(h), h = bo(i, t), e(p) } return h === T && (h = bo(i, t)), s + } var c, a, l, s, h, p, _ = 0, v = false, g = false, d = true; if (typeof n != "function") throw new ti("Expected a function"); return t = Su(t) || 0, du(r) && (v = !!r.leading, l = (g = "maxWait" in r) ? Ui(Su(r.maxWait) || 0, t) : l, d = "trailing" in r ? !!r.trailing : d), f.cancel = function () { h !== T && lo(h), _ = 0, c = p = a = h = T; }, f.flush = function () { return h === T ? s : o(Go()) }, f + } function cu(n, t) { + function r() { + var e = arguments, u = t ? t.apply(this, e) : e[0], i = r.cache; + return i.has(u) ? i.get(u) : (e = n.apply(this, e), r.cache = i.set(u, e) || i, e) + } if (typeof n != "function" || null != t && typeof t != "function") throw new ti("Expected a function"); return r.cache = new (cu.Cache || Fn), r + } function au(n) { if (typeof n != "function") throw new ti("Expected a function"); return function () { var t = arguments; switch (t.length) { case 0: return !n.call(this); case 1: return !n.call(this, t[0]); case 2: return !n.call(this, t[0], t[1]); case 3: return !n.call(this, t[0], t[1], t[2]) }return !n.apply(this, t) } } function lu(n, t) { + return n === t || n !== n && t !== t; + } function su(n) { return null != n && gu(n.length) && !_u(n) } function hu(n) { return yu(n) && su(n) } function pu(n) { if (!yu(n)) return false; var t = Ot(n); return "[object Error]" == t || "[object DOMException]" == t || typeof n.message == "string" && typeof n.name == "string" && !xu(n) } function _u(n) { return !!du(n) && (n = Ot(n), "[object Function]" == n || "[object GeneratorFunction]" == n || "[object AsyncFunction]" == n || "[object Proxy]" == n) } function vu(n) { return typeof n == "number" && n == Eu(n) } function gu(n) { + return typeof n == "number" && -1 < n && 0 == n % 1 && 9007199254740991 >= n; + } function du(n) { var t = typeof n; return null != n && ("object" == t || "function" == t) } function yu(n) { return null != n && typeof n == "object" } function bu(n) { return typeof n == "number" || yu(n) && "[object Number]" == Ot(n) } function xu(n) { return !(!yu(n) || "[object Object]" != Ot(n)) && (n = di(n), null === n || (n = oi.call(n, "constructor") && n.constructor, typeof n == "function" && n instanceof n && ii.call(n) == li)) } function ju(n) { return typeof n == "string" || !ff(n) && yu(n) && "[object String]" == Ot(n) } function wu(n) { + return typeof n == "symbol" || yu(n) && "[object Symbol]" == Ot(n); + } function mu(n) { if (!n) return []; if (su(n)) return ju(n) ? M(n) : Ur(n); if (wi && n[wi]) { n = n[wi](); for (var t, r = []; !(t = n.next()).done;)r.push(t.value); return r } return t = vo(n), ("[object Map]" == t ? W : "[object Set]" == t ? U : Uu)(n) } function Au(n) { return n ? (n = Su(n), n === $ || n === -$ ? 1.7976931348623157e308 * (0 > n ? -1 : 1) : n === n ? n : 0) : 0 === n ? n : 0 } function Eu(n) { n = Au(n); var t = n % 1; return n === n ? t ? n - t : n : 0 } function ku(n) { return n ? pt(Eu(n), 0, 4294967295) : 0 } function Su(n) { + if (typeof n == "number") return n; if (wu(n)) return F; if (du(n) && (n = typeof n.valueOf == "function" ? n.valueOf() : n, + n = du(n) ? n + "" : n), typeof n != "string") return 0 === n ? n : +n; n = n.replace(un, ""); var t = gn.test(n); return t || yn.test(n) ? Dn(n.slice(2), t ? 2 : 8) : vn.test(n) ? F : +n + } function Ou(n) { return Cr(n, Bu(n)) } function Iu(n) { return null == n ? "" : yr(n) } function Ru(n, t, r) { return n = null == n ? T : kt(n, t), n === T ? r : n } function zu(n, t) { return null != n && we(n, t, zt) } function Wu(n) { return su(n) ? qn(n) : Vt(n) } function Bu(n) { + if (su(n)) n = qn(n, true); else if (du(n)) { var t, r = ze(n), e = []; for (t in n) ("constructor" != t || !r && oi.call(n, t)) && e.push(t); n = e; } else { + if (t = [], + null != n) for (r in Qu(n)) t.push(r); n = t; + } return n + } function Lu(n, t) { if (null == n) return {}; var r = c(ve(n), function (n) { return [n] }); return t = ye(t), tr(n, r, function (n, r) { return t(n, r[0]) }) } function Uu(n) { return null == n ? [] : S(n, Wu(n)) } function Cu(n) { return $f(Iu(n).toLowerCase()) } function Du(n) { return (n = Iu(n)) && n.replace(xn, Xn).replace(Sn, "") } function Mu(n, t, r) { return n = Iu(n), t = r ? T : t, t === T ? zn.test(n) ? n.match(In) || [] : n.match(sn) || [] : n.match(t) || [] } function Tu(n) { return function () { return n } } function $u(n) { + return n; + } function Fu(n) { return qt(typeof n == "function" ? n : _t(n, 1)) } function Nu(n, t, e) { var u = Wu(t), i = Et(t, u); null != e || du(t) && (i.length || !u.length) || (e = t, t = n, n = this, i = Et(t, Wu(t))); var o = !(du(e) && "chain" in e && !e.chain), f = _u(n); return r(i, function (r) { var e = t[r]; n[r] = e, f && (n.prototype[r] = function () { var t = this.__chain__; if (o || t) { var r = n(this.__wrapped__); return (r.__actions__ = Ur(this.__actions__)).push({ func: e, args: arguments, thisArg: n }), r.__chain__ = t, r } return e.apply(n, a([this.value()], arguments)) }); }), n } function Pu() { } + function Zu(n) { return Ie(n) ? b(Me(n)) : rr(n) } function qu() { return [] } function Vu() { return false } mn = null == mn ? $n : rt.defaults($n.Object(), mn, rt.pick($n, Wn)); var Ku = mn.Array, Gu = mn.Date, Hu = mn.Error, Ju = mn.Function, Yu = mn.Math, Qu = mn.Object, Xu = mn.RegExp, ni = mn.String, ti = mn.TypeError, ri = Ku.prototype, ei = Qu.prototype, ui = mn["__core-js_shared__"], ii = Ju.prototype.toString, oi = ei.hasOwnProperty, fi = 0, ci = function () { var n = /[^.]+$/.exec(ui && ui.keys && ui.keys.IE_PROTO || ""); return n ? "Symbol(src)_1." + n : "" }(), ai = ei.toString, li = ii.call(Qu), si = $n._, hi = Xu("^" + ii.call(oi).replace(rn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), pi = Pn ? mn.Buffer : T, _i = mn.Symbol, vi = mn.Uint8Array, gi = pi ? pi.g : T, di = B(Qu.getPrototypeOf, Qu), yi = Qu.create, bi = ei.propertyIsEnumerable, xi = ri.splice, ji = _i ? _i.isConcatSpreadable : T, wi = _i ? _i.iterator : T, mi = _i ? _i.toStringTag : T, Ai = function () { + try { var n = je(Qu, "defineProperty"); return n({}, "", {}), n } catch (n) { } + }(), Ei = mn.clearTimeout !== $n.clearTimeout && mn.clearTimeout, ki = Gu && Gu.now !== $n.Date.now && Gu.now, Si = mn.setTimeout !== $n.setTimeout && mn.setTimeout, Oi = Yu.ceil, Ii = Yu.floor, Ri = Qu.getOwnPropertySymbols, zi = pi ? pi.isBuffer : T, Wi = mn.isFinite, Bi = ri.join, Li = B(Qu.keys, Qu), Ui = Yu.max, Ci = Yu.min, Di = Gu.now, Mi = mn.parseInt, Ti = Yu.random, $i = ri.reverse, Fi = je(mn, "DataView"), Ni = je(mn, "Map"), Pi = je(mn, "Promise"), Zi = je(mn, "Set"), qi = je(mn, "WeakMap"), Vi = je(Qu, "create"), Ki = qi && new qi, Gi = {}, Hi = Te(Fi), Ji = Te(Ni), Yi = Te(Pi), Qi = Te(Zi), Xi = Te(qi), no = _i ? _i.prototype : T, to = no ? no.valueOf : T, ro = no ? no.toString : T, eo = function () { + function n() { } return function (t) { return du(t) ? yi ? yi(t) : (n.prototype = t, t = new n, n.prototype = T, t) : {} } + }(); An.templateSettings = { escape: J, evaluate: Y, interpolate: Q, variable: "", imports: { _: An } }, An.prototype = En.prototype, An.prototype.constructor = An, On.prototype = eo(En.prototype), On.prototype.constructor = On, Un.prototype = eo(En.prototype), Un.prototype.constructor = Un, Mn.prototype.clear = function () { this.__data__ = Vi ? Vi(null) : {}, this.size = 0; }, Mn.prototype.delete = function (n) { + return n = this.has(n) && delete this.__data__[n], + this.size -= n ? 1 : 0, n + }, Mn.prototype.get = function (n) { var t = this.__data__; return Vi ? (n = t[n], "__lodash_hash_undefined__" === n ? T : n) : oi.call(t, n) ? t[n] : T }, Mn.prototype.has = function (n) { var t = this.__data__; return Vi ? t[n] !== T : oi.call(t, n) }, Mn.prototype.set = function (n, t) { var r = this.__data__; return this.size += this.has(n) ? 0 : 1, r[n] = Vi && t === T ? "__lodash_hash_undefined__" : t, this }, Tn.prototype.clear = function () { this.__data__ = [], this.size = 0; }, Tn.prototype.delete = function (n) { + var t = this.__data__; return n = ft(t, n), !(0 > n) && (n == t.length - 1 ? t.pop() : xi.call(t, n, 1), + --this.size, true) + }, Tn.prototype.get = function (n) { var t = this.__data__; return n = ft(t, n), 0 > n ? T : t[n][1] }, Tn.prototype.has = function (n) { return -1 < ft(this.__data__, n) }, Tn.prototype.set = function (n, t) { var r = this.__data__, e = ft(r, n); return 0 > e ? (++this.size, r.push([n, t])) : r[e][1] = t, this }, Fn.prototype.clear = function () { this.size = 0, this.__data__ = { hash: new Mn, map: new (Ni || Tn), string: new Mn }; }, Fn.prototype.delete = function (n) { return n = be(this, n).delete(n), this.size -= n ? 1 : 0, n }, Fn.prototype.get = function (n) { + return be(this, n).get(n); + }, Fn.prototype.has = function (n) { return be(this, n).has(n) }, Fn.prototype.set = function (n, t) { var r = be(this, n), e = r.size; return r.set(n, t), this.size += r.size == e ? 0 : 1, this }, Nn.prototype.add = Nn.prototype.push = function (n) { return this.__data__.set(n, "__lodash_hash_undefined__"), this }, Nn.prototype.has = function (n) { return this.__data__.has(n) }, Zn.prototype.clear = function () { this.__data__ = new Tn, this.size = 0; }, Zn.prototype.delete = function (n) { var t = this.__data__; return n = t.delete(n), this.size = t.size, n }, Zn.prototype.get = function (n) { + return this.__data__.get(n) + }, Zn.prototype.has = function (n) { return this.__data__.has(n) }, Zn.prototype.set = function (n, t) { var r = this.__data__; if (r instanceof Tn) { var e = r.__data__; if (!Ni || 199 > e.length) return e.push([n, t]), this.size = ++r.size, this; r = this.__data__ = new Fn(e); } return r.set(n, t), this.size = r.size, this }; var uo = Fr(mt), io = Fr(At, true), oo = Nr(), fo = Nr(true), co = Ki ? function (n, t) { return Ki.set(n, t), n } : $u, ao = Ai ? function (n, t) { return Ai(n, "toString", { configurable: true, enumerable: false, value: Tu(t), writable: true }) } : $u, lo = Ei || function (n) { + return $n.clearTimeout(n) + }, so = Zi && 1 / U(new Zi([, -0]))[1] == $ ? function (n) { return new Zi(n) } : Pu, ho = Ki ? function (n) { return Ki.get(n) } : Pu, po = Ri ? function (n) { return null == n ? [] : (n = Qu(n), i(Ri(n), function (t) { return bi.call(n, t) })) } : qu, _o = Ri ? function (n) { for (var t = []; n;)a(t, po(n)), n = di(n); return t } : qu, vo = Ot; (Fi && "[object DataView]" != vo(new Fi(new ArrayBuffer(1))) || Ni && "[object Map]" != vo(new Ni) || Pi && "[object Promise]" != vo(Pi.resolve()) || Zi && "[object Set]" != vo(new Zi) || qi && "[object WeakMap]" != vo(new qi)) && (vo = function (n) { + var t = Ot(n); if (n = (n = "[object Object]" == t ? n.constructor : T) ? Te(n) : "") switch (n) { case Hi: return "[object DataView]"; case Ji: return "[object Map]"; case Yi: return "[object Promise]"; case Qi: return "[object Set]"; case Xi: return "[object WeakMap]" }return t + }); var go = ui ? _u : Vu, yo = Ce(co), bo = Si || function (n, t) { return $n.setTimeout(n, t) }, xo = Ce(ao), jo = function (n) { n = cu(n, function (n) { return 500 === t.size && t.clear(), n }); var t = n.cache; return n }(function (n) { + var t = []; return 46 === n.charCodeAt(0) && t.push(""), n.replace(tn, function (n, r, e, u) { + t.push(e ? u.replace(hn, "$1") : r || n); + }), t + }), wo = fr(function (n, t) { return hu(n) ? yt(n, wt(t, 1, hu, true)) : [] }), mo = fr(function (n, t) { var r = Ve(t); return hu(r) && (r = T), hu(n) ? yt(n, wt(t, 1, hu, true), ye(r, 2)) : [] }), Ao = fr(function (n, t) { var r = Ve(t); return hu(r) && (r = T), hu(n) ? yt(n, wt(t, 1, hu, true), T, r) : [] }), Eo = fr(function (n) { var t = c(n, Er); return t.length && t[0] === n[0] ? Wt(t) : [] }), ko = fr(function (n) { var t = Ve(n), r = c(n, Er); return t === Ve(r) ? t = T : r.pop(), r.length && r[0] === n[0] ? Wt(r, ye(t, 2)) : [] }), So = fr(function (n) { + var t = Ve(n), r = c(n, Er); return (t = typeof t == "function" ? t : T) && r.pop(), + r.length && r[0] === n[0] ? Wt(r, T, t) : [] + }), Oo = fr(Ke), Io = pe(function (n, t) { var r = null == n ? 0 : n.length, e = ht(n, t); return ur(n, c(t, function (n) { return Se(n, r) ? +n : n }).sort(Wr)), e }), Ro = fr(function (n) { return br(wt(n, 1, hu, true)) }), zo = fr(function (n) { var t = Ve(n); return hu(t) && (t = T), br(wt(n, 1, hu, true), ye(t, 2)) }), Wo = fr(function (n) { var t = Ve(n), t = typeof t == "function" ? t : T; return br(wt(n, 1, hu, true), T, t) }), Bo = fr(function (n, t) { return hu(n) ? yt(n, t) : [] }), Lo = fr(function (n) { return mr(i(n, hu)) }), Uo = fr(function (n) { + var t = Ve(n); return hu(t) && (t = T), + mr(i(n, hu), ye(t, 2)) + }), Co = fr(function (n) { var t = Ve(n), t = typeof t == "function" ? t : T; return mr(i(n, hu), T, t) }), Do = fr(He), Mo = fr(function (n) { var t = n.length, t = 1 < t ? n[t - 1] : T, t = typeof t == "function" ? (n.pop(), t) : T; return Je(n, t) }), To = pe(function (n) { + function t(t) { return ht(t, n) } var r = n.length, e = r ? n[0] : 0, u = this.__wrapped__; return !(1 < r || this.__actions__.length) && u instanceof Un && Se(e) ? (u = u.slice(e, +e + (r ? 1 : 0)), u.__actions__.push({ func: Qe, args: [t], thisArg: T }), new On(u, this.__chain__).thru(function (n) { + return r && !n.length && n.push(T), + n + })) : this.thru(t) + }), $o = Tr(function (n, t, r) { oi.call(n, r) ? ++n[r] : st(n, r, 1); }), Fo = Gr(Ne), No = Gr(Pe), Po = Tr(function (n, t, r) { oi.call(n, r) ? n[r].push(t) : st(n, r, [t]); }), Zo = fr(function (t, r, e) { var u = -1, i = typeof r == "function", o = su(t) ? Ku(t.length) : []; return uo(t, function (t) { o[++u] = i ? n(r, t, e) : Lt(t, r, e); }), o }), qo = Tr(function (n, t, r) { st(n, r, t); }), Vo = Tr(function (n, t, r) { n[r ? 0 : 1].push(t); }, function () { return [[], []] }), Ko = fr(function (n, t) { + if (null == n) return []; var r = t.length; return 1 < r && Oe(n, t[0], t[1]) ? t = [] : 2 < r && Oe(t[0], t[1], t[2]) && (t = [t[0]]), + Xt(n, wt(t, 1), []) + }), Go = ki || function () { return $n.Date.now() }, Ho = fr(function (n, t, r) { var e = 1; if (r.length) var u = L(r, de(Ho)), e = 32 | e; return fe(n, e, t, r, u) }), Jo = fr(function (n, t, r) { var e = 3; if (r.length) var u = L(r, de(Jo)), e = 32 | e; return fe(t, e, n, r, u) }), Yo = fr(function (n, t) { return dt(n, 1, t) }), Qo = fr(function (n, t, r) { return dt(n, Su(t) || 0, r) }); cu.Cache = Fn; var Xo = fr(function (t, r) { + r = 1 == r.length && ff(r[0]) ? c(r[0], k(ye())) : c(wt(r, 1), k(ye())); var e = r.length; return fr(function (u) { + for (var i = -1, o = Ci(u.length, e); ++i < o;)u[i] = r[i].call(this, u[i]); + return n(t, this, u) + }) + }), nf = fr(function (n, t) { return fe(n, 32, T, t, L(t, de(nf))) }), tf = fr(function (n, t) { return fe(n, 64, T, t, L(t, de(tf))) }), rf = pe(function (n, t) { return fe(n, 256, T, T, T, t) }), ef = ee(It), uf = ee(function (n, t) { return n >= t }), of = Ut(function () { return arguments }()) ? Ut : function (n) { return yu(n) && oi.call(n, "callee") && !bi.call(n, "callee") }, ff = Ku.isArray, cf = Vn ? k(Vn) : Ct, af = zi || Vu, lf = Kn ? k(Kn) : Dt, sf = Gn ? k(Gn) : Tt, hf = Hn ? k(Hn) : Nt, pf = Jn ? k(Jn) : Pt, _f = Yn ? k(Yn) : Zt, vf = ee(Kt), gf = ee(function (n, t) { return n <= t }), df = $r(function (n, t) { + if (ze(t) || su(t)) Cr(t, Wu(t), n); else for (var r in t) oi.call(t, r) && ot(n, r, t[r]); + }), yf = $r(function (n, t) { Cr(t, Bu(t), n); }), bf = $r(function (n, t, r, e) { Cr(t, Bu(t), n, e); }), xf = $r(function (n, t, r, e) { Cr(t, Wu(t), n, e); }), jf = pe(ht), wf = fr(function (n, t) { n = Qu(n); var r = -1, e = t.length, u = 2 < e ? t[2] : T; for (u && Oe(t[0], t[1], u) && (e = 1); ++r < e;)for (var u = t[r], i = Bu(u), o = -1, f = i.length; ++o < f;) { var c = i[o], a = n[c]; (a === T || lu(a, ei[c]) && !oi.call(n, c)) && (n[c] = u[c]); } return n }), mf = fr(function (t) { return t.push(T, ae), n(Of, T, t) }), Af = Yr(function (n, t, r) { + null != t && typeof t.toString != "function" && (t = ai.call(t)), n[t] = r; + }, Tu($u)), Ef = Yr(function (n, t, r) { null != t && typeof t.toString != "function" && (t = ai.call(t)), oi.call(n, t) ? n[t].push(r) : n[t] = [r]; }, ye), kf = fr(Lt), Sf = $r(function (n, t, r) { Yt(n, t, r); }), Of = $r(function (n, t, r, e) { Yt(n, t, r, e); }), If = pe(function (n, t) { var r = {}; if (null == n) return r; var e = false; t = c(t, function (t) { return t = Sr(t, n), e || (e = 1 < t.length), t }), Cr(n, ve(n), r), e && (r = _t(r, 7, le)); for (var u = t.length; u--;)xr(r, t[u]); return r }), Rf = pe(function (n, t) { + return null == n ? {} : nr(n, t); + }), zf = oe(Wu), Wf = oe(Bu), Bf = qr(function (n, t, r) { return t = t.toLowerCase(), n + (r ? Cu(t) : t) }), Lf = qr(function (n, t, r) { return n + (r ? "-" : "") + t.toLowerCase() }), Uf = qr(function (n, t, r) { return n + (r ? " " : "") + t.toLowerCase() }), Cf = Zr("toLowerCase"), Df = qr(function (n, t, r) { return n + (r ? "_" : "") + t.toLowerCase() }), Mf = qr(function (n, t, r) { return n + (r ? " " : "") + $f(t) }), Tf = qr(function (n, t, r) { return n + (r ? " " : "") + t.toUpperCase() }), $f = Zr("toUpperCase"), Ff = fr(function (t, r) { try { return n(t, T, r) } catch (n) { return pu(n) ? n : new Hu(n) } }), Nf = pe(function (n, t) { + return r(t, function (t) { t = Me(t), st(n, t, Ho(n[t], n)); }), n + }), Pf = Hr(), Zf = Hr(true), qf = fr(function (n, t) { return function (r) { return Lt(r, n, t) } }), Vf = fr(function (n, t) { return function (r) { return Lt(n, r, t) } }), Kf = Xr(c), Gf = Xr(u), Hf = Xr(h), Jf = re(), Yf = re(true), Qf = Qr(function (n, t) { return n + t }, 0), Xf = ie("ceil"), nc = Qr(function (n, t) { return n / t }, 1), tc = ie("floor"), rc = Qr(function (n, t) { return n * t }, 1), ec = ie("round"), uc = Qr(function (n, t) { return n - t }, 0); return An.after = function (n, t) { + if (typeof t != "function") throw new ti("Expected a function"); + return n = Eu(n), function () { if (1 > --n) return t.apply(this, arguments) } + }, An.ary = eu, An.assign = df, An.assignIn = yf, An.assignInWith = bf, An.assignWith = xf, An.at = jf, An.before = uu, An.bind = Ho, An.bindAll = Nf, An.bindKey = Jo, An.castArray = function () { if (!arguments.length) return []; var n = arguments[0]; return ff(n) ? n : [n] }, An.chain = Ye, An.chunk = function (n, t, r) { if (t = (r ? Oe(n, t, r) : t === T) ? 1 : Ui(Eu(t), 0), r = null == n ? 0 : n.length, !r || 1 > t) return []; for (var e = 0, u = 0, i = Ku(Oi(r / t)); e < r;)i[u++] = hr(n, e, e += t); return i }, An.compact = function (n) { + for (var t = -1, r = null == n ? 0 : n.length, e = 0, u = []; ++t < r;) { + var i = n[t]; i && (u[e++] = i); + } return u + }, An.concat = function () { var n = arguments.length; if (!n) return []; for (var t = Ku(n - 1), r = arguments[0]; n--;)t[n - 1] = arguments[n]; return a(ff(r) ? Ur(r) : [r], wt(t, 1)) }, An.cond = function (t) { var r = null == t ? 0 : t.length, e = ye(); return t = r ? c(t, function (n) { if ("function" != typeof n[1]) throw new ti("Expected a function"); return [e(n[0]), n[1]] }) : [], fr(function (e) { for (var u = -1; ++u < r;) { var i = t[u]; if (n(i[0], this, e)) return n(i[1], this, e) } }) }, An.conforms = function (n) { return vt(_t(n, 1)) }, An.constant = Tu, + An.countBy = $o, An.create = function (n, t) { var r = eo(n); return null == t ? r : at(r, t) }, An.curry = iu, An.curryRight = ou, An.debounce = fu, An.defaults = wf, An.defaultsDeep = mf, An.defer = Yo, An.delay = Qo, An.difference = wo, An.differenceBy = mo, An.differenceWith = Ao, An.drop = function (n, t, r) { var e = null == n ? 0 : n.length; return e ? (t = r || t === T ? 1 : Eu(t), hr(n, 0 > t ? 0 : t, e)) : [] }, An.dropRight = function (n, t, r) { var e = null == n ? 0 : n.length; return e ? (t = r || t === T ? 1 : Eu(t), t = e - t, hr(n, 0, 0 > t ? 0 : t)) : [] }, An.dropRightWhile = function (n, t) { + return n && n.length ? jr(n, ye(t, 3), true, true) : []; + }, An.dropWhile = function (n, t) { return n && n.length ? jr(n, ye(t, 3), true) : [] }, An.fill = function (n, t, r, e) { var u = null == n ? 0 : n.length; if (!u) return []; for (r && typeof r != "number" && Oe(n, t, r) && (r = 0, e = u), u = n.length, r = Eu(r), 0 > r && (r = -r > u ? 0 : u + r), e = e === T || e > u ? u : Eu(e), 0 > e && (e += u), e = r > e ? 0 : ku(e); r < e;)n[r++] = t; return n }, An.filter = function (n, t) { return (ff(n) ? i : jt)(n, ye(t, 3)) }, An.flatMap = function (n, t) { return wt(ru(n, t), 1) }, An.flatMapDeep = function (n, t) { return wt(ru(n, t), $) }, An.flatMapDepth = function (n, t, r) { + return r = r === T ? 1 : Eu(r), + wt(ru(n, t), r) + }, An.flatten = Ze, An.flattenDeep = function (n) { return (null == n ? 0 : n.length) ? wt(n, $) : [] }, An.flattenDepth = function (n, t) { return null != n && n.length ? (t = t === T ? 1 : Eu(t), wt(n, t)) : [] }, An.flip = function (n) { return fe(n, 512) }, An.flow = Pf, An.flowRight = Zf, An.fromPairs = function (n) { for (var t = -1, r = null == n ? 0 : n.length, e = {}; ++t < r;) { var u = n[t]; e[u[0]] = u[1]; } return e }, An.functions = function (n) { return null == n ? [] : Et(n, Wu(n)) }, An.functionsIn = function (n) { return null == n ? [] : Et(n, Bu(n)) }, An.groupBy = Po, An.initial = function (n) { + return (null == n ? 0 : n.length) ? hr(n, 0, -1) : [] + }, An.intersection = Eo, An.intersectionBy = ko, An.intersectionWith = So, An.invert = Af, An.invertBy = Ef, An.invokeMap = Zo, An.iteratee = Fu, An.keyBy = qo, An.keys = Wu, An.keysIn = Bu, An.map = ru, An.mapKeys = function (n, t) { var r = {}; return t = ye(t, 3), mt(n, function (n, e, u) { st(r, t(n, e, u), n); }), r }, An.mapValues = function (n, t) { var r = {}; return t = ye(t, 3), mt(n, function (n, e, u) { st(r, e, t(n, e, u)); }), r }, An.matches = function (n) { return Ht(_t(n, 1)) }, An.matchesProperty = function (n, t) { return Jt(n, _t(t, 1)) }, An.memoize = cu, + An.merge = Sf, An.mergeWith = Of, An.method = qf, An.methodOf = Vf, An.mixin = Nu, An.negate = au, An.nthArg = function (n) { return n = Eu(n), fr(function (t) { return Qt(t, n) }) }, An.omit = If, An.omitBy = function (n, t) { return Lu(n, au(ye(t))) }, An.once = function (n) { return uu(2, n) }, An.orderBy = function (n, t, r, e) { return null == n ? [] : (ff(t) || (t = null == t ? [] : [t]), r = e ? T : r, ff(r) || (r = null == r ? [] : [r]), Xt(n, t, r)) }, An.over = Kf, An.overArgs = Xo, An.overEvery = Gf, An.overSome = Hf, An.partial = nf, An.partialRight = tf, An.partition = Vo, An.pick = Rf, An.pickBy = Lu, An.property = Zu, + An.propertyOf = function (n) { return function (t) { return null == n ? T : kt(n, t) } }, An.pull = Oo, An.pullAll = Ke, An.pullAllBy = function (n, t, r) { return n && n.length && t && t.length ? er(n, t, ye(r, 2)) : n }, An.pullAllWith = function (n, t, r) { return n && n.length && t && t.length ? er(n, t, T, r) : n }, An.pullAt = Io, An.range = Jf, An.rangeRight = Yf, An.rearg = rf, An.reject = function (n, t) { return (ff(n) ? i : jt)(n, au(ye(t, 3))) }, An.remove = function (n, t) { + var r = []; if (!n || !n.length) return r; var e = -1, u = [], i = n.length; for (t = ye(t, 3); ++e < i;) { + var o = n[e]; t(o, e, n) && (r.push(o), + u.push(e)); + } return ur(n, u), r + }, An.rest = function (n, t) { if (typeof n != "function") throw new ti("Expected a function"); return t = t === T ? t : Eu(t), fr(n, t) }, An.reverse = Ge, An.sampleSize = function (n, t, r) { return t = (r ? Oe(n, t, r) : t === T) ? 1 : Eu(t), (ff(n) ? et : ar)(n, t) }, An.set = function (n, t, r) { return null == n ? n : lr(n, t, r) }, An.setWith = function (n, t, r, e) { return e = typeof e == "function" ? e : T, null == n ? n : lr(n, t, r, e) }, An.shuffle = function (n) { return (ff(n) ? ut : sr)(n) }, An.slice = function (n, t, r) { + var e = null == n ? 0 : n.length; return e ? (r && typeof r != "number" && Oe(n, t, r) ? (t = 0, + r = e) : (t = null == t ? 0 : Eu(t), r = r === T ? e : Eu(r)), hr(n, t, r)) : [] + }, An.sortBy = Ko, An.sortedUniq = function (n) { return n && n.length ? gr(n) : [] }, An.sortedUniqBy = function (n, t) { return n && n.length ? gr(n, ye(t, 2)) : [] }, An.split = function (n, t, r) { return r && typeof r != "number" && Oe(n, t, r) && (t = r = T), r = r === T ? 4294967295 : r >>> 0, r ? (n = Iu(n)) && (typeof t == "string" || null != t && !hf(t)) && (t = yr(t), !t && Rn.test(n)) ? Or(M(n), 0, r) : n.split(t, r) : [] }, An.spread = function (t, r) { + if (typeof t != "function") throw new ti("Expected a function"); return r = null == r ? 0 : Ui(Eu(r), 0), + fr(function (e) { var u = e[r]; return e = Or(e, 0, r), u && a(e, u), n(t, this, e) }) + }, An.tail = function (n) { var t = null == n ? 0 : n.length; return t ? hr(n, 1, t) : [] }, An.take = function (n, t, r) { return n && n.length ? (t = r || t === T ? 1 : Eu(t), hr(n, 0, 0 > t ? 0 : t)) : [] }, An.takeRight = function (n, t, r) { var e = null == n ? 0 : n.length; return e ? (t = r || t === T ? 1 : Eu(t), t = e - t, hr(n, 0 > t ? 0 : t, e)) : [] }, An.takeRightWhile = function (n, t) { return n && n.length ? jr(n, ye(t, 3), false, true) : [] }, An.takeWhile = function (n, t) { return n && n.length ? jr(n, ye(t, 3)) : [] }, An.tap = function (n, t) { + return t(n), + n + }, An.throttle = function (n, t, r) { var e = true, u = true; if (typeof n != "function") throw new ti("Expected a function"); return du(r) && (e = "leading" in r ? !!r.leading : e, u = "trailing" in r ? !!r.trailing : u), fu(n, t, { leading: e, maxWait: t, trailing: u }) }, An.thru = Qe, An.toArray = mu, An.toPairs = zf, An.toPairsIn = Wf, An.toPath = function (n) { return ff(n) ? c(n, Me) : wu(n) ? [n] : Ur(jo(Iu(n))) }, An.toPlainObject = Ou, An.transform = function (n, t, e) { + var u = ff(n), i = u || af(n) || _f(n); if (t = ye(t, 4), null == e) { + var o = n && n.constructor; e = i ? u ? new o : [] : du(n) && _u(o) ? eo(di(n)) : {}; + } return (i ? r : mt)(n, function (n, r, u) { return t(e, n, r, u) }), e + }, An.unary = function (n) { return eu(n, 1) }, An.union = Ro, An.unionBy = zo, An.unionWith = Wo, An.uniq = function (n) { return n && n.length ? br(n) : [] }, An.uniqBy = function (n, t) { return n && n.length ? br(n, ye(t, 2)) : [] }, An.uniqWith = function (n, t) { return t = typeof t == "function" ? t : T, n && n.length ? br(n, T, t) : [] }, An.unset = function (n, t) { return null == n || xr(n, t) }, An.unzip = He, An.unzipWith = Je, An.update = function (n, t, r) { return null == n ? n : lr(n, t, kr(r)(kt(n, t)), void 0) }, An.updateWith = function (n, t, r, e) { + return e = typeof e == "function" ? e : T, null != n && (n = lr(n, t, kr(r)(kt(n, t)), e)), n + }, An.values = Uu, An.valuesIn = function (n) { return null == n ? [] : S(n, Bu(n)) }, An.without = Bo, An.words = Mu, An.wrap = function (n, t) { return nf(kr(t), n) }, An.xor = Lo, An.xorBy = Uo, An.xorWith = Co, An.zip = Do, An.zipObject = function (n, t) { return Ar(n || [], t || [], ot) }, An.zipObjectDeep = function (n, t) { return Ar(n || [], t || [], lr) }, An.zipWith = Mo, An.entries = zf, An.entriesIn = Wf, An.extend = yf, An.extendWith = bf, Nu(An, An), An.add = Qf, An.attempt = Ff, An.camelCase = Bf, An.capitalize = Cu, + An.ceil = Xf, An.clamp = function (n, t, r) { return r === T && (r = t, t = T), r !== T && (r = Su(r), r = r === r ? r : 0), t !== T && (t = Su(t), t = t === t ? t : 0), pt(Su(n), t, r) }, An.clone = function (n) { return _t(n, 4) }, An.cloneDeep = function (n) { return _t(n, 5) }, An.cloneDeepWith = function (n, t) { return t = typeof t == "function" ? t : T, _t(n, 5, t) }, An.cloneWith = function (n, t) { return t = typeof t == "function" ? t : T, _t(n, 4, t) }, An.conformsTo = function (n, t) { return null == t || gt(n, t, Wu(t)) }, An.deburr = Du, An.defaultTo = function (n, t) { return null == n || n !== n ? t : n }, An.divide = nc, An.endsWith = function (n, t, r) { + n = Iu(n), t = yr(t); var e = n.length, e = r = r === T ? e : pt(Eu(r), 0, e); return r -= t.length, 0 <= r && n.slice(r, e) == t + }, An.eq = lu, An.escape = function (n) { return (n = Iu(n)) && H.test(n) ? n.replace(K, nt) : n }, An.escapeRegExp = function (n) { return (n = Iu(n)) && en.test(n) ? n.replace(rn, "\\$&") : n }, An.every = function (n, t, r) { var e = ff(n) ? u : bt; return r && Oe(n, t, r) && (t = T), e(n, ye(t, 3)) }, An.find = Fo, An.findIndex = Ne, An.findKey = function (n, t) { return p(n, ye(t, 3), mt) }, An.findLast = No, An.findLastIndex = Pe, An.findLastKey = function (n, t) { + return p(n, ye(t, 3), At); + }, An.floor = tc, An.forEach = nu, An.forEachRight = tu, An.forIn = function (n, t) { return null == n ? n : oo(n, ye(t, 3), Bu) }, An.forInRight = function (n, t) { return null == n ? n : fo(n, ye(t, 3), Bu) }, An.forOwn = function (n, t) { return n && mt(n, ye(t, 3)) }, An.forOwnRight = function (n, t) { return n && At(n, ye(t, 3)) }, An.get = Ru, An.gt = ef, An.gte = uf, An.has = function (n, t) { return null != n && we(n, t, Rt) }, An.hasIn = zu, An.head = qe, An.identity = $u, An.includes = function (n, t, r, e) { + return n = su(n) ? n : Uu(n), r = r && !e ? Eu(r) : 0, e = n.length, 0 > r && (r = Ui(e + r, 0)), ju(n) ? r <= e && -1 < n.indexOf(t, r) : !!e && -1 < v(n, t, r); + }, An.indexOf = function (n, t, r) { var e = null == n ? 0 : n.length; return e ? (r = null == r ? 0 : Eu(r), 0 > r && (r = Ui(e + r, 0)), v(n, t, r)) : -1 }, An.inRange = function (n, t, r) { return t = Au(t), r === T ? (r = t, t = 0) : r = Au(r), n = Su(n), n >= Ci(t, r) && n < Ui(t, r) }, An.invoke = kf, An.isArguments = of, An.isArray = ff, An.isArrayBuffer = cf, An.isArrayLike = su, An.isArrayLikeObject = hu, An.isBoolean = function (n) { return true === n || false === n || yu(n) && "[object Boolean]" == Ot(n) }, An.isBuffer = af, An.isDate = lf, An.isElement = function (n) { return yu(n) && 1 === n.nodeType && !xu(n) }, An.isEmpty = function (n) { + if (null == n) return true; if (su(n) && (ff(n) || typeof n == "string" || typeof n.splice == "function" || af(n) || _f(n) || of(n))) return !n.length; var t = vo(n); if ("[object Map]" == t || "[object Set]" == t) return !n.size; if (ze(n)) return !Vt(n).length; for (var r in n) if (oi.call(n, r)) return false; return true + }, An.isEqual = function (n, t) { return Mt(n, t) }, An.isEqualWith = function (n, t, r) { var e = (r = typeof r == "function" ? r : T) ? r(n, t) : T; return e === T ? Mt(n, t, T, r) : !!e }, An.isError = pu, An.isFinite = function (n) { return typeof n == "number" && Wi(n) }, An.isFunction = _u, + An.isInteger = vu, An.isLength = gu, An.isMap = sf, An.isMatch = function (n, t) { return n === t || $t(n, t, xe(t)) }, An.isMatchWith = function (n, t, r) { return r = typeof r == "function" ? r : T, $t(n, t, xe(t), r) }, An.isNaN = function (n) { return bu(n) && n != +n }, An.isNative = function (n) { if (go(n)) throw new Hu("Unsupported core-js use. Try https://npms.io/search?q=ponyfill."); return Ft(n) }, An.isNil = function (n) { return null == n }, An.isNull = function (n) { return null === n }, An.isNumber = bu, An.isObject = du, An.isObjectLike = yu, An.isPlainObject = xu, An.isRegExp = hf, + An.isSafeInteger = function (n) { return vu(n) && -9007199254740991 <= n && 9007199254740991 >= n }, An.isSet = pf, An.isString = ju, An.isSymbol = wu, An.isTypedArray = _f, An.isUndefined = function (n) { return n === T }, An.isWeakMap = function (n) { return yu(n) && "[object WeakMap]" == vo(n) }, An.isWeakSet = function (n) { return yu(n) && "[object WeakSet]" == Ot(n) }, An.join = function (n, t) { return null == n ? "" : Bi.call(n, t) }, An.kebabCase = Lf, An.last = Ve, An.lastIndexOf = function (n, t, r) { + var e = null == n ? 0 : n.length; if (!e) return -1; var u = e; if (r !== T && (u = Eu(r), u = 0 > u ? Ui(e + u, 0) : Ci(u, e - 1)), + t === t) { for (r = u + 1; r-- && n[r] !== t;); n = r; } else n = _(n, d, u, true); return n + }, An.lowerCase = Uf, An.lowerFirst = Cf, An.lt = vf, An.lte = gf, An.max = function (n) { return n && n.length ? xt(n, $u, It) : T }, An.maxBy = function (n, t) { return n && n.length ? xt(n, ye(t, 2), It) : T }, An.mean = function (n) { return y(n, $u) }, An.meanBy = function (n, t) { return y(n, ye(t, 2)) }, An.min = function (n) { return n && n.length ? xt(n, $u, Kt) : T }, An.minBy = function (n, t) { return n && n.length ? xt(n, ye(t, 2), Kt) : T }, An.stubArray = qu, An.stubFalse = Vu, An.stubObject = function () { return {} }, An.stubString = function () { + return "" + }, An.stubTrue = function () { return true }, An.multiply = rc, An.nth = function (n, t) { return n && n.length ? Qt(n, Eu(t)) : T }, An.noConflict = function () { return $n._ === this && ($n._ = si), this }, An.noop = Pu, An.now = Go, An.pad = function (n, t, r) { n = Iu(n); var e = (t = Eu(t)) ? D(n) : 0; return !t || e >= t ? n : (t = (t - e) / 2, ne(Ii(t), r) + n + ne(Oi(t), r)) }, An.padEnd = function (n, t, r) { n = Iu(n); var e = (t = Eu(t)) ? D(n) : 0; return t && e < t ? n + ne(t - e, r) : n }, An.padStart = function (n, t, r) { n = Iu(n); var e = (t = Eu(t)) ? D(n) : 0; return t && e < t ? ne(t - e, r) + n : n }, An.parseInt = function (n, t, r) { + return r || null == t ? t = 0 : t && (t = +t), Mi(Iu(n).replace(on, ""), t || 0) + }, An.random = function (n, t, r) { if (r && typeof r != "boolean" && Oe(n, t, r) && (t = r = T), r === T && (typeof t == "boolean" ? (r = t, t = T) : typeof n == "boolean" && (r = n, n = T)), n === T && t === T ? (n = 0, t = 1) : (n = Au(n), t === T ? (t = n, n = 0) : t = Au(t)), n > t) { var e = n; n = t, t = e; } return r || n % 1 || t % 1 ? (r = Ti(), Ci(n + r * (t - n + Cn("1e-" + ((r + "").length - 1))), t)) : ir(n, t) }, An.reduce = function (n, t, r) { var e = ff(n) ? l : j, u = 3 > arguments.length; return e(n, ye(t, 4), r, u, uo) }, An.reduceRight = function (n, t, r) { + var e = ff(n) ? s : j, u = 3 > arguments.length; + return e(n, ye(t, 4), r, u, io) + }, An.repeat = function (n, t, r) { return t = (r ? Oe(n, t, r) : t === T) ? 1 : Eu(t), or(Iu(n), t) }, An.replace = function () { var n = arguments, t = Iu(n[0]); return 3 > n.length ? t : t.replace(n[1], n[2]) }, An.result = function (n, t, r) { t = Sr(t, n); var e = -1, u = t.length; for (u || (u = 1, n = T); ++e < u;) { var i = null == n ? T : n[Me(t[e])]; i === T && (e = u, i = r), n = _u(i) ? i.call(n) : i; } return n }, An.round = ec, An.runInContext = x, An.sample = function (n) { return (ff(n) ? Qn : cr)(n) }, An.size = function (n) { + if (null == n) return 0; if (su(n)) return ju(n) ? D(n) : n.length; + var t = vo(n); return "[object Map]" == t || "[object Set]" == t ? n.size : Vt(n).length + }, An.snakeCase = Df, An.some = function (n, t, r) { var e = ff(n) ? h : pr; return r && Oe(n, t, r) && (t = T), e(n, ye(t, 3)) }, An.sortedIndex = function (n, t) { return _r(n, t) }, An.sortedIndexBy = function (n, t, r) { return vr(n, t, ye(r, 2)) }, An.sortedIndexOf = function (n, t) { var r = null == n ? 0 : n.length; if (r) { var e = _r(n, t); if (e < r && lu(n[e], t)) return e } return -1 }, An.sortedLastIndex = function (n, t) { return _r(n, t, true) }, An.sortedLastIndexBy = function (n, t, r) { + return vr(n, t, ye(r, 2), true); + }, An.sortedLastIndexOf = function (n, t) { if (null == n ? 0 : n.length) { var r = _r(n, t, true) - 1; if (lu(n[r], t)) return r } return -1 }, An.startCase = Mf, An.startsWith = function (n, t, r) { return n = Iu(n), r = null == r ? 0 : pt(Eu(r), 0, n.length), t = yr(t), n.slice(r, r + t.length) == t }, An.subtract = uc, An.sum = function (n) { return n && n.length ? m(n, $u) : 0 }, An.sumBy = function (n, t) { return n && n.length ? m(n, ye(t, 2)) : 0 }, An.template = function (n, t, r) { + var e = An.templateSettings; r && Oe(n, t, r) && (t = T), n = Iu(n), t = bf({}, t, e, ce), r = bf({}, t.imports, e.imports, ce); var u, i, o = Wu(r), f = S(r, o), c = 0; + r = t.interpolate || jn; var a = "__p+='"; r = Xu((t.escape || jn).source + "|" + r.source + "|" + (r === Q ? pn : jn).source + "|" + (t.evaluate || jn).source + "|$", "g"); var l = oi.call(t, "sourceURL") ? "//# sourceURL=" + (t.sourceURL + "").replace(/[\r\n]/g, " ") + "\n" : ""; if (n.replace(r, function (t, r, e, o, f, l) { return e || (e = o), a += n.slice(c, l).replace(wn, z), r && (u = true, a += "'+__e(" + r + ")+'"), f && (i = true, a += "';" + f + ";\n__p+='"), e && (a += "'+((__t=(" + e + "))==null?'':__t)+'"), c = l + t.length, t }), a += "';", (t = oi.call(t, "variable") && t.variable) || (a = "with(obj){" + a + "}"), + a = (i ? a.replace(P, "") : a).replace(Z, "$1").replace(q, "$1;"), a = "function(" + (t || "obj") + "){" + (t ? "" : "obj||(obj={});") + "var __t,__p=''" + (u ? ",__e=_.escape" : "") + (i ? ",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}" : ";") + a + "return __p}", t = Ff(function () { return Ju(o, l + "return " + a).apply(T, f) }), t.source = a, pu(t)) throw t; return t + }, An.times = function (n, t) { if (n = Eu(n), 1 > n || 9007199254740991 < n) return []; var r = 4294967295, e = Ci(n, 4294967295); for (t = ye(t), n -= 4294967295, e = A(e, t); ++r < n;)t(r); return e }, An.toFinite = Au, + An.toInteger = Eu, An.toLength = ku, An.toLower = function (n) { return Iu(n).toLowerCase() }, An.toNumber = Su, An.toSafeInteger = function (n) { return n ? pt(Eu(n), -9007199254740991, 9007199254740991) : 0 === n ? n : 0 }, An.toString = Iu, An.toUpper = function (n) { return Iu(n).toUpperCase() }, An.trim = function (n, t, r) { return (n = Iu(n)) && (r || t === T) ? n.replace(un, "") : n && (t = yr(t)) ? (n = M(n), r = M(t), t = I(n, r), r = R(n, r) + 1, Or(n, t, r).join("")) : n }, An.trimEnd = function (n, t, r) { + return (n = Iu(n)) && (r || t === T) ? n.replace(fn, "") : n && (t = yr(t)) ? (n = M(n), t = R(n, M(t)) + 1, + Or(n, 0, t).join("")) : n + }, An.trimStart = function (n, t, r) { return (n = Iu(n)) && (r || t === T) ? n.replace(on, "") : n && (t = yr(t)) ? (n = M(n), t = I(n, M(t)), Or(n, t).join("")) : n }, An.truncate = function (n, t) { + var r = 30, e = "..."; if (du(t)) var u = "separator" in t ? t.separator : u, r = "length" in t ? Eu(t.length) : r, e = "omission" in t ? yr(t.omission) : e; n = Iu(n); var i = n.length; if (Rn.test(n)) var o = M(n), i = o.length; if (r >= i) return n; if (i = r - D(e), 1 > i) return e; if (r = o ? Or(o, 0, i).join("") : n.slice(0, i), u === T) return r + e; if (o && (i += r.length - i), hf(u)) { + if (n.slice(i).search(u)) { + var f = r; for (u.global || (u = Xu(u.source, Iu(_n.exec(u)) + "g")), u.lastIndex = 0; o = u.exec(f);)var c = o.index; r = r.slice(0, c === T ? i : c); + } + } else n.indexOf(yr(u), i) != i && (u = r.lastIndexOf(u), -1 < u && (r = r.slice(0, u))); return r + e + }, An.unescape = function (n) { return (n = Iu(n)) && G.test(n) ? n.replace(V, tt) : n }, An.uniqueId = function (n) { var t = ++fi; return Iu(n) + t }, An.upperCase = Tf, An.upperFirst = $f, An.each = nu, An.eachRight = tu, An.first = qe, Nu(An, function () { var n = {}; return mt(An, function (t, r) { oi.call(An.prototype, r) || (n[r] = t); }), n }(), { + chain: false + }), An.VERSION = "4.17.15", r("bind bindKey curry curryRight partial partialRight".split(" "), function (n) { An[n].placeholder = An; }), r(["drop", "take"], function (n, t) { Un.prototype[n] = function (r) { r = r === T ? 1 : Ui(Eu(r), 0); var e = this.__filtered__ && !t ? new Un(this) : this.clone(); return e.__filtered__ ? e.__takeCount__ = Ci(r, e.__takeCount__) : e.__views__.push({ size: Ci(r, 4294967295), type: n + (0 > e.__dir__ ? "Right" : "") }), e }, Un.prototype[n + "Right"] = function (t) { return this.reverse()[n](t).reverse() }; }), r(["filter", "map", "takeWhile"], function (n, t) { + var r = t + 1, e = 1 == r || 3 == r; Un.prototype[n] = function (n) { var t = this.clone(); return t.__iteratees__.push({ iteratee: ye(n, 3), type: r }), t.__filtered__ = t.__filtered__ || e, t }; + }), r(["head", "last"], function (n, t) { var r = "take" + (t ? "Right" : ""); Un.prototype[n] = function () { return this[r](1).value()[0] }; }), r(["initial", "tail"], function (n, t) { var r = "drop" + (t ? "" : "Right"); Un.prototype[n] = function () { return this.__filtered__ ? new Un(this) : this[r](1) }; }), Un.prototype.compact = function () { return this.filter($u) }, Un.prototype.find = function (n) { + return this.filter(n).head() + }, Un.prototype.findLast = function (n) { return this.reverse().find(n) }, Un.prototype.invokeMap = fr(function (n, t) { return typeof n == "function" ? new Un(this) : this.map(function (r) { return Lt(r, n, t) }) }), Un.prototype.reject = function (n) { return this.filter(au(ye(n))) }, Un.prototype.slice = function (n, t) { n = Eu(n); var r = this; return r.__filtered__ && (0 < n || 0 > t) ? new Un(r) : (0 > n ? r = r.takeRight(-n) : n && (r = r.drop(n)), t !== T && (t = Eu(t), r = 0 > t ? r.dropRight(-t) : r.take(t - n)), r) }, Un.prototype.takeRightWhile = function (n) { + return this.reverse().takeWhile(n).reverse() + }, Un.prototype.toArray = function () { return this.take(4294967295) }, mt(Un.prototype, function (n, t) { + var r = /^(?:filter|find|map|reject)|While$/.test(t), e = /^(?:head|last)$/.test(t), u = An[e ? "take" + ("last" == t ? "Right" : "") : t], i = e || /^find/.test(t); u && (An.prototype[t] = function () { + function t(n) { return n = u.apply(An, a([n], f)), e && h ? n[0] : n } var o = this.__wrapped__, f = e ? [1] : arguments, c = o instanceof Un, l = f[0], s = c || ff(o); s && r && typeof l == "function" && 1 != l.length && (c = s = false); var h = this.__chain__, p = !!this.__actions__.length, l = i && !h, c = c && !p; + return !i && s ? (o = c ? o : new Un(this), o = n.apply(o, f), o.__actions__.push({ func: Qe, args: [t], thisArg: T }), new On(o, h)) : l && c ? n.apply(this, f) : (o = this.thru(t), l ? e ? o.value()[0] : o.value() : o) + }); + }), r("pop push shift sort splice unshift".split(" "), function (n) { + var t = ri[n], r = /^(?:push|sort|unshift)$/.test(n) ? "tap" : "thru", e = /^(?:pop|shift)$/.test(n); An.prototype[n] = function () { + var n = arguments; if (e && !this.__chain__) { var u = this.value(); return t.apply(ff(u) ? u : [], n) } return this[r](function (r) { return t.apply(ff(r) ? r : [], n) }); + }; + }), mt(Un.prototype, function (n, t) { var r = An[t]; if (r) { var e = r.name + ""; oi.call(Gi, e) || (Gi[e] = []), Gi[e].push({ name: t, func: r }); } }), Gi[Jr(T, 2).name] = [{ name: "wrapper", func: T }], Un.prototype.clone = function () { var n = new Un(this.__wrapped__); return n.__actions__ = Ur(this.__actions__), n.__dir__ = this.__dir__, n.__filtered__ = this.__filtered__, n.__iteratees__ = Ur(this.__iteratees__), n.__takeCount__ = this.__takeCount__, n.__views__ = Ur(this.__views__), n }, Un.prototype.reverse = function () { + if (this.__filtered__) { + var n = new Un(this); + n.__dir__ = -1, n.__filtered__ = true; + } else n = this.clone(), n.__dir__ *= -1; return n + }, Un.prototype.value = function () { + var n, t = this.__wrapped__.value(), r = this.__dir__, e = ff(t), u = 0 > r, i = e ? t.length : 0; n = i; for (var o = this.__views__, f = 0, c = -1, a = o.length; ++c < a;) { var l = o[c], s = l.size; switch (l.type) { case "drop": f += s; break; case "dropRight": n -= s; break; case "take": n = Ci(n, f + s); break; case "takeRight": f = Ui(f, n - s); } } if (n = { start: f, end: n }, o = n.start, f = n.end, n = f - o, o = u ? f : o - 1, f = this.__iteratees__, c = f.length, a = 0, l = Ci(n, this.__takeCount__), !e || !u && i == n && l == n) return wr(t, this.__actions__); + e = []; n: for (; n-- && a < l;) { for (o += r, u = -1, i = t[o]; ++u < c;) { var h = f[u], s = h.type, h = (0, h.iteratee)(i); if (2 == s) i = h; else if (!h) { if (1 == s) continue n; break n } } e[a++] = i; } return e + }, An.prototype.at = To, An.prototype.chain = function () { return Ye(this) }, An.prototype.commit = function () { return new On(this.value(), this.__chain__) }, An.prototype.next = function () { this.__values__ === T && (this.__values__ = mu(this.value())); var n = this.__index__ >= this.__values__.length; return { done: n, value: n ? T : this.__values__[this.__index__++] } }, An.prototype.plant = function (n) { + for (var t, r = this; r instanceof En;) { var e = Fe(r); e.__index__ = 0, e.__values__ = T, t ? u.__wrapped__ = e : t = e; var u = e, r = r.__wrapped__; } return u.__wrapped__ = n, t + }, An.prototype.reverse = function () { var n = this.__wrapped__; return n instanceof Un ? (this.__actions__.length && (n = new Un(this)), n = n.reverse(), n.__actions__.push({ func: Qe, args: [Ge], thisArg: T }), new On(n, this.__chain__)) : this.thru(Ge) }, An.prototype.toJSON = An.prototype.valueOf = An.prototype.value = function () { return wr(this.__wrapped__, this.__actions__) }, An.prototype.first = An.prototype.head, + wi && (An.prototype[wi] = Xe), An + }(); Nn ? ((Nn.exports = rt)._ = rt, Fn._ = rt) : $n._ = rt; + }).call(commonjsGlobal); + }); + + var _mapping = createCommonjsModule(function (module, exports) { /** Used to map aliases to their real names. */ exports.aliasToReal = { @@ -778,7 +1036,7 @@ var app = (function (crypto$1) { 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll', - 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse', + 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words', 'zipAll' ], @@ -966,10 +1224,10 @@ var app = (function (crypto$1) { }; /** Used to map real names to their aliases. */ - exports.realToAlias = (function() { + exports.realToAlias = (function () { var hasOwnProperty = Object.prototype.hasOwnProperty, - object = exports.aliasToReal, - result = {}; + object = exports.aliasToReal, + result = {}; for (var key in object) { var value = object[key]; @@ -1060,897 +1318,897 @@ var app = (function (crypto$1) { 'zipObject': true, 'zipObjectDeep': true }; - }); - var _mapping_1 = _mapping.aliasToReal; - var _mapping_2 = _mapping.aryMethod; - var _mapping_3 = _mapping.aryRearg; - var _mapping_4 = _mapping.iterateeAry; - var _mapping_5 = _mapping.iterateeRearg; - var _mapping_6 = _mapping.methodRearg; - var _mapping_7 = _mapping.methodSpread; - var _mapping_8 = _mapping.mutate; - var _mapping_9 = _mapping.realToAlias; - var _mapping_10 = _mapping.remap; - var _mapping_11 = _mapping.skipFixed; - var _mapping_12 = _mapping.skipRearg; + }); + var _mapping_1 = _mapping.aliasToReal; + var _mapping_2 = _mapping.aryMethod; + var _mapping_3 = _mapping.aryRearg; + var _mapping_4 = _mapping.iterateeAry; + var _mapping_5 = _mapping.iterateeRearg; + var _mapping_6 = _mapping.methodRearg; + var _mapping_7 = _mapping.methodSpread; + var _mapping_8 = _mapping.mutate; + var _mapping_9 = _mapping.realToAlias; + var _mapping_10 = _mapping.remap; + var _mapping_11 = _mapping.skipFixed; + var _mapping_12 = _mapping.skipRearg; - /** - * The default argument placeholder value for methods. - * - * @type {Object} - */ - var placeholder = {}; + /** + * The default argument placeholder value for methods. + * + * @type {Object} + */ + var placeholder = {}; - /** Built-in value reference. */ - var push = Array.prototype.push; + /** Built-in value reference. */ + var push = Array.prototype.push; - /** - * Creates a function, with an arity of `n`, that invokes `func` with the - * arguments it receives. - * - * @private - * @param {Function} func The function to wrap. - * @param {number} n The arity of the new function. - * @returns {Function} Returns the new function. - */ - function baseArity(func, n) { - return n == 2 - ? function(a, b) { return func.apply(undefined, arguments); } - : function(a) { return func.apply(undefined, arguments); }; + /** + * Creates a function, with an arity of `n`, that invokes `func` with the + * arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} n The arity of the new function. + * @returns {Function} Returns the new function. + */ + function baseArity(func, n) { + return n == 2 + ? function (a, b) { return func.apply(undefined, arguments); } + : function (a) { return func.apply(undefined, arguments); }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, ignoring + * any additional arguments. + * + * @private + * @param {Function} func The function to cap arguments for. + * @param {number} n The arity cap. + * @returns {Function} Returns the new function. + */ + function baseAry(func, n) { + return n == 2 + ? function (a, b) { return func(a, b); } + : function (a) { return func(a); }; + } + + /** + * Creates a clone of `array`. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the cloned array. + */ + function cloneArray(array) { + var length = array ? array.length : 0, + result = Array(length); + + while (length--) { + result[length] = array[length]; } + return result; + } - /** - * Creates a function that invokes `func`, with up to `n` arguments, ignoring - * any additional arguments. - * - * @private - * @param {Function} func The function to cap arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ - function baseAry(func, n) { - return n == 2 - ? function(a, b) { return func(a, b); } - : function(a) { return func(a); }; - } + /** + * Creates a function that clones a given object using the assignment `func`. + * + * @private + * @param {Function} func The assignment function. + * @returns {Function} Returns the new cloner function. + */ + function createCloner(func) { + return function (object) { + return func({}, object); + }; + } - /** - * Creates a clone of `array`. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the cloned array. - */ - function cloneArray(array) { - var length = array ? array.length : 0, - result = Array(length); + /** + * A specialized version of `_.spread` which flattens the spread array into + * the arguments of the invoked `func`. + * + * @private + * @param {Function} func The function to spread arguments over. + * @param {number} start The start position of the spread. + * @returns {Function} Returns the new function. + */ + function flatSpread(func, start) { + return function () { + var length = arguments.length, + lastIndex = length - 1, + args = Array(length); while (length--) { - result[length] = array[length]; + args[length] = arguments[length]; + } + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + push.apply(otherArgs, array); + } + if (start != lastIndex) { + push.apply(otherArgs, args.slice(start + 1)); + } + return func.apply(this, otherArgs); + }; + } + + /** + * Creates a function that wraps `func` and uses `cloner` to clone the first + * argument it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} cloner The function to clone arguments. + * @returns {Function} Returns the new immutable function. + */ + function wrapImmutable(func, cloner) { + return function () { + var length = arguments.length; + if (!length) { + return; + } + var args = Array(length); + while (length--) { + args[length] = arguments[length]; + } + var result = args[0] = cloner.apply(undefined, args); + func.apply(undefined, args); + return result; + }; + } + + /** + * The base implementation of `convert` which accepts a `util` object of methods + * required to perform conversions. + * + * @param {Object} util The util object. + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @param {Object} [options] The options object. + * @param {boolean} [options.cap=true] Specify capping iteratee arguments. + * @param {boolean} [options.curry=true] Specify currying. + * @param {boolean} [options.fixed=true] Specify fixed arity. + * @param {boolean} [options.immutable=true] Specify immutable operations. + * @param {boolean} [options.rearg=true] Specify rearranging arguments. + * @returns {Function|Object} Returns the converted function or object. + */ + function baseConvert(util, name, func, options) { + var isLib = typeof name == 'function', + isObj = name === Object(name); + + if (isObj) { + options = func; + func = name; + name = undefined; + } + if (func == null) { + throw new TypeError; + } + options || (options = {}); + + var config = { + 'cap': 'cap' in options ? options.cap : true, + 'curry': 'curry' in options ? options.curry : true, + 'fixed': 'fixed' in options ? options.fixed : true, + 'immutable': 'immutable' in options ? options.immutable : true, + 'rearg': 'rearg' in options ? options.rearg : true + }; + + var defaultHolder = isLib ? func : placeholder, + forceCurry = ('curry' in options) && options.curry, + forceFixed = ('fixed' in options) && options.fixed, + forceRearg = ('rearg' in options) && options.rearg, + pristine = isLib ? func.runInContext() : undefined; + + var helpers = isLib ? func : { + 'ary': util.ary, + 'assign': util.assign, + 'clone': util.clone, + 'curry': util.curry, + 'forEach': util.forEach, + 'isArray': util.isArray, + 'isError': util.isError, + 'isFunction': util.isFunction, + 'isWeakMap': util.isWeakMap, + 'iteratee': util.iteratee, + 'keys': util.keys, + 'rearg': util.rearg, + 'toInteger': util.toInteger, + 'toPath': util.toPath + }; + + var ary = helpers.ary, + assign = helpers.assign, + clone = helpers.clone, + curry = helpers.curry, + each = helpers.forEach, + isArray = helpers.isArray, + isError = helpers.isError, + isFunction = helpers.isFunction, + isWeakMap = helpers.isWeakMap, + keys = helpers.keys, + rearg = helpers.rearg, + toInteger = helpers.toInteger, + toPath = helpers.toPath; + + var aryMethodKeys = keys(_mapping.aryMethod); + + var wrappers = { + 'castArray': function (castArray) { + return function () { + var value = arguments[0]; + return isArray(value) + ? castArray(cloneArray(value)) + : castArray.apply(undefined, arguments); + }; + }, + 'iteratee': function (iteratee) { + return function () { + var func = arguments[0], + arity = arguments[1], + result = iteratee(func, arity), + length = result.length; + + if (config.cap && typeof arity == 'number') { + arity = arity > 2 ? (arity - 2) : 1; + return (length && length <= arity) ? result : baseAry(result, arity); + } + return result; + }; + }, + 'mixin': function (mixin) { + return function (source) { + var func = this; + if (!isFunction(func)) { + return mixin(func, Object(source)); + } + var pairs = []; + each(keys(source), function (key) { + if (isFunction(source[key])) { + pairs.push([key, func.prototype[key]]); + } + }); + + mixin(func, Object(source)); + + each(pairs, function (pair) { + var value = pair[1]; + if (isFunction(value)) { + func.prototype[pair[0]] = value; + } else { + delete func.prototype[pair[0]]; + } + }); + return func; + }; + }, + 'nthArg': function (nthArg) { + return function (n) { + var arity = n < 0 ? 1 : (toInteger(n) + 1); + return curry(nthArg(n), arity); + }; + }, + 'rearg': function (rearg) { + return function (func, indexes) { + var arity = indexes ? indexes.length : 0; + return curry(rearg(func, indexes), arity); + }; + }, + 'runInContext': function (runInContext) { + return function (context) { + return baseConvert(util, runInContext(context), options); + }; + } + }; + + /*--------------------------------------------------------------------------*/ + + /** + * Casts `func` to a function with an arity capped iteratee if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @returns {Function} Returns the cast function. + */ + function castCap(name, func) { + if (config.cap) { + var indexes = _mapping.iterateeRearg[name]; + if (indexes) { + return iterateeRearg(func, indexes); + } + var n = !isLib && _mapping.iterateeAry[name]; + if (n) { + return iterateeAry(func, n); + } + } + return func; + } + + /** + * Casts `func` to a curried function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castCurry(name, func, n) { + return (forceCurry || (config.curry && n > 1)) + ? curry(func, n) + : func; + } + + /** + * Casts `func` to a fixed arity function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity cap. + * @returns {Function} Returns the cast function. + */ + function castFixed(name, func, n) { + if (config.fixed && (forceFixed || !_mapping.skipFixed[name])) { + var data = _mapping.methodSpread[name], + start = data && data.start; + + return start === undefined ? ary(func, n) : flatSpread(func, start); + } + return func; + } + + /** + * Casts `func` to an rearged function if needed. + * + * @private + * @param {string} name The name of the function to inspect. + * @param {Function} func The function to inspect. + * @param {number} n The arity of `func`. + * @returns {Function} Returns the cast function. + */ + function castRearg(name, func, n) { + return (config.rearg && n > 1 && (forceRearg || !_mapping.skipRearg[name])) + ? rearg(func, _mapping.methodRearg[name] || _mapping.aryRearg[n]) + : func; + } + + /** + * Creates a clone of `object` by `path`. + * + * @private + * @param {Object} object The object to clone. + * @param {Array|string} path The path to clone by. + * @returns {Object} Returns the cloned object. + */ + function cloneByPath(object, path) { + path = toPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + result = clone(Object(object)), + nested = result; + + while (nested != null && ++index < length) { + var key = path[index], + value = nested[key]; + + if (value != null && + !(isFunction(value) || isError(value) || isWeakMap(value))) { + nested[key] = clone(index == lastIndex ? value : Object(value)); + } + nested = nested[key]; } return result; } /** - * Creates a function that clones a given object using the assignment `func`. + * Converts `lodash` to an immutable auto-curried iteratee-first data-last + * version with conversion `options` applied. * - * @private - * @param {Function} func The assignment function. - * @returns {Function} Returns the new cloner function. + * @param {Object} [options] The options object. See `baseConvert` for more details. + * @returns {Function} Returns the converted `lodash`. */ - function createCloner(func) { - return function(object) { - return func({}, object); + function convertLib(options) { + return _.runInContext.convert(options)(undefined); + } + + /** + * Create a converter function for `func` of `name`. + * + * @param {string} name The name of the function to convert. + * @param {Function} func The function to convert. + * @returns {Function} Returns the new converter function. + */ + function createConverter(name, func) { + var realName = _mapping.aliasToReal[name] || name, + methodName = _mapping.remap[realName] || realName, + oldOptions = options; + + return function (options) { + var newUtil = isLib ? pristine : helpers, + newFunc = isLib ? pristine[methodName] : func, + newOptions = assign(assign({}, oldOptions), options); + + return baseConvert(newUtil, realName, newFunc, newOptions); }; } /** - * A specialized version of `_.spread` which flattens the spread array into - * the arguments of the invoked `func`. + * Creates a function that wraps `func` to invoke its iteratee, with up to `n` + * arguments, ignoring any additional arguments. * * @private - * @param {Function} func The function to spread arguments over. - * @param {number} start The start position of the spread. + * @param {Function} func The function to cap iteratee arguments for. + * @param {number} n The arity cap. * @returns {Function} Returns the new function. */ - function flatSpread(func, start) { - return function() { - var length = arguments.length, - lastIndex = length - 1, - args = Array(length); - - while (length--) { - args[length] = arguments[length]; - } - var array = args[start], - otherArgs = args.slice(0, start); - - if (array) { - push.apply(otherArgs, array); - } - if (start != lastIndex) { - push.apply(otherArgs, args.slice(start + 1)); - } - return func.apply(this, otherArgs); - }; + function iterateeAry(func, n) { + return overArg(func, function (func) { + return typeof func == 'function' ? baseAry(func, n) : func; + }); } /** - * Creates a function that wraps `func` and uses `cloner` to clone the first - * argument it receives. + * Creates a function that wraps `func` to invoke its iteratee with arguments + * arranged according to the specified `indexes` where the argument value at + * the first index is provided as the first argument, the argument value at + * the second index is provided as the second argument, and so on. + * + * @private + * @param {Function} func The function to rearrange iteratee arguments for. + * @param {number[]} indexes The arranged argument indexes. + * @returns {Function} Returns the new function. + */ + function iterateeRearg(func, indexes) { + return overArg(func, function (func) { + var n = indexes.length; + return baseArity(rearg(baseAry(func, n), indexes), n); + }); + } + + /** + * Creates a function that invokes `func` with its first argument transformed. * * @private * @param {Function} func The function to wrap. - * @param {Function} cloner The function to clone arguments. - * @returns {Function} Returns the new immutable function. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. */ - function wrapImmutable(func, cloner) { - return function() { + function overArg(func, transform) { + return function () { var length = arguments.length; if (!length) { - return; + return func(); } var args = Array(length); while (length--) { args[length] = arguments[length]; } - var result = args[0] = cloner.apply(undefined, args); - func.apply(undefined, args); - return result; + var index = config.rearg ? 0 : (length - 1); + args[index] = transform(args[index]); + return func.apply(undefined, args); }; } /** - * The base implementation of `convert` which accepts a `util` object of methods - * required to perform conversions. + * Creates a function that wraps `func` and applys the conversions + * rules by `name`. * - * @param {Object} util The util object. - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @param {Object} [options] The options object. - * @param {boolean} [options.cap=true] Specify capping iteratee arguments. - * @param {boolean} [options.curry=true] Specify currying. - * @param {boolean} [options.fixed=true] Specify fixed arity. - * @param {boolean} [options.immutable=true] Specify immutable operations. - * @param {boolean} [options.rearg=true] Specify rearranging arguments. - * @returns {Function|Object} Returns the converted function or object. + * @private + * @param {string} name The name of the function to wrap. + * @param {Function} func The function to wrap. + * @returns {Function} Returns the converted function. */ - function baseConvert(util, name, func, options) { - var isLib = typeof name == 'function', - isObj = name === Object(name); + function wrap(name, func, placeholder) { + var result, + realName = _mapping.aliasToReal[name] || name, + wrapped = func, + wrapper = wrappers[realName]; - if (isObj) { - options = func; - func = name; - name = undefined; + if (wrapper) { + wrapped = wrapper(func); } - if (func == null) { - throw new TypeError; - } - options || (options = {}); - - var config = { - 'cap': 'cap' in options ? options.cap : true, - 'curry': 'curry' in options ? options.curry : true, - 'fixed': 'fixed' in options ? options.fixed : true, - 'immutable': 'immutable' in options ? options.immutable : true, - 'rearg': 'rearg' in options ? options.rearg : true - }; - - var defaultHolder = isLib ? func : placeholder, - forceCurry = ('curry' in options) && options.curry, - forceFixed = ('fixed' in options) && options.fixed, - forceRearg = ('rearg' in options) && options.rearg, - pristine = isLib ? func.runInContext() : undefined; - - var helpers = isLib ? func : { - 'ary': util.ary, - 'assign': util.assign, - 'clone': util.clone, - 'curry': util.curry, - 'forEach': util.forEach, - 'isArray': util.isArray, - 'isError': util.isError, - 'isFunction': util.isFunction, - 'isWeakMap': util.isWeakMap, - 'iteratee': util.iteratee, - 'keys': util.keys, - 'rearg': util.rearg, - 'toInteger': util.toInteger, - 'toPath': util.toPath - }; - - var ary = helpers.ary, - assign = helpers.assign, - clone = helpers.clone, - curry = helpers.curry, - each = helpers.forEach, - isArray = helpers.isArray, - isError = helpers.isError, - isFunction = helpers.isFunction, - isWeakMap = helpers.isWeakMap, - keys = helpers.keys, - rearg = helpers.rearg, - toInteger = helpers.toInteger, - toPath = helpers.toPath; - - var aryMethodKeys = keys(_mapping.aryMethod); - - var wrappers = { - 'castArray': function(castArray) { - return function() { - var value = arguments[0]; - return isArray(value) - ? castArray(cloneArray(value)) - : castArray.apply(undefined, arguments); - }; - }, - 'iteratee': function(iteratee) { - return function() { - var func = arguments[0], - arity = arguments[1], - result = iteratee(func, arity), - length = result.length; - - if (config.cap && typeof arity == 'number') { - arity = arity > 2 ? (arity - 2) : 1; - return (length && length <= arity) ? result : baseAry(result, arity); - } - return result; - }; - }, - 'mixin': function(mixin) { - return function(source) { - var func = this; - if (!isFunction(func)) { - return mixin(func, Object(source)); - } - var pairs = []; - each(keys(source), function(key) { - if (isFunction(source[key])) { - pairs.push([key, func.prototype[key]]); - } - }); - - mixin(func, Object(source)); - - each(pairs, function(pair) { - var value = pair[1]; - if (isFunction(value)) { - func.prototype[pair[0]] = value; - } else { - delete func.prototype[pair[0]]; - } - }); - return func; - }; - }, - 'nthArg': function(nthArg) { - return function(n) { - var arity = n < 0 ? 1 : (toInteger(n) + 1); - return curry(nthArg(n), arity); - }; - }, - 'rearg': function(rearg) { - return function(func, indexes) { - var arity = indexes ? indexes.length : 0; - return curry(rearg(func, indexes), arity); - }; - }, - 'runInContext': function(runInContext) { - return function(context) { - return baseConvert(util, runInContext(context), options); - }; + else if (config.immutable) { + if (_mapping.mutate.array[realName]) { + wrapped = wrapImmutable(func, cloneArray); } - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Casts `func` to a function with an arity capped iteratee if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @returns {Function} Returns the cast function. - */ - function castCap(name, func) { - if (config.cap) { - var indexes = _mapping.iterateeRearg[name]; - if (indexes) { - return iterateeRearg(func, indexes); - } - var n = !isLib && _mapping.iterateeAry[name]; - if (n) { - return iterateeAry(func, n); - } + else if (_mapping.mutate.object[realName]) { + wrapped = wrapImmutable(func, createCloner(func)); } - return func; - } - - /** - * Casts `func` to a curried function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castCurry(name, func, n) { - return (forceCurry || (config.curry && n > 1)) - ? curry(func, n) - : func; - } - - /** - * Casts `func` to a fixed arity function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity cap. - * @returns {Function} Returns the cast function. - */ - function castFixed(name, func, n) { - if (config.fixed && (forceFixed || !_mapping.skipFixed[name])) { - var data = _mapping.methodSpread[name], - start = data && data.start; - - return start === undefined ? ary(func, n) : flatSpread(func, start); - } - return func; - } - - /** - * Casts `func` to an rearged function if needed. - * - * @private - * @param {string} name The name of the function to inspect. - * @param {Function} func The function to inspect. - * @param {number} n The arity of `func`. - * @returns {Function} Returns the cast function. - */ - function castRearg(name, func, n) { - return (config.rearg && n > 1 && (forceRearg || !_mapping.skipRearg[name])) - ? rearg(func, _mapping.methodRearg[name] || _mapping.aryRearg[n]) - : func; - } - - /** - * Creates a clone of `object` by `path`. - * - * @private - * @param {Object} object The object to clone. - * @param {Array|string} path The path to clone by. - * @returns {Object} Returns the cloned object. - */ - function cloneByPath(object, path) { - path = toPath(path); - - var index = -1, - length = path.length, - lastIndex = length - 1, - result = clone(Object(object)), - nested = result; - - while (nested != null && ++index < length) { - var key = path[index], - value = nested[key]; - - if (value != null && - !(isFunction(value) || isError(value) || isWeakMap(value))) { - nested[key] = clone(index == lastIndex ? value : Object(value)); - } - nested = nested[key]; - } - return result; - } - - /** - * Converts `lodash` to an immutable auto-curried iteratee-first data-last - * version with conversion `options` applied. - * - * @param {Object} [options] The options object. See `baseConvert` for more details. - * @returns {Function} Returns the converted `lodash`. - */ - function convertLib(options) { - return _.runInContext.convert(options)(undefined); - } - - /** - * Create a converter function for `func` of `name`. - * - * @param {string} name The name of the function to convert. - * @param {Function} func The function to convert. - * @returns {Function} Returns the new converter function. - */ - function createConverter(name, func) { - var realName = _mapping.aliasToReal[name] || name, - methodName = _mapping.remap[realName] || realName, - oldOptions = options; - - return function(options) { - var newUtil = isLib ? pristine : helpers, - newFunc = isLib ? pristine[methodName] : func, - newOptions = assign(assign({}, oldOptions), options); - - return baseConvert(newUtil, realName, newFunc, newOptions); - }; - } - - /** - * Creates a function that wraps `func` to invoke its iteratee, with up to `n` - * arguments, ignoring any additional arguments. - * - * @private - * @param {Function} func The function to cap iteratee arguments for. - * @param {number} n The arity cap. - * @returns {Function} Returns the new function. - */ - function iterateeAry(func, n) { - return overArg(func, function(func) { - return typeof func == 'function' ? baseAry(func, n) : func; - }); - } - - /** - * Creates a function that wraps `func` to invoke its iteratee with arguments - * arranged according to the specified `indexes` where the argument value at - * the first index is provided as the first argument, the argument value at - * the second index is provided as the second argument, and so on. - * - * @private - * @param {Function} func The function to rearrange iteratee arguments for. - * @param {number[]} indexes The arranged argument indexes. - * @returns {Function} Returns the new function. - */ - function iterateeRearg(func, indexes) { - return overArg(func, function(func) { - var n = indexes.length; - return baseArity(rearg(baseAry(func, n), indexes), n); - }); - } - - /** - * Creates a function that invokes `func` with its first 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() { - var length = arguments.length; - if (!length) { - return func(); - } - var args = Array(length); - while (length--) { - args[length] = arguments[length]; - } - var index = config.rearg ? 0 : (length - 1); - args[index] = transform(args[index]); - return func.apply(undefined, args); - }; - } - - /** - * Creates a function that wraps `func` and applys the conversions - * rules by `name`. - * - * @private - * @param {string} name The name of the function to wrap. - * @param {Function} func The function to wrap. - * @returns {Function} Returns the converted function. - */ - function wrap(name, func, placeholder) { - var result, - realName = _mapping.aliasToReal[name] || name, - wrapped = func, - wrapper = wrappers[realName]; - - if (wrapper) { - wrapped = wrapper(func); - } - else if (config.immutable) { - if (_mapping.mutate.array[realName]) { - wrapped = wrapImmutable(func, cloneArray); - } - else if (_mapping.mutate.object[realName]) { - wrapped = wrapImmutable(func, createCloner(func)); - } - else if (_mapping.mutate.set[realName]) { - wrapped = wrapImmutable(func, cloneByPath); - } - } - each(aryMethodKeys, function(aryKey) { - each(_mapping.aryMethod[aryKey], function(otherName) { - if (realName == otherName) { - var data = _mapping.methodSpread[realName], - afterRearg = data && data.afterRearg; - - result = afterRearg - ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) - : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); - - result = castCap(realName, result); - result = castCurry(realName, result, aryKey); - return false; - } - }); - return !result; - }); - - result || (result = wrapped); - if (result == func) { - result = forceCurry ? curry(result, 1) : function() { - return func.apply(this, arguments); - }; - } - result.convert = createConverter(realName, func); - result.placeholder = func.placeholder = placeholder; - - return result; - } - - /*--------------------------------------------------------------------------*/ - - if (!isObj) { - return wrap(name, func, defaultHolder); - } - var _ = func; - - // Convert methods by ary cap. - var pairs = []; - each(aryMethodKeys, function(aryKey) { - each(_mapping.aryMethod[aryKey], function(key) { - var func = _[_mapping.remap[key] || key]; - if (func) { - pairs.push([key, wrap(key, func, _)]); - } - }); - }); - - // Convert remaining methods. - each(keys(_), function(key) { - var func = _[key]; - if (typeof func == 'function') { - var length = pairs.length; - while (length--) { - if (pairs[length][0] == key) { - return; - } - } - func.convert = createConverter(key, func); - pairs.push([key, func]); - } - }); - - // Assign to `_` leaving `_.prototype` unchanged to allow chaining. - each(pairs, function(pair) { - _[pair[0]] = pair[1]; - }); - - _.convert = convertLib; - _.placeholder = _; - - // Assign aliases. - each(keys(_), function(key) { - each(_mapping.realToAlias[key] || [], function(alias) { - _[alias] = _[key]; - }); - }); - - return _; - } - - var _baseConvert = baseConvert; - - var _ = lodash_min.runInContext(); - var fp = _baseConvert(_, _); - var fp_1 = fp.find; - var fp_2 = fp.isUndefined; - var fp_3 = fp.split; - var fp_4 = fp.max; - var fp_5 = fp.last; - var fp_6 = fp.union; - var fp_7 = fp.reduce; - var fp_8 = fp.isObject; - var fp_9 = fp.cloneDeep; - var fp_10 = fp.some; - var fp_11 = fp.isArray; - var fp_12 = fp.map; - var fp_13 = fp.filter; - var fp_14 = fp.keys; - var fp_15 = fp.isFunction; - var fp_16 = fp.isEmpty; - var fp_17 = fp.countBy; - var fp_18 = fp.join; - var fp_19 = fp.includes; - var fp_20 = fp.flatten; - var fp_21 = fp.constant; - var fp_22 = fp.first; - var fp_23 = fp.intersection; - var fp_24 = fp.take; - var fp_25 = fp.has; - var fp_26 = fp.mapValues; - var fp_27 = fp.isString; - var fp_28 = fp.isBoolean; - var fp_29 = fp.isNull; - var fp_30 = fp.isNumber; - var fp_31 = fp.isObjectLike; - var fp_32 = fp.isDate; - var fp_33 = fp.clone; - var fp_34 = fp.values; - var fp_35 = fp.keyBy; - var fp_36 = fp.isNaN; - var fp_37 = fp.isInteger; - var fp_38 = fp.toNumber; - - // Found this seed-based random generator somewhere - // Based on The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu) - - var seed = 1; - - /** - * return a random number based on a seed - * @param seed - * @returns {number} - */ - function getNextValue() { - seed = (seed * 9301 + 49297) % 233280; - return seed/(233280.0); - } - - function setSeed(_seed_) { - seed = _seed_; - } - - var randomFromSeed = { - nextValue: getNextValue, - seed: setSeed - }; - - var ORIGINAL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-'; - var alphabet; - var previousSeed; - - var shuffled; - - function reset() { - shuffled = false; - } - - function setCharacters(_alphabet_) { - if (!_alphabet_) { - if (alphabet !== ORIGINAL) { - alphabet = ORIGINAL; - reset(); - } - return; - } - - if (_alphabet_ === alphabet) { - return; - } - - if (_alphabet_.length !== ORIGINAL.length) { - throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. You submitted ' + _alphabet_.length + ' characters: ' + _alphabet_); - } - - var unique = _alphabet_.split('').filter(function(item, ind, arr){ - return ind !== arr.lastIndexOf(item); - }); - - if (unique.length) { - throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. These characters were not unique: ' + unique.join(', ')); - } - - alphabet = _alphabet_; - reset(); - } - - function characters(_alphabet_) { - setCharacters(_alphabet_); - return alphabet; - } - - function setSeed$1(seed) { - randomFromSeed.seed(seed); - if (previousSeed !== seed) { - reset(); - previousSeed = seed; - } - } - - function shuffle() { - if (!alphabet) { - setCharacters(ORIGINAL); - } - - var sourceArray = alphabet.split(''); - var targetArray = []; - var r = randomFromSeed.nextValue(); - var characterIndex; - - while (sourceArray.length > 0) { - r = randomFromSeed.nextValue(); - characterIndex = Math.floor(r * sourceArray.length); - targetArray.push(sourceArray.splice(characterIndex, 1)[0]); - } - return targetArray.join(''); - } - - function getShuffled() { - if (shuffled) { - return shuffled; - } - shuffled = shuffle(); - return shuffled; - } - - /** - * lookup shuffled letter - * @param index - * @returns {string} - */ - function lookup(index) { - var alphabetShuffled = getShuffled(); - return alphabetShuffled[index]; - } - - function get () { - return alphabet || ORIGINAL; - } - - var alphabet_1 = { - get: get, - characters: characters, - seed: setSeed$1, - lookup: lookup, - shuffled: getShuffled - }; - - var crypto = typeof window === 'object' && (window.crypto || window.msCrypto); // IE 11 uses window.msCrypto - - var randomByte; - - if (!crypto || !crypto.getRandomValues) { - randomByte = function(size) { - var bytes = []; - for (var i = 0; i < size; i++) { - bytes.push(Math.floor(Math.random() * 256)); - } - return bytes; - }; - } else { - randomByte = function(size) { - return crypto.getRandomValues(new Uint8Array(size)); - }; - } - - var randomByteBrowser = randomByte; - - /** - * Secure random string generator with custom alphabet. - * - * Alphabet must contain 256 symbols or less. Otherwise, the generator - * will not be secure. - * - * @param {generator} random The random bytes generator. - * @param {string} alphabet Symbols to be used in new random string. - * @param {size} size The number of symbols in new random string. - * - * @return {string} Random string. - * - * @example - * const format = require('nanoid/format') - * - * function random (size) { - * const result = [] - * for (let i = 0; i < size; i++) { - * result.push(randomByte()) - * } - * return result - * } - * - * format(random, "abcdef", 5) //=> "fbaef" - * - * @name format - * @function - */ - var format = function (random, alphabet, size) { - var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1; - var step = Math.ceil(1.6 * mask * size / alphabet.length); - size = +size; - - var id = ''; - while (true) { - var bytes = random(step); - for (var i = 0; i < step; i++) { - var byte = bytes[i] & mask; - if (alphabet[byte]) { - id += alphabet[byte]; - if (id.length === size) return id - } + else if (_mapping.mutate.set[realName]) { + wrapped = wrapImmutable(func, cloneByPath); } } - }; + each(aryMethodKeys, function (aryKey) { + each(_mapping.aryMethod[aryKey], function (otherName) { + if (realName == otherName) { + var data = _mapping.methodSpread[realName], + afterRearg = data && data.afterRearg; - function generate(number) { - var loopCounter = 0; - var done; + result = afterRearg + ? castFixed(realName, castRearg(realName, wrapped, aryKey), aryKey) + : castRearg(realName, castFixed(realName, wrapped, aryKey), aryKey); - var str = ''; - - while (!done) { - str = str + format(randomByteBrowser, alphabet_1.get(), 1); - done = number < (Math.pow(16, loopCounter + 1 ) ); - loopCounter++; - } - return str; - } - - var generate_1 = generate; - - // Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness. - // This number should be updated every year or so to keep the generated id short. - // To regenerate `new Date() - 0` and bump the version. Always bump the version! - var REDUCE_TIME = 1567752802062; - - // don't change unless we change the algos or REDUCE_TIME - // must be an integer and less than 16 - var version = 7; - - // Counter is used when shortid is called multiple times in one second. - var counter; - - // Remember the last time shortid was called in case counter is needed. - var previousSeconds; - - /** - * Generate unique id - * Returns string id - */ - function build(clusterWorkerId) { - var str = ''; - - var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001); - - if (seconds === previousSeconds) { - counter++; - } else { - counter = 0; - previousSeconds = seconds; - } - - str = str + generate_1(version); - str = str + generate_1(clusterWorkerId); - if (counter > 0) { - str = str + generate_1(counter); - } - str = str + generate_1(seconds); - return str; - } - - var build_1 = build; - - function isShortId(id) { - if (!id || typeof id !== 'string' || id.length < 6 ) { + result = castCap(realName, result); + result = castCurry(realName, result, aryKey); return false; - } + } + }); + return !result; + }); - var nonAlphabetic = new RegExp('[^' + - alphabet_1.get().replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&') + - ']'); - return !nonAlphabetic.test(id); + result || (result = wrapped); + if (result == func) { + result = forceCurry ? curry(result, 1) : function () { + return func.apply(this, arguments); + }; + } + result.convert = createConverter(realName, func); + result.placeholder = func.placeholder = placeholder; + + return result; } - var isValid = isShortId; + /*--------------------------------------------------------------------------*/ - var lib = createCommonjsModule(function (module) { + if (!isObj) { + return wrap(name, func, defaultHolder); + } + var _ = func; + + // Convert methods by ary cap. + var pairs = []; + each(aryMethodKeys, function (aryKey) { + each(_mapping.aryMethod[aryKey], function (key) { + var func = _[_mapping.remap[key] || key]; + if (func) { + pairs.push([key, wrap(key, func, _)]); + } + }); + }); + + // Convert remaining methods. + each(keys(_), function (key) { + var func = _[key]; + if (typeof func == 'function') { + var length = pairs.length; + while (length--) { + if (pairs[length][0] == key) { + return; + } + } + func.convert = createConverter(key, func); + pairs.push([key, func]); + } + }); + + // Assign to `_` leaving `_.prototype` unchanged to allow chaining. + each(pairs, function (pair) { + _[pair[0]] = pair[1]; + }); + + _.convert = convertLib; + _.placeholder = _; + + // Assign aliases. + each(keys(_), function (key) { + each(_mapping.realToAlias[key] || [], function (alias) { + _[alias] = _[key]; + }); + }); + + return _; + } + + var _baseConvert = baseConvert; + + var _ = lodash_min.runInContext(); + var fp = _baseConvert(_, _); + var fp_1 = fp.find; + var fp_2 = fp.isUndefined; + var fp_3 = fp.split; + var fp_4 = fp.max; + var fp_5 = fp.last; + var fp_6 = fp.union; + var fp_7 = fp.reduce; + var fp_8 = fp.isObject; + var fp_9 = fp.cloneDeep; + var fp_10 = fp.some; + var fp_11 = fp.isArray; + var fp_12 = fp.map; + var fp_13 = fp.filter; + var fp_14 = fp.keys; + var fp_15 = fp.isFunction; + var fp_16 = fp.isEmpty; + var fp_17 = fp.countBy; + var fp_18 = fp.join; + var fp_19 = fp.includes; + var fp_20 = fp.flatten; + var fp_21 = fp.constant; + var fp_22 = fp.first; + var fp_23 = fp.intersection; + var fp_24 = fp.take; + var fp_25 = fp.has; + var fp_26 = fp.mapValues; + var fp_27 = fp.isString; + var fp_28 = fp.isBoolean; + var fp_29 = fp.isNull; + var fp_30 = fp.isNumber; + var fp_31 = fp.isObjectLike; + var fp_32 = fp.isDate; + var fp_33 = fp.clone; + var fp_34 = fp.values; + var fp_35 = fp.keyBy; + var fp_36 = fp.isNaN; + var fp_37 = fp.isInteger; + var fp_38 = fp.toNumber; + + // Found this seed-based random generator somewhere + // Based on The Central Randomizer 1.3 (C) 1997 by Paul Houle (houle@msc.cornell.edu) + + var seed = 1; + + /** + * return a random number based on a seed + * @param seed + * @returns {number} + */ + function getNextValue() { + seed = (seed * 9301 + 49297) % 233280; + return seed / (233280.0); + } + + function setSeed(_seed_) { + seed = _seed_; + } + + var randomFromSeed = { + nextValue: getNextValue, + seed: setSeed + }; + + var ORIGINAL = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-'; + var alphabet; + var previousSeed; + + var shuffled; + + function reset() { + shuffled = false; + } + + function setCharacters(_alphabet_) { + if (!_alphabet_) { + if (alphabet !== ORIGINAL) { + alphabet = ORIGINAL; + reset(); + } + return; + } + + if (_alphabet_ === alphabet) { + return; + } + + if (_alphabet_.length !== ORIGINAL.length) { + throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. You submitted ' + _alphabet_.length + ' characters: ' + _alphabet_); + } + + var unique = _alphabet_.split('').filter(function (item, ind, arr) { + return ind !== arr.lastIndexOf(item); + }); + + if (unique.length) { + throw new Error('Custom alphabet for shortid must be ' + ORIGINAL.length + ' unique characters. These characters were not unique: ' + unique.join(', ')); + } + + alphabet = _alphabet_; + reset(); + } + + function characters(_alphabet_) { + setCharacters(_alphabet_); + return alphabet; + } + + function setSeed$1(seed) { + randomFromSeed.seed(seed); + if (previousSeed !== seed) { + reset(); + previousSeed = seed; + } + } + + function shuffle() { + if (!alphabet) { + setCharacters(ORIGINAL); + } + + var sourceArray = alphabet.split(''); + var targetArray = []; + var r = randomFromSeed.nextValue(); + var characterIndex; + + while (sourceArray.length > 0) { + r = randomFromSeed.nextValue(); + characterIndex = Math.floor(r * sourceArray.length); + targetArray.push(sourceArray.splice(characterIndex, 1)[0]); + } + return targetArray.join(''); + } + + function getShuffled() { + if (shuffled) { + return shuffled; + } + shuffled = shuffle(); + return shuffled; + } + + /** + * lookup shuffled letter + * @param index + * @returns {string} + */ + function lookup(index) { + var alphabetShuffled = getShuffled(); + return alphabetShuffled[index]; + } + + function get() { + return alphabet || ORIGINAL; + } + + var alphabet_1 = { + get: get, + characters: characters, + seed: setSeed$1, + lookup: lookup, + shuffled: getShuffled + }; + + var crypto = typeof window === 'object' && (window.crypto || window.msCrypto); // IE 11 uses window.msCrypto + + var randomByte; + + if (!crypto || !crypto.getRandomValues) { + randomByte = function (size) { + var bytes = []; + for (var i = 0; i < size; i++) { + bytes.push(Math.floor(Math.random() * 256)); + } + return bytes; + }; + } else { + randomByte = function (size) { + return crypto.getRandomValues(new Uint8Array(size)); + }; + } + + var randomByteBrowser = randomByte; + + /** + * Secure random string generator with custom alphabet. + * + * Alphabet must contain 256 symbols or less. Otherwise, the generator + * will not be secure. + * + * @param {generator} random The random bytes generator. + * @param {string} alphabet Symbols to be used in new random string. + * @param {size} size The number of symbols in new random string. + * + * @return {string} Random string. + * + * @example + * const format = require('nanoid/format') + * + * function random (size) { + * const result = [] + * for (let i = 0; i < size; i++) { + * result.push(randomByte()) + * } + * return result + * } + * + * format(random, "abcdef", 5) //=> "fbaef" + * + * @name format + * @function + */ + var format = function (random, alphabet, size) { + var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1; + var step = Math.ceil(1.6 * mask * size / alphabet.length); + size = +size; + + var id = ''; + while (true) { + var bytes = random(step); + for (var i = 0; i < step; i++) { + var byte = bytes[i] & mask; + if (alphabet[byte]) { + id += alphabet[byte]; + if (id.length === size) return id + } + } + } + }; + + function generate(number) { + var loopCounter = 0; + var done; + + var str = ''; + + while (!done) { + str = str + format(randomByteBrowser, alphabet_1.get(), 1); + done = number < (Math.pow(16, loopCounter + 1)); + loopCounter++; + } + return str; + } + + var generate_1 = generate; + + // Ignore all milliseconds before a certain time to reduce the size of the date entropy without sacrificing uniqueness. + // This number should be updated every year or so to keep the generated id short. + // To regenerate `new Date() - 0` and bump the version. Always bump the version! + var REDUCE_TIME = 1567752802062; + + // don't change unless we change the algos or REDUCE_TIME + // must be an integer and less than 16 + var version = 7; + + // Counter is used when shortid is called multiple times in one second. + var counter; + + // Remember the last time shortid was called in case counter is needed. + var previousSeconds; + + /** + * Generate unique id + * Returns string id + */ + function build(clusterWorkerId) { + var str = ''; + + var seconds = Math.floor((Date.now() - REDUCE_TIME) * 0.001); + + if (seconds === previousSeconds) { + counter++; + } else { + counter = 0; + previousSeconds = seconds; + } + + str = str + generate_1(version); + str = str + generate_1(clusterWorkerId); + if (counter > 0) { + str = str + generate_1(counter); + } + str = str + generate_1(seconds); + return str; + } + + var build_1 = build; + + function isShortId(id) { + if (!id || typeof id !== 'string' || id.length < 6) { + return false; + } + + var nonAlphabetic = new RegExp('[^' + + alphabet_1.get().replace(/[|\\{}()[\]^$+*?.-]/g, '\\$&') + + ']'); + return !nonAlphabetic.test(id); + } + + var isValid = isShortId; + + var lib = createCommonjsModule(function (module) { @@ -1960,7 +2218,7 @@ var app = (function (crypto$1) { // has a unique value for worker // Note: I don't know if this is automatically set when using third // party cluster solutions such as pm2. - var clusterWorkerId = 0; + var clusterWorkerId = 0; /** * Set the seed. @@ -1969,8 +2227,8 @@ var app = (function (crypto$1) { * @param seed Integer value to seed the random alphabet. ALWAYS USE THE SAME SEED or you might get overlaps. */ function seed(seedValue) { - alphabet_1.seed(seedValue); - return module.exports; + alphabet_1.seed(seedValue); + return module.exports; } /** @@ -1980,8 +2238,8 @@ var app = (function (crypto$1) { * returns shortid module so it can be chained. */ function worker(workerId) { - clusterWorkerId = workerId; - return module.exports; + clusterWorkerId = workerId; + return module.exports; } /** @@ -1990,11 +2248,11 @@ var app = (function (crypto$1) { * returns the shuffled alphabet */ function characters(newCharacters) { - if (newCharacters !== undefined) { - alphabet_1.characters(newCharacters); - } + if (newCharacters !== undefined) { + alphabet_1.characters(newCharacters); + } - return alphabet_1.shuffled(); + return alphabet_1.shuffled(); } /** @@ -2012,18 +2270,18 @@ var app = (function (crypto$1) { module.exports.worker = worker; module.exports.characters = characters; module.exports.isValid = isValid; - }); - var lib_1 = lib.generate; - var lib_2 = lib.seed; - var lib_3 = lib.worker; - var lib_4 = lib.characters; - var lib_5 = lib.isValid; + }); + var lib_1 = lib.generate; + var lib_2 = lib.seed; + var lib_3 = lib.worker; + var lib_4 = lib.characters; + var lib_5 = lib.isValid; - var shortid = lib; - var shortid_1 = shortid.generate; + var shortid = lib; + var shortid_1 = shortid.generate; - var lodash = createCommonjsModule(function (module, exports) { - (function() { + var lodash = createCommonjsModule(function (module, exports) { + (function () { /** Used as a safe reference for `undefined` in pre-ES5 environments. */ var undefined$1; @@ -2036,7 +2294,7 @@ var app = (function (crypto$1) { /** Error message constants. */ var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', - FUNC_ERROR_TEXT = 'Expected a function'; + FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; @@ -2049,48 +2307,48 @@ var app = (function (crypto$1) { /** Used to compose bitmasks for cloning. */ var CLONE_DEEP_FLAG = 1, - CLONE_FLAT_FLAG = 2, - CLONE_SYMBOLS_FLAG = 4; + CLONE_FLAT_FLAG = 2, + CLONE_SYMBOLS_FLAG = 4; /** Used to compose bitmasks for value comparisons. */ var COMPARE_PARTIAL_FLAG = 1, - COMPARE_UNORDERED_FLAG = 2; + 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; + 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 = '...'; + DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ var HOT_COUNT = 800, - HOT_SPAN = 16; + HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ var LAZY_FILTER_FLAG = 1, - LAZY_MAP_FLAG = 2, - LAZY_WHILE_FLAG = 3; + 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; + 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; + 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 = [ @@ -2107,77 +2365,77 @@ var app = (function (crypto$1) { /** `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]'; + 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]'; + 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; + 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); + 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; + 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; + 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); + reHasRegExpChar = RegExp(reRegExpChar.source); /** Used to match leading and trailing whitespace. */ var reTrim = /^\s+|\s+$/g, - reTrimStart = /^\s+/, - reTrimEnd = /\s+$/; + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; /** Used to match wrap detail comments. */ var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, - reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, - reSplitDetails = /,? & /; + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; /** Used to match words composed of alphanumeric characters. */ var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; @@ -2220,50 +2478,50 @@ var app = (function (crypto$1) { /** 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; + 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'; + 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('|') + ')'; + 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'); @@ -2290,7 +2548,7 @@ var app = (function (crypto$1) { ].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 + ']'); + 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 ]/; @@ -2310,88 +2568,88 @@ var app = (function (crypto$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[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; + 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[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; + 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', + '\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', + '\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' @@ -2427,7 +2685,7 @@ var app = (function (crypto$1) { /** Built-in method references without a dependency on `root`. */ var freeParseFloat = parseFloat, - freeParseInt = parseInt; + freeParseInt = parseInt; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; @@ -2439,7 +2697,7 @@ var app = (function (crypto$1) { var root = freeGlobal || freeSelf || Function('return this')(); /** Detect free variable `exports`. */ - var freeExports = exports && !exports.nodeType && exports; + var freeExports = exports && !exports.nodeType && exports; /** Detect free variable `module`. */ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module; @@ -2451,7 +2709,7 @@ var app = (function (crypto$1) { var freeProcess = moduleExports && freeGlobal.process; /** Used to access faster Node.js helpers. */ - var nodeUtil = (function() { + var nodeUtil = (function () { try { // Use `util.types` for Node.js 10+. var types = freeModule && freeModule.require && freeModule.require('util').types; @@ -2462,16 +2720,16 @@ var app = (function (crypto$1) { // Legacy `process.binding('util')` for Node.js < 10. return freeProcess && freeProcess.binding && freeProcess.binding('util'); - } catch (e) {} + } 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; + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ @@ -2507,7 +2765,7 @@ var app = (function (crypto$1) { */ function arrayAggregator(array, setter, iteratee, accumulator) { var index = -1, - length = array == null ? 0 : array.length; + length = array == null ? 0 : array.length; while (++index < length) { var value = array[index]; @@ -2527,7 +2785,7 @@ var app = (function (crypto$1) { */ function arrayEach(array, iteratee) { var index = -1, - length = array == null ? 0 : array.length; + length = array == null ? 0 : array.length; while (++index < length) { if (iteratee(array[index], index, array) === false) { @@ -2569,7 +2827,7 @@ var app = (function (crypto$1) { */ function arrayEvery(array, predicate) { var index = -1, - length = array == null ? 0 : array.length; + length = array == null ? 0 : array.length; while (++index < length) { if (!predicate(array[index], index, array)) { @@ -2590,9 +2848,9 @@ var app = (function (crypto$1) { */ function arrayFilter(array, predicate) { var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; while (++index < length) { var value = array[index]; @@ -2628,7 +2886,7 @@ var app = (function (crypto$1) { */ function arrayIncludesWith(array, value, comparator) { var index = -1, - length = array == null ? 0 : array.length; + length = array == null ? 0 : array.length; while (++index < length) { if (comparator(value, array[index])) { @@ -2649,8 +2907,8 @@ var app = (function (crypto$1) { */ function arrayMap(array, iteratee) { var index = -1, - length = array == null ? 0 : array.length, - result = Array(length); + length = array == null ? 0 : array.length, + result = Array(length); while (++index < length) { result[index] = iteratee(array[index], index, array); @@ -2668,8 +2926,8 @@ var app = (function (crypto$1) { */ function arrayPush(array, values) { var index = -1, - length = values.length, - offset = array.length; + length = values.length, + offset = array.length; while (++index < length) { array[offset + index] = values[index]; @@ -2691,7 +2949,7 @@ var app = (function (crypto$1) { */ function arrayReduce(array, iteratee, accumulator, initAccum) { var index = -1, - length = array == null ? 0 : array.length; + length = array == null ? 0 : array.length; if (initAccum && length) { accumulator = array[++index]; @@ -2737,7 +2995,7 @@ var app = (function (crypto$1) { */ function arraySome(array, predicate) { var index = -1, - length = array == null ? 0 : array.length; + length = array == null ? 0 : array.length; while (++index < length) { if (predicate(array[index], index, array)) { @@ -2791,7 +3049,7 @@ var app = (function (crypto$1) { */ function baseFindKey(collection, predicate, eachFunc) { var result; - eachFunc(collection, function(value, key, collection) { + eachFunc(collection, function (value, key, collection) { if (predicate(value, key, collection)) { result = key; return false; @@ -2813,7 +3071,7 @@ var app = (function (crypto$1) { */ function baseFindIndex(array, predicate, fromIndex, fromRight) { var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); + index = fromIndex + (fromRight ? 1 : -1); while ((fromRight ? index-- : ++index < length)) { if (predicate(array[index], index, array)) { @@ -2850,7 +3108,7 @@ var app = (function (crypto$1) { */ function baseIndexOfWith(array, value, fromIndex, comparator) { var index = fromIndex - 1, - length = array.length; + length = array.length; while (++index < length) { if (comparator(array[index], value)) { @@ -2893,7 +3151,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new accessor function. */ function baseProperty(key) { - return function(object) { + return function (object) { return object == null ? undefined$1 : object[key]; }; } @@ -2906,7 +3164,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new accessor function. */ function basePropertyOf(object) { - return function(key) { + return function (key) { return object == null ? undefined$1 : object[key]; }; } @@ -2925,7 +3183,7 @@ var app = (function (crypto$1) { * @returns {*} Returns the accumulated value. */ function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection) { + eachFunc(collection, function (value, index, collection) { accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection); @@ -2964,8 +3222,8 @@ var app = (function (crypto$1) { */ function baseSum(array, iteratee) { var result, - index = -1, - length = array.length; + index = -1, + length = array.length; while (++index < length) { var current = iteratee(array[index]); @@ -2987,7 +3245,7 @@ var app = (function (crypto$1) { */ function baseTimes(n, iteratee) { var index = -1, - result = Array(n); + result = Array(n); while (++index < n) { result[index] = iteratee(index); @@ -3005,7 +3263,7 @@ var app = (function (crypto$1) { * @returns {Object} Returns the key-value pairs. */ function baseToPairs(object, props) { - return arrayMap(props, function(key) { + return arrayMap(props, function (key) { return [key, object[key]]; }); } @@ -3018,7 +3276,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new capped function. */ function baseUnary(func) { - return function(value) { + return function (value) { return func(value); }; } @@ -3034,7 +3292,7 @@ var app = (function (crypto$1) { * @returns {Object} Returns the array of property values. */ function baseValues(object, props) { - return arrayMap(props, function(key) { + return arrayMap(props, function (key) { return object[key]; }); } @@ -3062,9 +3320,9 @@ var app = (function (crypto$1) { */ function charsStartIndex(strSymbols, chrSymbols) { var index = -1, - length = strSymbols.length; + length = strSymbols.length; - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } @@ -3080,7 +3338,7 @@ var app = (function (crypto$1) { function charsEndIndex(strSymbols, chrSymbols) { var index = strSymbols.length; - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { } return index; } @@ -3094,7 +3352,7 @@ var app = (function (crypto$1) { */ function countHolders(array, placeholder) { var length = array.length, - result = 0; + result = 0; while (length--) { if (array[length] === placeholder) { @@ -3177,7 +3435,7 @@ var app = (function (crypto$1) { */ function iteratorToArray(iterator) { var data, - result = []; + result = []; while (!(data = iterator.next()).done) { result.push(data.value); @@ -3194,9 +3452,9 @@ var app = (function (crypto$1) { */ function mapToArray(map) { var index = -1, - result = Array(map.size); + result = Array(map.size); - map.forEach(function(value, key) { + map.forEach(function (value, key) { result[++index] = [key, value]; }); return result; @@ -3211,7 +3469,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new function. */ function overArg(func, transform) { - return function(arg) { + return function (arg) { return func(transform(arg)); }; } @@ -3227,9 +3485,9 @@ var app = (function (crypto$1) { */ function replaceHolders(array, placeholder) { var index = -1, - length = array.length, - resIndex = 0, - result = []; + length = array.length, + resIndex = 0, + result = []; while (++index < length) { var value = array[index]; @@ -3250,9 +3508,9 @@ var app = (function (crypto$1) { */ function setToArray(set) { var index = -1, - result = Array(set.size); + result = Array(set.size); - set.forEach(function(value) { + set.forEach(function (value) { result[++index] = value; }); return result; @@ -3267,9 +3525,9 @@ var app = (function (crypto$1) { */ function setToPairs(set) { var index = -1, - result = Array(set.size); + result = Array(set.size); - set.forEach(function(value) { + set.forEach(function (value) { result[++index] = [value, value]; }); return result; @@ -3287,7 +3545,7 @@ var app = (function (crypto$1) { */ function strictIndexOf(array, value, fromIndex) { var index = fromIndex - 1, - length = array.length; + length = array.length; while (++index < length) { if (array[index] === value) { @@ -3425,19 +3683,19 @@ var app = (function (crypto$1) { /** Built-in constructor references. */ var Array = context.Array, - Date = context.Date, - Error = context.Error, - Function = context.Function, - Math = context.Math, - Object = context.Object, - RegExp = context.RegExp, - String = context.String, - TypeError = context.TypeError; + Date = context.Date, + Error = context.Error, + Function = context.Function, + Math = context.Math, + Object = context.Object, + RegExp = context.RegExp, + String = context.String, + TypeError = context.TypeError; /** Used for built-in method references. */ var arrayProto = Array.prototype, - funcProto = Function.prototype, - objectProto = Object.prototype; + funcProto = Function.prototype, + objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; @@ -3452,7 +3710,7 @@ var app = (function (crypto$1) { var idCounter = 0; /** Used to detect methods masquerading as native. */ - var maskSrcKey = (function() { + var maskSrcKey = (function () { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); @@ -3473,57 +3731,57 @@ var app = (function (crypto$1) { /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined$1, - Symbol = context.Symbol, - Uint8Array = context.Uint8Array, - allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined$1, - getPrototype = overArg(Object.getPrototypeOf, Object), - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice, - spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined$1, - symIterator = Symbol ? Symbol.iterator : undefined$1, - symToStringTag = Symbol ? Symbol.toStringTag : undefined$1; + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined$1, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined$1, + symIterator = Symbol ? Symbol.iterator : undefined$1, + symToStringTag = Symbol ? Symbol.toStringTag : undefined$1; - var defineProperty = (function() { + var defineProperty = (function () { try { var func = getNative(Object, 'defineProperty'); func({}, '', {}); return func; - } catch (e) {} + } catch (e) { } }()); /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, - ctxNow = Date && Date.now !== root.Date.now && Date.now, - ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, - nativeFloor = Math.floor, - nativeGetSymbols = Object.getOwnPropertySymbols, - nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, - nativeIsFinite = context.isFinite, - nativeJoin = arrayProto.join, - nativeKeys = overArg(Object.keys, Object), - nativeMax = Math.max, - nativeMin = Math.min, - nativeNow = Date.now, - nativeParseInt = context.parseInt, - nativeRandom = Math.random, - nativeReverse = arrayProto.reverse; + nativeFloor = Math.floor, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max, + nativeMin = Math.min, + nativeNow = Date.now, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), - Map = getNative(context, 'Map'), - Promise = getNative(context, 'Promise'), - Set = getNative(context, 'Set'), - WeakMap = getNative(context, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; @@ -3533,15 +3791,15 @@ var app = (function (crypto$1) { /** Used to detect maps, sets, and weakmaps. */ var dataViewCtorString = toSource(DataView), - mapCtorString = toSource(Map), - promiseCtorString = toSource(Promise), - setCtorString = toSource(Set), - weakMapCtorString = toSource(WeakMap); + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined$1, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, - symbolToString = symbolProto ? symbolProto.toString : undefined$1; + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, + symbolToString = symbolProto ? symbolProto.toString : undefined$1; /*------------------------------------------------------------------------*/ @@ -3682,9 +3940,9 @@ var app = (function (crypto$1) { * @param {Object} proto The object to inherit from. * @returns {Object} Returns the new object. */ - var baseCreate = (function() { - function object() {} - return function(proto) { + var baseCreate = (function () { + function object() { } + return function (proto) { if (!isObject(proto)) { return {}; } @@ -3858,19 +4116,19 @@ var app = (function (crypto$1) { */ 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__); + 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__); @@ -3882,13 +4140,13 @@ var app = (function (crypto$1) { index += dir; var iterIndex = -1, - value = array[index]; + value = array[index]; while (++iterIndex < iterLength) { var data = iteratees[iterIndex], - iteratee = data.iteratee, - type = data.type, - computed = iteratee(value); + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); if (type == LAZY_MAP_FLAG) { value = computed; @@ -3920,7 +4178,7 @@ var app = (function (crypto$1) { */ function Hash(entries) { var index = -1, - length = entries == null ? 0 : entries.length; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4024,7 +4282,7 @@ var app = (function (crypto$1) { */ function ListCache(entries) { var index = -1, - length = entries == null ? 0 : entries.length; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4056,7 +4314,7 @@ var app = (function (crypto$1) { */ function listCacheDelete(key) { var data = this.__data__, - index = assocIndexOf(data, key); + index = assocIndexOf(data, key); if (index < 0) { return false; @@ -4082,7 +4340,7 @@ var app = (function (crypto$1) { */ function listCacheGet(key) { var data = this.__data__, - index = assocIndexOf(data, key); + index = assocIndexOf(data, key); return index < 0 ? undefined$1 : data[index][1]; } @@ -4112,7 +4370,7 @@ var app = (function (crypto$1) { */ function listCacheSet(key, value) { var data = this.__data__, - index = assocIndexOf(data, key); + index = assocIndexOf(data, key); if (index < 0) { ++this.size; @@ -4141,7 +4399,7 @@ var app = (function (crypto$1) { */ function MapCache(entries) { var index = -1, - length = entries == null ? 0 : entries.length; + length = entries == null ? 0 : entries.length; this.clear(); while (++index < length) { @@ -4219,7 +4477,7 @@ var app = (function (crypto$1) { */ function mapCacheSet(key, value) { var data = getMapData(this, key), - size = data.size; + size = data.size; data.set(key, value); this.size += data.size == size ? 0 : 1; @@ -4245,7 +4503,7 @@ var app = (function (crypto$1) { */ function SetCache(values) { var index = -1, - length = values == null ? 0 : values.length; + length = values == null ? 0 : values.length; this.__data__ = new MapCache; while (++index < length) { @@ -4322,7 +4580,7 @@ var app = (function (crypto$1) { */ function stackDelete(key) { var data = this.__data__, - result = data['delete'](key); + result = data['delete'](key); this.size = data.size; return result; @@ -4399,25 +4657,25 @@ var app = (function (crypto$1) { */ function arrayLikeKeys(value, inherited) { var isArr = isArray(value), - isArg = !isArr && isArguments(value), - isBuff = !isArr && !isArg && isBuffer(value), - isType = !isArr && !isArg && !isBuff && isTypedArray(value), - skipIndexes = isArr || isArg || isBuff || isType, - result = skipIndexes ? baseTimes(value.length, String) : [], - length = result.length; + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && ( - // Safari 9 has enumerable `arguments.length` in strict mode. - key == 'length' || - // Node.js 0.10 has enumerable non-index properties on buffers. - (isBuff && (key == 'offset' || key == 'parent')) || - // PhantomJS 2 has enumerable non-index properties on typed arrays. - (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || - // Skip index properties. - isIndex(key, length) - ))) { + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { result.push(key); } } @@ -4470,7 +4728,7 @@ var app = (function (crypto$1) { */ function assignMergeValue(object, key, value) { if ((value !== undefined$1 && !eq(object[key], value)) || - (value === undefined$1 && !(key in object))) { + (value === undefined$1 && !(key in object))) { baseAssignValue(object, key, value); } } @@ -4488,7 +4746,7 @@ var app = (function (crypto$1) { function assignValue(object, key, value) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined$1 && !(key in object))) { + (value === undefined$1 && !(key in object))) { baseAssignValue(object, key, value); } } @@ -4523,7 +4781,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns `accumulator`. */ function baseAggregator(collection, setter, iteratee, accumulator) { - baseEach(collection, function(value, key, collection) { + baseEach(collection, function (value, key, collection) { setter(accumulator, value, iteratee(value), collection); }); return accumulator; @@ -4587,9 +4845,9 @@ var app = (function (crypto$1) { */ function baseAt(object, paths) { var index = -1, - length = paths.length, - result = Array(length), - skip = object == null; + length = paths.length, + result = Array(length), + skip = object == null; while (++index < length) { result[index] = skip ? undefined$1 : get(object, paths[index]); @@ -4636,9 +4894,9 @@ var app = (function (crypto$1) { */ 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; + 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); @@ -4657,7 +4915,7 @@ var app = (function (crypto$1) { } } else { var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; + isFunc = tag == funcTag || tag == genTag; if (isBuffer(value)) { return cloneBuffer(value, isDeep); @@ -4685,11 +4943,11 @@ var app = (function (crypto$1) { stack.set(value, result); if (isSet(value)) { - value.forEach(function(subValue) { + value.forEach(function (subValue) { result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); } else if (isMap(value)) { - value.forEach(function(subValue, key) { + value.forEach(function (subValue, key) { result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); }); } @@ -4699,7 +4957,7 @@ var app = (function (crypto$1) { : (isFlat ? keysIn : keys); var props = isArr ? undefined$1 : keysFunc(value); - arrayEach(props || value, function(subValue, key) { + arrayEach(props || value, function (subValue, key) { if (props) { key = subValue; subValue = value[key]; @@ -4719,7 +4977,7 @@ var app = (function (crypto$1) { */ function baseConforms(source) { var props = keys(source); - return function(object) { + return function (object) { return baseConformsTo(object, source, props); }; } @@ -4740,8 +4998,8 @@ var app = (function (crypto$1) { object = Object(object); while (length--) { var key = props[length], - predicate = source[key], - value = object[key]; + predicate = source[key], + value = object[key]; if ((value === undefined$1 && !(key in object)) || !predicate(value)) { return false; @@ -4764,7 +5022,7 @@ var app = (function (crypto$1) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } - return setTimeout(function() { func.apply(undefined$1, args); }, wait); + return setTimeout(function () { func.apply(undefined$1, args); }, wait); } /** @@ -4780,11 +5038,11 @@ var app = (function (crypto$1) { */ function baseDifference(array, values, iteratee, comparator) { var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; if (!length) { return result; @@ -4804,7 +5062,7 @@ var app = (function (crypto$1) { outer: while (++index < length) { var value = array[index], - computed = iteratee == null ? value : iteratee(value); + computed = iteratee == null ? value : iteratee(value); value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { @@ -4854,7 +5112,7 @@ var app = (function (crypto$1) { */ function baseEvery(collection, predicate) { var result = true; - baseEach(collection, function(value, index, collection) { + baseEach(collection, function (value, index, collection) { result = !!predicate(value, index, collection); return result; }); @@ -4873,18 +5131,18 @@ var app = (function (crypto$1) { */ function baseExtremum(array, iteratee, comparator) { var index = -1, - length = array.length; + length = array.length; while (++index < length) { var value = array[index], - current = iteratee(value); + current = iteratee(value); if (current != null && (computed === undefined$1 - ? (current === current && !isSymbol(current)) - : comparator(current, computed) - )) { + ? (current === current && !isSymbol(current)) + : comparator(current, computed) + )) { var computed = current, - result = value; + result = value; } } return result; @@ -4928,7 +5186,7 @@ var app = (function (crypto$1) { */ function baseFilter(collection, predicate) { var result = []; - baseEach(collection, function(value, index, collection) { + baseEach(collection, function (value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } @@ -4949,7 +5207,7 @@ var app = (function (crypto$1) { */ function baseFlatten(array, depth, predicate, isStrict, result) { var index = -1, - length = array.length; + length = array.length; predicate || (predicate = isFlattenable); result || (result = []); @@ -5029,7 +5287,7 @@ var app = (function (crypto$1) { * @returns {Array} Returns the function names. */ function baseFunctions(object, props) { - return arrayFilter(props, function(key) { + return arrayFilter(props, function (key) { return isFunction(object[key]); }); } @@ -5046,7 +5304,7 @@ var app = (function (crypto$1) { path = castPath(path, object); var index = 0, - length = path.length; + length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; @@ -5148,12 +5406,12 @@ var app = (function (crypto$1) { */ 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 = []; + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; while (othIndex--) { var array = arrays[othIndex]; @@ -5168,25 +5426,25 @@ var app = (function (crypto$1) { array = arrays[0]; var index = -1, - seen = caches[0]; + seen = caches[0]; outer: while (++index < length && result.length < maxLength) { var value = array[index], - computed = iteratee ? iteratee(value) : value; + computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (!(seen - ? cacheHas(seen, computed) - : includes(result, computed, comparator) - )) { + ? 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)) - ) { + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { continue outer; } } @@ -5211,7 +5469,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns `accumulator`. */ function baseInverter(object, setter, iteratee, accumulator) { - baseForOwn(object, function(value, key, object) { + baseForOwn(object, function (value, key, object) { setter(accumulator, iteratee(value), key, object); }); return accumulator; @@ -5307,16 +5565,16 @@ var app = (function (crypto$1) { */ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { var objIsArr = isArray(object), - othIsArr = isArray(other), - objTag = objIsArr ? arrayTag : getTag(object), - othTag = othIsArr ? arrayTag : getTag(other); + othIsArr = isArray(other), + objTag = objIsArr ? arrayTag : getTag(object), + othTag = othIsArr ? arrayTag : getTag(other); objTag = objTag == argsTag ? objectTag : objTag; othTag = othTag == argsTag ? objectTag : othTag; var objIsObj = objTag == objectTag, - othIsObj = othTag == objectTag, - isSameTag = objTag == othTag; + othIsObj = othTag == objectTag, + isSameTag = objTag == othTag; if (isSameTag && isBuffer(object)) { if (!isBuffer(other)) { @@ -5333,11 +5591,11 @@ var app = (function (crypto$1) { } if (!(bitmask & COMPARE_PARTIAL_FLAG)) { var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), - othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); if (objIsWrapped || othIsWrapped) { var objUnwrapped = objIsWrapped ? object.value() : object, - othUnwrapped = othIsWrapped ? other.value() : other; + othUnwrapped = othIsWrapped ? other.value() : other; stack || (stack = new Stack); return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); @@ -5373,8 +5631,8 @@ var app = (function (crypto$1) { */ function baseIsMatch(object, source, matchData, customizer) { var index = matchData.length, - length = index, - noCustomizer = !customizer; + length = index, + noCustomizer = !customizer; if (object == null) { return !length; @@ -5383,17 +5641,17 @@ var app = (function (crypto$1) { while (index--) { var data = matchData[index]; if ((noCustomizer && data[2]) - ? data[1] !== object[data[0]] - : !(data[0] in object) - ) { + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { return false; } } while (++index < length) { data = matchData[index]; var key = data[0], - objValue = object[key], - srcValue = data[1]; + objValue = object[key], + srcValue = data[1]; if (noCustomizer && data[2]) { if (objValue === undefined$1 && !(key in object)) { @@ -5405,9 +5663,9 @@ var app = (function (crypto$1) { var result = customizer(objValue, srcValue, key, object, source, stack); } if (!(result === undefined$1 - ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) - : result - )) { + ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) + : result + )) { return false; } } @@ -5521,7 +5779,7 @@ var app = (function (crypto$1) { return nativeKeysIn(object); } var isProto = isPrototype(object), - result = []; + result = []; for (var key in object) { if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { @@ -5554,9 +5812,9 @@ var app = (function (crypto$1) { */ function baseMap(collection, iteratee) { var index = -1, - result = isArrayLike(collection) ? Array(collection.length) : []; + result = isArrayLike(collection) ? Array(collection.length) : []; - baseEach(collection, function(value, key, collection) { + baseEach(collection, function (value, key, collection) { result[++index] = iteratee(value, key, collection); }); return result; @@ -5574,7 +5832,7 @@ var app = (function (crypto$1) { if (matchData.length == 1 && matchData[0][2]) { return matchesStrictComparable(matchData[0][0], matchData[0][1]); } - return function(object) { + return function (object) { return object === source || baseIsMatch(object, source, matchData); }; } @@ -5591,7 +5849,7 @@ var app = (function (crypto$1) { if (isKey(path) && isStrictComparable(srcValue)) { return matchesStrictComparable(toKey(path), srcValue); } - return function(object) { + return function (object) { var objValue = get(object, path); return (objValue === undefined$1 && objValue === srcValue) ? hasIn(object, path) @@ -5614,7 +5872,7 @@ var app = (function (crypto$1) { if (object === source) { return; } - baseFor(source, function(srcValue, key) { + baseFor(source, function (srcValue, key) { stack || (stack = new Stack); if (isObject(srcValue)) { baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); @@ -5649,8 +5907,8 @@ var app = (function (crypto$1) { */ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { var objValue = safeGet(object, key), - srcValue = safeGet(source, key), - stacked = stack.get(srcValue); + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); if (stacked) { assignMergeValue(object, key, stacked); @@ -5664,8 +5922,8 @@ var app = (function (crypto$1) { if (isCommon) { var isArr = isArray(srcValue), - isBuff = !isArr && isBuffer(srcValue), - isTyped = !isArr && !isBuff && isTypedArray(srcValue); + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); newValue = srcValue; if (isArr || isBuff || isTyped) { @@ -5739,14 +5997,14 @@ var app = (function (crypto$1) { var index = -1; iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee())); - var result = baseMap(collection, function(value, key, collection) { - var criteria = arrayMap(iteratees, function(iteratee) { + var result = baseMap(collection, function (value, key, collection) { + var criteria = arrayMap(iteratees, function (iteratee) { return iteratee(value); }); return { 'criteria': criteria, 'index': ++index, 'value': value }; }); - return baseSortBy(result, function(object, other) { + return baseSortBy(result, function (object, other) { return compareMultiple(object, other, orders); }); } @@ -5761,7 +6019,7 @@ var app = (function (crypto$1) { * @returns {Object} Returns the new object. */ function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { + return basePickBy(object, paths, function (value, path) { return hasIn(object, path); }); } @@ -5777,12 +6035,12 @@ var app = (function (crypto$1) { */ function basePickBy(object, paths, predicate) { var index = -1, - length = paths.length, - result = {}; + length = paths.length, + result = {}; while (++index < length) { var path = paths[index], - value = baseGet(object, path); + value = baseGet(object, path); if (predicate(value, path)) { baseSet(result, castPath(path, object), value); @@ -5799,7 +6057,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new accessor function. */ function basePropertyDeep(path) { - return function(object) { + return function (object) { return baseGet(object, path); }; } @@ -5817,9 +6075,9 @@ var app = (function (crypto$1) { */ function basePullAll(array, values, iteratee, comparator) { var indexOf = comparator ? baseIndexOfWith : baseIndexOf, - index = -1, - length = values.length, - seen = array; + index = -1, + length = values.length, + seen = array; if (array === values) { values = copyArray(values); @@ -5829,8 +6087,8 @@ var app = (function (crypto$1) { } while (++index < length) { var fromIndex = 0, - value = values[index], - computed = iteratee ? iteratee(value) : value; + value = values[index], + computed = iteratee ? iteratee(value) : value; while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { if (seen !== array) { @@ -5853,7 +6111,7 @@ var app = (function (crypto$1) { */ function basePullAt(array, indexes) { var length = array ? indexes.length : 0, - lastIndex = length - 1; + lastIndex = length - 1; while (length--) { var index = indexes[length]; @@ -5895,8 +6153,8 @@ var app = (function (crypto$1) { */ function baseRange(start, end, step, fromRight) { var index = -1, - length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), - result = Array(length); + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); while (length--) { result[fromRight ? length : ++index] = start; @@ -5986,13 +6244,13 @@ var app = (function (crypto$1) { path = castPath(path, object); var index = -1, - length = path.length, - lastIndex = length - 1, - nested = object; + length = path.length, + lastIndex = length - 1, + nested = object; while (nested != null && ++index < length) { var key = toKey(path[index]), - newValue = value; + newValue = value; if (index != lastIndex) { var objValue = nested[key]; @@ -6017,7 +6275,7 @@ var app = (function (crypto$1) { * @param {*} data The metadata. * @returns {Function} Returns `func`. */ - var baseSetData = !metaMap ? identity : function(func, data) { + var baseSetData = !metaMap ? identity : function (func, data) { metaMap.set(func, data); return func; }; @@ -6030,7 +6288,7 @@ var app = (function (crypto$1) { * @param {Function} string The `toString` result. * @returns {Function} Returns `func`. */ - var baseSetToString = !defineProperty ? identity : function(func, string) { + var baseSetToString = !defineProperty ? identity : function (func, string) { return defineProperty(func, 'toString', { 'configurable': true, 'enumerable': false, @@ -6061,7 +6319,7 @@ var app = (function (crypto$1) { */ function baseSlice(array, start, end) { var index = -1, - length = array.length; + length = array.length; if (start < 0) { start = -start > length ? 0 : (length + start); @@ -6092,7 +6350,7 @@ var app = (function (crypto$1) { function baseSome(collection, predicate) { var result; - baseEach(collection, function(value, index, collection) { + baseEach(collection, function (value, index, collection) { result = predicate(value, index, collection); return !result; }); @@ -6113,15 +6371,15 @@ var app = (function (crypto$1) { */ function baseSortedIndex(array, value, retHighest) { var low = 0, - high = array == null ? low : array.length; + high = array == null ? low : array.length; if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { while (low < high) { var mid = (low + high) >>> 1, - computed = array[mid]; + computed = array[mid]; if (computed !== null && !isSymbol(computed) && - (retHighest ? (computed <= value) : (computed < value))) { + (retHighest ? (computed <= value) : (computed < value))) { low = mid + 1; } else { high = mid; @@ -6149,19 +6407,19 @@ var app = (function (crypto$1) { value = iteratee(value); var low = 0, - high = array == null ? 0 : array.length, - valIsNaN = value !== value, - valIsNull = value === null, - valIsSymbol = isSymbol(value), - valIsUndefined = value === undefined$1; + high = array == null ? 0 : array.length, + valIsNaN = value !== value, + valIsNull = value === null, + valIsSymbol = isSymbol(value), + valIsUndefined = value === undefined$1; while (low < high) { var mid = nativeFloor((low + high) / 2), - computed = iteratee(array[mid]), - othIsDefined = computed !== undefined$1, - othIsNull = computed === null, - othIsReflexive = computed === computed, - othIsSymbol = isSymbol(computed); + computed = iteratee(array[mid]), + othIsDefined = computed !== undefined$1, + othIsNull = computed === null, + othIsReflexive = computed === computed, + othIsSymbol = isSymbol(computed); if (valIsNaN) { var setLow = retHighest || othIsReflexive; @@ -6196,13 +6454,13 @@ var app = (function (crypto$1) { */ function baseSortedUniq(array, iteratee) { var index = -1, - length = array.length, - resIndex = 0, - result = []; + length = array.length, + resIndex = 0, + result = []; while (++index < length) { var value = array[index], - computed = iteratee ? iteratee(value) : value; + computed = iteratee ? iteratee(value) : value; if (!index || !eq(computed, seen)) { var seen = computed; @@ -6265,11 +6523,11 @@ var app = (function (crypto$1) { */ function baseUniq(array, iteratee, comparator) { var index = -1, - includes = arrayIncludes, - length = array.length, - isCommon = true, - result = [], - seen = result; + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; if (comparator) { isCommon = false; @@ -6290,7 +6548,7 @@ var app = (function (crypto$1) { outer: while (++index < length) { var value = array[index], - computed = iteratee ? iteratee(value) : value; + computed = iteratee ? iteratee(value) : value; value = (comparator || value !== 0) ? value : 0; if (isCommon && computed === computed) { @@ -6356,10 +6614,10 @@ var app = (function (crypto$1) { */ function baseWhile(array, predicate, isDrop, fromRight) { var length = array.length, - index = fromRight ? length : -1; + index = fromRight ? length : -1; while ((fromRight ? index-- : ++index < length) && - predicate(array[index], index, array)) {} + predicate(array[index], index, array)) { } return isDrop ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) @@ -6381,7 +6639,7 @@ var app = (function (crypto$1) { if (result instanceof LazyWrapper) { result = result.value(); } - return arrayReduce(actions, function(result, action) { + return arrayReduce(actions, function (result, action) { return action.func.apply(action.thisArg, arrayPush([result], action.args)); }, result); } @@ -6402,11 +6660,11 @@ var app = (function (crypto$1) { return length ? baseUniq(arrays[0]) : []; } var index = -1, - result = Array(length); + result = Array(length); while (++index < length) { var array = arrays[index], - othIndex = -1; + othIndex = -1; while (++othIndex < length) { if (othIndex != index) { @@ -6428,9 +6686,9 @@ var app = (function (crypto$1) { */ function baseZipObject(props, values, assignFunc) { var index = -1, - length = props.length, - valsLength = values.length, - result = {}; + length = props.length, + valsLength = values.length, + result = {}; while (++index < length) { var value = index < valsLength ? values[index] : undefined$1; @@ -6508,7 +6766,7 @@ var app = (function (crypto$1) { * @private * @param {number|Object} id The timer id or timeout object of the timer to clear. */ - var clearTimeout = ctxClearTimeout || function(id) { + var clearTimeout = ctxClearTimeout || function (id) { return root.clearTimeout(id); }; @@ -6525,7 +6783,7 @@ var app = (function (crypto$1) { return buffer.slice(); } var length = buffer.length, - result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); buffer.copy(result); return result; @@ -6605,27 +6863,27 @@ var app = (function (crypto$1) { function compareAscending(value, other) { if (value !== other) { var valIsDefined = value !== undefined$1, - valIsNull = value === null, - valIsReflexive = value === value, - valIsSymbol = isSymbol(value); + valIsNull = value === null, + valIsReflexive = value === value, + valIsSymbol = isSymbol(value); var othIsDefined = other !== undefined$1, - othIsNull = other === null, - othIsReflexive = other === other, - othIsSymbol = isSymbol(other); + 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) { + (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) { + (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || + (othIsNull && valIsDefined && valIsReflexive) || + (!othIsDefined && valIsReflexive) || + !othIsReflexive) { return -1; } } @@ -6648,10 +6906,10 @@ var app = (function (crypto$1) { */ function compareMultiple(object, other, orders) { var index = -1, - objCriteria = object.criteria, - othCriteria = other.criteria, - length = objCriteria.length, - ordersLength = orders.length; + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; while (++index < length) { var result = compareAscending(objCriteria[index], othCriteria[index]); @@ -6686,13 +6944,13 @@ var app = (function (crypto$1) { */ 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; + 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]; @@ -6721,14 +6979,14 @@ var app = (function (crypto$1) { */ function composeArgsRight(args, partials, holders, isCurried) { var argsIndex = -1, - argsLength = args.length, - holdersIndex = -1, - holdersLength = holders.length, - rightIndex = -1, - rightLength = partials.length, - rangeLength = nativeMax(argsLength - holdersLength, 0), - result = Array(rangeLength + rightLength), - isUncurried = !isCurried; + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; while (++argsIndex < rangeLength) { result[argsIndex] = args[argsIndex]; @@ -6755,7 +7013,7 @@ var app = (function (crypto$1) { */ function copyArray(source, array) { var index = -1, - length = source.length; + length = source.length; array || (array = Array(length)); while (++index < length) { @@ -6779,7 +7037,7 @@ var app = (function (crypto$1) { object || (object = {}); var index = -1, - length = props.length; + length = props.length; while (++index < length) { var key = props[index]; @@ -6833,9 +7091,9 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new aggregator function. */ function createAggregator(setter, initializer) { - return function(collection, iteratee) { + return function (collection, iteratee) { var func = isArray(collection) ? arrayAggregator : baseAggregator, - accumulator = initializer ? initializer() : {}; + accumulator = initializer ? initializer() : {}; return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; @@ -6849,11 +7107,11 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { - return baseRest(function(object, sources) { + 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; + 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) @@ -6883,7 +7141,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new base function. */ function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee) { + return function (collection, iteratee) { if (collection == null) { return collection; } @@ -6891,8 +7149,8 @@ var app = (function (crypto$1) { return eachFunc(collection, iteratee); } var length = collection.length, - index = fromRight ? length : -1, - iterable = Object(collection); + index = fromRight ? length : -1, + iterable = Object(collection); while ((fromRight ? index-- : ++index < length)) { if (iteratee(iterable[index], index, iterable) === false) { @@ -6911,11 +7169,11 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new base function. */ function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { + return function (object, iteratee, keysFunc) { var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; + iterable = Object(object), + props = keysFunc(object), + length = props.length; while (length--) { var key = props[fromRight ? length : ++index]; @@ -6939,7 +7197,7 @@ var app = (function (crypto$1) { */ function createBind(func, bitmask, thisArg) { var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); + Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; @@ -6956,7 +7214,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new case function. */ function createCaseFirst(methodName) { - return function(string) { + return function (string) { string = toString(string); var strSymbols = hasUnicode(string) @@ -6983,7 +7241,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new compounder function. */ function createCompounder(callback) { - return function(string) { + return function (string) { return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); }; } @@ -6997,7 +7255,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new wrapped function. */ function createCtor(Ctor) { - return function() { + return function () { // Use a `switch` statement to work with class constructors. See // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. @@ -7013,7 +7271,7 @@ var app = (function (crypto$1) { case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); } var thisBinding = baseCreate(Ctor.prototype), - result = Ctor.apply(thisBinding, args); + result = Ctor.apply(thisBinding, args); // Mimic the constructor's `return` behavior. // See https://es5.github.io/#x13.2.2 for more details. @@ -7035,9 +7293,9 @@ var app = (function (crypto$1) { function wrapper() { var length = arguments.length, - args = Array(length), - index = length, - placeholder = getHolder(wrapper); + args = Array(length), + index = length, + placeholder = getHolder(wrapper); while (index--) { args[index] = arguments[index]; @@ -7066,12 +7324,12 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new find function. */ function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { + 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); }; + 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; @@ -7086,10 +7344,10 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { - return flatRest(function(funcs) { + return flatRest(function (funcs) { var length = funcs.length, - index = length, - prereq = LodashWrapper.prototype.thru; + index = length, + prereq = LodashWrapper.prototype.thru; if (fromRight) { funcs.reverse(); @@ -7108,12 +7366,12 @@ var app = (function (crypto$1) { func = funcs[index]; var funcName = getFuncName(func), - data = funcName == 'wrapper' ? getData(func) : undefined$1; + 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 - ) { + 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)) @@ -7121,15 +7379,15 @@ var app = (function (crypto$1) { : wrapper.thru(func); } } - return function() { + return function () { var args = arguments, - value = args[0]; + 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; + result = length ? funcs[index].apply(this, args) : value; while (++index < length) { result = funcs[index].call(this, result); @@ -7160,23 +7418,23 @@ var app = (function (crypto$1) { */ 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); + 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; + args = Array(length), + index = length; while (index--) { args[index] = arguments[index]; } if (isCurried) { var placeholder = getHolder(wrapper), - holdersCount = countHolders(args, placeholder); + holdersCount = countHolders(args, placeholder); } if (partials) { args = composeArgs(args, partials, holders, isCurried); @@ -7193,7 +7451,7 @@ var app = (function (crypto$1) { ); } var thisBinding = isBind ? thisArg : this, - fn = isBindKey ? thisBinding[func] : func; + fn = isBindKey ? thisBinding[func] : func; length = args.length; if (argPos) { @@ -7221,7 +7479,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new inverter function. */ function createInverter(setter, toIteratee) { - return function(object, iteratee) { + return function (object, iteratee) { return baseInverter(object, setter, toIteratee(iteratee), {}); }; } @@ -7235,7 +7493,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new mathematical operation function. */ function createMathOperation(operator, defaultValue) { - return function(value, other) { + return function (value, other) { var result; if (value === undefined$1 && other === undefined$1) { return defaultValue; @@ -7268,11 +7526,11 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { - return flatRest(function(iteratees) { + return flatRest(function (iteratees) { iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { + return baseRest(function (args) { var thisArg = this; - return arrayFunc(iteratees, function(iteratee) { + return arrayFunc(iteratees, function (iteratee) { return apply(iteratee, thisArg, args); }); }); @@ -7315,15 +7573,15 @@ var app = (function (crypto$1) { */ function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & WRAP_BIND_FLAG, - Ctor = createCtor(func); + Ctor = createCtor(func); function wrapper() { var argsIndex = -1, - argsLength = arguments.length, - leftIndex = -1, - leftLength = partials.length, - args = Array(leftLength + argsLength), - fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; while (++leftIndex < leftLength) { args[leftIndex] = partials[leftIndex]; @@ -7344,7 +7602,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new range function. */ function createRange(fromRight) { - return function(start, end, step) { + return function (start, end, step) { if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { end = step = undefined$1; } @@ -7369,7 +7627,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new relational operation function. */ function createRelationalOperation(operator) { - return function(value, other) { + return function (value, other) { if (!(typeof value == 'string' && typeof other == 'string')) { value = toNumber(value); other = toNumber(other); @@ -7397,10 +7655,10 @@ var app = (function (crypto$1) { */ function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & WRAP_CURRY_FLAG, - newHolders = isCurry ? holders : undefined$1, - newHoldersRight = isCurry ? undefined$1 : holders, - newPartials = isCurry ? partials : undefined$1, - newPartialsRight = isCurry ? undefined$1 : partials; + newHolders = isCurry ? holders : undefined$1, + newHoldersRight = isCurry ? undefined$1 : holders, + newPartials = isCurry ? partials : undefined$1, + newPartialsRight = isCurry ? undefined$1 : partials; bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); @@ -7430,14 +7688,14 @@ var app = (function (crypto$1) { */ function createRound(methodName) { var func = Math[methodName]; - return function(number, precision) { + return function (number, precision) { number = toNumber(number); precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); if (precision && nativeIsFinite(number)) { // Shift with exponential notation to avoid floating-point issues. // See [MDN](https://mdn.io/round#Examples) for more details. var pair = (toString(number) + 'e').split('e'), - value = func(pair[0] + 'e' + (+pair[1] + precision)); + value = func(pair[0] + 'e' + (+pair[1] + precision)); pair = (toString(value) + 'e').split('e'); return +(pair[0] + 'e' + (+pair[1] - precision)); @@ -7453,7 +7711,7 @@ var app = (function (crypto$1) { * @param {Array} values The values to add to the set. * @returns {Object} Returns the new set. */ - var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + var createSet = !(Set && (1 / setToArray(new Set([, -0]))[1]) == INFINITY) ? noop : function (values) { return new Set(values); }; @@ -7465,7 +7723,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new pairs function. */ function createToPairs(keysFunc) { - return function(object) { + return function (object) { var tag = getTag(object); if (tag == mapTag) { return mapToArray(object); @@ -7518,7 +7776,7 @@ var app = (function (crypto$1) { if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { var partialsRight = partials, - holdersRight = holders; + holdersRight = holders; partials = holders = undefined$1; } @@ -7571,7 +7829,7 @@ var app = (function (crypto$1) { */ function customDefaultsAssignIn(objValue, srcValue, key, object) { if (objValue === undefined$1 || - (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { return srcValue; } return objValue; @@ -7629,8 +7887,8 @@ var app = (function (crypto$1) { */ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - arrLength = array.length, - othLength = other.length; + arrLength = array.length, + othLength = other.length; if (arrLength != othLength && !(isPartial && othLength > arrLength)) { return false; @@ -7641,8 +7899,8 @@ var app = (function (crypto$1) { return stacked == other; } var index = -1, - result = true, - seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined$1; + result = true, + seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined$1; stack.set(array, other); stack.set(other, array); @@ -7650,7 +7908,7 @@ var app = (function (crypto$1) { // Ignore non-index properties. while (++index < arrLength) { var arrValue = array[index], - othValue = other[index]; + othValue = other[index]; if (customizer) { var compared = isPartial @@ -7666,19 +7924,19 @@ var app = (function (crypto$1) { } // 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); - } - })) { + 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) - )) { + arrValue === othValue || + equalFunc(arrValue, othValue, bitmask, customizer, stack) + )) { result = false; break; } @@ -7709,7 +7967,7 @@ var app = (function (crypto$1) { switch (tag) { case dataViewTag: if ((object.byteLength != other.byteLength) || - (object.byteOffset != other.byteOffset)) { + (object.byteOffset != other.byteOffset)) { return false; } object = object.buffer; @@ -7717,7 +7975,7 @@ var app = (function (crypto$1) { case arrayBufferTag: if ((object.byteLength != other.byteLength) || - !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { return false; } return true; @@ -7785,10 +8043,10 @@ var app = (function (crypto$1) { */ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { var isPartial = bitmask & COMPARE_PARTIAL_FLAG, - objProps = getAllKeys(object), - objLength = objProps.length, - othProps = getAllKeys(other), - othLength = othProps.length; + objProps = getAllKeys(object), + objLength = objProps.length, + othProps = getAllKeys(other), + othLength = othProps.length; if (objLength != othLength && !isPartial) { return false; @@ -7813,7 +8071,7 @@ var app = (function (crypto$1) { while (++index < objLength) { key = objProps[index]; var objValue = object[key], - othValue = other[key]; + othValue = other[key]; if (customizer) { var compared = isPartial @@ -7822,9 +8080,9 @@ var app = (function (crypto$1) { } // Recursively compare objects (susceptible to call stack limits). if (!(compared === undefined$1 - ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) - : compared - )) { + ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) + : compared + )) { result = false; break; } @@ -7832,13 +8090,13 @@ var app = (function (crypto$1) { } if (result && !skipCtor) { var objCtor = object.constructor, - othCtor = other.constructor; + othCtor = other.constructor; // Non `Object` object instances with different constructors are not equal. if (objCtor != othCtor && - ('constructor' in object && 'constructor' in other) && - !(typeof objCtor == 'function' && objCtor instanceof objCtor && - typeof othCtor == 'function' && othCtor instanceof othCtor)) { + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { result = false; } } @@ -7888,7 +8146,7 @@ var app = (function (crypto$1) { * @param {Function} func The function to query. * @returns {*} Returns the metadata for `func`. */ - var getData = !metaMap ? noop : function(func) { + var getData = !metaMap ? noop : function (func) { return metaMap.get(func); }; @@ -7901,12 +8159,12 @@ var app = (function (crypto$1) { */ function getFuncName(func) { var result = (func.name + ''), - array = realNames[result], - length = hasOwnProperty.call(realNames, result) ? array.length : 0; + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; while (length--) { var data = array[length], - otherFunc = data.func; + otherFunc = data.func; if (otherFunc == null || otherFunc == func) { return data.name; } @@ -7967,11 +8225,11 @@ var app = (function (crypto$1) { */ function getMatchData(object) { var result = keys(object), - length = result.length; + length = result.length; while (length--) { var key = result[length], - value = object[key]; + value = object[key]; result[length] = [key, value, isStrictComparable(value)]; } @@ -8000,12 +8258,12 @@ var app = (function (crypto$1) { */ function getRawTag(value) { var isOwn = hasOwnProperty.call(value, symToStringTag), - tag = value[symToStringTag]; + tag = value[symToStringTag]; try { value[symToStringTag] = undefined$1; var unmasked = true; - } catch (e) {} + } catch (e) { } var result = nativeObjectToString.call(value); if (unmasked) { @@ -8025,12 +8283,12 @@ var app = (function (crypto$1) { * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { + var getSymbols = !nativeGetSymbols ? stubArray : function (object) { if (object == null) { return []; } object = Object(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { + return arrayFilter(nativeGetSymbols(object), function (symbol) { return propertyIsEnumerable.call(object, symbol); }); }; @@ -8042,7 +8300,7 @@ var app = (function (crypto$1) { * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { + var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); @@ -8062,14 +8320,14 @@ var app = (function (crypto$1) { // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || - (Map && getTag(new Map) != mapTag) || - (Promise && getTag(Promise.resolve()) != promiseTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function (value) { var result = baseGetTag(value), - Ctor = result == objectTag ? value.constructor : undefined$1, - ctorString = Ctor ? toSource(Ctor) : ''; + Ctor = result == objectTag ? value.constructor : undefined$1, + ctorString = Ctor ? toSource(Ctor) : ''; if (ctorString) { switch (ctorString) { @@ -8096,16 +8354,16 @@ var app = (function (crypto$1) { */ function getView(start, end, transforms) { var index = -1, - length = transforms.length; + length = transforms.length; while (++index < length) { var data = transforms[index], - size = data.size; + size = data.size; switch (data.type) { - case 'drop': start += size; break; + case 'drop': start += size; break; case 'dropRight': end -= size; break; - case 'take': end = nativeMin(end, start + size); break; + case 'take': end = nativeMin(end, start + size); break; case 'takeRight': start = nativeMax(start, end - size); break; } } @@ -8137,8 +8395,8 @@ var app = (function (crypto$1) { path = castPath(path, object); var index = -1, - length = path.length, - result = false; + length = path.length, + result = false; while (++index < length) { var key = toKey(path[index]); @@ -8164,7 +8422,7 @@ var app = (function (crypto$1) { */ function initCloneArray(array) { var length = array.length, - result = new array.constructor(length); + result = new array.constructor(length); // Add properties assigned by `RegExp#exec`. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { @@ -8281,7 +8539,7 @@ var app = (function (crypto$1) { return !!length && (type == 'number' || (type != 'symbol' && reIsUint.test(value))) && - (value > -1 && value % 1 == 0 && value < length); + (value > -1 && value % 1 == 0 && value < length); } /** @@ -8300,9 +8558,9 @@ var app = (function (crypto$1) { } var type = typeof index; if (type == 'number' - ? (isArrayLike(object) && isIndex(index, object.length)) - : (type == 'string' && index in object) - ) { + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { return eq(object[index], value); } return false; @@ -8322,7 +8580,7 @@ var app = (function (crypto$1) { } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || - value == null || isSymbol(value)) { + value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || @@ -8353,7 +8611,7 @@ var app = (function (crypto$1) { */ function isLaziable(func) { var funcName = getFuncName(func), - other = lodash[funcName]; + other = lodash[funcName]; if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { return false; @@ -8394,7 +8652,7 @@ var app = (function (crypto$1) { */ function isPrototype(value) { var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; return value === proto; } @@ -8421,7 +8679,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new spec function. */ function matchesStrictComparable(key, srcValue) { - return function(object) { + return function (object) { if (object == null) { return false; } @@ -8439,7 +8697,7 @@ var app = (function (crypto$1) { * @returns {Function} Returns the new memoized function. */ function memoizeCapped(func) { - var result = memoize(func, function(key) { + var result = memoize(func, function (key) { if (cache.size === MAX_MEMOIZE_SIZE) { cache.clear(); } @@ -8468,9 +8726,9 @@ var app = (function (crypto$1) { */ function mergeData(data, source) { var bitmask = data[1], - srcBitmask = source[1], - newBitmask = bitmask | srcBitmask, - isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); var isCombo = ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || @@ -8562,11 +8820,11 @@ var app = (function (crypto$1) { */ function overRest(func, start, transform) { start = nativeMax(start === undefined$1 ? (func.length - 1) : start, 0); - return function() { + return function () { var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); while (++index < length) { array[index] = args[start + index]; @@ -8605,8 +8863,8 @@ var app = (function (crypto$1) { */ function reorder(array, indexes) { var arrLength = array.length, - length = nativeMin(indexes.length, arrLength), - oldArray = copyArray(array); + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); while (length--) { var index = indexes[length]; @@ -8659,7 +8917,7 @@ var app = (function (crypto$1) { * @param {number} wait The number of milliseconds to delay invocation. * @returns {number|Object} Returns the timer id or timeout object. */ - var setTimeout = ctxSetTimeout || function(func, wait) { + var setTimeout = ctxSetTimeout || function (func, wait) { return root.setTimeout(func, wait); }; @@ -8699,11 +8957,11 @@ var app = (function (crypto$1) { */ function shortOut(func) { var count = 0, - lastCalled = 0; + lastCalled = 0; - return function() { + return function () { var stamp = nativeNow(), - remaining = HOT_SPAN - (stamp - lastCalled); + remaining = HOT_SPAN - (stamp - lastCalled); lastCalled = stamp; if (remaining > 0) { @@ -8727,13 +8985,13 @@ var app = (function (crypto$1) { */ function shuffleSelf(array, size) { var index = -1, - length = array.length, - lastIndex = length - 1; + length = array.length, + lastIndex = length - 1; size = size === undefined$1 ? length : size; while (++index < size) { var rand = baseRandom(index, lastIndex), - value = array[rand]; + value = array[rand]; array[rand] = array[index]; array[index] = value; @@ -8749,12 +9007,12 @@ var app = (function (crypto$1) { * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ - var stringToPath = memoizeCapped(function(string) { + var stringToPath = memoizeCapped(function (string) { var result = []; if (string.charCodeAt(0) === 46 /* . */) { result.push(''); } - string.replace(rePropName, function(match, number, quote, subString) { + string.replace(rePropName, function (match, number, quote, subString) { result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); }); return result; @@ -8786,10 +9044,10 @@ var app = (function (crypto$1) { if (func != null) { try { return funcToString.call(func); - } catch (e) {} + } catch (e) { } try { return (func + ''); - } catch (e) {} + } catch (e) { } } return ''; } @@ -8803,7 +9061,7 @@ var app = (function (crypto$1) { * @returns {Array} Returns `details`. */ function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { + arrayEach(wrapFlags, function (pair) { var value = '_.' + pair[0]; if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { details.push(value); @@ -8825,7 +9083,7 @@ var app = (function (crypto$1) { } var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); result.__actions__ = copyArray(wrapper.__actions__); - result.__index__ = wrapper.__index__; + result.__index__ = wrapper.__index__; result.__values__ = wrapper.__values__; return result; } @@ -8864,8 +9122,8 @@ var app = (function (crypto$1) { return []; } var index = 0, - resIndex = 0, - result = Array(nativeCeil(length / size)); + resIndex = 0, + result = Array(nativeCeil(length / size)); while (index < length) { result[resIndex++] = baseSlice(array, index, (index += size)); @@ -8890,9 +9148,9 @@ var app = (function (crypto$1) { */ function compact(array) { var index = -1, - length = array == null ? 0 : array.length, - resIndex = 0, - result = []; + length = array == null ? 0 : array.length, + resIndex = 0, + result = []; while (++index < length) { var value = array[index]; @@ -8931,8 +9189,8 @@ var app = (function (crypto$1) { return []; } var args = Array(length - 1), - array = arguments[0], - index = length; + array = arguments[0], + index = length; while (index--) { args[index - 1] = arguments[index]; @@ -8961,7 +9219,7 @@ var app = (function (crypto$1) { * _.difference([2, 1], [2, 3]); * // => [1] */ - var difference = baseRest(function(array, values) { + var difference = baseRest(function (array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; @@ -8993,7 +9251,7 @@ var app = (function (crypto$1) { * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var differenceBy = baseRest(function(array, values) { + var differenceBy = baseRest(function (array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined$1; @@ -9026,7 +9284,7 @@ var app = (function (crypto$1) { * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ - var differenceWith = baseRest(function(array, values) { + var differenceWith = baseRest(function (array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined$1; @@ -9409,8 +9667,8 @@ var app = (function (crypto$1) { */ function fromPairs(pairs) { var index = -1, - length = pairs == null ? 0 : pairs.length, - result = {}; + length = pairs == null ? 0 : pairs.length, + result = {}; while (++index < length) { var pair = pairs[index]; @@ -9512,7 +9770,7 @@ var app = (function (crypto$1) { * _.intersection([2, 1], [2, 3]); * // => [2] */ - var intersection = baseRest(function(arrays) { + var intersection = baseRest(function (arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) @@ -9542,9 +9800,9 @@ var app = (function (crypto$1) { * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ - var intersectionBy = baseRest(function(arrays) { + var intersectionBy = baseRest(function (arrays) { var iteratee = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); + mapped = arrayMap(arrays, castArrayLikeObject); if (iteratee === last(mapped)) { iteratee = undefined$1; @@ -9577,9 +9835,9 @@ var app = (function (crypto$1) { * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ - var intersectionWith = baseRest(function(arrays) { + var intersectionWith = baseRest(function (arrays) { var comparator = last(arrays), - mapped = arrayMap(arrays, castArrayLikeObject); + mapped = arrayMap(arrays, castArrayLikeObject); comparator = typeof comparator == 'function' ? comparator : undefined$1; if (comparator) { @@ -9822,11 +10080,11 @@ var app = (function (crypto$1) { * console.log(pulled); * // => ['b', 'd'] */ - var pullAt = flatRest(function(array, indexes) { + var pullAt = flatRest(function (array, indexes) { var length = array == null ? 0 : array.length, - result = baseAt(array, indexes); + result = baseAt(array, indexes); - basePullAt(array, arrayMap(indexes, function(index) { + basePullAt(array, arrayMap(indexes, function (index) { return isIndex(index, length) ? +index : index; }).sort(compareAscending)); @@ -9867,8 +10125,8 @@ var app = (function (crypto$1) { return result; } var index = -1, - indexes = [], - length = array.length; + indexes = [], + length = array.length; predicate = getIteratee(predicate, 3); while (++index < length) { @@ -10324,7 +10582,7 @@ var app = (function (crypto$1) { * _.union([2], [1, 2]); * // => [2, 1] */ - var union = baseRest(function(arrays) { + var union = baseRest(function (arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); @@ -10351,7 +10609,7 @@ var app = (function (crypto$1) { * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ - var unionBy = baseRest(function(arrays) { + var unionBy = baseRest(function (arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined$1; @@ -10380,7 +10638,7 @@ var app = (function (crypto$1) { * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var unionWith = baseRest(function(arrays) { + 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); @@ -10484,13 +10742,13 @@ var app = (function (crypto$1) { return []; } var length = 0; - array = arrayFilter(array, function(group) { + array = arrayFilter(array, function (group) { if (isArrayLikeObject(group)) { length = nativeMax(group.length, length); return true; } }); - return baseTimes(length, function(index) { + return baseTimes(length, function (index) { return arrayMap(array, baseProperty(index)); }); } @@ -10524,7 +10782,7 @@ var app = (function (crypto$1) { if (iteratee == null) { return result; } - return arrayMap(result, function(group) { + return arrayMap(result, function (group) { return apply(iteratee, undefined$1, group); }); } @@ -10549,7 +10807,7 @@ var app = (function (crypto$1) { * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ - var without = baseRest(function(array, values) { + var without = baseRest(function (array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; @@ -10573,7 +10831,7 @@ var app = (function (crypto$1) { * _.xor([2, 1], [2, 3]); * // => [1, 3] */ - var xor = baseRest(function(arrays) { + var xor = baseRest(function (arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); @@ -10600,7 +10858,7 @@ var app = (function (crypto$1) { * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var xorBy = baseRest(function(arrays) { + var xorBy = baseRest(function (arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined$1; @@ -10629,7 +10887,7 @@ var app = (function (crypto$1) { * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var xorWith = baseRest(function(arrays) { + var xorWith = baseRest(function (arrays) { var comparator = last(arrays); comparator = typeof comparator == 'function' ? comparator : undefined$1; return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator); @@ -10712,9 +10970,9 @@ var app = (function (crypto$1) { * }); * // => [111, 222] */ - var zipWith = baseRest(function(arrays) { + var zipWith = baseRest(function (arrays) { var length = arrays.length, - iteratee = length > 1 ? arrays[length - 1] : undefined$1; + iteratee = length > 1 ? arrays[length - 1] : undefined$1; iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined$1; return unzipWith(arrays, iteratee); @@ -10828,14 +11086,14 @@ var app = (function (crypto$1) { * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ - var wrapperAt = flatRest(function(paths) { + var wrapperAt = flatRest(function (paths) { var length = paths.length, - start = length ? paths[0] : 0, - value = this.__wrapped__, - interceptor = function(object) { return baseAt(object, paths); }; + 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)) { + !(value instanceof LazyWrapper) || !isIndex(start)) { return this.thru(interceptor); } value = value.slice(start, +start + (length ? 1 : 0)); @@ -10844,7 +11102,7 @@ var app = (function (crypto$1) { 'args': [interceptor], 'thisArg': undefined$1 }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { + return new LodashWrapper(value, this.__chain__).thru(function (array) { if (length && !array.length) { array.push(undefined$1); } @@ -10940,7 +11198,7 @@ var app = (function (crypto$1) { this.__values__ = toArray(this.value()); } var done = this.__index__ >= this.__values__.length, - value = done ? undefined$1 : this.__values__[this.__index__++]; + value = done ? undefined$1 : this.__values__[this.__index__++]; return { 'done': done, 'value': value }; } @@ -10993,7 +11251,7 @@ var app = (function (crypto$1) { */ function wrapperPlant(value) { var result, - parent = this; + parent = this; while (parent instanceof baseLodash) { var clone = wrapperClone(parent); @@ -11091,7 +11349,7 @@ var app = (function (crypto$1) { * _.countBy(['one', 'two', 'three'], 'length'); * // => { '3': 2, '5': 1 } */ - var countBy = createAggregator(function(result, value, key) { + var countBy = createAggregator(function (result, value, key) { if (hasOwnProperty.call(result, key)) { ++result[key]; } else { @@ -11407,7 +11665,7 @@ var app = (function (crypto$1) { * _.groupBy(['one', 'two', 'three'], 'length'); * // => { '3': ['one', 'two'], '5': ['three'] } */ - var groupBy = createAggregator(function(result, value, key) { + var groupBy = createAggregator(function (result, value, key) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { @@ -11481,12 +11739,12 @@ var app = (function (crypto$1) { * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ - var invokeMap = baseRest(function(collection, path, args) { + var invokeMap = baseRest(function (collection, path, args) { var index = -1, - isFunc = typeof path == 'function', - result = isArrayLike(collection) ? Array(collection.length) : []; + isFunc = typeof path == 'function', + result = isArrayLike(collection) ? Array(collection.length) : []; - baseEach(collection, function(value) { + baseEach(collection, function (value) { result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); }); return result; @@ -11520,7 +11778,7 @@ var app = (function (crypto$1) { * _.keyBy(array, 'dir'); * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ - var keyBy = createAggregator(function(result, value, key) { + var keyBy = createAggregator(function (result, value, key) { baseAssignValue(result, key, value); }); @@ -11650,9 +11908,9 @@ var app = (function (crypto$1) { * _.partition(users, 'active'); * // => objects for [['fred'], ['barney', 'pebbles']] */ - var partition = createAggregator(function(result, value, key) { + var partition = createAggregator(function (result, value, key) { result[key ? 0 : 1].push(value); - }, function() { return [[], []]; }); + }, function () { return [[], []]; }); /** * Reduces `collection` to a value which is the accumulated result of running @@ -11693,7 +11951,7 @@ var app = (function (crypto$1) { */ function reduce(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduce : baseReduce, - initAccum = arguments.length < 3; + initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); } @@ -11722,7 +11980,7 @@ var app = (function (crypto$1) { */ function reduceRight(collection, iteratee, accumulator) { var func = isArray(collection) ? arrayReduceRight : baseReduce, - initAccum = arguments.length < 3; + initAccum = arguments.length < 3; return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); } @@ -11943,7 +12201,7 @@ var app = (function (crypto$1) { * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] */ - var sortBy = baseRest(function(collection, iteratees) { + var sortBy = baseRest(function (collection, iteratees) { if (collection == null) { return []; } @@ -11974,7 +12232,7 @@ var app = (function (crypto$1) { * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ - var now = ctxNow || function() { + var now = ctxNow || function () { return root.Date.now(); }; @@ -12009,7 +12267,7 @@ var app = (function (crypto$1) { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); - return function() { + return function () { if (--n < 1) { return func.apply(this, arguments); } @@ -12062,7 +12320,7 @@ var app = (function (crypto$1) { throw new TypeError(FUNC_ERROR_TEXT); } n = toInteger(n); - return function() { + return function () { if (--n > 0) { result = func.apply(this, arguments); } @@ -12108,7 +12366,7 @@ var app = (function (crypto$1) { * bound('hi'); * // => 'hi fred!' */ - var bind = baseRest(function(func, thisArg, partials) { + var bind = baseRest(function (func, thisArg, partials) { var bitmask = WRAP_BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); @@ -12162,7 +12420,7 @@ var app = (function (crypto$1) { * bound('hi'); * // => 'hiya fred!' */ - var bindKey = baseRest(function(object, key, partials) { + 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)); @@ -12320,15 +12578,15 @@ var app = (function (crypto$1) { */ function debounce(func, wait, options) { var lastArgs, - lastThis, - maxWait, - result, - timerId, - lastCallTime, - lastInvokeTime = 0, - leading = false, - maxing = false, - trailing = true; + lastThis, + maxWait, + result, + timerId, + lastCallTime, + lastInvokeTime = 0, + leading = false, + maxing = false, + trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); @@ -12343,7 +12601,7 @@ var app = (function (crypto$1) { function invokeFunc(time) { var args = lastArgs, - thisArg = lastThis; + thisArg = lastThis; lastArgs = lastThis = undefined$1; lastInvokeTime = time; @@ -12362,8 +12620,8 @@ var app = (function (crypto$1) { function remainingWait(time) { var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime, - timeWaiting = wait - timeSinceLastCall; + timeSinceLastInvoke = time - lastInvokeTime, + timeWaiting = wait - timeSinceLastCall; return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) @@ -12372,7 +12630,7 @@ var app = (function (crypto$1) { function shouldInvoke(time) { var timeSinceLastCall = time - lastCallTime, - timeSinceLastInvoke = time - lastInvokeTime; + 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 @@ -12416,7 +12674,7 @@ var app = (function (crypto$1) { function debounced() { var time = now(), - isInvoking = shouldInvoke(time); + isInvoking = shouldInvoke(time); lastArgs = arguments; lastThis = this; @@ -12461,7 +12719,7 @@ var app = (function (crypto$1) { * }, 'deferred'); * // => Logs 'deferred' after one millisecond. */ - var defer = baseRest(function(func, args) { + var defer = baseRest(function (func, args) { return baseDelay(func, 1, args); }); @@ -12484,7 +12742,7 @@ var app = (function (crypto$1) { * }, 1000, 'later'); * // => Logs 'later' after one second. */ - var delay = baseRest(function(func, wait, args) { + var delay = baseRest(function (func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); @@ -12558,10 +12816,10 @@ var app = (function (crypto$1) { if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } - var memoized = function() { + var memoized = function () { var args = arguments, - key = resolver ? resolver.apply(this, args) : args[0], - cache = memoized.cache; + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; if (cache.has(key)) { return cache.get(key); @@ -12601,7 +12859,7 @@ var app = (function (crypto$1) { if (typeof predicate != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } - return function() { + return function () { var args = arguments; switch (args.length) { case 0: return !predicate.call(this); @@ -12666,15 +12924,15 @@ var app = (function (crypto$1) { * func(10, 5); * // => [100, 10] */ - var overArgs = castRest(function(func, transforms) { + 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) { + return baseRest(function (args) { var index = -1, - length = nativeMin(args.length, funcsLength); + length = nativeMin(args.length, funcsLength); while (++index < length) { args[index] = transforms[index].call(this, args[index]); @@ -12716,7 +12974,7 @@ var app = (function (crypto$1) { * greetFred('hi'); * // => 'hi fred' */ - var partial = baseRest(function(func, partials) { + var partial = baseRest(function (func, partials) { var holders = replaceHolders(partials, getHolder(partial)); return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders); }); @@ -12753,7 +13011,7 @@ var app = (function (crypto$1) { * sayHelloTo('fred'); * // => 'hello fred' */ - var partialRight = baseRest(function(func, partials) { + var partialRight = baseRest(function (func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders); }); @@ -12780,7 +13038,7 @@ var app = (function (crypto$1) { * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ - var rearg = flatRest(function(func, indexes) { + var rearg = flatRest(function (func, indexes) { return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes); }); @@ -12856,9 +13114,9 @@ var app = (function (crypto$1) { throw new TypeError(FUNC_ERROR_TEXT); } start = start == null ? 0 : nativeMax(toInteger(start), 0); - return baseRest(function(args) { + return baseRest(function (args) { var array = args[start], - otherArgs = castSlice(args, 0, start); + otherArgs = castSlice(args, 0, start); if (array) { arrayPush(otherArgs, array); @@ -12913,7 +13171,7 @@ var app = (function (crypto$1) { */ function throttle(func, wait, options) { var leading = true, - trailing = true; + trailing = true; if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); @@ -13250,7 +13508,7 @@ var app = (function (crypto$1) { * _.gte(1, 3); * // => false */ - var gte = createRelationalOperation(function(value, other) { + var gte = createRelationalOperation(function (value, other) { return value >= other; }); @@ -13272,7 +13530,7 @@ var app = (function (crypto$1) { * _.isArguments([1, 2, 3]); * // => false */ - var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + var isArguments = baseIsArguments(function () { return arguments; }()) ? baseIsArguments : function (value) { return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee'); }; @@ -13498,8 +13756,8 @@ var app = (function (crypto$1) { return true; } if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || - isBuffer(value) || isTypedArray(value) || isArguments(value))) { + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); @@ -14306,7 +14564,7 @@ var app = (function (crypto$1) { * _.lte(3, 1); * // => false */ - var lte = createRelationalOperation(function(value, other) { + var lte = createRelationalOperation(function (value, other) { return value <= other; }); @@ -14344,7 +14602,7 @@ var app = (function (crypto$1) { return iteratorToArray(value[symIterator]()); } var tag = getTag(value), - func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); return func(value); } @@ -14412,7 +14670,7 @@ var app = (function (crypto$1) { */ function toInteger(value) { var result = toFinite(value), - remainder = result % 1; + remainder = result % 1; return result === result ? (remainder ? result - remainder : result) : 0; } @@ -14609,7 +14867,7 @@ var app = (function (crypto$1) { * _.assign({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'c': 3 } */ - var assign = createAssigner(function(object, source) { + var assign = createAssigner(function (object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; @@ -14652,7 +14910,7 @@ var app = (function (crypto$1) { * _.assignIn({ 'a': 0 }, new Foo, new Bar); * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ - var assignIn = createAssigner(function(object, source) { + var assignIn = createAssigner(function (object, source) { copyObject(source, keysIn(source), object); }); @@ -14685,7 +14943,7 @@ var app = (function (crypto$1) { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + var assignInWith = createAssigner(function (object, source, srcIndex, customizer) { copyObject(source, keysIn(source), object, customizer); }); @@ -14717,7 +14975,7 @@ var app = (function (crypto$1) { * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + var assignWith = createAssigner(function (object, source, srcIndex, customizer) { copyObject(source, keys(source), object, customizer); }); @@ -14800,7 +15058,7 @@ var app = (function (crypto$1) { * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); * // => { 'a': 1, 'b': 2 } */ - var defaults = baseRest(function(object, sources) { + var defaults = baseRest(function (object, sources) { object = Object(object); var index = -1; @@ -14822,7 +15080,7 @@ var app = (function (crypto$1) { var value = object[key]; if (value === undefined$1 || - (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { + (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { object[key] = source[key]; } } @@ -14850,7 +15108,7 @@ var app = (function (crypto$1) { * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); * // => { 'a': { 'b': 2, 'c': 3 } } */ - var defaultsDeep = baseRest(function(args) { + var defaultsDeep = baseRest(function (args) { args.push(undefined$1, customDefaultsMerge); return apply(mergeWith, undefined$1, args); }); @@ -15224,9 +15482,9 @@ var app = (function (crypto$1) { * _.invert(object); * // => { '1': 'c', '2': 'b' } */ - var invert = createInverter(function(result, value, key) { + var invert = createInverter(function (result, value, key) { if (value != null && - typeof value.toString != 'function') { + typeof value.toString != 'function') { value = nativeObjectToString.call(value); } @@ -15259,9 +15517,9 @@ var app = (function (crypto$1) { * }); * // => { 'group1': ['a', 'c'], 'group2': ['b'] } */ - var invertBy = createInverter(function(result, value, key) { + var invertBy = createInverter(function (result, value, key) { if (value != null && - typeof value.toString != 'function') { + typeof value.toString != 'function') { value = nativeObjectToString.call(value); } @@ -15376,7 +15634,7 @@ var app = (function (crypto$1) { var result = {}; iteratee = getIteratee(iteratee, 3); - baseForOwn(object, function(value, key, object) { + baseForOwn(object, function (value, key, object) { baseAssignValue(result, iteratee(value, key, object), value); }); return result; @@ -15414,7 +15672,7 @@ var app = (function (crypto$1) { var result = {}; iteratee = getIteratee(iteratee, 3); - baseForOwn(object, function(value, key, object) { + baseForOwn(object, function (value, key, object) { baseAssignValue(result, key, iteratee(value, key, object)); }); return result; @@ -15451,7 +15709,7 @@ var app = (function (crypto$1) { * _.merge(object, other); * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ - var merge = createAssigner(function(object, source, srcIndex) { + var merge = createAssigner(function (object, source, srcIndex) { baseMerge(object, source, srcIndex); }); @@ -15486,7 +15744,7 @@ var app = (function (crypto$1) { * _.mergeWith(object, other, customizer); * // => { 'a': [1, 3], 'b': [2, 4] } */ - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + var mergeWith = createAssigner(function (object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); }); @@ -15510,13 +15768,13 @@ var app = (function (crypto$1) { * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ - var omit = flatRest(function(object, paths) { + var omit = flatRest(function (object, paths) { var result = {}; if (object == null) { return result; } var isDeep = false; - paths = arrayMap(paths, function(path) { + paths = arrayMap(paths, function (path) { path = castPath(path, object); isDeep || (isDeep = path.length > 1); return path; @@ -15573,7 +15831,7 @@ var app = (function (crypto$1) { * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ - var pick = flatRest(function(object, paths) { + var pick = flatRest(function (object, paths) { return object == null ? {} : basePick(object, paths); }); @@ -15599,11 +15857,11 @@ var app = (function (crypto$1) { if (object == null) { return {}; } - var props = arrayMap(getAllKeysIn(object), function(prop) { + var props = arrayMap(getAllKeysIn(object), function (prop) { return [prop]; }); predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { + return basePickBy(object, props, function (value, path) { return predicate(value, path[0]); }); } @@ -15641,7 +15899,7 @@ var app = (function (crypto$1) { path = castPath(path, object); var index = -1, - length = path.length; + length = path.length; // Ensure the loop is entered when path is empty. if (!length) { @@ -15804,7 +16062,7 @@ var app = (function (crypto$1) { */ function transform(object, iteratee, accumulator) { var isArr = isArray(object), - isArrLike = isArr || isBuffer(object) || isTypedArray(object); + isArrLike = isArr || isBuffer(object) || isTypedArray(object); iteratee = getIteratee(iteratee, 4); if (accumulator == null) { @@ -15819,7 +16077,7 @@ var app = (function (crypto$1) { accumulator = {}; } } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { + (isArrLike ? arrayEach : baseForOwn)(object, function (value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; @@ -16153,7 +16411,7 @@ var app = (function (crypto$1) { * _.camelCase('__FOO_BAR__'); * // => 'fooBar' */ - var camelCase = createCompounder(function(result, word, index) { + var camelCase = createCompounder(function (result, word, index) { word = word.toLowerCase(); return result + (index ? capitalize(word) : word); }); @@ -16315,7 +16573,7 @@ var app = (function (crypto$1) { * _.kebabCase('__FOO_BAR__'); * // => 'foo-bar' */ - var kebabCase = createCompounder(function(result, word, index) { + var kebabCase = createCompounder(function (result, word, index) { return result + (index ? '-' : '') + word.toLowerCase(); }); @@ -16339,7 +16597,7 @@ var app = (function (crypto$1) { * _.lowerCase('__FOO_BAR__'); * // => 'foo bar' */ - var lowerCase = createCompounder(function(result, word, index) { + var lowerCase = createCompounder(function (result, word, index) { return result + (index ? ' ' : '') + word.toLowerCase(); }); @@ -16552,7 +16810,7 @@ var app = (function (crypto$1) { */ function replace() { var args = arguments, - string = toString(args[0]); + string = toString(args[0]); return args.length < 3 ? string : string.replace(args[1], args[2]); } @@ -16578,7 +16836,7 @@ var app = (function (crypto$1) { * _.snakeCase('--FOO-BAR--'); * // => 'foo_bar' */ - var snakeCase = createCompounder(function(result, word, index) { + var snakeCase = createCompounder(function (result, word, index) { return result + (index ? '_' : '') + word.toLowerCase(); }); @@ -16611,9 +16869,9 @@ var app = (function (crypto$1) { } string = toString(string); if (string && ( - typeof separator == 'string' || - (separator != null && !isRegExp(separator)) - )) { + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { separator = baseToString(separator); if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); @@ -16643,7 +16901,7 @@ var app = (function (crypto$1) { * _.startCase('__FOO_BAR__'); * // => 'FOO BAR' */ - var startCase = createCompounder(function(result, word, index) { + var startCase = createCompounder(function (result, word, index) { return result + (index ? ' ' : '') + upperFirst(word); }); @@ -16797,14 +17055,14 @@ var app = (function (crypto$1) { options = assignInWith({}, options, settings, customDefaultsAssignIn); var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), - importsKeys = keys(imports), - importsValues = baseValues(imports, importsKeys); + importsKeys = keys(imports), + importsValues = baseValues(imports, importsKeys); var isEscaping, - isEvaluating, - index = 0, - interpolate = options.interpolate || reNoMatch, - source = "__p += '"; + isEvaluating, + index = 0, + interpolate = options.interpolate || reNoMatch, + source = "__p += '"; // Compile the regexp to match each delimiter. var reDelimiters = RegExp( @@ -16812,7 +17070,7 @@ var app = (function (crypto$1) { interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$' - , 'g'); + , 'g'); // Use a sourceURL for easier debugging. // The sourceURL gets injected into the source that's eval-ed, so be careful @@ -16824,7 +17082,7 @@ var app = (function (crypto$1) { : ('lodash.templateSources[' + (++templateCounter) + ']') ) + '\n'; - string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { + string.replace(reDelimiters, function (match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { interpolateValue || (interpolateValue = esTemplateValue); // Escape characters that can't be included in string literals. @@ -16872,18 +17130,18 @@ var app = (function (crypto$1) { ) + "var __t, __p = ''" + (isEscaping - ? ', __e = _.escape' - : '' + ? ', __e = _.escape' + : '' ) + (isEvaluating ? ', __j = Array.prototype.join;\n' + - "function print() { __p += __j.call(arguments, '') }\n" + "function print() { __p += __j.call(arguments, '') }\n" : ';\n' ) + source + 'return __p\n}'; - var result = attempt(function() { + var result = attempt(function () { return Function(importsKeys, sourceURL + 'return ' + source) .apply(undefined$1, importsValues); }); @@ -16978,9 +17236,9 @@ var app = (function (crypto$1) { return string; } var strSymbols = stringToArray(string), - chrSymbols = stringToArray(chars), - start = charsStartIndex(strSymbols, chrSymbols), - end = charsEndIndex(strSymbols, chrSymbols) + 1; + chrSymbols = stringToArray(chars), + start = charsStartIndex(strSymbols, chrSymbols), + end = charsEndIndex(strSymbols, chrSymbols) + 1; return castSlice(strSymbols, start, end).join(''); } @@ -17013,7 +17271,7 @@ var app = (function (crypto$1) { return string; } var strSymbols = stringToArray(string), - end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; + end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; return castSlice(strSymbols, 0, end).join(''); } @@ -17046,7 +17304,7 @@ var app = (function (crypto$1) { return string; } var strSymbols = stringToArray(string), - start = charsStartIndex(strSymbols, stringToArray(chars)); + start = charsStartIndex(strSymbols, stringToArray(chars)); return castSlice(strSymbols, start).join(''); } @@ -17090,7 +17348,7 @@ var app = (function (crypto$1) { */ function truncate(string, options) { var length = DEFAULT_TRUNC_LENGTH, - omission = DEFAULT_TRUNC_OMISSION; + omission = DEFAULT_TRUNC_OMISSION; if (isObject(options)) { var separator = 'separator' in options ? options.separator : separator; @@ -17124,7 +17382,7 @@ var app = (function (crypto$1) { if (isRegExp(separator)) { if (string.slice(end).search(separator)) { var match, - substring = result; + substring = result; if (!separator.global) { separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); @@ -17190,7 +17448,7 @@ var app = (function (crypto$1) { * _.upperCase('__foo_bar__'); * // => 'FOO BAR' */ - var upperCase = createCompounder(function(result, word, index) { + var upperCase = createCompounder(function (result, word, index) { return result + (index ? ' ' : '') + word.toUpperCase(); }); @@ -17266,7 +17524,7 @@ var app = (function (crypto$1) { * elements = []; * } */ - var attempt = baseRest(function(func, args) { + var attempt = baseRest(function (func, args) { try { return apply(func, undefined$1, args); } catch (e) { @@ -17300,8 +17558,8 @@ var app = (function (crypto$1) { * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ - var bindAll = flatRest(function(object, methodNames) { - arrayEach(methodNames, function(key) { + var bindAll = flatRest(function (object, methodNames) { + arrayEach(methodNames, function (key) { key = toKey(key); baseAssignValue(object, key, bind(object[key], object)); }); @@ -17339,16 +17597,16 @@ var app = (function (crypto$1) { */ function cond(pairs) { var length = pairs == null ? 0 : pairs.length, - toIteratee = getIteratee(); + toIteratee = getIteratee(); - pairs = !length ? [] : arrayMap(pairs, function(pair) { + 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) { + return baseRest(function (args) { var index = -1; while (++index < length) { var pair = pairs[index]; @@ -17407,7 +17665,7 @@ var app = (function (crypto$1) { * // => true */ function constant(value) { - return function() { + return function () { return value; }; } @@ -17635,8 +17893,8 @@ var app = (function (crypto$1) { * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ - var method = baseRest(function(path, args) { - return function(object) { + var method = baseRest(function (path, args) { + return function (object) { return baseInvoke(object, path, args); }; }); @@ -17664,8 +17922,8 @@ var app = (function (crypto$1) { * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] */ - var methodOf = baseRest(function(object, args) { - return function(path) { + var methodOf = baseRest(function (object, args) { + return function (path) { return baseInvoke(object, path, args); }; }); @@ -17708,27 +17966,27 @@ var app = (function (crypto$1) { */ function mixin(object, source, options) { var props = keys(source), - methodNames = baseFunctions(source, props); + methodNames = baseFunctions(source, props); if (options == null && - !(isObject(source) && (methodNames.length || !props.length))) { + !(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); + isFunc = isFunction(object); - arrayEach(methodNames, function(methodName) { + arrayEach(methodNames, function (methodName) { var func = source[methodName]; object[methodName] = func; if (isFunc) { - object.prototype[methodName] = function() { + object.prototype[methodName] = function () { var chainAll = this.__chain__; if (chain || chainAll) { var result = object(this.__wrapped__), - actions = result.__actions__ = copyArray(this.__actions__); + actions = result.__actions__ = copyArray(this.__actions__); actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); result.__chain__ = chainAll; @@ -17800,7 +18058,7 @@ var app = (function (crypto$1) { */ function nthArg(n) { n = toInteger(n); - return baseRest(function(args) { + return baseRest(function (args) { return baseNth(args, n); }); } @@ -17925,7 +18183,7 @@ var app = (function (crypto$1) { * // => [2, 0] */ function propertyOf(object) { - return function(path) { + return function (path) { return object == null ? undefined$1 : baseGet(object, path); }; } @@ -18131,7 +18389,7 @@ var app = (function (crypto$1) { return []; } var index = MAX_ARRAY_LENGTH, - length = nativeMin(n, MAX_ARRAY_LENGTH); + length = nativeMin(n, MAX_ARRAY_LENGTH); iteratee = getIteratee(iteratee); n -= MAX_ARRAY_LENGTH; @@ -18206,7 +18464,7 @@ var app = (function (crypto$1) { * _.add(6, 4); * // => 10 */ - var add = createMathOperation(function(augend, addend) { + var add = createMathOperation(function (augend, addend) { return augend + addend; }, 0); @@ -18248,7 +18506,7 @@ var app = (function (crypto$1) { * _.divide(6, 4); * // => 1.5 */ - var divide = createMathOperation(function(dividend, divisor) { + var divide = createMathOperation(function (dividend, divisor) { return dividend / divisor; }, 1); @@ -18441,7 +18699,7 @@ var app = (function (crypto$1) { * _.multiply(6, 4); * // => 24 */ - var multiply = createMathOperation(function(multiplier, multiplicand) { + var multiply = createMathOperation(function (multiplier, multiplicand) { return multiplier * multiplicand; }, 1); @@ -18483,7 +18741,7 @@ var app = (function (crypto$1) { * _.subtract(6, 4); * // => 2 */ - var subtract = createMathOperation(function(minuend, subtrahend) { + var subtract = createMathOperation(function (minuend, subtrahend) { return minuend - subtrahend; }, 0); @@ -18856,9 +19114,9 @@ var app = (function (crypto$1) { lodash.eachRight = forEachRight; lodash.first = head; - mixin(lodash, (function() { + mixin(lodash, (function () { var source = {}; - baseForOwn(lodash, function(func, methodName) { + baseForOwn(lodash, function (func, methodName) { if (!hasOwnProperty.call(lodash.prototype, methodName)) { source[methodName] = func; } @@ -18878,13 +19136,13 @@ var app = (function (crypto$1) { lodash.VERSION = VERSION; // Assign default placeholders. - arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { + 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) { + 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) @@ -18902,17 +19160,17 @@ var app = (function (crypto$1) { return result; }; - LazyWrapper.prototype[methodName + 'Right'] = function(n) { + 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) { + arrayEach(['filter', 'map', 'takeWhile'], function (methodName, index) { var type = index + 1, - isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; + isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; - LazyWrapper.prototype[methodName] = function(iteratee) { + LazyWrapper.prototype[methodName] = function (iteratee) { var result = this.clone(); result.__iteratees__.push({ 'iteratee': getIteratee(iteratee, 3), @@ -18924,49 +19182,49 @@ var app = (function (crypto$1) { }); // Add `LazyWrapper` methods for `_.head` and `_.last`. - arrayEach(['head', 'last'], function(methodName, index) { + arrayEach(['head', 'last'], function (methodName, index) { var takeName = 'take' + (index ? 'Right' : ''); - LazyWrapper.prototype[methodName] = function() { + LazyWrapper.prototype[methodName] = function () { return this[takeName](1).value()[0]; }; }); // Add `LazyWrapper` methods for `_.initial` and `_.tail`. - arrayEach(['initial', 'tail'], function(methodName, index) { + arrayEach(['initial', 'tail'], function (methodName, index) { var dropName = 'drop' + (index ? '' : 'Right'); - LazyWrapper.prototype[methodName] = function() { + LazyWrapper.prototype[methodName] = function () { return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); }; }); - LazyWrapper.prototype.compact = function() { + LazyWrapper.prototype.compact = function () { return this.filter(identity); }; - LazyWrapper.prototype.find = function(predicate) { + LazyWrapper.prototype.find = function (predicate) { return this.filter(predicate).head(); }; - LazyWrapper.prototype.findLast = function(predicate) { + LazyWrapper.prototype.findLast = function (predicate) { return this.reverse().find(predicate); }; - LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { + LazyWrapper.prototype.invokeMap = baseRest(function (path, args) { if (typeof path == 'function') { return new LazyWrapper(this); } - return this.map(function(value) { + return this.map(function (value) { return baseInvoke(value, path, args); }); }); - LazyWrapper.prototype.reject = function(predicate) { + LazyWrapper.prototype.reject = function (predicate) { return this.filter(negate(getIteratee(predicate))); }; - LazyWrapper.prototype.slice = function(start, end) { + LazyWrapper.prototype.slice = function (start, end) { start = toInteger(start); var result = this; @@ -18985,32 +19243,32 @@ var app = (function (crypto$1) { return result; }; - LazyWrapper.prototype.takeRightWhile = function(predicate) { + LazyWrapper.prototype.takeRightWhile = function (predicate) { return this.reverse().takeWhile(predicate).reverse(); }; - LazyWrapper.prototype.toArray = function() { + LazyWrapper.prototype.toArray = function () { return this.take(MAX_ARRAY_LENGTH); }; // Add `LazyWrapper` methods to `lodash.prototype`. - baseForOwn(LazyWrapper.prototype, function(func, methodName) { + 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); + 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() { + lodash.prototype[methodName] = function () { var value = this.__wrapped__, - args = isTaker ? [1] : arguments, - isLazy = value instanceof LazyWrapper, - iteratee = args[0], - useLazy = isLazy || isArray(value); + args = isTaker ? [1] : arguments, + isLazy = value instanceof LazyWrapper, + iteratee = args[0], + useLazy = isLazy || isArray(value); - var interceptor = function(value) { + var interceptor = function (value) { var result = lodashFunc.apply(lodash, arrayPush([value], args)); return (isTaker && chainAll) ? result[0] : result; }; @@ -19020,9 +19278,9 @@ var app = (function (crypto$1) { isLazy = useLazy = false; } var chainAll = this.__chain__, - isHybrid = !!this.__actions__.length, - isUnwrapped = retUnwrapped && !chainAll, - onlyLazy = isLazy && !isHybrid; + isHybrid = !!this.__actions__.length, + isUnwrapped = retUnwrapped && !chainAll, + onlyLazy = isLazy && !isHybrid; if (!retUnwrapped && useLazy) { value = onlyLazy ? value : new LazyWrapper(this); @@ -19039,25 +19297,25 @@ var app = (function (crypto$1) { }); // Add `Array` methods to `lodash.prototype`. - arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { + 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); + chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', + retUnwrapped = /^(?:pop|shift)$/.test(methodName); - lodash.prototype[methodName] = function() { + 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 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) { + baseForOwn(LazyWrapper.prototype, function (func, methodName) { var lodashFunc = lodash[methodName]; if (lodashFunc) { var key = lodashFunc.name + ''; @@ -19113,209 +19371,209 @@ var app = (function (crypto$1) { root._ = _; } }.call(commonjsGlobal)); - }); - var lodash_1 = lodash.flow; - var lodash_2 = lodash.head; - var lodash_3 = lodash.find; - var lodash_4 = lodash.each; - var lodash_5 = lodash.tail; - var lodash_6 = lodash.findIndex; - var lodash_7 = lodash.startsWith; - var lodash_8 = lodash.dropRight; - var lodash_9 = lodash.takeRight; - var lodash_10 = lodash.trim; - var lodash_11 = lodash.split; - var lodash_12 = lodash.replace; - var lodash_13 = lodash.merge; - var lodash_14 = lodash.assign; + }); + var lodash_1 = lodash.flow; + var lodash_2 = lodash.head; + var lodash_3 = lodash.find; + var lodash_4 = lodash.each; + var lodash_5 = lodash.tail; + var lodash_6 = lodash.findIndex; + var lodash_7 = lodash.startsWith; + var lodash_8 = lodash.dropRight; + var lodash_9 = lodash.takeRight; + var lodash_10 = lodash.trim; + var lodash_11 = lodash.split; + var lodash_12 = lodash.replace; + var lodash_13 = lodash.merge; + var lodash_14 = lodash.assign; - const commonPlus = extra => fp_6(["onBegin", "onComplete", "onError"])(extra); + const commonPlus = extra => fp_6(["onBegin", "onComplete", "onError"])(extra); - const common = () => commonPlus([]); + const common = () => commonPlus([]); - const _events = { - recordApi: { - save: commonPlus(["onInvalid", "onRecordUpdated", "onRecordCreated"]), - delete: common(), - getContext: common(), - getNew: common(), - load: common(), - validate: common(), - uploadFile: common(), - downloadFile: common(), - }, - indexApi: { - buildIndex: common(), - listItems: common(), - delete: common(), - aggregates: common(), - }, - collectionApi: { - getAllowedRecordTypes: common(), - initialise: common(), - delete: common(), - }, - authApi: { - authenticate: common(), - authenticateTemporaryAccess: common(), - createTemporaryAccess: common(), - createUser: common(), - enableUser: common(), - disableUser: common(), - loadAccessLevels: common(), - getNewAccessLevel: common(), - getNewUser: common(), - getNewUserAuth: common(), - getUsers: common(), - saveAccessLevels: common(), - isAuthorized: common(), - changeMyPassword: common(), - setPasswordFromTemporaryCode: common(), - scorePassword: common(), - isValidPassword: common(), - validateUser: common(), - validateAccessLevels: common(), - setUserAccessLevels: common(), - }, - templateApi: { - saveApplicationHierarchy: common(), - saveActionsAndTriggers: common(), - }, - actionsApi: { - execute: common(), - }, - }; + const _events = { + recordApi: { + save: commonPlus(["onInvalid", "onRecordUpdated", "onRecordCreated"]), + delete: common(), + getContext: common(), + getNew: common(), + load: common(), + validate: common(), + uploadFile: common(), + downloadFile: common(), + }, + indexApi: { + buildIndex: common(), + listItems: common(), + delete: common(), + aggregates: common(), + }, + collectionApi: { + getAllowedRecordTypes: common(), + initialise: common(), + delete: common(), + }, + authApi: { + authenticate: common(), + authenticateTemporaryAccess: common(), + createTemporaryAccess: common(), + createUser: common(), + enableUser: common(), + disableUser: common(), + loadAccessLevels: common(), + getNewAccessLevel: common(), + getNewUser: common(), + getNewUserAuth: common(), + getUsers: common(), + saveAccessLevels: common(), + isAuthorized: common(), + changeMyPassword: common(), + setPasswordFromTemporaryCode: common(), + scorePassword: common(), + isValidPassword: common(), + validateUser: common(), + validateAccessLevels: common(), + setUserAccessLevels: common(), + }, + templateApi: { + saveApplicationHierarchy: common(), + saveActionsAndTriggers: common(), + }, + actionsApi: { + execute: common(), + }, + }; - const _eventsList = []; + const _eventsList = []; - const makeEvent = (area, method, name) => `${area}:${method}:${name}`; + const makeEvent = (area, method, name) => `${area}:${method}:${name}`; - for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - _events[areaKey][methodKey] = fp_7((obj, s) => { - obj[s] = makeEvent(areaKey, methodKey, s); - return obj - }, {})(_events[areaKey][methodKey]); + for (const areaKey in _events) { + for (const methodKey in _events[areaKey]) { + _events[areaKey][methodKey] = fp_7((obj, s) => { + obj[s] = makeEvent(areaKey, methodKey, s); + return obj + }, {})(_events[areaKey][methodKey]); + } + } + + for (const areaKey in _events) { + for (const methodKey in _events[areaKey]) { + for (const name in _events[areaKey][methodKey]) { + _eventsList.push(_events[areaKey][methodKey][name]); } } + } - for (const areaKey in _events) { - for (const methodKey in _events[areaKey]) { - for (const name in _events[areaKey][methodKey]) { - _eventsList.push(_events[areaKey][methodKey][name]); - } - } + const events = _events; + + class BadRequestError extends Error { + constructor(message) { + super(message); + this.httpStatusCode = 400; + } + } + + class UnauthorisedError extends Error { + constructor(message) { + super(message); + this.httpStatusCode = 401; + } + } + + const apiWrapperSync = ( + app, + eventNamespace, + isAuthorized, + eventContext, + func, + ...params + ) => { + pushCallStack(app, eventNamespace); + + if (!isAuthorized(app)) { + handleNotAuthorized(app, eventContext, eventNamespace); + return } - const events = _events; + const startDate = Date.now(); + const elapsed = () => Date.now() - startDate; - class BadRequestError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 400; - } - } + try { + app.publish(eventNamespace.onBegin, eventContext); - class UnauthorisedError extends Error { - constructor(message) { - super(message); - this.httpStatusCode = 401; - } - } + const result = func(...params); - const apiWrapperSync = ( - app, - eventNamespace, - isAuthorized, - eventContext, - func, - ...params - ) => { - pushCallStack(app, eventNamespace); - - if (!isAuthorized(app)) { - handleNotAuthorized(app, eventContext, eventNamespace); - return - } - - const startDate = Date.now(); - const elapsed = () => Date.now() - startDate; - - try { - app.publish(eventNamespace.onBegin, eventContext); - - const result = func(...params); - - publishComplete(app, eventContext, eventNamespace, elapsed, result); - return result - } catch (error) { - publishError(app, eventContext, eventNamespace, elapsed, error); - throw error - } - }; - - const handleNotAuthorized = (app, eventContext, eventNamespace) => { - const err = new UnauthorisedError(`Unauthorized: ${eventNamespace}`); - publishError(app, eventContext, eventNamespace, () => 0, err); - throw err - }; - - const pushCallStack = (app, eventNamespace, seedCallId) => { - const callId = shortid_1(); - - const createCallStack = () => ({ - seedCallId: !fp_2(seedCallId) ? seedCallId : callId, - threadCallId: callId, - stack: [], - }); - - if (fp_2(app.calls)) { - app.calls = createCallStack(); - } - - app.calls.stack.push({ - namespace: eventNamespace, - callId, - }); - }; - - const popCallStack = app => { - app.calls.stack.pop(); - if (app.calls.stack.length === 0) { - delete app.calls; - } - }; - - const publishError = async ( - app, - eventContext, - eventNamespace, - elapsed, - err - ) => { - const ctx = fp_9(eventContext); - ctx.error = err; - ctx.elapsed = elapsed(); - await app.publish(eventNamespace.onError, ctx); - popCallStack(app); - }; - - const publishComplete = async ( - app, - eventContext, - eventNamespace, - elapsed, - result - ) => { - const endcontext = fp_9(eventContext); - endcontext.result = result; - endcontext.elapsed = elapsed(); - await app.publish(eventNamespace.onComplete, endcontext); - popCallStack(app); + publishComplete(app, eventContext, eventNamespace, elapsed, result); return result - }; + } catch (error) { + publishError(app, eventContext, eventNamespace, elapsed, error); + throw error + } + }; - var bcrypt = createCommonjsModule(function (module) { + const handleNotAuthorized = (app, eventContext, eventNamespace) => { + const err = new UnauthorisedError(`Unauthorized: ${eventNamespace}`); + publishError(app, eventContext, eventNamespace, () => 0, err); + throw err + }; + + const pushCallStack = (app, eventNamespace, seedCallId) => { + const callId = shortid_1(); + + const createCallStack = () => ({ + seedCallId: !fp_2(seedCallId) ? seedCallId : callId, + threadCallId: callId, + stack: [], + }); + + if (fp_2(app.calls)) { + app.calls = createCallStack(); + } + + app.calls.stack.push({ + namespace: eventNamespace, + callId, + }); + }; + + const popCallStack = app => { + app.calls.stack.pop(); + if (app.calls.stack.length === 0) { + delete app.calls; + } + }; + + const publishError = async ( + app, + eventContext, + eventNamespace, + elapsed, + err + ) => { + const ctx = fp_9(eventContext); + ctx.error = err; + ctx.elapsed = elapsed(); + await app.publish(eventNamespace.onError, ctx); + popCallStack(app); + }; + + const publishComplete = async ( + app, + eventContext, + eventNamespace, + elapsed, + result + ) => { + const endcontext = fp_9(eventContext); + endcontext.result = result; + endcontext.elapsed = elapsed(); + await app.publish(eventNamespace.onComplete, endcontext); + popCallStack(app); + return result + }; + + var bcrypt = createCommonjsModule(function (module) { /* Copyright (c) 2012 Nevins Bartolomeo Copyright (c) 2012 Shane Girish @@ -19349,8462 +19607,8472 @@ var app = (function (crypto$1) { * Released under the Apache License, Version 2.0 * see: https://github.com/dcodeIO/bcrypt.js for details */ - (function(global, factory) { + (function (global, factory) { /* AMD */ if (typeof commonjsRequire === 'function' && 'object' === "object" && module && module["exports"]) - module["exports"] = factory(); + module["exports"] = factory(); /* Global */ else - (global["dcodeIO"] = global["dcodeIO"] || {})["bcrypt"] = factory(); + (global["dcodeIO"] = global["dcodeIO"] || {})["bcrypt"] = factory(); - }(commonjsGlobal, function() { + }(commonjsGlobal, function () { - /** - * bcrypt namespace. - * @type {Object.} - */ - var bcrypt = {}; + /** + * bcrypt namespace. + * @type {Object.} + */ + var bcrypt = {}; - /** - * The random implementation to use as a fallback. - * @type {?function(number):!Array.} - * @inner - */ - var randomFallback = null; + /** + * The random implementation to use as a fallback. + * @type {?function(number):!Array.} + * @inner + */ + var randomFallback = null; - /** - * Generates cryptographically secure random bytes. - * @function - * @param {number} len Bytes length - * @returns {!Array.} Random bytes - * @throws {Error} If no random implementation is available - * @inner - */ - function random(len) { - /* node */ if ( module && module['exports']) - try { - return crypto$1['randomBytes'](len); - } catch (e) {} + /** + * Generates cryptographically secure random bytes. + * @function + * @param {number} len Bytes length + * @returns {!Array.} Random bytes + * @throws {Error} If no random implementation is available + * @inner + */ + function random(len) { + /* node */ if (module && module['exports']) + try { + return crypto$1['randomBytes'](len); + } catch (e) { } /* WCA */ try { - var a; (self['crypto']||self['msCrypto'])['getRandomValues'](a = new Uint32Array(len)); - return Array.prototype.slice.call(a); - } catch (e) {} + var a; (self['crypto'] || self['msCrypto'])['getRandomValues'](a = new Uint32Array(len)); + return Array.prototype.slice.call(a); + } catch (e) { } /* fallback */ if (!randomFallback) - throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"); - return randomFallback(len); - } + throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative"); + return randomFallback(len); + } - // Test if any secure randomness source is available - var randomAvailable = false; - try { - random(1); - randomAvailable = true; - } catch (e) {} - - // Default fallback, if any - randomFallback = null; - /** - * Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto - * API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it - * is seeded properly! - * @param {?function(number):!Array.} random Function taking the number of bytes to generate as its - * sole argument, returning the corresponding array of cryptographically secure random byte values. - * @see http://nodejs.org/api/crypto.html - * @see http://www.w3.org/TR/WebCryptoAPI/ - */ - bcrypt.setRandomFallback = function(random) { - randomFallback = random; - }; - - /** - * Synchronously generates a salt. - * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted - * @param {number=} seed_length Not supported. - * @returns {string} Resulting salt - * @throws {Error} If a random fallback is required but not set - * @expose - */ - bcrypt.genSaltSync = function(rounds, seed_length) { - rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; - if (typeof rounds !== 'number') - throw Error("Illegal arguments: "+(typeof rounds)+", "+(typeof seed_length)); - if (rounds < 4) - rounds = 4; - else if (rounds > 31) - rounds = 31; - var salt = []; - salt.push("$2a$"); - if (rounds < 10) - salt.push("0"); - salt.push(rounds.toString()); - salt.push('$'); - salt.push(base64_encode(random(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw - return salt.join(''); - }; - - /** - * Asynchronously generates a salt. - * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted - * @param {(number|function(Error, string=))=} seed_length Not supported. - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt - * @returns {!Promise} If `callback` has been omitted - * @throws {Error} If `callback` is present but not a function - * @expose - */ - bcrypt.genSalt = function(rounds, seed_length, callback) { - if (typeof seed_length === 'function') - callback = seed_length, - seed_length = undefined; // Not supported. - if (typeof rounds === 'function') - callback = rounds, - rounds = undefined; - if (typeof rounds === 'undefined') - rounds = GENSALT_DEFAULT_LOG2_ROUNDS; - else if (typeof rounds !== 'number') - throw Error("illegal arguments: "+(typeof rounds)); - - function _async(callback) { - nextTick(function() { // Pretty thin, but salting is fast enough - try { - callback(null, bcrypt.genSaltSync(rounds)); - } catch (err) { - callback(err); - } - }); - } - - if (callback) { - if (typeof callback !== 'function') - throw Error("Illegal callback: "+typeof(callback)); - _async(callback); - } else - return new Promise(function(resolve, reject) { - _async(function(err, res) { - if (err) { - reject(err); - return; - } - resolve(res); - }); - }); - }; - - /** - * Synchronously generates a hash for the given string. - * @param {string} s String to hash - * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10 - * @returns {string} Resulting hash - * @expose - */ - bcrypt.hashSync = function(s, salt) { - if (typeof salt === 'undefined') - salt = GENSALT_DEFAULT_LOG2_ROUNDS; - if (typeof salt === 'number') - salt = bcrypt.genSaltSync(salt); - if (typeof s !== 'string' || typeof salt !== 'string') - throw Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)); - return _hash(s, salt); - }; - - /** - * Asynchronously generates a hash for the given string. - * @param {string} s String to hash - * @param {number|string} salt Salt length to generate or salt to use - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash - * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed - * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. - * @returns {!Promise} If `callback` has been omitted - * @throws {Error} If `callback` is present but not a function - * @expose - */ - bcrypt.hash = function(s, salt, callback, progressCallback) { - - function _async(callback) { - if (typeof s === 'string' && typeof salt === 'number') - bcrypt.genSalt(salt, function(err, salt) { - _hash(s, salt, callback, progressCallback); - }); - else if (typeof s === 'string' && typeof salt === 'string') - _hash(s, salt, callback, progressCallback); - else - nextTick(callback.bind(this, Error("Illegal arguments: "+(typeof s)+', '+(typeof salt)))); - } - - if (callback) { - if (typeof callback !== 'function') - throw Error("Illegal callback: "+typeof(callback)); - _async(callback); - } else - return new Promise(function(resolve, reject) { - _async(function(err, res) { - if (err) { - reject(err); - return; - } - resolve(res); - }); - }); - }; - - /** - * Compares two strings of the same length in constant time. - * @param {string} known Must be of the correct length - * @param {string} unknown Must be the same length as `known` - * @returns {boolean} - * @inner - */ - function safeStringCompare(known, unknown) { - var right = 0, - wrong = 0; - for (var i=0, k=known.length; i} UTF8 bytes - * @inner - */ - function stringToBytes(str) { - var out = [], - i = 0; - utfx.encodeUTF16toUTF8(function() { - if (i >= str.length) return null; - return str.charCodeAt(i++); - }, function(b) { - out.push(b); - }); - return out; - } - - // A base64 implementation for the bcrypt algorithm. This is partly non-standard. - - /** - * bcrypt's own non-standard base64 dictionary. - * @type {!Array.} - * @const - * @inner - **/ - var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(''); - - /** - * @type {!Array.} - * @const - * @inner - **/ - var BASE64_INDEX = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, - 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, - -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1]; - - /** - * @type {!function(...number):string} - * @inner - */ - var stringFromCharCode = String.fromCharCode; - - /** - * Encodes a byte array to base64 with up to len bytes of input. - * @param {!Array.} b Byte array - * @param {number} len Maximum input length - * @returns {string} - * @inner - */ - function base64_encode(b, len) { - var off = 0, - rs = [], - c1, c2; - if (len <= 0 || len > b.length) - throw Error("Illegal len: "+len); - while (off < len) { - c1 = b[off++] & 0xff; - rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]); - c1 = (c1 & 0x03) << 4; - if (off >= len) { - rs.push(BASE64_CODE[c1 & 0x3f]); - break; - } - c2 = b[off++] & 0xff; - c1 |= (c2 >> 4) & 0x0f; - rs.push(BASE64_CODE[c1 & 0x3f]); - c1 = (c2 & 0x0f) << 2; - if (off >= len) { - rs.push(BASE64_CODE[c1 & 0x3f]); - break; - } - c2 = b[off++] & 0xff; - c1 |= (c2 >> 6) & 0x03; - rs.push(BASE64_CODE[c1 & 0x3f]); - rs.push(BASE64_CODE[c2 & 0x3f]); - } - return rs.join(''); - } - - /** - * Decodes a base64 encoded string to up to len bytes of output. - * @param {string} s String to decode - * @param {number} len Maximum output length - * @returns {!Array.} - * @inner - */ - function base64_decode(s, len) { - var off = 0, - slen = s.length, - olen = 0, - rs = [], - c1, c2, c3, c4, o, code; - if (len <= 0) - throw Error("Illegal len: "+len); - while (off < slen - 1 && olen < len) { - code = s.charCodeAt(off++); - c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - code = s.charCodeAt(off++); - c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - if (c1 == -1 || c2 == -1) - break; - o = (c1 << 2) >>> 0; - o |= (c2 & 0x30) >> 4; - rs.push(stringFromCharCode(o)); - if (++olen >= len || off >= slen) - break; - code = s.charCodeAt(off++); - c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - if (c3 == -1) - break; - o = ((c2 & 0x0f) << 4) >>> 0; - o |= (c3 & 0x3c) >> 2; - rs.push(stringFromCharCode(o)); - if (++olen >= len || off >= slen) - break; - code = s.charCodeAt(off++); - c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; - o = ((c3 & 0x03) << 6) >>> 0; - o |= c4; - rs.push(stringFromCharCode(o)); - ++olen; - } - var res = []; - for (off = 0; off - * Released under the Apache License, Version 2.0 - * see: https://github.com/dcodeIO/utfx for details - */ - var utfx = function() { - - /** - * utfx namespace. - * @inner - * @type {!Object.} - */ - var utfx = {}; - - /** - * Maximum valid code point. - * @type {number} - * @const - */ - utfx.MAX_CODEPOINT = 0x10FFFF; - - /** - * Encodes UTF8 code points to UTF8 bytes. - * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point - * respectively `null` if there are no more code points left or a single numeric code point. - * @param {!function(number)} dst Bytes destination as a function successively called with the next byte - */ - utfx.encodeUTF8 = function(src, dst) { - var cp = null; - if (typeof src === 'number') - cp = src, - src = function() { return null; }; - while (cp !== null || (cp = src()) !== null) { - if (cp < 0x80) - dst(cp&0x7F); - else if (cp < 0x800) - dst(((cp>>6)&0x1F)|0xC0), - dst((cp&0x3F)|0x80); - else if (cp < 0x10000) - dst(((cp>>12)&0x0F)|0xE0), - dst(((cp>>6)&0x3F)|0x80), - dst((cp&0x3F)|0x80); - else - dst(((cp>>18)&0x07)|0xF0), - dst(((cp>>12)&0x3F)|0x80), - dst(((cp>>6)&0x3F)|0x80), - dst((cp&0x3F)|0x80); - cp = null; - } - }; - - /** - * Decodes UTF8 bytes to UTF8 code points. - * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there - * are no more bytes left. - * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point. - * @throws {RangeError} If a starting byte is invalid in UTF8 - * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the - * remaining bytes. - */ - utfx.decodeUTF8 = function(src, dst) { - var a, b, c, d, fail = function(b) { - b = b.slice(0, b.indexOf(null)); - var err = Error(b.toString()); - err.name = "TruncatedError"; - err['bytes'] = b; - throw err; - }; - while ((a = src()) !== null) { - if ((a&0x80) === 0) - dst(a); - else if ((a&0xE0) === 0xC0) - ((b = src()) === null) && fail([a, b]), - dst(((a&0x1F)<<6) | (b&0x3F)); - else if ((a&0xF0) === 0xE0) - ((b=src()) === null || (c=src()) === null) && fail([a, b, c]), - dst(((a&0x0F)<<12) | ((b&0x3F)<<6) | (c&0x3F)); - else if ((a&0xF8) === 0xF0) - ((b=src()) === null || (c=src()) === null || (d=src()) === null) && fail([a, b, c ,d]), - dst(((a&0x07)<<18) | ((b&0x3F)<<12) | ((c&0x3F)<<6) | (d&0x3F)); - else throw RangeError("Illegal starting byte: "+a); - } - }; - - /** - * Converts UTF16 characters to UTF8 code points. - * @param {!function():number|null} src Characters source as a function returning the next char code respectively - * `null` if there are no more characters left. - * @param {!function(number)} dst Code points destination as a function successively called with each converted code - * point. - */ - utfx.UTF16toUTF8 = function(src, dst) { - var c1, c2 = null; - while (true) { - if ((c1 = c2 !== null ? c2 : src()) === null) - break; - if (c1 >= 0xD800 && c1 <= 0xDFFF) { - if ((c2 = src()) !== null) { - if (c2 >= 0xDC00 && c2 <= 0xDFFF) { - dst((c1-0xD800)*0x400+c2-0xDC00+0x10000); - c2 = null; continue; - } - } - } - dst(c1); - } - if (c2 !== null) dst(c2); - }; - - /** - * Converts UTF8 code points to UTF16 characters. - * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point - * respectively `null` if there are no more code points left or a single numeric code point. - * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. - * @throws {RangeError} If a code point is out of range - */ - utfx.UTF8toUTF16 = function(src, dst) { - var cp = null; - if (typeof src === 'number') - cp = src, src = function() { return null; }; - while (cp !== null || (cp = src()) !== null) { - if (cp <= 0xFFFF) - dst(cp); - else - cp -= 0x10000, - dst((cp>>10)+0xD800), - dst((cp%0x400)+0xDC00); - cp = null; - } - }; - - /** - * Converts and encodes UTF16 characters to UTF8 bytes. - * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null` - * if there are no more characters left. - * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. - */ - utfx.encodeUTF16toUTF8 = function(src, dst) { - utfx.UTF16toUTF8(src, function(cp) { - utfx.encodeUTF8(cp, dst); - }); - }; - - /** - * Decodes and converts UTF8 bytes to UTF16 characters. - * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there - * are no more bytes left. - * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. - * @throws {RangeError} If a starting byte is invalid in UTF8 - * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes. - */ - utfx.decodeUTF8toUTF16 = function(src, dst) { - utfx.decodeUTF8(src, function(cp) { - utfx.UTF8toUTF16(cp, dst); - }); - }; - - /** - * Calculates the byte length of an UTF8 code point. - * @param {number} cp UTF8 code point - * @returns {number} Byte length - */ - utfx.calculateCodePoint = function(cp) { - return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; - }; - - /** - * Calculates the number of UTF8 bytes required to store UTF8 code points. - * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively - * `null` if there are no more code points left. - * @returns {number} The number of UTF8 bytes required - */ - utfx.calculateUTF8 = function(src) { - var cp, l=0; - while ((cp = src()) !== null) - l += utfx.calculateCodePoint(cp); - return l; - }; - - /** - * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes. - * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively - * `null` if there are no more characters left. - * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1. - */ - utfx.calculateUTF16asUTF8 = function(src) { - var n=0, l=0; - utfx.UTF16toUTF8(src, function(cp) { - ++n; l += utfx.calculateCodePoint(cp); - }); - return [n,l]; - }; - - return utfx; - }(); - - Date.now = Date.now || function() { return +new Date; }; - - /** - * @type {number} - * @const - * @inner - */ - var BCRYPT_SALT_LEN = 16; - - /** - * @type {number} - * @const - * @inner - */ - var GENSALT_DEFAULT_LOG2_ROUNDS = 10; - - /** - * @type {number} - * @const - * @inner - */ - var BLOWFISH_NUM_ROUNDS = 16; - - /** - * @type {number} - * @const - * @inner - */ - var MAX_EXECUTION_TIME = 100; - - /** - * @type {Array.} - * @const - * @inner - */ - var P_ORIG = [ - 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, - 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, - 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, - 0xb5470917, 0x9216d5d9, 0x8979fb1b - ]; - - /** - * @type {Array.} - * @const - * @inner - */ - var S_ORIG = [ - 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, - 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, - 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, - 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, - 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, - 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, - 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, - 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, - 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, - 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, - 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, - 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, - 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, - 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, - 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, - 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, - 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, - 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, - 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, - 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, - 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, - 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, - 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, - 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, - 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, - 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, - 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, - 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, - 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, - 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, - 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, - 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, - 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, - 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, - 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, - 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, - 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, - 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, - 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, - 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, - 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, - 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, - 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, - 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, - 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, - 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, - 0x6e85076a, 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, - 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, - 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, - 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, - 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, - 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, - 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, - 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, - 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, - 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, - 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, - 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, - 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, - 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, - 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, - 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, - 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, - 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, - 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, - 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, - 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, - 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, - 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, - 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, - 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, - 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, - 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, - 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, - 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, - 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, - 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, - 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, - 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, - 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, - 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, - 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, - 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, - 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, - 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, - 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, - 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, - 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, - 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, - 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, - 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, - 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, - 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, - 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, - 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, - 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, - 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, - 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, - 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, - 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, - 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, - 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, - 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, - 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, - 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, - 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, - 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, - 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, - 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, - 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, - 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, - 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, - 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, - 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, - 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, - 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, - 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, - 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, - 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, - 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, - 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, - 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, - 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, - 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, - 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, - 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, - 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, - 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, - 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, - 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, - 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, - 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, - 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, - 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, - 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, - 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, - 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, - 0x92638212, 0x670efa8e, 0x406000e0, 0x3a39ce37, 0xd3faf5cf, - 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, - 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, - 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, - 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, - 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, - 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, - 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, - 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, - 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, - 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, - 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, - 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, - 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, - 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, - 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, - 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, - 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, - 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, - 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, - 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, - 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, - 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, - 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, - 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, - 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, - 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, - 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, - 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, - 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, - 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, - 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, - 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, - 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, - 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, - 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, - 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, - 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, - 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, - 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, - 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, - 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, - 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, - 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, - 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, - 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, - 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 - ]; - - /** - * @type {Array.} - * @const - * @inner - */ - var C_ORIG = [ - 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, - 0x6f756274 - ]; - - /** - * @param {Array.} lr - * @param {number} off - * @param {Array.} P - * @param {Array.} S - * @returns {Array.} - * @inner - */ - function _encipher(lr, off, P, S) { // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt - var n, - l = lr[off], - r = lr[off + 1]; - - l ^= P[0]; - - /* - for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;) - // Feistel substitution on left word - n = S[l >>> 24], - n += S[0x100 | ((l >> 16) & 0xff)], - n ^= S[0x200 | ((l >> 8) & 0xff)], - n += S[0x300 | (l & 0xff)], - r ^= n ^ P[++i], - // Feistel substitution on right word - n = S[r >>> 24], - n += S[0x100 | ((r >> 16) & 0xff)], - n ^= S[0x200 | ((r >> 8) & 0xff)], - n += S[0x300 | (r & 0xff)], - l ^= n ^ P[++i]; - */ - - //The following is an unrolled version of the above loop. - //Iteration 0 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[1]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[2]; - //Iteration 1 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[3]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[4]; - //Iteration 2 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[5]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[6]; - //Iteration 3 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[7]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[8]; - //Iteration 4 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[9]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[10]; - //Iteration 5 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[11]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[12]; - //Iteration 6 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[13]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[14]; - //Iteration 7 - n = S[l >>> 24]; - n += S[0x100 | ((l >> 16) & 0xff)]; - n ^= S[0x200 | ((l >> 8) & 0xff)]; - n += S[0x300 | (l & 0xff)]; - r ^= n ^ P[15]; - n = S[r >>> 24]; - n += S[0x100 | ((r >> 16) & 0xff)]; - n ^= S[0x200 | ((r >> 8) & 0xff)]; - n += S[0x300 | (r & 0xff)]; - l ^= n ^ P[16]; - - lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; - lr[off + 1] = l; - return lr; - } - - /** - * @param {Array.} data - * @param {number} offp - * @returns {{key: number, offp: number}} - * @inner - */ - function _streamtoword(data, offp) { - for (var i = 0, word = 0; i < 4; ++i) - word = (word << 8) | (data[offp] & 0xff), - offp = (offp + 1) % data.length; - return { key: word, offp: offp }; - } - - /** - * @param {Array.} key - * @param {Array.} P - * @param {Array.} S - * @inner - */ - function _key(key, P, S) { - var offset = 0, - lr = [0, 0], - plen = P.length, - slen = S.length, - sw; - for (var i = 0; i < plen; i++) - sw = _streamtoword(key, offset), - offset = sw.offp, - P[i] = P[i] ^ sw.key; - for (i = 0; i < plen; i += 2) - lr = _encipher(lr, 0, P, S), - P[i] = lr[0], - P[i + 1] = lr[1]; - for (i = 0; i < slen; i += 2) - lr = _encipher(lr, 0, P, S), - S[i] = lr[0], - S[i + 1] = lr[1]; - } - - /** - * Expensive key schedule Blowfish. - * @param {Array.} data - * @param {Array.} key - * @param {Array.} P - * @param {Array.} S - * @inner - */ - function _ekskey(data, key, P, S) { - var offp = 0, - lr = [0, 0], - plen = P.length, - slen = S.length, - sw; - for (var i = 0; i < plen; i++) - sw = _streamtoword(key, offp), - offp = sw.offp, - P[i] = P[i] ^ sw.key; - offp = 0; - for (i = 0; i < plen; i += 2) - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[0] ^= sw.key, - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[1] ^= sw.key, - lr = _encipher(lr, 0, P, S), - P[i] = lr[0], - P[i + 1] = lr[1]; - for (i = 0; i < slen; i += 2) - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[0] ^= sw.key, - sw = _streamtoword(data, offp), - offp = sw.offp, - lr[1] ^= sw.key, - lr = _encipher(lr, 0, P, S), - S[i] = lr[0], - S[i + 1] = lr[1]; - } - - /** - * Internaly crypts a string. - * @param {Array.} b Bytes to crypt - * @param {Array.} salt Salt bytes to use - * @param {number} rounds Number of rounds - * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If - * omitted, the operation will be performed synchronously. - * @param {function(number)=} progressCallback Callback called with the current progress - * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined` - * @inner - */ - function _crypt(b, salt, rounds, callback, progressCallback) { - var cdata = C_ORIG.slice(), - clen = cdata.length, - err; - - // Validate - if (rounds < 4 || rounds > 31) { - err = Error("Illegal number of rounds (4-31): "+rounds); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - if (salt.length !== BCRYPT_SALT_LEN) { - err =Error("Illegal salt length: "+salt.length+" != "+BCRYPT_SALT_LEN); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - rounds = (1 << rounds) >>> 0; - - var P, S, i = 0, j; - - //Use typed arrays when available - huge speedup! - if (Int32Array) { - P = new Int32Array(P_ORIG); - S = new Int32Array(S_ORIG); - } else { - P = P_ORIG.slice(); - S = S_ORIG.slice(); - } - - _ekskey(salt, b, P, S); - - /** - * Calcualtes the next round. - * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined` - * @inner - */ - function next() { - if (progressCallback) - progressCallback(i / rounds); - if (i < rounds) { - var start = Date.now(); - for (; i < rounds;) { - i = i + 1; - _key(b, P, S); - _key(salt, P, S); - if (Date.now() - start > MAX_EXECUTION_TIME) - break; - } - } else { - for (i = 0; i < 64; i++) - for (j = 0; j < (clen >> 1); j++) - _encipher(cdata, j << 1, P, S); - var ret = []; - for (i = 0; i < clen; i++) - ret.push(((cdata[i] >> 24) & 0xff) >>> 0), - ret.push(((cdata[i] >> 16) & 0xff) >>> 0), - ret.push(((cdata[i] >> 8) & 0xff) >>> 0), - ret.push((cdata[i] & 0xff) >>> 0); - if (callback) { - callback(null, ret); - return; - } else - return ret; - } - if (callback) - nextTick(next); - } - - // Async - if (typeof callback !== 'undefined') { - next(); - - // Sync - } else { - var res; - while (true) - if (typeof(res = next()) !== 'undefined') - return res || []; - } - } - - /** - * Internally hashes a string. - * @param {string} s String to hash - * @param {?string} salt Salt to use, actually never null - * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted, - * hashing is perormed synchronously. - * @param {function(number)=} progressCallback Callback called with the current progress - * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined` - * @inner - */ - function _hash(s, salt, callback, progressCallback) { - var err; - if (typeof s !== 'string' || typeof salt !== 'string') { - err = Error("Invalid string / salt: Not a string"); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } - else - throw err; - } - - // Validate the salt - var minor, offset; - if (salt.charAt(0) !== '$' || salt.charAt(1) !== '2') { - err = Error("Invalid salt version: "+salt.substring(0,2)); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } - else - throw err; - } - if (salt.charAt(2) === '$') - minor = String.fromCharCode(0), - offset = 3; - else { - minor = salt.charAt(2); - if ((minor !== 'a' && minor !== 'b' && minor !== 'y') || salt.charAt(3) !== '$') { - err = Error("Invalid salt revision: "+salt.substring(2,4)); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - offset = 4; - } - - // Extract number of rounds - if (salt.charAt(offset + 2) > '$') { - err = Error("Missing salt rounds"); - if (callback) { - nextTick(callback.bind(this, err)); - return; - } else - throw err; - } - var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, - r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), - rounds = r1 + r2, - real_salt = salt.substring(offset + 3, offset + 25); - s += minor >= 'a' ? "\x00" : ""; - - var passwordb = stringToBytes(s), - saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); - - /** - * Finishes hashing. - * @param {Array.} bytes Byte array - * @returns {string} - * @inner - */ - function finish(bytes) { - var res = []; - res.push("$2"); - if (minor >= 'a') - res.push(minor); - res.push("$"); - if (rounds < 10) - res.push("0"); - res.push(rounds.toString()); - res.push("$"); - res.push(base64_encode(saltb, saltb.length)); - res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); - return res.join(''); - } - - // Sync - if (typeof callback == 'undefined') - return finish(_crypt(passwordb, saltb, rounds)); - - // Async - else { - _crypt(passwordb, saltb, rounds, function(err, bytes) { - if (err) - callback(err, null); - else - callback(null, finish(bytes)); - }, progressCallback); - } - } - - /** - * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. - * @function - * @param {!Array.} b Byte array - * @param {number} len Maximum input length - * @returns {string} - * @expose - */ - bcrypt.encodeBase64 = base64_encode; - - /** - * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. - * @function - * @param {string} s String to decode - * @param {number} len Maximum output length - * @returns {!Array.} - * @expose - */ - bcrypt.decodeBase64 = base64_decode; - - return bcrypt; - })); - }); - - // this is the combinator function - const $$ = (...funcs) => arg => lodash_1(funcs)(arg); - - // this is the pipe function - const $ = (arg, funcs) => $$(...funcs)(arg); - - const keySep = "/"; - const trimKeySep = str => lodash_10(str, keySep); - const splitByKeySep = str => fp_3(keySep)(str); - const safeKey = key => - lodash_12(`${keySep}${trimKeySep(key)}`, `${keySep}${keySep}`, keySep); - const joinKey = (...strs) => { - const paramsOrArray = (strs.length === 1) & fp_11(strs[0]) ? strs[0] : strs; - return $(paramsOrArray, [ - fp_13(s => !fp_2(s) && !fp_29(s) && s.toString().length > 0), - fp_18(keySep), - safeKey, - ]) - }; - const splitKey = $$(trimKeySep, splitByKeySep); - - const configFolder = `${keySep}.config`; - const fieldDefinitions = joinKey(configFolder, "fields.json"); - const templateDefinitions = joinKey(configFolder, "templates.json"); - const appDefinitionFile = joinKey(configFolder, "appDefinition.json"); - - const not = func => val => !func(val); - const isDefined = not(fp_2); - const isNonNull = not(fp_29); - const isNotNaN = not(fp_36); - - const allTrue = (...funcArgs) => val => - fp_7( - (result, conditionFunc) => - (fp_29(result) || result == true) && conditionFunc(val), - null - )(funcArgs); - - const isSomething = allTrue(isDefined, isNonNull, isNotNaN); - const isNothing = not(isSomething); - - const none = predicate => collection => !fp_10(predicate)(collection); - - const all = predicate => collection => - none(v => !predicate(v))(collection); - - const isNotEmpty = ob => !fp_16(ob); - const isNonEmptyString = allTrue(fp_27, isNotEmpty); - const tryOr = failFunc => (func, ...args) => { + // Test if any secure randomness source is available + var randomAvailable = false; try { - return func.apply(null, ...args) - } catch (_) { - return failFunc() - } - }; - const causesException = func => { - try { - func(); - return false - } catch (e) { - return true - } - }; + random(1); + randomAvailable = true; + } catch (e) { } - const executesWithoutException = func => !causesException(func); - - const handleErrorWith = returnValInError => - tryOr(fp_21(returnValInError)); - - const handleErrorWithUndefined = handleErrorWith(undefined); - - const switchCase = (...cases) => value => { - const nextCase = () => lodash_2(cases)[0](value); - const nextResult = () => lodash_2(cases)[1](value); - - if (fp_16(cases)) return // undefined - if (nextCase() === true) return nextResult() - return switchCase(...lodash_5(cases))(value) - }; - const isOneOf = (...vals) => val => fp_19(val)(vals); - const defaultCase = fp_21(true); - - const isSafeInteger = n => - fp_37(n) && - n <= Number.MAX_SAFE_INTEGER && - n >= 0 - Number.MAX_SAFE_INTEGER; - - const toDateOrNull = s => - fp_29(s) ? null : fp_32(s) ? s : new Date(s); - const toBoolOrNull = s => (fp_29(s) ? null : s === "true" || s === true); - const toNumberOrNull = s => (fp_29(s) ? null : fp_38(s)); - - const isArrayOfString = opts => fp_11(opts) && all(fp_27)(opts); - - const makerule = (field, error, isValid) => ({ field, error, isValid }); - - var filters = new Map(); - var limiters = new Map(); - - function compileRawExpression(src) { - return new Function('context', 'tempVars', // eslint-disable-line - ("const sandbox = $nxCompileToSandbox(context, tempVars)\n try { with (sandbox) { return " + src + " } } catch (err) {\n if (!(err instanceof TypeError)) throw err\n }\n $nxClearSandbox()")); - } - - function compileRawCode(src) { - return new Function('context', 'tempVars', // eslint-disable-line - ("const sandbox = $nxCompileToSandbox(context, tempVars)\n with (sandbox) { " + src + " }\n $nxClearSandbox()")); - } - - var filterRegex = /(?:[^\|]|\|\|)+/g; - var limiterRegex = /(?:[^&]|&&)+/g; - var argsRegex = /\S+/g; - - function parseExpression(src) { - var tokens = src.match(filterRegex); - if (tokens.length === 1) { - return compileRawExpression(tokens[0]); - } - - var expression = { - exec: compileRawExpression(tokens[0]), - filters: [] + // Default fallback, if any + randomFallback = null; + /** + * Sets the pseudo random number generator to use as a fallback if neither node's `crypto` module nor the Web Crypto + * API is available. Please note: It is highly important that the PRNG used is cryptographically secure and that it + * is seeded properly! + * @param {?function(number):!Array.} random Function taking the number of bytes to generate as its + * sole argument, returning the corresponding array of cryptographically secure random byte values. + * @see http://nodejs.org/api/crypto.html + * @see http://www.w3.org/TR/WebCryptoAPI/ + */ + bcrypt.setRandomFallback = function (random) { + randomFallback = random; }; - for (var i = 1; i < tokens.length; i++) { - var filterTokens = tokens[i].match(argsRegex); - var filterName = filterTokens.shift(); - var effect = filters.get(filterName); - if (!effect) { - throw new Error(("There is no filter named: " + filterName + ".")); + + /** + * Synchronously generates a salt. + * @param {number=} rounds Number of rounds to use, defaults to 10 if omitted + * @param {number=} seed_length Not supported. + * @returns {string} Resulting salt + * @throws {Error} If a random fallback is required but not set + * @expose + */ + bcrypt.genSaltSync = function (rounds, seed_length) { + rounds = rounds || GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof rounds !== 'number') + throw Error("Illegal arguments: " + (typeof rounds) + ", " + (typeof seed_length)); + if (rounds < 4) + rounds = 4; + else if (rounds > 31) + rounds = 31; + var salt = []; + salt.push("$2a$"); + if (rounds < 10) + salt.push("0"); + salt.push(rounds.toString()); + salt.push('$'); + salt.push(base64_encode(random(BCRYPT_SALT_LEN), BCRYPT_SALT_LEN)); // May throw + return salt.join(''); + }; + + /** + * Asynchronously generates a salt. + * @param {(number|function(Error, string=))=} rounds Number of rounds to use, defaults to 10 if omitted + * @param {(number|function(Error, string=))=} seed_length Not supported. + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting salt + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + * @expose + */ + bcrypt.genSalt = function (rounds, seed_length, callback) { + if (typeof seed_length === 'function') + callback = seed_length, + seed_length = undefined; // Not supported. + if (typeof rounds === 'function') + callback = rounds, + rounds = undefined; + if (typeof rounds === 'undefined') + rounds = GENSALT_DEFAULT_LOG2_ROUNDS; + else if (typeof rounds !== 'number') + throw Error("illegal arguments: " + (typeof rounds)); + + function _async(callback) { + nextTick(function () { // Pretty thin, but salting is fast enough + try { + callback(null, bcrypt.genSaltSync(rounds)); + } catch (err) { + callback(err); + } + }); } - expression.filters.push({ effect: effect, argExpressions: filterTokens.map(compileRawExpression) }); + + if (callback) { + if (typeof callback !== 'function') + throw Error("Illegal callback: " + typeof (callback)); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + }; + + /** + * Synchronously generates a hash for the given string. + * @param {string} s String to hash + * @param {(number|string)=} salt Salt length to generate or salt to use, default to 10 + * @returns {string} Resulting hash + * @expose + */ + bcrypt.hashSync = function (s, salt) { + if (typeof salt === 'undefined') + salt = GENSALT_DEFAULT_LOG2_ROUNDS; + if (typeof salt === 'number') + salt = bcrypt.genSaltSync(salt); + if (typeof s !== 'string' || typeof salt !== 'string') + throw Error("Illegal arguments: " + (typeof s) + ', ' + (typeof salt)); + return _hash(s, salt); + }; + + /** + * Asynchronously generates a hash for the given string. + * @param {string} s String to hash + * @param {number|string} salt Salt length to generate or salt to use + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash + * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed + * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + * @expose + */ + bcrypt.hash = function (s, salt, callback, progressCallback) { + + function _async(callback) { + if (typeof s === 'string' && typeof salt === 'number') + bcrypt.genSalt(salt, function (err, salt) { + _hash(s, salt, callback, progressCallback); + }); + else if (typeof s === 'string' && typeof salt === 'string') + _hash(s, salt, callback, progressCallback); + else + nextTick(callback.bind(this, Error("Illegal arguments: " + (typeof s) + ', ' + (typeof salt)))); + } + + if (callback) { + if (typeof callback !== 'function') + throw Error("Illegal callback: " + typeof (callback)); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + }; + + /** + * Compares two strings of the same length in constant time. + * @param {string} known Must be of the correct length + * @param {string} unknown Must be the same length as `known` + * @returns {boolean} + * @inner + */ + function safeStringCompare(known, unknown) { + var right = 0, + wrong = 0; + for (var i = 0, k = known.length; i < k; ++i) { + if (known.charCodeAt(i) === unknown.charCodeAt(i)) + ++right; + else + ++wrong; + } + // Prevent removal of unused variables (never true, actually) + if (right < 0) + return false; + return wrong === 0; } + + /** + * Synchronously tests a string against a hash. + * @param {string} s String to compare + * @param {string} hash Hash to test against + * @returns {boolean} true if matching, otherwise false + * @throws {Error} If an argument is illegal + * @expose + */ + bcrypt.compareSync = function (s, hash) { + if (typeof s !== "string" || typeof hash !== "string") + throw Error("Illegal arguments: " + (typeof s) + ', ' + (typeof hash)); + if (hash.length !== 60) + return false; + return safeStringCompare(bcrypt.hashSync(s, hash.substr(0, hash.length - 31)), hash); + }; + + /** + * Asynchronously compares the given data against the given hash. + * @param {string} s Data to compare + * @param {string} hash Data to be compared to + * @param {function(Error, boolean)=} callback Callback receiving the error, if any, otherwise the result + * @param {function(number)=} progressCallback Callback successively called with the percentage of rounds completed + * (0.0 - 1.0), maximally once per `MAX_EXECUTION_TIME = 100` ms. + * @returns {!Promise} If `callback` has been omitted + * @throws {Error} If `callback` is present but not a function + * @expose + */ + bcrypt.compare = function (s, hash, callback, progressCallback) { + + function _async(callback) { + if (typeof s !== "string" || typeof hash !== "string") { + nextTick(callback.bind(this, Error("Illegal arguments: " + (typeof s) + ', ' + (typeof hash)))); + return; + } + if (hash.length !== 60) { + nextTick(callback.bind(this, null, false)); + return; + } + bcrypt.hash(s, hash.substr(0, 29), function (err, comp) { + if (err) + callback(err); + else + callback(null, safeStringCompare(comp, hash)); + }, progressCallback); + } + + if (callback) { + if (typeof callback !== 'function') + throw Error("Illegal callback: " + typeof (callback)); + _async(callback); + } else + return new Promise(function (resolve, reject) { + _async(function (err, res) { + if (err) { + reject(err); + return; + } + resolve(res); + }); + }); + }; + + /** + * Gets the number of rounds used to encrypt the specified hash. + * @param {string} hash Hash to extract the used number of rounds from + * @returns {number} Number of rounds used + * @throws {Error} If `hash` is not a string + * @expose + */ + bcrypt.getRounds = function (hash) { + if (typeof hash !== "string") + throw Error("Illegal arguments: " + (typeof hash)); + return parseInt(hash.split("$")[2], 10); + }; + + /** + * Gets the salt portion from a hash. Does not validate the hash. + * @param {string} hash Hash to extract the salt from + * @returns {string} Extracted salt part + * @throws {Error} If `hash` is not a string or otherwise invalid + * @expose + */ + bcrypt.getSalt = function (hash) { + if (typeof hash !== 'string') + throw Error("Illegal arguments: " + (typeof hash)); + if (hash.length !== 60) + throw Error("Illegal hash length: " + hash.length + " != 60"); + return hash.substring(0, 29); + }; + + /** + * Continues with the callback on the next tick. + * @function + * @param {function(...[*])} callback Callback to execute + * @inner + */ + var nextTick = typeof process !== 'undefined' && process && typeof process.nextTick === 'function' + ? (typeof setImmediate === 'function' ? setImmediate : process.nextTick) + : setTimeout; + + /** + * Converts a JavaScript string to UTF8 bytes. + * @param {string} str String + * @returns {!Array.} UTF8 bytes + * @inner + */ + function stringToBytes(str) { + var out = [], + i = 0; + utfx.encodeUTF16toUTF8(function () { + if (i >= str.length) return null; + return str.charCodeAt(i++); + }, function (b) { + out.push(b); + }); + return out; + } + + // A base64 implementation for the bcrypt algorithm. This is partly non-standard. + + /** + * bcrypt's own non-standard base64 dictionary. + * @type {!Array.} + * @const + * @inner + **/ + var BASE64_CODE = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(''); + + /** + * @type {!Array.} + * @const + * @inner + **/ + var BASE64_INDEX = [-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, + 1, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, -1, -1, -1, -1, -1, -1, + -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, -1, -1, -1, -1, -1, -1, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, -1, -1, -1, -1, -1]; + + /** + * @type {!function(...number):string} + * @inner + */ + var stringFromCharCode = String.fromCharCode; + + /** + * Encodes a byte array to base64 with up to len bytes of input. + * @param {!Array.} b Byte array + * @param {number} len Maximum input length + * @returns {string} + * @inner + */ + function base64_encode(b, len) { + var off = 0, + rs = [], + c1, c2; + if (len <= 0 || len > b.length) + throw Error("Illegal len: " + len); + while (off < len) { + c1 = b[off++] & 0xff; + rs.push(BASE64_CODE[(c1 >> 2) & 0x3f]); + c1 = (c1 & 0x03) << 4; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 0x3f]); + break; + } + c2 = b[off++] & 0xff; + c1 |= (c2 >> 4) & 0x0f; + rs.push(BASE64_CODE[c1 & 0x3f]); + c1 = (c2 & 0x0f) << 2; + if (off >= len) { + rs.push(BASE64_CODE[c1 & 0x3f]); + break; + } + c2 = b[off++] & 0xff; + c1 |= (c2 >> 6) & 0x03; + rs.push(BASE64_CODE[c1 & 0x3f]); + rs.push(BASE64_CODE[c2 & 0x3f]); + } + return rs.join(''); + } + + /** + * Decodes a base64 encoded string to up to len bytes of output. + * @param {string} s String to decode + * @param {number} len Maximum output length + * @returns {!Array.} + * @inner + */ + function base64_decode(s, len) { + var off = 0, + slen = s.length, + olen = 0, + rs = [], + c1, c2, c3, c4, o, code; + if (len <= 0) + throw Error("Illegal len: " + len); + while (off < slen - 1 && olen < len) { + code = s.charCodeAt(off++); + c1 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + code = s.charCodeAt(off++); + c2 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c1 == -1 || c2 == -1) + break; + o = (c1 << 2) >>> 0; + o |= (c2 & 0x30) >> 4; + rs.push(stringFromCharCode(o)); + if (++olen >= len || off >= slen) + break; + code = s.charCodeAt(off++); + c3 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + if (c3 == -1) + break; + o = ((c2 & 0x0f) << 4) >>> 0; + o |= (c3 & 0x3c) >> 2; + rs.push(stringFromCharCode(o)); + if (++olen >= len || off >= slen) + break; + code = s.charCodeAt(off++); + c4 = code < BASE64_INDEX.length ? BASE64_INDEX[code] : -1; + o = ((c3 & 0x03) << 6) >>> 0; + o |= c4; + rs.push(stringFromCharCode(o)); + ++olen; + } + var res = []; + for (off = 0; off < olen; off++) + res.push(rs[off].charCodeAt(0)); + return res; + } + + /** + * utfx-embeddable (c) 2014 Daniel Wirtz + * Released under the Apache License, Version 2.0 + * see: https://github.com/dcodeIO/utfx for details + */ + var utfx = function () { + + /** + * utfx namespace. + * @inner + * @type {!Object.} + */ + var utfx = {}; + + /** + * Maximum valid code point. + * @type {number} + * @const + */ + utfx.MAX_CODEPOINT = 0x10FFFF; + + /** + * Encodes UTF8 code points to UTF8 bytes. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte + */ + utfx.encodeUTF8 = function (src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, + src = function () { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp < 0x80) + dst(cp & 0x7F); + else if (cp < 0x800) + dst(((cp >> 6) & 0x1F) | 0xC0), + dst((cp & 0x3F) | 0x80); + else if (cp < 0x10000) + dst(((cp >> 12) & 0x0F) | 0xE0), + dst(((cp >> 6) & 0x3F) | 0x80), + dst((cp & 0x3F) | 0x80); + else + dst(((cp >> 18) & 0x07) | 0xF0), + dst(((cp >> 12) & 0x3F) | 0x80), + dst(((cp >> 6) & 0x3F) | 0x80), + dst((cp & 0x3F) | 0x80); + cp = null; + } + }; + + /** + * Decodes UTF8 bytes to UTF8 code points. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Code points destination as a function successively called with each decoded code point. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the + * remaining bytes. + */ + utfx.decodeUTF8 = function (src, dst) { + var a, b, c, d, fail = function (b) { + b = b.slice(0, b.indexOf(null)); + var err = Error(b.toString()); + err.name = "TruncatedError"; + err['bytes'] = b; + throw err; + }; + while ((a = src()) !== null) { + if ((a & 0x80) === 0) + dst(a); + else if ((a & 0xE0) === 0xC0) + ((b = src()) === null) && fail([a, b]), + dst(((a & 0x1F) << 6) | (b & 0x3F)); + else if ((a & 0xF0) === 0xE0) + ((b = src()) === null || (c = src()) === null) && fail([a, b, c]), + dst(((a & 0x0F) << 12) | ((b & 0x3F) << 6) | (c & 0x3F)); + else if ((a & 0xF8) === 0xF0) + ((b = src()) === null || (c = src()) === null || (d = src()) === null) && fail([a, b, c, d]), + dst(((a & 0x07) << 18) | ((b & 0x3F) << 12) | ((c & 0x3F) << 6) | (d & 0x3F)); + else throw RangeError("Illegal starting byte: " + a); + } + }; + + /** + * Converts UTF16 characters to UTF8 code points. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @param {!function(number)} dst Code points destination as a function successively called with each converted code + * point. + */ + utfx.UTF16toUTF8 = function (src, dst) { + var c1, c2 = null; + while (true) { + if ((c1 = c2 !== null ? c2 : src()) === null) + break; + if (c1 >= 0xD800 && c1 <= 0xDFFF) { + if ((c2 = src()) !== null) { + if (c2 >= 0xDC00 && c2 <= 0xDFFF) { + dst((c1 - 0xD800) * 0x400 + c2 - 0xDC00 + 0x10000); + c2 = null; continue; + } + } + } + dst(c1); + } + if (c2 !== null) dst(c2); + }; + + /** + * Converts UTF8 code points to UTF16 characters. + * @param {(!function():number|null) | number} src Code points source, either as a function returning the next code point + * respectively `null` if there are no more code points left or a single numeric code point. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a code point is out of range + */ + utfx.UTF8toUTF16 = function (src, dst) { + var cp = null; + if (typeof src === 'number') + cp = src, src = function () { return null; }; + while (cp !== null || (cp = src()) !== null) { + if (cp <= 0xFFFF) + dst(cp); + else + cp -= 0x10000, + dst((cp >> 10) + 0xD800), + dst((cp % 0x400) + 0xDC00); + cp = null; + } + }; + + /** + * Converts and encodes UTF16 characters to UTF8 bytes. + * @param {!function():number|null} src Characters source as a function returning the next char code respectively `null` + * if there are no more characters left. + * @param {!function(number)} dst Bytes destination as a function successively called with the next byte. + */ + utfx.encodeUTF16toUTF8 = function (src, dst) { + utfx.UTF16toUTF8(src, function (cp) { + utfx.encodeUTF8(cp, dst); + }); + }; + + /** + * Decodes and converts UTF8 bytes to UTF16 characters. + * @param {!function():number|null} src Bytes source as a function returning the next byte respectively `null` if there + * are no more bytes left. + * @param {!function(number)} dst Characters destination as a function successively called with each converted char code. + * @throws {RangeError} If a starting byte is invalid in UTF8 + * @throws {Error} If the last sequence is truncated. Has an array property `bytes` holding the remaining bytes. + */ + utfx.decodeUTF8toUTF16 = function (src, dst) { + utfx.decodeUTF8(src, function (cp) { + utfx.UTF8toUTF16(cp, dst); + }); + }; + + /** + * Calculates the byte length of an UTF8 code point. + * @param {number} cp UTF8 code point + * @returns {number} Byte length + */ + utfx.calculateCodePoint = function (cp) { + return (cp < 0x80) ? 1 : (cp < 0x800) ? 2 : (cp < 0x10000) ? 3 : 4; + }; + + /** + * Calculates the number of UTF8 bytes required to store UTF8 code points. + * @param {(!function():number|null)} src Code points source as a function returning the next code point respectively + * `null` if there are no more code points left. + * @returns {number} The number of UTF8 bytes required + */ + utfx.calculateUTF8 = function (src) { + var cp, l = 0; + while ((cp = src()) !== null) + l += utfx.calculateCodePoint(cp); + return l; + }; + + /** + * Calculates the number of UTF8 code points respectively UTF8 bytes required to store UTF16 char codes. + * @param {(!function():number|null)} src Characters source as a function returning the next char code respectively + * `null` if there are no more characters left. + * @returns {!Array.} The number of UTF8 code points at index 0 and the number of UTF8 bytes required at index 1. + */ + utfx.calculateUTF16asUTF8 = function (src) { + var n = 0, l = 0; + utfx.UTF16toUTF8(src, function (cp) { + ++n; l += utfx.calculateCodePoint(cp); + }); + return [n, l]; + }; + + return utfx; + }(); + + Date.now = Date.now || function () { return +new Date; }; + + /** + * @type {number} + * @const + * @inner + */ + var BCRYPT_SALT_LEN = 16; + + /** + * @type {number} + * @const + * @inner + */ + var GENSALT_DEFAULT_LOG2_ROUNDS = 10; + + /** + * @type {number} + * @const + * @inner + */ + var BLOWFISH_NUM_ROUNDS = 16; + + /** + * @type {number} + * @const + * @inner + */ + var MAX_EXECUTION_TIME = 100; + + /** + * @type {Array.} + * @const + * @inner + */ + var P_ORIG = [ + 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, + 0x299f31d0, 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, + 0xbe5466cf, 0x34e90c6c, 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, + 0xb5470917, 0x9216d5d9, 0x8979fb1b + ]; + + /** + * @type {Array.} + * @const + * @inner + */ + var S_ORIG = [ + 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, + 0x6a267e96, 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, + 0x0801f2e2, 0x858efc16, 0x636920d8, 0x71574e69, 0xa458fea3, + 0xf4933d7e, 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, 0xc5d1b023, + 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e, + 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, + 0x55605c60, 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, 0xa15486af, + 0x7c72e993, 0xb3ee1411, 0x636fbc2a, 0x2ba9c55d, 0x741831f6, + 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c, 0x7a325381, + 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, + 0xe98575b1, 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, + 0x0f6d6ff3, 0x83f44239, 0x2e0b4482, 0xa4842004, 0x69c8f04a, + 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, 0x6eef0b6c, + 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176, + 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, + 0x3b8b5ebe, 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, 0x37d0d724, + 0xd00a1248, 0xdb0fead3, 0x49f1c09b, 0x075372c9, 0x80991b7b, + 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, + 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, + 0x9b30952c, 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, + 0x660f2807, 0x192e4bb3, 0xc0cba857, 0x45c8740f, 0xd20b5f39, + 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, 0x3c7516df, + 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760, + 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, + 0xdf1769db, 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, + 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, 0x9a53e479, 0xb6f84565, + 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, + 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, + 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, + 0x8888b812, 0x900df01c, 0x4fad5ea0, 0x688fc31c, 0xd1cff191, + 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, 0xb4a84fe0, + 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705, + 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, + 0xfb9d35cf, 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, 0x2464369b, + 0xf009b91e, 0x5563911d, 0x59dfa6aa, 0x78c14389, 0xd95a537f, + 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9, 0x11c81968, + 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, + 0x571be91f, 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, + 0xff34052e, 0xc5855664, 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, + 0x6e85076a, 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, 0xecaa8c71, + 0x699a17ff, 0x5664526c, 0xc2b19ee1, 0x193602a5, 0x75094c29, + 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, + 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, + 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, + 0xb79c5305, 0xaa500737, 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, + 0x5716f2b8, 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, 0xd19113f9, + 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc, + 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, + 0xa4751e41, 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, 0x2cb81290, + 0x24977c79, 0x5679b072, 0xbcaf89af, 0xde9a771f, 0xd9930810, + 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124, 0x501adde6, + 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, + 0x3215d908, 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, + 0x50940002, 0x133ae4dd, 0x71dff89e, 0x10314e55, 0x81ac77d6, + 0x5f11199b, 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, 0x86e34570, + 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa, + 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, + 0x9c10b36a, 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, 0x5223a708, + 0xf71312b6, 0xebadfe6e, 0xeac31f66, 0xe3bc4595, 0xa67bc883, + 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5, 0x65582185, + 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, + 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, + 0xd59e9e0b, 0xcbaade14, 0xeecc86bc, 0x60622ca7, 0x9cab5cab, + 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, 0x9b540b19, + 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77, + 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, + 0x7858ba99, 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, + 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, 0x5d4a14d9, 0xe864b7e3, + 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, + 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, + 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, + 0x47848a0b, 0x5692b285, 0x095bbf00, 0xad19489d, 0x1462b174, + 0x23820e00, 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, 0x7cde3759, + 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e, + 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, + 0x800bcadc, 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, 0xc5c43465, + 0x713e38d8, 0x3d28f89e, 0xf16dff20, 0x153e21e7, 0x8fb03d4a, + 0xe6e39f2b, 0xdb83adf7, 0xe93d5a68, 0x948140f7, 0xf64c261c, + 0x94692934, 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, 0x1e39f62e, + 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af, + 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, + 0x31cb8504, 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, + 0xd7486900, 0x680ec0a4, 0x27a18dee, 0x4f3ffea2, 0xe887ad8c, + 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec, 0xce78a399, + 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, + 0xdd5b4332, 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, + 0x454056ac, 0xba489527, 0x55533a3a, 0x20838d87, 0xfe6ba9b7, + 0xd096954b, 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, 0xfdf8e802, + 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22, + 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, + 0x5d886e17, 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, + 0x02e1329e, 0xaf664fd1, 0xcad18115, 0x6b2395e0, 0x333e92e1, + 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, + 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, + 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, + 0x991be14c, 0xdb6e6b0d, 0xc67b5510, 0x6d672c37, 0x2765d43b, + 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, 0xbb132f88, + 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979, + 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, + 0x782ef11c, 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, + 0x0a121386, 0xd90cec6e, 0xd5abea2a, 0x64af674e, 0xda86a85f, + 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086, 0x60787bf8, + 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, + 0xbde8ae24, 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, + 0xf474ef38, 0x8789bdc2, 0x5366f9c3, 0xc8b38e74, 0xb475f255, + 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, 0xb90bace1, + 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09, + 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, + 0x1d6efe10, 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, + 0xa70683fa, 0xa002b5c4, 0x0de6d027, 0x9af88c27, 0x773f8641, + 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0, 0x006058aa, + 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, + 0x4b7c0188, 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, + 0x1ac15bb4, 0xd39eb8fc, 0xed545578, 0x08fca5b5, 0xd83d7cd3, + 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, 0xd79a3234, + 0x92638212, 0x670efa8e, 0x406000e0, 0x3a39ce37, 0xd3faf5cf, + 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742, 0xd3822740, + 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, + 0xbc946e79, 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, + 0xd5730a1d, 0x4cd04dc6, 0x2939bbdb, 0xa9ba4650, 0xac9526e8, + 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, 0x83c061ba, + 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1, + 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, + 0x77fa0a59, 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, + 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, 0x1f9f25cf, 0xadf2b89b, + 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6, 0x47b0acfd, + 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, + 0x88f46dba, 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, + 0x97271aec, 0xa93a072a, 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, + 0x26dcf319, 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, 0x4de81751, + 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce, + 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, + 0x6413e680, 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, + 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, 0xdda26a7e, 0x3a59ff45, + 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb, 0x8d6612ae, + 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, + 0x4eb4e2cc, 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, + 0x06b89fb4, 0xce6ea048, 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, + 0x277227f8, 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, 0xe01cc87e, + 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a, + 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, + 0xe0b12b4f, 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, 0xfae59361, + 0xceb69ceb, 0xc2a86459, 0x12baa8d1, 0xb6c1075e, 0xe3056a0c, + 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, + 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, + 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, + 0xce6279cf, 0xcd3e7e6f, 0x1618b166, 0xfd2c1d05, 0x848fd2c5, + 0xf6fb2299, 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, 0xde966292, + 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a, + 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, + 0x35bdd2f6, 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, 0xba38209c, + 0xf746ce76, 0x77afa1c5, 0x20756060, 0x85cbfe4e, 0x8ae88dd8, + 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, + 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 + ]; + + /** + * @type {Array.} + * @const + * @inner + */ + var C_ORIG = [ + 0x4f727068, 0x65616e42, 0x65686f6c, 0x64657253, 0x63727944, + 0x6f756274 + ]; + + /** + * @param {Array.} lr + * @param {number} off + * @param {Array.} P + * @param {Array.} S + * @returns {Array.} + * @inner + */ + function _encipher(lr, off, P, S) { // This is our bottleneck: 1714/1905 ticks / 90% - see profile.txt + var n, + l = lr[off], + r = lr[off + 1]; + + l ^= P[0]; + + /* + for (var i=0, k=BLOWFISH_NUM_ROUNDS-2; i<=k;) + // Feistel substitution on left word + n = S[l >>> 24], + n += S[0x100 | ((l >> 16) & 0xff)], + n ^= S[0x200 | ((l >> 8) & 0xff)], + n += S[0x300 | (l & 0xff)], + r ^= n ^ P[++i], + // Feistel substitution on right word + n = S[r >>> 24], + n += S[0x100 | ((r >> 16) & 0xff)], + n ^= S[0x200 | ((r >> 8) & 0xff)], + n += S[0x300 | (r & 0xff)], + l ^= n ^ P[++i]; + */ + + //The following is an unrolled version of the above loop. + //Iteration 0 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[1]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[2]; + //Iteration 1 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[3]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[4]; + //Iteration 2 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[5]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[6]; + //Iteration 3 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[7]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[8]; + //Iteration 4 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[9]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[10]; + //Iteration 5 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[11]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[12]; + //Iteration 6 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[13]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[14]; + //Iteration 7 + n = S[l >>> 24]; + n += S[0x100 | ((l >> 16) & 0xff)]; + n ^= S[0x200 | ((l >> 8) & 0xff)]; + n += S[0x300 | (l & 0xff)]; + r ^= n ^ P[15]; + n = S[r >>> 24]; + n += S[0x100 | ((r >> 16) & 0xff)]; + n ^= S[0x200 | ((r >> 8) & 0xff)]; + n += S[0x300 | (r & 0xff)]; + l ^= n ^ P[16]; + + lr[off] = r ^ P[BLOWFISH_NUM_ROUNDS + 1]; + lr[off + 1] = l; + return lr; + } + + /** + * @param {Array.} data + * @param {number} offp + * @returns {{key: number, offp: number}} + * @inner + */ + function _streamtoword(data, offp) { + for (var i = 0, word = 0; i < 4; ++i) + word = (word << 8) | (data[offp] & 0xff), + offp = (offp + 1) % data.length; + return { key: word, offp: offp }; + } + + /** + * @param {Array.} key + * @param {Array.} P + * @param {Array.} S + * @inner + */ + function _key(key, P, S) { + var offset = 0, + lr = [0, 0], + plen = P.length, + slen = S.length, + sw; + for (var i = 0; i < plen; i++) + sw = _streamtoword(key, offset), + offset = sw.offp, + P[i] = P[i] ^ sw.key; + for (i = 0; i < plen; i += 2) + lr = _encipher(lr, 0, P, S), + P[i] = lr[0], + P[i + 1] = lr[1]; + for (i = 0; i < slen; i += 2) + lr = _encipher(lr, 0, P, S), + S[i] = lr[0], + S[i + 1] = lr[1]; + } + + /** + * Expensive key schedule Blowfish. + * @param {Array.} data + * @param {Array.} key + * @param {Array.} P + * @param {Array.} S + * @inner + */ + function _ekskey(data, key, P, S) { + var offp = 0, + lr = [0, 0], + plen = P.length, + slen = S.length, + sw; + for (var i = 0; i < plen; i++) + sw = _streamtoword(key, offp), + offp = sw.offp, + P[i] = P[i] ^ sw.key; + offp = 0; + for (i = 0; i < plen; i += 2) + sw = _streamtoword(data, offp), + offp = sw.offp, + lr[0] ^= sw.key, + sw = _streamtoword(data, offp), + offp = sw.offp, + lr[1] ^= sw.key, + lr = _encipher(lr, 0, P, S), + P[i] = lr[0], + P[i + 1] = lr[1]; + for (i = 0; i < slen; i += 2) + sw = _streamtoword(data, offp), + offp = sw.offp, + lr[0] ^= sw.key, + sw = _streamtoword(data, offp), + offp = sw.offp, + lr[1] ^= sw.key, + lr = _encipher(lr, 0, P, S), + S[i] = lr[0], + S[i + 1] = lr[1]; + } + + /** + * Internaly crypts a string. + * @param {Array.} b Bytes to crypt + * @param {Array.} salt Salt bytes to use + * @param {number} rounds Number of rounds + * @param {function(Error, Array.=)=} callback Callback receiving the error, if any, and the resulting bytes. If + * omitted, the operation will be performed synchronously. + * @param {function(number)=} progressCallback Callback called with the current progress + * @returns {!Array.|undefined} Resulting bytes if callback has been omitted, otherwise `undefined` + * @inner + */ + function _crypt(b, salt, rounds, callback, progressCallback) { + var cdata = C_ORIG.slice(), + clen = cdata.length, + err; + + // Validate + if (rounds < 4 || rounds > 31) { + err = Error("Illegal number of rounds (4-31): " + rounds); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else + throw err; + } + if (salt.length !== BCRYPT_SALT_LEN) { + err = Error("Illegal salt length: " + salt.length + " != " + BCRYPT_SALT_LEN); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else + throw err; + } + rounds = (1 << rounds) >>> 0; + + var P, S, i = 0, j; + + //Use typed arrays when available - huge speedup! + if (Int32Array) { + P = new Int32Array(P_ORIG); + S = new Int32Array(S_ORIG); + } else { + P = P_ORIG.slice(); + S = S_ORIG.slice(); + } + + _ekskey(salt, b, P, S); + + /** + * Calcualtes the next round. + * @returns {Array.|undefined} Resulting array if callback has been omitted, otherwise `undefined` + * @inner + */ + function next() { + if (progressCallback) + progressCallback(i / rounds); + if (i < rounds) { + var start = Date.now(); + for (; i < rounds;) { + i = i + 1; + _key(b, P, S); + _key(salt, P, S); + if (Date.now() - start > MAX_EXECUTION_TIME) + break; + } + } else { + for (i = 0; i < 64; i++) + for (j = 0; j < (clen >> 1); j++) + _encipher(cdata, j << 1, P, S); + var ret = []; + for (i = 0; i < clen; i++) + ret.push(((cdata[i] >> 24) & 0xff) >>> 0), + ret.push(((cdata[i] >> 16) & 0xff) >>> 0), + ret.push(((cdata[i] >> 8) & 0xff) >>> 0), + ret.push((cdata[i] & 0xff) >>> 0); + if (callback) { + callback(null, ret); + return; + } else + return ret; + } + if (callback) + nextTick(next); + } + + // Async + if (typeof callback !== 'undefined') { + next(); + + // Sync + } else { + var res; + while (true) + if (typeof (res = next()) !== 'undefined') + return res || []; + } + } + + /** + * Internally hashes a string. + * @param {string} s String to hash + * @param {?string} salt Salt to use, actually never null + * @param {function(Error, string=)=} callback Callback receiving the error, if any, and the resulting hash. If omitted, + * hashing is perormed synchronously. + * @param {function(number)=} progressCallback Callback called with the current progress + * @returns {string|undefined} Resulting hash if callback has been omitted, otherwise `undefined` + * @inner + */ + function _hash(s, salt, callback, progressCallback) { + var err; + if (typeof s !== 'string' || typeof salt !== 'string') { + err = Error("Invalid string / salt: Not a string"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } + else + throw err; + } + + // Validate the salt + var minor, offset; + if (salt.charAt(0) !== '$' || salt.charAt(1) !== '2') { + err = Error("Invalid salt version: " + salt.substring(0, 2)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } + else + throw err; + } + if (salt.charAt(2) === '$') + minor = String.fromCharCode(0), + offset = 3; + else { + minor = salt.charAt(2); + if ((minor !== 'a' && minor !== 'b' && minor !== 'y') || salt.charAt(3) !== '$') { + err = Error("Invalid salt revision: " + salt.substring(2, 4)); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else + throw err; + } + offset = 4; + } + + // Extract number of rounds + if (salt.charAt(offset + 2) > '$') { + err = Error("Missing salt rounds"); + if (callback) { + nextTick(callback.bind(this, err)); + return; + } else + throw err; + } + var r1 = parseInt(salt.substring(offset, offset + 1), 10) * 10, + r2 = parseInt(salt.substring(offset + 1, offset + 2), 10), + rounds = r1 + r2, + real_salt = salt.substring(offset + 3, offset + 25); + s += minor >= 'a' ? "\x00" : ""; + + var passwordb = stringToBytes(s), + saltb = base64_decode(real_salt, BCRYPT_SALT_LEN); + + /** + * Finishes hashing. + * @param {Array.} bytes Byte array + * @returns {string} + * @inner + */ + function finish(bytes) { + var res = []; + res.push("$2"); + if (minor >= 'a') + res.push(minor); + res.push("$"); + if (rounds < 10) + res.push("0"); + res.push(rounds.toString()); + res.push("$"); + res.push(base64_encode(saltb, saltb.length)); + res.push(base64_encode(bytes, C_ORIG.length * 4 - 1)); + return res.join(''); + } + + // Sync + if (typeof callback == 'undefined') + return finish(_crypt(passwordb, saltb, rounds)); + + // Async + else { + _crypt(passwordb, saltb, rounds, function (err, bytes) { + if (err) + callback(err, null); + else + callback(null, finish(bytes)); + }, progressCallback); + } + } + + /** + * Encodes a byte array to base64 with up to len bytes of input, using the custom bcrypt alphabet. + * @function + * @param {!Array.} b Byte array + * @param {number} len Maximum input length + * @returns {string} + * @expose + */ + bcrypt.encodeBase64 = base64_encode; + + /** + * Decodes a base64 encoded string to up to len bytes of output, using the custom bcrypt alphabet. + * @function + * @param {string} s String to decode + * @param {number} len Maximum output length + * @returns {!Array.} + * @expose + */ + bcrypt.decodeBase64 = base64_decode; + + return bcrypt; + })); + }); + + // this is the combinator function + const $$ = (...funcs) => arg => lodash_1(funcs)(arg); + + // this is the pipe function + const $ = (arg, funcs) => $$(...funcs)(arg); + + const keySep = "/"; + const trimKeySep = str => lodash_10(str, keySep); + const splitByKeySep = str => fp_3(keySep)(str); + const safeKey = key => + lodash_12(`${keySep}${trimKeySep(key)}`, `${keySep}${keySep}`, keySep); + const joinKey = (...strs) => { + const paramsOrArray = (strs.length === 1) & fp_11(strs[0]) ? strs[0] : strs; + return $(paramsOrArray, [ + fp_13(s => !fp_2(s) && !fp_29(s) && s.toString().length > 0), + fp_18(keySep), + safeKey, + ]) + }; + const splitKey = $$(trimKeySep, splitByKeySep); + + const configFolder = `${keySep}.config`; + const fieldDefinitions = joinKey(configFolder, "fields.json"); + const templateDefinitions = joinKey(configFolder, "templates.json"); + const appDefinitionFile = joinKey(configFolder, "appDefinition.json"); + + const not = func => val => !func(val); + const isDefined = not(fp_2); + const isNonNull = not(fp_29); + const isNotNaN = not(fp_36); + + const allTrue = (...funcArgs) => val => + fp_7( + (result, conditionFunc) => + (fp_29(result) || result == true) && conditionFunc(val), + null + )(funcArgs); + + const isSomething = allTrue(isDefined, isNonNull, isNotNaN); + const isNothing = not(isSomething); + + const none = predicate => collection => !fp_10(predicate)(collection); + + const all = predicate => collection => + none(v => !predicate(v))(collection); + + const isNotEmpty = ob => !fp_16(ob); + const isNonEmptyString = allTrue(fp_27, isNotEmpty); + const tryOr = failFunc => (func, ...args) => { + try { + return func.apply(null, ...args) + } catch (_) { + return failFunc() + } + }; + const causesException = func => { + try { + func(); + return false + } catch (e) { + return true + } + }; + + const executesWithoutException = func => !causesException(func); + + const handleErrorWith = returnValInError => + tryOr(fp_21(returnValInError)); + + const handleErrorWithUndefined = handleErrorWith(undefined); + + const switchCase = (...cases) => value => { + const nextCase = () => lodash_2(cases)[0](value); + const nextResult = () => lodash_2(cases)[1](value); + + if (fp_16(cases)) return // undefined + if (nextCase() === true) return nextResult() + return switchCase(...lodash_5(cases))(value) + }; + const isOneOf = (...vals) => val => fp_19(val)(vals); + const defaultCase = fp_21(true); + + const isSafeInteger = n => + fp_37(n) && + n <= Number.MAX_SAFE_INTEGER && + n >= 0 - Number.MAX_SAFE_INTEGER; + + const toDateOrNull = s => + fp_29(s) ? null : fp_32(s) ? s : new Date(s); + const toBoolOrNull = s => (fp_29(s) ? null : s === "true" || s === true); + const toNumberOrNull = s => (fp_29(s) ? null : fp_38(s)); + + const isArrayOfString = opts => fp_11(opts) && all(fp_27)(opts); + + const makerule = (field, error, isValid) => ({ field, error, isValid }); + + var filters = new Map(); + var limiters = new Map(); + + function compileRawExpression(src) { + return new Function('context', 'tempVars', // eslint-disable-line + ("const sandbox = $nxCompileToSandbox(context, tempVars)\n try { with (sandbox) { return " + src + " } } catch (err) {\n if (!(err instanceof TypeError)) throw err\n }\n $nxClearSandbox()")); + } + + function compileRawCode(src) { + return new Function('context', 'tempVars', // eslint-disable-line + ("const sandbox = $nxCompileToSandbox(context, tempVars)\n with (sandbox) { " + src + " }\n $nxClearSandbox()")); + } + + var filterRegex = /(?:[^\|]|\|\|)+/g; + var limiterRegex = /(?:[^&]|&&)+/g; + var argsRegex = /\S+/g; + + function parseExpression(src) { + var tokens = src.match(filterRegex); + if (tokens.length === 1) { + return compileRawExpression(tokens[0]); + } + + var expression = { + exec: compileRawExpression(tokens[0]), + filters: [] + }; + for (var i = 1; i < tokens.length; i++) { + var filterTokens = tokens[i].match(argsRegex); + var filterName = filterTokens.shift(); + var effect = filters.get(filterName); + if (!effect) { + throw new Error(("There is no filter named: " + filterName + ".")); + } + expression.filters.push({ effect: effect, argExpressions: filterTokens.map(compileRawExpression) }); + } + return expression; + } + + function parseCode(src) { + var tokens = src.match(limiterRegex); + if (tokens.length === 1) { + return compileRawCode(tokens[0]); + } + + var code = { + exec: compileRawCode(tokens[0]), + limiters: [] + }; + for (var i = 1; i < tokens.length; i++) { + var limiterTokens = tokens[i].match(argsRegex); + var limiterName = limiterTokens.shift(); + var effect = limiters.get(limiterName); + if (!effect) { + throw new Error(("There is no limiter named: " + limiterName + ".")); + } + code.limiters.push({ effect: effect, argExpressions: limiterTokens.map(compileRawExpression) }); + } + return code; + } + + var expressionCache = new Map(); + var codeCache = new Map(); + + function compileExpression(src) { + if (typeof src !== 'string') { + throw new TypeError('First argument must be a string.'); + } + var expression = expressionCache.get(src); + if (!expression) { + expression = parseExpression(src); + expressionCache.set(src, expression); + } + + if (typeof expression === 'function') { return expression; } - function parseCode(src) { - var tokens = src.match(limiterRegex); - if (tokens.length === 1) { - return compileRawCode(tokens[0]); - } + return function evaluateExpression(context, tempVars) { + var value = expression.exec(context, tempVars); + for (var i = 0, list = expression.filters; i < list.length; i += 1) { + var filter = list[i]; - var code = { - exec: compileRawCode(tokens[0]), - limiters: [] - }; - for (var i = 1; i < tokens.length; i++) { - var limiterTokens = tokens[i].match(argsRegex); - var limiterName = limiterTokens.shift(); - var effect = limiters.get(limiterName); - if (!effect) { - throw new Error(("There is no limiter named: " + limiterName + ".")); - } - code.limiters.push({ effect: effect, argExpressions: limiterTokens.map(compileRawExpression) }); + var args = filter.argExpressions.map(evaluateArgExpression, context); + value = filter.effect.apply(filter, [value].concat(args)); } + return value; + }; + } + + function compileCode(src) { + if (typeof src !== 'string') { + throw new TypeError('First argument must be a string.'); + } + var code = codeCache.get(src); + if (!code) { + code = parseCode(src); + codeCache.set(src, code); + } + + if (typeof code === 'function') { return code; } - var expressionCache = new Map(); - var codeCache = new Map(); - - function compileExpression(src) { - if (typeof src !== 'string') { - throw new TypeError('First argument must be a string.'); - } - var expression = expressionCache.get(src); - if (!expression) { - expression = parseExpression(src); - expressionCache.set(src, expression); - } - - if (typeof expression === 'function') { - return expression; - } - - return function evaluateExpression(context, tempVars) { - var value = expression.exec(context, tempVars); - for (var i = 0, list = expression.filters; i < list.length; i += 1) { - var filter = list[i]; - - var args = filter.argExpressions.map(evaluateArgExpression, context); - value = filter.effect.apply(filter, [ value ].concat( args )); + var context = {}; + return function evaluateCode(state, tempVars) { + var i = 0; + function next() { + Object.assign(context, tempVars); + if (i < code.limiters.length) { + var limiter = code.limiters[i++]; + var args = limiter.argExpressions.map(evaluateArgExpression, state); + limiter.effect.apply(limiter, [next, context].concat(args)); + } else { + code.exec(state, tempVars); } - return value; - }; - } - - function compileCode(src) { - if (typeof src !== 'string') { - throw new TypeError('First argument must be a string.'); - } - var code = codeCache.get(src); - if (!code) { - code = parseCode(src); - codeCache.set(src, code); } + next(); + }; + } - if (typeof code === 'function') { - return code; - } + function evaluateArgExpression(argExpression) { + return argExpression(this); + } - var context = {}; - return function evaluateCode(state, tempVars) { - var i = 0; - function next() { - Object.assign(context, tempVars); - if (i < code.limiters.length) { - var limiter = code.limiters[i++]; - var args = limiter.argExpressions.map(evaluateArgExpression, state); - limiter.effect.apply(limiter, [ next, context ].concat( args )); - } else { - code.exec(state, tempVars); - } - } - next(); - }; + var hasHandler = { has: has }; + var allHandlers = { has: has, get: get$1 }; + var globals$1 = new Set(); + var temp; + + var globalObj; + if (typeof window !== 'undefined') { globalObj = window; } // eslint-disable-line + else if (typeof global !== 'undefined') { globalObj = global; } // eslint-disable-line + else if (typeof self !== 'undefined') { globalObj = self; } // eslint-disable-line + globalObj.$nxCompileToSandbox = toSandbox; + globalObj.$nxClearSandbox = clearSandbox; + + function has(target, key) { + return globals$1.has(key) ? key in target : true; + } + + function get$1(target, key) { + return key in temp ? temp[key] : target[key]; + } + + function toSandbox(obj, tempVars) { + if (tempVars) { + temp = tempVars; + return new Proxy(obj, allHandlers); } + return new Proxy(obj, hasHandler); + } - function evaluateArgExpression(argExpression) { - return argExpression(this); - } + function clearSandbox() { + temp = undefined; + } - var hasHandler = { has: has }; - var allHandlers = { has: has, get: get$1 }; - var globals$1 = new Set(); - var temp; + const compileFilter = index => compileExpression(index.filter); - var globalObj; - if (typeof window !== 'undefined') { globalObj = window; } // eslint-disable-line - else if (typeof global !== 'undefined') { globalObj = global; } // eslint-disable-line - else if (typeof self !== 'undefined') { globalObj = self; } // eslint-disable-line - globalObj.$nxCompileToSandbox = toSandbox; - globalObj.$nxClearSandbox = clearSandbox; + const compileMap = index => compileCode(index.map); - function has(target, key) { - return globals$1.has(key) ? key in target : true; - } + const indexTypes = { reference: "reference", ancestor: "ancestor" }; - function get$1(target, key) { - return key in temp ? temp[key] : target[key]; - } + const indexRuleSet = [ + makerule("map", "index has no map function", index => + isNonEmptyString(index.map) + ), + makerule( + "map", + "index's map function does not compile", + index => + !isNonEmptyString(index.map) || + executesWithoutException(() => compileMap(index)) + ), + makerule( + "filter", + "index's filter function does not compile", + index => + !isNonEmptyString(index.filter) || + executesWithoutException(() => compileFilter(index)) + ), + makerule("name", "must declare a name for index", index => + isNonEmptyString(index.name) + ), + makerule( + "name", + "there is a duplicate named index on this node", + index => + fp_16(index.name) || + fp_17("name")(index.parent().indexes)[index.name] === 1 + ), + makerule( + "indexType", + "reference index may only exist on a record node", + index => + isModel(index.parent()) || index.indexType !== indexTypes.reference + ), + makerule( + "indexType", + `index type must be one of: ${fp_18(", ")(fp_14(indexTypes))}`, + index => fp_19(index.indexType)(fp_14(indexTypes)) + ), + ]; - function toSandbox(obj, tempVars) { - if (tempVars) { - temp = tempVars; - return new Proxy(obj, allHandlers); - } - return new Proxy(obj, hasHandler); - } - - function clearSandbox() { - temp = undefined; - } - - const compileFilter = index => compileExpression(index.filter); - - const compileMap = index => compileCode(index.map); - - const indexTypes = { reference: "reference", ancestor: "ancestor" }; - - const indexRuleSet = [ - makerule("map", "index has no map function", index => - isNonEmptyString(index.map) - ), - makerule( - "map", - "index's map function does not compile", - index => - !isNonEmptyString(index.map) || - executesWithoutException(() => compileMap(index)) - ), - makerule( - "filter", - "index's filter function does not compile", - index => - !isNonEmptyString(index.filter) || - executesWithoutException(() => compileFilter(index)) - ), - makerule("name", "must declare a name for index", index => - isNonEmptyString(index.name) - ), - makerule( - "name", - "there is a duplicate named index on this node", - index => - fp_16(index.name) || - fp_17("name")(index.parent().indexes)[index.name] === 1 - ), - makerule( - "indexType", - "reference index may only exist on a record node", - index => - isRecord(index.parent()) || index.indexType !== indexTypes.reference - ), - makerule( - "indexType", - `index type must be one of: ${fp_18(", ")(fp_14(indexTypes))}`, - index => fp_19(index.indexType)(fp_14(indexTypes)) - ), - ]; - - const getFlattenedHierarchy = (appHierarchy, useCached = true) => { - if (isSomething(appHierarchy.getFlattenedHierarchy) && useCached) { - return appHierarchy.getFlattenedHierarchy() - } - - const flattenHierarchy = (currentNode, flattened) => { - flattened.push(currentNode); - if ( - (!currentNode.children || currentNode.children.length === 0) && - (!currentNode.indexes || currentNode.indexes.length === 0) && - (!currentNode.aggregateGroups || currentNode.aggregateGroups.length === 0) - ) { - return flattened - } - - const unionIfAny = l2 => l1 => fp_6(l1)(!l2 ? [] : l2); - - const children = $( - [], - [ - unionIfAny(currentNode.children), - unionIfAny(currentNode.indexes), - unionIfAny(currentNode.aggregateGroups), - ] - ); - - for (const child of children) { - flattenHierarchy(child, flattened); - } - return flattened - }; - - appHierarchy.getFlattenedHierarchy = () => flattenHierarchy(appHierarchy, []); + const getFlattenedHierarchy = (appHierarchy, useCached = true) => { + if (isSomething(appHierarchy.getFlattenedHierarchy) && useCached) { return appHierarchy.getFlattenedHierarchy() - }; + } - const getExactNodeForKey = appHierarchy => key => - $(appHierarchy, [ - getFlattenedHierarchy, - fp_1(n => new RegExp(`${n.pathRegx()}$`).test(key)), - ]); - - const getNodeForCollectionPath = appHierarchy => collectionKey => - $(appHierarchy, [ - getFlattenedHierarchy, - fp_1( - n => - isCollectionRecord(n) && - new RegExp(`${n.collectionPathRegx()}$`).test(collectionKey) - ), - ]); - - const getNode = (appHierarchy, nodeKey) => - $(appHierarchy, [ - getFlattenedHierarchy, - fp_1( - n => - n.nodeKey() === nodeKey || - (isCollectionRecord(n) && n.collectionNodeKey() === nodeKey) - ), - ]); - - const getNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { - const nodeByKey = getExactNodeForKey(appHierarchy)(keyOrNodeKey); - return isNothing(nodeByKey) ? getNode(appHierarchy, keyOrNodeKey) : nodeByKey - }; - - const isNode = (appHierarchy, key) => - isSomething(getExactNodeForKey(appHierarchy)(key)); - - const isRecord = node => isSomething(node) && node.type === "record"; - const isSingleRecord = node => isRecord(node) && node.isSingle; - const isCollectionRecord = node => isRecord(node) && !node.isSingle; - const isRoot = node => isSomething(node) && node.isRoot(); - - const getSafeFieldParser = (tryParse, defaultValueFunctions) => ( - field, - record - ) => { - if (fp_25(field.name)(record)) { - return getSafeValueParser( - tryParse, - defaultValueFunctions - )(record[field.name]) + const flattenHierarchy = (currentNode, flattened) => { + flattened.push(currentNode); + if ( + (!currentNode.children || currentNode.children.length === 0) && + (!currentNode.indexes || currentNode.indexes.length === 0) && + (!currentNode.aggregateGroups || currentNode.aggregateGroups.length === 0) + ) { + return flattened } - return defaultValueFunctions[field.getUndefinedValue]() - }; - const getSafeValueParser = ( - tryParse, - defaultValueFunctions - ) => value => { - const parsed = tryParse(value); - if (parsed.success) { - return parsed.value - } - return defaultValueFunctions.default() - }; + const unionIfAny = l2 => l1 => fp_6(l1)(!l2 ? [] : l2); - const getNewValue = (tryParse, defaultValueFunctions) => field => { - const getInitialValue = - fp_2(field) || fp_2(field.getInitialValue) - ? "default" - : field.getInitialValue; - - return fp_25(getInitialValue)(defaultValueFunctions) - ? defaultValueFunctions[getInitialValue]() - : getSafeValueParser(tryParse, defaultValueFunctions)(getInitialValue) - }; - - const typeFunctions = specificFunctions => - lodash_13( - { - value: fp_21, - null: fp_21(null), - }, - specificFunctions + const children = $( + [], + [ + unionIfAny(currentNode.children), + unionIfAny(currentNode.indexes), + unionIfAny(currentNode.aggregateGroups), + ] ); - const validateTypeConstraints = validationRules => async ( - field, - record, - context - ) => { - const fieldValue = record[field.name]; - const validateRule = async r => - !(await r.isValid(fieldValue, field.typeOptions, context)) - ? r.getMessage(fieldValue, field.typeOptions) - : ""; - - const errors = []; - for (const r of validationRules) { - const err = await validateRule(r); - if (isNotEmpty(err)) errors.push(err); + for (const child of children) { + flattenHierarchy(child, flattened); } - - return errors + return flattened }; - const getDefaultOptions = fp_26(v => v.defaultValue); + appHierarchy.getFlattenedHierarchy = () => flattenHierarchy(appHierarchy, []); + return appHierarchy.getFlattenedHierarchy() + }; - const makerule$1 = (isValid, getMessage) => ({ isValid, getMessage }); - const parsedFailed = val => ({ success: false, value: val }); - const parsedSuccess = val => ({ success: true, value: val }); - const getDefaultExport = ( - name, - tryParse, - functions, - options, - validationRules, - sampleValue, - stringify - ) => ({ - getNew: getNewValue(tryParse, functions), - safeParseField: getSafeFieldParser(tryParse, functions), - safeParseValue: getSafeValueParser(tryParse, functions), - tryParse, - name, - getDefaultOptions: () => getDefaultOptions(fp_9(options)), - optionDefinitions: options, - validateTypeConstraints: validateTypeConstraints(validationRules), - sampleValue, - stringify: val => (val === null || val === undefined ? "" : stringify(val)), - getDefaultValue: functions.default, - }); + const getExactNodeForKey = appHierarchy => key => + $(appHierarchy, [ + getFlattenedHierarchy, + fp_1(n => new RegExp(`${n.pathRegx()}$`).test(key)), + ]); - const stringFunctions = typeFunctions({ - default: fp_21(null), - }); - - const stringTryParse = switchCase( - [fp_27, parsedSuccess], - [fp_29, parsedSuccess], - [defaultCase, v => parsedSuccess(v.toString())] - ); - - const options = { - maxLength: { - defaultValue: null, - isValid: n => n === null || (isSafeInteger(n) && n > 0), - requirementDescription: - "max length must be null (no limit) or a greater than zero integer", - parse: toNumberOrNull, - }, - values: { - defaultValue: null, - isValid: v => - v === null || (isArrayOfString(v) && v.length > 0 && v.length < 10000), - requirementDescription: - "'values' must be null (no values) or an arry of at least one string", - parse: s => s, - }, - allowDeclaredValuesOnly: { - defaultValue: false, - isValid: fp_28, - requirementDescription: "allowDeclaredValuesOnly must be true or false", - parse: toBoolOrNull, - }, - }; - - const typeConstraints = [ - makerule$1( - async (val, opts) => - val === null || opts.maxLength === null || val.length <= opts.maxLength, - (val, opts) => `value exceeds maximum length of ${opts.maxLength}` + const getNodeForCollectionPath = appHierarchy => collectionKey => + $(appHierarchy, [ + getFlattenedHierarchy, + fp_1( + n => + isCollectionRecord(n) && + new RegExp(`${n.collectionPathRegx()}$`).test(collectionKey) ), - makerule$1( - async (val, opts) => - val === null || - opts.allowDeclaredValuesOnly === false || - fp_19(val)(opts.values), - val => `"${val}" does not exist in the list of allowed values` + ]); + + const getNode = (appHierarchy, nodeKey) => + $(appHierarchy, [ + getFlattenedHierarchy, + fp_1( + n => + n.nodeKey() === nodeKey || + (isCollectionRecord(n) && n.collectionNodeKey() === nodeKey) ), - ]; + ]); - var string = getDefaultExport( - "string", - stringTryParse, - stringFunctions, - options, - typeConstraints, - "abcde", - str => str + const getNodeByKeyOrNodeKey = (appHierarchy, keyOrNodeKey) => { + const nodeByKey = getExactNodeForKey(appHierarchy)(keyOrNodeKey); + return isNothing(nodeByKey) ? getNode(appHierarchy, keyOrNodeKey) : nodeByKey + }; + + const isNode = (appHierarchy, key) => + isSomething(getExactNodeForKey(appHierarchy)(key)); + + const isModel = node => isSomething(node) && node.type === "record"; + const isSingleRecord = node => isModel(node) && node.isSingle; + const isCollectionRecord = node => isModel(node) && !node.isSingle; + const isRoot = node => isSomething(node) && node.isRoot(); + + const getSafeFieldParser = (tryParse, defaultValueFunctions) => ( + field, + record + ) => { + if (fp_25(field.name)(record)) { + return getSafeValueParser( + tryParse, + defaultValueFunctions + )(record[field.name]) + } + return defaultValueFunctions[field.getUndefinedValue]() + }; + + const getSafeValueParser = ( + tryParse, + defaultValueFunctions + ) => value => { + const parsed = tryParse(value); + if (parsed.success) { + return parsed.value + } + return defaultValueFunctions.default() + }; + + const getNewValue = (tryParse, defaultValueFunctions) => field => { + const getInitialValue = + fp_2(field) || fp_2(field.getInitialValue) + ? "default" + : field.getInitialValue; + + return fp_25(getInitialValue)(defaultValueFunctions) + ? defaultValueFunctions[getInitialValue]() + : getSafeValueParser(tryParse, defaultValueFunctions)(getInitialValue) + }; + + const typeFunctions = specificFunctions => + lodash_13( + { + value: fp_21, + null: fp_21(null), + }, + specificFunctions ); - const boolFunctions = typeFunctions({ - default: fp_21(null), - }); + const validateTypeConstraints = validationRules => async ( + field, + record, + context + ) => { + const fieldValue = record[field.name]; + const validateRule = async r => + !(await r.isValid(fieldValue, field.typeOptions, context)) + ? r.getMessage(fieldValue, field.typeOptions) + : ""; - const boolTryParse = switchCase( - [fp_28, parsedSuccess], - [fp_29, parsedSuccess], - [isOneOf("true", "1", "yes", "on"), () => parsedSuccess(true)], - [isOneOf("false", "0", "no", "off"), () => parsedSuccess(false)], - [defaultCase, parsedFailed] - ); + const errors = []; + for (const r of validationRules) { + const err = await validateRule(r); + if (isNotEmpty(err)) errors.push(err); + } - const options$1 = { - allowNulls: { - defaultValue: true, - isValid: fp_28, - requirementDescription: "must be a true or false", - parse: toBoolOrNull, - }, - }; + return errors + }; - const typeConstraints$1 = [ - makerule$1( - async (val, opts) => opts.allowNulls === true || val !== null, - () => "field cannot be null" - ), - ]; + const getDefaultOptions = fp_26(v => v.defaultValue); - var bool = getDefaultExport( - "bool", - boolTryParse, - boolFunctions, - options$1, - typeConstraints$1, - true, - JSON.stringify - ); + const makerule$1 = (isValid, getMessage) => ({ isValid, getMessage }); + const parsedFailed = val => ({ success: false, value: val }); + const parsedSuccess = val => ({ success: true, value: val }); + const getDefaultExport = ( + name, + tryParse, + functions, + options, + validationRules, + sampleValue, + stringify + ) => ({ + getNew: getNewValue(tryParse, functions), + safeParseField: getSafeFieldParser(tryParse, functions), + safeParseValue: getSafeValueParser(tryParse, functions), + tryParse, + name, + getDefaultOptions: () => getDefaultOptions(fp_9(options)), + optionDefinitions: options, + validateTypeConstraints: validateTypeConstraints(validationRules), + sampleValue, + stringify: val => (val === null || val === undefined ? "" : stringify(val)), + getDefaultValue: functions.default, + }); - const numberFunctions = typeFunctions({ - default: fp_21(null), - }); + const stringFunctions = typeFunctions({ + default: fp_21(null), + }); - const parseStringtoNumberOrNull = s => { - const num = Number(s); - return isNaN(num) ? parsedFailed(s) : parsedSuccess(num) - }; + const stringTryParse = switchCase( + [fp_27, parsedSuccess], + [fp_29, parsedSuccess], + [defaultCase, v => parsedSuccess(v.toString())] + ); - const numberTryParse = switchCase( - [fp_30, parsedSuccess], - [fp_27, parseStringtoNumberOrNull], - [fp_29, parsedSuccess], - [defaultCase, parsedFailed] - ); + const options = { + maxLength: { + defaultValue: null, + isValid: n => n === null || (isSafeInteger(n) && n > 0), + requirementDescription: + "max length must be null (no limit) or a greater than zero integer", + parse: toNumberOrNull, + }, + values: { + defaultValue: null, + isValid: v => + v === null || (isArrayOfString(v) && v.length > 0 && v.length < 10000), + requirementDescription: + "'values' must be null (no values) or an arry of at least one string", + parse: s => s, + }, + allowDeclaredValuesOnly: { + defaultValue: false, + isValid: fp_28, + requirementDescription: "allowDeclaredValuesOnly must be true or false", + parse: toBoolOrNull, + }, + }; - const options$2 = { - maxValue: { - defaultValue: Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: "must be a valid integer", - parse: toNumberOrNull, - }, - minValue: { - defaultValue: 0 - Number.MAX_SAFE_INTEGER, - isValid: isSafeInteger, - requirementDescription: "must be a valid integer", - parse: toNumberOrNull, - }, - decimalPlaces: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: "must be a positive integer", - parse: toNumberOrNull, - }, - }; + const typeConstraints = [ + makerule$1( + async (val, opts) => + val === null || opts.maxLength === null || val.length <= opts.maxLength, + (val, opts) => `value exceeds maximum length of ${opts.maxLength}` + ), + makerule$1( + async (val, opts) => + val === null || + opts.allowDeclaredValuesOnly === false || + fp_19(val)(opts.values), + val => `"${val}" does not exist in the list of allowed values` + ), + ]; - const getDecimalPlaces = val => { - const splitDecimal = val.toString().split("."); - if (splitDecimal.length === 1) return 0 - return splitDecimal[1].length - }; + var string = getDefaultExport( + "string", + stringTryParse, + stringFunctions, + options, + typeConstraints, + "abcde", + str => str + ); - const typeConstraints$2 = [ - makerule$1( - async (val, opts) => - val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => - `value (${val.toString()}) must be greater than or equal to ${ + const boolFunctions = typeFunctions({ + default: fp_21(null), + }); + + const boolTryParse = switchCase( + [fp_28, parsedSuccess], + [fp_29, parsedSuccess], + [isOneOf("true", "1", "yes", "on"), () => parsedSuccess(true)], + [isOneOf("false", "0", "no", "off"), () => parsedSuccess(false)], + [defaultCase, parsedFailed] + ); + + const options$1 = { + allowNulls: { + defaultValue: true, + isValid: fp_28, + requirementDescription: "must be a true or false", + parse: toBoolOrNull, + }, + }; + + const typeConstraints$1 = [ + makerule$1( + async (val, opts) => opts.allowNulls === true || val !== null, + () => "field cannot be null" + ), + ]; + + var bool = getDefaultExport( + "bool", + boolTryParse, + boolFunctions, + options$1, + typeConstraints$1, + true, + JSON.stringify + ); + + const numberFunctions = typeFunctions({ + default: fp_21(null), + }); + + const parseStringtoNumberOrNull = s => { + const num = Number(s); + return isNaN(num) ? parsedFailed(s) : parsedSuccess(num) + }; + + const numberTryParse = switchCase( + [fp_30, parsedSuccess], + [fp_27, parseStringtoNumberOrNull], + [fp_29, parsedSuccess], + [defaultCase, parsedFailed] + ); + + const options$2 = { + maxValue: { + defaultValue: Number.MAX_SAFE_INTEGER, + isValid: isSafeInteger, + requirementDescription: "must be a valid integer", + parse: toNumberOrNull, + }, + minValue: { + defaultValue: 0 - Number.MAX_SAFE_INTEGER, + isValid: isSafeInteger, + requirementDescription: "must be a valid integer", + parse: toNumberOrNull, + }, + decimalPlaces: { + defaultValue: 0, + isValid: n => isSafeInteger(n) && n >= 0, + requirementDescription: "must be a positive integer", + parse: toNumberOrNull, + }, + }; + + const getDecimalPlaces = val => { + const splitDecimal = val.toString().split("."); + if (splitDecimal.length === 1) return 0 + return splitDecimal[1].length + }; + + const typeConstraints$2 = [ + makerule$1( + async (val, opts) => + val === null || opts.minValue === null || val >= opts.minValue, + (val, opts) => + `value (${val.toString()}) must be greater than or equal to ${ opts.minValue - }` - ), - makerule$1( - async (val, opts) => - val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => - `value (${val.toString()}) must be less than or equal to ${ + }` + ), + makerule$1( + async (val, opts) => + val === null || opts.maxValue === null || val <= opts.maxValue, + (val, opts) => + `value (${val.toString()}) must be less than or equal to ${ opts.minValue - } options` - ), - makerule$1( - async (val, opts) => - val === null || opts.decimalPlaces >= getDecimalPlaces(val), - (val, opts) => - `value (${val.toString()}) must have ${ + } options` + ), + makerule$1( + async (val, opts) => + val === null || opts.decimalPlaces >= getDecimalPlaces(val), + (val, opts) => + `value (${val.toString()}) must have ${ opts.decimalPlaces - } decimal places or less` - ), - ]; + } decimal places or less` + ), + ]; - var number = getDefaultExport( - "number", - numberTryParse, - numberFunctions, - options$2, - typeConstraints$2, - 1, - num => num.toString() - ); + var number = getDefaultExport( + "number", + numberTryParse, + numberFunctions, + options$2, + typeConstraints$2, + 1, + num => num.toString() + ); - const dateFunctions = typeFunctions({ - default: fp_21(null), - now: () => new Date(), - }); + const dateFunctions = typeFunctions({ + default: fp_21(null), + now: () => new Date(), + }); - const isValidDate = d => d instanceof Date && !isNaN(d); + const isValidDate = d => d instanceof Date && !isNaN(d); - const parseStringToDate = s => - switchCase( - [isValidDate, parsedSuccess], - [defaultCase, parsedFailed] - )(new Date(s)); - - const dateTryParse = switchCase( - [fp_32, parsedSuccess], - [fp_27, parseStringToDate], - [fp_29, parsedSuccess], + const parseStringToDate = s => + switchCase( + [isValidDate, parsedSuccess], [defaultCase, parsedFailed] - ); + )(new Date(s)); - const options$3 = { - maxValue: { - defaultValue: new Date(32503680000000), - isValid: fp_32, - requirementDescription: "must be a valid date", - parse: toDateOrNull, - }, - minValue: { - defaultValue: new Date(-8520336000000), - isValid: fp_32, - requirementDescription: "must be a valid date", - parse: toDateOrNull, - }, - }; + const dateTryParse = switchCase( + [fp_32, parsedSuccess], + [fp_27, parseStringToDate], + [fp_29, parsedSuccess], + [defaultCase, parsedFailed] + ); - const typeConstraints$3 = [ - makerule$1( - async (val, opts) => - val === null || opts.minValue === null || val >= opts.minValue, - (val, opts) => - `value (${val.toString()}) must be greater than or equal to ${ + const options$3 = { + maxValue: { + defaultValue: new Date(32503680000000), + isValid: fp_32, + requirementDescription: "must be a valid date", + parse: toDateOrNull, + }, + minValue: { + defaultValue: new Date(-8520336000000), + isValid: fp_32, + requirementDescription: "must be a valid date", + parse: toDateOrNull, + }, + }; + + const typeConstraints$3 = [ + makerule$1( + async (val, opts) => + val === null || opts.minValue === null || val >= opts.minValue, + (val, opts) => + `value (${val.toString()}) must be greater than or equal to ${ opts.minValue - }` - ), - makerule$1( - async (val, opts) => - val === null || opts.maxValue === null || val <= opts.maxValue, - (val, opts) => - `value (${val.toString()}) must be less than or equal to ${ + }` + ), + makerule$1( + async (val, opts) => + val === null || opts.maxValue === null || val <= opts.maxValue, + (val, opts) => + `value (${val.toString()}) must be less than or equal to ${ opts.minValue - } options` - ), - ]; + } options` + ), + ]; - var datetime = getDefaultExport( - "datetime", - dateTryParse, - dateFunctions, - options$3, - typeConstraints$3, - new Date(1984, 4, 1), - date => JSON.stringify(date).replace(new RegExp('"', "g"), "") - ); + var datetime = getDefaultExport( + "datetime", + dateTryParse, + dateFunctions, + options$3, + typeConstraints$3, + new Date(1984, 4, 1), + date => JSON.stringify(date).replace(new RegExp('"', "g"), "") + ); - const arrayFunctions = () => - typeFunctions({ - default: fp_21([]), - }); - - const mapToParsedArrary = type => - $$( - fp_12(i => type.safeParseValue(i)), - parsedSuccess - ); - - const arrayTryParse = type => - switchCase([fp_11, mapToParsedArrary(type)], [defaultCase, parsedFailed]); - - const typeName = type => `array<${type}>`; - - const options$4 = { - maxLength: { - defaultValue: 10000, - isValid: isSafeInteger, - requirementDescription: "must be a positive integer", - parse: toNumberOrNull, - }, - minLength: { - defaultValue: 0, - isValid: n => isSafeInteger(n) && n >= 0, - requirementDescription: "must be a positive integer", - parse: toNumberOrNull, - }, - }; - - const typeConstraints$4 = [ - makerule$1( - async (val, opts) => val === null || val.length >= opts.minLength, - (val, opts) => `must choose ${opts.minLength} or more options` - ), - makerule$1( - async (val, opts) => val === null || val.length <= opts.maxLength, - (val, opts) => `cannot choose more than ${opts.maxLength} options` - ), - ]; - - var array = type => - getDefaultExport( - typeName(type.name), - arrayTryParse(type), - arrayFunctions(), - options$4, - typeConstraints$4, - [type.sampleValue], - JSON.stringify - ); - - const referenceNothing = () => ({ key: "" }); - - const referenceFunctions = typeFunctions({ - default: referenceNothing, + const arrayFunctions = () => + typeFunctions({ + default: fp_21([]), }); - const hasStringValue = (ob, path) => fp_25(path)(ob) && fp_27(ob[path]); + const mapToParsedArrary = type => + $$( + fp_12(i => type.safeParseValue(i)), + parsedSuccess + ); - const isObjectWithKey = v => fp_31(v) && hasStringValue(v, "key"); + const arrayTryParse = type => + switchCase([fp_11, mapToParsedArrary(type)], [defaultCase, parsedFailed]); - const tryParseFromString = s => { - try { - const asObj = JSON.parse(s); - if (isObjectWithKey) { - return parsedSuccess(asObj) - } - } catch (_) { - // EMPTY + const typeName = type => `array<${type}>`; + + const options$4 = { + maxLength: { + defaultValue: 10000, + isValid: isSafeInteger, + requirementDescription: "must be a positive integer", + parse: toNumberOrNull, + }, + minLength: { + defaultValue: 0, + isValid: n => isSafeInteger(n) && n >= 0, + requirementDescription: "must be a positive integer", + parse: toNumberOrNull, + }, + }; + + const typeConstraints$4 = [ + makerule$1( + async (val, opts) => val === null || val.length >= opts.minLength, + (val, opts) => `must choose ${opts.minLength} or more options` + ), + makerule$1( + async (val, opts) => val === null || val.length <= opts.maxLength, + (val, opts) => `cannot choose more than ${opts.maxLength} options` + ), + ]; + + var array = type => + getDefaultExport( + typeName(type.name), + arrayTryParse(type), + arrayFunctions(), + options$4, + typeConstraints$4, + [type.sampleValue], + JSON.stringify + ); + + const referenceNothing = () => ({ key: "" }); + + const referenceFunctions = typeFunctions({ + default: referenceNothing, + }); + + const hasStringValue = (ob, path) => fp_25(path)(ob) && fp_27(ob[path]); + + const isObjectWithKey = v => fp_31(v) && hasStringValue(v, "key"); + + const tryParseFromString = s => { + try { + const asObj = JSON.parse(s); + if (isObjectWithKey) { + return parsedSuccess(asObj) } + } catch (_) { + // EMPTY + } - return parsedFailed(s) - }; + return parsedFailed(s) + }; - const referenceTryParse = v => - switchCase( - [isObjectWithKey, parsedSuccess], - [fp_27, tryParseFromString], - [fp_29, () => parsedSuccess(referenceNothing())], - [defaultCase, parsedFailed] - )(v); + const referenceTryParse = v => + switchCase( + [isObjectWithKey, parsedSuccess], + [fp_27, tryParseFromString], + [fp_29, () => parsedSuccess(referenceNothing())], + [defaultCase, parsedFailed] + )(v); - const options$5 = { - indexNodeKey: { - defaultValue: null, - isValid: isNonEmptyString, - requirementDescription: "must be a non-empty string", - parse: s => s, - }, - displayValue: { - defaultValue: "", - isValid: isNonEmptyString, - requirementDescription: "must be a non-empty string", - parse: s => s, - }, - reverseIndexNodeKeys: { - defaultValue: null, - isValid: v => isArrayOfString(v) && v.length > 0, - requirementDescription: "must be a non-empty array of strings", - parse: s => s, - }, - }; + const options$5 = { + indexNodeKey: { + defaultValue: null, + isValid: isNonEmptyString, + requirementDescription: "must be a non-empty string", + parse: s => s, + }, + displayValue: { + defaultValue: "", + isValid: isNonEmptyString, + requirementDescription: "must be a non-empty string", + parse: s => s, + }, + reverseIndexNodeKeys: { + defaultValue: null, + isValid: v => isArrayOfString(v) && v.length > 0, + requirementDescription: "must be a non-empty array of strings", + parse: s => s, + }, + }; - const isEmptyString = s => fp_27(s) && fp_16(s); + const isEmptyString = s => fp_27(s) && fp_16(s); - const ensureReferenceExists = async (val, opts, context) => - isEmptyString(val.key) || (await context.referenceExists(opts, val.key)); + const ensureReferenceExists = async (val, opts, context) => + isEmptyString(val.key) || (await context.referenceExists(opts, val.key)); - const typeConstraints$5 = [ - makerule$1( - ensureReferenceExists, - (val, opts) => - `"${val[opts.displayValue]}" does not exist in options list (key: ${ + const typeConstraints$5 = [ + makerule$1( + ensureReferenceExists, + (val, opts) => + `"${val[opts.displayValue]}" does not exist in options list (key: ${ val.key - })` - ), - ]; + })` + ), + ]; - var reference = getDefaultExport( - "reference", - referenceTryParse, - referenceFunctions, - options$5, - typeConstraints$5, - { key: "key", value: "value" }, - JSON.stringify + var reference = getDefaultExport( + "reference", + referenceTryParse, + referenceFunctions, + options$5, + typeConstraints$5, + { key: "key", value: "value" }, + JSON.stringify + ); + + const illegalCharacters = "*?\\/:<>|\0\b\f\v"; + + const isLegalFilename = filePath => { + const fn = fileName(filePath); + return ( + fn.length <= 255 && + fp_23(fn.split(""))(illegalCharacters.split("")).length === 0 && + none(f => f === "..")(splitKey(filePath)) + ) + }; + + const fileNothing = () => ({ relativePath: "", size: 0 }); + + const fileFunctions = typeFunctions({ + default: fileNothing, + }); + + const fileTryParse = v => + switchCase( + [isValidFile, parsedSuccess], + [fp_29, () => parsedSuccess(fileNothing())], + [defaultCase, parsedFailed] + )(v); + + const fileName = filePath => $(filePath, [splitKey, fp_5]); + + const isValidFile = f => + !fp_29(f) && + fp_25("relativePath")(f) && + fp_25("size")(f) && + fp_30(f.size) && + fp_27(f.relativePath) && + isLegalFilename(f.relativePath); + + const options$6 = {}; + + const typeConstraints$6 = []; + + var file = getDefaultExport( + "file", + fileTryParse, + fileFunctions, + options$6, + typeConstraints$6, + { relativePath: "some_file.jpg", size: 1000 }, + JSON.stringify + ); + + const allTypes = () => { + const basicTypes = { + string, + number, + datetime, + bool, + reference, + file, + }; + + const arrays = $(basicTypes, [ + fp_14, + fp_12(k => { + const kvType = {}; + const concreteArray = array(basicTypes[k]); + kvType[concreteArray.name] = concreteArray; + return kvType + }), + types => lodash_14({}, ...types), + ]); + + return lodash_13({}, basicTypes, arrays) + }; + + const all$1 = allTypes(); + + const getType = typeName => { + if (!fp_25(typeName)(all$1)) + throw new BadRequestError(`Do not recognise type ${typeName}`) + return all$1[typeName] + }; + + const getNewFieldValue = field => getType(field.type).getNew(field); + + const AUTH_FOLDER = "/.auth"; + const USERS_LIST_FILE = joinKey(AUTH_FOLDER, "users.json"); + const USERS_LOCK_FILE = joinKey(AUTH_FOLDER, "users_lock"); + const ACCESS_LEVELS_FILE = joinKey(AUTH_FOLDER, "access_levels.json"); + const ACCESS_LEVELS_LOCK_FILE = joinKey( + AUTH_FOLDER, + "access_levels_lock" + ); + + const permissionTypes = { + CREATE_RECORD: "create record", + UPDATE_RECORD: "update record", + READ_RECORD: "read record", + DELETE_RECORD: "delete record", + READ_INDEX: "read index", + MANAGE_INDEX: "manage index", + MANAGE_COLLECTION: "manage collection", + WRITE_TEMPLATES: "write templates", + CREATE_USER: "create user", + SET_PASSWORD: "set password", + CREATE_TEMPORARY_ACCESS: "create temporary access", + ENABLE_DISABLE_USER: "enable or disable user", + WRITE_ACCESS_LEVELS: "write access levels", + LIST_USERS: "list users", + LIST_ACCESS_LEVELS: "list access levels", + EXECUTE_ACTION: "execute action", + SET_USER_ACCESS_LEVELS: "set user access levels", + }; + + const isAuthorized = app => (permissionType, resourceKey) => + apiWrapperSync( + app, + events.authApi.isAuthorized, + alwaysAuthorized, + { resourceKey, permissionType }, + _isAuthorized, + app, + permissionType, + resourceKey ); - const illegalCharacters = "*?\\/:<>|\0\b\f\v"; + const _isAuthorized = (app, permissionType, resourceKey) => { + if (!app.user) { + return false + } - const isLegalFilename = filePath => { - const fn = fileName(filePath); - return ( - fn.length <= 255 && - fp_23(fn.split(""))(illegalCharacters.split("")).length === 0 && - none(f => f === "..")(splitKey(filePath)) - ) - }; + const validType = $(permissionTypes, [fp_34, fp_19(permissionType)]); - const fileNothing = () => ({ relativePath: "", size: 0 }); + if (!validType) { + return false + } - const fileFunctions = typeFunctions({ - default: fileNothing, - }); - - const fileTryParse = v => - switchCase( - [isValidFile, parsedSuccess], - [fp_29, () => parsedSuccess(fileNothing())], - [defaultCase, parsedFailed] - )(v); - - const fileName = filePath => $(filePath, [splitKey, fp_5]); - - const isValidFile = f => - !fp_29(f) && - fp_25("relativePath")(f) && - fp_25("size")(f) && - fp_30(f.size) && - fp_27(f.relativePath) && - isLegalFilename(f.relativePath); - - const options$6 = {}; - - const typeConstraints$6 = []; - - var file = getDefaultExport( - "file", - fileTryParse, - fileFunctions, - options$6, - typeConstraints$6, - { relativePath: "some_file.jpg", size: 1000 }, - JSON.stringify - ); - - const allTypes = () => { - const basicTypes = { - string, - number, - datetime, - bool, - reference, - file, - }; - - const arrays = $(basicTypes, [ - fp_14, - fp_12(k => { - const kvType = {}; - const concreteArray = array(basicTypes[k]); - kvType[concreteArray.name] = concreteArray; - return kvType - }), - types => lodash_14({}, ...types), - ]); - - return lodash_13({}, basicTypes, arrays) - }; - - const all$1 = allTypes(); - - const getType = typeName => { - if (!fp_25(typeName)(all$1)) - throw new BadRequestError(`Do not recognise type ${typeName}`) - return all$1[typeName] - }; - - const getNewFieldValue = field => getType(field.type).getNew(field); - - const AUTH_FOLDER = "/.auth"; - const USERS_LIST_FILE = joinKey(AUTH_FOLDER, "users.json"); - const USERS_LOCK_FILE = joinKey(AUTH_FOLDER, "users_lock"); - const ACCESS_LEVELS_FILE = joinKey(AUTH_FOLDER, "access_levels.json"); - const ACCESS_LEVELS_LOCK_FILE = joinKey( - AUTH_FOLDER, - "access_levels_lock" - ); - - const permissionTypes = { - CREATE_RECORD: "create record", - UPDATE_RECORD: "update record", - READ_RECORD: "read record", - DELETE_RECORD: "delete record", - READ_INDEX: "read index", - MANAGE_INDEX: "manage index", - MANAGE_COLLECTION: "manage collection", - WRITE_TEMPLATES: "write templates", - CREATE_USER: "create user", - SET_PASSWORD: "set password", - CREATE_TEMPORARY_ACCESS: "create temporary access", - ENABLE_DISABLE_USER: "enable or disable user", - WRITE_ACCESS_LEVELS: "write access levels", - LIST_USERS: "list users", - LIST_ACCESS_LEVELS: "list access levels", - EXECUTE_ACTION: "execute action", - SET_USER_ACCESS_LEVELS: "set user access levels", - }; - - const isAuthorized = app => (permissionType, resourceKey) => - apiWrapperSync( - app, - events.authApi.isAuthorized, - alwaysAuthorized, - { resourceKey, permissionType }, - _isAuthorized, - app, - permissionType, - resourceKey - ); - - const _isAuthorized = (app, permissionType, resourceKey) => { - if (!app.user) { - return false - } - - const validType = $(permissionTypes, [fp_34, fp_19(permissionType)]); - - if (!validType) { - return false - } - - const permMatchesResource = userperm => { - const nodeKey = isNothing(resourceKey) - ? null - : isNode(app.hierarchy, resourceKey) + const permMatchesResource = userperm => { + const nodeKey = isNothing(resourceKey) + ? null + : isNode(app.hierarchy, resourceKey) ? getNodeByKeyOrNodeKey(app.hierarchy, resourceKey).nodeKey() : resourceKey; - return ( - userperm.type === permissionType && - (isNothing(resourceKey) || nodeKey === userperm.nodeKey) - ) - }; - - return $(app.user.permissions, [fp_10(permMatchesResource)]) - }; - - const nodePermission = type => ({ - add: (nodeKey, accessLevel) => - accessLevel.permissions.push({ type, nodeKey }), - isAuthorized: resourceKey => app => isAuthorized(app)(type, resourceKey), - isNode: true, - get: nodeKey => ({ type, nodeKey }), - }); - - const staticPermission = type => ({ - add: accessLevel => accessLevel.permissions.push({ type }), - isAuthorized: app => isAuthorized(app)(type), - isNode: false, - get: () => ({ type }), - }); - - const createRecord = nodePermission(permissionTypes.CREATE_RECORD); - - const updateRecord = nodePermission(permissionTypes.UPDATE_RECORD); - - const deleteRecord = nodePermission(permissionTypes.DELETE_RECORD); - - const readRecord = nodePermission(permissionTypes.READ_RECORD); - - const writeTemplates = staticPermission(permissionTypes.WRITE_TEMPLATES); - - const createUser = staticPermission(permissionTypes.CREATE_USER); - - const setPassword = staticPermission(permissionTypes.SET_PASSWORD); - - const readIndex = nodePermission(permissionTypes.READ_INDEX); - - const manageIndex = staticPermission(permissionTypes.MANAGE_INDEX); - - const manageCollection = staticPermission(permissionTypes.MANAGE_COLLECTION); - - const createTemporaryAccess = staticPermission( - permissionTypes.CREATE_TEMPORARY_ACCESS - ); - - const enableDisableUser = staticPermission(permissionTypes.ENABLE_DISABLE_USER); - - const writeAccessLevels = staticPermission(permissionTypes.WRITE_ACCESS_LEVELS); - - const listUsers = staticPermission(permissionTypes.LIST_USERS); - - const listAccessLevels = staticPermission(permissionTypes.LIST_ACCESS_LEVELS); - - const setUserAccessLevels = staticPermission( - permissionTypes.SET_USER_ACCESS_LEVELS - ); - - const executeAction = nodePermission(permissionTypes.EXECUTE_ACTION); - - const alwaysAuthorized = () => true; - - const permission = { - createRecord, - updateRecord, - deleteRecord, - readRecord, - writeTemplates, - createUser, - setPassword, - readIndex, - createTemporaryAccess, - enableDisableUser, - writeAccessLevels, - listUsers, - listAccessLevels, - manageIndex, - manageCollection, - executeAction, - setUserAccessLevels, - }; - - const getNew = app => (collectionKey, recordTypeName) => { - const recordNode = getRecordNode(app, collectionKey); - collectionKey = safeKey(collectionKey); - return apiWrapperSync( - app, - events.recordApi.getNew, - permission.createRecord.isAuthorized(recordNode.nodeKey()), - { collectionKey, recordTypeName }, - _getNew, - recordNode, - collectionKey + return ( + userperm.type === permissionType && + (isNothing(resourceKey) || nodeKey === userperm.nodeKey) ) }; - const _getNew = (recordNode, collectionKey) => - constructRecord(recordNode, getNewFieldValue, collectionKey); + return $(app.user.permissions, [fp_10(permMatchesResource)]) + }; - const getRecordNode = (app, collectionKey) => { - collectionKey = safeKey(collectionKey); - return getNodeForCollectionPath(app.hierarchy)(collectionKey) - }; + const nodePermission = type => ({ + add: (nodeKey, accessLevel) => + accessLevel.permissions.push({ type, nodeKey }), + isAuthorized: resourceKey => app => isAuthorized(app)(type, resourceKey), + isNode: true, + get: nodeKey => ({ type, nodeKey }), + }); - const getNewChild = app => (recordKey, collectionName, recordTypeName) => - getNew(app)(joinKey(recordKey, collectionName), recordTypeName); + const staticPermission = type => ({ + add: accessLevel => accessLevel.permissions.push({ type }), + isAuthorized: app => isAuthorized(app)(type), + isNode: false, + get: () => ({ type }), + }); - const constructRecord = (recordNode, getFieldValue, collectionKey) => { - const record = $(recordNode.fields, [fp_35("name"), fp_26(getFieldValue)]); + const createRecord = nodePermission(permissionTypes.CREATE_RECORD); - record.id = `${recordNode.nodeId}-${shortid_1()}`; - record.key = isSingleRecord(recordNode) - ? joinKey(collectionKey, recordNode.name) - : joinKey(collectionKey, record.id); - record.isNew = true; - record.type = recordNode.name; - return record - }; + const updateRecord = nodePermission(permissionTypes.UPDATE_RECORD); - const pathRegxMaker = node => () => - node.nodeKey().replace(/{id}/g, "[a-zA-Z0-9_-]+"); + const deleteRecord = nodePermission(permissionTypes.DELETE_RECORD); - const nodeKeyMaker = node => () => - switchCase( - [ - n => isRecord(n) && !isSingleRecord(n), - n => - joinKey( - node.parent().nodeKey(), - node.collectionName, - `${n.nodeId}-{id}` - ), - ], + const readRecord = nodePermission(permissionTypes.READ_RECORD); - [isRoot, fp_21("/")], + const writeTemplates = staticPermission(permissionTypes.WRITE_TEMPLATES); - [defaultCase, n => joinKey(node.parent().nodeKey(), n.name)] - )(node); + const createUser = staticPermission(permissionTypes.CREATE_USER); - const construct = parent => node => { - node.nodeKey = nodeKeyMaker(node); - node.pathRegx = pathRegxMaker(node); - node.parent = fp_21(parent); - node.isRoot = () => - isNothing(parent) && node.name === "root" && node.type === "root"; - if (isCollectionRecord(node)) { - node.collectionNodeKey = () => - joinKey(parent.nodeKey(), node.collectionName); - node.collectionPathRegx = () => - joinKey(parent.pathRegx(), node.collectionName); - } - return node - }; + const setPassword = staticPermission(permissionTypes.SET_PASSWORD); - const constructHierarchy = (node, parent) => { - construct(parent)(node); - if (node.indexes) { - lodash_4(node.indexes, child => constructHierarchy(child, node)); - } - if (node.aggregateGroups) { - lodash_4(node.aggregateGroups, child => constructHierarchy(child, node)); - } - if (node.children && node.children.length > 0) { - lodash_4(node.children, child => constructHierarchy(child, node)); - } - if (node.fields) { - lodash_4(node.fields, f => - lodash_4(f.typeOptions, (val, key) => { - const def = all$1[f.type].optionDefinitions[key]; - if (!def) { - // unknown typeOption - delete f.typeOptions[key]; - } else { - f.typeOptions[key] = def.parse(val); - } - }) - ); - } - return node - }; + const readIndex = nodePermission(permissionTypes.READ_INDEX); - const createCoreApi = (backendDefinition, user) => { - const app = createCoreApp(backendDefinition, user); + const manageIndex = staticPermission(permissionTypes.MANAGE_INDEX); - return { - recordApi: { - getNew: getNew(app), - getNewChild: getNewChild(app), - }, + const manageCollection = staticPermission(permissionTypes.MANAGE_COLLECTION); - templateApi: { - constructHierarchy, - }, - } - }; + const createTemporaryAccess = staticPermission( + permissionTypes.CREATE_TEMPORARY_ACCESS + ); - const BB_STATE_BINDINGPATH = "##bbstate"; - const BB_STATE_BINDINGSOURCE = "##bbsource"; - const BB_STATE_FALLBACK = "##bbstatefallback"; + const enableDisableUser = staticPermission(permissionTypes.ENABLE_DISABLE_USER); - const isBound = prop => - prop !== undefined && prop[BB_STATE_BINDINGPATH] !== undefined; + const writeAccessLevels = staticPermission(permissionTypes.WRITE_ACCESS_LEVELS); - const takeStateFromStore = prop => - prop[BB_STATE_BINDINGSOURCE] === undefined || - prop[BB_STATE_BINDINGSOURCE] === "store"; + const listUsers = staticPermission(permissionTypes.LIST_USERS); - const takeStateFromContext = prop => - prop[BB_STATE_BINDINGSOURCE] === "context"; + const listAccessLevels = staticPermission(permissionTypes.LIST_ACCESS_LEVELS); - const takeStateFromEventParameters = prop => - prop[BB_STATE_BINDINGSOURCE] === "event"; + const setUserAccessLevels = staticPermission( + permissionTypes.SET_USER_ACCESS_LEVELS + ); - const getState = (s, path, fallback) => { - if (!s) return fallback - if (!path || path.length === 0) return fallback + const executeAction = nodePermission(permissionTypes.EXECUTE_ACTION); - if (path === "$") return s + const alwaysAuthorized = () => true; - const pathParts = path.split("."); - const safeGetPath = (obj, currentPartIndex = 0) => { - const currentKey = pathParts[currentPartIndex]; + const permission = { + createRecord, + updateRecord, + deleteRecord, + readRecord, + writeTemplates, + createUser, + setPassword, + readIndex, + createTemporaryAccess, + enableDisableUser, + writeAccessLevels, + listUsers, + listAccessLevels, + manageIndex, + manageCollection, + executeAction, + setUserAccessLevels, + }; - if (pathParts.length - 1 == currentPartIndex) { - const value = obj[currentKey]; - if (fp_2(value)) return fallback - else return value - } + const getNew = app => (collectionKey, recordTypeName) => { + const recordNode = getRecordNode(app, collectionKey); + collectionKey = safeKey(collectionKey); + return apiWrapperSync( + app, + events.recordApi.getNew, + permission.createRecord.isAuthorized(recordNode.nodeKey()), + { collectionKey, recordTypeName }, + _getNew, + recordNode, + collectionKey + ) + }; - if ( - obj[currentKey] === null || - obj[currentKey] === undefined || - !fp_8(obj[currentKey]) - ) { - return fallback - } + const _getNew = (recordNode, collectionKey) => + constructRecord(recordNode, getNewFieldValue, collectionKey); - return safeGetPath(obj[currentKey], currentPartIndex + 1) - }; + const getRecordNode = (app, collectionKey) => { + collectionKey = safeKey(collectionKey); + return getNodeForCollectionPath(app.hierarchy)(collectionKey) + }; - return safeGetPath(s) - }; + const getNewChild = app => (recordKey, collectionName, recordTypeName) => + getNew(app)(joinKey(recordKey, collectionName), recordTypeName); - const getStateOrValue = (globalState, prop, currentContext) => { - if (!prop) return prop + const constructRecord = (recordNode, getFieldValue, collectionKey) => { + const record = $(recordNode.fields, [fp_35("name"), fp_26(getFieldValue)]); - if (isBound(prop)) { - const stateToUse = takeStateFromStore(prop) ? globalState : currentContext; + record.id = `${recordNode.nodeId}-${shortid_1()}`; + record.key = isSingleRecord(recordNode) + ? joinKey(collectionKey, recordNode.name) + : joinKey(collectionKey, record.id); + record.isNew = true; + record.type = recordNode.name; + return record + }; - return getState( - stateToUse, - prop[BB_STATE_BINDINGPATH], - prop[BB_STATE_FALLBACK] - ) - } + const pathRegxMaker = node => () => + node.nodeKey().replace(/{id}/g, "[a-zA-Z0-9_-]+"); - if (prop.path && prop.source) { - const stateToUse = prop.source === "store" ? globalState : currentContext; + const nodeKeyMaker = node => () => + switchCase( + [ + n => isModel(n) && !isSingleRecord(n), + n => + joinKey( + node.parent().nodeKey(), + node.collectionName, + `${n.nodeId}-{id}` + ), + ], - return getState(stateToUse, prop.path, prop.fallback) - } + [isRoot, fp_21("/")], - return prop - }; + [defaultCase, n => joinKey(node.parent().nodeKey(), n.name)] + )(node); - const setState = (store, path, value) => { - if (!path || path.length === 0) return + const construct = parent => node => { + node.nodeKey = nodeKeyMaker(node); + node.pathRegx = pathRegxMaker(node); + node.parent = fp_21(parent); + node.isRoot = () => + isNothing(parent) && node.name === "root" && node.type === "root"; + if (isCollectionRecord(node)) { + node.collectionNodeKey = () => + joinKey(parent.nodeKey(), node.collectionName); + node.collectionPathRegx = () => + joinKey(parent.pathRegx(), node.collectionName); + } + return node + }; - const pathParts = path.split("."); - const safeSetPath = (obj, currentPartIndex = 0) => { - const currentKey = pathParts[currentPartIndex]; - - if (pathParts.length - 1 == currentPartIndex) { - obj[currentKey] = value; - return - } - - if ( - obj[currentKey] === null || - obj[currentKey] === undefined || - !fp_8(obj[currentKey]) - ) { - obj[currentKey] = {}; - } - - safeSetPath(obj[currentKey], currentPartIndex + 1); - }; - - store.update(s => { - safeSetPath(s); - return s - }); - }; - - const setStateFromBinding = (store, binding, value) => - setState(store, binding[BB_STATE_BINDINGPATH], value); - - const trimSlash = str => str.replace(/^\/+|\/+$/g, ""); - - const ERROR = "##error_message"; - - const loadRecord = api => async ({ recordKey, statePath }) => { - if (!recordKey) { - api.error("Load Record: record key not set"); - return - } - - if (!statePath) { - api.error("Load Record: state path not set"); - return - } - - const record = await api.get({ - url: `/api/record/${trimSlash(recordKey)}`, - }); - - if (api.isSuccess(record)) api.setState(statePath, record); - }; - - const listRecords = api => async ({ indexKey, statePath }) => { - if (!indexKey) { - api.error("Load Record: record key not set"); - return - } - - if (!statePath) { - api.error("Load Record: state path not set"); - return - } - - const records = await api.get({ - url: `/api/listRecords/${trimSlash(indexKey)}`, - }); - - if (api.isSuccess(records)) api.setState(statePath, records); - }; - - const USER_STATE_PATH = "_bbuser"; - - const authenticate = api => async ({ username, password }) => { - if (!username) { - api.error("Authenticate: username not set"); - return - } - - if (!password) { - api.error("Authenticate: password not set"); - return - } - - const user = await api.post({ - url: "/api/authenticate", - body: { username, password }, - }); - - // set user even if error - so it is defined at least - api.setState(USER_STATE_PATH, user); - localStorage.setItem("budibase:user", JSON.stringify(user)); - }; - - const saveRecord = api => async ({ statePath }) => { - if (!statePath) { - api.error("Load Record: state path not set"); - return - } - - const recordtoSave = api.getState(statePath); - - if (!recordtoSave) { - api.error(`there is no record in state: ${statePath}`); - return - } - - if (!recordtoSave.key) { - api.error( - `item in state does not appear to be a record - it has no key (${statePath})` - ); - return - } - - const savedRecord = await api.post({ - url: `/api/record/${trimSlash(recordtoSave.key)}`, - body: recordtoSave, - }); - - if (api.isSuccess(savedRecord)) api.setState(statePath, savedRecord); - }; - - const createApi = ({ rootPath, setState, getState }) => { - const apiCall = method => ({ - url, - body, - notFound, - badRequest, - forbidden, - }) => { - return fetch(`${rootPath}${url}`, { - method: method, - headers: { - "Content-Type": "application/json", - }, - body: body && JSON.stringify(body), - credentials: "same-origin", - }).then(r => { - switch (r.status) { - case 200: - return r.json() - case 404: - return error(notFound || `${url} Not found`) - case 400: - return error(badRequest || `${url} Bad Request`) - case 403: - return error(forbidden || `${url} Forbidden`) - default: - if ( - r.status.toString().startsWith("2") || - r.status.toString().startsWith("3") - ) - return r.json() - else return error(`${url} - ${r.statusText}`) + const constructHierarchy = (node, parent) => { + construct(parent)(node); + if (node.indexes) { + lodash_4(node.indexes, child => constructHierarchy(child, node)); + } + if (node.aggregateGroups) { + lodash_4(node.aggregateGroups, child => constructHierarchy(child, node)); + } + if (node.children && node.children.length > 0) { + lodash_4(node.children, child => constructHierarchy(child, node)); + } + if (node.fields) { + lodash_4(node.fields, f => + lodash_4(f.typeOptions, (val, key) => { + const def = all$1[f.type].optionDefinitions[key]; + if (!def) { + // unknown typeOption + delete f.typeOptions[key]; + } else { + f.typeOptions[key] = def.parse(val); } }) - }; + ); + } + return node + }; - const post = apiCall("POST"); - const get = apiCall("GET"); - const patch = apiCall("PATCH"); - const del = apiCall("DELETE"); + const createCoreApi = (backendDefinition, user) => { + const app = createCoreApp(backendDefinition, user); - const ERROR_MEMBER = "##error"; - const error = message => { - const e = {}; - e[ERROR_MEMBER] = message; - setState(ERROR, message); - return e - }; + return { + recordApi: { + getNew: getNew(app), + getNewChild: getNewChild(app), + }, - const isSuccess = obj => !obj || !obj[ERROR_MEMBER]; + templateApi: { + constructHierarchy, + }, + } + }; - const apiOpts = { - rootPath, - setState, - getState, - isSuccess, - error, - post, - get, - patch, - delete: del, - }; + const BB_STATE_BINDINGPATH = "##bbstate"; + const BB_STATE_BINDINGSOURCE = "##bbsource"; + const BB_STATE_FALLBACK = "##bbstatefallback"; - return { - loadRecord: loadRecord(apiOpts), - listRecords: listRecords(apiOpts), - authenticate: authenticate(apiOpts), - saveRecord: saveRecord(apiOpts), + const isBound = prop => + prop !== undefined && prop[BB_STATE_BINDINGPATH] !== undefined; + + const takeStateFromStore = prop => + prop[BB_STATE_BINDINGSOURCE] === undefined || + prop[BB_STATE_BINDINGSOURCE] === "store"; + + const takeStateFromContext = prop => + prop[BB_STATE_BINDINGSOURCE] === "context"; + + const takeStateFromEventParameters = prop => + prop[BB_STATE_BINDINGSOURCE] === "event"; + + const getState = (s, path, fallback) => { + if (!s) return fallback + if (!path || path.length === 0) return fallback + + if (path === "$") return s + + const pathParts = path.split("."); + const safeGetPath = (obj, currentPartIndex = 0) => { + const currentKey = pathParts[currentPartIndex]; + + if (pathParts.length - 1 == currentPartIndex) { + const value = obj[currentKey]; + if (fp_2(value)) return fallback + else return value } + + if ( + obj[currentKey] === null || + obj[currentKey] === undefined || + !fp_8(obj[currentKey]) + ) { + return fallback + } + + return safeGetPath(obj[currentKey], currentPartIndex + 1) }; - const getNewChildRecordToState = (coreApi, setState) => ({ - recordKey, - collectionName, - childRecordType, - statePath, + return safeGetPath(s) + }; + + const getStateOrValue = (globalState, prop, currentContext) => { + if (!prop) return prop + + if (isBound(prop)) { + const stateToUse = takeStateFromStore(prop) ? globalState : currentContext; + + return getState( + stateToUse, + prop[BB_STATE_BINDINGPATH], + prop[BB_STATE_FALLBACK] + ) + } + + if (prop.path && prop.source) { + const stateToUse = prop.source === "store" ? globalState : currentContext; + + return getState(stateToUse, prop.path, prop.fallback) + } + + return prop + }; + + const setState = (store, path, value) => { + if (!path || path.length === 0) return + + const pathParts = path.split("."); + const safeSetPath = (obj, currentPartIndex = 0) => { + const currentKey = pathParts[currentPartIndex]; + + if (pathParts.length - 1 == currentPartIndex) { + obj[currentKey] = value; + return + } + + if ( + obj[currentKey] === null || + obj[currentKey] === undefined || + !fp_8(obj[currentKey]) + ) { + obj[currentKey] = {}; + } + + safeSetPath(obj[currentKey], currentPartIndex + 1); + }; + + store.update(s => { + safeSetPath(s); + return s + }); + }; + + const setStateFromBinding = (store, binding, value) => + setState(store, binding[BB_STATE_BINDINGPATH], value); + + const trimSlash = str => str.replace(/^\/+|\/+$/g, ""); + + const ERROR = "##error_message"; + + const loadRecord = api => async ({ recordKey, statePath }) => { + if (!recordKey) { + api.error("Load Record: record key not set"); + return + } + + if (!statePath) { + api.error("Load Record: state path not set"); + return + } + + const record = await api.get({ + url: `/api/record/${trimSlash(recordKey)}`, + }); + + if (api.isSuccess(record)) api.setState(statePath, record); + }; + + const listRecords = api => async ({ indexKey, statePath }) => { + if (!indexKey) { + api.error("Load Record: record key not set"); + return + } + + if (!statePath) { + api.error("Load Record: state path not set"); + return + } + + const records = await api.get({ + url: `/api/listRecords/${trimSlash(indexKey)}`, + }); + + if (api.isSuccess(records)) api.setState(statePath, records); + }; + + const USER_STATE_PATH = "_bbuser"; + + const authenticate = api => async ({ username, password }) => { + if (!username) { + api.error("Authenticate: username not set"); + return + } + + if (!password) { + api.error("Authenticate: password not set"); + return + } + + const user = await api.post({ + url: "/api/authenticate", + body: { username, password }, + }); + + // set user even if error - so it is defined at least + api.setState(USER_STATE_PATH, user); + localStorage.setItem("budibase:user", JSON.stringify(user)); + }; + + const saveRecord = api => async ({ statePath }) => { + if (!statePath) { + api.error("Load Record: state path not set"); + return + } + + const recordtoSave = api.getState(statePath); + + if (!recordtoSave) { + api.error(`there is no record in state: ${statePath}`); + return + } + + if (!recordtoSave.key) { + api.error( + `item in state does not appear to be a record - it has no key (${statePath})` + ); + return + } + + const savedRecord = await api.post({ + url: `/api/record/${trimSlash(recordtoSave.key)}`, + body: recordtoSave, + }); + + if (api.isSuccess(savedRecord)) api.setState(statePath, savedRecord); + }; + + const createApi = ({ rootPath, setState, getState }) => { + const apiCall = method => ({ + url, + body, + notFound, + badRequest, + forbidden, }) => { - const error = errorHandler(setState); - try { - if (!recordKey) { - error("getNewChild > recordKey not set"); - return + return fetch(`${rootPath}${url}`, { + method: method, + headers: { + "Content-Type": "application/json", + }, + body: body && JSON.stringify(body), + credentials: "same-origin", + }).then(r => { + switch (r.status) { + case 200: + return r.json() + case 404: + return error(notFound || `${url} Not found`) + case 400: + return error(badRequest || `${url} Bad Request`) + case 403: + return error(forbidden || `${url} Forbidden`) + default: + if ( + r.status.toString().startsWith("2") || + r.status.toString().startsWith("3") + ) + return r.json() + else return error(`${url} - ${r.statusText}`) } - - if (!collectionName) { - error("getNewChild > collectionName not set"); - return - } - - if (!childRecordType) { - error("getNewChild > childRecordType not set"); - return - } - - if (!statePath) { - error("getNewChild > statePath not set"); - return - } - - const rec = coreApi.recordApi.getNewChild( - recordKey, - collectionName, - childRecordType - ); - setState(statePath, rec); - } catch (e) { - error(e.message); - } + }) }; - const getNewRecordToState = (coreApi, setState) => ({ - collectionKey, - childRecordType, - statePath, - }) => { - const error = errorHandler(setState); - try { - if (!collectionKey) { - error("getNewChild > collectionKey not set"); - return - } + const post = apiCall("POST"); + const get = apiCall("GET"); + const patch = apiCall("PATCH"); + const del = apiCall("DELETE"); - if (!childRecordType) { - error("getNewChild > childRecordType not set"); - return - } - - if (!statePath) { - error("getNewChild > statePath not set"); - return - } - - const rec = coreApi.recordApi.getNew(collectionKey, childRecordType); - setState(statePath, rec); - } catch (e) { - error(e.message); - } + const ERROR_MEMBER = "##error"; + const error = message => { + const e = {}; + e[ERROR_MEMBER] = message; + setState(ERROR, message); + return e }; - const errorHandler = setState => message => setState(ERROR, message); + const isSuccess = obj => !obj || !obj[ERROR_MEMBER]; - const EVENT_TYPE_MEMBER_NAME = "##eventHandlerType"; - - const eventHandlers = (store, coreApi, rootPath) => { - const handler = (parameters, execute) => ({ - execute, - parameters, - }); - - const setStateWithStore = (path, value) => setState(store, path, value); - - let currentState; - store.subscribe(s => { - currentState = s; - }); - - const api = createApi({ - rootPath: rootPath, - setState: setStateWithStore, - getState: (path, fallback) => getState(currentState, path, fallback), - }); - - const setStateHandler = ({ path, value }) => setState(store, path, value); - - return { - "Set State": handler(["path", "value"], setStateHandler), - "Load Record": handler(["recordKey", "statePath"], api.loadRecord), - "List Records": handler(["indexKey", "statePath"], api.listRecords), - "Save Record": handler(["statePath"], api.saveRecord), - - "Get New Child Record": handler( - ["recordKey", "collectionName", "childRecordType", "statePath"], - getNewChildRecordToState(coreApi, setStateWithStore) - ), - - "Get New Record": handler( - ["collectionKey", "childRecordType", "statePath"], - getNewRecordToState(coreApi, setStateWithStore) - ), - - Authenticate: handler(["username", "password"], api.authenticate), - } + const apiOpts = { + rootPath, + setState, + getState, + isSuccess, + error, + post, + get, + patch, + delete: del, }; - const isEventType = prop => - fp_11(prop) && - prop.length > 0 && - !fp_2(prop[0][EVENT_TYPE_MEMBER_NAME]); + return { + loadRecord: loadRecord(apiOpts), + listRecords: listRecords(apiOpts), + authenticate: authenticate(apiOpts), + saveRecord: saveRecord(apiOpts), + } + }; - const doNothing = () => {}; - doNothing.isPlaceholder = true; + const getNewChildRecordToState = (coreApi, setState) => ({ + recordKey, + collectionName, + childRecordType, + statePath, + }) => { + const error = errorHandler(setState); + try { + if (!recordKey) { + error("getNewChild > recordKey not set"); + return + } - const isMetaProp = propName => - propName === "_component" || - propName === "_children" || - propName === "_id" || - propName === "_style"; + if (!collectionName) { + error("getNewChild > collectionName not set"); + return + } - const setupBinding = (store, rootProps, coreApi, context, rootPath) => { - const rootInitialProps = { ...rootProps }; + if (!childRecordType) { + error("getNewChild > childRecordType not set"); + return + } - const getBindings = (props, initialProps) => { - const boundProps = []; - const contextBoundProps = []; - const componentEventHandlers = []; + if (!statePath) { + error("getNewChild > statePath not set"); + return + } - for (let propName in props) { - if (isMetaProp(propName)) continue + const rec = coreApi.recordApi.getNewChild( + recordKey, + collectionName, + childRecordType + ); + setState(statePath, rec); + } catch (e) { + error(e.message); + } + }; - const val = props[propName]; + const getNewRecordToState = (coreApi, setState) => ({ + collectionKey, + childRecordType, + statePath, + }) => { + const error = errorHandler(setState); + try { + if (!collectionKey) { + error("getNewChild > collectionKey not set"); + return + } - if (isBound(val) && takeStateFromStore(val)) { - const binding = BindingPath(val); - const source = BindingSource(val); - const fallback = BindingFallback(val); + if (!childRecordType) { + error("getNewChild > childRecordType not set"); + return + } - boundProps.push({ - path: binding, - fallback, - propName, - source, + if (!statePath) { + error("getNewChild > statePath not set"); + return + } + + const rec = coreApi.recordApi.getNew(collectionKey, childRecordType); + setState(statePath, rec); + } catch (e) { + error(e.message); + } + }; + + const errorHandler = setState => message => setState(ERROR, message); + + const EVENT_TYPE_MEMBER_NAME = "##eventHandlerType"; + + const eventHandlers = (store, coreApi, rootPath) => { + const handler = (parameters, execute) => ({ + execute, + parameters, + }); + + const setStateWithStore = (path, value) => setState(store, path, value); + + let currentState; + store.subscribe(s => { + currentState = s; + }); + + const api = createApi({ + rootPath: rootPath, + setState: setStateWithStore, + getState: (path, fallback) => getState(currentState, path, fallback), + }); + + const setStateHandler = ({ path, value }) => setState(store, path, value); + + return { + "Set State": handler(["path", "value"], setStateHandler), + "Load Record": handler(["recordKey", "statePath"], api.loadRecord), + "List Records": handler(["indexKey", "statePath"], api.listRecords), + "Save Record": handler(["statePath"], api.saveRecord), + + "Get New Child Record": handler( + ["recordKey", "collectionName", "childRecordType", "statePath"], + getNewChildRecordToState(coreApi, setStateWithStore) + ), + + "Get New Record": handler( + ["collectionKey", "childRecordType", "statePath"], + getNewRecordToState(coreApi, setStateWithStore) + ), + + Authenticate: handler(["username", "password"], api.authenticate), + } + }; + + const isEventType = prop => + fp_11(prop) && + prop.length > 0 && + !fp_2(prop[0][EVENT_TYPE_MEMBER_NAME]); + + const doNothing = () => { }; + doNothing.isPlaceholder = true; + + const isMetaProp = propName => + propName === "_component" || + propName === "_children" || + propName === "_id" || + propName === "_style"; + + const setupBinding = (store, rootProps, coreApi, context, rootPath) => { + const rootInitialProps = { ...rootProps }; + + const getBindings = (props, initialProps) => { + const boundProps = []; + const contextBoundProps = []; + const componentEventHandlers = []; + + for (let propName in props) { + if (isMetaProp(propName)) continue + + const val = props[propName]; + + if (isBound(val) && takeStateFromStore(val)) { + const binding = BindingPath(val); + const source = BindingSource(val); + const fallback = BindingFallback(val); + + boundProps.push({ + path: binding, + fallback, + propName, + source, + }); + + initialProps[propName] = fallback; + } else if (isBound(val) && takeStateFromContext(val)) { + const binding = BindingPath(val); + const fallback = BindingFallback(val); + const source = BindingSource(val); + + contextBoundProps.push({ + path: binding, + fallback, + propName, + source, + }); + + initialProps[propName] = !context + ? val + : getState(context, binding, fallback); + } else if (isEventType(val)) { + const handlers = { propName, handlers: [] }; + componentEventHandlers.push(handlers); + + for (let e of val) { + handlers.handlers.push({ + handlerType: e[EVENT_TYPE_MEMBER_NAME], + parameters: e.parameters, }); - - initialProps[propName] = fallback; - } else if (isBound(val) && takeStateFromContext(val)) { - const binding = BindingPath(val); - const fallback = BindingFallback(val); - const source = BindingSource(val); - - contextBoundProps.push({ - path: binding, - fallback, - propName, - source, - }); - - initialProps[propName] = !context - ? val - : getState(context, binding, fallback); - } else if (isEventType(val)) { - const handlers = { propName, handlers: [] }; - componentEventHandlers.push(handlers); - - for (let e of val) { - handlers.handlers.push({ - handlerType: e[EVENT_TYPE_MEMBER_NAME], - parameters: e.parameters, - }); - } - - initialProps[propName] = doNothing; } + + initialProps[propName] = doNothing; } + } - return { - contextBoundProps, - boundProps, - componentEventHandlers, - initialProps, - } - }; + return { + contextBoundProps, + boundProps, + componentEventHandlers, + initialProps, + } + }; - const bind = rootBindings => component => { - if ( - rootBindings.boundProps.length === 0 && - rootBindings.componentEventHandlers.length === 0 - ) - return + const bind = rootBindings => component => { + if ( + rootBindings.boundProps.length === 0 && + rootBindings.componentEventHandlers.length === 0 + ) + return - const handlerTypes = eventHandlers(store, coreApi, rootPath); + const handlerTypes = eventHandlers(store, coreApi, rootPath); - const unsubscribe = store.subscribe(rootState => { - const getPropsFromBindings = (s, bindings) => { - const { boundProps, componentEventHandlers } = bindings; - const newProps = { ...bindings.initialProps }; + const unsubscribe = store.subscribe(rootState => { + const getPropsFromBindings = (s, bindings) => { + const { boundProps, componentEventHandlers } = bindings; + const newProps = { ...bindings.initialProps }; - for (let boundProp of boundProps) { - const val = getState(s, boundProp.path, boundProp.fallback); + for (let boundProp of boundProps) { + const val = getState(s, boundProp.path, boundProp.fallback); - if (val === undefined && newProps[boundProp.propName] !== undefined) { - delete newProps[boundProp.propName]; - } - - if (val !== undefined) { - newProps[boundProp.propName] = val; - } + if (val === undefined && newProps[boundProp.propName] !== undefined) { + delete newProps[boundProp.propName]; } - for (let boundHandler of componentEventHandlers) { - const closuredHandlers = []; - for (let h of boundHandler.handlers) { - const handlerType = handlerTypes[h.handlerType]; - closuredHandlers.push(eventContext => { - const parameters = {}; - for (let pname in h.parameters) { - const p = h.parameters[pname]; - parameters[pname] = !isBound(p) - ? p - : takeStateFromStore(p) + if (val !== undefined) { + newProps[boundProp.propName] = val; + } + } + + for (let boundHandler of componentEventHandlers) { + const closuredHandlers = []; + for (let h of boundHandler.handlers) { + const handlerType = handlerTypes[h.handlerType]; + closuredHandlers.push(eventContext => { + const parameters = {}; + for (let pname in h.parameters) { + const p = h.parameters[pname]; + parameters[pname] = !isBound(p) + ? p + : takeStateFromStore(p) ? getState(s, p[BB_STATE_BINDINGPATH], p[BB_STATE_FALLBACK]) : takeStateFromEventParameters(p) - ? getState( + ? getState( eventContext, p[BB_STATE_BINDINGPATH], p[BB_STATE_FALLBACK] ) - : takeStateFromContext(p) - ? getState( - context, - p[BB_STATE_BINDINGPATH], - p[BB_STATE_FALLBACK] - ) - : p[BB_STATE_FALLBACK]; - } - handlerType.execute(parameters); - }); - } - - newProps[boundHandler.propName] = async context => { - for (let runHandler of closuredHandlers) { - await runHandler(context); + : takeStateFromContext(p) + ? getState( + context, + p[BB_STATE_BINDINGPATH], + p[BB_STATE_FALLBACK] + ) + : p[BB_STATE_FALLBACK]; } - }; + handlerType.execute(parameters); + }); } - return newProps - }; + newProps[boundHandler.propName] = async context => { + for (let runHandler of closuredHandlers) { + await runHandler(context); + } + }; + } - const rootNewProps = getPropsFromBindings(rootState, rootBindings); + return newProps + }; - component.$set(rootNewProps); - }); + const rootNewProps = getPropsFromBindings(rootState, rootBindings); - return unsubscribe - }; + component.$set(rootNewProps); + }); - const bindings = getBindings(rootProps, rootInitialProps); + return unsubscribe + }; - return { - initialProps: rootInitialProps, - bind: bind(bindings), - boundProps: bindings.boundProps, - contextBoundProps: bindings.contextBoundProps, + const bindings = getBindings(rootProps, rootInitialProps); + + return { + initialProps: rootInitialProps, + bind: bind(bindings), + boundProps: bindings.boundProps, + contextBoundProps: bindings.contextBoundProps, + } + }; + + const BindingPath = prop => prop[BB_STATE_BINDINGPATH]; + const BindingFallback = prop => prop[BB_STATE_FALLBACK]; + const BindingSource = prop => prop[BB_STATE_BINDINGSOURCE]; + + const renderComponent = ({ + componentConstructor, + uiFunctions, + htmlElement, + anchor, + props, + initialProps, + bb, + parentNode, + }) => { + const func = initialProps._id ? uiFunctions[initialProps._id] : undefined; + + const parentContext = (parentNode && parentNode.context) || {}; + + let renderedNodes = []; + const render = context => { + let componentContext = parentContext; + if (context) { + componentContext = { ...componentContext }; + componentContext.$parent = parentContext; + } + + const thisNode = createTreeNode(); + thisNode.context = componentContext; + thisNode.parentNode = parentNode; + thisNode.props = props; + + parentNode.children.push(thisNode); + renderedNodes.push(thisNode); + + initialProps._bb = bb(thisNode, props); + + thisNode.component = new componentConstructor({ + target: htmlElement, + props: initialProps, + hydrate: false, + anchor, + }); + + thisNode.rootElement = htmlElement.children[htmlElement.children.length - 1]; + + if (initialProps._id && thisNode.rootElement) { + thisNode.rootElement.classList.add(`pos-${initialProps._id}`); } }; - const BindingPath = prop => prop[BB_STATE_BINDINGPATH]; - const BindingFallback = prop => prop[BB_STATE_FALLBACK]; - const BindingSource = prop => prop[BB_STATE_BINDINGSOURCE]; + if (func) { + func(render, parentContext); + } else { + render(); + } - const renderComponent = ({ - componentConstructor, + return renderedNodes + }; + + const createTreeNode = () => ({ + context: {}, + props: {}, + rootElement: null, + parentNode: null, + children: [], + component: null, + unsubscribe: () => { }, + get destroy() { + const node = this; + return () => { + if (node.unsubscribe) node.unsubscribe(); + if (node.component && node.component.$destroy) node.component.$destroy(); + if (node.children) { + for (let child of node.children) { + child.destroy(); + } + } + } + }, + }); + + const isScreenSlot = componentName => + componentName === "##builtin/screenslot"; + + const attachChildren = initialiseOpts => (htmlElement, options) => { + const { uiFunctions, - htmlElement, - anchor, - props, - initialProps, bb, - parentNode, - }) => { - const func = initialProps._id ? uiFunctions[initialProps._id] : undefined; + coreApi, + store, + componentLibraries, + treeNode, + frontendDefinition, + onScreenSlotRendered, + } = initialiseOpts; - const parentContext = (parentNode && parentNode.context) || {}; + const anchor = options && options.anchor ? options.anchor : null; + const force = options ? options.force : false; + const hydrate = options ? options.hydrate : true; - let renderedNodes = []; - const render = context => { - let componentContext = parentContext; - if (context) { - componentContext = { ...componentContext }; - componentContext.$parent = parentContext; - } + if (!force && treeNode.children.length > 0) return treeNode.children - const thisNode = createTreeNode(); - thisNode.context = componentContext; - thisNode.parentNode = parentNode; - thisNode.props = props; + for (let childNode of treeNode.children) { + childNode.destroy(); + } - parentNode.children.push(thisNode); - renderedNodes.push(thisNode); + if (hydrate) { + while (htmlElement.firstChild) { + htmlElement.removeChild(htmlElement.firstChild); + } + } - initialProps._bb = bb(thisNode, props); + htmlElement.classList.add(`lay-${treeNode.props._id}`); - thisNode.component = new componentConstructor({ - target: htmlElement, - props: initialProps, - hydrate: false, - anchor, - }); + const renderedComponents = []; + for (let childProps of treeNode.props._children) { + const { componentName, libName } = splitName(childProps._component); - thisNode.rootElement = htmlElement.children[htmlElement.children.length - 1]; + if (!componentName || !libName) return - if (initialProps._id && thisNode.rootElement) { - thisNode.rootElement.classList.add(`pos-${initialProps._id}`); - } - }; + const { initialProps, bind } = setupBinding( + store, + childProps, + coreApi, + frontendDefinition.appRootPath + ); - if (func) { - func(render, parentContext); - } else { - render(); + const componentConstructor = componentLibraries[libName][componentName]; + + const renderedComponentsThisIteration = renderComponent({ + props: childProps, + parentNode: treeNode, + componentConstructor, + uiFunctions, + htmlElement, + anchor, + initialProps, + bb, + }); + + if ( + onScreenSlotRendered && + isScreenSlot(childProps._component) && + renderedComponentsThisIteration.length > 0 + ) { + // assuming there is only ever one screen slot + onScreenSlotRendered(renderedComponentsThisIteration[0]); } - return renderedNodes + for (let comp of renderedComponentsThisIteration) { + comp.unsubscribe = bind(comp.component); + renderedComponents.push(comp); + } + } + + treeNode.children = renderedComponents; + + return renderedComponents + }; + + const splitName = fullname => { + const componentName = $(fullname, [fp_3("/"), fp_5]); + + const libName = fullname.substring( + 0, + fullname.length - componentName.length - 1 + ); + + return { libName, componentName } + }; + + function regexparam(str, loose) { + if (str instanceof RegExp) return { keys: false, pattern: str }; + var c, o, tmp, ext, keys = [], pattern = '', arr = str.split('/'); + arr[0] || arr.shift(); + + while (tmp = arr.shift()) { + c = tmp[0]; + if (c === '*') { + keys.push('wild'); + pattern += '/(.*)'; + } else if (c === ':') { + o = tmp.indexOf('?', 1); + ext = tmp.indexOf('.', 1); + keys.push(tmp.substring(1, !!~o ? o : !!~ext ? ext : tmp.length)); + pattern += !!~o && !~ext ? '(?:/([^/]+?))?' : '/([^/]+?)'; + if (!!~ext) pattern += (!!~o ? '?' : '') + '\\' + tmp.substring(ext); + } else { + pattern += '/' + tmp; + } + } + + return { + keys: keys, + pattern: new RegExp('^' + pattern + (loose ? '(?=$|\/)' : '\/?$'), 'i') + }; + } + + const screenRouter = (screens, onScreenSelected) => { + const routes = screens.map(s => s.route); + let fallback = routes.findIndex(([p]) => p === "*"); + if (fallback < 0) fallback = 0; + + let current; + + function route(url) { + const _url = url.state || url; + current = routes.findIndex( + p => p !== "*" && new RegExp("^" + p + "$").test(_url) + ); + + const params = {}; + + if (current === -1) { + routes.forEach(([p], i) => { + const pm = regexparam(p); + const matches = pm.pattern.exec(_url); + + if (!matches) return + + let j = 0; + while (j < pm.keys.length) { + params[pm.keys[j]] = matches[++j] || null; + } + + current = i; + }); + } + + const storeInitial = {}; + const store = writable(storeInitial); + + if (current !== -1) { + onScreenSelected(screens[current], store, _url); + } else if (fallback) { + onScreenSelected(screens[fallback], store, _url); + } + + !url.state && history.pushState(_url, null, _url); + } + + function click(e) { + const x = e.target.closest("a"); + const y = x && x.getAttribute("href"); + + if ( + e.ctrlKey || + e.metaKey || + e.altKey || + e.shiftKey || + e.button || + e.defaultPrevented + ) + return + + if (!y || x.target || x.host !== location.host) return + + e.preventDefault(); + route(y); + } + + addEventListener("popstate", route); + addEventListener("pushstate", route); + addEventListener("click", click); + + return route + }; + + const createApp = ( + document, + componentLibraries, + frontendDefinition, + backendDefinition, + user, + uiFunctions + ) => { + const coreApi = createCoreApi(backendDefinition, user); + backendDefinition.hierarchy = coreApi.templateApi.constructHierarchy( + backendDefinition.hierarchy + ); + const pageStore = writable({ + _bbuser: user, + }); + + const relativeUrl = url => + frontendDefinition.appRootPath + ? frontendDefinition.appRootPath + "/" + trimSlash(url) + : url; + + const apiCall = method => (url, body) => + fetch(relativeUrl(url), { + method: method, + headers: { + "Content-Type": "application/json", + }, + body: body && JSON.stringify(body), + }); + + const api = { + post: apiCall("POST"), + get: apiCall("GET"), + patch: apiCall("PATCH"), + delete: apiCall("DELETE"), }; - const createTreeNode = () => ({ - context: {}, - props: {}, - rootElement: null, - parentNode: null, - children: [], - component: null, - unsubscribe: () => {}, - get destroy() { - const node = this; - return () => { - if (node.unsubscribe) node.unsubscribe(); - if (node.component && node.component.$destroy) node.component.$destroy(); - if (node.children) { - for (let child of node.children) { - child.destroy(); + const safeCallEvent = (event, context) => { + const isFunction = obj => + !!(obj && obj.constructor && obj.call && obj.apply); + + if (isFunction(event)) event(context); + }; + + let routeTo; + let currentScreenStore; + let currentScreenUbsubscribe; + let currentUrl; + + const onScreenSlotRendered = screenSlotNode => { + const onScreenSelected = (screen, store, url) => { + const { getInitialiseParams, unsubscribe } = attachChildrenParams(store); + screenSlotNode.props._children = [screen.props]; + const initialiseChildParams = getInitialiseParams(screenSlotNode); + attachChildren(initialiseChildParams)(screenSlotNode.rootElement, { + hydrate: true, + force: true, + }); + if (currentScreenUbsubscribe) currentScreenUbsubscribe(); + currentScreenUbsubscribe = unsubscribe; + currentScreenStore = store; + currentUrl = url; + }; + + routeTo = screenRouter(frontendDefinition.screens, onScreenSelected); + routeTo(currentUrl || window.location.pathname); + }; + + const attachChildrenParams = store => { + let currentState = null; + const unsubscribe = store.subscribe(s => { + currentState = s; + }); + + const getInitialiseParams = treeNode => ({ + bb: getBbClientApi, + coreApi, + store, + document, + componentLibraries, + frontendDefinition, + uiFunctions, + treeNode, + onScreenSlotRendered, + }); + + const getBbClientApi = (treeNode, componentProps) => { + return { + attachChildren: attachChildren(getInitialiseParams(treeNode)), + context: treeNode.context, + props: componentProps, + call: safeCallEvent, + setStateFromBinding: (binding, value) => + setStateFromBinding(store, binding, value), + setState: (path, value) => setState(store, path, value), + getStateOrValue: (prop, currentContext) => + getStateOrValue(currentState, prop, currentContext), + store, + relativeUrl, + api, + isBound, + parent, + } + }; + return { getInitialiseParams, unsubscribe } + }; + + let rootTreeNode; + + const initialisePage = (page, target, urlPath) => { + currentUrl = urlPath; + + rootTreeNode = createTreeNode(); + rootTreeNode.props = { + _children: [page.props], + }; + rootTreeNode.rootElement = target; + const { getInitialiseParams } = attachChildrenParams(pageStore); + const initChildParams = getInitialiseParams(rootTreeNode); + + attachChildren(initChildParams)(target, { + hydrate: true, + force: true, + }); + + return rootTreeNode + }; + return { + initialisePage, + screenStore: () => currentScreenStore, + pageStore: () => pageStore, + routeTo: () => routeTo, + rootNode: () => rootTreeNode, + } + }; + + /* src\Container.svelte generated by Svelte v3.12.1 */ + + const file$1 = "src\\Container.svelte"; + + // (47:31) + function create_if_block_12(ctx) { + var p; + + const block = { + c: function create() { + p = element("p"); + this.h(); + }, + + l: function claim(nodes) { + p = claim_element(nodes, "P", { class: true }, false); + var p_nodes = children(p); + + p_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(p, "class", ctx.className); + add_location(p, file$1, 47, 0, 1453); + }, + + m: function mount(target, anchor) { + insert_dev(target, p, anchor); + ctx.p_binding(p); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(p, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(p); + } + + ctx.p_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_12.name, type: "if", source: "(47:31) ", ctx }); + return block; + } + + // (45:32) + function create_if_block_11(ctx) { + var figcaption; + + const block = { + c: function create() { + figcaption = element("figcaption"); + this.h(); + }, + + l: function claim(nodes) { + figcaption = claim_element(nodes, "FIGCAPTION", { class: true }, false); + var figcaption_nodes = children(figcaption); + + figcaption_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(figcaption, "class", ctx.className); + add_location(figcaption, file$1, 45, 0, 1357); + }, + + m: function mount(target, anchor) { + insert_dev(target, figcaption, anchor); + ctx.figcaption_binding(figcaption); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(figcaption, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(figcaption); + } + + ctx.figcaption_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_11.name, type: "if", source: "(45:32) ", ctx }); + return block; + } + + // (43:28) + function create_if_block_10(ctx) { + var figure; + + const block = { + c: function create() { + figure = element("figure"); + this.h(); + }, + + l: function claim(nodes) { + figure = claim_element(nodes, "FIGURE", { class: true }, false); + var figure_nodes = children(figure); + + figure_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(figure, "class", ctx.className); + add_location(figure, file$1, 43, 0, 1264); + }, + + m: function mount(target, anchor) { + insert_dev(target, figure, anchor); + ctx.figure_binding(figure); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(figure, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(figure); + } + + ctx.figure_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_10.name, type: "if", source: "(43:28) ", ctx }); + return block; + } + + // (41:26) + function create_if_block_9(ctx) { + var mark; + + const block = { + c: function create() { + mark = element("mark"); + this.h(); + }, + + l: function claim(nodes) { + mark = claim_element(nodes, "MARK", { class: true }, false); + var mark_nodes = children(mark); + + mark_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(mark, "class", ctx.className); + add_location(mark, file$1, 41, 0, 1177); + }, + + m: function mount(target, anchor) { + insert_dev(target, mark, anchor); + ctx.mark_binding(mark); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(mark, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(mark); + } + + ctx.mark_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_9.name, type: "if", source: "(41:26) ", ctx }); + return block; + } + + // (39:25) + function create_if_block_8(ctx) { + var nav; + + const block = { + c: function create() { + nav = element("nav"); + this.h(); + }, + + l: function claim(nodes) { + nav = claim_element(nodes, "NAV", { class: true }, false); + var nav_nodes = children(nav); + + nav_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(nav, "class", ctx.className); + add_location(nav, file$1, 39, 0, 1093); + }, + + m: function mount(target, anchor) { + insert_dev(target, nav, anchor); + ctx.nav_binding(nav); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(nav, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(nav); + } + + ctx.nav_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_8.name, type: "if", source: "(39:25) ", ctx }); + return block; + } + + // (37:29) + function create_if_block_7(ctx) { + var article; + + const block = { + c: function create() { + article = element("article"); + this.h(); + }, + + l: function claim(nodes) { + article = claim_element(nodes, "ARTICLE", { class: true }, false); + var article_nodes = children(article); + + article_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(article, "class", ctx.className); + add_location(article, file$1, 37, 0, 1006); + }, + + m: function mount(target, anchor) { + insert_dev(target, article, anchor); + ctx.article_binding(article); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(article, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(article); + } + + ctx.article_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_7.name, type: "if", source: "(37:29) ", ctx }); + return block; + } + + // (35:29) + function create_if_block_6(ctx) { + var details; + + const block = { + c: function create() { + details = element("details"); + this.h(); + }, + + l: function claim(nodes) { + details = claim_element(nodes, "DETAILS", { class: true }, false); + var details_nodes = children(details); + + details_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(details, "class", ctx.className); + add_location(details, file$1, 35, 0, 915); + }, + + m: function mount(target, anchor) { + insert_dev(target, details, anchor); + ctx.details_binding(details); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(details, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(details); + } + + ctx.details_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_6.name, type: "if", source: "(35:29) ", ctx }); + return block; + } + + // (33:29) + function create_if_block_5(ctx) { + var summary; + + const block = { + c: function create() { + summary = element("summary"); + this.h(); + }, + + l: function claim(nodes) { + summary = claim_element(nodes, "SUMMARY", { class: true }, false); + var summary_nodes = children(summary); + + summary_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(summary, "class", ctx.className); + add_location(summary, file$1, 33, 0, 824); + }, + + m: function mount(target, anchor) { + insert_dev(target, summary, anchor); + ctx.summary_binding(summary); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(summary, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(summary); + } + + ctx.summary_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_5.name, type: "if", source: "(33:29) ", ctx }); + return block; + } + + // (31:27) + function create_if_block_4(ctx) { + var aside; + + const block = { + c: function create() { + aside = element("aside"); + this.h(); + }, + + l: function claim(nodes) { + aside = claim_element(nodes, "ASIDE", { class: true }, false); + var aside_nodes = children(aside); + + aside_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(aside, "class", ctx.className); + add_location(aside, file$1, 31, 0, 735); + }, + + m: function mount(target, anchor) { + insert_dev(target, aside, anchor); + ctx.aside_binding(aside); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(aside, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(aside); + } + + ctx.aside_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_4.name, type: "if", source: "(31:27) ", ctx }); + return block; + } + + // (29:28) + function create_if_block_3(ctx) { + var footer; + + const block = { + c: function create() { + footer = element("footer"); + this.h(); + }, + + l: function claim(nodes) { + footer = claim_element(nodes, "FOOTER", { class: true }, false); + var footer_nodes = children(footer); + + footer_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(footer, "class", ctx.className); + add_location(footer, file$1, 29, 0, 647); + }, + + m: function mount(target, anchor) { + insert_dev(target, footer, anchor); + ctx.footer_binding(footer); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(footer, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(footer); + } + + ctx.footer_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_3.name, type: "if", source: "(29:28) ", ctx }); + return block; + } + + // (27:26) + function create_if_block_2(ctx) { + var main; + + const block = { + c: function create() { + main = element("main"); + this.h(); + }, + + l: function claim(nodes) { + main = claim_element(nodes, "MAIN", { class: true }, false); + var main_nodes = children(main); + + main_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(main, "class", ctx.className); + add_location(main, file$1, 27, 0, 560); + }, + + m: function mount(target, anchor) { + insert_dev(target, main, anchor); + ctx.main_binding(main); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(main, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(main); + } + + ctx.main_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_2.name, type: "if", source: "(27:26) ", ctx }); + return block; + } + + // (25:28) + function create_if_block_1(ctx) { + var header; + + const block = { + c: function create() { + header = element("header"); + this.h(); + }, + + l: function claim(nodes) { + header = claim_element(nodes, "HEADER", { class: true }, false); + var header_nodes = children(header); + + header_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(header, "class", ctx.className); + add_location(header, file$1, 25, 0, 473); + }, + + m: function mount(target, anchor) { + insert_dev(target, header, anchor); + ctx.header_binding(header); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(header, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(header); + } + + ctx.header_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_1.name, type: "if", source: "(25:28) ", ctx }); + return block; + } + + // (23:0) {#if type === "div"} + function create_if_block(ctx) { + var div; + + const block = { + c: function create() { + div = element("div"); + this.h(); + }, + + l: function claim(nodes) { + div = claim_element(nodes, "DIV", { class: true }, false); + var div_nodes = children(div); + + div_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(div, "class", ctx.className); + add_location(div, file$1, 23, 0, 387); + }, + + m: function mount(target, anchor) { + insert_dev(target, div, anchor); + ctx.div_binding(div); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(div, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(div); + } + + ctx.div_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block.name, type: "if", source: "(23:0) {#if type === \"div\"}", ctx }); + return block; + } + + function create_fragment(ctx) { + var if_block_anchor; + + function select_block_type(changed, ctx) { + if (ctx.type === "div") return create_if_block; + if (ctx.type === "header") return create_if_block_1; + if (ctx.type === "main") return create_if_block_2; + if (ctx.type === "footer") return create_if_block_3; + if (ctx.type === "aside") return create_if_block_4; + if (ctx.type === "summary") return create_if_block_5; + if (ctx.type === "details") return create_if_block_6; + if (ctx.type === "article") return create_if_block_7; + if (ctx.type === "nav") return create_if_block_8; + if (ctx.type === "mark") return create_if_block_9; + if (ctx.type === "figure") return create_if_block_10; + if (ctx.type === "figcaption") return create_if_block_11; + if (ctx.type === "paragraph") return create_if_block_12; + } + + var current_block_type = select_block_type(null, ctx); + var if_block = current_block_type && current_block_type(ctx); + + const block = { + c: function create() { + if (if_block) if_block.c(); + if_block_anchor = empty(); + }, + + l: function claim(nodes) { + if (if_block) if_block.l(nodes); + if_block_anchor = empty(); + }, + + m: function mount(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert_dev(target, if_block_anchor, anchor); + }, + + p: function update(changed, ctx) { + if (current_block_type === (current_block_type = select_block_type(changed, ctx)) && if_block) { + if_block.p(changed, ctx); + } else { + if (if_block) if_block.d(1); + if_block = current_block_type && current_block_type(ctx); + if (if_block) { + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } + }, + + i: noop, + o: noop, + + d: function destroy(detaching) { + if (if_block) if_block.d(detaching); + + if (detaching) { + detach_dev(if_block_anchor); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment.name, type: "component", source: "", ctx }); + return block; + } + + function instance($$self, $$props, $$invalidate) { + let { className = "", onLoad, type, _bb } = $$props; + + let containerElement; + let hasLoaded; + let currentChildren; + + const writable_props = ['className', 'onLoad', 'type', '_bb']; + Object.keys($$props).forEach(key => { + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); + }); + + function div_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function header_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function main_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function footer_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function aside_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function summary_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function details_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function article_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function nav_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function mark_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function figure_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function figcaption_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function p_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + $$self.$set = $$props => { + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('onLoad' in $$props) $$invalidate('onLoad', onLoad = $$props.onLoad); + if ('type' in $$props) $$invalidate('type', type = $$props.type); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + }; + + $$self.$capture_state = () => { + return { className, onLoad, type, _bb, containerElement, hasLoaded, currentChildren }; + }; + + $$self.$inject_state = $$props => { + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('onLoad' in $$props) $$invalidate('onLoad', onLoad = $$props.onLoad); + if ('type' in $$props) $$invalidate('type', type = $$props.type); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + if ('containerElement' in $$props) $$invalidate('containerElement', containerElement = $$props.containerElement); + if ('hasLoaded' in $$props) $$invalidate('hasLoaded', hasLoaded = $$props.hasLoaded); + if ('currentChildren' in $$props) currentChildren = $$props.currentChildren; + }; + + $$self.$$.update = ($$dirty = { containerElement: 1, _bb: 1, hasLoaded: 1, onLoad: 1 }) => { + if ($$dirty.containerElement || $$dirty._bb || $$dirty.hasLoaded || $$dirty.onLoad) { + { + if (containerElement) { + _bb.attachChildren(containerElement); + if (!hasLoaded) { + _bb.call(onLoad); + $$invalidate('hasLoaded', hasLoaded = true); + } + } + } + } + }; + + return { + className, + onLoad, + type, + _bb, + containerElement, + div_binding, + header_binding, + main_binding, + footer_binding, + aside_binding, + summary_binding, + details_binding, + article_binding, + nav_binding, + mark_binding, + figure_binding, + figcaption_binding, + p_binding + }; + } + + class Container extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance, create_fragment, safe_not_equal, ["className", "onLoad", "type", "_bb"]); + dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Container", options, id: create_fragment.name }); + + const { ctx } = this.$$; + const props = options.props || {}; + if (ctx.onLoad === undefined && !('onLoad' in props)) { + console.warn(" was created without expected prop 'onLoad'"); + } + if (ctx.type === undefined && !('type' in props)) { + console.warn(" was created without expected prop 'type'"); + } + if (ctx._bb === undefined && !('_bb' in props)) { + console.warn(" was created without expected prop '_bb'"); + } + } + + get className() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set className(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get onLoad() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set onLoad(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get type() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set type(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get _bb() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set _bb(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + } + + const buildStyle = styles => { + let str = ""; + for (let s in styles) { + if (styles[s]) { + str += `${s}: ${styles[s]}; `; + } + } + return str + }; + + /* src\Text.svelte generated by Svelte v3.12.1 */ + + const file$2 = "src\\Text.svelte"; + + // (53:0) {:else} + function create_else_block(ctx) { + var t; + + const block = { + c: function create() { + t = text(ctx.text); + }, + + l: function claim(nodes) { + t = claim_text(nodes, ctx.text); + }, + + m: function mount(target, anchor) { + insert_dev(target, t, anchor); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(t); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_else_block.name, type: "else", source: "(53:0) {:else}", ctx }); + return block; + } + + // (51:25) + function create_if_block_10$1(ctx) { + var sup, t; + + const block = { + c: function create() { + sup = element("sup"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + sup = claim_element(nodes, "SUP", { class: true, style: true }, false); + var sup_nodes = children(sup); + + t = claim_text(sup_nodes, ctx.text); + sup_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(sup, "class", ctx.className); + attr_dev(sup, "style", ctx.style); + add_location(sup, file$2, 51, 0, 1254); + }, + + m: function mount(target, anchor) { + insert_dev(target, sup, anchor); + append_dev(sup, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(sup, "class", ctx.className); + } + + if (changed.style) { + attr_dev(sup, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(sup); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_10$1.name, type: "if", source: "(51:25) ", ctx }); + return block; + } + + // (49:25) + function create_if_block_9$1(ctx) { + var sub, t; + + const block = { + c: function create() { + sub = element("sub"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + sub = claim_element(nodes, "SUB", { class: true, style: true }, false); + var sub_nodes = children(sub); + + t = claim_text(sub_nodes, ctx.text); + sub_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(sub, "class", ctx.className); + attr_dev(sub, "style", ctx.style); + add_location(sub, file$2, 49, 0, 1182); + }, + + m: function mount(target, anchor) { + insert_dev(target, sub, anchor); + append_dev(sub, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(sub, "class", ctx.className); + } + + if (changed.style) { + attr_dev(sub, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(sub); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_9$1.name, type: "if", source: "(49:25) ", ctx }); + return block; + } + + // (47:25) + function create_if_block_8$1(ctx) { + var ins, t; + + const block = { + c: function create() { + ins = element("ins"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + ins = claim_element(nodes, "INS", { class: true, style: true }, false); + var ins_nodes = children(ins); + + t = claim_text(ins_nodes, ctx.text); + ins_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(ins, "class", ctx.className); + attr_dev(ins, "style", ctx.style); + add_location(ins, file$2, 47, 0, 1110); + }, + + m: function mount(target, anchor) { + insert_dev(target, ins, anchor); + append_dev(ins, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(ins, "class", ctx.className); + } + + if (changed.style) { + attr_dev(ins, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(ins); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_8$1.name, type: "if", source: "(47:25) ", ctx }); + return block; + } + + // (45:25) + function create_if_block_7$1(ctx) { + var del, t; + + const block = { + c: function create() { + del = element("del"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + del = claim_element(nodes, "DEL", { class: true, style: true }, false); + var del_nodes = children(del); + + t = claim_text(del_nodes, ctx.text); + del_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(del, "class", ctx.className); + attr_dev(del, "style", ctx.style); + add_location(del, file$2, 45, 0, 1038); + }, + + m: function mount(target, anchor) { + insert_dev(target, del, anchor); + append_dev(del, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(del, "class", ctx.className); + } + + if (changed.style) { + attr_dev(del, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(del); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_7$1.name, type: "if", source: "(45:25) ", ctx }); + return block; + } + + // (43:27) + function create_if_block_6$1(ctx) { + var small, t; + + const block = { + c: function create() { + small = element("small"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + small = claim_element(nodes, "SMALL", { class: true, style: true }, false); + var small_nodes = children(small); + + t = claim_text(small_nodes, ctx.text); + small_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(small, "class", ctx.className); + attr_dev(small, "style", ctx.style); + add_location(small, file$2, 43, 0, 962); + }, + + m: function mount(target, anchor) { + insert_dev(target, small, anchor); + append_dev(small, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(small, "class", ctx.className); + } + + if (changed.style) { + attr_dev(small, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(small); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_6$1.name, type: "if", source: "(43:27) ", ctx }); + return block; + } + + // (41:26) + function create_if_block_5$1(ctx) { + var mark, t; + + const block = { + c: function create() { + mark = element("mark"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + mark = claim_element(nodes, "MARK", { class: true, style: true }, false); + var mark_nodes = children(mark); + + t = claim_text(mark_nodes, ctx.text); + mark_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(mark, "class", ctx.className); + attr_dev(mark, "style", ctx.style); + add_location(mark, file$2, 41, 0, 886); + }, + + m: function mount(target, anchor) { + insert_dev(target, mark, anchor); + append_dev(mark, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(mark, "class", ctx.className); + } + + if (changed.style) { + attr_dev(mark, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(mark); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_5$1.name, type: "if", source: "(41:26) ", ctx }); + return block; + } + + // (39:24) + function create_if_block_4$1(ctx) { + var em, t; + + const block = { + c: function create() { + em = element("em"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + em = claim_element(nodes, "EM", { class: true, style: true }, false); + var em_nodes = children(em); + + t = claim_text(em_nodes, ctx.text); + em_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(em, "class", ctx.className); + attr_dev(em, "style", ctx.style); + add_location(em, file$2, 39, 0, 815); + }, + + m: function mount(target, anchor) { + insert_dev(target, em, anchor); + append_dev(em, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(em, "class", ctx.className); + } + + if (changed.style) { + attr_dev(em, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(em); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_4$1.name, type: "if", source: "(39:24) ", ctx }); + return block; + } + + // (37:23) + function create_if_block_3$1(ctx) { + var i, t; + + const block = { + c: function create() { + i = element("i"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + i = claim_element(nodes, "I", { class: true, style: true }, false); + var i_nodes = children(i); + + t = claim_text(i_nodes, ctx.text); + i_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(i, "class", ctx.className); + attr_dev(i, "style", ctx.style); + add_location(i, file$2, 37, 0, 748); + }, + + m: function mount(target, anchor) { + insert_dev(target, i, anchor); + append_dev(i, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(i, "class", ctx.className); + } + + if (changed.style) { + attr_dev(i, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(i); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_3$1.name, type: "if", source: "(37:23) ", ctx }); + return block; + } + + // (35:28) + function create_if_block_2$1(ctx) { + var strong, t; + + const block = { + c: function create() { + strong = element("strong"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + strong = claim_element(nodes, "STRONG", { class: true, style: true }, false); + var strong_nodes = children(strong); + + t = claim_text(strong_nodes, ctx.text); + strong_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(strong, "class", ctx.className); + attr_dev(strong, "style", ctx.style); + add_location(strong, file$2, 35, 0, 672); + }, + + m: function mount(target, anchor) { + insert_dev(target, strong, anchor); + append_dev(strong, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(strong, "class", ctx.className); + } + + if (changed.style) { + attr_dev(strong, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(strong); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_2$1.name, type: "if", source: "(35:28) ", ctx }); + return block; + } + + // (33:23) + function create_if_block_1$1(ctx) { + var b, t; + + const block = { + c: function create() { + b = element("b"); + t = text(ctx.text); + this.h(); + }, + + l: function claim(nodes) { + b = claim_element(nodes, "B", { class: true, style: true }, false); + var b_nodes = children(b); + + t = claim_text(b_nodes, ctx.text); + b_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(b, "class", ctx.className); + attr_dev(b, "style", ctx.style); + add_location(b, file$2, 33, 0, 601); + }, + + m: function mount(target, anchor) { + insert_dev(target, b, anchor); + append_dev(b, t); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + + if (changed.className) { + attr_dev(b, "class", ctx.className); + } + + if (changed.style) { + attr_dev(b, "style", ctx.style); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(b); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_1$1.name, type: "if", source: "(33:23) ", ctx }); + return block; + } + + // (31:0) {#if isTag("none")} + function create_if_block$1(ctx) { + var t; + + const block = { + c: function create() { + t = text(ctx.text); + }, + + l: function claim(nodes) { + t = claim_text(nodes, ctx.text); + }, + + m: function mount(target, anchor) { + insert_dev(target, t, anchor); + }, + + p: function update(changed, ctx) { + if (changed.text) { + set_data_dev(t, ctx.text); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(t); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block$1.name, type: "if", source: "(31:0) {#if isTag(\"none\")}", ctx }); + return block; + } + + function create_fragment$1(ctx) { + var if_block_anchor; + + function select_block_type(changed, ctx) { + if (ctx.isTag("none")) return create_if_block$1; + if (ctx.isTag("")) return create_if_block_1$1; + if (ctx.isTag("")) return create_if_block_2$1; + if (ctx.isTag("")) return create_if_block_3$1; + if (ctx.isTag("")) return create_if_block_4$1; + if (ctx.isTag("")) return create_if_block_5$1; + if (ctx.isTag("")) return create_if_block_6$1; + if (ctx.isTag("")) return create_if_block_7$1; + if (ctx.isTag("")) return create_if_block_8$1; + if (ctx.isTag("")) return create_if_block_9$1; + if (ctx.isTag("")) return create_if_block_10$1; + return create_else_block; + } + + var current_block_type = select_block_type(null, ctx); + var if_block = current_block_type(ctx); + + const block = { + c: function create() { + if_block.c(); + if_block_anchor = empty(); + }, + + l: function claim(nodes) { + if_block.l(nodes); + if_block_anchor = empty(); + }, + + m: function mount(target, anchor) { + if_block.m(target, anchor); + insert_dev(target, if_block_anchor, anchor); + }, + + p: function update(changed, ctx) { + if_block.p(changed, ctx); + }, + + i: noop, + o: noop, + + d: function destroy(detaching) { + if_block.d(detaching); + + if (detaching) { + detach_dev(if_block_anchor); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$1.name, type: "component", source: "", ctx }); + return block; + } + + function instance$1($$self, $$props, $$invalidate) { + let { text = "", className = "", formattingTag = "", font = "", textAlign = "", verticalAlign = "", color = "", _bb } = $$props; + + let style = ""; + + const isTag = tag => (formattingTag || "").indexOf(tag) > -1; + + const writable_props = ['text', 'className', 'formattingTag', 'font', 'textAlign', 'verticalAlign', 'color', '_bb']; + Object.keys($$props).forEach(key => { + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); + }); + + $$self.$set = $$props => { + if ('text' in $$props) $$invalidate('text', text = $$props.text); + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('formattingTag' in $$props) $$invalidate('formattingTag', formattingTag = $$props.formattingTag); + if ('font' in $$props) $$invalidate('font', font = $$props.font); + if ('textAlign' in $$props) $$invalidate('textAlign', textAlign = $$props.textAlign); + if ('verticalAlign' in $$props) $$invalidate('verticalAlign', verticalAlign = $$props.verticalAlign); + if ('color' in $$props) $$invalidate('color', color = $$props.color); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + }; + + $$self.$capture_state = () => { + return { text, className, formattingTag, font, textAlign, verticalAlign, color, _bb, style }; + }; + + $$self.$inject_state = $$props => { + if ('text' in $$props) $$invalidate('text', text = $$props.text); + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('formattingTag' in $$props) $$invalidate('formattingTag', formattingTag = $$props.formattingTag); + if ('font' in $$props) $$invalidate('font', font = $$props.font); + if ('textAlign' in $$props) $$invalidate('textAlign', textAlign = $$props.textAlign); + if ('verticalAlign' in $$props) $$invalidate('verticalAlign', verticalAlign = $$props.verticalAlign); + if ('color' in $$props) $$invalidate('color', color = $$props.color); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + if ('style' in $$props) $$invalidate('style', style = $$props.style); + }; + + $$self.$$.update = ($$dirty = { font: 1, verticalAlign: 1, color: 1, textAlign: 1 }) => { + if ($$dirty.font || $$dirty.verticalAlign || $$dirty.color || $$dirty.textAlign) { + { + $$invalidate('style', style = buildStyle({ + font, + verticalAlign, + color, + "text-align": textAlign, + "vertical-align": verticalAlign, + })); + } + } + }; + + return { + text, + className, + formattingTag, + font, + textAlign, + verticalAlign, + color, + _bb, + style, + isTag + }; + } + + class Text extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$1, create_fragment$1, safe_not_equal, ["text", "className", "formattingTag", "font", "textAlign", "verticalAlign", "color", "_bb"]); + dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Text", options, id: create_fragment$1.name }); + + const { ctx } = this.$$; + const props = options.props || {}; + if (ctx._bb === undefined && !('_bb' in props)) { + console.warn(" was created without expected prop '_bb'"); + } + } + + get text() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set text(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get className() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set className(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get formattingTag() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set formattingTag(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get font() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set font(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get textAlign() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set textAlign(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get verticalAlign() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set verticalAlign(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get color() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set color(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get _bb() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set _bb(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + } + + /* src\Heading.svelte generated by Svelte v3.12.1 */ + + const file$3 = "src\\Heading.svelte"; + + // (22:24) + function create_if_block_5$2(ctx) { + var h6; + + const block = { + c: function create() { + h6 = element("h6"); + this.h(); + }, + + l: function claim(nodes) { + h6 = claim_element(nodes, "H6", { class: true }, false); + var h6_nodes = children(h6); + + h6_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(h6, "class", ctx.className); + add_location(h6, file$3, 22, 0, 623); + }, + + m: function mount(target, anchor) { + insert_dev(target, h6, anchor); + ctx.h6_binding(h6); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(h6, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(h6); + } + + ctx.h6_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_5$2.name, type: "if", source: "(22:24) ", ctx }); + return block; + } + + // (20:24) + function create_if_block_4$2(ctx) { + var h5; + + const block = { + c: function create() { + h5 = element("h5"); + this.h(); + }, + + l: function claim(nodes) { + h5 = claim_element(nodes, "H5", { class: true }, false); + var h5_nodes = children(h5); + + h5_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(h5, "class", ctx.className); + add_location(h5, file$3, 20, 0, 539); + }, + + m: function mount(target, anchor) { + insert_dev(target, h5, anchor); + ctx.h5_binding(h5); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(h5, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(h5); + } + + ctx.h5_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_4$2.name, type: "if", source: "(20:24) ", ctx }); + return block; + } + + // (18:24) + function create_if_block_3$2(ctx) { + var h4; + + const block = { + c: function create() { + h4 = element("h4"); + this.h(); + }, + + l: function claim(nodes) { + h4 = claim_element(nodes, "H4", { class: true }, false); + var h4_nodes = children(h4); + + h4_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(h4, "class", ctx.className); + add_location(h4, file$3, 18, 0, 455); + }, + + m: function mount(target, anchor) { + insert_dev(target, h4, anchor); + ctx.h4_binding(h4); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(h4, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(h4); + } + + ctx.h4_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_3$2.name, type: "if", source: "(18:24) ", ctx }); + return block; + } + + // (16:24) + function create_if_block_2$2(ctx) { + var h3; + + const block = { + c: function create() { + h3 = element("h3"); + this.h(); + }, + + l: function claim(nodes) { + h3 = claim_element(nodes, "H3", { class: true }, false); + var h3_nodes = children(h3); + + h3_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(h3, "class", ctx.className); + add_location(h3, file$3, 16, 0, 371); + }, + + m: function mount(target, anchor) { + insert_dev(target, h3, anchor); + ctx.h3_binding(h3); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(h3, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(h3); + } + + ctx.h3_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_2$2.name, type: "if", source: "(16:24) ", ctx }); + return block; + } + + // (14:24) + function create_if_block_1$2(ctx) { + var h2; + + const block = { + c: function create() { + h2 = element("h2"); + this.h(); + }, + + l: function claim(nodes) { + h2 = claim_element(nodes, "H2", { class: true }, false); + var h2_nodes = children(h2); + + h2_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(h2, "class", ctx.className); + add_location(h2, file$3, 14, 0, 287); + }, + + m: function mount(target, anchor) { + insert_dev(target, h2, anchor); + ctx.h2_binding(h2); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(h2, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(h2); + } + + ctx.h2_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block_1$2.name, type: "if", source: "(14:24) ", ctx }); + return block; + } + + // (12:0) {#if type === "h1"} + function create_if_block$2(ctx) { + var h1; + + const block = { + c: function create() { + h1 = element("h1"); + this.h(); + }, + + l: function claim(nodes) { + h1 = claim_element(nodes, "H1", { class: true }, false); + var h1_nodes = children(h1); + + h1_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(h1, "class", ctx.className); + add_location(h1, file$3, 12, 0, 203); + }, + + m: function mount(target, anchor) { + insert_dev(target, h1, anchor); + ctx.h1_binding(h1); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(h1, "class", ctx.className); + } + }, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(h1); + } + + ctx.h1_binding(null); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_if_block$2.name, type: "if", source: "(12:0) {#if type === \"h1\"}", ctx }); + return block; + } + + function create_fragment$2(ctx) { + var if_block_anchor; + + function select_block_type(changed, ctx) { + if (ctx.type === "h1") return create_if_block$2; + if (ctx.type === "h2") return create_if_block_1$2; + if (ctx.type === "h3") return create_if_block_2$2; + if (ctx.type === "h4") return create_if_block_3$2; + if (ctx.type === "h5") return create_if_block_4$2; + if (ctx.type === "h6") return create_if_block_5$2; + } + + var current_block_type = select_block_type(null, ctx); + var if_block = current_block_type && current_block_type(ctx); + + const block = { + c: function create() { + if (if_block) if_block.c(); + if_block_anchor = empty(); + }, + + l: function claim(nodes) { + if (if_block) if_block.l(nodes); + if_block_anchor = empty(); + }, + + m: function mount(target, anchor) { + if (if_block) if_block.m(target, anchor); + insert_dev(target, if_block_anchor, anchor); + }, + + p: function update(changed, ctx) { + if (current_block_type === (current_block_type = select_block_type(changed, ctx)) && if_block) { + if_block.p(changed, ctx); + } else { + if (if_block) if_block.d(1); + if_block = current_block_type && current_block_type(ctx); + if (if_block) { + if_block.c(); + if_block.m(if_block_anchor.parentNode, if_block_anchor); + } + } + }, + + i: noop, + o: noop, + + d: function destroy(detaching) { + if (if_block) if_block.d(detaching); + + if (detaching) { + detach_dev(if_block_anchor); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$2.name, type: "component", source: "", ctx }); + return block; + } + + function instance$2($$self, $$props, $$invalidate) { + let { className = "", type, _bb } = $$props; + + let containerElement; + + const writable_props = ['className', 'type', '_bb']; + Object.keys($$props).forEach(key => { + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); + }); + + function h1_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function h2_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function h3_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function h4_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function h5_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + function h6_binding($$value) { + binding_callbacks[$$value ? 'unshift' : 'push'](() => { + $$invalidate('containerElement', containerElement = $$value); + }); + } + + $$self.$set = $$props => { + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('type' in $$props) $$invalidate('type', type = $$props.type); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + }; + + $$self.$capture_state = () => { + return { className, type, _bb, containerElement }; + }; + + $$self.$inject_state = $$props => { + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('type' in $$props) $$invalidate('type', type = $$props.type); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + if ('containerElement' in $$props) $$invalidate('containerElement', containerElement = $$props.containerElement); + }; + + $$self.$$.update = ($$dirty = { containerElement: 1, _bb: 1 }) => { + if ($$dirty.containerElement || $$dirty._bb) { containerElement && _bb.attachChildren(containerElement); } + }; + + return { + className, + type, + _bb, + containerElement, + h1_binding, + h2_binding, + h3_binding, + h4_binding, + h5_binding, + h6_binding + }; + } + + class Heading extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$2, create_fragment$2, safe_not_equal, ["className", "type", "_bb"]); + dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Heading", options, id: create_fragment$2.name }); + + const { ctx } = this.$$; + const props = options.props || {}; + if (ctx.type === undefined && !('type' in props)) { + console.warn(" was created without expected prop 'type'"); + } + if (ctx._bb === undefined && !('_bb' in props)) { + console.warn(" was created without expected prop '_bb'"); + } + } + + get className() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set className(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get type() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set type(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get _bb() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set _bb(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + } + + /* src\Input.svelte generated by Svelte v3.12.1 */ + + const file$4 = "src\\Input.svelte"; + + function create_fragment$3(ctx) { + var input, dispose; + + const block = { + c: function create() { + input = element("input"); + this.h(); + }, + + l: function claim(nodes) { + input = claim_element(nodes, "INPUT", { class: true, type: true, value: true }, false); + var input_nodes = children(input); + + input_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(input, "class", ctx.className); + attr_dev(input, "type", ctx.type); + input.value = ctx.value; + add_location(input, file$4, 16, 0, 274); + dispose = listen_dev(input, "change", ctx.onchange); + }, + + m: function mount(target, anchor) { + insert_dev(target, input, anchor); + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(input, "class", ctx.className); + } + + if (changed.type) { + attr_dev(input, "type", ctx.type); + } + + if (changed.value) { + prop_dev(input, "value", ctx.value); + } + }, + + i: noop, + o: noop, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(input); + } + + dispose(); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$3.name, type: "component", source: "", ctx }); + return block; + } + + let actualValue = ""; + + function instance$3($$self, $$props, $$invalidate) { + let { value = "", className = "", type = "text", _bb } = $$props; + + const onchange = ev => { + if (_bb) { + _bb.setStateFromBinding(_bb.props.value, ev.target.value); + } + }; + + const writable_props = ['value', 'className', 'type', '_bb']; + Object.keys($$props).forEach(key => { + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created with unknown prop '${key}'`); + }); + + $$self.$set = $$props => { + if ('value' in $$props) $$invalidate('value', value = $$props.value); + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('type' in $$props) $$invalidate('type', type = $$props.type); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + }; + + $$self.$capture_state = () => { + return { value, className, type, _bb, actualValue }; + }; + + $$self.$inject_state = $$props => { + if ('value' in $$props) $$invalidate('value', value = $$props.value); + if ('className' in $$props) $$invalidate('className', className = $$props.className); + if ('type' in $$props) $$invalidate('type', type = $$props.type); + if ('_bb' in $$props) $$invalidate('_bb', _bb = $$props._bb); + if ('actualValue' in $$props) actualValue = $$props.actualValue; + }; + + return { value, className, type, _bb, onchange }; + } + + class Input extends SvelteComponentDev { + constructor(options) { + super(options); + init(this, options, instance$3, create_fragment$3, safe_not_equal, ["value", "className", "type", "_bb"]); + dispatch_dev("SvelteRegisterComponent", { component: this, tagName: "Input", options, id: create_fragment$3.name }); + + const { ctx } = this.$$; + const props = options.props || {}; + if (ctx._bb === undefined && !('_bb' in props)) { + console.warn(" was created without expected prop '_bb'"); + } + } + + get value() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set value(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get className() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set className(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get type() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set type(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get _bb() { + throw new Error(": Props cannot be read directly from the component instance unless compiling with 'accessors: true' or ''"); + } + + set _bb(value) { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + } + + /* src\Select.svelte generated by Svelte v3.12.1 */ + + const file$5 = "src\\Select.svelte"; + + function create_fragment$4(ctx) { + var select, select_value_value, dispose; + + const block = { + c: function create() { + select = element("select"); + this.h(); + }, + + l: function claim(nodes) { + select = claim_element(nodes, "SELECT", { class: true, value: true }, false); + var select_nodes = children(select); + + select_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + attr_dev(select, "class", ctx.className); + add_location(select, file$5, 18, 0, 327); + dispose = listen_dev(select, "change", ctx.onchange); + }, + + m: function mount(target, anchor) { + insert_dev(target, select, anchor); + ctx.select_binding(select); + + select_value_value = ctx.value; + for (var i = 0; i < select.options.length; i += 1) { + var option = select.options[i]; + + if (option.__value === select_value_value) { + option.selected = true; + break; + } + } + }, + + p: function update(changed, ctx) { + if (changed.className) { + attr_dev(select, "class", ctx.className); + } + + if ((changed.value) && select_value_value !== (select_value_value = ctx.value)) { + for (var i = 0; i < select.options.length; i += 1) { + var option = select.options[i]; + + if (option.__value === select_value_value) { + option.selected = true; + break; } } } }, + + i: noop, + o: noop, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(select); + } + + ctx.select_binding(null); + dispose(); + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$4.name, type: "component", source: "", ctx }); + return block; + } + + let actualValue$1 = ""; + + function instance$4($$self, $$props, $$invalidate) { + let { value = "", className = "", _bb } = $$props; + let selectElement; + + const onchange = ev => { + if (_bb) { + _bb.setStateFromBinding(_bb.props.value, ev.target.value); + } + }; + + const writable_props = ['value', 'className', '_bb']; + Object.keys($$props).forEach(key => { + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(` was created without expected prop '_bb'"); + } + } + + get value() { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get className() { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + + get _bb() { + throw new Error(": Props cannot be set directly on the component instance unless compiling with 'accessors: true' or ''"); + } + } + + /* src\Option.svelte generated by Svelte v3.12.1 */ + + const file$6 = "src\\Option.svelte"; + + function create_fragment$5(ctx) { + var option, t; + + const block = { + c: function create() { + option = element("option"); + t = text(ctx.actualText); + this.h(); + }, + + l: function claim(nodes) { + option = claim_element(nodes, "OPTION", { value: true }, false); + var option_nodes = children(option); + + t = claim_text(option_nodes, ctx.actualText); + option_nodes.forEach(detach_dev); + this.h(); + }, + + h: function hydrate() { + option.__value = ctx.actualValue; + option.value = option.__value; + add_location(option, file$6, 13, 0, 212); + }, + + m: function mount(target, anchor) { + insert_dev(target, option, anchor); + append_dev(option, t); + }, + + p: function update(changed, ctx) { + if (changed.actualText) { + set_data_dev(t, ctx.actualText); + } + + if (changed.actualValue) { + prop_dev(option, "__value", ctx.actualValue); + } + + option.value = option.__value; + }, + + i: noop, + o: noop, + + d: function destroy(detaching) { + if (detaching) { + detach_dev(option); + } + } + }; + dispatch_dev("SvelteRegisterBlock", { block, id: create_fragment$5.name, type: "component", source: "", ctx }); + return block; + } + + function instance$5($$self, $$props, $$invalidate) { + let { value = "", text = "", _bb } = $$props; + + let actualValue; + let actualText; + + const writable_props = ['value', 'text', '_bb']; + Object.keys($$props).forEach(key => { + if (!writable_props.includes(key) && !key.startsWith('$$')) console.warn(`