\n\n return h('div', {\n style: this.modalOuterStyle,\n attrs: this.computedAttrs,\n key: \"modal-outer-\".concat(this[COMPONENT_UID_KEY])\n }, [$modal, $backdrop]);\n }\n },\n render: function render(h) {\n if (this.static) {\n return this.lazy && this.isHidden ? h() : this.makeModal(h);\n } else {\n return this.isHidden ? h() : h(BVTransporter, [this.makeModal(h)]);\n }\n }\n});","import { NAME_MODAL } from '../../constants/components';\nimport { EVENT_NAME_SHOW, EVENT_OPTIONS_PASSIVE } from '../../constants/events';\nimport { CODE_ENTER, CODE_SPACE } from '../../constants/key-codes';\nimport { getAttr, hasAttr, isDisabled, matches, select, setAttr } from '../../utils/dom';\nimport { getRootActionEventName, eventOn, eventOff } from '../../utils/events';\nimport { isString } from '../../utils/inspect';\nimport { keys } from '../../utils/object';\nimport { getEventRoot } from '../../utils/get-event-root';\nimport { getInstanceFromDirective } from '../../utils/get-instance-from-directive'; // Emitted show event for modal\n\nvar ROOT_ACTION_EVENT_NAME_SHOW = getRootActionEventName(NAME_MODAL, EVENT_NAME_SHOW); // Prop name we use to store info on root element\n\nvar PROPERTY = '__bv_modal_directive__';\n\nvar getTarget = function getTarget(_ref) {\n var _ref$modifiers = _ref.modifiers,\n modifiers = _ref$modifiers === void 0 ? {} : _ref$modifiers,\n arg = _ref.arg,\n value = _ref.value;\n // Try value, then arg, otherwise pick last modifier\n return isString(value) ? value : isString(arg) ? arg : keys(modifiers).reverse()[0];\n};\n\nvar getTriggerElement = function getTriggerElement(el) {\n // If root element is a dropdown-item or nav-item, we\n // need to target the inner link or button instead\n return el && matches(el, '.dropdown-menu > li, li.nav-item') ? select('a, button', el) || el : el;\n};\n\nvar setRole = function setRole(trigger) {\n // Ensure accessibility on non button elements\n if (trigger && trigger.tagName !== 'BUTTON') {\n // Only set a role if the trigger element doesn't have one\n if (!hasAttr(trigger, 'role')) {\n setAttr(trigger, 'role', 'button');\n } // Add a tabindex is not a button or link, and tabindex is not provided\n\n\n if (trigger.tagName !== 'A' && !hasAttr(trigger, 'tabindex')) {\n setAttr(trigger, 'tabindex', '0');\n }\n }\n};\n\nvar bind = function bind(el, binding, vnode) {\n var target = getTarget(binding);\n var trigger = getTriggerElement(el);\n\n if (target && trigger) {\n var handler = function handler(event) {\n // `currentTarget` is the element with the listener on it\n var currentTarget = event.currentTarget;\n\n if (!isDisabled(currentTarget)) {\n var type = event.type;\n var key = event.keyCode; // Open modal only if trigger is not disabled\n\n if (type === 'click' || type === 'keydown' && (key === CODE_ENTER || key === CODE_SPACE)) {\n getEventRoot(getInstanceFromDirective(vnode, binding)).$emit(ROOT_ACTION_EVENT_NAME_SHOW, target, currentTarget);\n }\n }\n };\n\n el[PROPERTY] = {\n handler: handler,\n target: target,\n trigger: trigger\n }; // If element is not a button, we add `role=\"button\"` for accessibility\n\n setRole(trigger); // Listen for click events\n\n eventOn(trigger, 'click', handler, EVENT_OPTIONS_PASSIVE);\n\n if (trigger.tagName !== 'BUTTON' && getAttr(trigger, 'role') === 'button') {\n // If trigger isn't a button but has role button,\n // we also listen for `keydown.space` && `keydown.enter`\n eventOn(trigger, 'keydown', handler, EVENT_OPTIONS_PASSIVE);\n }\n }\n};\n\nvar unbind = function unbind(el) {\n var oldProp = el[PROPERTY] || {};\n var trigger = oldProp.trigger;\n var handler = oldProp.handler;\n\n if (trigger && handler) {\n eventOff(trigger, 'click', handler, EVENT_OPTIONS_PASSIVE);\n eventOff(trigger, 'keydown', handler, EVENT_OPTIONS_PASSIVE);\n eventOff(el, 'click', handler, EVENT_OPTIONS_PASSIVE);\n eventOff(el, 'keydown', handler, EVENT_OPTIONS_PASSIVE);\n }\n\n delete el[PROPERTY];\n};\n\nvar componentUpdated = function componentUpdated(el, binding, vnode) {\n var oldProp = el[PROPERTY] || {};\n var target = getTarget(binding);\n var trigger = getTriggerElement(el);\n\n if (target !== oldProp.target || trigger !== oldProp.trigger) {\n // We bind and rebind if the target or trigger changes\n unbind(el, binding, vnode);\n bind(el, binding, vnode);\n } // If trigger element is not a button, ensure `role=\"button\"`\n // is still set for accessibility\n\n\n setRole(trigger);\n};\n\nvar updated = function updated() {};\n/*\n * Export our directive\n */\n\n\nexport var VBModal = {\n inserted: componentUpdated,\n updated: updated,\n componentUpdated: componentUpdated,\n unbind: unbind\n};","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n// Plugin for adding `$bvModal` property to all Vue instances\nimport { NAME_MODAL, NAME_MSG_BOX } from '../../../constants/components';\nimport { EVENT_NAME_HIDDEN, EVENT_NAME_HIDE, HOOK_EVENT_NAME_BEFORE_DESTROY, HOOK_EVENT_NAME_DESTROYED } from '../../../constants/events';\nimport { useParentMixin } from '../../../mixins/use-parent';\nimport { concat } from '../../../utils/array';\nimport { getComponentConfig } from '../../../utils/config';\nimport { requestAF } from '../../../utils/dom';\nimport { getRootActionEventName } from '../../../utils/events';\nimport { isUndefined, isFunction } from '../../../utils/inspect';\nimport { assign, defineProperties, defineProperty, hasOwnProperty, keys, omit, readonlyDescriptor } from '../../../utils/object';\nimport { pluginFactory } from '../../../utils/plugins';\nimport { warn, warnNotClient, warnNoPromiseSupport } from '../../../utils/warn';\nimport { createNewChildComponent } from '../../../utils/create-new-child-component';\nimport { getEventRoot } from '../../../utils/get-event-root';\nimport { BModal, props as modalProps } from '../modal'; // --- Constants ---\n\nvar PROP_NAME = '$bvModal';\nvar PROP_NAME_PRIV = '_bv__modal'; // Base modal props that are allowed\n// Some may be ignored or overridden on some message boxes\n// Prop ID is allowed, but really only should be used for testing\n// We need to add it in explicitly as it comes from the `idMixin`\n\nvar BASE_PROPS = ['id'].concat(_toConsumableArray(keys(omit(modalProps, ['busy', 'lazy', 'noStacking', 'static', 'visible'])))); // Fallback event resolver (returns undefined)\n\nvar defaultResolver = function defaultResolver() {}; // Map prop names to modal slot names\n\n\nvar propsToSlots = {\n msgBoxContent: 'default',\n title: 'modal-title',\n okTitle: 'modal-ok',\n cancelTitle: 'modal-cancel'\n}; // --- Helper methods ---\n// Method to filter only recognized props that are not undefined\n\nvar filterOptions = function filterOptions(options) {\n return BASE_PROPS.reduce(function (memo, key) {\n if (!isUndefined(options[key])) {\n memo[key] = options[key];\n }\n\n return memo;\n }, {});\n}; // Method to install `$bvModal` VM injection\n\n\nvar plugin = function plugin(Vue) {\n // Create a private sub-component that extends BModal\n // which self-destructs after hidden\n // @vue/component\n var BMsgBox = Vue.extend({\n name: NAME_MSG_BOX,\n extends: BModal,\n mixins: [useParentMixin],\n destroyed: function destroyed() {\n // Make sure we not in document any more\n if (this.$el && this.$el.parentNode) {\n this.$el.parentNode.removeChild(this.$el);\n }\n },\n mounted: function mounted() {\n var _this = this;\n\n // Self destruct handler\n var handleDestroy = function handleDestroy() {\n _this.$nextTick(function () {\n // In a `requestAF()` to release control back to application\n requestAF(function () {\n _this.$destroy();\n });\n });\n }; // Self destruct if parent destroyed\n\n\n this.bvParent.$once(HOOK_EVENT_NAME_DESTROYED, handleDestroy); // Self destruct after hidden\n\n this.$once(EVENT_NAME_HIDDEN, handleDestroy); // Self destruct on route change\n\n /* istanbul ignore if */\n\n if (this.$router && this.$route) {\n // Destroy ourselves if route changes\n\n /* istanbul ignore next */\n this.$once(HOOK_EVENT_NAME_BEFORE_DESTROY, this.$watch('$router', handleDestroy));\n } // Show the `BMsgBox`\n\n\n this.show();\n }\n }); // Method to generate the on-demand modal message box\n // Returns a promise that resolves to a value returned by the resolve\n\n var asyncMsgBox = function asyncMsgBox(parent, props) {\n var resolver = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultResolver;\n\n if (warnNotClient(PROP_NAME) || warnNoPromiseSupport(PROP_NAME)) {\n /* istanbul ignore next */\n return;\n } // Create an instance of `BMsgBox` component\n // We set parent as the local VM so these modals can emit events on\n // the app `$root`, as needed by things like tooltips and popovers\n // And it helps to ensure `BMsgBox` is destroyed when parent is destroyed\n\n\n var msgBox = createNewChildComponent(parent, BMsgBox, {\n // Preset the prop values\n propsData: _objectSpread(_objectSpread(_objectSpread({}, filterOptions(getComponentConfig(NAME_MODAL))), {}, {\n // Defaults that user can override\n hideHeaderClose: true,\n hideHeader: !(props.title || props.titleHtml)\n }, omit(props, keys(propsToSlots))), {}, {\n // Props that can't be overridden\n lazy: false,\n busy: false,\n visible: false,\n noStacking: false,\n noEnforceFocus: false\n })\n }); // Convert certain props to scoped slots\n\n keys(propsToSlots).forEach(function (prop) {\n if (!isUndefined(props[prop])) {\n // Can be a string, or array of VNodes.\n // Alternatively, user can use HTML version of prop to pass an HTML string.\n msgBox.$slots[propsToSlots[prop]] = concat(props[prop]);\n }\n }); // Return a promise that resolves when hidden, or rejects on destroyed\n\n return new Promise(function (resolve, reject) {\n var resolved = false;\n msgBox.$once(HOOK_EVENT_NAME_DESTROYED, function () {\n if (!resolved) {\n /* istanbul ignore next */\n reject(new Error('BootstrapVue MsgBox destroyed before resolve'));\n }\n });\n msgBox.$on(EVENT_NAME_HIDE, function (bvModalEvent) {\n if (!bvModalEvent.defaultPrevented) {\n var result = resolver(bvModalEvent); // If resolver didn't cancel hide, we resolve\n\n if (!bvModalEvent.defaultPrevented) {\n resolved = true;\n resolve(result);\n }\n }\n }); // Create a mount point (a DIV) and mount the msgBo which will trigger it to show\n\n var div = document.createElement('div');\n document.body.appendChild(div);\n msgBox.$mount(div);\n });\n }; // Private utility method to open a user defined message box and returns a promise.\n // Not to be used directly by consumers, as this method may change calling syntax\n\n\n var makeMsgBox = function makeMsgBox(parent, content) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var resolver = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n\n if (!content || warnNoPromiseSupport(PROP_NAME) || warnNotClient(PROP_NAME) || !isFunction(resolver)) {\n /* istanbul ignore next */\n return;\n }\n\n return asyncMsgBox(parent, _objectSpread(_objectSpread({}, filterOptions(options)), {}, {\n msgBoxContent: content\n }), resolver);\n }; // BvModal instance class\n\n\n var BvModal = /*#__PURE__*/function () {\n function BvModal(vm) {\n _classCallCheck(this, BvModal);\n\n // Assign the new properties to this instance\n assign(this, {\n _vm: vm,\n _root: getEventRoot(vm)\n }); // Set these properties as read-only and non-enumerable\n\n defineProperties(this, {\n _vm: readonlyDescriptor(),\n _root: readonlyDescriptor()\n });\n } // --- Instance methods ---\n // Show modal with the specified ID args are for future use\n\n\n _createClass(BvModal, [{\n key: \"show\",\n value: function show(id) {\n if (id && this._root) {\n var _this$_root;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n (_this$_root = this._root).$emit.apply(_this$_root, [getRootActionEventName(NAME_MODAL, 'show'), id].concat(args));\n }\n } // Hide modal with the specified ID args are for future use\n\n }, {\n key: \"hide\",\n value: function hide(id) {\n if (id && this._root) {\n var _this$_root2;\n\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n (_this$_root2 = this._root).$emit.apply(_this$_root2, [getRootActionEventName(NAME_MODAL, 'hide'), id].concat(args));\n }\n } // The following methods require Promise support!\n // IE 11 and others do not support Promise natively, so users\n // should have a Polyfill loaded (which they need anyways for IE 11 support)\n // Open a message box with OK button only and returns a promise\n\n }, {\n key: \"msgBoxOk\",\n value: function msgBoxOk(message) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // Pick the modal props we support from options\n var props = _objectSpread(_objectSpread({}, options), {}, {\n // Add in overrides and our content prop\n okOnly: true,\n okDisabled: false,\n hideFooter: false,\n msgBoxContent: message\n });\n\n return makeMsgBox(this._vm, message, props, function () {\n // Always resolve to true for OK\n return true;\n });\n } // Open a message box modal with OK and CANCEL buttons\n // and returns a promise\n\n }, {\n key: \"msgBoxConfirm\",\n value: function msgBoxConfirm(message) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // Set the modal props we support from options\n var props = _objectSpread(_objectSpread({}, options), {}, {\n // Add in overrides and our content prop\n okOnly: false,\n okDisabled: false,\n cancelDisabled: false,\n hideFooter: false\n });\n\n return makeMsgBox(this._vm, message, props, function (bvModalEvent) {\n var trigger = bvModalEvent.trigger;\n return trigger === 'ok' ? true : trigger === 'cancel' ? false : null;\n });\n }\n }]);\n\n return BvModal;\n }(); // Add our instance mixin\n\n\n Vue.mixin({\n beforeCreate: function beforeCreate() {\n // Because we need access to `$root` for `$emits`, and VM for parenting,\n // we have to create a fresh instance of `BvModal` for each VM\n this[PROP_NAME_PRIV] = new BvModal(this);\n }\n }); // Define our read-only `$bvModal` instance property\n // Placed in an if just in case in HMR mode\n\n if (!hasOwnProperty(Vue.prototype, PROP_NAME)) {\n defineProperty(Vue.prototype, PROP_NAME, {\n get: function get() {\n /* istanbul ignore next */\n if (!this || !this[PROP_NAME_PRIV]) {\n warn(\"\\\"\".concat(PROP_NAME, \"\\\" must be accessed from a Vue instance \\\"this\\\" context.\"), NAME_MODAL);\n }\n\n return this[PROP_NAME_PRIV];\n }\n });\n }\n};\n\nexport var BVModalPlugin = /*#__PURE__*/pluginFactory({\n plugins: {\n plugin: plugin\n }\n});","import { BModal } from './modal';\nimport { VBModal } from '../../directives/modal/modal';\nimport { BVModalPlugin } from './helpers/bv-modal';\nimport { pluginFactory } from '../../utils/plugins';\nvar ModalPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BModal: BModal\n },\n directives: {\n VBModal: VBModal\n },\n // $bvModal injection\n plugins: {\n BVModalPlugin: BVModalPlugin\n }\n});\nexport { ModalPlugin, BModal };","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_NAV } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props'; // --- Helper methods ---\n\nvar computeJustifyContent = function computeJustifyContent(value) {\n value = value === 'left' ? 'start' : value === 'right' ? 'end' : value;\n return \"justify-content-\".concat(value);\n}; // --- Props ---\n\n\nexport var props = makePropsConfigurable({\n align: makeProp(PROP_TYPE_STRING),\n // Set to `true` if placing in a card header\n cardHeader: makeProp(PROP_TYPE_BOOLEAN, false),\n fill: makeProp(PROP_TYPE_BOOLEAN, false),\n justified: makeProp(PROP_TYPE_BOOLEAN, false),\n pills: makeProp(PROP_TYPE_BOOLEAN, false),\n small: makeProp(PROP_TYPE_BOOLEAN, false),\n tabs: makeProp(PROP_TYPE_BOOLEAN, false),\n tag: makeProp(PROP_TYPE_STRING, 'ul'),\n vertical: makeProp(PROP_TYPE_BOOLEAN, false)\n}, NAME_NAV); // --- Main component ---\n// @vue/component\n\nexport var BNav = /*#__PURE__*/extend({\n name: NAME_NAV,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class;\n\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var tabs = props.tabs,\n pills = props.pills,\n vertical = props.vertical,\n align = props.align,\n cardHeader = props.cardHeader;\n return h(props.tag, mergeData(data, {\n staticClass: 'nav',\n class: (_class = {\n 'nav-tabs': tabs,\n 'nav-pills': pills && !tabs,\n 'card-header-tabs': !vertical && cardHeader && tabs,\n 'card-header-pills': !vertical && cardHeader && pills && !tabs,\n 'flex-column': vertical,\n 'nav-fill': !vertical && props.fill,\n 'nav-justified': !vertical && props.justified\n }, _defineProperty(_class, computeJustifyContent(align), !vertical && align), _defineProperty(_class, \"small\", props.small), _class)\n }), children);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_NAV_ITEM } from '../../constants/components';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_OBJECT } from '../../constants/props';\nimport { omit, sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props';\nimport { BLink, props as BLinkProps } from '../link/link'; // --- Props ---\n\nvar linkProps = omit(BLinkProps, ['event', 'routerTag']);\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, linkProps), {}, {\n linkAttrs: makeProp(PROP_TYPE_OBJECT, {}),\n linkClasses: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)\n})), NAME_NAV_ITEM); // --- Main component ---\n// @vue/component\n\nexport var BNavItem = /*#__PURE__*/extend({\n name: NAME_NAV_ITEM,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n listeners = _ref.listeners,\n children = _ref.children;\n return h('li', mergeData(omit(data, ['on']), {\n staticClass: 'nav-item'\n }), [h(BLink, {\n staticClass: 'nav-link',\n class: props.linkClasses,\n attrs: props.linkAttrs,\n props: pluckProps(linkProps, props),\n on: listeners\n }, children)]);\n }\n});","import { extend, mergeData } from '../../vue';\nimport { NAME_NAV_TEXT } from '../../constants/components'; // --- Props ---\n\nexport var props = {}; // --- Main component ---\n// @vue/component\n\nexport var BNavText = /*#__PURE__*/extend({\n name: NAME_NAV_TEXT,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var data = _ref.data,\n children = _ref.children;\n return h('li', mergeData(data, {\n staticClass: 'navbar-text'\n }), children);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_NAV_FORM } from '../../constants/components';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING } from '../../constants/props';\nimport { omit, sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props';\nimport { BForm, props as BFormProps } from '../form/form'; // --- Props ---\n\nvar formProps = omit(BFormProps, ['inline']);\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, formProps), {}, {\n formClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)\n})), NAME_NAV_FORM); // --- Main component ---\n// @vue/component\n\nexport var BNavForm = /*#__PURE__*/extend({\n name: NAME_NAV_FORM,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children,\n listeners = _ref.listeners;\n var $form = h(BForm, {\n class: props.formClass,\n props: _objectSpread(_objectSpread({}, pluckProps(formProps, props)), {}, {\n inline: true\n }),\n attrs: data.attrs,\n on: listeners\n }, children);\n return h('li', mergeData(omit(data, ['attrs', 'on']), {\n staticClass: 'form-inline'\n }), [$form]);\n }\n});","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_NAV_ITEM_DROPDOWN } from '../../constants/components';\nimport { SLOT_NAME_BUTTON_CONTENT, SLOT_NAME_DEFAULT, SLOT_NAME_TEXT } from '../../constants/slots';\nimport { htmlOrText } from '../../utils/html';\nimport { keys, pick, sortKeys } from '../../utils/object';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { dropdownMixin, props as dropdownProps } from '../../mixins/dropdown';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { props as BDropdownProps } from '../dropdown/dropdown';\nimport { BLink } from '../link/link'; // --- Props ---\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, idProps), pick(BDropdownProps, [].concat(_toConsumableArray(keys(dropdownProps)), ['html', 'lazy', 'menuClass', 'noCaret', 'role', 'text', 'toggleClass'])))), NAME_NAV_ITEM_DROPDOWN); // --- Main component ---\n// @vue/component\n\nexport var BNavItemDropdown = /*#__PURE__*/extend({\n name: NAME_NAV_ITEM_DROPDOWN,\n mixins: [idMixin, dropdownMixin, normalizeSlotMixin],\n props: props,\n computed: {\n toggleId: function toggleId() {\n return this.safeId('_BV_toggle_');\n },\n menuId: function menuId() {\n return this.safeId('_BV_toggle_menu_');\n },\n dropdownClasses: function dropdownClasses() {\n return [this.directionClass, this.boundaryClass, {\n show: this.visible\n }];\n },\n menuClasses: function menuClasses() {\n return [this.menuClass, {\n 'dropdown-menu-right': this.right,\n show: this.visible\n }];\n },\n toggleClasses: function toggleClasses() {\n return [this.toggleClass, {\n 'dropdown-toggle-no-caret': this.noCaret\n }];\n }\n },\n render: function render(h) {\n var toggleId = this.toggleId,\n menuId = this.menuId,\n visible = this.visible,\n hide = this.hide;\n var $toggle = h(BLink, {\n staticClass: 'nav-link dropdown-toggle',\n class: this.toggleClasses,\n props: {\n href: \"#\".concat(this.id || ''),\n disabled: this.disabled\n },\n attrs: {\n id: toggleId,\n role: 'button',\n 'aria-haspopup': 'true',\n 'aria-expanded': visible ? 'true' : 'false',\n 'aria-controls': menuId\n },\n on: {\n mousedown: this.onMousedown,\n click: this.toggle,\n keydown: this.toggle // Handle ENTER, SPACE and DOWN\n\n },\n ref: 'toggle'\n }, [// TODO: The `text` slot is deprecated in favor of the `button-content` slot\n this.normalizeSlot([SLOT_NAME_BUTTON_CONTENT, SLOT_NAME_TEXT]) || h('span', {\n domProps: htmlOrText(this.html, this.text)\n })]);\n var $menu = h('ul', {\n staticClass: 'dropdown-menu',\n class: this.menuClasses,\n attrs: {\n tabindex: '-1',\n 'aria-labelledby': toggleId,\n id: menuId\n },\n on: {\n keydown: this.onKeydown // Handle UP, DOWN and ESC\n\n },\n ref: 'menu'\n }, !this.lazy || visible ? this.normalizeSlot(SLOT_NAME_DEFAULT, {\n hide: hide\n }) : [h()]);\n return h('li', {\n staticClass: 'nav-item b-nav-dropdown dropdown',\n class: this.dropdownClasses,\n attrs: {\n id: this.safeId()\n }\n }, [$toggle, $menu]);\n }\n});","import { BNav } from './nav';\nimport { BNavItem } from './nav-item';\nimport { BNavText } from './nav-text';\nimport { BNavForm } from './nav-form';\nimport { BNavItemDropdown } from './nav-item-dropdown';\nimport { DropdownPlugin } from '../dropdown';\nimport { pluginFactory } from '../../utils/plugins';\nvar NavPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BNav: BNav,\n BNavItem: BNavItem,\n BNavText: BNavText,\n BNavForm: BNavForm,\n BNavItemDropdown: BNavItemDropdown,\n BNavItemDd: BNavItemDropdown,\n BNavDropdown: BNavItemDropdown,\n BNavDd: BNavItemDropdown\n },\n plugins: {\n DropdownPlugin: DropdownPlugin\n }\n});\nexport { NavPlugin, BNav, BNavItem, BNavText, BNavForm, BNavItemDropdown };","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_NAVBAR } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_BOOLEAN_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { getBreakpoints } from '../../utils/config';\nimport { isTag } from '../../utils/dom';\nimport { isString } from '../../utils/inspect';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n fixed: makeProp(PROP_TYPE_STRING),\n print: makeProp(PROP_TYPE_BOOLEAN, false),\n sticky: makeProp(PROP_TYPE_BOOLEAN, false),\n tag: makeProp(PROP_TYPE_STRING, 'nav'),\n toggleable: makeProp(PROP_TYPE_BOOLEAN_STRING, false),\n type: makeProp(PROP_TYPE_STRING, 'light'),\n variant: makeProp(PROP_TYPE_STRING)\n}, NAME_NAVBAR); // --- Main component ---\n// @vue/component\n\nexport var BNavbar = /*#__PURE__*/extend({\n name: NAME_NAVBAR,\n mixins: [normalizeSlotMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvNavbar: function getBvNavbar() {\n return _this;\n }\n };\n },\n props: props,\n computed: {\n breakpointClass: function breakpointClass() {\n var toggleable = this.toggleable;\n var xs = getBreakpoints()[0];\n var breakpoint = null;\n\n if (toggleable && isString(toggleable) && toggleable !== xs) {\n breakpoint = \"navbar-expand-\".concat(toggleable);\n } else if (toggleable === false) {\n breakpoint = 'navbar-expand';\n }\n\n return breakpoint;\n }\n },\n render: function render(h) {\n var _ref;\n\n var tag = this.tag,\n type = this.type,\n variant = this.variant,\n fixed = this.fixed;\n return h(tag, {\n staticClass: 'navbar',\n class: [(_ref = {\n 'd-print': this.print,\n 'sticky-top': this.sticky\n }, _defineProperty(_ref, \"navbar-\".concat(type), type), _defineProperty(_ref, \"bg-\".concat(variant), variant), _defineProperty(_ref, \"fixed-\".concat(fixed), fixed), _ref), this.breakpointClass],\n attrs: {\n role: isTag(tag, 'nav') ? null : 'navigation'\n }\n }, [this.normalizeSlot()]);\n }\n});","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_NAVBAR_NAV } from '../../constants/components';\nimport { pick } from '../../utils/object';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { props as BNavProps } from '../nav/nav'; // --- Helper methods ---\n\nvar computeJustifyContent = function computeJustifyContent(value) {\n value = value === 'left' ? 'start' : value === 'right' ? 'end' : value;\n return \"justify-content-\".concat(value);\n}; // --- Props ---\n\n\nexport var props = makePropsConfigurable(pick(BNavProps, ['tag', 'fill', 'justified', 'align', 'small']), NAME_NAVBAR_NAV); // --- Main component ---\n// @vue/component\n\nexport var BNavbarNav = /*#__PURE__*/extend({\n name: NAME_NAVBAR_NAV,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class;\n\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var align = props.align;\n return h(props.tag, mergeData(data, {\n staticClass: 'navbar-nav',\n class: (_class = {\n 'nav-fill': props.fill,\n 'nav-justified': props.justified\n }, _defineProperty(_class, computeJustifyContent(align), align), _defineProperty(_class, \"small\", props.small), _class)\n }), children);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_NAVBAR_BRAND } from '../../constants/components';\nimport { PROP_TYPE_STRING } from '../../constants/props';\nimport { omit, sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props';\nimport { BLink, props as BLinkProps } from '../link/link'; // --- Props ---\n\nvar linkProps = omit(BLinkProps, ['event', 'routerTag']);\nlinkProps.href.default = undefined;\nlinkProps.to.default = undefined;\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, linkProps), {}, {\n tag: makeProp(PROP_TYPE_STRING, 'div')\n})), NAME_NAVBAR_BRAND); // --- Main component ---\n// @vue/component\n\nexport var BNavbarBrand = /*#__PURE__*/extend({\n name: NAME_NAVBAR_BRAND,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var isLink = props.to || props.href;\n var tag = isLink ? BLink : props.tag;\n return h(tag, mergeData(data, {\n staticClass: 'navbar-brand',\n props: isLink ? pluckProps(linkProps, props) : {}\n }), children);\n }\n});","import { extend } from '../../vue';\nimport { NAME_COLLAPSE, NAME_NAVBAR_TOGGLE } from '../../constants/components';\nimport { EVENT_NAME_CLICK } from '../../constants/events';\nimport { PROP_TYPE_ARRAY_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_DEFAULT } from '../../constants/slots';\nimport { getRootEventName } from '../../utils/events';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { listenOnRootMixin } from '../../mixins/listen-on-root';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { VBToggle } from '../../directives/toggle/toggle'; // --- Constants ---\n\nvar CLASS_NAME = 'navbar-toggler';\nvar ROOT_EVENT_NAME_STATE = getRootEventName(NAME_COLLAPSE, 'state');\nvar ROOT_EVENT_NAME_SYNC_STATE = getRootEventName(NAME_COLLAPSE, 'sync-state'); // --- Props ---\n\nexport var props = makePropsConfigurable({\n disabled: makeProp(PROP_TYPE_BOOLEAN, false),\n label: makeProp(PROP_TYPE_STRING, 'Toggle navigation'),\n target: makeProp(PROP_TYPE_ARRAY_STRING, undefined, true) // Required\n\n}, NAME_NAVBAR_TOGGLE); // --- Main component ---\n// @vue/component\n\nexport var BNavbarToggle = /*#__PURE__*/extend({\n name: NAME_NAVBAR_TOGGLE,\n directives: {\n VBToggle: VBToggle\n },\n mixins: [listenOnRootMixin, normalizeSlotMixin],\n props: props,\n data: function data() {\n return {\n toggleState: false\n };\n },\n created: function created() {\n this.listenOnRoot(ROOT_EVENT_NAME_STATE, this.handleStateEvent);\n this.listenOnRoot(ROOT_EVENT_NAME_SYNC_STATE, this.handleStateEvent);\n },\n methods: {\n onClick: function onClick(event) {\n if (!this.disabled) {\n // Emit courtesy `click` event\n this.$emit(EVENT_NAME_CLICK, event);\n }\n },\n handleStateEvent: function handleStateEvent(id, state) {\n // We listen for state events so that we can pass the\n // boolean expanded state to the default scoped slot\n if (id === this.target) {\n this.toggleState = state;\n }\n }\n },\n render: function render(h) {\n var disabled = this.disabled;\n return h('button', {\n staticClass: CLASS_NAME,\n class: {\n disabled: disabled\n },\n directives: [{\n name: 'VBToggle',\n value: this.target\n }],\n attrs: {\n type: 'button',\n disabled: disabled,\n 'aria-label': this.label\n },\n on: {\n click: this.onClick\n }\n }, [this.normalizeSlot(SLOT_NAME_DEFAULT, {\n expanded: this.toggleState\n }) || h('span', {\n staticClass: \"\".concat(CLASS_NAME, \"-icon\")\n })]);\n }\n});","import { BNavbar } from './navbar';\nimport { BNavbarNav } from './navbar-nav';\nimport { BNavbarBrand } from './navbar-brand';\nimport { BNavbarToggle } from './navbar-toggle';\nimport { NavPlugin } from '../nav';\nimport { CollapsePlugin } from '../collapse';\nimport { DropdownPlugin } from '../dropdown';\nimport { pluginFactory } from '../../utils/plugins';\nvar NavbarPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BNavbar: BNavbar,\n BNavbarNav: BNavbarNav,\n BNavbarBrand: BNavbarBrand,\n BNavbarToggle: BNavbarToggle,\n BNavToggle: BNavbarToggle\n },\n plugins: {\n NavPlugin: NavPlugin,\n CollapsePlugin: CollapsePlugin,\n DropdownPlugin: DropdownPlugin\n }\n});\nexport { NavbarPlugin, BNavbar, BNavbarNav, BNavbarBrand, BNavbarToggle };","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_SPINNER } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_LABEL } from '../../constants/slots';\nimport { normalizeSlot } from '../../utils/normalize-slot';\nimport { makeProp, makePropsConfigurable } from '../../utils/props'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n label: makeProp(PROP_TYPE_STRING),\n role: makeProp(PROP_TYPE_STRING, 'status'),\n small: makeProp(PROP_TYPE_BOOLEAN, false),\n tag: makeProp(PROP_TYPE_STRING, 'span'),\n type: makeProp(PROP_TYPE_STRING, 'border'),\n variant: makeProp(PROP_TYPE_STRING)\n}, NAME_SPINNER); // --- Main component ---\n// @vue/component\n\nexport var BSpinner = /*#__PURE__*/extend({\n name: NAME_SPINNER,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class;\n\n var props = _ref.props,\n data = _ref.data,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots;\n var $slots = slots();\n var $scopedSlots = scopedSlots || {};\n var $label = normalizeSlot(SLOT_NAME_LABEL, {}, $scopedSlots, $slots) || props.label;\n\n if ($label) {\n $label = h('span', {\n staticClass: 'sr-only'\n }, $label);\n }\n\n return h(props.tag, mergeData(data, {\n attrs: {\n role: $label ? props.role || 'status' : null,\n 'aria-hidden': $label ? null : 'true'\n },\n class: (_class = {}, _defineProperty(_class, \"spinner-\".concat(props.type), props.type), _defineProperty(_class, \"spinner-\".concat(props.type, \"-sm\"), props.small), _defineProperty(_class, \"text-\".concat(props.variant), props.variant), _class)\n }), [$label || h()]);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_OVERLAY } from '../../constants/components';\nimport { EVENT_NAME_CLICK, EVENT_NAME_HIDDEN, EVENT_NAME_SHOWN } from '../../constants/events';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_BOOLEAN_STRING, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_OVERLAY } from '../../constants/slots';\nimport { toFloat } from '../../utils/number';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { BSpinner } from '../spinner/spinner';\nimport { BVTransition } from '../transition/bv-transition'; // --- Constants ---\n\nvar POSITION_COVER = {\n top: 0,\n left: 0,\n bottom: 0,\n right: 0\n}; // --- Props ---\n\nexport var props = makePropsConfigurable({\n // Alternative to variant, allowing a specific\n // CSS color to be applied to the overlay\n bgColor: makeProp(PROP_TYPE_STRING),\n blur: makeProp(PROP_TYPE_STRING, '2px'),\n fixed: makeProp(PROP_TYPE_BOOLEAN, false),\n noCenter: makeProp(PROP_TYPE_BOOLEAN, false),\n noFade: makeProp(PROP_TYPE_BOOLEAN, false),\n // If `true, does not render the default slot\n // and switches to absolute positioning\n noWrap: makeProp(PROP_TYPE_BOOLEAN, false),\n opacity: makeProp(PROP_TYPE_NUMBER_STRING, 0.85, function (value) {\n var number = toFloat(value, 0);\n return number >= 0 && number <= 1;\n }),\n overlayTag: makeProp(PROP_TYPE_STRING, 'div'),\n rounded: makeProp(PROP_TYPE_BOOLEAN_STRING, false),\n show: makeProp(PROP_TYPE_BOOLEAN, false),\n spinnerSmall: makeProp(PROP_TYPE_BOOLEAN, false),\n spinnerType: makeProp(PROP_TYPE_STRING, 'border'),\n spinnerVariant: makeProp(PROP_TYPE_STRING),\n variant: makeProp(PROP_TYPE_STRING, 'light'),\n wrapTag: makeProp(PROP_TYPE_STRING, 'div'),\n zIndex: makeProp(PROP_TYPE_NUMBER_STRING, 10)\n}, NAME_OVERLAY); // --- Main component ---\n// @vue/component\n\nexport var BOverlay = /*#__PURE__*/extend({\n name: NAME_OVERLAY,\n mixins: [normalizeSlotMixin],\n props: props,\n computed: {\n computedRounded: function computedRounded() {\n var rounded = this.rounded;\n return rounded === true || rounded === '' ? 'rounded' : !rounded ? '' : \"rounded-\".concat(rounded);\n },\n computedVariant: function computedVariant() {\n var variant = this.variant;\n return variant && !this.bgColor ? \"bg-\".concat(variant) : '';\n },\n slotScope: function slotScope() {\n return {\n spinnerType: this.spinnerType || null,\n spinnerVariant: this.spinnerVariant || null,\n spinnerSmall: this.spinnerSmall\n };\n }\n },\n methods: {\n defaultOverlayFn: function defaultOverlayFn(_ref) {\n var spinnerType = _ref.spinnerType,\n spinnerVariant = _ref.spinnerVariant,\n spinnerSmall = _ref.spinnerSmall;\n return this.$createElement(BSpinner, {\n props: {\n type: spinnerType,\n variant: spinnerVariant,\n small: spinnerSmall\n }\n });\n }\n },\n render: function render(h) {\n var _this = this;\n\n var show = this.show,\n fixed = this.fixed,\n noFade = this.noFade,\n noWrap = this.noWrap,\n slotScope = this.slotScope;\n var $overlay = h();\n\n if (show) {\n var $background = h('div', {\n staticClass: 'position-absolute',\n class: [this.computedVariant, this.computedRounded],\n style: _objectSpread(_objectSpread({}, POSITION_COVER), {}, {\n opacity: this.opacity,\n backgroundColor: this.bgColor || null,\n backdropFilter: this.blur ? \"blur(\".concat(this.blur, \")\") : null\n })\n });\n var $content = h('div', {\n staticClass: 'position-absolute',\n style: this.noCenter ?\n /* istanbul ignore next */\n _objectSpread({}, POSITION_COVER) : {\n top: '50%',\n left: '50%',\n transform: 'translateX(-50%) translateY(-50%)'\n }\n }, [this.normalizeSlot(SLOT_NAME_OVERLAY, slotScope) || this.defaultOverlayFn(slotScope)]);\n $overlay = h(this.overlayTag, {\n staticClass: 'b-overlay',\n class: {\n 'position-absolute': !noWrap || noWrap && !fixed,\n 'position-fixed': noWrap && fixed\n },\n style: _objectSpread(_objectSpread({}, POSITION_COVER), {}, {\n zIndex: this.zIndex || 10\n }),\n on: {\n click: function click(event) {\n return _this.$emit(EVENT_NAME_CLICK, event);\n }\n },\n key: 'overlay'\n }, [$background, $content]);\n } // Wrap in a fade transition\n\n\n $overlay = h(BVTransition, {\n props: {\n noFade: noFade,\n appear: true\n },\n on: {\n 'after-enter': function afterEnter() {\n return _this.$emit(EVENT_NAME_SHOWN);\n },\n 'after-leave': function afterLeave() {\n return _this.$emit(EVENT_NAME_HIDDEN);\n }\n }\n }, [$overlay]);\n\n if (noWrap) {\n return $overlay;\n }\n\n return h(this.wrapTag, {\n staticClass: 'b-overlay-wrap position-relative',\n attrs: {\n 'aria-busy': show ? 'true' : null\n }\n }, noWrap ? [$overlay] : [this.normalizeSlot(), $overlay]);\n }\n});","var _watch;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../vue';\nimport { NAME_PAGINATION } from '../constants/components';\nimport { CODE_DOWN, CODE_LEFT, CODE_RIGHT, CODE_SPACE, CODE_UP } from '../constants/key-codes';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_BOOLEAN_NUMBER_STRING, PROP_TYPE_FUNCTION_STRING, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../constants/props';\nimport { SLOT_NAME_ELLIPSIS_TEXT, SLOT_NAME_FIRST_TEXT, SLOT_NAME_LAST_TEXT, SLOT_NAME_NEXT_TEXT, SLOT_NAME_PAGE, SLOT_NAME_PREV_TEXT } from '../constants/slots';\nimport { createArray } from '../utils/array';\nimport { attemptFocus, getActiveElement, getAttr, isDisabled, isVisible, selectAll } from '../utils/dom';\nimport { stopEvent } from '../utils/events';\nimport { isFunction, isNull } from '../utils/inspect';\nimport { mathFloor, mathMax, mathMin } from '../utils/math';\nimport { makeModelMixin } from '../utils/model';\nimport { toInteger } from '../utils/number';\nimport { sortKeys } from '../utils/object';\nimport { hasPropFunction, makeProp, makePropsConfigurable } from '../utils/props';\nimport { safeVueInstance } from '../utils/safe-vue-instance';\nimport { toString } from '../utils/string';\nimport { warn } from '../utils/warn';\nimport { normalizeSlotMixin } from '../mixins/normalize-slot';\nimport { BLink } from '../components/link/link'; // Common props, computed, data, render function, and methods\n// for `
` and ``\n// --- Constants ---\n\nvar _makeModelMixin = makeModelMixin('value', {\n type: PROP_TYPE_BOOLEAN_NUMBER_STRING,\n defaultValue: null,\n\n /* istanbul ignore next */\n validator: function validator(value) {\n if (!isNull(value) && toInteger(value, 0) < 1) {\n warn('\"v-model\" value must be a number greater than \"0\"', NAME_PAGINATION);\n return false;\n }\n\n return true;\n }\n}),\n modelMixin = _makeModelMixin.mixin,\n modelProps = _makeModelMixin.props,\n MODEL_PROP_NAME = _makeModelMixin.prop,\n MODEL_EVENT_NAME = _makeModelMixin.event;\n\nexport { MODEL_PROP_NAME, MODEL_EVENT_NAME }; // Threshold of limit size when we start/stop showing ellipsis\n\nvar ELLIPSIS_THRESHOLD = 3; // Default # of buttons limit\n\nvar DEFAULT_LIMIT = 5; // --- Helper methods ---\n// Make an array of N to N+X\n\nvar makePageArray = function makePageArray(startNumber, numberOfPages) {\n return createArray(numberOfPages, function (_, i) {\n return {\n number: startNumber + i,\n classes: null\n };\n });\n}; // Sanitize the provided limit value (converting to a number)\n\n\nvar sanitizeLimit = function sanitizeLimit(value) {\n var limit = toInteger(value) || 1;\n return limit < 1 ? DEFAULT_LIMIT : limit;\n}; // Sanitize the provided current page number (converting to a number)\n\n\nvar sanitizeCurrentPage = function sanitizeCurrentPage(val, numberOfPages) {\n var page = toInteger(val) || 1;\n return page > numberOfPages ? numberOfPages : page < 1 ? 1 : page;\n}; // Links don't normally respond to SPACE, so we add that\n// functionality via this handler\n\n\nvar onSpaceKey = function onSpaceKey(event) {\n if (event.keyCode === CODE_SPACE) {\n // Stop page from scrolling\n stopEvent(event, {\n immediatePropagation: true\n }); // Trigger the click event on the link\n\n event.currentTarget.click();\n return false;\n }\n}; // --- Props ---\n\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, modelProps), {}, {\n align: makeProp(PROP_TYPE_STRING, 'left'),\n ariaLabel: makeProp(PROP_TYPE_STRING, 'Pagination'),\n disabled: makeProp(PROP_TYPE_BOOLEAN, false),\n ellipsisClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n ellipsisText: makeProp(PROP_TYPE_STRING, \"\\u2026\"),\n // '…'\n firstClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n firstNumber: makeProp(PROP_TYPE_BOOLEAN, false),\n firstText: makeProp(PROP_TYPE_STRING, \"\\xAB\"),\n // '«'\n hideEllipsis: makeProp(PROP_TYPE_BOOLEAN, false),\n hideGotoEndButtons: makeProp(PROP_TYPE_BOOLEAN, false),\n labelFirstPage: makeProp(PROP_TYPE_STRING, 'Go to first page'),\n labelLastPage: makeProp(PROP_TYPE_STRING, 'Go to last page'),\n labelNextPage: makeProp(PROP_TYPE_STRING, 'Go to next page'),\n labelPage: makeProp(PROP_TYPE_FUNCTION_STRING, 'Go to page'),\n labelPrevPage: makeProp(PROP_TYPE_STRING, 'Go to previous page'),\n lastClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n lastNumber: makeProp(PROP_TYPE_BOOLEAN, false),\n lastText: makeProp(PROP_TYPE_STRING, \"\\xBB\"),\n // '»'\n limit: makeProp(PROP_TYPE_NUMBER_STRING, DEFAULT_LIMIT,\n /* istanbul ignore next */\n function (value) {\n if (toInteger(value, 0) < 1) {\n warn('Prop \"limit\" must be a number greater than \"0\"', NAME_PAGINATION);\n return false;\n }\n\n return true;\n }),\n nextClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n nextText: makeProp(PROP_TYPE_STRING, \"\\u203A\"),\n // '›'\n pageClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n pills: makeProp(PROP_TYPE_BOOLEAN, false),\n prevClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n prevText: makeProp(PROP_TYPE_STRING, \"\\u2039\"),\n // '‹'\n size: makeProp(PROP_TYPE_STRING)\n})), 'pagination'); // --- Mixin ---\n// @vue/component\n\nexport var paginationMixin = extend({\n mixins: [modelMixin, normalizeSlotMixin],\n props: props,\n data: function data() {\n // `-1` signifies no page initially selected\n var currentPage = toInteger(this[MODEL_PROP_NAME], 0);\n currentPage = currentPage > 0 ? currentPage : -1;\n return {\n currentPage: currentPage,\n localNumberOfPages: 1,\n localLimit: DEFAULT_LIMIT\n };\n },\n computed: {\n btnSize: function btnSize() {\n var size = this.size;\n return size ? \"pagination-\".concat(size) : '';\n },\n alignment: function alignment() {\n var align = this.align;\n\n if (align === 'center') {\n return 'justify-content-center';\n } else if (align === 'end' || align === 'right') {\n return 'justify-content-end';\n } else if (align === 'fill') {\n // The page-items will also have 'flex-fill' added\n // We add text centering to make the button appearance better in fill mode\n return 'text-center';\n }\n\n return '';\n },\n styleClass: function styleClass() {\n return this.pills ? 'b-pagination-pills' : '';\n },\n computedCurrentPage: function computedCurrentPage() {\n return sanitizeCurrentPage(this.currentPage, this.localNumberOfPages);\n },\n paginationParams: function paginationParams() {\n // Determine if we should show the the ellipsis\n var limit = this.localLimit,\n numberOfPages = this.localNumberOfPages,\n currentPage = this.computedCurrentPage,\n hideEllipsis = this.hideEllipsis,\n firstNumber = this.firstNumber,\n lastNumber = this.lastNumber;\n var showFirstDots = false;\n var showLastDots = false;\n var numberOfLinks = limit;\n var startNumber = 1;\n\n if (numberOfPages <= limit) {\n // Special case: Less pages available than the limit of displayed pages\n numberOfLinks = numberOfPages;\n } else if (currentPage < limit - 1 && limit > ELLIPSIS_THRESHOLD) {\n if (!hideEllipsis || lastNumber) {\n showLastDots = true;\n numberOfLinks = limit - (firstNumber ? 0 : 1);\n }\n\n numberOfLinks = mathMin(numberOfLinks, limit);\n } else if (numberOfPages - currentPage + 2 < limit && limit > ELLIPSIS_THRESHOLD) {\n if (!hideEllipsis || firstNumber) {\n showFirstDots = true;\n numberOfLinks = limit - (lastNumber ? 0 : 1);\n }\n\n startNumber = numberOfPages - numberOfLinks + 1;\n } else {\n // We are somewhere in the middle of the page list\n if (limit > ELLIPSIS_THRESHOLD) {\n numberOfLinks = limit - (hideEllipsis ? 0 : 2);\n showFirstDots = !!(!hideEllipsis || firstNumber);\n showLastDots = !!(!hideEllipsis || lastNumber);\n }\n\n startNumber = currentPage - mathFloor(numberOfLinks / 2);\n } // Sanity checks\n\n /* istanbul ignore if */\n\n\n if (startNumber < 1) {\n startNumber = 1;\n showFirstDots = false;\n } else if (startNumber > numberOfPages - numberOfLinks) {\n startNumber = numberOfPages - numberOfLinks + 1;\n showLastDots = false;\n }\n\n if (showFirstDots && firstNumber && startNumber < 4) {\n numberOfLinks = numberOfLinks + 2;\n startNumber = 1;\n showFirstDots = false;\n }\n\n var lastPageNumber = startNumber + numberOfLinks - 1;\n\n if (showLastDots && lastNumber && lastPageNumber > numberOfPages - 3) {\n numberOfLinks = numberOfLinks + (lastPageNumber === numberOfPages - 2 ? 2 : 3);\n showLastDots = false;\n } // Special handling for lower limits (where ellipsis are never shown)\n\n\n if (limit <= ELLIPSIS_THRESHOLD) {\n if (firstNumber && startNumber === 1) {\n numberOfLinks = mathMin(numberOfLinks + 1, numberOfPages, limit + 1);\n } else if (lastNumber && numberOfPages === startNumber + numberOfLinks - 1) {\n startNumber = mathMax(startNumber - 1, 1);\n numberOfLinks = mathMin(numberOfPages - startNumber + 1, numberOfPages, limit + 1);\n }\n }\n\n numberOfLinks = mathMin(numberOfLinks, numberOfPages - startNumber + 1);\n return {\n showFirstDots: showFirstDots,\n showLastDots: showLastDots,\n numberOfLinks: numberOfLinks,\n startNumber: startNumber\n };\n },\n pageList: function pageList() {\n // Generates the pageList array\n var _this$paginationParam = this.paginationParams,\n numberOfLinks = _this$paginationParam.numberOfLinks,\n startNumber = _this$paginationParam.startNumber;\n var currentPage = this.computedCurrentPage; // Generate list of page numbers\n\n var pages = makePageArray(startNumber, numberOfLinks); // We limit to a total of 3 page buttons on XS screens\n // So add classes to page links to hide them for XS breakpoint\n // Note: Ellipsis will also be hidden on XS screens\n // TODO: Make this visual limit configurable based on breakpoint(s)\n\n if (pages.length > 3) {\n var idx = currentPage - startNumber; // THe following is a bootstrap-vue custom utility class\n\n var classes = 'bv-d-xs-down-none';\n\n if (idx === 0) {\n // Keep leftmost 3 buttons visible when current page is first page\n for (var i = 3; i < pages.length; i++) {\n pages[i].classes = classes;\n }\n } else if (idx === pages.length - 1) {\n // Keep rightmost 3 buttons visible when current page is last page\n for (var _i = 0; _i < pages.length - 3; _i++) {\n pages[_i].classes = classes;\n }\n } else {\n // Hide all except current page, current page - 1 and current page + 1\n for (var _i2 = 0; _i2 < idx - 1; _i2++) {\n // hide some left button(s)\n pages[_i2].classes = classes;\n }\n\n for (var _i3 = pages.length - 1; _i3 > idx + 1; _i3--) {\n // hide some right button(s)\n pages[_i3].classes = classes;\n }\n }\n }\n\n return pages;\n }\n },\n watch: (_watch = {}, _defineProperty(_watch, MODEL_PROP_NAME, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n this.currentPage = sanitizeCurrentPage(newValue, this.localNumberOfPages);\n }\n }), _defineProperty(_watch, \"currentPage\", function currentPage(newValue, oldValue) {\n if (newValue !== oldValue) {\n // Emit `null` if no page selected\n this.$emit(MODEL_EVENT_NAME, newValue > 0 ? newValue : null);\n }\n }), _defineProperty(_watch, \"limit\", function limit(newValue, oldValue) {\n if (newValue !== oldValue) {\n this.localLimit = sanitizeLimit(newValue);\n }\n }), _watch),\n created: function created() {\n var _this = this;\n\n // Set our default values in data\n this.localLimit = sanitizeLimit(this.limit);\n this.$nextTick(function () {\n // Sanity check\n _this.currentPage = _this.currentPage > _this.localNumberOfPages ? _this.localNumberOfPages : _this.currentPage;\n });\n },\n methods: {\n handleKeyNav: function handleKeyNav(event) {\n var keyCode = event.keyCode,\n shiftKey = event.shiftKey;\n /* istanbul ignore if */\n\n if (this.isNav) {\n // We disable left/right keyboard navigation in ``\n return;\n }\n\n if (keyCode === CODE_LEFT || keyCode === CODE_UP) {\n stopEvent(event, {\n propagation: false\n });\n shiftKey ? this.focusFirst() : this.focusPrev();\n } else if (keyCode === CODE_RIGHT || keyCode === CODE_DOWN) {\n stopEvent(event, {\n propagation: false\n });\n shiftKey ? this.focusLast() : this.focusNext();\n }\n },\n getButtons: function getButtons() {\n // Return only buttons that are visible\n return selectAll('button.page-link, a.page-link', this.$el).filter(function (btn) {\n return isVisible(btn);\n });\n },\n focusCurrent: function focusCurrent() {\n var _this2 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var btn = _this2.getButtons().find(function (el) {\n return toInteger(getAttr(el, 'aria-posinset'), 0) === _this2.computedCurrentPage;\n });\n\n if (!attemptFocus(btn)) {\n // Fallback if current page is not in button list\n _this2.focusFirst();\n }\n });\n },\n focusFirst: function focusFirst() {\n var _this3 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var btn = _this3.getButtons().find(function (el) {\n return !isDisabled(el);\n });\n\n attemptFocus(btn);\n });\n },\n focusLast: function focusLast() {\n var _this4 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var btn = _this4.getButtons().reverse().find(function (el) {\n return !isDisabled(el);\n });\n\n attemptFocus(btn);\n });\n },\n focusPrev: function focusPrev() {\n var _this5 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var buttons = _this5.getButtons();\n\n var index = buttons.indexOf(getActiveElement());\n\n if (index > 0 && !isDisabled(buttons[index - 1])) {\n attemptFocus(buttons[index - 1]);\n }\n });\n },\n focusNext: function focusNext() {\n var _this6 = this;\n\n // We do this in `$nextTick()` to ensure buttons have finished rendering\n this.$nextTick(function () {\n var buttons = _this6.getButtons();\n\n var index = buttons.indexOf(getActiveElement());\n\n if (index < buttons.length - 1 && !isDisabled(buttons[index + 1])) {\n attemptFocus(buttons[index + 1]);\n }\n });\n }\n },\n render: function render(h) {\n var _this7 = this;\n\n var _safeVueInstance = safeVueInstance(this),\n disabled = _safeVueInstance.disabled,\n labelPage = _safeVueInstance.labelPage,\n ariaLabel = _safeVueInstance.ariaLabel,\n isNav = _safeVueInstance.isNav,\n numberOfPages = _safeVueInstance.localNumberOfPages,\n currentPage = _safeVueInstance.computedCurrentPage;\n\n var pageNumbers = this.pageList.map(function (p) {\n return p.number;\n });\n var _this$paginationParam2 = this.paginationParams,\n showFirstDots = _this$paginationParam2.showFirstDots,\n showLastDots = _this$paginationParam2.showLastDots;\n var fill = this.align === 'fill';\n var $buttons = []; // Helper function and flag\n\n var isActivePage = function isActivePage(pageNumber) {\n return pageNumber === currentPage;\n };\n\n var noCurrentPage = this.currentPage < 1; // Factory function for prev/next/first/last buttons\n\n var makeEndBtn = function makeEndBtn(linkTo, ariaLabel, btnSlot, btnText, btnClass, pageTest, key) {\n var isDisabled = disabled || isActivePage(pageTest) || noCurrentPage || linkTo < 1 || linkTo > numberOfPages;\n var pageNumber = linkTo < 1 ? 1 : linkTo > numberOfPages ? numberOfPages : linkTo;\n var scope = {\n disabled: isDisabled,\n page: pageNumber,\n index: pageNumber - 1\n };\n var $btnContent = _this7.normalizeSlot(btnSlot, scope) || toString(btnText) || h();\n var $inner = h(isDisabled ? 'span' : isNav ? BLink : 'button', {\n staticClass: 'page-link',\n class: {\n 'flex-grow-1': !isNav && !isDisabled && fill\n },\n props: isDisabled || !isNav ? {} : _this7.linkProps(linkTo),\n attrs: {\n role: isNav ? null : 'menuitem',\n type: isNav || isDisabled ? null : 'button',\n tabindex: isDisabled || isNav ? null : '-1',\n 'aria-label': ariaLabel,\n 'aria-controls': safeVueInstance(_this7).ariaControls || null,\n 'aria-disabled': isDisabled ? 'true' : null\n },\n on: isDisabled ? {} : {\n '!click': function click(event) {\n _this7.onClick(event, linkTo);\n },\n keydown: onSpaceKey\n }\n }, [$btnContent]);\n return h('li', {\n key: key,\n staticClass: 'page-item',\n class: [{\n disabled: isDisabled,\n 'flex-fill': fill,\n 'd-flex': fill && !isNav && !isDisabled\n }, btnClass],\n attrs: {\n role: isNav ? null : 'presentation',\n 'aria-hidden': isDisabled ? 'true' : null\n }\n }, [$inner]);\n }; // Ellipsis factory\n\n\n var makeEllipsis = function makeEllipsis(isLast) {\n return h('li', {\n staticClass: 'page-item',\n class: ['disabled', 'bv-d-xs-down-none', fill ? 'flex-fill' : '', _this7.ellipsisClass],\n attrs: {\n role: 'separator'\n },\n key: \"ellipsis-\".concat(isLast ? 'last' : 'first')\n }, [h('span', {\n staticClass: 'page-link'\n }, [_this7.normalizeSlot(SLOT_NAME_ELLIPSIS_TEXT) || toString(_this7.ellipsisText) || h()])]);\n }; // Page button factory\n\n\n var makePageButton = function makePageButton(page, idx) {\n var pageNumber = page.number;\n var active = isActivePage(pageNumber) && !noCurrentPage; // Active page will have tabindex of 0, or if no current page and first page button\n\n var tabIndex = disabled ? null : active || noCurrentPage && idx === 0 ? '0' : '-1';\n var attrs = {\n role: isNav ? null : 'menuitemradio',\n type: isNav || disabled ? null : 'button',\n 'aria-disabled': disabled ? 'true' : null,\n 'aria-controls': safeVueInstance(_this7).ariaControls || null,\n 'aria-label': hasPropFunction(labelPage) ?\n /* istanbul ignore next */\n labelPage(pageNumber) : \"\".concat(isFunction(labelPage) ? labelPage() : labelPage, \" \").concat(pageNumber),\n 'aria-checked': isNav ? null : active ? 'true' : 'false',\n 'aria-current': isNav && active ? 'page' : null,\n 'aria-posinset': isNav ? null : pageNumber,\n 'aria-setsize': isNav ? null : numberOfPages,\n // ARIA \"roving tabindex\" method (except in `isNav` mode)\n tabindex: isNav ? null : tabIndex\n };\n var btnContent = toString(_this7.makePage(pageNumber));\n var scope = {\n page: pageNumber,\n index: pageNumber - 1,\n content: btnContent,\n active: active,\n disabled: disabled\n };\n var $inner = h(disabled ? 'span' : isNav ? BLink : 'button', {\n props: disabled || !isNav ? {} : _this7.linkProps(pageNumber),\n staticClass: 'page-link',\n class: {\n 'flex-grow-1': !isNav && !disabled && fill\n },\n attrs: attrs,\n on: disabled ? {} : {\n '!click': function click(event) {\n _this7.onClick(event, pageNumber);\n },\n keydown: onSpaceKey\n }\n }, [_this7.normalizeSlot(SLOT_NAME_PAGE, scope) || btnContent]);\n return h('li', {\n staticClass: 'page-item',\n class: [{\n disabled: disabled,\n active: active,\n 'flex-fill': fill,\n 'd-flex': fill && !isNav && !disabled\n }, page.classes, _this7.pageClass],\n attrs: {\n role: isNav ? null : 'presentation'\n },\n key: \"page-\".concat(pageNumber)\n }, [$inner]);\n }; // Goto first page button\n // Don't render button when `hideGotoEndButtons` or `firstNumber` is set\n\n\n var $firstPageBtn = h();\n\n if (!this.firstNumber && !this.hideGotoEndButtons) {\n $firstPageBtn = makeEndBtn(1, this.labelFirstPage, SLOT_NAME_FIRST_TEXT, this.firstText, this.firstClass, 1, 'pagination-goto-first');\n }\n\n $buttons.push($firstPageBtn); // Goto previous page button\n\n $buttons.push(makeEndBtn(currentPage - 1, this.labelPrevPage, SLOT_NAME_PREV_TEXT, this.prevText, this.prevClass, 1, 'pagination-goto-prev')); // Show first (1) button?\n\n $buttons.push(this.firstNumber && pageNumbers[0] !== 1 ? makePageButton({\n number: 1\n }, 0) : h()); // First ellipsis\n\n $buttons.push(showFirstDots ? makeEllipsis(false) : h()); // Individual page links\n\n this.pageList.forEach(function (page, idx) {\n var offset = showFirstDots && _this7.firstNumber && pageNumbers[0] !== 1 ? 1 : 0;\n $buttons.push(makePageButton(page, idx + offset));\n }); // Last ellipsis\n\n $buttons.push(showLastDots ? makeEllipsis(true) : h()); // Show last page button?\n\n $buttons.push(this.lastNumber && pageNumbers[pageNumbers.length - 1] !== numberOfPages ? makePageButton({\n number: numberOfPages\n }, -1) : h()); // Goto next page button\n\n $buttons.push(makeEndBtn(currentPage + 1, this.labelNextPage, SLOT_NAME_NEXT_TEXT, this.nextText, this.nextClass, numberOfPages, 'pagination-goto-next')); // Goto last page button\n // Don't render button when `hideGotoEndButtons` or `lastNumber` is set\n\n var $lastPageBtn = h();\n\n if (!this.lastNumber && !this.hideGotoEndButtons) {\n $lastPageBtn = makeEndBtn(numberOfPages, this.labelLastPage, SLOT_NAME_LAST_TEXT, this.lastText, this.lastClass, numberOfPages, 'pagination-goto-last');\n }\n\n $buttons.push($lastPageBtn); // Assemble the pagination buttons\n\n var $pagination = h('ul', {\n staticClass: 'pagination',\n class: ['b-pagination', this.btnSize, this.alignment, this.styleClass],\n attrs: {\n role: isNav ? null : 'menubar',\n 'aria-disabled': disabled ? 'true' : 'false',\n 'aria-label': isNav ? null : ariaLabel || null\n },\n // We disable keyboard left/right nav when ``\n on: isNav ? {} : {\n keydown: this.handleKeyNav\n },\n ref: 'ul'\n }, $buttons); // If we are ``, wrap in `` wrapper\n\n if (isNav) {\n return h('nav', {\n attrs: {\n 'aria-disabled': disabled ? 'true' : null,\n 'aria-hidden': disabled ? 'true' : 'false',\n 'aria-label': isNav ? ariaLabel || null : null\n }\n }, [$pagination]);\n }\n\n return $pagination;\n }\n});","import { BOverlay } from './overlay';\nimport { pluginFactory } from '../../utils/plugins';\nvar OverlayPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BOverlay: BOverlay\n }\n});\nexport { OverlayPlugin, BOverlay };","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_PAGINATION } from '../../constants/components';\nimport { EVENT_NAME_CHANGE, EVENT_NAME_PAGE_CLICK } from '../../constants/events';\nimport { PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { BvEvent } from '../../utils/bv-event.class';\nimport { attemptFocus, isVisible } from '../../utils/dom';\nimport { isUndefinedOrNull } from '../../utils/inspect';\nimport { mathCeil, mathMax } from '../../utils/math';\nimport { toInteger } from '../../utils/number';\nimport { sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { MODEL_PROP_NAME, paginationMixin, props as paginationProps } from '../../mixins/pagination'; // --- Constants ---\n\nvar DEFAULT_PER_PAGE = 20;\nvar DEFAULT_TOTAL_ROWS = 0; // --- Helper methods ---\n// Sanitize the provided per page number (converting to a number)\n\nvar sanitizePerPage = function sanitizePerPage(value) {\n return mathMax(toInteger(value) || DEFAULT_PER_PAGE, 1);\n}; // Sanitize the provided total rows number (converting to a number)\n\n\nvar sanitizeTotalRows = function sanitizeTotalRows(value) {\n return mathMax(toInteger(value) || DEFAULT_TOTAL_ROWS, 0);\n}; // --- Props ---\n\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, paginationProps), {}, {\n ariaControls: makeProp(PROP_TYPE_STRING),\n perPage: makeProp(PROP_TYPE_NUMBER_STRING, DEFAULT_PER_PAGE),\n totalRows: makeProp(PROP_TYPE_NUMBER_STRING, DEFAULT_TOTAL_ROWS)\n})), NAME_PAGINATION); // --- Main component ---\n// @vue/component\n\nexport var BPagination = /*#__PURE__*/extend({\n name: NAME_PAGINATION,\n // The render function is brought in via the `paginationMixin`\n mixins: [paginationMixin],\n props: props,\n computed: {\n numberOfPages: function numberOfPages() {\n var result = mathCeil(sanitizeTotalRows(this.totalRows) / sanitizePerPage(this.perPage));\n return result < 1 ? 1 : result;\n },\n // Used for watching changes to `perPage` and `numberOfPages`\n pageSizeNumberOfPages: function pageSizeNumberOfPages() {\n return {\n perPage: sanitizePerPage(this.perPage),\n totalRows: sanitizeTotalRows(this.totalRows),\n numberOfPages: this.numberOfPages\n };\n }\n },\n watch: {\n pageSizeNumberOfPages: function pageSizeNumberOfPages(newValue, oldValue) {\n if (!isUndefinedOrNull(oldValue)) {\n if (newValue.perPage !== oldValue.perPage && newValue.totalRows === oldValue.totalRows) {\n // If the page size changes, reset to page 1\n this.currentPage = 1;\n } else if (newValue.numberOfPages !== oldValue.numberOfPages && this.currentPage > newValue.numberOfPages) {\n // If `numberOfPages` changes and is less than\n // the `currentPage` number, reset to page 1\n this.currentPage = 1;\n }\n }\n\n this.localNumberOfPages = newValue.numberOfPages;\n }\n },\n created: function created() {\n var _this = this;\n\n // Set the initial page count\n this.localNumberOfPages = this.numberOfPages; // Set the initial page value\n\n var currentPage = toInteger(this[MODEL_PROP_NAME], 0);\n\n if (currentPage > 0) {\n this.currentPage = currentPage;\n } else {\n this.$nextTick(function () {\n // If this value parses to `NaN` or a value less than `1`\n // trigger an initial emit of `null` if no page specified\n _this.currentPage = 0;\n });\n }\n },\n methods: {\n // These methods are used by the render function\n onClick: function onClick(event, pageNumber) {\n var _this2 = this;\n\n // Dont do anything if clicking the current active page\n if (pageNumber === this.currentPage) {\n return;\n }\n\n var target = event.target; // Emit a user-cancelable `page-click` event\n\n var clickEvent = new BvEvent(EVENT_NAME_PAGE_CLICK, {\n cancelable: true,\n vueTarget: this,\n target: target\n });\n this.$emit(clickEvent.type, clickEvent, pageNumber);\n\n if (clickEvent.defaultPrevented) {\n return;\n } // Update the `v-model`\n\n\n this.currentPage = pageNumber; // Emit event triggered by user interaction\n\n this.$emit(EVENT_NAME_CHANGE, this.currentPage); // Keep the current button focused if possible\n\n this.$nextTick(function () {\n if (isVisible(target) && _this2.$el.contains(target)) {\n attemptFocus(target);\n } else {\n _this2.focusCurrent();\n }\n });\n },\n makePage: function makePage(pageNum) {\n return pageNum;\n },\n\n /* istanbul ignore next */\n linkProps: function linkProps() {\n // No props, since we render a plain button\n return {};\n }\n }\n});","import { BPagination } from './pagination';\nimport { pluginFactory } from '../../utils/plugins';\nvar PaginationPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BPagination: BPagination\n }\n});\nexport { PaginationPlugin, BPagination };","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_PAGINATION_NAV } from '../../constants/components';\nimport { IS_BROWSER } from '../../constants/env';\nimport { EVENT_NAME_CHANGE, EVENT_NAME_PAGE_CLICK } from '../../constants/events';\nimport { PROP_TYPE_ARRAY, PROP_TYPE_BOOLEAN, PROP_TYPE_FUNCTION, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { BvEvent } from '../../utils/bv-event.class';\nimport { attemptBlur, requestAF } from '../../utils/dom';\nimport { isArray, isUndefined, isObject } from '../../utils/inspect';\nimport { looseEqual } from '../../utils/loose-equal';\nimport { mathMax } from '../../utils/math';\nimport { toInteger } from '../../utils/number';\nimport { omit, sortKeys } from '../../utils/object';\nimport { hasPropFunction, makeProp, makePropsConfigurable, pluckProps } from '../../utils/props';\nimport { computeHref, parseQuery } from '../../utils/router';\nimport { toString } from '../../utils/string';\nimport { warn } from '../../utils/warn';\nimport { paginationMixin, props as paginationProps } from '../../mixins/pagination';\nimport { props as BLinkProps } from '../link/link'; // --- Helper methods ---\n// Sanitize the provided number of pages (converting to a number)\n\nexport var sanitizeNumberOfPages = function sanitizeNumberOfPages(value) {\n return mathMax(toInteger(value, 0), 1);\n}; // --- Props ---\n\nvar _linkProps = omit(BLinkProps, ['event', 'routerTag']);\n\nvar props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread(_objectSpread({}, paginationProps), _linkProps), {}, {\n baseUrl: makeProp(PROP_TYPE_STRING, '/'),\n linkGen: makeProp(PROP_TYPE_FUNCTION),\n // Disable auto page number detection if `true`\n noPageDetect: makeProp(PROP_TYPE_BOOLEAN, false),\n numberOfPages: makeProp(PROP_TYPE_NUMBER_STRING, 1,\n /* istanbul ignore next */\n function (value) {\n var number = toInteger(value, 0);\n\n if (number < 1) {\n warn('Prop \"number-of-pages\" must be a number greater than \"0\"', NAME_PAGINATION_NAV);\n return false;\n }\n\n return true;\n }),\n pageGen: makeProp(PROP_TYPE_FUNCTION),\n // Optional array of page links\n pages: makeProp(PROP_TYPE_ARRAY),\n useRouter: makeProp(PROP_TYPE_BOOLEAN, false)\n})), NAME_PAGINATION_NAV); // --- Main component ---\n// @vue/component\n\nexport var BPaginationNav = /*#__PURE__*/extend({\n name: NAME_PAGINATION_NAV,\n // The render function is brought in via the pagination mixin\n mixins: [paginationMixin],\n props: props,\n computed: {\n // Used by render function to trigger wrapping in '' element\n isNav: function isNav() {\n return true;\n },\n computedValue: function computedValue() {\n // Returns the value prop as a number or `null` if undefined or < 1\n var value = toInteger(this.value, 0);\n return value < 1 ? null : value;\n }\n },\n watch: {\n numberOfPages: function numberOfPages() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.setNumberOfPages();\n });\n },\n pages: function pages() {\n var _this2 = this;\n\n this.$nextTick(function () {\n _this2.setNumberOfPages();\n });\n }\n },\n created: function created() {\n this.setNumberOfPages();\n },\n mounted: function mounted() {\n var _this3 = this;\n\n if (this.$router) {\n // We only add the watcher if vue router is detected\n this.$watch('$route', function () {\n _this3.$nextTick(function () {\n requestAF(function () {\n _this3.guessCurrentPage();\n });\n });\n });\n }\n },\n methods: {\n setNumberOfPages: function setNumberOfPages() {\n var _this4 = this;\n\n if (isArray(this.pages) && this.pages.length > 0) {\n this.localNumberOfPages = this.pages.length;\n } else {\n this.localNumberOfPages = sanitizeNumberOfPages(this.numberOfPages);\n }\n\n this.$nextTick(function () {\n _this4.guessCurrentPage();\n });\n },\n onClick: function onClick(event, pageNumber) {\n var _this5 = this;\n\n // Dont do anything if clicking the current active page\n if (pageNumber === this.currentPage) {\n return;\n }\n\n var target = event.currentTarget || event.target; // Emit a user-cancelable `page-click` event\n\n var clickEvent = new BvEvent(EVENT_NAME_PAGE_CLICK, {\n cancelable: true,\n vueTarget: this,\n target: target\n });\n this.$emit(clickEvent.type, clickEvent, pageNumber);\n\n if (clickEvent.defaultPrevented) {\n return;\n } // Update the `v-model`\n // Done in in requestAF() to allow browser to complete the\n // native browser click handling of a link\n\n\n requestAF(function () {\n _this5.currentPage = pageNumber;\n\n _this5.$emit(EVENT_NAME_CHANGE, pageNumber);\n }); // Emulate native link click page reloading behaviour by blurring the\n // paginator and returning focus to the document\n // Done in a `nextTick()` to ensure rendering complete\n\n this.$nextTick(function () {\n attemptBlur(target);\n });\n },\n getPageInfo: function getPageInfo(pageNumber) {\n if (!isArray(this.pages) || this.pages.length === 0 || isUndefined(this.pages[pageNumber - 1])) {\n var link = \"\".concat(this.baseUrl).concat(pageNumber);\n return {\n link: this.useRouter ? {\n path: link\n } : link,\n text: toString(pageNumber)\n };\n }\n\n var info = this.pages[pageNumber - 1];\n\n if (isObject(info)) {\n var _link = info.link;\n return {\n // Normalize link for router use\n link: isObject(_link) ? _link : this.useRouter ? {\n path: _link\n } : _link,\n // Make sure text has a value\n text: toString(info.text || pageNumber)\n };\n } else {\n return {\n link: toString(info),\n text: toString(pageNumber)\n };\n }\n },\n makePage: function makePage(pageNumber) {\n var pageGen = this.pageGen;\n var info = this.getPageInfo(pageNumber);\n\n if (hasPropFunction(pageGen)) {\n return pageGen(pageNumber, info);\n }\n\n return info.text;\n },\n makeLink: function makeLink(pageNumber) {\n var linkGen = this.linkGen;\n var info = this.getPageInfo(pageNumber);\n\n if (hasPropFunction(linkGen)) {\n return linkGen(pageNumber, info);\n }\n\n return info.link;\n },\n linkProps: function linkProps(pageNumber) {\n var props = pluckProps(_linkProps, this);\n var link = this.makeLink(pageNumber);\n\n if (this.useRouter || isObject(link)) {\n props.to = link;\n } else {\n props.href = link;\n }\n\n return props;\n },\n resolveLink: function resolveLink() {\n var to = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n // Given a to (or href string), convert to normalized route-like structure\n // Works only client side!\n var link;\n\n try {\n // Convert the `to` to a HREF via a temporary `a` tag\n link = document.createElement('a');\n link.href = computeHref({\n to: to\n }, 'a', '/', '/'); // We need to add the anchor to the document to make sure the\n // `pathname` is correctly detected in any browser (i.e. IE)\n\n document.body.appendChild(link); // Once href is assigned, the link will be normalized to the full URL bits\n\n var _link2 = link,\n pathname = _link2.pathname,\n hash = _link2.hash,\n search = _link2.search; // Remove link from document\n\n document.body.removeChild(link); // Return the location in a route-like object\n\n return {\n path: pathname,\n hash: hash,\n query: parseQuery(search)\n };\n } catch (e) {\n /* istanbul ignore next */\n try {\n link && link.parentNode && link.parentNode.removeChild(link);\n } catch (_unused) {}\n /* istanbul ignore next */\n\n\n return {};\n }\n },\n resolveRoute: function resolveRoute() {\n var to = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n\n // Given a to (or href string), convert to normalized route location structure\n // Works only when router available!\n try {\n var route = this.$router.resolve(to, this.$route).route;\n return {\n path: route.path,\n hash: route.hash,\n query: route.query\n };\n } catch (e) {\n /* istanbul ignore next */\n return {};\n }\n },\n guessCurrentPage: function guessCurrentPage() {\n var $router = this.$router,\n $route = this.$route;\n var guess = this.computedValue; // This section only occurs if we are client side, or server-side with `$router`\n\n if (!this.noPageDetect && !guess && (IS_BROWSER || !IS_BROWSER && $router)) {\n // Current route (if router available)\n var currentRoute = $router && $route ? {\n path: $route.path,\n hash: $route.hash,\n query: $route.query\n } : {}; // Current page full HREF (if client side)\n // Can't be done as a computed prop!\n\n var loc = IS_BROWSER ? window.location || document.location : null;\n var currentLink = loc ? {\n path: loc.pathname,\n hash: loc.hash,\n query: parseQuery(loc.search)\n } :\n /* istanbul ignore next */\n {}; // Loop through the possible pages looking for a match until found\n\n for (var pageNumber = 1; !guess && pageNumber <= this.localNumberOfPages; pageNumber++) {\n var to = this.makeLink(pageNumber);\n\n if ($router && (isObject(to) || this.useRouter)) {\n // Resolve the page via the `$router`\n guess = looseEqual(this.resolveRoute(to), currentRoute) ? pageNumber : null;\n } else if (IS_BROWSER) {\n // If no `$router` available (or `!this.useRouter` when `to` is a string)\n // we compare using parsed URIs\n guess = looseEqual(this.resolveLink(to), currentLink) ? pageNumber : null;\n } else {\n // Probably SSR, but no `$router` so we can't guess,\n // so lets break out of the loop early\n\n /* istanbul ignore next */\n guess = -1;\n }\n }\n } // We set `currentPage` to `0` to trigger an `$emit('input', null)`\n // As the default for `currentPage` is `-1` when no value is specified\n // Valid page numbers are greater than `0`\n\n\n this.currentPage = guess > 0 ? guess : 0;\n }\n }\n});","import { BPaginationNav } from './pagination-nav';\nimport { pluginFactory } from '../../utils/plugins';\nvar PaginationNavPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BPaginationNav: BPaginationNav\n }\n});\nexport { PaginationNavPlugin, BPaginationNav };","// Base on-demand component for tooltip / popover templates\n//\n// Currently:\n// Responsible for positioning and transitioning the template\n// Templates are only instantiated when shown, and destroyed when hidden\n//\nimport Popper from 'popper.js';\nimport { extend } from '../../../vue';\nimport { NAME_POPPER } from '../../../constants/components';\nimport { EVENT_NAME_HIDDEN, EVENT_NAME_HIDE, EVENT_NAME_SHOW, EVENT_NAME_SHOWN, HOOK_EVENT_NAME_DESTROYED } from '../../../constants/events';\nimport { PROP_TYPE_ARRAY_STRING, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../../constants/props';\nimport { HTMLElement, SVGElement } from '../../../constants/safe-types';\nimport { useParentMixin } from '../../../mixins/use-parent';\nimport { getCS, requestAF, select } from '../../../utils/dom';\nimport { toFloat } from '../../../utils/number';\nimport { makeProp } from '../../../utils/props';\nimport { BVTransition } from '../../transition/bv-transition'; // --- Constants ---\n\nvar AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: 'right',\n BOTTOM: 'bottom',\n LEFT: 'left',\n TOPLEFT: 'top',\n TOPRIGHT: 'top',\n RIGHTTOP: 'right',\n RIGHTBOTTOM: 'right',\n BOTTOMLEFT: 'bottom',\n BOTTOMRIGHT: 'bottom',\n LEFTTOP: 'left',\n LEFTBOTTOM: 'left'\n};\nvar OffsetMap = {\n AUTO: 0,\n TOPLEFT: -1,\n TOP: 0,\n TOPRIGHT: +1,\n RIGHTTOP: -1,\n RIGHT: 0,\n RIGHTBOTTOM: +1,\n BOTTOMLEFT: -1,\n BOTTOM: 0,\n BOTTOMRIGHT: +1,\n LEFTTOP: -1,\n LEFT: 0,\n LEFTBOTTOM: +1\n}; // --- Props ---\n\nexport var props = {\n // The minimum distance (in `px`) from the edge of the\n // tooltip/popover that the arrow can be positioned\n arrowPadding: makeProp(PROP_TYPE_NUMBER_STRING, 6),\n // 'scrollParent', 'viewport', 'window', or `Element`\n boundary: makeProp([HTMLElement, PROP_TYPE_STRING], 'scrollParent'),\n // Tooltip/popover will try and stay away from\n // boundary edge by this many pixels\n boundaryPadding: makeProp(PROP_TYPE_NUMBER_STRING, 5),\n fallbackPlacement: makeProp(PROP_TYPE_ARRAY_STRING, 'flip'),\n offset: makeProp(PROP_TYPE_NUMBER_STRING, 0),\n placement: makeProp(PROP_TYPE_STRING, 'top'),\n // Element that the tooltip/popover is positioned relative to\n target: makeProp([HTMLElement, SVGElement])\n}; // --- Main component ---\n// @vue/component\n\nexport var BVPopper = /*#__PURE__*/extend({\n name: NAME_POPPER,\n mixins: [useParentMixin],\n props: props,\n data: function data() {\n return {\n // reactive props set by parent\n noFade: false,\n // State related data\n localShow: true,\n attachment: this.getAttachment(this.placement)\n };\n },\n computed: {\n /* istanbul ignore next */\n templateType: function templateType() {\n // Overridden by template component\n return 'unknown';\n },\n popperConfig: function popperConfig() {\n var _this = this;\n\n var placement = this.placement;\n return {\n placement: this.getAttachment(placement),\n modifiers: {\n offset: {\n offset: this.getOffset(placement)\n },\n flip: {\n behavior: this.fallbackPlacement\n },\n // `arrow.element` can also be a reference to an HTML Element\n // maybe we should make this a `$ref` in the templates?\n arrow: {\n element: '.arrow'\n },\n preventOverflow: {\n padding: this.boundaryPadding,\n boundariesElement: this.boundary\n }\n },\n onCreate: function onCreate(data) {\n // Handle flipping arrow classes\n if (data.originalPlacement !== data.placement) {\n /* istanbul ignore next: can't test in JSDOM */\n _this.popperPlacementChange(data);\n }\n },\n onUpdate: function onUpdate(data) {\n // Handle flipping arrow classes\n _this.popperPlacementChange(data);\n }\n };\n }\n },\n created: function created() {\n var _this2 = this;\n\n // Note: We are created on-demand, and should be guaranteed that\n // DOM is rendered/ready by the time the created hook runs\n this.$_popper = null; // Ensure we show as we mount\n\n this.localShow = true; // Create popper instance before shown\n\n this.$on(EVENT_NAME_SHOW, function (el) {\n _this2.popperCreate(el);\n }); // Self destruct handler\n\n var handleDestroy = function handleDestroy() {\n _this2.$nextTick(function () {\n // In a `requestAF()` to release control back to application\n requestAF(function () {\n _this2.$destroy();\n });\n });\n }; // Self destruct if parent destroyed\n\n\n this.bvParent.$once(HOOK_EVENT_NAME_DESTROYED, handleDestroy); // Self destruct after hidden\n\n this.$once(EVENT_NAME_HIDDEN, handleDestroy);\n },\n beforeMount: function beforeMount() {\n // Ensure that the attachment position is correct before mounting\n // as our propsData is added after `new Template({...})`\n this.attachment = this.getAttachment(this.placement);\n },\n updated: function updated() {\n // Update popper if needed\n // TODO: Should this be a watcher on `this.popperConfig` instead?\n this.updatePopper();\n },\n beforeDestroy: function beforeDestroy() {\n this.destroyPopper();\n },\n destroyed: function destroyed() {\n // Make sure template is removed from DOM\n var el = this.$el;\n el && el.parentNode && el.parentNode.removeChild(el);\n },\n methods: {\n // \"Public\" method to trigger hide template\n hide: function hide() {\n this.localShow = false;\n },\n // Private\n getAttachment: function getAttachment(placement) {\n return AttachmentMap[String(placement).toUpperCase()] || 'auto';\n },\n getOffset: function getOffset(placement) {\n if (!this.offset) {\n // Could set a ref for the arrow element\n var arrow = this.$refs.arrow || select('.arrow', this.$el);\n var arrowOffset = toFloat(getCS(arrow).width, 0) + toFloat(this.arrowPadding, 0);\n\n switch (OffsetMap[String(placement).toUpperCase()] || 0) {\n /* istanbul ignore next: can't test in JSDOM */\n case +1:\n /* istanbul ignore next: can't test in JSDOM */\n return \"+50%p - \".concat(arrowOffset, \"px\");\n\n /* istanbul ignore next: can't test in JSDOM */\n\n case -1:\n /* istanbul ignore next: can't test in JSDOM */\n return \"-50%p + \".concat(arrowOffset, \"px\");\n\n default:\n return 0;\n }\n }\n /* istanbul ignore next */\n\n\n return this.offset;\n },\n popperCreate: function popperCreate(el) {\n this.destroyPopper(); // We use `el` rather than `this.$el` just in case the original\n // mountpoint root element type was changed by the template\n\n this.$_popper = new Popper(this.target, el, this.popperConfig);\n },\n destroyPopper: function destroyPopper() {\n this.$_popper && this.$_popper.destroy();\n this.$_popper = null;\n },\n updatePopper: function updatePopper() {\n this.$_popper && this.$_popper.scheduleUpdate();\n },\n popperPlacementChange: function popperPlacementChange(data) {\n // Callback used by popper to adjust the arrow placement\n this.attachment = this.getAttachment(data.placement);\n },\n\n /* istanbul ignore next */\n renderTemplate: function renderTemplate(h) {\n // Will be overridden by templates\n return h('div');\n }\n },\n render: function render(h) {\n var _this3 = this;\n\n var noFade = this.noFade; // Note: 'show' and 'fade' classes are only appled during transition\n\n return h(BVTransition, {\n // Transitions as soon as mounted\n props: {\n appear: true,\n noFade: noFade\n },\n on: {\n // Events used by parent component/instance\n beforeEnter: function beforeEnter(el) {\n return _this3.$emit(EVENT_NAME_SHOW, el);\n },\n afterEnter: function afterEnter(el) {\n return _this3.$emit(EVENT_NAME_SHOWN, el);\n },\n beforeLeave: function beforeLeave(el) {\n return _this3.$emit(EVENT_NAME_HIDE, el);\n },\n afterLeave: function afterLeave(el) {\n return _this3.$emit(EVENT_NAME_HIDDEN, el);\n }\n }\n }, [this.localShow ? this.renderTemplate(h) : h()]);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { NAME_TOOLTIP_TEMPLATE } from '../../../constants/components';\nimport { EVENT_NAME_FOCUSIN, EVENT_NAME_FOCUSOUT, EVENT_NAME_MOUSEENTER, EVENT_NAME_MOUSELEAVE } from '../../../constants/events';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';\nimport { isFunction } from '../../../utils/inspect';\nimport { makeProp } from '../../../utils/props';\nimport { scopedStyleMixin } from '../../../mixins/scoped-style';\nimport { BVPopper } from './bv-popper'; // --- Props ---\n\nexport var props = {\n // Used only by the directive versions\n html: makeProp(PROP_TYPE_BOOLEAN, false),\n // Other non-reactive (while open) props are pulled in from BVPopper\n id: makeProp(PROP_TYPE_STRING)\n}; // --- Main component ---\n// @vue/component\n\nexport var BVTooltipTemplate = /*#__PURE__*/extend({\n name: NAME_TOOLTIP_TEMPLATE,\n extends: BVPopper,\n mixins: [scopedStyleMixin],\n props: props,\n data: function data() {\n // We use data, rather than props to ensure reactivity\n // Parent component will directly set this data\n return {\n title: '',\n content: '',\n variant: null,\n customClass: null,\n interactive: true\n };\n },\n computed: {\n templateType: function templateType() {\n return 'tooltip';\n },\n templateClasses: function templateClasses() {\n var _ref;\n\n var variant = this.variant,\n attachment = this.attachment,\n templateType = this.templateType;\n return [(_ref = {\n // Disables pointer events to hide the tooltip when the user\n // hovers over its content\n noninteractive: !this.interactive\n }, _defineProperty(_ref, \"b-\".concat(templateType, \"-\").concat(variant), variant), _defineProperty(_ref, \"bs-\".concat(templateType, \"-\").concat(attachment), attachment), _ref), this.customClass];\n },\n templateAttributes: function templateAttributes() {\n var id = this.id;\n return _objectSpread(_objectSpread({}, this.bvParent.bvParent.$attrs), {}, {\n id: id,\n role: 'tooltip',\n tabindex: '-1'\n }, this.scopedStyleAttrs);\n },\n templateListeners: function templateListeners() {\n var _this = this;\n\n // Used for hover/focus trigger listeners\n return {\n mouseenter:\n /* istanbul ignore next */\n function mouseenter(event) {\n _this.$emit(EVENT_NAME_MOUSEENTER, event);\n },\n mouseleave:\n /* istanbul ignore next */\n function mouseleave(event) {\n _this.$emit(EVENT_NAME_MOUSELEAVE, event);\n },\n focusin:\n /* istanbul ignore next */\n function focusin(event) {\n _this.$emit(EVENT_NAME_FOCUSIN, event);\n },\n focusout:\n /* istanbul ignore next */\n function focusout(event) {\n _this.$emit(EVENT_NAME_FOCUSOUT, event);\n }\n };\n }\n },\n methods: {\n renderTemplate: function renderTemplate(h) {\n var title = this.title; // Title can be a scoped slot function\n\n var $title = isFunction(title) ? title({}) : title; // Directive versions only\n\n var domProps = this.html && !isFunction(title) ? {\n innerHTML: title\n } : {};\n return h('div', {\n staticClass: 'tooltip b-tooltip',\n class: this.templateClasses,\n attrs: this.templateAttributes,\n on: this.templateListeners\n }, [h('div', {\n staticClass: 'arrow',\n ref: 'arrow'\n }), h('div', {\n staticClass: 'tooltip-inner',\n domProps: domProps\n }, [$title])]);\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// Tooltip \"Class\" (Built as a renderless Vue instance)\n//\n// Handles trigger events, etc.\n// Instantiates template on demand\nimport { COMPONENT_UID_KEY, extend } from '../../../vue';\nimport { NAME_MODAL, NAME_TOOLTIP_HELPER } from '../../../constants/components';\nimport { EVENT_NAME_DISABLE, EVENT_NAME_DISABLED, EVENT_NAME_ENABLE, EVENT_NAME_ENABLED, EVENT_NAME_FOCUSIN, EVENT_NAME_FOCUSOUT, EVENT_NAME_HIDDEN, EVENT_NAME_HIDE, EVENT_NAME_MOUSEENTER, EVENT_NAME_MOUSELEAVE, EVENT_NAME_SHOW, EVENT_NAME_SHOWN, EVENT_OPTIONS_NO_CAPTURE, HOOK_EVENT_NAME_BEFORE_DESTROY, HOOK_EVENT_NAME_DESTROYED } from '../../../constants/events';\nimport { useParentMixin } from '../../../mixins/use-parent';\nimport { arrayIncludes, concat, from as arrayFrom } from '../../../utils/array';\nimport { getInstanceFromElement } from '../../../utils/element-to-vue-instance-registry';\nimport { attemptFocus, closest, contains, getAttr, getById, hasAttr, hasClass, isDisabled, isElement, isVisible, removeAttr, requestAF, select, setAttr } from '../../../utils/dom';\nimport { eventOff, eventOn, eventOnOff, getRootActionEventName, getRootEventName } from '../../../utils/events';\nimport { getScopeId } from '../../../utils/get-scope-id';\nimport { identity } from '../../../utils/identity';\nimport { isFunction, isNumber, isPlainObject, isString, isUndefined, isUndefinedOrNull } from '../../../utils/inspect';\nimport { looseEqual } from '../../../utils/loose-equal';\nimport { mathMax } from '../../../utils/math';\nimport { noop } from '../../../utils/noop';\nimport { toInteger } from '../../../utils/number';\nimport { keys } from '../../../utils/object';\nimport { warn } from '../../../utils/warn';\nimport { BvEvent } from '../../../utils/bv-event.class';\nimport { createNewChildComponent } from '../../../utils/create-new-child-component';\nimport { listenOnRootMixin } from '../../../mixins/listen-on-root';\nimport { BVTooltipTemplate } from './bv-tooltip-template'; // --- Constants ---\n// Modal container selector for appending tooltip/popover\n\nvar MODAL_SELECTOR = '.modal-content'; // Modal `$root` hidden event\n\nvar ROOT_EVENT_NAME_MODAL_HIDDEN = getRootEventName(NAME_MODAL, EVENT_NAME_HIDDEN); // Sidebar container selector for appending tooltip/popover\n\nvar SIDEBAR_SELECTOR = '.b-sidebar'; // For finding the container to append to\n\nvar CONTAINER_SELECTOR = [MODAL_SELECTOR, SIDEBAR_SELECTOR].join(', '); // For dropdown sniffing\n\nvar DROPDOWN_CLASS = 'dropdown';\nvar DROPDOWN_OPEN_SELECTOR = '.dropdown-menu.show'; // Data attribute to temporary store the `title` attribute's value\n\nvar DATA_TITLE_ATTR = 'data-original-title'; // Data specific to popper and template\n// We don't use props, as we need reactivity (we can't pass reactive props)\n\nvar templateData = {\n // Text string or Scoped slot function\n title: '',\n // Text string or Scoped slot function\n content: '',\n // String\n variant: null,\n // String, Array, Object\n customClass: null,\n // String or array of Strings (overwritten by BVPopper)\n triggers: '',\n // String (overwritten by BVPopper)\n placement: 'auto',\n // String or array of strings\n fallbackPlacement: 'flip',\n // Element or Component reference (or function that returns element) of\n // the element that will have the trigger events bound, and is also\n // default element for positioning\n target: null,\n // HTML ID, Element or Component reference\n container: null,\n // 'body'\n // Boolean\n noFade: false,\n // 'scrollParent', 'viewport', 'window', Element, or Component reference\n boundary: 'scrollParent',\n // Tooltip/popover will try and stay away from\n // boundary edge by this many pixels (Number)\n boundaryPadding: 5,\n // Arrow offset (Number)\n offset: 0,\n // Hover/focus delay (Number or Object)\n delay: 0,\n // Arrow of Tooltip/popover will try and stay away from\n // the edge of tooltip/popover edge by this many pixels\n arrowPadding: 6,\n // Interactive state (Boolean)\n interactive: true,\n // Disabled state (Boolean)\n disabled: false,\n // ID to use for tooltip/popover\n id: null,\n // Flag used by directives only, for HTML content\n html: false\n}; // --- Main component ---\n// @vue/component\n\nexport var BVTooltip = /*#__PURE__*/extend({\n name: NAME_TOOLTIP_HELPER,\n mixins: [listenOnRootMixin, useParentMixin],\n data: function data() {\n return _objectSpread(_objectSpread({}, templateData), {}, {\n // State management data\n activeTrigger: {\n // manual: false,\n hover: false,\n click: false,\n focus: false\n },\n localShow: false\n });\n },\n computed: {\n templateType: function templateType() {\n // Overwritten by BVPopover\n return 'tooltip';\n },\n computedId: function computedId() {\n return this.id || \"__bv_\".concat(this.templateType, \"_\").concat(this[COMPONENT_UID_KEY], \"__\");\n },\n computedDelay: function computedDelay() {\n // Normalizes delay into object form\n var delay = {\n show: 0,\n hide: 0\n };\n\n if (isPlainObject(this.delay)) {\n delay.show = mathMax(toInteger(this.delay.show, 0), 0);\n delay.hide = mathMax(toInteger(this.delay.hide, 0), 0);\n } else if (isNumber(this.delay) || isString(this.delay)) {\n delay.show = delay.hide = mathMax(toInteger(this.delay, 0), 0);\n }\n\n return delay;\n },\n computedTriggers: function computedTriggers() {\n // Returns the triggers in sorted array form\n // TODO: Switch this to object form for easier lookup\n return concat(this.triggers).filter(identity).join(' ').trim().toLowerCase().split(/\\s+/).sort();\n },\n isWithActiveTrigger: function isWithActiveTrigger() {\n for (var trigger in this.activeTrigger) {\n if (this.activeTrigger[trigger]) {\n return true;\n }\n }\n\n return false;\n },\n computedTemplateData: function computedTemplateData() {\n var title = this.title,\n content = this.content,\n variant = this.variant,\n customClass = this.customClass,\n noFade = this.noFade,\n interactive = this.interactive;\n return {\n title: title,\n content: content,\n variant: variant,\n customClass: customClass,\n noFade: noFade,\n interactive: interactive\n };\n }\n },\n watch: {\n computedTriggers: function computedTriggers(newTriggers, oldTriggers) {\n var _this = this;\n\n // Triggers have changed, so re-register them\n\n /* istanbul ignore next */\n if (!looseEqual(newTriggers, oldTriggers)) {\n this.$nextTick(function () {\n // Disable trigger listeners\n _this.unListen(); // Clear any active triggers that are no longer in the list of triggers\n\n\n oldTriggers.forEach(function (trigger) {\n if (!arrayIncludes(newTriggers, trigger)) {\n if (_this.activeTrigger[trigger]) {\n _this.activeTrigger[trigger] = false;\n }\n }\n }); // Re-enable the trigger listeners\n\n _this.listen();\n });\n }\n },\n computedTemplateData: function computedTemplateData() {\n // If any of the while open reactive \"props\" change,\n // ensure that the template updates accordingly\n this.handleTemplateUpdate();\n },\n title: function title(newValue, oldValue) {\n // Make sure to hide the tooltip when the title is set empty\n if (newValue !== oldValue && !newValue) {\n this.hide();\n }\n },\n disabled: function disabled(newValue) {\n if (newValue) {\n this.disable();\n } else {\n this.enable();\n }\n }\n },\n created: function created() {\n var _this2 = this;\n\n // Create non-reactive properties\n this.$_tip = null;\n this.$_hoverTimeout = null;\n this.$_hoverState = '';\n this.$_visibleInterval = null;\n this.$_enabled = !this.disabled;\n this.$_noop = noop.bind(this); // Destroy ourselves when the parent is destroyed\n\n if (this.bvParent) {\n this.bvParent.$once(HOOK_EVENT_NAME_BEFORE_DESTROY, function () {\n _this2.$nextTick(function () {\n // In a `requestAF()` to release control back to application\n requestAF(function () {\n _this2.$destroy();\n });\n });\n });\n }\n\n this.$nextTick(function () {\n var target = _this2.getTarget();\n\n if (target && contains(document.body, target)) {\n // Copy the parent's scoped style attribute\n _this2.scopeId = getScopeId(_this2.bvParent); // Set up all trigger handlers and listeners\n\n _this2.listen();\n } else {\n /* istanbul ignore next */\n warn(isString(_this2.target) ? \"Unable to find target element by ID \\\"#\".concat(_this2.target, \"\\\" in document.\") : 'The provided target is no valid HTML element.', _this2.templateType);\n }\n });\n },\n\n /* istanbul ignore next */\n updated: function updated() {\n // Usually called when the slots/data changes\n this.$nextTick(this.handleTemplateUpdate);\n },\n\n /* istanbul ignore next */\n deactivated: function deactivated() {\n // In a keepalive that has been deactivated, so hide\n // the tooltip/popover if it is showing\n this.forceHide();\n },\n beforeDestroy: function beforeDestroy() {\n // Remove all handler/listeners\n this.unListen();\n this.setWhileOpenListeners(false); // Clear any timeouts/intervals\n\n this.clearHoverTimeout();\n this.clearVisibilityInterval(); // Destroy the template\n\n this.destroyTemplate(); // Remove any other private properties created during create\n\n this.$_noop = null;\n },\n methods: {\n // --- Methods for creating and destroying the template ---\n getTemplate: function getTemplate() {\n // Overridden by BVPopover\n return BVTooltipTemplate;\n },\n updateData: function updateData() {\n var _this3 = this;\n\n var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // Method for updating popper/template data\n // We only update data if it exists, and has not changed\n var titleUpdated = false;\n keys(templateData).forEach(function (prop) {\n if (!isUndefined(data[prop]) && _this3[prop] !== data[prop]) {\n _this3[prop] = data[prop];\n\n if (prop === 'title') {\n titleUpdated = true;\n }\n }\n }); // If the title has updated, we may need to handle the `title`\n // attribute on the trigger target\n // We only do this while the template is open\n\n if (titleUpdated && this.localShow) {\n this.fixTitle();\n }\n },\n createTemplateAndShow: function createTemplateAndShow() {\n // Creates the template instance and show it\n var container = this.getContainer();\n var Template = this.getTemplate();\n var $tip = this.$_tip = createNewChildComponent(this, Template, {\n // The following is not reactive to changes in the props data\n propsData: {\n // These values cannot be changed while template is showing\n id: this.computedId,\n html: this.html,\n placement: this.placement,\n fallbackPlacement: this.fallbackPlacement,\n target: this.getPlacementTarget(),\n boundary: this.getBoundary(),\n // Ensure the following are integers\n offset: toInteger(this.offset, 0),\n arrowPadding: toInteger(this.arrowPadding, 0),\n boundaryPadding: toInteger(this.boundaryPadding, 0)\n }\n }); // We set the initial reactive data (values that can be changed while open)\n\n this.handleTemplateUpdate(); // Template transition phase events (handled once only)\n // When the template has mounted, but not visibly shown yet\n\n $tip.$once(EVENT_NAME_SHOW, this.onTemplateShow); // When the template has completed showing\n\n $tip.$once(EVENT_NAME_SHOWN, this.onTemplateShown); // When the template has started to hide\n\n $tip.$once(EVENT_NAME_HIDE, this.onTemplateHide); // When the template has completed hiding\n\n $tip.$once(EVENT_NAME_HIDDEN, this.onTemplateHidden); // When the template gets destroyed for any reason\n\n $tip.$once(HOOK_EVENT_NAME_DESTROYED, this.destroyTemplate); // Convenience events from template\n // To save us from manually adding/removing DOM\n // listeners to tip element when it is open\n\n $tip.$on(EVENT_NAME_FOCUSIN, this.handleEvent);\n $tip.$on(EVENT_NAME_FOCUSOUT, this.handleEvent);\n $tip.$on(EVENT_NAME_MOUSEENTER, this.handleEvent);\n $tip.$on(EVENT_NAME_MOUSELEAVE, this.handleEvent); // Mount (which triggers the `show`)\n\n $tip.$mount(container.appendChild(document.createElement('div'))); // Template will automatically remove its markup from DOM when hidden\n },\n hideTemplate: function hideTemplate() {\n // Trigger the template to start hiding\n // The template will emit the `hide` event after this and\n // then emit the `hidden` event once it is fully hidden\n // The `hook:destroyed` will also be called (safety measure)\n this.$_tip && this.$_tip.hide(); // Clear out any stragging active triggers\n\n this.clearActiveTriggers(); // Reset the hover state\n\n this.$_hoverState = '';\n },\n // Destroy the template instance and reset state\n destroyTemplate: function destroyTemplate() {\n this.setWhileOpenListeners(false);\n this.clearHoverTimeout();\n this.$_hoverState = '';\n this.clearActiveTriggers();\n this.localPlacementTarget = null;\n\n try {\n this.$_tip.$destroy();\n } catch (_unused) {}\n\n this.$_tip = null;\n this.removeAriaDescribedby();\n this.restoreTitle();\n this.localShow = false;\n },\n getTemplateElement: function getTemplateElement() {\n return this.$_tip ? this.$_tip.$el : null;\n },\n handleTemplateUpdate: function handleTemplateUpdate() {\n var _this4 = this;\n\n // Update our template title/content \"props\"\n // So that the template updates accordingly\n var $tip = this.$_tip;\n\n if ($tip) {\n var props = ['title', 'content', 'variant', 'customClass', 'noFade', 'interactive']; // Only update the values if they have changed\n\n props.forEach(function (prop) {\n if ($tip[prop] !== _this4[prop]) {\n $tip[prop] = _this4[prop];\n }\n });\n }\n },\n // --- Show/Hide handlers ---\n // Show the tooltip\n show: function show() {\n var target = this.getTarget();\n\n if (!target || !contains(document.body, target) || !isVisible(target) || this.dropdownOpen() || (isUndefinedOrNull(this.title) || this.title === '') && (isUndefinedOrNull(this.content) || this.content === '')) {\n // If trigger element isn't in the DOM or is not visible, or\n // is on an open dropdown toggle, or has no content, then\n // we exit without showing\n return;\n } // If tip already exists, exit early\n\n\n if (this.$_tip || this.localShow) {\n /* istanbul ignore next */\n return;\n } // In the process of showing\n\n\n this.localShow = true; // Create a cancelable BvEvent\n\n var showEvent = this.buildEvent(EVENT_NAME_SHOW, {\n cancelable: true\n });\n this.emitEvent(showEvent); // Don't show if event cancelled\n\n /* istanbul ignore if */\n\n if (showEvent.defaultPrevented) {\n // Destroy the template (if for some reason it was created)\n this.destroyTemplate();\n return;\n } // Fix the title attribute on target\n\n\n this.fixTitle(); // Set aria-describedby on target\n\n this.addAriaDescribedby(); // Create and show the tooltip\n\n this.createTemplateAndShow();\n },\n hide: function hide() {\n var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n // Hide the tooltip\n var tip = this.getTemplateElement();\n /* istanbul ignore if */\n\n if (!tip || !this.localShow) {\n this.restoreTitle();\n return;\n } // Emit cancelable BvEvent 'hide'\n // We disable cancelling if `force` is true\n\n\n var hideEvent = this.buildEvent(EVENT_NAME_HIDE, {\n cancelable: !force\n });\n this.emitEvent(hideEvent);\n /* istanbul ignore if: ignore for now */\n\n if (hideEvent.defaultPrevented) {\n // Don't hide if event cancelled\n return;\n } // Tell the template to hide\n\n\n this.hideTemplate();\n },\n forceHide: function forceHide() {\n // Forcefully hides/destroys the template, regardless of any active triggers\n var tip = this.getTemplateElement();\n\n if (!tip || !this.localShow) {\n /* istanbul ignore next */\n return;\n } // Disable while open listeners/watchers\n // This is also done in the template `hide` event handler\n\n\n this.setWhileOpenListeners(false); // Clear any hover enter/leave event\n\n this.clearHoverTimeout();\n this.$_hoverState = '';\n this.clearActiveTriggers(); // Disable the fade animation on the template\n\n if (this.$_tip) {\n this.$_tip.noFade = true;\n } // Hide the tip (with force = true)\n\n\n this.hide(true);\n },\n enable: function enable() {\n this.$_enabled = true; // Create a non-cancelable BvEvent\n\n this.emitEvent(this.buildEvent(EVENT_NAME_ENABLED));\n },\n disable: function disable() {\n this.$_enabled = false; // Create a non-cancelable BvEvent\n\n this.emitEvent(this.buildEvent(EVENT_NAME_DISABLED));\n },\n // --- Handlers for template events ---\n // When template is inserted into DOM, but not yet shown\n onTemplateShow: function onTemplateShow() {\n // Enable while open listeners/watchers\n this.setWhileOpenListeners(true);\n },\n // When template show transition completes\n onTemplateShown: function onTemplateShown() {\n var prevHoverState = this.$_hoverState;\n this.$_hoverState = '';\n /* istanbul ignore next: occasional Node 10 coverage error */\n\n if (prevHoverState === 'out') {\n this.leave(null);\n } // Emit a non-cancelable BvEvent 'shown'\n\n\n this.emitEvent(this.buildEvent(EVENT_NAME_SHOWN));\n },\n // When template is starting to hide\n onTemplateHide: function onTemplateHide() {\n // Disable while open listeners/watchers\n this.setWhileOpenListeners(false);\n },\n // When template has completed closing (just before it self destructs)\n onTemplateHidden: function onTemplateHidden() {\n // Destroy the template\n this.destroyTemplate(); // Emit a non-cancelable BvEvent 'shown'\n\n this.emitEvent(this.buildEvent(EVENT_NAME_HIDDEN));\n },\n // --- Helper methods ---\n getTarget: function getTarget() {\n var target = this.target;\n\n if (isString(target)) {\n target = getById(target.replace(/^#/, ''));\n } else if (isFunction(target)) {\n target = target();\n } else if (target) {\n target = target.$el || target;\n }\n\n return isElement(target) ? target : null;\n },\n getPlacementTarget: function getPlacementTarget() {\n // This is the target that the tooltip will be placed on, which may not\n // necessarily be the same element that has the trigger event listeners\n // For now, this is the same as target\n // TODO:\n // Add in child selector support\n // Add in visibility checks for this element\n // Fallback to target if not found\n return this.getTarget();\n },\n getTargetId: function getTargetId() {\n // Returns the ID of the trigger element\n var target = this.getTarget();\n return target && target.id ? target.id : null;\n },\n getContainer: function getContainer() {\n // Handle case where container may be a component ref\n var container = this.container ? this.container.$el || this.container : false;\n var body = document.body;\n var target = this.getTarget(); // If we are in a modal, we append to the modal, If we\n // are in a sidebar, we append to the sidebar, else append\n // to body, unless a container is specified\n // TODO:\n // Template should periodically check to see if it is in dom\n // And if not, self destruct (if container got v-if'ed out of DOM)\n // Or this could possibly be part of the visibility check\n\n return container === false ? closest(CONTAINER_SELECTOR, target) || body :\n /*istanbul ignore next */\n isString(container) ?\n /*istanbul ignore next */\n getById(container.replace(/^#/, '')) || body :\n /*istanbul ignore next */\n body;\n },\n getBoundary: function getBoundary() {\n return this.boundary ? this.boundary.$el || this.boundary : 'scrollParent';\n },\n isInModal: function isInModal() {\n var target = this.getTarget();\n return target && closest(MODAL_SELECTOR, target);\n },\n isDropdown: function isDropdown() {\n // Returns true if trigger is a dropdown\n var target = this.getTarget();\n return target && hasClass(target, DROPDOWN_CLASS);\n },\n dropdownOpen: function dropdownOpen() {\n // Returns true if trigger is a dropdown and the dropdown menu is open\n var target = this.getTarget();\n return this.isDropdown() && target && select(DROPDOWN_OPEN_SELECTOR, target);\n },\n clearHoverTimeout: function clearHoverTimeout() {\n clearTimeout(this.$_hoverTimeout);\n this.$_hoverTimeout = null;\n },\n clearVisibilityInterval: function clearVisibilityInterval() {\n clearInterval(this.$_visibleInterval);\n this.$_visibleInterval = null;\n },\n clearActiveTriggers: function clearActiveTriggers() {\n for (var trigger in this.activeTrigger) {\n this.activeTrigger[trigger] = false;\n }\n },\n addAriaDescribedby: function addAriaDescribedby() {\n // Add aria-describedby on trigger element, without removing any other IDs\n var target = this.getTarget();\n var desc = getAttr(target, 'aria-describedby') || '';\n desc = desc.split(/\\s+/).concat(this.computedId).join(' ').trim(); // Update/add aria-described by\n\n setAttr(target, 'aria-describedby', desc);\n },\n removeAriaDescribedby: function removeAriaDescribedby() {\n var _this5 = this;\n\n // Remove aria-describedby on trigger element, without removing any other IDs\n var target = this.getTarget();\n var desc = getAttr(target, 'aria-describedby') || '';\n desc = desc.split(/\\s+/).filter(function (d) {\n return d !== _this5.computedId;\n }).join(' ').trim(); // Update or remove aria-describedby\n\n if (desc) {\n /* istanbul ignore next */\n setAttr(target, 'aria-describedby', desc);\n } else {\n removeAttr(target, 'aria-describedby');\n }\n },\n fixTitle: function fixTitle() {\n // If the target has a `title` attribute,\n // remove it and store it on a data attribute\n var target = this.getTarget();\n\n if (hasAttr(target, 'title')) {\n // Get `title` attribute value and remove it from target\n var title = getAttr(target, 'title');\n setAttr(target, 'title', ''); // Only set the data attribute when the value is truthy\n\n if (title) {\n setAttr(target, DATA_TITLE_ATTR, title);\n }\n }\n },\n restoreTitle: function restoreTitle() {\n // If the target had a `title` attribute,\n // restore it and remove the data attribute\n var target = this.getTarget();\n\n if (hasAttr(target, DATA_TITLE_ATTR)) {\n // Get data attribute value and remove it from target\n var title = getAttr(target, DATA_TITLE_ATTR);\n removeAttr(target, DATA_TITLE_ATTR); // Only restore the `title` attribute when the value is truthy\n\n if (title) {\n setAttr(target, 'title', title);\n }\n }\n },\n // --- BvEvent helpers ---\n buildEvent: function buildEvent(type) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // Defaults to a non-cancellable event\n return new BvEvent(type, _objectSpread({\n cancelable: false,\n target: this.getTarget(),\n relatedTarget: this.getTemplateElement() || null,\n componentId: this.computedId,\n vueTarget: this\n }, options));\n },\n emitEvent: function emitEvent(bvEvent) {\n var type = bvEvent.type;\n this.emitOnRoot(getRootEventName(this.templateType, type), bvEvent);\n this.$emit(type, bvEvent);\n },\n // --- Event handler setup methods ---\n listen: function listen() {\n var _this6 = this;\n\n // Enable trigger event handlers\n var el = this.getTarget();\n\n if (!el) {\n /* istanbul ignore next */\n return;\n } // Listen for global show/hide events\n\n\n this.setRootListener(true); // Set up our listeners on the target trigger element\n\n this.computedTriggers.forEach(function (trigger) {\n if (trigger === 'click') {\n eventOn(el, 'click', _this6.handleEvent, EVENT_OPTIONS_NO_CAPTURE);\n } else if (trigger === 'focus') {\n eventOn(el, 'focusin', _this6.handleEvent, EVENT_OPTIONS_NO_CAPTURE);\n eventOn(el, 'focusout', _this6.handleEvent, EVENT_OPTIONS_NO_CAPTURE);\n } else if (trigger === 'blur') {\n // Used to close $tip when element loses focus\n\n /* istanbul ignore next */\n eventOn(el, 'focusout', _this6.handleEvent, EVENT_OPTIONS_NO_CAPTURE);\n } else if (trigger === 'hover') {\n eventOn(el, 'mouseenter', _this6.handleEvent, EVENT_OPTIONS_NO_CAPTURE);\n eventOn(el, 'mouseleave', _this6.handleEvent, EVENT_OPTIONS_NO_CAPTURE);\n }\n }, this);\n },\n\n /* istanbul ignore next */\n unListen: function unListen() {\n var _this7 = this;\n\n // Remove trigger event handlers\n var events = ['click', 'focusin', 'focusout', 'mouseenter', 'mouseleave'];\n var target = this.getTarget(); // Stop listening for global show/hide/enable/disable events\n\n this.setRootListener(false); // Clear out any active target listeners\n\n events.forEach(function (event) {\n target && eventOff(target, event, _this7.handleEvent, EVENT_OPTIONS_NO_CAPTURE);\n }, this);\n },\n setRootListener: function setRootListener(on) {\n // Listen for global `bv::{hide|show}::{tooltip|popover}` hide request event\n var method = on ? 'listenOnRoot' : 'listenOffRoot';\n var type = this.templateType;\n this[method](getRootActionEventName(type, EVENT_NAME_HIDE), this.doHide);\n this[method](getRootActionEventName(type, EVENT_NAME_SHOW), this.doShow);\n this[method](getRootActionEventName(type, EVENT_NAME_DISABLE), this.doDisable);\n this[method](getRootActionEventName(type, EVENT_NAME_ENABLE), this.doEnable);\n },\n setWhileOpenListeners: function setWhileOpenListeners(on) {\n // Events that are only registered when the template is showing\n // Modal close events\n this.setModalListener(on); // Dropdown open events (if we are attached to a dropdown)\n\n this.setDropdownListener(on); // Periodic $element visibility check\n // For handling when tip target is in , tabs, carousel, etc\n\n this.visibleCheck(on); // On-touch start listeners\n\n this.setOnTouchStartListener(on);\n },\n // Handler for periodic visibility check\n visibleCheck: function visibleCheck(on) {\n var _this8 = this;\n\n this.clearVisibilityInterval();\n var target = this.getTarget();\n\n if (on) {\n this.$_visibleInterval = setInterval(function () {\n var tip = _this8.getTemplateElement();\n\n if (tip && _this8.localShow && (!target.parentNode || !isVisible(target))) {\n // Target element is no longer visible or not in DOM, so force-hide the tooltip\n _this8.forceHide();\n }\n }, 100);\n }\n },\n setModalListener: function setModalListener(on) {\n // Handle case where tooltip/target is in a modal\n if (this.isInModal()) {\n // We can listen for modal hidden events on `$root`\n this[on ? 'listenOnRoot' : 'listenOffRoot'](ROOT_EVENT_NAME_MODAL_HIDDEN, this.forceHide);\n }\n },\n\n /* istanbul ignore next: JSDOM doesn't support `ontouchstart` */\n setOnTouchStartListener: function setOnTouchStartListener(on) {\n var _this9 = this;\n\n // If this is a touch-enabled device we add extra empty\n // `mouseover` listeners to the body's immediate children\n // Only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n arrayFrom(document.body.children).forEach(function (el) {\n eventOnOff(on, el, 'mouseover', _this9.$_noop);\n });\n }\n },\n setDropdownListener: function setDropdownListener(on) {\n var target = this.getTarget();\n\n if (!target || !this.bvEventRoot || !this.isDropdown) {\n return;\n } // We can listen for dropdown shown events on its instance\n // TODO:\n // We could grab the ID from the dropdown, and listen for\n // $root events for that particular dropdown id\n // Dropdown shown and hidden events will need to emit\n // Note: Dropdown auto-ID happens in a `$nextTick()` after mount\n // So the ID lookup would need to be done in a `$nextTick()`\n\n\n var instance = getInstanceFromElement(target);\n\n if (instance) {\n instance[on ? '$on' : '$off'](EVENT_NAME_SHOWN, this.forceHide);\n }\n },\n // --- Event handlers ---\n handleEvent: function handleEvent(event) {\n // General trigger event handler\n // target is the trigger element\n var target = this.getTarget();\n\n if (!target || isDisabled(target) || !this.$_enabled || this.dropdownOpen()) {\n // If disabled or not enabled, or if a dropdown that is open, don't do anything\n // If tip is shown before element gets disabled, then tip will not\n // close until no longer disabled or forcefully closed\n return;\n }\n\n var type = event.type;\n var triggers = this.computedTriggers;\n\n if (type === 'click' && arrayIncludes(triggers, 'click')) {\n this.click(event);\n } else if (type === 'mouseenter' && arrayIncludes(triggers, 'hover')) {\n // `mouseenter` is a non-bubbling event\n this.enter(event);\n } else if (type === 'focusin' && arrayIncludes(triggers, 'focus')) {\n // `focusin` is a bubbling event\n // `event` includes `relatedTarget` (element losing focus)\n this.enter(event);\n } else if (type === 'focusout' && (arrayIncludes(triggers, 'focus') || arrayIncludes(triggers, 'blur')) || type === 'mouseleave' && arrayIncludes(triggers, 'hover')) {\n // `focusout` is a bubbling event\n // `mouseleave` is a non-bubbling event\n // `tip` is the template (will be null if not open)\n var tip = this.getTemplateElement(); // `eventTarget` is the element which is losing focus/hover and\n\n var eventTarget = event.target; // `relatedTarget` is the element gaining focus/hover\n\n var relatedTarget = event.relatedTarget;\n /* istanbul ignore next */\n\n if ( // From tip to target\n tip && contains(tip, eventTarget) && contains(target, relatedTarget) || // From target to tip\n tip && contains(target, eventTarget) && contains(tip, relatedTarget) || // Within tip\n tip && contains(tip, eventTarget) && contains(tip, relatedTarget) || // Within target\n contains(target, eventTarget) && contains(target, relatedTarget)) {\n // If focus/hover moves within `tip` and `target`, don't trigger a leave\n return;\n } // Otherwise trigger a leave\n\n\n this.leave(event);\n }\n },\n doHide: function doHide(id) {\n // Programmatically hide tooltip or popover\n if (!id || this.getTargetId() === id || this.computedId === id) {\n // Close all tooltips or popovers, or this specific tip (with ID)\n this.forceHide();\n }\n },\n doShow: function doShow(id) {\n // Programmatically show tooltip or popover\n if (!id || this.getTargetId() === id || this.computedId === id) {\n // Open all tooltips or popovers, or this specific tip (with ID)\n this.show();\n }\n },\n\n /*istanbul ignore next: ignore for now */\n doDisable: function doDisable(id)\n /*istanbul ignore next: ignore for now */\n {\n // Programmatically disable tooltip or popover\n if (!id || this.getTargetId() === id || this.computedId === id) {\n // Disable all tooltips or popovers (no ID), or this specific tip (with ID)\n this.disable();\n }\n },\n\n /*istanbul ignore next: ignore for now */\n doEnable: function doEnable(id)\n /*istanbul ignore next: ignore for now */\n {\n // Programmatically enable tooltip or popover\n if (!id || this.getTargetId() === id || this.computedId === id) {\n // Enable all tooltips or popovers (no ID), or this specific tip (with ID)\n this.enable();\n }\n },\n click: function click(event) {\n if (!this.$_enabled || this.dropdownOpen()) {\n /* istanbul ignore next */\n return;\n } // Get around a WebKit bug where `click` does not trigger focus events\n // On most browsers, `click` triggers a `focusin`/`focus` event first\n // Needed so that trigger 'click blur' works on iOS\n // https://github.com/bootstrap-vue/bootstrap-vue/issues/5099\n // We use `currentTarget` rather than `target` to trigger on the\n // element, not the inner content\n\n\n attemptFocus(event.currentTarget);\n this.activeTrigger.click = !this.activeTrigger.click;\n\n if (this.isWithActiveTrigger) {\n this.enter(null);\n } else {\n /* istanbul ignore next */\n this.leave(null);\n }\n },\n\n /* istanbul ignore next */\n toggle: function toggle() {\n // Manual toggle handler\n if (!this.$_enabled || this.dropdownOpen()) {\n /* istanbul ignore next */\n return;\n } // Should we register as an active trigger?\n // this.activeTrigger.manual = !this.activeTrigger.manual\n\n\n if (this.localShow) {\n this.leave(null);\n } else {\n this.enter(null);\n }\n },\n enter: function enter() {\n var _this10 = this;\n\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n // Opening trigger handler\n // Note: Click events are sent with event === null\n if (event) {\n this.activeTrigger[event.type === 'focusin' ? 'focus' : 'hover'] = true;\n }\n /* istanbul ignore next */\n\n\n if (this.localShow || this.$_hoverState === 'in') {\n this.$_hoverState = 'in';\n return;\n }\n\n this.clearHoverTimeout();\n this.$_hoverState = 'in';\n\n if (!this.computedDelay.show) {\n this.show();\n } else {\n // Hide any title attribute while enter delay is active\n this.fixTitle();\n this.$_hoverTimeout = setTimeout(function () {\n /* istanbul ignore else */\n if (_this10.$_hoverState === 'in') {\n _this10.show();\n } else if (!_this10.localShow) {\n _this10.restoreTitle();\n }\n }, this.computedDelay.show);\n }\n },\n leave: function leave() {\n var _this11 = this;\n\n var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n // Closing trigger handler\n // Note: Click events are sent with event === null\n if (event) {\n this.activeTrigger[event.type === 'focusout' ? 'focus' : 'hover'] = false;\n /* istanbul ignore next */\n\n if (event.type === 'focusout' && arrayIncludes(this.computedTriggers, 'blur')) {\n // Special case for `blur`: we clear out the other triggers\n this.activeTrigger.click = false;\n this.activeTrigger.hover = false;\n }\n }\n /* istanbul ignore next: ignore for now */\n\n\n if (this.isWithActiveTrigger) {\n return;\n }\n\n this.clearHoverTimeout();\n this.$_hoverState = 'out';\n\n if (!this.computedDelay.hide) {\n this.hide();\n } else {\n this.$_hoverTimeout = setTimeout(function () {\n if (_this11.$_hoverState === 'out') {\n _this11.hide();\n }\n }, this.computedDelay.hide);\n }\n }\n }\n});","var _makePropsConfigurabl, _watch;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TOOLTIP } from '../../constants/components';\nimport { EVENT_NAME_CLOSE, EVENT_NAME_DISABLE, EVENT_NAME_DISABLED, EVENT_NAME_ENABLE, EVENT_NAME_ENABLED, EVENT_NAME_HIDDEN, EVENT_NAME_HIDE, EVENT_NAME_OPEN, EVENT_NAME_SHOW, EVENT_NAME_SHOWN, MODEL_EVENT_NAME_PREFIX } from '../../constants/events';\nimport { PROP_TYPE_ARRAY_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_FUNCTION, PROP_TYPE_NUMBER_OBJECT_STRING, PROP_TYPE_NUMBER_STRING, PROP_TYPE_OBJECT, PROP_TYPE_STRING } from '../../constants/props';\nimport { HTMLElement, SVGElement } from '../../constants/safe-types';\nimport { useParentMixin } from '../../mixins/use-parent';\nimport { getScopeId } from '../../utils/get-scope-id';\nimport { isUndefinedOrNull } from '../../utils/inspect';\nimport { pick } from '../../utils/object';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { createNewChildComponent } from '../../utils/create-new-child-component';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { BVTooltip } from './helpers/bv-tooltip'; // --- Constants ---\n\nvar MODEL_PROP_NAME_ENABLED = 'disabled';\nvar MODEL_EVENT_NAME_ENABLED = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_ENABLED;\nvar MODEL_PROP_NAME_SHOW = 'show';\nvar MODEL_EVENT_NAME_SHOW = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_SHOW; // --- Props ---\n\nexport var props = makePropsConfigurable((_makePropsConfigurabl = {\n // String: scrollParent, window, or viewport\n // Element: element reference\n // Object: Vue component\n boundary: makeProp([HTMLElement, PROP_TYPE_OBJECT, PROP_TYPE_STRING], 'scrollParent'),\n boundaryPadding: makeProp(PROP_TYPE_NUMBER_STRING, 50),\n // String: HTML ID of container, if null body is used (default)\n // HTMLElement: element reference reference\n // Object: Vue Component\n container: makeProp([HTMLElement, PROP_TYPE_OBJECT, PROP_TYPE_STRING]),\n customClass: makeProp(PROP_TYPE_STRING),\n delay: makeProp(PROP_TYPE_NUMBER_OBJECT_STRING, 50)\n}, _defineProperty(_makePropsConfigurabl, MODEL_PROP_NAME_ENABLED, makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_makePropsConfigurabl, \"fallbackPlacement\", makeProp(PROP_TYPE_ARRAY_STRING, 'flip')), _defineProperty(_makePropsConfigurabl, \"id\", makeProp(PROP_TYPE_STRING)), _defineProperty(_makePropsConfigurabl, \"noFade\", makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_makePropsConfigurabl, \"noninteractive\", makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_makePropsConfigurabl, \"offset\", makeProp(PROP_TYPE_NUMBER_STRING, 0)), _defineProperty(_makePropsConfigurabl, \"placement\", makeProp(PROP_TYPE_STRING, 'top')), _defineProperty(_makePropsConfigurabl, MODEL_PROP_NAME_SHOW, makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_makePropsConfigurabl, \"target\", makeProp([HTMLElement, SVGElement, PROP_TYPE_FUNCTION, PROP_TYPE_OBJECT, PROP_TYPE_STRING], undefined, true)), _defineProperty(_makePropsConfigurabl, \"title\", makeProp(PROP_TYPE_STRING)), _defineProperty(_makePropsConfigurabl, \"triggers\", makeProp(PROP_TYPE_ARRAY_STRING, 'hover focus')), _defineProperty(_makePropsConfigurabl, \"variant\", makeProp(PROP_TYPE_STRING)), _makePropsConfigurabl), NAME_TOOLTIP); // --- Main component ---\n// @vue/component\n\nexport var BTooltip = /*#__PURE__*/extend({\n name: NAME_TOOLTIP,\n mixins: [normalizeSlotMixin, useParentMixin],\n inheritAttrs: false,\n props: props,\n data: function data() {\n return {\n localShow: this[MODEL_PROP_NAME_SHOW],\n localTitle: '',\n localContent: ''\n };\n },\n computed: {\n // Data that will be passed to the template and popper\n templateData: function templateData() {\n return _objectSpread({\n title: this.localTitle,\n content: this.localContent,\n interactive: !this.noninteractive\n }, pick(this.$props, ['boundary', 'boundaryPadding', 'container', 'customClass', 'delay', 'fallbackPlacement', 'id', 'noFade', 'offset', 'placement', 'target', 'target', 'triggers', 'variant', MODEL_PROP_NAME_ENABLED]));\n },\n // Used to watch for changes to the title and content props\n templateTitleContent: function templateTitleContent() {\n var title = this.title,\n content = this.content;\n return {\n title: title,\n content: content\n };\n }\n },\n watch: (_watch = {}, _defineProperty(_watch, MODEL_PROP_NAME_SHOW, function (newValue, oldValue) {\n if (newValue !== oldValue && newValue !== this.localShow && this.$_toolpop) {\n if (newValue) {\n this.$_toolpop.show();\n } else {\n // We use `forceHide()` to override any active triggers\n this.$_toolpop.forceHide();\n }\n }\n }), _defineProperty(_watch, MODEL_PROP_NAME_ENABLED, function (newValue) {\n if (newValue) {\n this.doDisable();\n } else {\n this.doEnable();\n }\n }), _defineProperty(_watch, \"localShow\", function localShow(newValue) {\n // TODO: May need to be done in a `$nextTick()`\n this.$emit(MODEL_EVENT_NAME_SHOW, newValue);\n }), _defineProperty(_watch, \"templateData\", function templateData() {\n var _this = this;\n\n this.$nextTick(function () {\n if (_this.$_toolpop) {\n _this.$_toolpop.updateData(_this.templateData);\n }\n });\n }), _defineProperty(_watch, \"templateTitleContent\", function templateTitleContent() {\n this.$nextTick(this.updateContent);\n }), _watch),\n created: function created() {\n // Create private non-reactive props\n this.$_toolpop = null;\n },\n updated: function updated() {\n // Update the `propData` object\n // Done in a `$nextTick()` to ensure slot(s) have updated\n this.$nextTick(this.updateContent);\n },\n beforeDestroy: function beforeDestroy() {\n // Shutdown our local event listeners\n this.$off(EVENT_NAME_OPEN, this.doOpen);\n this.$off(EVENT_NAME_CLOSE, this.doClose);\n this.$off(EVENT_NAME_DISABLE, this.doDisable);\n this.$off(EVENT_NAME_ENABLE, this.doEnable); // Destroy the tip instance\n\n if (this.$_toolpop) {\n this.$_toolpop.$destroy();\n this.$_toolpop = null;\n }\n },\n mounted: function mounted() {\n var _this2 = this;\n\n // Instantiate a new BVTooltip instance\n // Done in a `$nextTick()` to ensure DOM has completed rendering\n // so that target can be found\n this.$nextTick(function () {\n // Load the on demand child instance\n var Component = _this2.getComponent(); // Ensure we have initial content\n\n\n _this2.updateContent(); // Pass down the scoped style attribute if available\n\n\n var scopeId = getScopeId(_this2) || getScopeId(_this2.bvParent); // Create the instance\n\n var $toolpop = _this2.$_toolpop = createNewChildComponent(_this2, Component, {\n // Pass down the scoped style ID\n _scopeId: scopeId || undefined\n }); // Set the initial data\n\n $toolpop.updateData(_this2.templateData); // Set listeners\n\n $toolpop.$on(EVENT_NAME_SHOW, _this2.onShow);\n $toolpop.$on(EVENT_NAME_SHOWN, _this2.onShown);\n $toolpop.$on(EVENT_NAME_HIDE, _this2.onHide);\n $toolpop.$on(EVENT_NAME_HIDDEN, _this2.onHidden);\n $toolpop.$on(EVENT_NAME_DISABLED, _this2.onDisabled);\n $toolpop.$on(EVENT_NAME_ENABLED, _this2.onEnabled); // Initially disabled?\n\n if (_this2[MODEL_PROP_NAME_ENABLED]) {\n // Initially disabled\n _this2.doDisable();\n } // Listen to open signals from others\n\n\n _this2.$on(EVENT_NAME_OPEN, _this2.doOpen); // Listen to close signals from others\n\n\n _this2.$on(EVENT_NAME_CLOSE, _this2.doClose); // Listen to disable signals from others\n\n\n _this2.$on(EVENT_NAME_DISABLE, _this2.doDisable); // Listen to enable signals from others\n\n\n _this2.$on(EVENT_NAME_ENABLE, _this2.doEnable); // Initially show tooltip?\n\n\n if (_this2.localShow) {\n $toolpop.show();\n }\n });\n },\n methods: {\n getComponent: function getComponent() {\n // Overridden by BPopover\n return BVTooltip;\n },\n updateContent: function updateContent() {\n // Overridden by BPopover\n // Tooltip: Default slot is `title`\n // Popover: Default slot is `content`, `title` slot is title\n // We pass a scoped slot function reference by default (Vue v2.6x)\n // And pass the title prop as a fallback\n this.setTitle(this.normalizeSlot() || this.title);\n },\n // Helper methods for `updateContent()`\n setTitle: function setTitle(value) {\n value = isUndefinedOrNull(value) ? '' : value; // We only update the value if it has changed\n\n if (this.localTitle !== value) {\n this.localTitle = value;\n }\n },\n setContent: function setContent(value) {\n value = isUndefinedOrNull(value) ? '' : value; // We only update the value if it has changed\n\n if (this.localContent !== value) {\n this.localContent = value;\n }\n },\n // --- Template event handlers ---\n onShow: function onShow(bvEvent) {\n // Placeholder\n this.$emit(EVENT_NAME_SHOW, bvEvent);\n\n if (bvEvent) {\n this.localShow = !bvEvent.defaultPrevented;\n }\n },\n onShown: function onShown(bvEvent) {\n // Tip is now showing\n this.localShow = true;\n this.$emit(EVENT_NAME_SHOWN, bvEvent);\n },\n onHide: function onHide(bvEvent) {\n this.$emit(EVENT_NAME_HIDE, bvEvent);\n },\n onHidden: function onHidden(bvEvent) {\n // Tip is no longer showing\n this.$emit(EVENT_NAME_HIDDEN, bvEvent);\n this.localShow = false;\n },\n onDisabled: function onDisabled(bvEvent) {\n // Prevent possible endless loop if user mistakenly\n // fires `disabled` instead of `disable`\n if (bvEvent && bvEvent.type === EVENT_NAME_DISABLED) {\n this.$emit(MODEL_EVENT_NAME_ENABLED, true);\n this.$emit(EVENT_NAME_DISABLED, bvEvent);\n }\n },\n onEnabled: function onEnabled(bvEvent) {\n // Prevent possible endless loop if user mistakenly\n // fires `enabled` instead of `enable`\n if (bvEvent && bvEvent.type === EVENT_NAME_ENABLED) {\n this.$emit(MODEL_EVENT_NAME_ENABLED, false);\n this.$emit(EVENT_NAME_ENABLED, bvEvent);\n }\n },\n // --- Local event listeners ---\n doOpen: function doOpen() {\n !this.localShow && this.$_toolpop && this.$_toolpop.show();\n },\n doClose: function doClose() {\n this.localShow && this.$_toolpop && this.$_toolpop.hide();\n },\n doDisable: function doDisable() {\n this.$_toolpop && this.$_toolpop.disable();\n },\n doEnable: function doEnable() {\n this.$_toolpop && this.$_toolpop.enable();\n }\n },\n render: function render(h) {\n // Always renders a comment node\n // TODO:\n // Future: Possibly render a target slot (single root element)\n // which we can apply the listeners to (pass `this.$el` to BVTooltip)\n return h();\n }\n});","import { extend } from '../../../vue';\nimport { NAME_POPOVER_TEMPLATE } from '../../../constants/components';\nimport { isFunction, isUndefinedOrNull } from '../../../utils/inspect';\nimport { BVTooltipTemplate } from '../../tooltip/helpers/bv-tooltip-template'; // @vue/component\n\nexport var BVPopoverTemplate = /*#__PURE__*/extend({\n name: NAME_POPOVER_TEMPLATE,\n extends: BVTooltipTemplate,\n computed: {\n templateType: function templateType() {\n return 'popover';\n }\n },\n methods: {\n renderTemplate: function renderTemplate(h) {\n var title = this.title,\n content = this.content; // Title and content could be a scoped slot function\n\n var $title = isFunction(title) ? title({}) : title;\n var $content = isFunction(content) ? content({}) : content; // Directive usage only\n\n var titleDomProps = this.html && !isFunction(title) ? {\n innerHTML: title\n } : {};\n var contentDomProps = this.html && !isFunction(content) ? {\n innerHTML: content\n } : {};\n return h('div', {\n staticClass: 'popover b-popover',\n class: this.templateClasses,\n attrs: this.templateAttributes,\n on: this.templateListeners\n }, [h('div', {\n staticClass: 'arrow',\n ref: 'arrow'\n }), isUndefinedOrNull($title) || $title === '' ?\n /* istanbul ignore next */\n h() : h('h3', {\n staticClass: 'popover-header',\n domProps: titleDomProps\n }, [$title]), isUndefinedOrNull($content) || $content === '' ?\n /* istanbul ignore next */\n h() : h('div', {\n staticClass: 'popover-body',\n domProps: contentDomProps\n }, [$content])]);\n }\n }\n});","// Popover \"Class\" (Built as a renderless Vue instance)\n// Inherits from BVTooltip\n//\n// Handles trigger events, etc.\n// Instantiates template on demand\nimport { extend } from '../../../vue';\nimport { NAME_POPOVER_HELPER } from '../../../constants/components';\nimport { BVTooltip } from '../../tooltip/helpers/bv-tooltip';\nimport { BVPopoverTemplate } from './bv-popover-template'; // @vue/component\n\nexport var BVPopover = /*#__PURE__*/extend({\n name: NAME_POPOVER_HELPER,\n extends: BVTooltip,\n computed: {\n // Overwrites BVTooltip\n templateType: function templateType() {\n return 'popover';\n }\n },\n methods: {\n getTemplate: function getTemplate() {\n // Overwrites BVTooltip\n return BVPopoverTemplate;\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_POPOVER } from '../../constants/components';\nimport { EVENT_NAME_CLICK } from '../../constants/events';\nimport { PROP_TYPE_ARRAY_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_TITLE } from '../../constants/slots';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { BTooltip, props as BTooltipProps } from '../tooltip/tooltip';\nimport { BVPopover } from './helpers/bv-popover';\nimport { sortKeys } from '../../utils/object'; // --- Props ---\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, BTooltipProps), {}, {\n content: makeProp(PROP_TYPE_STRING),\n placement: makeProp(PROP_TYPE_STRING, 'right'),\n triggers: makeProp(PROP_TYPE_ARRAY_STRING, EVENT_NAME_CLICK)\n})), NAME_POPOVER); // --- Main component ---\n// @vue/component\n\nexport var BPopover = /*#__PURE__*/extend({\n name: NAME_POPOVER,\n extends: BTooltip,\n inheritAttrs: false,\n props: props,\n methods: {\n getComponent: function getComponent() {\n // Overridden by BPopover\n return BVPopover;\n },\n updateContent: function updateContent() {\n // Tooltip: Default slot is `title`\n // Popover: Default slot is `content`, `title` slot is title\n // We pass a scoped slot function references by default (Vue v2.6x)\n // And pass the title prop as a fallback\n this.setContent(this.normalizeSlot() || this.content);\n this.setTitle(this.normalizeSlot(SLOT_NAME_TITLE) || this.title);\n }\n } // Render function provided by BTooltip\n\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { NAME_POPOVER } from '../../constants/components';\nimport { IS_BROWSER } from '../../constants/env';\nimport { EVENT_NAME_SHOW } from '../../constants/events';\nimport { concat } from '../../utils/array';\nimport { getComponentConfig } from '../../utils/config';\nimport { getScopeId } from '../../utils/get-scope-id';\nimport { identity } from '../../utils/identity';\nimport { getInstanceFromDirective } from '../../utils/get-instance-from-directive';\nimport { isFunction, isNumber, isPlainObject, isString, isUndefined, isUndefinedOrNull } from '../../utils/inspect';\nimport { looseEqual } from '../../utils/loose-equal';\nimport { toInteger } from '../../utils/number';\nimport { keys } from '../../utils/object';\nimport { createNewChildComponent } from '../../utils/create-new-child-component';\nimport { BVPopover } from '../../components/popover/helpers/bv-popover';\nimport { nextTick } from '../../vue'; // Key which we use to store tooltip object on element\n\nvar BV_POPOVER = '__BV_Popover__'; // Default trigger\n\nvar DefaultTrigger = 'click'; // Valid event triggers\n\nvar validTriggers = {\n focus: true,\n hover: true,\n click: true,\n blur: true,\n manual: true\n}; // Directive modifier test regular expressions. Pre-compile for performance\n\nvar htmlRE = /^html$/i;\nvar noFadeRE = /^nofade$/i;\nvar placementRE = /^(auto|top(left|right)?|bottom(left|right)?|left(top|bottom)?|right(top|bottom)?)$/i;\nvar boundaryRE = /^(window|viewport|scrollParent)$/i;\nvar delayRE = /^d\\d+$/i;\nvar delayShowRE = /^ds\\d+$/i;\nvar delayHideRE = /^dh\\d+$/i;\nvar offsetRE = /^o-?\\d+$/i;\nvar variantRE = /^v-.+$/i;\nvar spacesRE = /\\s+/; // Build a Popover config based on bindings (if any)\n// Arguments and modifiers take precedence over passed value config object\n\nvar parseBindings = function parseBindings(bindings, vnode)\n/* istanbul ignore next: not easy to test */\n{\n // We start out with a basic config\n var config = {\n title: undefined,\n content: undefined,\n trigger: '',\n // Default set below if needed\n placement: 'right',\n fallbackPlacement: 'flip',\n container: false,\n // Default of body\n animation: true,\n offset: 0,\n disabled: false,\n id: null,\n html: false,\n delay: getComponentConfig(NAME_POPOVER, 'delay', 50),\n boundary: String(getComponentConfig(NAME_POPOVER, 'boundary', 'scrollParent')),\n boundaryPadding: toInteger(getComponentConfig(NAME_POPOVER, 'boundaryPadding', 5), 0),\n variant: getComponentConfig(NAME_POPOVER, 'variant'),\n customClass: getComponentConfig(NAME_POPOVER, 'customClass')\n }; // Process `bindings.value`\n\n if (isString(bindings.value) || isNumber(bindings.value)) {\n // Value is popover content (html optionally supported)\n config.content = bindings.value;\n } else if (isFunction(bindings.value)) {\n // Content generator function\n config.content = bindings.value;\n } else if (isPlainObject(bindings.value)) {\n // Value is config object, so merge\n config = _objectSpread(_objectSpread({}, config), bindings.value);\n } // If argument, assume element ID of container element\n\n\n if (bindings.arg) {\n // Element ID specified as arg\n // We must prepend '#' to become a CSS selector\n config.container = \"#\".concat(bindings.arg);\n } // If title is not provided, try title attribute\n\n\n if (isUndefined(config.title)) {\n // Try attribute\n var data = vnode.data || {};\n config.title = data.attrs && !isUndefinedOrNull(data.attrs.title) ? data.attrs.title : undefined;\n } // Normalize delay\n\n\n if (!isPlainObject(config.delay)) {\n config.delay = {\n show: toInteger(config.delay, 0),\n hide: toInteger(config.delay, 0)\n };\n } // Process modifiers\n\n\n keys(bindings.modifiers).forEach(function (mod) {\n if (htmlRE.test(mod)) {\n // Title/content allows HTML\n config.html = true;\n } else if (noFadeRE.test(mod)) {\n // No animation\n config.animation = false;\n } else if (placementRE.test(mod)) {\n // Placement of popover\n config.placement = mod;\n } else if (boundaryRE.test(mod)) {\n // Boundary of popover\n mod = mod === 'scrollparent' ? 'scrollParent' : mod;\n config.boundary = mod;\n } else if (delayRE.test(mod)) {\n // Delay value\n var delay = toInteger(mod.slice(1), 0);\n config.delay.show = delay;\n config.delay.hide = delay;\n } else if (delayShowRE.test(mod)) {\n // Delay show value\n config.delay.show = toInteger(mod.slice(2), 0);\n } else if (delayHideRE.test(mod)) {\n // Delay hide value\n config.delay.hide = toInteger(mod.slice(2), 0);\n } else if (offsetRE.test(mod)) {\n // Offset value, negative allowed\n config.offset = toInteger(mod.slice(1), 0);\n } else if (variantRE.test(mod)) {\n // Variant\n config.variant = mod.slice(2) || null;\n }\n }); // Special handling of event trigger modifiers trigger is\n // a space separated list\n\n var selectedTriggers = {}; // Parse current config object trigger\n\n concat(config.trigger || '').filter(identity).join(' ').trim().toLowerCase().split(spacesRE).forEach(function (trigger) {\n if (validTriggers[trigger]) {\n selectedTriggers[trigger] = true;\n }\n }); // Parse modifiers for triggers\n\n keys(bindings.modifiers).forEach(function (mod) {\n mod = mod.toLowerCase();\n\n if (validTriggers[mod]) {\n // If modifier is a valid trigger\n selectedTriggers[mod] = true;\n }\n }); // Sanitize triggers\n\n config.trigger = keys(selectedTriggers).join(' ');\n\n if (config.trigger === 'blur') {\n // Blur by itself is useless, so convert it to 'focus'\n config.trigger = 'focus';\n }\n\n if (!config.trigger) {\n // Use default trigger\n config.trigger = DefaultTrigger;\n }\n\n return config;\n}; // Add or update Popover on our element\n\n\nvar applyPopover = function applyPopover(el, bindings, vnode) {\n if (!IS_BROWSER) {\n /* istanbul ignore next */\n return;\n }\n\n var config = parseBindings(bindings, vnode);\n\n if (!el[BV_POPOVER]) {\n var parent = getInstanceFromDirective(vnode, bindings);\n el[BV_POPOVER] = createNewChildComponent(parent, BVPopover, {\n // Add the parent's scoped style attribute data\n _scopeId: getScopeId(parent, undefined)\n });\n el[BV_POPOVER].__bv_prev_data__ = {};\n el[BV_POPOVER].$on(EVENT_NAME_SHOW, function ()\n /* istanbul ignore next: for now */\n {\n // Before showing the popover, we update the title\n // and content if they are functions\n var data = {};\n\n if (isFunction(config.title)) {\n data.title = config.title(el);\n }\n\n if (isFunction(config.content)) {\n data.content = config.content(el);\n }\n\n if (keys(data).length > 0) {\n el[BV_POPOVER].updateData(data);\n }\n });\n }\n\n var data = {\n title: config.title,\n content: config.content,\n triggers: config.trigger,\n placement: config.placement,\n fallbackPlacement: config.fallbackPlacement,\n variant: config.variant,\n customClass: config.customClass,\n container: config.container,\n boundary: config.boundary,\n delay: config.delay,\n offset: config.offset,\n noFade: !config.animation,\n id: config.id,\n disabled: config.disabled,\n html: config.html\n };\n var oldData = el[BV_POPOVER].__bv_prev_data__;\n el[BV_POPOVER].__bv_prev_data__ = data;\n\n if (!looseEqual(data, oldData)) {\n // We only update the instance if data has changed\n var newData = {\n target: el\n };\n keys(data).forEach(function (prop) {\n // We only pass data properties that have changed\n if (data[prop] !== oldData[prop]) {\n // If title/content is a function, we execute it here\n newData[prop] = (prop === 'title' || prop === 'content') && isFunction(data[prop]) ?\n /* istanbul ignore next */\n data[prop](el) : data[prop];\n }\n });\n el[BV_POPOVER].updateData(newData);\n }\n}; // Remove Popover from our element\n\n\nvar removePopover = function removePopover(el) {\n if (el[BV_POPOVER]) {\n el[BV_POPOVER].$destroy();\n el[BV_POPOVER] = null;\n }\n\n delete el[BV_POPOVER];\n}; // Export our directive\n\n\nexport var VBPopover = {\n bind: function bind(el, bindings, vnode) {\n applyPopover(el, bindings, vnode);\n },\n // We use `componentUpdated` here instead of `update`, as the former\n // waits until the containing component and children have finished updating\n componentUpdated: function componentUpdated(el, bindings, vnode) {\n // Performed in a `$nextTick()` to prevent endless render/update loops\n nextTick(function () {\n applyPopover(el, bindings, vnode);\n });\n },\n unbind: function unbind(el) {\n removePopover(el);\n }\n};","import { VBPopover } from './popover';\nimport { pluginFactory } from '../../utils/plugins';\nvar VBPopoverPlugin = /*#__PURE__*/pluginFactory({\n directives: {\n VBPopover: VBPopover\n }\n});\nexport { VBPopoverPlugin, VBPopover };","import { BPopover } from './popover';\nimport { VBPopoverPlugin } from '../../directives/popover';\nimport { pluginFactory } from '../../utils/plugins';\nvar PopoverPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BPopover: BPopover\n },\n plugins: {\n VBPopoverPlugin: VBPopoverPlugin\n }\n});\nexport { PopoverPlugin, BPopover };","import { extend } from '../../vue';\nimport { NAME_PROGRESS_BAR } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { htmlOrText } from '../../utils/html';\nimport { isBoolean } from '../../utils/inspect';\nimport { mathMax, mathPow } from '../../utils/math';\nimport { toFixed, toFloat, toInteger } from '../../utils/number';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { toString } from '../../utils/string';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n animated: makeProp(PROP_TYPE_BOOLEAN, null),\n label: makeProp(PROP_TYPE_STRING),\n labelHtml: makeProp(PROP_TYPE_STRING),\n max: makeProp(PROP_TYPE_NUMBER_STRING, null),\n precision: makeProp(PROP_TYPE_NUMBER_STRING, null),\n showProgress: makeProp(PROP_TYPE_BOOLEAN, null),\n showValue: makeProp(PROP_TYPE_BOOLEAN, null),\n striped: makeProp(PROP_TYPE_BOOLEAN, null),\n value: makeProp(PROP_TYPE_NUMBER_STRING, 0),\n variant: makeProp(PROP_TYPE_STRING)\n}, NAME_PROGRESS_BAR); // --- Main component ---\n// @vue/component\n\nexport var BProgressBar = /*#__PURE__*/extend({\n name: NAME_PROGRESS_BAR,\n mixins: [normalizeSlotMixin],\n inject: {\n getBvProgress: {\n default:\n /* istanbul ignore next */\n function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n props: props,\n computed: {\n bvProgress: function bvProgress() {\n return this.getBvProgress();\n },\n progressBarClasses: function progressBarClasses() {\n var computedAnimated = this.computedAnimated,\n computedVariant = this.computedVariant;\n return [computedVariant ? \"bg-\".concat(computedVariant) : '', this.computedStriped || computedAnimated ? 'progress-bar-striped' : '', computedAnimated ? 'progress-bar-animated' : ''];\n },\n progressBarStyles: function progressBarStyles() {\n return {\n width: 100 * (this.computedValue / this.computedMax) + '%'\n };\n },\n computedValue: function computedValue() {\n return toFloat(this.value, 0);\n },\n computedMax: function computedMax() {\n // Prefer our max over parent setting\n // Default to `100` for invalid values (`-x`, `0`, `NaN`)\n var max = toFloat(this.max) || toFloat(this.bvProgress.max, 0);\n return max > 0 ? max : 100;\n },\n computedPrecision: function computedPrecision() {\n // Prefer our precision over parent setting\n // Default to `0` for invalid values (`-x`, `NaN`)\n return mathMax(toInteger(this.precision, toInteger(this.bvProgress.precision, 0)), 0);\n },\n computedProgress: function computedProgress() {\n var precision = this.computedPrecision;\n var p = mathPow(10, precision);\n return toFixed(100 * p * this.computedValue / this.computedMax / p, precision);\n },\n computedVariant: function computedVariant() {\n // Prefer our variant over parent setting\n return this.variant || this.bvProgress.variant;\n },\n computedStriped: function computedStriped() {\n // Prefer our striped over parent setting\n return isBoolean(this.striped) ? this.striped : this.bvProgress.striped || false;\n },\n computedAnimated: function computedAnimated() {\n // Prefer our animated over parent setting\n return isBoolean(this.animated) ? this.animated : this.bvProgress.animated || false;\n },\n computedShowProgress: function computedShowProgress() {\n // Prefer our showProgress over parent setting\n return isBoolean(this.showProgress) ? this.showProgress : this.bvProgress.showProgress || false;\n },\n computedShowValue: function computedShowValue() {\n // Prefer our showValue over parent setting\n return isBoolean(this.showValue) ? this.showValue : this.bvProgress.showValue || false;\n }\n },\n render: function render(h) {\n var label = this.label,\n labelHtml = this.labelHtml,\n computedValue = this.computedValue,\n computedPrecision = this.computedPrecision;\n var $children;\n var domProps = {};\n\n if (this.hasNormalizedSlot()) {\n $children = this.normalizeSlot();\n } else if (label || labelHtml) {\n domProps = htmlOrText(labelHtml, label);\n } else if (this.computedShowProgress) {\n $children = this.computedProgress;\n } else if (this.computedShowValue) {\n $children = toFixed(computedValue, computedPrecision);\n }\n\n return h('div', {\n staticClass: 'progress-bar',\n class: this.progressBarClasses,\n style: this.progressBarStyles,\n attrs: {\n role: 'progressbar',\n 'aria-valuemin': '0',\n 'aria-valuemax': toString(this.computedMax),\n 'aria-valuenow': toFixed(computedValue, computedPrecision)\n },\n domProps: domProps\n }, $children);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_PROGRESS } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { omit, sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { BProgressBar, props as BProgressBarProps } from './progress-bar'; // --- Props ---\n\nvar progressBarProps = omit(BProgressBarProps, ['label', 'labelHtml']);\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, progressBarProps), {}, {\n animated: makeProp(PROP_TYPE_BOOLEAN, false),\n height: makeProp(PROP_TYPE_STRING),\n max: makeProp(PROP_TYPE_NUMBER_STRING, 100),\n precision: makeProp(PROP_TYPE_NUMBER_STRING, 0),\n showProgress: makeProp(PROP_TYPE_BOOLEAN, false),\n showValue: makeProp(PROP_TYPE_BOOLEAN, false),\n striped: makeProp(PROP_TYPE_BOOLEAN, false)\n})), NAME_PROGRESS); // --- Main component ---\n// @vue/component\n\nexport var BProgress = /*#__PURE__*/extend({\n name: NAME_PROGRESS,\n mixins: [normalizeSlotMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvProgress: function getBvProgress() {\n return _this;\n }\n };\n },\n props: props,\n computed: {\n progressHeight: function progressHeight() {\n return {\n height: this.height || null\n };\n }\n },\n render: function render(h) {\n var $childNodes = this.normalizeSlot();\n\n if (!$childNodes) {\n $childNodes = h(BProgressBar, {\n props: pluckProps(progressBarProps, this.$props)\n });\n }\n\n return h('div', {\n staticClass: 'progress',\n style: this.progressHeight\n }, [$childNodes]);\n }\n});","var _watch;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_COLLAPSE, NAME_SIDEBAR } from '../../constants/components';\nimport { IS_BROWSER } from '../../constants/env';\nimport { EVENT_NAME_CHANGE, EVENT_NAME_HIDDEN, EVENT_NAME_SHOWN } from '../../constants/events';\nimport { CODE_ESC } from '../../constants/key-codes';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_BOOLEAN_STRING, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_DEFAULT, SLOT_NAME_FOOTER, SLOT_NAME_HEADER, SLOT_NAME_HEADER_CLOSE, SLOT_NAME_TITLE } from '../../constants/slots';\nimport { attemptFocus, contains, getActiveElement, getTabables } from '../../utils/dom';\nimport { getRootActionEventName, getRootEventName } from '../../utils/events';\nimport { makeModelMixin } from '../../utils/model';\nimport { sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { listenOnRootMixin } from '../../mixins/listen-on-root';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { BIconX } from '../../icons/icons';\nimport { BButtonClose } from '../button/button-close';\nimport { BVTransition } from '../transition/bv-transition'; // --- Constants ---\n\nvar CLASS_NAME = 'b-sidebar';\nvar ROOT_ACTION_EVENT_NAME_REQUEST_STATE = getRootActionEventName(NAME_COLLAPSE, 'request-state');\nvar ROOT_ACTION_EVENT_NAME_TOGGLE = getRootActionEventName(NAME_COLLAPSE, 'toggle');\nvar ROOT_EVENT_NAME_STATE = getRootEventName(NAME_COLLAPSE, 'state');\nvar ROOT_EVENT_NAME_SYNC_STATE = getRootEventName(NAME_COLLAPSE, 'sync-state');\n\nvar _makeModelMixin = makeModelMixin('visible', {\n type: PROP_TYPE_BOOLEAN,\n defaultValue: false,\n event: EVENT_NAME_CHANGE\n}),\n modelMixin = _makeModelMixin.mixin,\n modelProps = _makeModelMixin.props,\n MODEL_PROP_NAME = _makeModelMixin.prop,\n MODEL_EVENT_NAME = _makeModelMixin.event; // --- Props ---\n\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread(_objectSpread({}, idProps), modelProps), {}, {\n ariaLabel: makeProp(PROP_TYPE_STRING),\n ariaLabelledby: makeProp(PROP_TYPE_STRING),\n // If `true`, shows a basic backdrop\n backdrop: makeProp(PROP_TYPE_BOOLEAN, false),\n backdropVariant: makeProp(PROP_TYPE_STRING, 'dark'),\n bgVariant: makeProp(PROP_TYPE_STRING, 'light'),\n bodyClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n // `aria-label` for close button\n closeLabel: makeProp(PROP_TYPE_STRING),\n footerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n footerTag: makeProp(PROP_TYPE_STRING, 'footer'),\n headerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n headerTag: makeProp(PROP_TYPE_STRING, 'header'),\n lazy: makeProp(PROP_TYPE_BOOLEAN, false),\n noCloseOnBackdrop: makeProp(PROP_TYPE_BOOLEAN, false),\n noCloseOnEsc: makeProp(PROP_TYPE_BOOLEAN, false),\n noCloseOnRouteChange: makeProp(PROP_TYPE_BOOLEAN, false),\n noEnforceFocus: makeProp(PROP_TYPE_BOOLEAN, false),\n noHeader: makeProp(PROP_TYPE_BOOLEAN, false),\n noHeaderClose: makeProp(PROP_TYPE_BOOLEAN, false),\n noSlide: makeProp(PROP_TYPE_BOOLEAN, false),\n right: makeProp(PROP_TYPE_BOOLEAN, false),\n shadow: makeProp(PROP_TYPE_BOOLEAN_STRING, false),\n sidebarClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n tag: makeProp(PROP_TYPE_STRING, 'div'),\n textVariant: makeProp(PROP_TYPE_STRING, 'dark'),\n title: makeProp(PROP_TYPE_STRING),\n width: makeProp(PROP_TYPE_STRING),\n zIndex: makeProp(PROP_TYPE_NUMBER_STRING)\n})), NAME_SIDEBAR); // --- Render methods ---\n\nvar renderHeaderTitle = function renderHeaderTitle(h, ctx) {\n // Render a empty `` when to title was provided\n var title = ctx.normalizeSlot(SLOT_NAME_TITLE, ctx.slotScope) || ctx.title;\n\n if (!title) {\n return h('span');\n }\n\n return h('strong', {\n attrs: {\n id: ctx.safeId('__title__')\n }\n }, [title]);\n};\n\nvar renderHeaderClose = function renderHeaderClose(h, ctx) {\n if (ctx.noHeaderClose) {\n return h();\n }\n\n var closeLabel = ctx.closeLabel,\n textVariant = ctx.textVariant,\n hide = ctx.hide;\n return h(BButtonClose, {\n props: {\n ariaLabel: closeLabel,\n textVariant: textVariant\n },\n on: {\n click: hide\n },\n ref: 'close-button'\n }, [ctx.normalizeSlot(SLOT_NAME_HEADER_CLOSE) || h(BIconX)]);\n};\n\nvar renderHeader = function renderHeader(h, ctx) {\n if (ctx.noHeader) {\n return h();\n }\n\n var $content = ctx.normalizeSlot(SLOT_NAME_HEADER, ctx.slotScope);\n\n if (!$content) {\n var $title = renderHeaderTitle(h, ctx);\n var $close = renderHeaderClose(h, ctx);\n $content = ctx.right ? [$close, $title] : [$title, $close];\n }\n\n return h(ctx.headerTag, {\n staticClass: \"\".concat(CLASS_NAME, \"-header\"),\n class: ctx.headerClass,\n key: 'header'\n }, $content);\n};\n\nvar renderBody = function renderBody(h, ctx) {\n return h('div', {\n staticClass: \"\".concat(CLASS_NAME, \"-body\"),\n class: ctx.bodyClass,\n key: 'body'\n }, [ctx.normalizeSlot(SLOT_NAME_DEFAULT, ctx.slotScope)]);\n};\n\nvar renderFooter = function renderFooter(h, ctx) {\n var $footer = ctx.normalizeSlot(SLOT_NAME_FOOTER, ctx.slotScope);\n\n if (!$footer) {\n return h();\n }\n\n return h(ctx.footerTag, {\n staticClass: \"\".concat(CLASS_NAME, \"-footer\"),\n class: ctx.footerClass,\n key: 'footer'\n }, [$footer]);\n};\n\nvar renderContent = function renderContent(h, ctx) {\n // We render the header even if `lazy` is enabled as it\n // acts as the accessible label for the sidebar\n var $header = renderHeader(h, ctx);\n\n if (ctx.lazy && !ctx.isOpen) {\n return $header;\n }\n\n return [$header, renderBody(h, ctx), renderFooter(h, ctx)];\n};\n\nvar renderBackdrop = function renderBackdrop(h, ctx) {\n if (!ctx.backdrop) {\n return h();\n }\n\n var backdropVariant = ctx.backdropVariant;\n return h('div', {\n directives: [{\n name: 'show',\n value: ctx.localShow\n }],\n staticClass: 'b-sidebar-backdrop',\n class: _defineProperty({}, \"bg-\".concat(backdropVariant), backdropVariant),\n on: {\n click: ctx.onBackdropClick\n }\n });\n}; // --- Main component ---\n// @vue/component\n\n\nexport var BSidebar = /*#__PURE__*/extend({\n name: NAME_SIDEBAR,\n mixins: [attrsMixin, idMixin, modelMixin, listenOnRootMixin, normalizeSlotMixin],\n inheritAttrs: false,\n props: props,\n data: function data() {\n var visible = !!this[MODEL_PROP_NAME];\n return {\n // Internal `v-model` state\n localShow: visible,\n // For lazy render triggering\n isOpen: visible\n };\n },\n computed: {\n transitionProps: function transitionProps() {\n return this.noSlide ?\n /* istanbul ignore next */\n {\n css: true\n } : {\n css: true,\n enterClass: '',\n enterActiveClass: 'slide',\n enterToClass: 'show',\n leaveClass: 'show',\n leaveActiveClass: 'slide',\n leaveToClass: ''\n };\n },\n slotScope: function slotScope() {\n var hide = this.hide,\n right = this.right,\n visible = this.localShow;\n return {\n hide: hide,\n right: right,\n visible: visible\n };\n },\n hasTitle: function hasTitle() {\n var $scopedSlots = this.$scopedSlots,\n $slots = this.$slots;\n return !this.noHeader && !this.hasNormalizedSlot(SLOT_NAME_HEADER) && !!(this.normalizeSlot(SLOT_NAME_TITLE, this.slotScope, $scopedSlots, $slots) || this.title);\n },\n titleId: function titleId() {\n return this.hasTitle ? this.safeId('__title__') : null;\n },\n computedAttrs: function computedAttrs() {\n return _objectSpread(_objectSpread({}, this.bvAttrs), {}, {\n id: this.safeId(),\n tabindex: '-1',\n role: 'dialog',\n 'aria-modal': this.backdrop ? 'true' : 'false',\n 'aria-hidden': this.localShow ? null : 'true',\n 'aria-label': this.ariaLabel || null,\n 'aria-labelledby': this.ariaLabelledby || this.titleId || null\n });\n }\n },\n watch: (_watch = {}, _defineProperty(_watch, MODEL_PROP_NAME, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n this.localShow = newValue;\n }\n }), _defineProperty(_watch, \"localShow\", function localShow(newValue, oldValue) {\n if (newValue !== oldValue) {\n this.emitState(newValue);\n this.$emit(MODEL_EVENT_NAME, newValue);\n }\n }), _defineProperty(_watch, \"$route\", function $route() {\n var newValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var oldValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!this.noCloseOnRouteChange && newValue.fullPath !== oldValue.fullPath) {\n this.hide();\n }\n }), _watch),\n created: function created() {\n // Define non-reactive properties\n this.$_returnFocusEl = null;\n },\n mounted: function mounted() {\n var _this = this;\n\n // Add `$root` listeners\n this.listenOnRoot(ROOT_ACTION_EVENT_NAME_TOGGLE, this.handleToggle);\n this.listenOnRoot(ROOT_ACTION_EVENT_NAME_REQUEST_STATE, this.handleSync); // Send out a gratuitous state event to ensure toggle button is synced\n\n this.$nextTick(function () {\n _this.emitState(_this.localShow);\n });\n },\n\n /* istanbul ignore next */\n activated: function activated() {\n this.emitSync();\n },\n beforeDestroy: function beforeDestroy() {\n this.localShow = false;\n this.$_returnFocusEl = null;\n },\n methods: {\n hide: function hide() {\n this.localShow = false;\n },\n emitState: function emitState() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.localShow;\n this.emitOnRoot(ROOT_EVENT_NAME_STATE, this.safeId(), state);\n },\n emitSync: function emitSync() {\n var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.localShow;\n this.emitOnRoot(ROOT_EVENT_NAME_SYNC_STATE, this.safeId(), state);\n },\n handleToggle: function handleToggle(id) {\n // Note `safeId()` can be null until after mount\n if (id && id === this.safeId()) {\n this.localShow = !this.localShow;\n }\n },\n handleSync: function handleSync(id) {\n var _this2 = this;\n\n // Note `safeId()` can be null until after mount\n if (id && id === this.safeId()) {\n this.$nextTick(function () {\n _this2.emitSync(_this2.localShow);\n });\n }\n },\n onKeydown: function onKeydown(event) {\n var keyCode = event.keyCode;\n\n if (!this.noCloseOnEsc && keyCode === CODE_ESC && this.localShow) {\n this.hide();\n }\n },\n onBackdropClick: function onBackdropClick() {\n if (this.localShow && !this.noCloseOnBackdrop) {\n this.hide();\n }\n },\n\n /* istanbul ignore next */\n onTopTrapFocus: function onTopTrapFocus() {\n var tabables = getTabables(this.$refs.content);\n this.enforceFocus(tabables.reverse()[0]);\n },\n\n /* istanbul ignore next */\n onBottomTrapFocus: function onBottomTrapFocus() {\n var tabables = getTabables(this.$refs.content);\n this.enforceFocus(tabables[0]);\n },\n onBeforeEnter: function onBeforeEnter() {\n // Returning focus to `document.body` may cause unwanted scrolls,\n // so we exclude setting focus on body\n this.$_returnFocusEl = getActiveElement(IS_BROWSER ? [document.body] : []); // Trigger lazy render\n\n this.isOpen = true;\n },\n onAfterEnter: function onAfterEnter(el) {\n if (!contains(el, getActiveElement())) {\n this.enforceFocus(el);\n }\n\n this.$emit(EVENT_NAME_SHOWN);\n },\n onAfterLeave: function onAfterLeave() {\n this.enforceFocus(this.$_returnFocusEl);\n this.$_returnFocusEl = null; // Trigger lazy render\n\n this.isOpen = false;\n this.$emit(EVENT_NAME_HIDDEN);\n },\n enforceFocus: function enforceFocus(el) {\n if (!this.noEnforceFocus) {\n attemptFocus(el);\n }\n }\n },\n render: function render(h) {\n var _ref;\n\n var bgVariant = this.bgVariant,\n width = this.width,\n textVariant = this.textVariant,\n localShow = this.localShow;\n var shadow = this.shadow === '' ? true : this.shadow;\n var $sidebar = h(this.tag, {\n staticClass: CLASS_NAME,\n class: [(_ref = {\n shadow: shadow === true\n }, _defineProperty(_ref, \"shadow-\".concat(shadow), shadow && shadow !== true), _defineProperty(_ref, \"\".concat(CLASS_NAME, \"-right\"), this.right), _defineProperty(_ref, \"bg-\".concat(bgVariant), bgVariant), _defineProperty(_ref, \"text-\".concat(textVariant), textVariant), _ref), this.sidebarClass],\n style: {\n width: width\n },\n attrs: this.computedAttrs,\n directives: [{\n name: 'show',\n value: localShow\n }],\n ref: 'content'\n }, [renderContent(h, this)]);\n $sidebar = h('transition', {\n props: this.transitionProps,\n on: {\n beforeEnter: this.onBeforeEnter,\n afterEnter: this.onAfterEnter,\n afterLeave: this.onAfterLeave\n }\n }, [$sidebar]);\n var $backdrop = h(BVTransition, {\n props: {\n noFade: this.noSlide\n }\n }, [renderBackdrop(h, this)]);\n var $tabTrapTop = h();\n var $tabTrapBottom = h();\n\n if (this.backdrop && localShow) {\n $tabTrapTop = h('div', {\n attrs: {\n tabindex: '0'\n },\n on: {\n focus: this.onTopTrapFocus\n }\n });\n $tabTrapBottom = h('div', {\n attrs: {\n tabindex: '0'\n },\n on: {\n focus: this.onBottomTrapFocus\n }\n });\n }\n\n return h('div', {\n staticClass: 'b-sidebar-outer',\n style: {\n zIndex: this.zIndex\n },\n attrs: {\n tabindex: '-1'\n },\n on: {\n keydown: this.onKeydown\n }\n }, [$tabTrapTop, $sidebar, $tabTrapBottom, $backdrop]);\n }\n});","import { BProgress } from './progress';\nimport { BProgressBar } from './progress-bar';\nimport { pluginFactory } from '../../utils/plugins';\nvar ProgressPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BProgress: BProgress,\n BProgressBar: BProgressBar\n }\n});\nexport { ProgressPlugin, BProgress, BProgressBar };","import { BSidebar } from './sidebar';\nimport { VBTogglePlugin } from '../../directives/toggle';\nimport { pluginFactory } from '../../utils/plugins';\nvar SidebarPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BSidebar: BSidebar\n },\n plugins: {\n VBTogglePlugin: VBTogglePlugin\n }\n});\nexport { SidebarPlugin, BSidebar };","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_SKELETON } from '../../constants/components';\nimport { PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n animation: makeProp(PROP_TYPE_STRING, 'wave'),\n height: makeProp(PROP_TYPE_STRING),\n size: makeProp(PROP_TYPE_STRING),\n type: makeProp(PROP_TYPE_STRING, 'text'),\n variant: makeProp(PROP_TYPE_STRING),\n width: makeProp(PROP_TYPE_STRING)\n}, NAME_SKELETON); // --- Main component ---\n// @vue/component\n\nexport var BSkeleton = /*#__PURE__*/extend({\n name: NAME_SKELETON,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var _class;\n\n var data = _ref.data,\n props = _ref.props;\n var size = props.size,\n animation = props.animation,\n variant = props.variant;\n return h('div', mergeData(data, {\n staticClass: 'b-skeleton',\n style: {\n width: size || props.width,\n height: size || props.height\n },\n class: (_class = {}, _defineProperty(_class, \"b-skeleton-\".concat(props.type), true), _defineProperty(_class, \"b-skeleton-animate-\".concat(animation), animation), _defineProperty(_class, \"bg-\".concat(variant), variant), _class)\n }));\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_SKELETON_ICON } from '../../constants/components';\nimport { PROP_TYPE_OBJECT, PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { BIcon } from '../../icons'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n animation: makeProp(PROP_TYPE_STRING, 'wave'),\n icon: makeProp(PROP_TYPE_STRING),\n iconProps: makeProp(PROP_TYPE_OBJECT, {})\n}, NAME_SKELETON_ICON); // --- Main component ---\n// @vue/component\n\nexport var BSkeletonIcon = /*#__PURE__*/extend({\n name: NAME_SKELETON_ICON,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var data = _ref.data,\n props = _ref.props;\n var icon = props.icon,\n animation = props.animation;\n var $icon = h(BIcon, {\n staticClass: 'b-skeleton-icon',\n props: _objectSpread(_objectSpread({}, props.iconProps), {}, {\n icon: icon\n })\n });\n return h('div', mergeData(data, {\n staticClass: 'b-skeleton-icon-wrapper position-relative d-inline-block overflow-hidden',\n class: _defineProperty({}, \"b-skeleton-animate-\".concat(animation), animation)\n }), [$icon]);\n }\n});","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_SKELETON_IMG } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { BAspect } from '../aspect';\nimport { BSkeleton } from './skeleton'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n animation: makeProp(PROP_TYPE_STRING),\n aspect: makeProp(PROP_TYPE_STRING, '16:9'),\n cardImg: makeProp(PROP_TYPE_STRING),\n height: makeProp(PROP_TYPE_STRING),\n noAspect: makeProp(PROP_TYPE_BOOLEAN, false),\n variant: makeProp(PROP_TYPE_STRING),\n width: makeProp(PROP_TYPE_STRING)\n}, NAME_SKELETON_IMG); // --- Main component ---\n// @vue/component\n\nexport var BSkeletonImg = /*#__PURE__*/extend({\n name: NAME_SKELETON_IMG,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var data = _ref.data,\n props = _ref.props;\n var aspect = props.aspect,\n width = props.width,\n height = props.height,\n animation = props.animation,\n variant = props.variant,\n cardImg = props.cardImg;\n var $img = h(BSkeleton, mergeData(data, {\n props: {\n type: 'img',\n width: width,\n height: height,\n animation: animation,\n variant: variant\n },\n class: _defineProperty({}, \"card-img-\".concat(cardImg), cardImg)\n }));\n return props.noAspect ? $img : h(BAspect, {\n props: {\n aspect: aspect\n }\n }, [$img]);\n }\n});","// Mixin to determine if an event listener has been registered\n// either via `v-on:name` (in the parent) or programmatically\n// via `vm.$on('name', ...)`\n// See: https://github.com/vuejs/vue/issues/10825\nimport { isVue3, extend } from '../vue';\nimport { isArray, isUndefined } from '../utils/inspect'; // @vue/component\n\nexport var hasListenerMixin = extend({\n methods: {\n hasListener: function hasListener(name) {\n if (isVue3) {\n return true;\n } // Only includes listeners registered via `v-on:name`\n\n\n var $listeners = this.$listeners || {}; // Includes `v-on:name` and `this.$on('name')` registered listeners\n // Note this property is not part of the public Vue API, but it is\n // the only way to determine if a listener was added via `vm.$on`\n\n var $events = this._events || {}; // Registered listeners in `this._events` are always an array,\n // but might be zero length\n\n return !isUndefined($listeners[name]) || isArray($events[name]) && $events[name].length > 0;\n }\n }\n});","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { PROP_TYPE_BOOLEAN_STRING } from '../../../constants/props';\nimport { makeProp } from '../../../utils/props'; // --- Props ---\n\nexport var props = {\n stacked: makeProp(PROP_TYPE_BOOLEAN_STRING, false)\n}; // --- Mixin ---\n// @vue/component\n\nexport var stackedMixin = extend({\n props: props,\n computed: {\n isStacked: function isStacked() {\n var stacked = this.stacked; // `true` when always stacked, or returns breakpoint specified\n\n return stacked === '' ? true : stacked;\n },\n isStackedAlways: function isStackedAlways() {\n return this.isStacked === true;\n },\n stackedTableClasses: function stackedTableClasses() {\n var isStackedAlways = this.isStackedAlways;\n return _defineProperty({\n 'b-table-stacked': isStackedAlways\n }, \"b-table-stacked-\".concat(this.stacked), !isStackedAlways && this.isStacked);\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_BOOLEAN_STRING, PROP_TYPE_STRING } from '../../../constants/props';\nimport { identity } from '../../../utils/identity';\nimport { isBoolean } from '../../../utils/inspect';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { toString } from '../../../utils/string';\nimport { attrsMixin } from '../../../mixins/attrs'; // Main `` render mixin\n// Includes all main table styling options\n// --- Props ---\n\nexport var props = {\n bordered: makeProp(PROP_TYPE_BOOLEAN, false),\n borderless: makeProp(PROP_TYPE_BOOLEAN, false),\n captionTop: makeProp(PROP_TYPE_BOOLEAN, false),\n dark: makeProp(PROP_TYPE_BOOLEAN, false),\n fixed: makeProp(PROP_TYPE_BOOLEAN, false),\n hover: makeProp(PROP_TYPE_BOOLEAN, false),\n noBorderCollapse: makeProp(PROP_TYPE_BOOLEAN, false),\n outlined: makeProp(PROP_TYPE_BOOLEAN, false),\n responsive: makeProp(PROP_TYPE_BOOLEAN_STRING, false),\n small: makeProp(PROP_TYPE_BOOLEAN, false),\n // If a string, it is assumed to be the table `max-height` value\n stickyHeader: makeProp(PROP_TYPE_BOOLEAN_STRING, false),\n striped: makeProp(PROP_TYPE_BOOLEAN, false),\n tableClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n tableVariant: makeProp(PROP_TYPE_STRING)\n}; // --- Mixin ---\n// @vue/component\n\nexport var tableRendererMixin = extend({\n mixins: [attrsMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvTable: function getBvTable() {\n return _this;\n }\n };\n },\n // Don't place attributes on root element automatically,\n // as table could be wrapped in responsive ``\n inheritAttrs: false,\n props: props,\n computed: {\n isTableSimple: function isTableSimple() {\n return false;\n },\n // Layout related computed props\n isResponsive: function isResponsive() {\n var responsive = this.responsive;\n return responsive === '' ? true : responsive;\n },\n isStickyHeader: function isStickyHeader() {\n var stickyHeader = this.stickyHeader;\n stickyHeader = stickyHeader === '' ? true : stickyHeader;\n return this.isStacked ? false : stickyHeader;\n },\n wrapperClasses: function wrapperClasses() {\n var isResponsive = this.isResponsive;\n return [this.isStickyHeader ? 'b-table-sticky-header' : '', isResponsive === true ? 'table-responsive' : isResponsive ? \"table-responsive-\".concat(this.responsive) : ''].filter(identity);\n },\n wrapperStyles: function wrapperStyles() {\n var isStickyHeader = this.isStickyHeader;\n return isStickyHeader && !isBoolean(isStickyHeader) ? {\n maxHeight: isStickyHeader\n } : {};\n },\n tableClasses: function tableClasses() {\n var _safeVueInstance = safeVueInstance(this),\n hover = _safeVueInstance.hover,\n tableVariant = _safeVueInstance.tableVariant,\n selectableTableClasses = _safeVueInstance.selectableTableClasses,\n stackedTableClasses = _safeVueInstance.stackedTableClasses,\n tableClass = _safeVueInstance.tableClass,\n computedBusy = _safeVueInstance.computedBusy;\n\n hover = this.isTableSimple ? hover : hover && this.computedItems.length > 0 && !computedBusy;\n return [// User supplied classes\n tableClass, // Styling classes\n {\n 'table-striped': this.striped,\n 'table-hover': hover,\n 'table-dark': this.dark,\n 'table-bordered': this.bordered,\n 'table-borderless': this.borderless,\n 'table-sm': this.small,\n // The following are b-table custom styles\n border: this.outlined,\n 'b-table-fixed': this.fixed,\n 'b-table-caption-top': this.captionTop,\n 'b-table-no-border-collapse': this.noBorderCollapse\n }, tableVariant ? \"\".concat(this.dark ? 'bg' : 'table', \"-\").concat(tableVariant) : '', // Stacked table classes\n stackedTableClasses, // Selectable classes\n selectableTableClasses];\n },\n tableAttrs: function tableAttrs() {\n var _safeVueInstance2 = safeVueInstance(this),\n items = _safeVueInstance2.computedItems,\n filteredItems = _safeVueInstance2.filteredItems,\n fields = _safeVueInstance2.computedFields,\n selectableTableAttrs = _safeVueInstance2.selectableTableAttrs,\n computedBusy = _safeVueInstance2.computedBusy;\n\n var ariaAttrs = this.isTableSimple ? {} : {\n 'aria-busy': toString(computedBusy),\n 'aria-colcount': toString(fields.length),\n // Preserve user supplied `aria-describedby`, if provided\n 'aria-describedby': this.bvAttrs['aria-describedby'] || this.$refs.caption ? this.captionId : null\n };\n var rowCount = items && filteredItems && filteredItems.length > items.length ? toString(filteredItems.length) : null;\n return _objectSpread(_objectSpread(_objectSpread({\n // We set `aria-rowcount` before merging in `$attrs`,\n // in case user has supplied their own\n 'aria-rowcount': rowCount\n }, this.bvAttrs), {}, {\n // Now we can override any `$attrs` here\n id: this.safeId(),\n role: this.bvAttrs.role || 'table'\n }, ariaAttrs), selectableTableAttrs);\n }\n },\n render: function render(h) {\n var _safeVueInstance3 = safeVueInstance(this),\n wrapperClasses = _safeVueInstance3.wrapperClasses,\n renderCaption = _safeVueInstance3.renderCaption,\n renderColgroup = _safeVueInstance3.renderColgroup,\n renderThead = _safeVueInstance3.renderThead,\n renderTbody = _safeVueInstance3.renderTbody,\n renderTfoot = _safeVueInstance3.renderTfoot;\n\n var $content = [];\n\n if (this.isTableSimple) {\n $content.push(this.normalizeSlot());\n } else {\n // Build the `
` (from caption mixin)\n $content.push(renderCaption ? renderCaption() : null); // Build the ` `\n\n $content.push(renderColgroup ? renderColgroup() : null); // Build the ` `\n\n $content.push(renderThead ? renderThead() : null); // Build the ` `\n\n $content.push(renderTbody ? renderTbody() : null); // Build the ` `\n\n $content.push(renderTfoot ? renderTfoot() : null);\n } // Assemble ``\n\n\n var $table = h('table', {\n staticClass: 'table b-table',\n class: this.tableClasses,\n attrs: this.tableAttrs,\n key: 'b-table'\n }, $content.filter(identity)); // Add responsive/sticky wrapper if needed and return table\n\n return wrapperClasses.length > 0 ? h('div', {\n class: wrapperClasses,\n style: this.wrapperStyles,\n key: 'wrap'\n }, [$table]) : $table;\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TABLE_SIMPLE } from '../../constants/components';\nimport { sortKeys } from '../../utils/object';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { hasListenerMixin } from '../../mixins/has-listener';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { stackedMixin, props as stackedProps } from './helpers/mixin-stacked';\nimport { tableRendererMixin, props as tableRendererProps } from './helpers/mixin-table-renderer'; // --- Props ---\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread(_objectSpread({}, idProps), stackedProps), tableRendererProps)), NAME_TABLE_SIMPLE); // --- Main component ---\n// @vue/component\n\nexport var BTableSimple = /*#__PURE__*/extend({\n name: NAME_TABLE_SIMPLE,\n // Order of mixins is important!\n // They are merged from first to last, followed by this component\n mixins: [// General mixins\n attrsMixin, hasListenerMixin, idMixin, normalizeSlotMixin, // Required table mixins\n tableRendererMixin, // Table features mixins\n // Stacked requires extra handling by users via\n // the table cell `stacked-heading` prop\n stackedMixin],\n props: props,\n computed: {\n isTableSimple: function isTableSimple() {\n return true;\n }\n } // Render function is provided by `tableRendererMixin`\n\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_SKELETON_TABLE } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER, PROP_TYPE_OBJECT, PROP_TYPE_STRING } from '../../constants/props';\nimport { createArray } from '../../utils/array';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { BSkeleton } from './skeleton';\nimport { BTableSimple } from '../table'; // --- Helper methods ---\n\nvar isPositiveNumber = function isPositiveNumber(value) {\n return value > 0;\n}; // --- Props ---\n\n\nexport var props = makePropsConfigurable({\n animation: makeProp(PROP_TYPE_STRING),\n columns: makeProp(PROP_TYPE_NUMBER, 5, isPositiveNumber),\n hideHeader: makeProp(PROP_TYPE_BOOLEAN, false),\n rows: makeProp(PROP_TYPE_NUMBER, 3, isPositiveNumber),\n showFooter: makeProp(PROP_TYPE_BOOLEAN, false),\n tableProps: makeProp(PROP_TYPE_OBJECT, {})\n}, NAME_SKELETON_TABLE); // --- Main component ---\n// @vue/component\n\nexport var BSkeletonTable = /*#__PURE__*/extend({\n name: NAME_SKELETON_TABLE,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var data = _ref.data,\n props = _ref.props;\n var animation = props.animation,\n columns = props.columns;\n var $th = h('th', [h(BSkeleton, {\n props: {\n animation: animation\n }\n })]);\n var $thTr = h('tr', createArray(columns, $th));\n var $td = h('td', [h(BSkeleton, {\n props: {\n width: '75%',\n animation: animation\n }\n })]);\n var $tdTr = h('tr', createArray(columns, $td));\n var $tbody = h('tbody', createArray(props.rows, $tdTr));\n var $thead = !props.hideHeader ? h('thead', [$thTr]) : h();\n var $tfoot = props.showFooter ? h('tfoot', [$thTr]) : h();\n return h(BTableSimple, mergeData(data, {\n props: _objectSpread({}, props.tableProps)\n }), [$thead, $tbody, $tfoot]);\n }\n});","import { extend, mergeData } from '../../vue';\nimport { NAME_SKELETON_WRAPPER } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN } from '../../constants/props';\nimport { SLOT_NAME_DEFAULT, SLOT_NAME_LOADING } from '../../constants/slots';\nimport { normalizeSlot } from '../../utils/normalize-slot';\nimport { makeProp, makePropsConfigurable } from '../../utils/props'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n loading: makeProp(PROP_TYPE_BOOLEAN, false)\n}, NAME_SKELETON_WRAPPER); // --- Main component ---\n// @vue/component\n\nexport var BSkeletonWrapper = /*#__PURE__*/extend({\n name: NAME_SKELETON_WRAPPER,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var data = _ref.data,\n props = _ref.props,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots;\n var $slots = slots();\n var $scopedSlots = scopedSlots || {};\n var slotScope = {};\n\n if (props.loading) {\n return h('div', mergeData(data, {\n attrs: {\n role: 'alert',\n 'aria-live': 'polite',\n 'aria-busy': true\n },\n staticClass: 'b-skeleton-wrapper',\n key: 'loading'\n }), normalizeSlot(SLOT_NAME_LOADING, slotScope, $scopedSlots, $slots));\n }\n\n return normalizeSlot(SLOT_NAME_DEFAULT, slotScope, $scopedSlots, $slots);\n }\n});","import { pluginFactory } from '../../utils/plugins';\nimport { BSkeleton } from './skeleton';\nimport { BSkeletonIcon } from './skeleton-icon';\nimport { BSkeletonImg } from './skeleton-img';\nimport { BSkeletonTable } from './skeleton-table';\nimport { BSkeletonWrapper } from './skeleton-wrapper';\nvar SkeletonPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BSkeleton: BSkeleton,\n BSkeletonIcon: BSkeletonIcon,\n BSkeletonImg: BSkeletonImg,\n BSkeletonTable: BSkeletonTable,\n BSkeletonWrapper: BSkeletonWrapper\n }\n});\nexport { SkeletonPlugin, BSkeleton, BSkeletonIcon, BSkeletonImg, BSkeletonTable, BSkeletonWrapper };","import { BSpinner } from './spinner';\nimport { pluginFactory } from '../../utils/plugins';\nvar SpinnerPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BSpinner: BSpinner\n }\n});\nexport { SpinnerPlugin, BSpinner };","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TR } from '../../constants/components';\nimport { PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { listenersMixin } from '../../mixins/listeners';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Constants ---\n\nvar LIGHT = 'light';\nvar DARK = 'dark'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n variant: makeProp(PROP_TYPE_STRING)\n}, NAME_TR); // --- Main component ---\n// TODO:\n// In Bootstrap v5, we won't need \"sniffing\" as table element variants properly inherit\n// to the child elements, so this can be converted to a functional component\n// @vue/component\n\nexport var BTr = /*#__PURE__*/extend({\n name: NAME_TR,\n mixins: [attrsMixin, listenersMixin, normalizeSlotMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvTableTr: function getBvTableTr() {\n return _this;\n }\n };\n },\n inject: {\n getBvTableRowGroup: {\n default:\n /* istanbul ignore next */\n function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n inheritAttrs: false,\n props: props,\n computed: {\n bvTableRowGroup: function bvTableRowGroup() {\n return this.getBvTableRowGroup();\n },\n // Sniffed by `` / ``\n inTbody: function inTbody() {\n return this.bvTableRowGroup.isTbody;\n },\n // Sniffed by `` / ``\n inThead: function inThead() {\n return this.bvTableRowGroup.isThead;\n },\n // Sniffed by `` / ``\n inTfoot: function inTfoot() {\n return this.bvTableRowGroup.isTfoot;\n },\n // Sniffed by `` / ``\n isDark: function isDark() {\n return this.bvTableRowGroup.isDark;\n },\n // Sniffed by `` / ``\n isStacked: function isStacked() {\n return this.bvTableRowGroup.isStacked;\n },\n // Sniffed by `` / ``\n isResponsive: function isResponsive() {\n return this.bvTableRowGroup.isResponsive;\n },\n // Sniffed by `` / ``\n // Sticky headers are only supported in thead\n isStickyHeader: function isStickyHeader() {\n return this.bvTableRowGroup.isStickyHeader;\n },\n // Sniffed by / `` / ``\n // Needed to handle header background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n hasStickyHeader: function hasStickyHeader() {\n return !this.isStacked && this.bvTableRowGroup.hasStickyHeader;\n },\n // Sniffed by `` / ``\n tableVariant: function tableVariant() {\n return this.bvTableRowGroup.tableVariant;\n },\n // Sniffed by `` / ``\n headVariant: function headVariant() {\n return this.inThead ? this.bvTableRowGroup.headVariant : null;\n },\n // Sniffed by `` / ``\n footVariant: function footVariant() {\n return this.inTfoot ? this.bvTableRowGroup.footVariant : null;\n },\n isRowDark: function isRowDark() {\n return this.headVariant === LIGHT || this.footVariant === LIGHT ?\n /* istanbul ignore next */\n false : this.headVariant === DARK || this.footVariant === DARK ?\n /* istanbul ignore next */\n true : this.isDark;\n },\n trClasses: function trClasses() {\n var variant = this.variant;\n return [variant ? \"\".concat(this.isRowDark ? 'bg' : 'table', \"-\").concat(variant) : null];\n },\n trAttrs: function trAttrs() {\n return _objectSpread({\n role: 'row'\n }, this.bvAttrs);\n }\n },\n render: function render(h) {\n return h('tr', {\n class: this.trClasses,\n attrs: this.trAttrs,\n // Pass native listeners to child\n on: this.bvListeners\n }, this.normalizeSlot());\n }\n});","import { extend } from '../../../vue';\nimport { SLOT_NAME_BOTTOM_ROW } from '../../../constants/slots';\nimport { isFunction } from '../../../utils/inspect';\nimport { BTr } from '../tr'; // --- Props ---\n\nexport var props = {}; // --- Mixin ---\n// @vue/component\n\nexport var bottomRowMixin = extend({\n props: props,\n methods: {\n renderBottomRow: function renderBottomRow() {\n var fields = this.computedFields,\n stacked = this.stacked,\n tbodyTrClass = this.tbodyTrClass,\n tbodyTrAttr = this.tbodyTrAttr;\n var h = this.$createElement; // Static bottom row slot (hidden in visibly stacked mode as we can't control the data-label)\n // If in *always* stacked mode, we don't bother rendering the row\n\n if (!this.hasNormalizedSlot(SLOT_NAME_BOTTOM_ROW) || stacked === true || stacked === '') {\n return h();\n }\n\n return h(BTr, {\n staticClass: 'b-table-bottom-row',\n class: [isFunction(tbodyTrClass) ?\n /* istanbul ignore next */\n tbodyTrClass(null, 'row-bottom') : tbodyTrClass],\n attrs: isFunction(tbodyTrAttr) ?\n /* istanbul ignore next */\n tbodyTrAttr(null, 'row-bottom') : tbodyTrAttr,\n key: 'b-bottom-row'\n }, this.normalizeSlot(SLOT_NAME_BOTTOM_ROW, {\n columns: fields.length,\n fields: fields\n }));\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TABLE_CELL } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { isTag } from '../../utils/dom';\nimport { isUndefinedOrNull } from '../../utils/inspect';\nimport { toInteger } from '../../utils/number';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { toString } from '../../utils/string';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { listenersMixin } from '../../mixins/listeners';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Helper methods ---\n// Parse a rowspan or colspan into a digit (or `null` if < `1` )\n\nvar parseSpan = function parseSpan(value) {\n value = toInteger(value, 0);\n return value > 0 ? value : null;\n};\n/* istanbul ignore next */\n\n\nvar spanValidator = function spanValidator(value) {\n return isUndefinedOrNull(value) || parseSpan(value) > 0;\n}; // --- Props ---\n\n\nexport var props = makePropsConfigurable({\n colspan: makeProp(PROP_TYPE_NUMBER_STRING, null, spanValidator),\n rowspan: makeProp(PROP_TYPE_NUMBER_STRING, null, spanValidator),\n stackedHeading: makeProp(PROP_TYPE_STRING),\n stickyColumn: makeProp(PROP_TYPE_BOOLEAN, false),\n variant: makeProp(PROP_TYPE_STRING)\n}, NAME_TABLE_CELL); // --- Main component ---\n// TODO:\n// In Bootstrap v5, we won't need \"sniffing\" as table element variants properly inherit\n// to the child elements, so this can be converted to a functional component\n// @vue/component\n\nexport var BTd = /*#__PURE__*/extend({\n name: NAME_TABLE_CELL,\n // Mixin order is important!\n mixins: [attrsMixin, listenersMixin, normalizeSlotMixin],\n inject: {\n getBvTableTr: {\n default:\n /* istanbul ignore next */\n function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n inheritAttrs: false,\n props: props,\n computed: {\n bvTableTr: function bvTableTr() {\n return this.getBvTableTr();\n },\n // Overridden by ``\n tag: function tag() {\n return 'td';\n },\n inTbody: function inTbody() {\n return this.bvTableTr.inTbody;\n },\n inThead: function inThead() {\n return this.bvTableTr.inThead;\n },\n inTfoot: function inTfoot() {\n return this.bvTableTr.inTfoot;\n },\n isDark: function isDark() {\n return this.bvTableTr.isDark;\n },\n isStacked: function isStacked() {\n return this.bvTableTr.isStacked;\n },\n // We only support stacked-heading in tbody in stacked mode\n isStackedCell: function isStackedCell() {\n return this.inTbody && this.isStacked;\n },\n isResponsive: function isResponsive() {\n return this.bvTableTr.isResponsive;\n },\n // Needed to handle header background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n // Sticky headers only apply to cells in table `thead`\n isStickyHeader: function isStickyHeader() {\n return this.bvTableTr.isStickyHeader;\n },\n // Needed to handle header background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n hasStickyHeader: function hasStickyHeader() {\n return this.bvTableTr.hasStickyHeader;\n },\n // Needed to handle background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n // Sticky column cells are only available in responsive\n // mode (horizontal scrolling) or when sticky header mode\n // Applies to cells in `thead`, `tbody` and `tfoot`\n isStickyColumn: function isStickyColumn() {\n return !this.isStacked && (this.isResponsive || this.hasStickyHeader) && this.stickyColumn;\n },\n rowVariant: function rowVariant() {\n return this.bvTableTr.variant;\n },\n headVariant: function headVariant() {\n return this.bvTableTr.headVariant;\n },\n footVariant: function footVariant() {\n return this.bvTableTr.footVariant;\n },\n tableVariant: function tableVariant() {\n return this.bvTableTr.tableVariant;\n },\n computedColspan: function computedColspan() {\n return parseSpan(this.colspan);\n },\n computedRowspan: function computedRowspan() {\n return parseSpan(this.rowspan);\n },\n // We use computed props here for improved performance by caching\n // the results of the string interpolation\n cellClasses: function cellClasses() {\n var variant = this.variant,\n headVariant = this.headVariant,\n isStickyColumn = this.isStickyColumn;\n\n if (!variant && this.isStickyHeader && !headVariant || !variant && isStickyColumn && this.inTfoot && !this.footVariant || !variant && isStickyColumn && this.inThead && !headVariant || !variant && isStickyColumn && this.inTbody) {\n // Needed for sticky-header mode as Bootstrap v4 table cells do\n // not inherit parent's `background-color`\n variant = this.rowVariant || this.tableVariant || 'b-table-default';\n }\n\n return [variant ? \"\".concat(this.isDark ? 'bg' : 'table', \"-\").concat(variant) : null, isStickyColumn ? 'b-table-sticky-column' : null];\n },\n cellAttrs: function cellAttrs() {\n var stackedHeading = this.stackedHeading; // We use computed props here for improved performance by caching\n // the results of the object spread (Object.assign)\n\n var headOrFoot = this.inThead || this.inTfoot; // Make sure col/rowspan's are > 0 or null\n\n var colspan = this.computedColspan;\n var rowspan = this.computedRowspan; // Default role and scope\n\n var role = 'cell';\n var scope = null; // Compute role and scope\n // We only add scopes with an explicit span of 1 or greater\n\n if (headOrFoot) {\n // Header or footer cells\n role = 'columnheader';\n scope = colspan > 0 ? 'colspan' : 'col';\n } else if (isTag(this.tag, 'th')) {\n // th's in tbody\n role = 'rowheader';\n scope = rowspan > 0 ? 'rowgroup' : 'row';\n }\n\n return _objectSpread(_objectSpread({\n colspan: colspan,\n rowspan: rowspan,\n role: role,\n scope: scope\n }, this.bvAttrs), {}, {\n // Add in the stacked cell label data-attribute if in\n // stacked mode (if a stacked heading label is provided)\n 'data-label': this.isStackedCell && !isUndefinedOrNull(stackedHeading) ?\n /* istanbul ignore next */\n toString(stackedHeading) : null\n });\n }\n },\n render: function render(h) {\n var $content = [this.normalizeSlot()];\n return h(this.tag, {\n class: this.cellClasses,\n attrs: this.cellAttrs,\n // Transfer any native listeners\n on: this.bvListeners\n }, [this.isStackedCell ? h('div', [$content]) : $content]);\n }\n});","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { MODEL_EVENT_NAME_PREFIX } from '../../../constants/events';\nimport { PROP_TYPE_BOOLEAN } from '../../../constants/props';\nimport { SLOT_NAME_TABLE_BUSY } from '../../../constants/slots';\nimport { stopEvent } from '../../../utils/events';\nimport { isFunction } from '../../../utils/inspect';\nimport { makeProp } from '../../../utils/props';\nimport { BTr } from '../tr';\nimport { BTd } from '../td'; // --- Constants ---\n\nvar MODEL_PROP_NAME_BUSY = 'busy';\nvar MODEL_EVENT_NAME_BUSY = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_BUSY; // --- Props ---\n\nexport var props = _defineProperty({}, MODEL_PROP_NAME_BUSY, makeProp(PROP_TYPE_BOOLEAN, false)); // --- Mixin ---\n// @vue/component\n\nexport var busyMixin = extend({\n props: props,\n data: function data() {\n return {\n localBusy: false\n };\n },\n computed: {\n computedBusy: function computedBusy() {\n return this[MODEL_PROP_NAME_BUSY] || this.localBusy;\n }\n },\n watch: {\n localBusy: function localBusy(newValue, oldValue) {\n if (newValue !== oldValue) {\n this.$emit(MODEL_EVENT_NAME_BUSY, newValue);\n }\n }\n },\n methods: {\n // Event handler helper\n stopIfBusy: function stopIfBusy(event) {\n // If table is busy (via provider) then don't propagate\n if (this.computedBusy) {\n stopEvent(event);\n return true;\n }\n\n return false;\n },\n // Render the busy indicator or return `null` if not busy\n renderBusy: function renderBusy() {\n var tbodyTrClass = this.tbodyTrClass,\n tbodyTrAttr = this.tbodyTrAttr;\n var h = this.$createElement; // Return a busy indicator row, or `null` if not busy\n\n if (this.computedBusy && this.hasNormalizedSlot(SLOT_NAME_TABLE_BUSY)) {\n return h(BTr, {\n staticClass: 'b-table-busy-slot',\n class: [isFunction(tbodyTrClass) ?\n /* istanbul ignore next */\n tbodyTrClass(null, SLOT_NAME_TABLE_BUSY) : tbodyTrClass],\n attrs: isFunction(tbodyTrAttr) ?\n /* istanbul ignore next */\n tbodyTrAttr(null, SLOT_NAME_TABLE_BUSY) : tbodyTrAttr,\n key: 'table-busy-slot'\n }, [h(BTd, {\n props: {\n colspan: this.computedFields.length || null\n }\n }, [this.normalizeSlot(SLOT_NAME_TABLE_BUSY)])]);\n } // We return `null` here so that we can determine if we need to\n // render the table items rows or not\n\n\n return null;\n }\n }\n});","import { extend } from '../../../vue';\nimport { PROP_TYPE_STRING } from '../../../constants/props';\nimport { SLOT_NAME_TABLE_CAPTION } from '../../../constants/slots';\nimport { htmlOrText } from '../../../utils/html';\nimport { makeProp } from '../../../utils/props'; // --- Props ---\n\nexport var props = {\n caption: makeProp(PROP_TYPE_STRING),\n captionHtml: makeProp(PROP_TYPE_STRING) // `caption-top` is part of table-render mixin (styling)\n // captionTop: makeProp(PROP_TYPE_BOOLEAN, false)\n\n}; // --- Mixin ---\n// @vue/component\n\nexport var captionMixin = extend({\n props: props,\n computed: {\n captionId: function captionId() {\n return this.isStacked ? this.safeId('_caption_') : null;\n }\n },\n methods: {\n renderCaption: function renderCaption() {\n var caption = this.caption,\n captionHtml = this.captionHtml;\n var h = this.$createElement;\n var $caption = h();\n var hasCaptionSlot = this.hasNormalizedSlot(SLOT_NAME_TABLE_CAPTION);\n\n if (hasCaptionSlot || caption || captionHtml) {\n $caption = h('caption', {\n attrs: {\n id: this.captionId\n },\n domProps: hasCaptionSlot ? {} : htmlOrText(captionHtml, caption),\n key: 'caption',\n ref: 'caption'\n }, this.normalizeSlot(SLOT_NAME_TABLE_CAPTION));\n }\n\n return $caption;\n }\n }\n});","import { extend } from '../../../vue';\nimport { SLOT_NAME_TABLE_COLGROUP } from '../../../constants/slots'; // --- Props ---\n\nexport var props = {}; // --- Mixin ---\n// @vue/component\n\nexport var colgroupMixin = extend({\n methods: {\n renderColgroup: function renderColgroup() {\n var fields = this.computedFields;\n var h = this.$createElement;\n var $colgroup = h();\n\n if (this.hasNormalizedSlot(SLOT_NAME_TABLE_COLGROUP)) {\n $colgroup = h('colgroup', {\n key: 'colgroup'\n }, [this.normalizeSlot(SLOT_NAME_TABLE_COLGROUP, {\n columns: fields.length,\n fields: fields\n })]);\n }\n\n return $colgroup;\n }\n }\n});","import { extend } from '../../../vue';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';\nimport { SLOT_NAME_EMPTY, SLOT_NAME_EMPTYFILTERED, SLOT_NAME_TABLE_BUSY } from '../../../constants/slots';\nimport { htmlOrText } from '../../../utils/html';\nimport { isFunction } from '../../../utils/inspect';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { BTr } from '../tr';\nimport { BTd } from '../td'; // --- Props ---\n\nexport var props = {\n emptyFilteredHtml: makeProp(PROP_TYPE_STRING),\n emptyFilteredText: makeProp(PROP_TYPE_STRING, 'There are no records matching your request'),\n emptyHtml: makeProp(PROP_TYPE_STRING),\n emptyText: makeProp(PROP_TYPE_STRING, 'There are no records to show'),\n showEmpty: makeProp(PROP_TYPE_BOOLEAN, false)\n}; // --- Mixin ---\n// @vue/component\n\nexport var emptyMixin = extend({\n props: props,\n methods: {\n renderEmpty: function renderEmpty() {\n var _safeVueInstance = safeVueInstance(this),\n items = _safeVueInstance.computedItems,\n computedBusy = _safeVueInstance.computedBusy;\n\n var h = this.$createElement;\n var $empty = h();\n\n if (this.showEmpty && (!items || items.length === 0) && !(computedBusy && this.hasNormalizedSlot(SLOT_NAME_TABLE_BUSY))) {\n var fields = this.computedFields,\n isFiltered = this.isFiltered,\n emptyText = this.emptyText,\n emptyHtml = this.emptyHtml,\n emptyFilteredText = this.emptyFilteredText,\n emptyFilteredHtml = this.emptyFilteredHtml,\n tbodyTrClass = this.tbodyTrClass,\n tbodyTrAttr = this.tbodyTrAttr;\n $empty = this.normalizeSlot(isFiltered ? SLOT_NAME_EMPTYFILTERED : SLOT_NAME_EMPTY, {\n emptyFilteredHtml: emptyFilteredHtml,\n emptyFilteredText: emptyFilteredText,\n emptyHtml: emptyHtml,\n emptyText: emptyText,\n fields: fields,\n // Not sure why this is included, as it will always be an empty array\n items: items\n });\n\n if (!$empty) {\n $empty = h('div', {\n class: ['text-center', 'my-2'],\n domProps: isFiltered ? htmlOrText(emptyFilteredHtml, emptyFilteredText) : htmlOrText(emptyHtml, emptyText)\n });\n }\n\n $empty = h(BTd, {\n props: {\n colspan: fields.length || null\n }\n }, [h('div', {\n attrs: {\n role: 'alert',\n 'aria-live': 'polite'\n }\n }, [$empty])]);\n $empty = h(BTr, {\n staticClass: 'b-table-empty-row',\n class: [isFunction(tbodyTrClass) ?\n /* istanbul ignore next */\n tbodyTrClass(null, 'row-empty') : tbodyTrClass],\n attrs: isFunction(tbodyTrAttr) ?\n /* istanbul ignore next */\n tbodyTrAttr(null, 'row-empty') : tbodyTrAttr,\n key: isFiltered ? 'b-empty-filtered-row' : 'b-empty-row'\n }, [$empty]);\n }\n\n return $empty;\n }\n }\n});","import { isDate, isObject, isUndefinedOrNull } from './inspect';\nimport { keys } from './object';\nimport { toString } from './string'; // Recursively stringifies the values of an object, space separated, in an\n// SSR safe deterministic way (keys are sorted before stringification)\n//\n// ex:\n// { b: 3, c: { z: 'zzz', d: null, e: 2 }, d: [10, 12, 11], a: 'one' }\n// becomes\n// 'one 3 2 zzz 10 12 11'\n//\n// Strings are returned as-is\n// Numbers get converted to string\n// `null` and `undefined` values are filtered out\n// Dates are converted to their native string format\n\nexport var stringifyObjectValues = function stringifyObjectValues(value) {\n if (isUndefinedOrNull(value)) {\n return '';\n } // Arrays are also object, and keys just returns the array indexes\n // Date objects we convert to strings\n\n\n if (isObject(value) && !isDate(value)) {\n return keys(value).sort() // Sort to prevent SSR issues on pre-rendered sorted tables\n .map(function (k) {\n return stringifyObjectValues(value[k]);\n }).filter(function (v) {\n return !!v;\n }) // Ignore empty strings\n .join(' ');\n }\n\n return toString(value);\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// Constants used by table helpers\nexport var FIELD_KEY_CELL_VARIANT = '_cellVariants';\nexport var FIELD_KEY_ROW_VARIANT = '_rowVariant';\nexport var FIELD_KEY_SHOW_DETAILS = '_showDetails'; // Object of item keys that should be ignored for headers and\n// stringification and filter events\n\nexport var IGNORED_FIELD_KEYS = [FIELD_KEY_CELL_VARIANT, FIELD_KEY_ROW_VARIANT, FIELD_KEY_SHOW_DETAILS].reduce(function (result, key) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, true));\n}, {}); // Filter CSS selector for click/dblclick/etc. events\n// If any of these selectors match the clicked element, we ignore the event\n\nexport var EVENT_FILTER = ['a', 'a *', // Include content inside links\n'button', 'button *', // Include content inside buttons\n'input:not(.disabled):not([disabled])', 'select:not(.disabled):not([disabled])', 'textarea:not(.disabled):not([disabled])', '[role=\"link\"]', '[role=\"link\"] *', '[role=\"button\"]', '[role=\"button\"] *', '[tabindex]:not(.disabled):not([disabled])'].join(',');","import { arrayIncludes } from '../../../utils/array';\nimport { isArray, isFunction } from '../../../utils/inspect';\nimport { clone, keys, pick } from '../../../utils/object';\nimport { IGNORED_FIELD_KEYS } from './constants'; // Return a copy of a row after all reserved fields have been filtered out\n\nexport var sanitizeRow = function sanitizeRow(row, ignoreFields, includeFields) {\n var fieldsObj = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n // We first need to format the row based on the field configurations\n // This ensures that we add formatted values for keys that may not\n // exist in the row itself\n var formattedRow = keys(fieldsObj).reduce(function (result, key) {\n var field = fieldsObj[key];\n var filterByFormatted = field.filterByFormatted;\n var formatter = isFunction(filterByFormatted) ?\n /* istanbul ignore next */\n filterByFormatted : filterByFormatted ?\n /* istanbul ignore next */\n field.formatter : null;\n\n if (isFunction(formatter)) {\n result[key] = formatter(row[key], key, row);\n }\n\n return result;\n }, clone(row)); // Determine the allowed keys:\n // - Ignore special fields that start with `_`\n // - Ignore fields in the `ignoreFields` array\n // - Include only fields in the `includeFields` array\n\n var allowedKeys = keys(formattedRow).filter(function (key) {\n return !IGNORED_FIELD_KEYS[key] && !(isArray(ignoreFields) && ignoreFields.length > 0 && arrayIncludes(ignoreFields, key)) && !(isArray(includeFields) && includeFields.length > 0 && !arrayIncludes(includeFields, key));\n });\n return pick(formattedRow, allowedKeys);\n};","import { isObject } from '../../../utils/inspect';\nimport { stringifyObjectValues } from '../../../utils/stringify-object-values';\nimport { sanitizeRow } from './sanitize-row'; // Stringifies the values of a record, ignoring any special top level field keys\n// TODO: Add option to stringify `scopedSlot` items\n\nexport var stringifyRecordValues = function stringifyRecordValues(row, ignoreFields, includeFields, fieldsObj) {\n return isObject(row) ? stringifyObjectValues(sanitizeRow(row, ignoreFields, includeFields, fieldsObj)) :\n /* istanbul ignore next */\n '';\n};","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { extend } from '../../../vue';\nimport { NAME_TABLE } from '../../../constants/components';\nimport { EVENT_NAME_FILTERED } from '../../../constants/events';\nimport { PROP_TYPE_REG_EXP, PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_FUNCTION, PROP_TYPE_ARRAY, PROP_TYPE_NUMBER_STRING } from '../../../constants/props';\nimport { RX_DIGITS, RX_SPACES } from '../../../constants/regex';\nimport { concat } from '../../../utils/array';\nimport { cloneDeep } from '../../../utils/clone-deep';\nimport { identity } from '../../../utils/identity';\nimport { isFunction, isString, isRegExp } from '../../../utils/inspect';\nimport { looseEqual } from '../../../utils/loose-equal';\nimport { toInteger } from '../../../utils/number';\nimport { hasPropFunction, makeProp } from '../../../utils/props';\nimport { escapeRegExp } from '../../../utils/string';\nimport { warn } from '../../../utils/warn';\nimport { stringifyRecordValues } from './stringify-record-values'; // --- Constants ---\n\nvar DEBOUNCE_DEPRECATED_MSG = 'Prop \"filter-debounce\" is deprecated. Use the debounce feature of \"\" instead.'; // --- Props ---\n\nexport var props = {\n filter: makeProp([].concat(_toConsumableArray(PROP_TYPE_ARRAY_OBJECT_STRING), [PROP_TYPE_REG_EXP])),\n filterDebounce: makeProp(PROP_TYPE_NUMBER_STRING, 0, function (value) {\n return RX_DIGITS.test(String(value));\n }),\n filterFunction: makeProp(PROP_TYPE_FUNCTION),\n filterIgnoredFields: makeProp(PROP_TYPE_ARRAY, []),\n filterIncludedFields: makeProp(PROP_TYPE_ARRAY, [])\n}; // --- Mixin ---\n// @vue/component\n\nexport var filteringMixin = extend({\n props: props,\n data: function data() {\n return {\n // Flag for displaying which empty slot to show and some event triggering\n isFiltered: false,\n // Where we store the copy of the filter criteria after debouncing\n // We pre-set it with the sanitized filter value\n localFilter: this.filterSanitize(this.filter)\n };\n },\n computed: {\n computedFilterIgnored: function computedFilterIgnored() {\n return concat(this.filterIgnoredFields || []).filter(identity);\n },\n computedFilterIncluded: function computedFilterIncluded() {\n return concat(this.filterIncludedFields || []).filter(identity);\n },\n computedFilterDebounce: function computedFilterDebounce() {\n var ms = toInteger(this.filterDebounce, 0);\n /* istanbul ignore next */\n\n if (ms > 0) {\n warn(DEBOUNCE_DEPRECATED_MSG, NAME_TABLE);\n }\n\n return ms;\n },\n localFiltering: function localFiltering() {\n return this.hasProvider ? !!this.noProviderFiltering : true;\n },\n // For watching changes to `filteredItems` vs `localItems`\n filteredCheck: function filteredCheck() {\n var filteredItems = this.filteredItems,\n localItems = this.localItems,\n localFilter = this.localFilter;\n return {\n filteredItems: filteredItems,\n localItems: localItems,\n localFilter: localFilter\n };\n },\n // Sanitized/normalize filter-function prop\n localFilterFn: function localFilterFn() {\n // Return `null` to signal to use internal filter function\n var filterFunction = this.filterFunction;\n return hasPropFunction(filterFunction) ? filterFunction : null;\n },\n // Returns the records in `localItems` that match the filter criteria\n // Returns the original `localItems` array if not sorting\n filteredItems: function filteredItems() {\n // Note the criteria is debounced and sanitized\n var items = this.localItems,\n criteria = this.localFilter; // Resolve the filtering function, when requested\n // We prefer the provided filtering function and fallback to the internal one\n // When no filtering criteria is specified the filtering factories will return `null`\n\n var filterFn = this.localFiltering ? this.filterFnFactory(this.localFilterFn, criteria) || this.defaultFilterFnFactory(criteria) : null; // We only do local filtering when requested and there are records to filter\n\n return filterFn && items.length > 0 ? items.filter(filterFn) : items;\n }\n },\n watch: {\n // Watch for debounce being set to 0\n computedFilterDebounce: function computedFilterDebounce(newValue) {\n if (!newValue && this.$_filterTimer) {\n this.clearFilterTimer();\n this.localFilter = this.filterSanitize(this.filter);\n }\n },\n // Watch for changes to the filter criteria, and debounce if necessary\n filter: {\n // We need a deep watcher in case the user passes\n // an object when using `filter-function`\n deep: true,\n handler: function handler(newCriteria) {\n var _this = this;\n\n var timeout = this.computedFilterDebounce;\n this.clearFilterTimer();\n\n if (timeout && timeout > 0) {\n // If we have a debounce time, delay the update of `localFilter`\n this.$_filterTimer = setTimeout(function () {\n _this.localFilter = _this.filterSanitize(newCriteria);\n }, timeout);\n } else {\n // Otherwise, immediately update `localFilter` with `newFilter` value\n this.localFilter = this.filterSanitize(newCriteria);\n }\n }\n },\n // Watch for changes to the filter criteria and filtered items vs `localItems`\n // Set visual state and emit events as required\n filteredCheck: function filteredCheck(_ref) {\n var filteredItems = _ref.filteredItems,\n localFilter = _ref.localFilter;\n // Determine if the dataset is filtered or not\n var isFiltered = false;\n\n if (!localFilter) {\n // If filter criteria is falsey\n isFiltered = false;\n } else if (looseEqual(localFilter, []) || looseEqual(localFilter, {})) {\n // If filter criteria is an empty array or object\n isFiltered = false;\n } else if (localFilter) {\n // If filter criteria is truthy\n isFiltered = true;\n }\n\n if (isFiltered) {\n this.$emit(EVENT_NAME_FILTERED, filteredItems, filteredItems.length);\n }\n\n this.isFiltered = isFiltered;\n },\n isFiltered: function isFiltered(newValue, oldValue) {\n if (newValue === false && oldValue === true) {\n // We need to emit a filtered event if `isFiltered` transitions from `true` to\n // `false` so that users can update their pagination controls\n var localItems = this.localItems;\n this.$emit(EVENT_NAME_FILTERED, localItems, localItems.length);\n }\n }\n },\n created: function created() {\n var _this2 = this;\n\n // Create private non-reactive props\n this.$_filterTimer = null; // If filter is \"pre-set\", set the criteria\n // This will trigger any watchers/dependents\n // this.localFilter = this.filterSanitize(this.filter)\n // Set the initial filtered state in a `$nextTick()` so that\n // we trigger a filtered event if needed\n\n this.$nextTick(function () {\n _this2.isFiltered = Boolean(_this2.localFilter);\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.clearFilterTimer();\n },\n methods: {\n clearFilterTimer: function clearFilterTimer() {\n clearTimeout(this.$_filterTimer);\n this.$_filterTimer = null;\n },\n filterSanitize: function filterSanitize(criteria) {\n // Sanitizes filter criteria based on internal or external filtering\n if (this.localFiltering && !this.localFilterFn && !(isString(criteria) || isRegExp(criteria))) {\n // If using internal filter function, which only accepts string or RegExp,\n // return '' to signify no filter\n return '';\n } // Could be a string, object or array, as needed by external filter function\n // We use `cloneDeep` to ensure we have a new copy of an object or array\n // without Vue's reactive observers\n\n\n return cloneDeep(criteria);\n },\n // Filter Function factories\n filterFnFactory: function filterFnFactory(filterFn, criteria) {\n // Wrapper factory for external filter functions\n // Wrap the provided filter-function and return a new function\n // Returns `null` if no filter-function defined or if criteria is falsey\n // Rather than directly grabbing `this.computedLocalFilterFn` or `this.filterFunction`\n // we have it passed, so that the caller computed prop will be reactive to changes\n // in the original filter-function (as this routine is a method)\n if (!filterFn || !isFunction(filterFn) || !criteria || looseEqual(criteria, []) || looseEqual(criteria, {})) {\n return null;\n } // Build the wrapped filter test function, passing the criteria to the provided function\n\n\n var fn = function fn(item) {\n // Generated function returns true if the criteria matches part\n // of the serialized data, otherwise false\n return filterFn(item, criteria);\n }; // Return the wrapped function\n\n\n return fn;\n },\n defaultFilterFnFactory: function defaultFilterFnFactory(criteria) {\n var _this3 = this;\n\n // Generates the default filter function, using the given filter criteria\n // Returns `null` if no criteria or criteria format not supported\n if (!criteria || !(isString(criteria) || isRegExp(criteria))) {\n // Built in filter can only support strings or RegExp criteria (at the moment)\n return null;\n } // Build the RegExp needed for filtering\n\n\n var regExp = criteria;\n\n if (isString(regExp)) {\n // Escape special RegExp characters in the string and convert contiguous\n // whitespace to \\s+ matches\n var pattern = escapeRegExp(criteria).replace(RX_SPACES, '\\\\s+'); // Build the RegExp (no need for global flag, as we only need\n // to find the value once in the string)\n\n regExp = new RegExp(\".*\".concat(pattern, \".*\"), 'i');\n } // Generate the wrapped filter test function to use\n\n\n var fn = function fn(item) {\n // This searches all row values (and sub property values) in the entire (excluding\n // special `_` prefixed keys), because we convert the record to a space-separated\n // string containing all the value properties (recursively), even ones that are\n // not visible (not specified in this.fields)\n // Users can ignore filtering on specific fields, or on only certain fields,\n // and can optionall specify searching results of fields with formatter\n //\n // TODO: Enable searching on scoped slots (optional, as it will be SLOW)\n //\n // Generated function returns true if the criteria matches part of\n // the serialized data, otherwise false\n //\n // We set `lastIndex = 0` on the `RegExp` in case someone specifies the `/g` global flag\n regExp.lastIndex = 0;\n return regExp.test(stringifyRecordValues(item, _this3.computedFilterIgnored, _this3.computedFilterIncluded, _this3.computedFieldsObj));\n }; // Return the generated function\n\n\n return fn;\n }\n }\n});","import { identity } from '../../../utils/identity';\nimport { isArray, isFunction, isObject, isString } from '../../../utils/inspect';\nimport { clone, keys } from '../../../utils/object';\nimport { startCase } from '../../../utils/string';\nimport { IGNORED_FIELD_KEYS } from './constants'; // Private function to massage field entry into common object format\n\nvar processField = function processField(key, value) {\n var field = null;\n\n if (isString(value)) {\n // Label shortcut\n field = {\n key: key,\n label: value\n };\n } else if (isFunction(value)) {\n // Formatter shortcut\n field = {\n key: key,\n formatter: value\n };\n } else if (isObject(value)) {\n field = clone(value);\n field.key = field.key || key;\n } else if (value !== false) {\n // Fallback to just key\n\n /* istanbul ignore next */\n field = {\n key: key\n };\n }\n\n return field;\n}; // We normalize fields into an array of objects\n// [ { key:..., label:..., ...}, {...}, ..., {..}]\n\n\nexport var normalizeFields = function normalizeFields(origFields, items) {\n var fields = [];\n\n if (isArray(origFields)) {\n // Normalize array Form\n origFields.filter(identity).forEach(function (f) {\n if (isString(f)) {\n fields.push({\n key: f,\n label: startCase(f)\n });\n } else if (isObject(f) && f.key && isString(f.key)) {\n // Full object definition. We use assign so that we don't mutate the original\n fields.push(clone(f));\n } else if (isObject(f) && keys(f).length === 1) {\n // Shortcut object (i.e. { 'foo_bar': 'This is Foo Bar' }\n var key = keys(f)[0];\n var field = processField(key, f[key]);\n\n if (field) {\n fields.push(field);\n }\n }\n });\n } // If no field provided, take a sample from first record (if exits)\n\n\n if (fields.length === 0 && isArray(items) && items.length > 0) {\n var sample = items[0];\n keys(sample).forEach(function (k) {\n if (!IGNORED_FIELD_KEYS[k]) {\n fields.push({\n key: k,\n label: startCase(k)\n });\n }\n });\n } // Ensure we have a unique array of fields and that they have String labels\n\n\n var memo = {};\n return fields.filter(function (f) {\n if (!memo[f.key]) {\n memo[f.key] = true;\n f.label = isString(f.label) ? f.label : startCase(f.key);\n return true;\n }\n\n return false;\n });\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { EVENT_NAME_CONTEXT_CHANGED } from '../../../constants/events';\nimport { PROP_TYPE_ARRAY, PROP_TYPE_STRING } from '../../../constants/props';\nimport { useParentMixin } from '../../../mixins/use-parent';\nimport { isArray, isFunction, isString } from '../../../utils/inspect';\nimport { looseEqual } from '../../../utils/loose-equal';\nimport { mathMax } from '../../../utils/math';\nimport { makeModelMixin } from '../../../utils/model';\nimport { toInteger } from '../../../utils/number';\nimport { clone, sortKeys } from '../../../utils/object';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { normalizeFields } from './normalize-fields'; // --- Constants ---\n\nvar _makeModelMixin = makeModelMixin('value', {\n type: PROP_TYPE_ARRAY,\n defaultValue: []\n}),\n modelMixin = _makeModelMixin.mixin,\n modelProps = _makeModelMixin.props,\n MODEL_PROP_NAME = _makeModelMixin.prop,\n MODEL_EVENT_NAME = _makeModelMixin.event;\n\nexport { MODEL_PROP_NAME, MODEL_EVENT_NAME }; // --- Props ---\n\nexport var props = sortKeys(_objectSpread(_objectSpread({}, modelProps), {}, _defineProperty({\n fields: makeProp(PROP_TYPE_ARRAY, null),\n // Provider mixin adds in `Function` type\n items: makeProp(PROP_TYPE_ARRAY, []),\n // Primary key for record\n // If provided the value in each row must be unique!\n primaryKey: makeProp(PROP_TYPE_STRING)\n}, MODEL_PROP_NAME, makeProp(PROP_TYPE_ARRAY, [])))); // --- Mixin ---\n// @vue/component\n\nexport var itemsMixin = extend({\n mixins: [modelMixin, useParentMixin],\n props: props,\n data: function data() {\n var items = this.items;\n return {\n // Our local copy of the items\n // Must be an array\n localItems: isArray(items) ? items.slice() : []\n };\n },\n computed: {\n computedFields: function computedFields() {\n // We normalize fields into an array of objects\n // `[ { key:..., label:..., ...}, {...}, ..., {..}]`\n return normalizeFields(this.fields, this.localItems);\n },\n computedFieldsObj: function computedFieldsObj() {\n // Fields as a simple lookup hash object\n // Mainly for formatter lookup and use in `scopedSlots` for convenience\n // If the field has a formatter, it normalizes formatter to a\n // function ref or `undefined` if no formatter\n var bvParent = this.bvParent;\n return this.computedFields.reduce(function (obj, f) {\n // We use object spread here so we don't mutate the original field object\n obj[f.key] = clone(f);\n\n if (f.formatter) {\n // Normalize formatter to a function ref or `undefined`\n var formatter = f.formatter;\n\n if (isString(formatter) && isFunction(bvParent[formatter])) {\n formatter = bvParent[formatter];\n } else if (!isFunction(formatter)) {\n /* istanbul ignore next */\n formatter = undefined;\n } // Return formatter function or `undefined` if none\n\n\n obj[f.key].formatter = formatter;\n }\n\n return obj;\n }, {});\n },\n computedItems: function computedItems() {\n var _safeVueInstance = safeVueInstance(this),\n paginatedItems = _safeVueInstance.paginatedItems,\n sortedItems = _safeVueInstance.sortedItems,\n filteredItems = _safeVueInstance.filteredItems,\n localItems = _safeVueInstance.localItems; // Fallback if various mixins not provided\n\n\n return (paginatedItems || sortedItems || filteredItems || localItems ||\n /* istanbul ignore next */\n []).slice();\n },\n context: function context() {\n var _safeVueInstance2 = safeVueInstance(this),\n perPage = _safeVueInstance2.perPage,\n currentPage = _safeVueInstance2.currentPage; // Current state of sorting, filtering and pagination props/values\n\n\n return {\n filter: this.localFilter,\n sortBy: this.localSortBy,\n sortDesc: this.localSortDesc,\n perPage: mathMax(toInteger(perPage, 0), 0),\n currentPage: mathMax(toInteger(currentPage, 0), 1),\n apiUrl: this.apiUrl\n };\n }\n },\n watch: {\n items: function items(newValue) {\n // Set `localItems`/`filteredItems` to a copy of the provided array\n this.localItems = isArray(newValue) ? newValue.slice() : [];\n },\n // Watch for changes on `computedItems` and update the `v-model`\n computedItems: function computedItems(newValue, oldValue) {\n if (!looseEqual(newValue, oldValue)) {\n this.$emit(MODEL_EVENT_NAME, newValue);\n }\n },\n // Watch for context changes\n context: function context(newValue, oldValue) {\n // Emit context information for external paging/filtering/sorting handling\n if (!looseEqual(newValue, oldValue)) {\n this.$emit(EVENT_NAME_CONTEXT_CHANGED, newValue);\n }\n }\n },\n mounted: function mounted() {\n // Initially update the `v-model` of displayed items\n this.$emit(MODEL_EVENT_NAME, this.computedItems);\n },\n methods: {\n // Method to get the formatter method for a given field key\n getFieldFormatter: function getFieldFormatter(key) {\n var field = this.computedFieldsObj[key]; // `this.computedFieldsObj` has pre-normalized the formatter to a\n // function ref if present, otherwise `undefined`\n\n return field ? field.formatter : undefined;\n }\n }\n});","import { extend } from '../../../vue';\nimport { PROP_TYPE_NUMBER_STRING } from '../../../constants/props';\nimport { mathMax } from '../../../utils/math';\nimport { toInteger } from '../../../utils/number';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance'; // --- Props ---\n\nexport var props = {\n currentPage: makeProp(PROP_TYPE_NUMBER_STRING, 1),\n perPage: makeProp(PROP_TYPE_NUMBER_STRING, 0)\n}; // --- Mixin ---\n// @vue/component\n\nexport var paginationMixin = extend({\n props: props,\n computed: {\n localPaging: function localPaging() {\n return this.hasProvider ? !!this.noProviderPaging : true;\n },\n paginatedItems: function paginatedItems() {\n var _safeVueInstance = safeVueInstance(this),\n sortedItems = _safeVueInstance.sortedItems,\n filteredItems = _safeVueInstance.filteredItems,\n localItems = _safeVueInstance.localItems;\n\n var items = sortedItems || filteredItems || localItems || [];\n var currentPage = mathMax(toInteger(this.currentPage, 1), 1);\n var perPage = mathMax(toInteger(this.perPage, 0), 0); // Apply local pagination\n\n if (this.localPaging && perPage) {\n // Grab the current page of data (which may be past filtered items limit)\n items = items.slice((currentPage - 1) * perPage, currentPage * perPage);\n } // Return the items to display in the table\n\n\n return items;\n }\n }\n});","import { extend } from '../../../vue';\nimport { NAME_TABLE } from '../../../constants/components';\nimport { EVENT_NAME_REFRESH, EVENT_NAME_REFRESHED } from '../../../constants/events';\nimport { PROP_TYPE_ARRAY_FUNCTION, PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';\nimport { getRootActionEventName, getRootEventName } from '../../../utils/events';\nimport { isArray, isFunction, isPromise } from '../../../utils/inspect';\nimport { looseEqual } from '../../../utils/loose-equal';\nimport { clone } from '../../../utils/object';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { warn } from '../../../utils/warn';\nimport { listenOnRootMixin } from '../../../mixins/listen-on-root'; // --- Constants ---\n\nvar ROOT_EVENT_NAME_REFRESHED = getRootEventName(NAME_TABLE, EVENT_NAME_REFRESHED);\nvar ROOT_ACTION_EVENT_NAME_REFRESH = getRootActionEventName(NAME_TABLE, EVENT_NAME_REFRESH); // --- Props ---\n\nexport var props = {\n // Passed to the context object\n // Not used by `` directly\n apiUrl: makeProp(PROP_TYPE_STRING),\n // Adds in 'Function' support\n items: makeProp(PROP_TYPE_ARRAY_FUNCTION, []),\n noProviderFiltering: makeProp(PROP_TYPE_BOOLEAN, false),\n noProviderPaging: makeProp(PROP_TYPE_BOOLEAN, false),\n noProviderSorting: makeProp(PROP_TYPE_BOOLEAN, false)\n}; // --- Mixin ---\n// @vue/component\n\nexport var providerMixin = extend({\n mixins: [listenOnRootMixin],\n props: props,\n computed: {\n hasProvider: function hasProvider() {\n return isFunction(this.items);\n },\n providerTriggerContext: function providerTriggerContext() {\n // Used to trigger the provider function via a watcher. Only the fields that\n // are needed for triggering a provider update are included. Note that the\n // regular this.context is sent to the provider during fetches though, as they\n // may need all the prop info.\n var ctx = {\n apiUrl: this.apiUrl,\n filter: null,\n sortBy: null,\n sortDesc: null,\n perPage: null,\n currentPage: null\n };\n\n if (!this.noProviderFiltering) {\n // Either a string, or could be an object or array.\n ctx.filter = this.localFilter;\n }\n\n if (!this.noProviderSorting) {\n ctx.sortBy = this.localSortBy;\n ctx.sortDesc = this.localSortDesc;\n }\n\n if (!this.noProviderPaging) {\n ctx.perPage = this.perPage;\n ctx.currentPage = this.currentPage;\n }\n\n return clone(ctx);\n }\n },\n watch: {\n // Provider update triggering\n items: function items(newValue) {\n // If a new provider has been specified, trigger an update\n if (this.hasProvider || isFunction(newValue)) {\n this.$nextTick(this._providerUpdate);\n }\n },\n providerTriggerContext: function providerTriggerContext(newValue, oldValue) {\n // Trigger the provider to update as the relevant context values have changed.\n if (!looseEqual(newValue, oldValue)) {\n this.$nextTick(this._providerUpdate);\n }\n }\n },\n mounted: function mounted() {\n var _this = this;\n\n // Call the items provider if necessary\n if (this.hasProvider && (!this.localItems || this.localItems.length === 0)) {\n // Fetch on mount if localItems is empty\n this._providerUpdate();\n } // Listen for global messages to tell us to force refresh the table\n\n\n this.listenOnRoot(ROOT_ACTION_EVENT_NAME_REFRESH, function (id) {\n if (id === _this.id || id === _this) {\n _this.refresh();\n }\n });\n },\n methods: {\n refresh: function refresh() {\n var _safeVueInstance = safeVueInstance(this),\n items = _safeVueInstance.items,\n refresh = _safeVueInstance.refresh,\n computedBusy = _safeVueInstance.computedBusy; // Public Method: Force a refresh of the provider function\n\n\n this.$off(EVENT_NAME_REFRESHED, refresh);\n\n if (computedBusy) {\n // Can't force an update when forced busy by user (busy prop === true)\n if (this.localBusy && this.hasProvider) {\n // But if provider running (localBusy), re-schedule refresh once `refreshed` emitted\n this.$on(EVENT_NAME_REFRESHED, refresh);\n }\n } else {\n this.clearSelected();\n\n if (this.hasProvider) {\n this.$nextTick(this._providerUpdate);\n } else {\n /* istanbul ignore next */\n this.localItems = isArray(items) ? items.slice() : [];\n }\n }\n },\n // Provider related methods\n _providerSetLocal: function _providerSetLocal(items) {\n this.localItems = isArray(items) ? items.slice() : [];\n this.localBusy = false;\n this.$emit(EVENT_NAME_REFRESHED); // New root emit\n\n if (this.id) {\n this.emitOnRoot(ROOT_EVENT_NAME_REFRESHED, this.id);\n }\n },\n _providerUpdate: function _providerUpdate() {\n var _this2 = this;\n\n // Refresh the provider function items.\n if (!this.hasProvider) {\n // Do nothing if no provider\n return;\n } // If table is busy, wait until refreshed before calling again\n\n\n if (safeVueInstance(this).computedBusy) {\n // Schedule a new refresh once `refreshed` is emitted\n this.$nextTick(this.refresh);\n return;\n } // Set internal busy state\n\n\n this.localBusy = true; // Call provider function with context and optional callback after DOM is fully updated\n\n this.$nextTick(function () {\n try {\n // Call provider function passing it the context and optional callback\n var data = _this2.items(_this2.context, _this2._providerSetLocal);\n\n if (isPromise(data)) {\n // Provider returned Promise\n data.then(function (items) {\n // Provider resolved with items\n _this2._providerSetLocal(items);\n });\n } else if (isArray(data)) {\n // Provider returned Array data\n _this2._providerSetLocal(data);\n } else {\n /* istanbul ignore if */\n if (_this2.items.length !== 2) {\n // Check number of arguments provider function requested\n // Provider not using callback (didn't request second argument), so we clear\n // busy state as most likely there was an error in the provider function\n\n /* istanbul ignore next */\n warn(\"Provider function didn't request callback and did not return a promise or data.\", NAME_TABLE);\n _this2.localBusy = false;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n // Provider function borked on us, so we spew out a warning\n // and clear the busy state\n warn(\"Provider function error [\".concat(e.name, \"] \").concat(e.message, \".\"), NAME_TABLE);\n _this2.localBusy = false;\n\n _this2.$off(EVENT_NAME_REFRESHED, _this2.refresh);\n }\n });\n }\n }\n});","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { EVENT_NAME_CONTEXT_CHANGED, EVENT_NAME_FILTERED, EVENT_NAME_ROW_CLICKED, EVENT_NAME_ROW_SELECTED } from '../../../constants/events';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';\nimport { arrayIncludes, createArray } from '../../../utils/array';\nimport { identity } from '../../../utils/identity';\nimport { isArray, isNumber } from '../../../utils/inspect';\nimport { looseEqual } from '../../../utils/loose-equal';\nimport { mathMax, mathMin } from '../../../utils/math';\nimport { makeProp } from '../../../utils/props';\nimport { toString } from '../../../utils/string';\nimport { sanitizeRow } from './sanitize-row'; // --- Constants ---\n\nvar SELECT_MODES = ['range', 'multi', 'single'];\nvar ROLE_GRID = 'grid'; // --- Props ---\n\nexport var props = {\n // Disable use of click handlers for row selection\n noSelectOnClick: makeProp(PROP_TYPE_BOOLEAN, false),\n selectMode: makeProp(PROP_TYPE_STRING, 'multi', function (value) {\n return arrayIncludes(SELECT_MODES, value);\n }),\n selectable: makeProp(PROP_TYPE_BOOLEAN, false),\n selectedVariant: makeProp(PROP_TYPE_STRING, 'active')\n}; // --- Mixin ---\n// @vue/component\n\nexport var selectableMixin = extend({\n props: props,\n data: function data() {\n return {\n selectedRows: [],\n selectedLastRow: -1\n };\n },\n computed: {\n isSelectable: function isSelectable() {\n return this.selectable && this.selectMode;\n },\n hasSelectableRowClick: function hasSelectableRowClick() {\n return this.isSelectable && !this.noSelectOnClick;\n },\n supportsSelectableRows: function supportsSelectableRows() {\n return true;\n },\n selectableHasSelection: function selectableHasSelection() {\n var selectedRows = this.selectedRows;\n return this.isSelectable && selectedRows && selectedRows.length > 0 && selectedRows.some(identity);\n },\n selectableIsMultiSelect: function selectableIsMultiSelect() {\n return this.isSelectable && arrayIncludes(['range', 'multi'], this.selectMode);\n },\n selectableTableClasses: function selectableTableClasses() {\n var _ref;\n\n var isSelectable = this.isSelectable;\n return _ref = {\n 'b-table-selectable': isSelectable\n }, _defineProperty(_ref, \"b-table-select-\".concat(this.selectMode), isSelectable), _defineProperty(_ref, 'b-table-selecting', this.selectableHasSelection), _defineProperty(_ref, 'b-table-selectable-no-click', isSelectable && !this.hasSelectableRowClick), _ref;\n },\n selectableTableAttrs: function selectableTableAttrs() {\n if (!this.isSelectable) {\n return {};\n }\n\n var role = this.bvAttrs.role || ROLE_GRID;\n return {\n role: role,\n // TODO:\n // Should this attribute not be included when `no-select-on-click` is set\n // since this attribute implies keyboard navigation?\n 'aria-multiselectable': role === ROLE_GRID ? toString(this.selectableIsMultiSelect) : null\n };\n }\n },\n watch: {\n computedItems: function computedItems(newValue, oldValue) {\n // Reset for selectable\n var equal = false;\n\n if (this.isSelectable && this.selectedRows.length > 0) {\n // Quick check against array length\n equal = isArray(newValue) && isArray(oldValue) && newValue.length === oldValue.length;\n\n for (var i = 0; equal && i < newValue.length; i++) {\n // Look for the first non-loosely equal row, after ignoring reserved fields\n equal = looseEqual(sanitizeRow(newValue[i]), sanitizeRow(oldValue[i]));\n }\n }\n\n if (!equal) {\n this.clearSelected();\n }\n },\n selectable: function selectable(newValue) {\n this.clearSelected();\n this.setSelectionHandlers(newValue);\n },\n selectMode: function selectMode() {\n this.clearSelected();\n },\n hasSelectableRowClick: function hasSelectableRowClick(newValue) {\n this.clearSelected();\n this.setSelectionHandlers(!newValue);\n },\n selectedRows: function selectedRows(_selectedRows, oldValue) {\n var _this = this;\n\n if (this.isSelectable && !looseEqual(_selectedRows, oldValue)) {\n var items = []; // `.forEach()` skips over non-existent indices (on sparse arrays)\n\n _selectedRows.forEach(function (v, idx) {\n if (v) {\n items.push(_this.computedItems[idx]);\n }\n });\n\n this.$emit(EVENT_NAME_ROW_SELECTED, items);\n }\n }\n },\n beforeMount: function beforeMount() {\n // Set up handlers if needed\n if (this.isSelectable) {\n this.setSelectionHandlers(true);\n }\n },\n methods: {\n // Public methods\n selectRow: function selectRow(index) {\n // Select a particular row (indexed based on computedItems)\n if (this.isSelectable && isNumber(index) && index >= 0 && index < this.computedItems.length && !this.isRowSelected(index)) {\n var selectedRows = this.selectableIsMultiSelect ? this.selectedRows.slice() : [];\n selectedRows[index] = true;\n this.selectedLastClicked = -1;\n this.selectedRows = selectedRows;\n }\n },\n unselectRow: function unselectRow(index) {\n // Un-select a particular row (indexed based on `computedItems`)\n if (this.isSelectable && isNumber(index) && this.isRowSelected(index)) {\n var selectedRows = this.selectedRows.slice();\n selectedRows[index] = false;\n this.selectedLastClicked = -1;\n this.selectedRows = selectedRows;\n }\n },\n selectAllRows: function selectAllRows() {\n var length = this.computedItems.length;\n\n if (this.isSelectable && length > 0) {\n this.selectedLastClicked = -1;\n this.selectedRows = this.selectableIsMultiSelect ? createArray(length, true) : [true];\n }\n },\n isRowSelected: function isRowSelected(index) {\n // Determine if a row is selected (indexed based on `computedItems`)\n return !!(isNumber(index) && this.selectedRows[index]);\n },\n clearSelected: function clearSelected() {\n // Clear any active selected row(s)\n this.selectedLastClicked = -1;\n this.selectedRows = [];\n },\n // Internal private methods\n selectableRowClasses: function selectableRowClasses(index) {\n if (this.isSelectable && this.isRowSelected(index)) {\n var variant = this.selectedVariant;\n return _defineProperty({\n 'b-table-row-selected': true\n }, \"\".concat(this.dark ? 'bg' : 'table', \"-\").concat(variant), variant);\n }\n\n return {};\n },\n selectableRowAttrs: function selectableRowAttrs(index) {\n return {\n 'aria-selected': !this.isSelectable ? null : this.isRowSelected(index) ? 'true' : 'false'\n };\n },\n setSelectionHandlers: function setSelectionHandlers(on) {\n var method = on && !this.noSelectOnClick ? '$on' : '$off'; // Handle row-clicked event\n\n this[method](EVENT_NAME_ROW_CLICKED, this.selectionHandler); // Clear selection on filter, pagination, and sort changes\n\n this[method](EVENT_NAME_FILTERED, this.clearSelected);\n this[method](EVENT_NAME_CONTEXT_CHANGED, this.clearSelected);\n },\n selectionHandler: function selectionHandler(item, index, event) {\n /* istanbul ignore if: should never happen */\n if (!this.isSelectable || this.noSelectOnClick) {\n // Don't do anything if table is not in selectable mode\n this.clearSelected();\n return;\n }\n\n var selectMode = this.selectMode,\n selectedLastRow = this.selectedLastRow;\n var selectedRows = this.selectedRows.slice();\n var selected = !selectedRows[index]; // Note 'multi' mode needs no special event handling\n\n if (selectMode === 'single') {\n selectedRows = [];\n } else if (selectMode === 'range') {\n if (selectedLastRow > -1 && event.shiftKey) {\n // range\n for (var idx = mathMin(selectedLastRow, index); idx <= mathMax(selectedLastRow, index); idx++) {\n selectedRows[idx] = true;\n }\n\n selected = true;\n } else {\n if (!(event.ctrlKey || event.metaKey)) {\n // Clear range selection if any\n selectedRows = [];\n selected = true;\n }\n\n if (selected) this.selectedLastRow = index;\n }\n }\n\n selectedRows[index] = selected;\n this.selectedRows = selectedRows;\n }\n }\n});","var _props, _watch;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { EVENT_NAME_HEAD_CLICKED, EVENT_NAME_SORT_CHANGED, MODEL_EVENT_NAME_PREFIX } from '../../../constants/events';\nimport { PROP_TYPE_ARRAY_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_FUNCTION, PROP_TYPE_OBJECT, PROP_TYPE_STRING } from '../../../constants/props';\nimport { arrayIncludes } from '../../../utils/array';\nimport { isFunction, isUndefinedOrNull } from '../../../utils/inspect';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { stableSort } from '../../../utils/stable-sort';\nimport { trim } from '../../../utils/string';\nimport { defaultSortCompare } from './default-sort-compare'; // --- Constants ---\n\nvar MODEL_PROP_NAME_SORT_BY = 'sortBy';\nvar MODEL_EVENT_NAME_SORT_BY = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_SORT_BY;\nvar MODEL_PROP_NAME_SORT_DESC = 'sortDesc';\nvar MODEL_EVENT_NAME_SORT_DESC = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_SORT_DESC;\nvar SORT_DIRECTION_ASC = 'asc';\nvar SORT_DIRECTION_DESC = 'desc';\nvar SORT_DIRECTION_LAST = 'last';\nvar SORT_DIRECTIONS = [SORT_DIRECTION_ASC, SORT_DIRECTION_DESC, SORT_DIRECTION_LAST]; // --- Props ---\n\nexport var props = (_props = {\n labelSortAsc: makeProp(PROP_TYPE_STRING, 'Click to sort ascending'),\n labelSortClear: makeProp(PROP_TYPE_STRING, 'Click to clear sorting'),\n labelSortDesc: makeProp(PROP_TYPE_STRING, 'Click to sort descending'),\n noFooterSorting: makeProp(PROP_TYPE_BOOLEAN, false),\n noLocalSorting: makeProp(PROP_TYPE_BOOLEAN, false),\n // Another prop that should have had a better name\n // It should be `noSortClear` (on non-sortable headers)\n // We will need to make sure the documentation is clear on what\n // this prop does (as well as in the code for future reference)\n noSortReset: makeProp(PROP_TYPE_BOOLEAN, false)\n}, _defineProperty(_props, MODEL_PROP_NAME_SORT_BY, makeProp(PROP_TYPE_STRING)), _defineProperty(_props, \"sortCompare\", makeProp(PROP_TYPE_FUNCTION)), _defineProperty(_props, \"sortCompareLocale\", makeProp(PROP_TYPE_ARRAY_STRING)), _defineProperty(_props, \"sortCompareOptions\", makeProp(PROP_TYPE_OBJECT, {\n numeric: true\n})), _defineProperty(_props, MODEL_PROP_NAME_SORT_DESC, makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_props, \"sortDirection\", makeProp(PROP_TYPE_STRING, SORT_DIRECTION_ASC, function (value) {\n return arrayIncludes(SORT_DIRECTIONS, value);\n})), _defineProperty(_props, \"sortIconLeft\", makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_props, \"sortNullLast\", makeProp(PROP_TYPE_BOOLEAN, false)), _props); // --- Mixin ---\n// @vue/component\n\nexport var sortingMixin = extend({\n props: props,\n data: function data() {\n return {\n localSortBy: this[MODEL_PROP_NAME_SORT_BY] || '',\n localSortDesc: this[MODEL_PROP_NAME_SORT_DESC] || false\n };\n },\n computed: {\n localSorting: function localSorting() {\n return this.hasProvider ? !!this.noProviderSorting : !this.noLocalSorting;\n },\n isSortable: function isSortable() {\n return this.computedFields.some(function (f) {\n return f.sortable;\n });\n },\n // Sorts the filtered items and returns a new array of the sorted items\n // When not sorted, the original items array will be returned\n sortedItems: function sortedItems() {\n var _safeVueInstance = safeVueInstance(this),\n sortBy = _safeVueInstance.localSortBy,\n sortDesc = _safeVueInstance.localSortDesc,\n locale = _safeVueInstance.sortCompareLocale,\n nullLast = _safeVueInstance.sortNullLast,\n sortCompare = _safeVueInstance.sortCompare,\n localSorting = _safeVueInstance.localSorting,\n filteredItems = _safeVueInstance.filteredItems,\n localItems = _safeVueInstance.localItems;\n\n var items = (filteredItems || localItems || []).slice();\n\n var localeOptions = _objectSpread(_objectSpread({}, this.sortCompareOptions), {}, {\n usage: 'sort'\n });\n\n if (sortBy && localSorting) {\n var field = this.computedFieldsObj[sortBy] || {};\n var sortByFormatted = field.sortByFormatted;\n var formatter = isFunction(sortByFormatted) ?\n /* istanbul ignore next */\n sortByFormatted : sortByFormatted ? this.getFieldFormatter(sortBy) : undefined; // `stableSort` returns a new array, and leaves the original array intact\n\n return stableSort(items, function (a, b) {\n var result = null; // Call user provided `sortCompare` routine first\n\n if (isFunction(sortCompare)) {\n // TODO:\n // Change the `sortCompare` signature to the one of `defaultSortCompare`\n // with the next major version bump\n result = sortCompare(a, b, sortBy, sortDesc, formatter, localeOptions, locale);\n } // Fallback to built-in `defaultSortCompare` if `sortCompare`\n // is not defined or returns `null`/`false`\n\n\n if (isUndefinedOrNull(result) || result === false) {\n result = defaultSortCompare(a, b, {\n sortBy: sortBy,\n formatter: formatter,\n locale: locale,\n localeOptions: localeOptions,\n nullLast: nullLast\n });\n } // Negate result if sorting in descending order\n\n\n return (result || 0) * (sortDesc ? -1 : 1);\n });\n }\n\n return items;\n }\n },\n watch: (_watch = {\n /* istanbul ignore next: pain in the butt to test */\n isSortable: function isSortable(newValue) {\n if (newValue) {\n if (this.isSortable) {\n this.$on(EVENT_NAME_HEAD_CLICKED, this.handleSort);\n }\n } else {\n this.$off(EVENT_NAME_HEAD_CLICKED, this.handleSort);\n }\n }\n }, _defineProperty(_watch, MODEL_PROP_NAME_SORT_DESC, function (newValue) {\n /* istanbul ignore next */\n if (newValue === this.localSortDesc) {\n return;\n }\n\n this.localSortDesc = newValue || false;\n }), _defineProperty(_watch, MODEL_PROP_NAME_SORT_BY, function (newValue) {\n /* istanbul ignore next */\n if (newValue === this.localSortBy) {\n return;\n }\n\n this.localSortBy = newValue || '';\n }), _defineProperty(_watch, \"localSortDesc\", function localSortDesc(newValue, oldValue) {\n // Emit update to sort-desc.sync\n if (newValue !== oldValue) {\n this.$emit(MODEL_EVENT_NAME_SORT_DESC, newValue);\n }\n }), _defineProperty(_watch, \"localSortBy\", function localSortBy(newValue, oldValue) {\n if (newValue !== oldValue) {\n this.$emit(MODEL_EVENT_NAME_SORT_BY, newValue);\n }\n }), _watch),\n created: function created() {\n if (this.isSortable) {\n this.$on(EVENT_NAME_HEAD_CLICKED, this.handleSort);\n }\n },\n methods: {\n // Handlers\n // Need to move from thead-mixin\n handleSort: function handleSort(key, field, event, isFoot) {\n var _this = this;\n\n if (!this.isSortable) {\n /* istanbul ignore next */\n return;\n }\n\n if (isFoot && this.noFooterSorting) {\n return;\n } // TODO: make this tri-state sorting\n // cycle desc => asc => none => desc => ...\n\n\n var sortChanged = false;\n\n var toggleLocalSortDesc = function toggleLocalSortDesc() {\n var sortDirection = field.sortDirection || _this.sortDirection;\n\n if (sortDirection === SORT_DIRECTION_ASC) {\n _this.localSortDesc = false;\n } else if (sortDirection === SORT_DIRECTION_DESC) {\n _this.localSortDesc = true;\n } else {// sortDirection === 'last'\n // Leave at last sort direction from previous column\n }\n };\n\n if (field.sortable) {\n var sortKey = !this.localSorting && field.sortKey ? field.sortKey : key;\n\n if (this.localSortBy === sortKey) {\n // Change sorting direction on current column\n this.localSortDesc = !this.localSortDesc;\n } else {\n // Start sorting this column ascending\n this.localSortBy = sortKey; // this.localSortDesc = false\n\n toggleLocalSortDesc();\n }\n\n sortChanged = true;\n } else if (this.localSortBy && !this.noSortReset) {\n this.localSortBy = '';\n toggleLocalSortDesc();\n sortChanged = true;\n }\n\n if (sortChanged) {\n // Sorting parameters changed\n this.$emit(EVENT_NAME_SORT_CHANGED, this.context);\n }\n },\n // methods to compute classes and attrs for thead>th cells\n sortTheadThClasses: function sortTheadThClasses(key, field, isFoot) {\n return {\n // If sortable and sortIconLeft are true, then place sort icon on the left\n 'b-table-sort-icon-left': field.sortable && this.sortIconLeft && !(isFoot && this.noFooterSorting)\n };\n },\n sortTheadThAttrs: function sortTheadThAttrs(key, field, isFoot) {\n var _field$sortKey;\n\n var isSortable = this.isSortable,\n noFooterSorting = this.noFooterSorting,\n localSortDesc = this.localSortDesc,\n localSortBy = this.localSortBy,\n localSorting = this.localSorting;\n\n if (!isSortable || isFoot && noFooterSorting) {\n // No attributes if not a sortable table\n return {};\n }\n\n var sortable = field.sortable;\n var sortKey = !localSorting ? (_field$sortKey = field.sortKey) !== null && _field$sortKey !== void 0 ? _field$sortKey : key : key; // Assemble the aria-sort attribute value\n\n var ariaSort = sortable && localSortBy === sortKey ? localSortDesc ? 'descending' : 'ascending' : sortable ? 'none' : null; // Return the attribute\n\n return {\n 'aria-sort': ariaSort\n };\n },\n // A label to be placed in an `.sr-only` element in the header cell\n sortTheadThLabel: function sortTheadThLabel(key, field, isFoot) {\n // No label if not a sortable table\n if (!this.isSortable || isFoot && this.noFooterSorting) {\n return null;\n }\n\n var localSortBy = this.localSortBy,\n localSortDesc = this.localSortDesc,\n labelSortAsc = this.labelSortAsc,\n labelSortDesc = this.labelSortDesc;\n var sortable = field.sortable; // The correctness of these labels is very important for screen reader users\n\n var labelSorting = '';\n\n if (sortable) {\n if (localSortBy === key) {\n // Currently sorted sortable column\n labelSorting = localSortDesc ? labelSortAsc : labelSortDesc;\n } else {\n // Not currently sorted sortable column\n // Not using nested ternary's here for clarity/readability\n // Default for `aria-label`\n labelSorting = localSortDesc ? labelSortDesc : labelSortAsc; // Handle `sortDirection` setting\n\n var sortDirection = this.sortDirection || field.sortDirection;\n\n if (sortDirection === SORT_DIRECTION_ASC) {\n labelSorting = labelSortAsc;\n } else if (sortDirection === SORT_DIRECTION_DESC) {\n labelSorting = labelSortDesc;\n }\n }\n } else if (!this.noSortReset) {\n // Non sortable column\n labelSorting = localSortBy ? this.labelSortClear : '';\n } // Return the `.sr-only` sort label or `null` if no label\n\n\n return trim(labelSorting) || null;\n }\n }\n});","/*\n * Consistent and stable sort function across JavaScript platforms\n *\n * Inconsistent sorts can cause SSR problems between client and server\n * such as in if sortBy is applied to the data on server side render.\n * Chrome and V8 native sorts are inconsistent/unstable\n *\n * This function uses native sort with fallback to index compare when the a and b\n * compare returns 0\n *\n * Algorithm based on:\n * https://stackoverflow.com/questions/1427608/fast-stable-sorting-algorithm-implementation-in-javascript/45422645#45422645\n *\n * @param {array} array to sort\n * @param {function} sort compare function\n * @return {array}\n */\nexport var stableSort = function stableSort(array, compareFn) {\n // Using `.bind(compareFn)` on the wrapped anonymous function improves\n // performance by avoiding the function call setup. We don't use an arrow\n // function here as it binds `this` to the `stableSort` context rather than\n // the `compareFn` context, which wouldn't give us the performance increase.\n return array.map(function (a, index) {\n return [index, a];\n }).sort(function (a, b) {\n return this(a[1], b[1]) || a[0] - b[0];\n }.bind(compareFn)).map(function (e) {\n return e[1];\n });\n};","import { get } from '../../../utils/get';\nimport { isDate, isFunction, isNumber, isNumeric, isUndefinedOrNull } from '../../../utils/inspect';\nimport { toFloat } from '../../../utils/number';\nimport { stringifyObjectValues } from '../../../utils/stringify-object-values';\n\nvar normalizeValue = function normalizeValue(value) {\n if (isUndefinedOrNull(value)) {\n return '';\n }\n\n if (isNumeric(value)) {\n return toFloat(value, value);\n }\n\n return value;\n}; // Default sort compare routine\n//\n// TODO:\n// Add option to sort by multiple columns (tri-state per column,\n// plus order of columns in sort) where `sortBy` could be an array\n// of objects `[ {key: 'foo', sortDir: 'asc'}, {key:'bar', sortDir: 'desc'} ...]`\n// or an array of arrays `[ ['foo','asc'], ['bar','desc'] ]`\n// Multisort will most likely be handled in `mixin-sort.js` by\n// calling this method for each sortBy\n\n\nexport var defaultSortCompare = function defaultSortCompare(a, b) {\n var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},\n _ref$sortBy = _ref.sortBy,\n sortBy = _ref$sortBy === void 0 ? null : _ref$sortBy,\n _ref$formatter = _ref.formatter,\n formatter = _ref$formatter === void 0 ? null : _ref$formatter,\n _ref$locale = _ref.locale,\n locale = _ref$locale === void 0 ? undefined : _ref$locale,\n _ref$localeOptions = _ref.localeOptions,\n localeOptions = _ref$localeOptions === void 0 ? {} : _ref$localeOptions,\n _ref$nullLast = _ref.nullLast,\n nullLast = _ref$nullLast === void 0 ? false : _ref$nullLast;\n\n // Get the value by `sortBy`\n var aa = get(a, sortBy, null);\n var bb = get(b, sortBy, null); // Apply user-provided formatter\n\n if (isFunction(formatter)) {\n aa = formatter(aa, sortBy, a);\n bb = formatter(bb, sortBy, b);\n } // Internally normalize value\n // `null` / `undefined` => ''\n // `'0'` => `0`\n\n\n aa = normalizeValue(aa);\n bb = normalizeValue(bb);\n\n if (isDate(aa) && isDate(bb) || isNumber(aa) && isNumber(bb)) {\n // Special case for comparing dates and numbers\n // Internally dates are compared via their epoch number values\n return aa < bb ? -1 : aa > bb ? 1 : 0;\n } else if (nullLast && aa === '' && bb !== '') {\n // Special case when sorting `null` / `undefined` / '' last\n return 1;\n } else if (nullLast && aa !== '' && bb === '') {\n // Special case when sorting `null` / `undefined` / '' last\n return -1;\n } // Do localized string comparison\n\n\n return stringifyObjectValues(aa).localeCompare(stringifyObjectValues(bb), locale, localeOptions);\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TBODY } from '../../constants/components';\nimport { PROP_TYPE_OBJECT } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { listenersMixin } from '../../mixins/listeners';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n tbodyTransitionHandlers: makeProp(PROP_TYPE_OBJECT),\n tbodyTransitionProps: makeProp(PROP_TYPE_OBJECT)\n}, NAME_TBODY); // --- Main component ---\n// TODO:\n// In Bootstrap v5, we won't need \"sniffing\" as table element variants properly inherit\n// to the child elements, so this can be converted to a functional component\n// @vue/component\n\nexport var BTbody = /*#__PURE__*/extend({\n name: NAME_TBODY,\n mixins: [attrsMixin, listenersMixin, normalizeSlotMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvTableRowGroup: function getBvTableRowGroup() {\n return _this;\n }\n };\n },\n inject: {\n // Sniffed by `` / `` / ``\n getBvTable: {\n default:\n /* istanbul ignore next */\n function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n inheritAttrs: false,\n props: props,\n computed: {\n bvTable: function bvTable() {\n return this.getBvTable();\n },\n // Sniffed by `` / `` / ``\n isTbody: function isTbody() {\n return true;\n },\n // Sniffed by `` / `` / ``\n isDark: function isDark() {\n return this.bvTable.dark;\n },\n // Sniffed by `` / `` / ``\n isStacked: function isStacked() {\n return this.bvTable.isStacked;\n },\n // Sniffed by `` / `` / ``\n isResponsive: function isResponsive() {\n return this.bvTable.isResponsive;\n },\n // Sniffed by `` / `` / ``\n // Sticky headers are only supported in thead\n isStickyHeader: function isStickyHeader() {\n return false;\n },\n // Sniffed by `` / `` / ``\n // Needed to handle header background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n hasStickyHeader: function hasStickyHeader() {\n return !this.isStacked && this.bvTable.stickyHeader;\n },\n // Sniffed by `` / `` / ``\n tableVariant: function tableVariant() {\n return this.bvTable.tableVariant;\n },\n isTransitionGroup: function isTransitionGroup() {\n return this.tbodyTransitionProps || this.tbodyTransitionHandlers;\n },\n tbodyAttrs: function tbodyAttrs() {\n return _objectSpread({\n role: 'rowgroup'\n }, this.bvAttrs);\n },\n tbodyProps: function tbodyProps() {\n var tbodyTransitionProps = this.tbodyTransitionProps;\n return tbodyTransitionProps ? _objectSpread(_objectSpread({}, tbodyTransitionProps), {}, {\n tag: 'tbody'\n }) : {};\n }\n },\n render: function render(h) {\n var data = {\n props: this.tbodyProps,\n attrs: this.tbodyAttrs\n };\n\n if (this.isTransitionGroup) {\n // We use native listeners if a transition group for any delegated events\n data.on = this.tbodyTransitionHandlers || {};\n data.nativeOn = this.bvListeners;\n } else {\n // Otherwise we place any listeners on the tbody element\n data.on = this.bvListeners;\n }\n\n return h(this.isTransitionGroup ? 'transition-group' : 'tbody', data, this.normalizeSlot());\n }\n});","import { closest, getAttr, getById, matches, select } from '../../../utils/dom';\nimport { EVENT_FILTER } from './constants';\nvar TABLE_TAG_NAMES = ['TD', 'TH', 'TR']; // Returns `true` if we should ignore the click/double-click/keypress event\n// Avoids having the user need to use `@click.stop` on the form control\n\nexport var filterEvent = function filterEvent(event) {\n // Exit early when we don't have a target element\n if (!event || !event.target) {\n /* istanbul ignore next */\n return false;\n }\n\n var el = event.target; // Exit early when element is disabled or a table element\n\n if (el.disabled || TABLE_TAG_NAMES.indexOf(el.tagName) !== -1) {\n return false;\n } // Ignore the click when it was inside a dropdown menu\n\n\n if (closest('.dropdown-menu', el)) {\n return true;\n }\n\n var label = el.tagName === 'LABEL' ? el : closest('label', el); // If the label's form control is not disabled then we don't propagate event\n // Modern browsers have `label.control` that references the associated input, but IE 11\n // does not have this property on the label element, so we resort to DOM lookups\n\n if (label) {\n var labelFor = getAttr(label, 'for');\n var input = labelFor ? getById(labelFor) : select('input, select, textarea', label);\n\n if (input && !input.disabled) {\n return true;\n }\n } // Otherwise check if the event target matches one of the selectors in the\n // event filter (i.e. anchors, non disabled inputs, etc.)\n // Return `true` if we should ignore the event\n\n\n return matches(el, EVENT_FILTER);\n};","import { getSel, isElement } from '../../../utils/dom'; // Helper to determine if a there is an active text selection on the document page\n// Used to filter out click events caused by the mouse up at end of selection\n//\n// Accepts an element as only argument to test to see if selection overlaps or is\n// contained within the element\n\nexport var textSelectionActive = function textSelectionActive() {\n var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;\n var sel = getSel();\n return sel && sel.toString().trim() !== '' && sel.containsNode && isElement(el) ?\n /* istanbul ignore next */\n sel.containsNode(el, true) : false;\n};","import { extend } from '../../vue';\nimport { NAME_TH } from '../../constants/components';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { BTd, props as BTdProps } from './td'; // --- Props ---\n\nexport var props = makePropsConfigurable(BTdProps, NAME_TH); // --- Main component ---\n// TODO:\n// In Bootstrap v5, we won't need \"sniffing\" as table element variants properly inherit\n// to the child elements, so this can be converted to a functional component\n// @vue/component\n\nexport var BTh = /*#__PURE__*/extend({\n name: NAME_TH,\n extends: BTd,\n props: props,\n computed: {\n tag: function tag() {\n return 'th';\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { extend, REF_FOR_KEY } from '../../../vue';\nimport { EVENT_NAME_ROW_CLICKED, EVENT_NAME_ROW_HOVERED, EVENT_NAME_ROW_UNHOVERED } from '../../../constants/events';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_FUNCTION, PROP_TYPE_OBJECT_FUNCTION } from '../../../constants/props';\nimport { SLOT_NAME_ROW_DETAILS } from '../../../constants/slots';\nimport { useParentMixin } from '../../../mixins/use-parent';\nimport { get } from '../../../utils/get';\nimport { isFunction, isString, isUndefinedOrNull } from '../../../utils/inspect';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { toString } from '../../../utils/string';\nimport { BTr } from '../tr';\nimport { BTd } from '../td';\nimport { BTh } from '../th';\nimport { FIELD_KEY_CELL_VARIANT, FIELD_KEY_ROW_VARIANT, FIELD_KEY_SHOW_DETAILS } from './constants'; // --- Props ---\n\nexport var props = {\n detailsTdClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n tbodyTrAttr: makeProp(PROP_TYPE_OBJECT_FUNCTION),\n tbodyTrClass: makeProp([].concat(_toConsumableArray(PROP_TYPE_ARRAY_OBJECT_STRING), [PROP_TYPE_FUNCTION]))\n}; // --- Mixin ---\n// @vue/component\n\nexport var tbodyRowMixin = extend({\n mixins: [useParentMixin],\n props: props,\n methods: {\n // Methods for computing classes, attributes and styles for table cells\n getTdValues: function getTdValues(item, key, tdValue, defaultValue) {\n var bvParent = this.bvParent;\n\n if (tdValue) {\n var value = get(item, key, '');\n\n if (isFunction(tdValue)) {\n return tdValue(value, key, item);\n } else if (isString(tdValue) && isFunction(bvParent[tdValue])) {\n return bvParent[tdValue](value, key, item);\n }\n\n return tdValue;\n }\n\n return defaultValue;\n },\n getThValues: function getThValues(item, key, thValue, type, defaultValue) {\n var bvParent = this.bvParent;\n\n if (thValue) {\n var value = get(item, key, '');\n\n if (isFunction(thValue)) {\n return thValue(value, key, item, type);\n } else if (isString(thValue) && isFunction(bvParent[thValue])) {\n return bvParent[thValue](value, key, item, type);\n }\n\n return thValue;\n }\n\n return defaultValue;\n },\n // Method to get the value for a field\n getFormattedValue: function getFormattedValue(item, field) {\n var key = field.key;\n var formatter = this.getFieldFormatter(key);\n var value = get(item, key, null);\n\n if (isFunction(formatter)) {\n value = formatter(value, key, item);\n }\n\n return isUndefinedOrNull(value) ? '' : value;\n },\n // Factory function methods\n toggleDetailsFactory: function toggleDetailsFactory(hasDetailsSlot, item) {\n var _this = this;\n\n // Returns a function to toggle a row's details slot\n return function () {\n if (hasDetailsSlot) {\n _this.$set(item, FIELD_KEY_SHOW_DETAILS, !item[FIELD_KEY_SHOW_DETAILS]);\n }\n };\n },\n // Row event handlers\n rowHovered: function rowHovered(event) {\n // `mouseenter` handler (non-bubbling)\n // `this.tbodyRowEventStopped` from tbody mixin\n if (!this.tbodyRowEventStopped(event)) {\n // `this.emitTbodyRowEvent` from tbody mixin\n this.emitTbodyRowEvent(EVENT_NAME_ROW_HOVERED, event);\n }\n },\n rowUnhovered: function rowUnhovered(event) {\n // `mouseleave` handler (non-bubbling)\n // `this.tbodyRowEventStopped` from tbody mixin\n if (!this.tbodyRowEventStopped(event)) {\n // `this.emitTbodyRowEvent` from tbody mixin\n this.emitTbodyRowEvent(EVENT_NAME_ROW_UNHOVERED, event);\n }\n },\n // Renders a TD or TH for a row's field\n renderTbodyRowCell: function renderTbodyRowCell(field, colIndex, item, rowIndex) {\n var _this2 = this;\n\n var isStacked = this.isStacked;\n var key = field.key,\n label = field.label,\n isRowHeader = field.isRowHeader;\n var h = this.$createElement;\n var hasDetailsSlot = this.hasNormalizedSlot(SLOT_NAME_ROW_DETAILS);\n var formatted = this.getFormattedValue(item, field);\n var stickyColumn = !isStacked && (this.isResponsive || this.stickyHeader) && field.stickyColumn; // We only uses the helper components for sticky columns to\n // improve performance of BTable/BTableLite by reducing the\n // total number of vue instances created during render\n\n var cellTag = stickyColumn ? isRowHeader ? BTh : BTd : isRowHeader ? 'th' : 'td';\n var cellVariant = item[FIELD_KEY_CELL_VARIANT] && item[FIELD_KEY_CELL_VARIANT][key] ? item[FIELD_KEY_CELL_VARIANT][key] : field.variant || null;\n var data = {\n // For the Vue key, we concatenate the column index and\n // field key (as field keys could be duplicated)\n // TODO: Although we do prevent duplicate field keys...\n // So we could change this to: `row-${rowIndex}-cell-${key}`\n class: [field.class ? field.class : '', this.getTdValues(item, key, field.tdClass, '')],\n props: {},\n attrs: _objectSpread({\n 'aria-colindex': String(colIndex + 1)\n }, isRowHeader ? this.getThValues(item, key, field.thAttr, 'row', {}) : this.getTdValues(item, key, field.tdAttr, {})),\n key: \"row-\".concat(rowIndex, \"-cell-\").concat(colIndex, \"-\").concat(key)\n };\n\n if (stickyColumn) {\n // We are using the helper BTd or BTh\n data.props = {\n stackedHeading: isStacked ? label : null,\n stickyColumn: true,\n variant: cellVariant\n };\n } else {\n // Using native TD or TH element, so we need to\n // add in the attributes and variant class\n data.attrs['data-label'] = isStacked && !isUndefinedOrNull(label) ? toString(label) : null;\n data.attrs.role = isRowHeader ? 'rowheader' : 'cell';\n data.attrs.scope = isRowHeader ? 'row' : null; // Add in the variant class\n\n if (cellVariant) {\n data.class.push(\"\".concat(this.dark ? 'bg' : 'table', \"-\").concat(cellVariant));\n }\n }\n\n var slotScope = {\n item: item,\n index: rowIndex,\n field: field,\n unformatted: get(item, key, ''),\n value: formatted,\n toggleDetails: this.toggleDetailsFactory(hasDetailsSlot, item),\n detailsShowing: Boolean(item[FIELD_KEY_SHOW_DETAILS])\n }; // If table supports selectable mode, then add in the following scope\n // this.supportsSelectableRows will be undefined if mixin isn't loaded\n\n if (safeVueInstance(this).supportsSelectableRows) {\n slotScope.rowSelected = this.isRowSelected(rowIndex);\n\n slotScope.selectRow = function () {\n return _this2.selectRow(rowIndex);\n };\n\n slotScope.unselectRow = function () {\n return _this2.unselectRow(rowIndex);\n };\n } // The new `v-slot` syntax doesn't like a slot name starting with\n // a square bracket and if using in-document HTML templates, the\n // v-slot attributes are lower-cased by the browser.\n // Switched to round bracket syntax to prevent confusion with\n // dynamic slot name syntax.\n // We look for slots in this order: `cell(${key})`, `cell(${key.toLowerCase()})`, 'cell()'\n // Slot names are now cached by mixin tbody in `this.$_bodyFieldSlotNameCache`\n // Will be `null` if no slot (or fallback slot) exists\n\n\n var slotName = this.$_bodyFieldSlotNameCache[key];\n var $childNodes = slotName ? this.normalizeSlot(slotName, slotScope) : toString(formatted);\n\n if (this.isStacked) {\n // We wrap in a DIV to ensure rendered as a single cell when visually stacked!\n $childNodes = [h('div', [$childNodes])];\n } // Render either a td or th cell\n\n\n return h(cellTag, data, [$childNodes]);\n },\n // Renders an item's row (or rows if details supported)\n renderTbodyRow: function renderTbodyRow(item, rowIndex) {\n var _this3 = this;\n\n var _safeVueInstance = safeVueInstance(this),\n fields = _safeVueInstance.computedFields,\n striped = _safeVueInstance.striped,\n primaryKey = _safeVueInstance.primaryKey,\n currentPage = _safeVueInstance.currentPage,\n perPage = _safeVueInstance.perPage,\n tbodyTrClass = _safeVueInstance.tbodyTrClass,\n tbodyTrAttr = _safeVueInstance.tbodyTrAttr,\n hasSelectableRowClick = _safeVueInstance.hasSelectableRowClick;\n\n var h = this.$createElement;\n var hasDetailsSlot = this.hasNormalizedSlot(SLOT_NAME_ROW_DETAILS);\n var rowShowDetails = item[FIELD_KEY_SHOW_DETAILS] && hasDetailsSlot;\n var hasRowClickHandler = this.$listeners[EVENT_NAME_ROW_CLICKED] || hasSelectableRowClick; // We can return more than one TR if rowDetails enabled\n\n var $rows = []; // Details ID needed for `aria-details` when details showing\n // We set it to `null` when not showing so that attribute\n // does not appear on the element\n\n var detailsId = rowShowDetails ? this.safeId(\"_details_\".concat(rowIndex, \"_\")) : null; // For each item data field in row\n\n var $tds = fields.map(function (field, colIndex) {\n return _this3.renderTbodyRowCell(field, colIndex, item, rowIndex);\n }); // Calculate the row number in the dataset (indexed from 1)\n\n var ariaRowIndex = null;\n\n if (currentPage && perPage && perPage > 0) {\n ariaRowIndex = String((currentPage - 1) * perPage + rowIndex + 1);\n } // Create a unique :key to help ensure that sub components are re-rendered rather than\n // re-used, which can cause issues. If a primary key is not provided we use the rendered\n // rows index within the tbody.\n // See: https://github.com/bootstrap-vue/bootstrap-vue/issues/2410\n\n\n var primaryKeyValue = toString(get(item, primaryKey)) || null;\n var rowKey = primaryKeyValue || toString(rowIndex); // If primary key is provided, use it to generate a unique ID on each tbody > tr\n // In the format of '{tableId}__row_{primaryKeyValue}'\n\n var rowId = primaryKeyValue ? this.safeId(\"_row_\".concat(primaryKeyValue)) : null; // Selectable classes and attributes\n\n var selectableClasses = safeVueInstance(this).selectableRowClasses ? this.selectableRowClasses(rowIndex) : {};\n var selectableAttrs = safeVueInstance(this).selectableRowAttrs ? this.selectableRowAttrs(rowIndex) : {}; // Additional classes and attributes\n\n var userTrClasses = isFunction(tbodyTrClass) ? tbodyTrClass(item, 'row') : tbodyTrClass;\n var userTrAttrs = isFunction(tbodyTrAttr) ?\n /* istanbul ignore next */\n tbodyTrAttr(item, 'row') : tbodyTrAttr; // Add the item row\n\n $rows.push(h(BTr, _defineProperty({\n class: [userTrClasses, selectableClasses, rowShowDetails ? 'b-table-has-details' : ''],\n props: {\n variant: item[FIELD_KEY_ROW_VARIANT] || null\n },\n attrs: _objectSpread(_objectSpread({\n id: rowId\n }, userTrAttrs), {}, {\n // Users cannot override the following attributes\n tabindex: hasRowClickHandler ? '0' : null,\n 'data-pk': primaryKeyValue || null,\n 'aria-details': detailsId,\n 'aria-owns': detailsId,\n 'aria-rowindex': ariaRowIndex\n }, selectableAttrs),\n on: {\n // Note: These events are not A11Y friendly!\n mouseenter: this.rowHovered,\n mouseleave: this.rowUnhovered\n },\n key: \"__b-table-row-\".concat(rowKey, \"__\"),\n ref: 'item-rows'\n }, REF_FOR_KEY, true), $tds)); // Row Details slot\n\n if (rowShowDetails) {\n var detailsScope = {\n item: item,\n index: rowIndex,\n fields: fields,\n toggleDetails: this.toggleDetailsFactory(hasDetailsSlot, item)\n }; // If table supports selectable mode, then add in the following scope\n // this.supportsSelectableRows will be undefined if mixin isn't loaded\n\n if (safeVueInstance(this).supportsSelectableRows) {\n detailsScope.rowSelected = this.isRowSelected(rowIndex);\n\n detailsScope.selectRow = function () {\n return _this3.selectRow(rowIndex);\n };\n\n detailsScope.unselectRow = function () {\n return _this3.unselectRow(rowIndex);\n };\n } // Render the details slot in a TD\n\n\n var $details = h(BTd, {\n props: {\n colspan: fields.length\n },\n class: this.detailsTdClass\n }, [this.normalizeSlot(SLOT_NAME_ROW_DETAILS, detailsScope)]); // Add a hidden row to keep table row striping consistent when details showing\n // Only added if the table is striped\n\n if (striped) {\n $rows.push( // We don't use `BTr` here as we don't need the extra functionality\n h('tr', {\n staticClass: 'd-none',\n attrs: {\n 'aria-hidden': 'true',\n role: 'presentation'\n },\n key: \"__b-table-details-stripe__\".concat(rowKey)\n }));\n } // Add the actual details row\n\n\n var userDetailsTrClasses = isFunction(this.tbodyTrClass) ?\n /* istanbul ignore next */\n this.tbodyTrClass(item, SLOT_NAME_ROW_DETAILS) : this.tbodyTrClass;\n var userDetailsTrAttrs = isFunction(this.tbodyTrAttr) ?\n /* istanbul ignore next */\n this.tbodyTrAttr(item, SLOT_NAME_ROW_DETAILS) : this.tbodyTrAttr;\n $rows.push(h(BTr, {\n staticClass: 'b-table-details',\n class: [userDetailsTrClasses],\n props: {\n variant: item[FIELD_KEY_ROW_VARIANT] || null\n },\n attrs: _objectSpread(_objectSpread({}, userDetailsTrAttrs), {}, {\n // Users cannot override the following attributes\n id: detailsId,\n tabindex: '-1'\n }),\n key: \"__b-table-details__\".concat(rowKey)\n }, [$details]));\n } else if (hasDetailsSlot) {\n // Only add the placeholder if a the table has a row-details slot defined (but not shown)\n $rows.push(h());\n\n if (striped) {\n // Add extra placeholder if table is striped\n $rows.push(h());\n }\n } // Return the row(s)\n\n\n return $rows;\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { EVENT_NAME_ROW_CLICKED, EVENT_NAME_ROW_CONTEXTMENU, EVENT_NAME_ROW_DBLCLICKED, EVENT_NAME_ROW_MIDDLE_CLICKED } from '../../../constants/events';\nimport { CODE_DOWN, CODE_END, CODE_ENTER, CODE_HOME, CODE_SPACE, CODE_UP } from '../../../constants/key-codes';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING } from '../../../constants/props';\nimport { arrayIncludes, from as arrayFrom } from '../../../utils/array';\nimport { attemptFocus, closest, isActiveElement, isElement } from '../../../utils/dom';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { stopEvent } from '../../../utils/events';\nimport { sortKeys } from '../../../utils/object';\nimport { makeProp, pluckProps } from '../../../utils/props';\nimport { BTbody, props as BTbodyProps } from '../tbody';\nimport { filterEvent } from './filter-event';\nimport { textSelectionActive } from './text-selection-active';\nimport { tbodyRowMixin, props as tbodyRowProps } from './mixin-tbody-row'; // --- Helper methods ---\n\nvar getCellSlotName = function getCellSlotName(value) {\n return \"cell(\".concat(value || '', \")\");\n}; // --- Props ---\n\n\nexport var props = sortKeys(_objectSpread(_objectSpread(_objectSpread({}, BTbodyProps), tbodyRowProps), {}, {\n tbodyClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)\n})); // --- Mixin ---\n// @vue/component\n\nexport var tbodyMixin = extend({\n mixins: [tbodyRowMixin],\n props: props,\n beforeDestroy: function beforeDestroy() {\n this.$_bodyFieldSlotNameCache = null;\n },\n methods: {\n // Returns all the item TR elements (excludes detail and spacer rows)\n // `this.$refs['item-rows']` is an array of item TR components/elements\n // Rows should all be `` components, but we map to TR elements\n // Also note that `this.$refs['item-rows']` may not always be in document order\n getTbodyTrs: function getTbodyTrs() {\n var $refs = this.$refs;\n var tbody = $refs.tbody ? $refs.tbody.$el || $refs.tbody : null;\n var trs = ($refs['item-rows'] || []).map(function (tr) {\n return tr.$el || tr;\n });\n return tbody && tbody.children && tbody.children.length > 0 && trs && trs.length > 0 ? arrayFrom(tbody.children).filter(function (tr) {\n return arrayIncludes(trs, tr);\n }) :\n /* istanbul ignore next */\n [];\n },\n // Returns index of a particular TBODY item TR\n // We set `true` on closest to include self in result\n getTbodyTrIndex: function getTbodyTrIndex(el) {\n /* istanbul ignore next: should not normally happen */\n if (!isElement(el)) {\n return -1;\n }\n\n var tr = el.tagName === 'TR' ? el : closest('tr', el, true);\n return tr ? this.getTbodyTrs().indexOf(tr) : -1;\n },\n // Emits a row event, with the item object, row index and original event\n emitTbodyRowEvent: function emitTbodyRowEvent(type, event) {\n if (type && this.hasListener(type) && event && event.target) {\n var rowIndex = this.getTbodyTrIndex(event.target);\n\n if (rowIndex > -1) {\n // The array of TRs correlate to the `computedItems` array\n var item = this.computedItems[rowIndex];\n this.$emit(type, item, rowIndex, event);\n }\n }\n },\n tbodyRowEventStopped: function tbodyRowEventStopped(event) {\n return this.stopIfBusy && this.stopIfBusy(event);\n },\n // Delegated row event handlers\n onTbodyRowKeydown: function onTbodyRowKeydown(event) {\n // Keyboard navigation and row click emulation\n var target = event.target,\n keyCode = event.keyCode;\n\n if (this.tbodyRowEventStopped(event) || target.tagName !== 'TR' || !isActiveElement(target) || target.tabIndex !== 0) {\n // Early exit if not an item row TR\n return;\n }\n\n if (arrayIncludes([CODE_ENTER, CODE_SPACE], keyCode)) {\n // Emulated click for keyboard users, transfer to click handler\n stopEvent(event);\n this.onTBodyRowClicked(event);\n } else if (arrayIncludes([CODE_UP, CODE_DOWN, CODE_HOME, CODE_END], keyCode)) {\n // Keyboard navigation\n var rowIndex = this.getTbodyTrIndex(target);\n\n if (rowIndex > -1) {\n stopEvent(event);\n var trs = this.getTbodyTrs();\n var shift = event.shiftKey;\n\n if (keyCode === CODE_HOME || shift && keyCode === CODE_UP) {\n // Focus first row\n attemptFocus(trs[0]);\n } else if (keyCode === CODE_END || shift && keyCode === CODE_DOWN) {\n // Focus last row\n attemptFocus(trs[trs.length - 1]);\n } else if (keyCode === CODE_UP && rowIndex > 0) {\n // Focus previous row\n attemptFocus(trs[rowIndex - 1]);\n } else if (keyCode === CODE_DOWN && rowIndex < trs.length - 1) {\n // Focus next row\n attemptFocus(trs[rowIndex + 1]);\n }\n }\n }\n },\n onTBodyRowClicked: function onTBodyRowClicked(event) {\n var $refs = this.$refs;\n var tbody = $refs.tbody ? $refs.tbody.$el || $refs.tbody : null; // Don't emit event when the table is busy, the user clicked\n // on a non-disabled control or is selecting text\n\n if (this.tbodyRowEventStopped(event) || filterEvent(event) || textSelectionActive(tbody || this.$el)) {\n return;\n }\n\n this.emitTbodyRowEvent(EVENT_NAME_ROW_CLICKED, event);\n },\n onTbodyRowMiddleMouseRowClicked: function onTbodyRowMiddleMouseRowClicked(event) {\n if (!this.tbodyRowEventStopped(event) && event.which === 2) {\n this.emitTbodyRowEvent(EVENT_NAME_ROW_MIDDLE_CLICKED, event);\n }\n },\n onTbodyRowContextmenu: function onTbodyRowContextmenu(event) {\n if (!this.tbodyRowEventStopped(event)) {\n this.emitTbodyRowEvent(EVENT_NAME_ROW_CONTEXTMENU, event);\n }\n },\n onTbodyRowDblClicked: function onTbodyRowDblClicked(event) {\n if (!this.tbodyRowEventStopped(event) && !filterEvent(event)) {\n this.emitTbodyRowEvent(EVENT_NAME_ROW_DBLCLICKED, event);\n }\n },\n // Render the tbody element and children\n // Note:\n // Row hover handlers are handled by the tbody-row mixin\n // As mouseenter/mouseleave events do not bubble\n renderTbody: function renderTbody() {\n var _this = this;\n\n var _safeVueInstance = safeVueInstance(this),\n items = _safeVueInstance.computedItems,\n renderBusy = _safeVueInstance.renderBusy,\n renderTopRow = _safeVueInstance.renderTopRow,\n renderEmpty = _safeVueInstance.renderEmpty,\n renderBottomRow = _safeVueInstance.renderBottomRow,\n hasSelectableRowClick = _safeVueInstance.hasSelectableRowClick;\n\n var h = this.$createElement;\n var hasRowClickHandler = this.hasListener(EVENT_NAME_ROW_CLICKED) || hasSelectableRowClick; // Prepare the tbody rows\n\n var $rows = []; // Add the item data rows or the busy slot\n\n var $busy = renderBusy ? renderBusy() : null;\n\n if ($busy) {\n // If table is busy and a busy slot, then return only the busy \"row\" indicator\n $rows.push($busy);\n } else {\n // Table isn't busy, or we don't have a busy slot\n // Create a slot cache for improved performance when looking up cell slot names\n // Values will be keyed by the field's `key` and will store the slot's name\n // Slots could be dynamic (i.e. `v-if`), so we must compute on each render\n // Used by tbody-row mixin render helper\n var cache = {};\n var defaultSlotName = getCellSlotName();\n defaultSlotName = this.hasNormalizedSlot(defaultSlotName) ? defaultSlotName : null;\n this.computedFields.forEach(function (field) {\n var key = field.key;\n var slotName = getCellSlotName(key);\n var lowercaseSlotName = getCellSlotName(key.toLowerCase());\n cache[key] = _this.hasNormalizedSlot(slotName) ? slotName : _this.hasNormalizedSlot(lowercaseSlotName) ?\n /* istanbul ignore next */\n lowercaseSlotName : defaultSlotName;\n }); // Created as a non-reactive property so to not trigger component updates\n // Must be a fresh object each render\n\n this.$_bodyFieldSlotNameCache = cache; // Add static top row slot (hidden in visibly stacked mode\n // as we can't control `data-label` attr)\n\n $rows.push(renderTopRow ? renderTopRow() : h()); // Render the rows\n\n items.forEach(function (item, rowIndex) {\n // Render the individual item row (rows if details slot)\n $rows.push(_this.renderTbodyRow(item, rowIndex));\n }); // Empty items / empty filtered row slot (only shows if `items.length < 1`)\n\n $rows.push(renderEmpty ? renderEmpty() : h()); // Static bottom row slot (hidden in visibly stacked mode\n // as we can't control `data-label` attr)\n\n $rows.push(renderBottomRow ? renderBottomRow() : h());\n } // Note: these events will only emit if a listener is registered\n\n\n var handlers = {\n auxclick: this.onTbodyRowMiddleMouseRowClicked,\n // TODO:\n // Perhaps we do want to automatically prevent the\n // default context menu from showing if there is a\n // `row-contextmenu` listener registered\n contextmenu: this.onTbodyRowContextmenu,\n // The following event(s) is not considered A11Y friendly\n dblclick: this.onTbodyRowDblClicked // Hover events (`mouseenter`/`mouseleave`) are handled by `tbody-row` mixin\n\n }; // Add in click/keydown listeners if needed\n\n if (hasRowClickHandler) {\n handlers.click = this.onTBodyRowClicked;\n handlers.keydown = this.onTbodyRowKeydown;\n } // Assemble rows into the tbody\n\n\n var $tbody = h(BTbody, {\n class: this.tbodyClass || null,\n props: pluckProps(BTbodyProps, this.$props),\n // BTbody transfers all native event listeners to the root element\n // TODO: Only set the handlers if the table is not busy\n on: handlers,\n ref: 'tbody'\n }, $rows); // Return the assembled tbody\n\n return $tbody;\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TFOOT } from '../../constants/components';\nimport { PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { listenersMixin } from '../../mixins/listeners';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n // Supported values: 'lite', 'dark', or null\n footVariant: makeProp(PROP_TYPE_STRING)\n}, NAME_TFOOT); // --- Main component ---\n// TODO:\n// In Bootstrap v5, we won't need \"sniffing\" as table element variants properly inherit\n// to the child elements, so this can be converted to a functional component\n// @vue/component\n\nexport var BTfoot = /*#__PURE__*/extend({\n name: NAME_TFOOT,\n mixins: [attrsMixin, listenersMixin, normalizeSlotMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvTableRowGroup: function getBvTableRowGroup() {\n return _this;\n }\n };\n },\n inject: {\n // Sniffed by `` / `` / ``\n getBvTable: {\n default:\n /* istanbul ignore next */\n function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n inheritAttrs: false,\n props: props,\n computed: {\n bvTable: function bvTable() {\n return this.getBvTable();\n },\n // Sniffed by `` / `` / ``\n isTfoot: function isTfoot() {\n return true;\n },\n // Sniffed by `` / `` / ``\n isDark: function isDark() {\n return this.bvTable.dark;\n },\n // Sniffed by `` / `` / ``\n isStacked: function isStacked() {\n return this.bvTable.isStacked;\n },\n // Sniffed by `` / `` / ``\n isResponsive: function isResponsive() {\n return this.bvTable.isResponsive;\n },\n // Sniffed by `` / `` / ``\n // Sticky headers are only supported in thead\n isStickyHeader: function isStickyHeader() {\n return false;\n },\n // Sniffed by `` / `` / ``\n // Needed to handle header background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n hasStickyHeader: function hasStickyHeader() {\n return !this.isStacked && this.bvTable.stickyHeader;\n },\n // Sniffed by `` / `` / ``\n tableVariant: function tableVariant() {\n return this.bvTable.tableVariant;\n },\n tfootClasses: function tfootClasses() {\n return [this.footVariant ? \"thead-\".concat(this.footVariant) : null];\n },\n tfootAttrs: function tfootAttrs() {\n return _objectSpread(_objectSpread({}, this.bvAttrs), {}, {\n role: 'rowgroup'\n });\n }\n },\n render: function render(h) {\n return h('tfoot', {\n class: this.tfootClasses,\n attrs: this.tfootAttrs,\n // Pass down any native listeners\n on: this.bvListeners\n }, this.normalizeSlot());\n }\n});","import { extend } from '../../../vue';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../../constants/props';\nimport { SLOT_NAME_CUSTOM_FOOT } from '../../../constants/slots';\nimport { makeProp } from '../../../utils/props';\nimport { BTfoot } from '../tfoot'; // --- Props ---\n\nexport var props = {\n footClone: makeProp(PROP_TYPE_BOOLEAN, false),\n // Any Bootstrap theme variant (or custom)\n // Falls back to `headRowVariant`\n footRowVariant: makeProp(PROP_TYPE_STRING),\n // 'dark', 'light', or `null` (or custom)\n footVariant: makeProp(PROP_TYPE_STRING),\n tfootClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n tfootTrClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)\n}; // --- Mixin ---\n// @vue/component\n\nexport var tfootMixin = extend({\n props: props,\n methods: {\n renderTFootCustom: function renderTFootCustom() {\n var h = this.$createElement;\n\n if (this.hasNormalizedSlot(SLOT_NAME_CUSTOM_FOOT)) {\n return h(BTfoot, {\n class: this.tfootClass || null,\n props: {\n footVariant: this.footVariant || this.headVariant || null\n },\n key: 'bv-tfoot-custom'\n }, this.normalizeSlot(SLOT_NAME_CUSTOM_FOOT, {\n items: this.computedItems.slice(),\n fields: this.computedFields.slice(),\n columns: this.computedFields.length\n }));\n }\n\n return h();\n },\n renderTfoot: function renderTfoot() {\n // Passing true to renderThead will make it render a tfoot\n return this.footClone ? this.renderThead(true) : this.renderTFootCustom();\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_THEAD } from '../../constants/components';\nimport { PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { listenersMixin } from '../../mixins/listeners';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n // Also sniffed by `` / `` / ``\n // Supported values: 'lite', 'dark', or `null`\n headVariant: makeProp(PROP_TYPE_STRING)\n}, NAME_THEAD); // --- Main component ---\n// TODO:\n// In Bootstrap v5, we won't need \"sniffing\" as table element variants properly inherit\n// to the child elements, so this can be converted to a functional component\n// @vue/component\n\nexport var BThead = /*#__PURE__*/extend({\n name: NAME_THEAD,\n mixins: [attrsMixin, listenersMixin, normalizeSlotMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvTableRowGroup: function getBvTableRowGroup() {\n return _this;\n }\n };\n },\n inject: {\n // Sniffed by `` / `` / ``\n getBvTable: {\n default:\n /* istanbul ignore next */\n function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n inheritAttrs: false,\n props: props,\n computed: {\n bvTable: function bvTable() {\n return this.getBvTable();\n },\n // Sniffed by `` / `` / ``\n isThead: function isThead() {\n return true;\n },\n // Sniffed by `` / `` / ``\n isDark: function isDark() {\n return this.bvTable.dark;\n },\n // Sniffed by `` / `` / ``\n isStacked: function isStacked() {\n return this.bvTable.isStacked;\n },\n // Sniffed by `` / `` / ``\n isResponsive: function isResponsive() {\n return this.bvTable.isResponsive;\n },\n // Sniffed by `` / `` / ``\n // Needed to handle header background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n // Sticky headers only apply to cells in table `thead`\n isStickyHeader: function isStickyHeader() {\n return !this.isStacked && this.bvTable.stickyHeader;\n },\n // Sniffed by `` / `` / ``\n // Needed to handle header background classes, due to lack of\n // background color inheritance with Bootstrap v4 table CSS\n hasStickyHeader: function hasStickyHeader() {\n return !this.isStacked && this.bvTable.stickyHeader;\n },\n // Sniffed by `` / `` / ``\n tableVariant: function tableVariant() {\n return this.bvTable.tableVariant;\n },\n theadClasses: function theadClasses() {\n return [this.headVariant ? \"thead-\".concat(this.headVariant) : null];\n },\n theadAttrs: function theadAttrs() {\n return _objectSpread({\n role: 'rowgroup'\n }, this.bvAttrs);\n }\n },\n render: function render(h) {\n return h('thead', {\n class: this.theadClasses,\n attrs: this.theadAttrs,\n // Pass down any native listeners\n on: this.bvListeners\n }, this.normalizeSlot());\n }\n});","function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../../vue';\nimport { EVENT_NAME_HEAD_CLICKED } from '../../../constants/events';\nimport { CODE_ENTER, CODE_SPACE } from '../../../constants/key-codes';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_STRING } from '../../../constants/props';\nimport { SLOT_NAME_THEAD_TOP } from '../../../constants/slots';\nimport { stopEvent } from '../../../utils/events';\nimport { htmlOrText } from '../../../utils/html';\nimport { identity } from '../../../utils/identity';\nimport { isUndefinedOrNull } from '../../../utils/inspect';\nimport { noop } from '../../../utils/noop';\nimport { makeProp } from '../../../utils/props';\nimport { safeVueInstance } from '../../../utils/safe-vue-instance';\nimport { startCase } from '../../../utils/string';\nimport { BThead } from '../thead';\nimport { BTfoot } from '../tfoot';\nimport { BTr } from '../tr';\nimport { BTh } from '../th';\nimport { filterEvent } from './filter-event';\nimport { textSelectionActive } from './text-selection-active'; // --- Helper methods ---\n\nvar getHeadSlotName = function getHeadSlotName(value) {\n return \"head(\".concat(value || '', \")\");\n};\n\nvar getFootSlotName = function getFootSlotName(value) {\n return \"foot(\".concat(value || '', \")\");\n}; // --- Props ---\n\n\nexport var props = {\n // Any Bootstrap theme variant (or custom)\n headRowVariant: makeProp(PROP_TYPE_STRING),\n // 'light', 'dark' or `null` (or custom)\n headVariant: makeProp(PROP_TYPE_STRING),\n theadClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n theadTrClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)\n}; // --- Mixin ---\n// @vue/component\n\nexport var theadMixin = extend({\n props: props,\n methods: {\n fieldClasses: function fieldClasses(field) {\n // Header field () classes\n return [field.class ? field.class : '', field.thClass ? field.thClass : ''];\n },\n headClicked: function headClicked(event, field, isFoot) {\n if (this.stopIfBusy && this.stopIfBusy(event)) {\n // If table is busy (via provider) then don't propagate\n return;\n } else if (filterEvent(event)) {\n // Clicked on a non-disabled control so ignore\n return;\n } else if (textSelectionActive(this.$el)) {\n // User is selecting text, so ignore\n\n /* istanbul ignore next: JSDOM doesn't support getSelection() */\n return;\n }\n\n stopEvent(event);\n this.$emit(EVENT_NAME_HEAD_CLICKED, field.key, field, event, isFoot);\n },\n renderThead: function renderThead() {\n var _this = this;\n\n var isFoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;\n\n var _safeVueInstance = safeVueInstance(this),\n fields = _safeVueInstance.computedFields,\n isSortable = _safeVueInstance.isSortable,\n isSelectable = _safeVueInstance.isSelectable,\n headVariant = _safeVueInstance.headVariant,\n footVariant = _safeVueInstance.footVariant,\n headRowVariant = _safeVueInstance.headRowVariant,\n footRowVariant = _safeVueInstance.footRowVariant;\n\n var h = this.$createElement; // In always stacked mode, we don't bother rendering the head/foot\n // Or if no field headings (empty table)\n\n if (this.isStackedAlways || fields.length === 0) {\n return h();\n }\n\n var hasHeadClickListener = isSortable || this.hasListener(EVENT_NAME_HEAD_CLICKED); // Reference to `selectAllRows` and `clearSelected()`, if table is selectable\n\n var selectAllRows = isSelectable ? this.selectAllRows : noop;\n var clearSelected = isSelectable ? this.clearSelected : noop; // Helper function to generate a field cell\n\n var makeCell = function makeCell(field, colIndex) {\n var label = field.label,\n labelHtml = field.labelHtml,\n variant = field.variant,\n stickyColumn = field.stickyColumn,\n key = field.key;\n var ariaLabel = null;\n\n if (!field.label.trim() && !field.headerTitle) {\n // In case field's label and title are empty/blank\n // We need to add a hint about what the column is about for non-sighted users\n\n /* istanbul ignore next */\n ariaLabel = startCase(field.key);\n }\n\n var on = {};\n\n if (hasHeadClickListener) {\n on.click = function (event) {\n _this.headClicked(event, field, isFoot);\n };\n\n on.keydown = function (event) {\n var keyCode = event.keyCode;\n\n if (keyCode === CODE_ENTER || keyCode === CODE_SPACE) {\n _this.headClicked(event, field, isFoot);\n }\n };\n }\n\n var sortAttrs = isSortable ? _this.sortTheadThAttrs(key, field, isFoot) : {};\n var sortClass = isSortable ? _this.sortTheadThClasses(key, field, isFoot) : null;\n var sortLabel = isSortable ? _this.sortTheadThLabel(key, field, isFoot) : null;\n var data = {\n class: [{\n // We need to make the header cell relative when we have\n // a `.sr-only` sort label to work around overflow issues\n 'position-relative': sortLabel\n }, _this.fieldClasses(field), sortClass],\n props: {\n variant: variant,\n stickyColumn: stickyColumn\n },\n style: field.thStyle || {},\n attrs: _objectSpread(_objectSpread({\n // We only add a `tabindex` of `0` if there is a head-clicked listener\n // and the current field is sortable\n tabindex: hasHeadClickListener && field.sortable ? '0' : null,\n abbr: field.headerAbbr || null,\n title: field.headerTitle || null,\n 'aria-colindex': colIndex + 1,\n 'aria-label': ariaLabel\n }, _this.getThValues(null, key, field.thAttr, isFoot ? 'foot' : 'head', {})), sortAttrs),\n on: on,\n key: key\n }; // Handle edge case where in-document templates are used with new\n // `v-slot:name` syntax where the browser lower-cases the v-slot's\n // name (attributes become lower cased when parsed by the browser)\n // We have replaced the square bracket syntax with round brackets\n // to prevent confusion with dynamic slot names\n\n var slotNames = [getHeadSlotName(key), getHeadSlotName(key.toLowerCase()), getHeadSlotName()]; // Footer will fallback to header slot names\n\n if (isFoot) {\n slotNames = [getFootSlotName(key), getFootSlotName(key.toLowerCase()), getFootSlotName()].concat(_toConsumableArray(slotNames));\n }\n\n var scope = {\n label: label,\n column: key,\n field: field,\n isFoot: isFoot,\n // Add in row select methods\n selectAllRows: selectAllRows,\n clearSelected: clearSelected\n };\n var $content = _this.normalizeSlot(slotNames, scope) || h('div', {\n domProps: htmlOrText(labelHtml, label)\n });\n var $srLabel = sortLabel ? h('span', {\n staticClass: 'sr-only'\n }, \" (\".concat(sortLabel, \")\")) : null; // Return the header cell\n\n return h(BTh, data, [$content, $srLabel].filter(identity));\n }; // Generate the array of cells\n\n\n var $cells = fields.map(makeCell).filter(identity); // Generate the row(s)\n\n var $trs = [];\n\n if (isFoot) {\n $trs.push(h(BTr, {\n class: this.tfootTrClass,\n props: {\n variant: isUndefinedOrNull(footRowVariant) ? headRowVariant :\n /* istanbul ignore next */\n footRowVariant\n }\n }, $cells));\n } else {\n var scope = {\n columns: fields.length,\n fields: fields,\n // Add in row select methods\n selectAllRows: selectAllRows,\n clearSelected: clearSelected\n };\n $trs.push(this.normalizeSlot(SLOT_NAME_THEAD_TOP, scope) || h());\n $trs.push(h(BTr, {\n class: this.theadTrClass,\n props: {\n variant: headRowVariant\n }\n }, $cells));\n }\n\n return h(isFoot ? BTfoot : BThead, {\n class: (isFoot ? this.tfootClass : this.theadClass) || null,\n props: isFoot ? {\n footVariant: footVariant || headVariant || null\n } : {\n headVariant: headVariant || null\n },\n key: isFoot ? 'bv-tfoot' : 'bv-thead'\n }, $trs);\n }\n }\n});","import { extend } from '../../../vue';\nimport { SLOT_NAME_TOP_ROW } from '../../../constants/slots';\nimport { isFunction } from '../../../utils/inspect';\nimport { BTr } from '../tr'; // --- Props ---\n\nexport var props = {}; // --- Mixin ---\n// @vue/component\n\nexport var topRowMixin = extend({\n methods: {\n renderTopRow: function renderTopRow() {\n var fields = this.computedFields,\n stacked = this.stacked,\n tbodyTrClass = this.tbodyTrClass,\n tbodyTrAttr = this.tbodyTrAttr;\n var h = this.$createElement; // Add static Top Row slot (hidden in visibly stacked mode as we can't control the data-label)\n // If in *always* stacked mode, we don't bother rendering the row\n\n if (!this.hasNormalizedSlot(SLOT_NAME_TOP_ROW) || stacked === true || stacked === '') {\n return h();\n }\n\n return h(BTr, {\n staticClass: 'b-table-top-row',\n class: [isFunction(tbodyTrClass) ? tbodyTrClass(null, 'row-top') : tbodyTrClass],\n attrs: isFunction(tbodyTrAttr) ? tbodyTrAttr(null, 'row-top') : tbodyTrAttr,\n key: 'b-top-row'\n }, [this.normalizeSlot(SLOT_NAME_TOP_ROW, {\n columns: fields.length,\n fields: fields\n })]);\n }\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TABLE } from '../../constants/components';\nimport { sortKeys } from '../../utils/object';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { hasListenerMixin } from '../../mixins/has-listener';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { bottomRowMixin, props as bottomRowProps } from './helpers/mixin-bottom-row';\nimport { busyMixin, props as busyProps } from './helpers/mixin-busy';\nimport { captionMixin, props as captionProps } from './helpers/mixin-caption';\nimport { colgroupMixin, props as colgroupProps } from './helpers/mixin-colgroup';\nimport { emptyMixin, props as emptyProps } from './helpers/mixin-empty';\nimport { filteringMixin, props as filteringProps } from './helpers/mixin-filtering';\nimport { itemsMixin, props as itemsProps } from './helpers/mixin-items';\nimport { paginationMixin, props as paginationProps } from './helpers/mixin-pagination';\nimport { providerMixin, props as providerProps } from './helpers/mixin-provider';\nimport { selectableMixin, props as selectableProps } from './helpers/mixin-selectable';\nimport { sortingMixin, props as sortingProps } from './helpers/mixin-sorting';\nimport { stackedMixin, props as stackedProps } from './helpers/mixin-stacked';\nimport { tableRendererMixin, props as tableRendererProps } from './helpers/mixin-table-renderer';\nimport { tbodyMixin, props as tbodyProps } from './helpers/mixin-tbody';\nimport { tfootMixin, props as tfootProps } from './helpers/mixin-tfoot';\nimport { theadMixin, props as theadProps } from './helpers/mixin-thead';\nimport { topRowMixin, props as topRowProps } from './helpers/mixin-top-row'; // --- Props ---\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, idProps), bottomRowProps), busyProps), captionProps), colgroupProps), emptyProps), filteringProps), itemsProps), paginationProps), providerProps), selectableProps), sortingProps), stackedProps), tableRendererProps), tbodyProps), tfootProps), theadProps), topRowProps)), NAME_TABLE); // --- Main component ---\n// @vue/component\n\nexport var BTable = /*#__PURE__*/extend({\n name: NAME_TABLE,\n // Order of mixins is important!\n // They are merged from first to last, followed by this component\n mixins: [// General mixins\n attrsMixin, hasListenerMixin, idMixin, normalizeSlotMixin, // Required table mixins\n itemsMixin, tableRendererMixin, stackedMixin, theadMixin, tfootMixin, tbodyMixin, // Table features mixins\n stackedMixin, filteringMixin, sortingMixin, paginationMixin, captionMixin, colgroupMixin, selectableMixin, emptyMixin, topRowMixin, bottomRowMixin, busyMixin, providerMixin],\n props: props // Render function is provided by `tableRendererMixin`\n\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TABLE_LITE } from '../../constants/components';\nimport { sortKeys } from '../../utils/object';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { hasListenerMixin } from '../../mixins/has-listener';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { captionMixin, props as captionProps } from './helpers/mixin-caption';\nimport { colgroupMixin, props as colgroupProps } from './helpers/mixin-colgroup';\nimport { itemsMixin, props as itemsProps } from './helpers/mixin-items';\nimport { stackedMixin, props as stackedProps } from './helpers/mixin-stacked';\nimport { tableRendererMixin, props as tableRendererProps } from './helpers/mixin-table-renderer';\nimport { tbodyMixin, props as tbodyProps } from './helpers/mixin-tbody';\nimport { tfootMixin, props as tfootProps } from './helpers/mixin-tfoot';\nimport { theadMixin, props as theadProps } from './helpers/mixin-thead'; // --- Props ---\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, idProps), captionProps), colgroupProps), itemsProps), stackedProps), tableRendererProps), tbodyProps), tfootProps), theadProps)), NAME_TABLE_LITE); // --- Main component ---\n// @vue/component\n\nexport var BTableLite = /*#__PURE__*/extend({\n name: NAME_TABLE_LITE,\n // Order of mixins is important!\n // They are merged from first to last, followed by this component\n mixins: [// General mixins\n attrsMixin, hasListenerMixin, idMixin, normalizeSlotMixin, // Required table mixins\n itemsMixin, tableRendererMixin, stackedMixin, theadMixin, tfootMixin, tbodyMixin, // Table features mixins\n // These are pretty lightweight, and are useful for lightweight tables\n captionMixin, colgroupMixin],\n props: props // Render function is provided by `tableRendererMixin`\n\n});","var _watch;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { COMPONENT_UID_KEY, REF_FOR_KEY, extend } from '../../vue';\nimport { NAME_TABS, NAME_TAB_BUTTON_HELPER } from '../../constants/components';\nimport { IS_BROWSER } from '../../constants/env';\nimport { EVENT_NAME_ACTIVATE_TAB, EVENT_NAME_CHANGED, EVENT_NAME_CLICK, EVENT_NAME_FIRST, EVENT_NAME_LAST, EVENT_NAME_NEXT, EVENT_NAME_PREV } from '../../constants/events';\nimport { CODE_DOWN, CODE_END, CODE_HOME, CODE_LEFT, CODE_RIGHT, CODE_SPACE, CODE_UP } from '../../constants/key-codes';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_EMPTY, SLOT_NAME_TABS_END, SLOT_NAME_TABS_START, SLOT_NAME_TITLE } from '../../constants/slots';\nimport { arrayIncludes } from '../../utils/array';\nimport { BvEvent } from '../../utils/bv-event.class';\nimport { attemptFocus, selectAll, requestAF } from '../../utils/dom';\nimport { stopEvent } from '../../utils/events';\nimport { identity } from '../../utils/identity';\nimport { isEvent } from '../../utils/inspect';\nimport { looseEqual } from '../../utils/loose-equal';\nimport { mathMax } from '../../utils/math';\nimport { makeModelMixin } from '../../utils/model';\nimport { toInteger } from '../../utils/number';\nimport { omit, sortKeys } from '../../utils/object';\nimport { observeDom } from '../../utils/observe-dom';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { stableSort } from '../../utils/stable-sort';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { BLink } from '../link/link';\nimport { BNav, props as BNavProps } from '../nav/nav'; // --- Constants ---\n\nvar _makeModelMixin = makeModelMixin('value', {\n type: PROP_TYPE_NUMBER\n}),\n modelMixin = _makeModelMixin.mixin,\n modelProps = _makeModelMixin.props,\n MODEL_PROP_NAME = _makeModelMixin.prop,\n MODEL_EVENT_NAME = _makeModelMixin.event; // --- Helper methods ---\n// Filter function to filter out disabled tabs\n\n\nvar notDisabled = function notDisabled(tab) {\n return !tab.disabled;\n}; // --- Helper components ---\n// @vue/component\n\n\nvar BVTabButton = /*#__PURE__*/extend({\n name: NAME_TAB_BUTTON_HELPER,\n inject: {\n getBvTabs: {\n default:\n /* istanbul ignore next */\n function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n props: {\n controls: makeProp(PROP_TYPE_STRING),\n id: makeProp(PROP_TYPE_STRING),\n noKeyNav: makeProp(PROP_TYPE_BOOLEAN, false),\n posInSet: makeProp(PROP_TYPE_NUMBER),\n setSize: makeProp(PROP_TYPE_NUMBER),\n // Reference to the child instance\n tab: makeProp(),\n tabIndex: makeProp(PROP_TYPE_NUMBER)\n },\n computed: {\n bvTabs: function bvTabs() {\n return this.getBvTabs();\n }\n },\n methods: {\n focus: function focus() {\n attemptFocus(this.$refs.link);\n },\n handleEvent: function handleEvent(event) {\n /* istanbul ignore next */\n if (this.tab.disabled) {\n return;\n }\n\n var type = event.type,\n keyCode = event.keyCode,\n shiftKey = event.shiftKey;\n\n if (type === 'click') {\n stopEvent(event);\n this.$emit(EVENT_NAME_CLICK, event);\n } else if (type === 'keydown' && keyCode === CODE_SPACE) {\n // For ARIA tabs the SPACE key will also trigger a click/select\n // Even with keyboard navigation disabled, SPACE should \"click\" the button\n // See: https://github.com/bootstrap-vue/bootstrap-vue/issues/4323\n stopEvent(event);\n this.$emit(EVENT_NAME_CLICK, event);\n } else if (type === 'keydown' && !this.noKeyNav) {\n // For keyboard navigation\n if ([CODE_UP, CODE_LEFT, CODE_HOME].indexOf(keyCode) !== -1) {\n stopEvent(event);\n\n if (shiftKey || keyCode === CODE_HOME) {\n this.$emit(EVENT_NAME_FIRST, event);\n } else {\n this.$emit(EVENT_NAME_PREV, event);\n }\n } else if ([CODE_DOWN, CODE_RIGHT, CODE_END].indexOf(keyCode) !== -1) {\n stopEvent(event);\n\n if (shiftKey || keyCode === CODE_END) {\n this.$emit(EVENT_NAME_LAST, event);\n } else {\n this.$emit(EVENT_NAME_NEXT, event);\n }\n }\n }\n }\n },\n render: function render(h) {\n var id = this.id,\n tabIndex = this.tabIndex,\n setSize = this.setSize,\n posInSet = this.posInSet,\n controls = this.controls,\n handleEvent = this.handleEvent;\n var _this$tab = this.tab,\n title = _this$tab.title,\n localActive = _this$tab.localActive,\n disabled = _this$tab.disabled,\n titleItemClass = _this$tab.titleItemClass,\n titleLinkClass = _this$tab.titleLinkClass,\n titleLinkAttributes = _this$tab.titleLinkAttributes;\n var $link = h(BLink, {\n staticClass: 'nav-link',\n class: [{\n active: localActive && !disabled,\n disabled: disabled\n }, titleLinkClass, // Apply `activeNavItemClass` styles when the tab is active\n localActive ? this.bvTabs.activeNavItemClass : null],\n props: {\n disabled: disabled\n },\n attrs: _objectSpread(_objectSpread({}, titleLinkAttributes), {}, {\n id: id,\n role: 'tab',\n // Roving tab index when keynav enabled\n tabindex: tabIndex,\n 'aria-selected': localActive && !disabled ? 'true' : 'false',\n 'aria-setsize': setSize,\n 'aria-posinset': posInSet,\n 'aria-controls': controls\n }),\n on: {\n click: handleEvent,\n keydown: handleEvent\n },\n ref: 'link'\n }, [this.tab.normalizeSlot(SLOT_NAME_TITLE) || title]);\n return h('li', {\n staticClass: 'nav-item',\n class: [titleItemClass],\n attrs: {\n role: 'presentation'\n }\n }, [$link]);\n }\n}); // --- Props ---\n\nvar navProps = omit(BNavProps, ['tabs', 'isNavBar', 'cardHeader']);\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, idProps), modelProps), navProps), {}, {\n // Only applied to the currently active ``\n activeNavItemClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n // Only applied to the currently active ``\n // This prop is sniffed by the `` child\n activeTabClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n card: makeProp(PROP_TYPE_BOOLEAN, false),\n contentClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n // Synonym for 'bottom'\n end: makeProp(PROP_TYPE_BOOLEAN, false),\n // This prop is sniffed by the `` child\n lazy: makeProp(PROP_TYPE_BOOLEAN, false),\n navClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n navWrapperClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n noFade: makeProp(PROP_TYPE_BOOLEAN, false),\n noKeyNav: makeProp(PROP_TYPE_BOOLEAN, false),\n noNavStyle: makeProp(PROP_TYPE_BOOLEAN, false),\n tag: makeProp(PROP_TYPE_STRING, 'div')\n})), NAME_TABS); // --- Main component ---\n// @vue/component\n\nexport var BTabs = /*#__PURE__*/extend({\n name: NAME_TABS,\n mixins: [idMixin, modelMixin, normalizeSlotMixin],\n provide: function provide() {\n var _this = this;\n\n return {\n getBvTabs: function getBvTabs() {\n return _this;\n }\n };\n },\n props: props,\n data: function data() {\n return {\n // Index of current tab\n currentTab: toInteger(this[MODEL_PROP_NAME], -1),\n // Array of direct child `` instances, in DOM order\n tabs: [],\n // Array of child instances registered (for triggering reactive updates)\n registeredTabs: []\n };\n },\n computed: {\n fade: function fade() {\n // This computed prop is sniffed by the tab child\n return !this.noFade;\n },\n localNavClass: function localNavClass() {\n var classes = [];\n\n if (this.card && this.vertical) {\n classes.push('card-header', 'h-100', 'border-bottom-0', 'rounded-0');\n }\n\n return [].concat(classes, [this.navClass]);\n }\n },\n watch: (_watch = {}, _defineProperty(_watch, MODEL_PROP_NAME, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n newValue = toInteger(newValue, -1);\n oldValue = toInteger(oldValue, 0);\n var $tab = this.tabs[newValue];\n\n if ($tab && !$tab.disabled) {\n this.activateTab($tab);\n } else {\n // Try next or prev tabs\n if (newValue < oldValue) {\n this.previousTab();\n } else {\n this.nextTab();\n }\n }\n }\n }), _defineProperty(_watch, \"currentTab\", function currentTab(newValue) {\n var index = -1; // Ensure only one tab is active at most\n\n this.tabs.forEach(function ($tab, i) {\n if (i === newValue && !$tab.disabled) {\n $tab.localActive = true;\n index = i;\n } else {\n $tab.localActive = false;\n }\n }); // Update the v-model\n\n this.$emit(MODEL_EVENT_NAME, index);\n }), _defineProperty(_watch, \"tabs\", function tabs(newValue, oldValue) {\n var _this2 = this;\n\n // We use `_uid` instead of `safeId()`, as the later is changed in a `$nextTick()`\n // if no explicit ID is provided, causing duplicate emits\n if (!looseEqual(newValue.map(function ($tab) {\n return $tab[COMPONENT_UID_KEY];\n }), oldValue.map(function ($tab) {\n return $tab[COMPONENT_UID_KEY];\n }))) {\n // In a `$nextTick()` to ensure `currentTab` has been set first\n this.$nextTick(function () {\n // We emit shallow copies of the new and old arrays of tabs,\n // to prevent users from potentially mutating the internal arrays\n _this2.$emit(EVENT_NAME_CHANGED, newValue.slice(), oldValue.slice());\n });\n }\n }), _defineProperty(_watch, \"registeredTabs\", function registeredTabs() {\n this.updateTabs();\n }), _watch),\n created: function created() {\n // Create private non-reactive props\n this.$_observer = null;\n },\n mounted: function mounted() {\n this.setObserver(true);\n },\n beforeDestroy: function beforeDestroy() {\n this.setObserver(false); // Ensure no references to child instances exist\n\n this.tabs = [];\n },\n methods: {\n registerTab: function registerTab($tab) {\n if (!arrayIncludes(this.registeredTabs, $tab)) {\n this.registeredTabs.push($tab);\n }\n },\n unregisterTab: function unregisterTab($tab) {\n this.registeredTabs = this.registeredTabs.slice().filter(function ($t) {\n return $t !== $tab;\n });\n },\n // DOM observer is needed to detect changes in order of tabs\n setObserver: function setObserver() {\n var _this3 = this;\n\n var on = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n this.$_observer && this.$_observer.disconnect();\n this.$_observer = null;\n\n if (on) {\n /* istanbul ignore next: difficult to test mutation observer in JSDOM */\n var handler = function handler() {\n _this3.$nextTick(function () {\n requestAF(function () {\n _this3.updateTabs();\n });\n });\n }; // Watch for changes to `` sub components\n\n\n this.$_observer = observeDom(this.$refs.content, handler, {\n childList: true,\n subtree: false,\n attributes: true,\n attributeFilter: ['id']\n });\n }\n },\n getTabs: function getTabs() {\n var $tabs = this.registeredTabs; // Dropped intentionally\n // .filter(\n // $tab => $tab.$children.filter($t => $t && $t._isTab).length === 0\n // )\n // DOM Order of Tabs\n\n var order = [];\n /* istanbul ignore next: too difficult to test */\n\n if (IS_BROWSER && $tabs.length > 0) {\n // We rely on the DOM when mounted to get the \"true\" order of the `` children\n // `querySelectorAll()` always returns elements in document order, regardless of\n // order specified in the selector\n var selector = $tabs.map(function ($tab) {\n return \"#\".concat($tab.safeId());\n }).join(', ');\n order = selectAll(selector, this.$el).map(function ($el) {\n return $el.id;\n }).filter(identity);\n } // Stable sort keeps the original order if not found in the `order` array,\n // which will be an empty array before mount\n\n\n return stableSort($tabs, function (a, b) {\n return order.indexOf(a.safeId()) - order.indexOf(b.safeId());\n });\n },\n updateTabs: function updateTabs() {\n var $tabs = this.getTabs(); // Find last active non-disabled tab in current tabs\n // We trust tab state over `currentTab`, in case tabs were added/removed/re-ordered\n\n var tabIndex = $tabs.indexOf($tabs.slice().reverse().find(function ($tab) {\n return $tab.localActive && !$tab.disabled;\n })); // Else try setting to `currentTab`\n\n if (tabIndex < 0) {\n var currentTab = this.currentTab;\n\n if (currentTab >= $tabs.length) {\n // Handle last tab being removed, so find the last non-disabled tab\n tabIndex = $tabs.indexOf($tabs.slice().reverse().find(notDisabled));\n } else if ($tabs[currentTab] && !$tabs[currentTab].disabled) {\n // Current tab is not disabled\n tabIndex = currentTab;\n }\n } // Else find first non-disabled tab in current tabs\n\n\n if (tabIndex < 0) {\n tabIndex = $tabs.indexOf($tabs.find(notDisabled));\n } // Ensure only one tab is active at a time\n\n\n $tabs.forEach(function ($tab, index) {\n $tab.localActive = index === tabIndex;\n });\n this.tabs = $tabs;\n this.currentTab = tabIndex;\n },\n // Find a button that controls a tab, given the tab reference\n // Returns the button vm instance\n getButtonForTab: function getButtonForTab($tab) {\n return (this.$refs.buttons || []).find(function ($btn) {\n return $btn.tab === $tab;\n });\n },\n // Force a button to re-render its content, given a `` instance\n // Called by `` on `update()`\n updateButton: function updateButton($tab) {\n var $button = this.getButtonForTab($tab);\n\n if ($button && $button.$forceUpdate) {\n $button.$forceUpdate();\n }\n },\n // Activate a tab given a `` instance\n // Also accessed by ``\n activateTab: function activateTab($tab) {\n var currentTab = this.currentTab,\n $tabs = this.tabs;\n var result = false;\n\n if ($tab) {\n var index = $tabs.indexOf($tab);\n\n if (index !== currentTab && index > -1 && !$tab.disabled) {\n var tabEvent = new BvEvent(EVENT_NAME_ACTIVATE_TAB, {\n cancelable: true,\n vueTarget: this,\n componentId: this.safeId()\n });\n this.$emit(tabEvent.type, index, currentTab, tabEvent);\n\n if (!tabEvent.defaultPrevented) {\n this.currentTab = index;\n result = true;\n }\n }\n } // Couldn't set tab, so ensure v-model is up to date\n\n /* istanbul ignore next: should rarely happen */\n\n\n if (!result && this[MODEL_PROP_NAME] !== currentTab) {\n this.$emit(MODEL_EVENT_NAME, currentTab);\n }\n\n return result;\n },\n // Deactivate a tab given a `` instance\n // Accessed by ``\n deactivateTab: function deactivateTab($tab) {\n if ($tab) {\n // Find first non-disabled tab that isn't the one being deactivated\n // If no tabs are available, then don't deactivate current tab\n return this.activateTab(this.tabs.filter(function ($t) {\n return $t !== $tab;\n }).find(notDisabled));\n }\n /* istanbul ignore next: should never/rarely happen */\n\n\n return false;\n },\n // Focus a tab button given its `` instance\n focusButton: function focusButton($tab) {\n var _this4 = this;\n\n // Wrap in `$nextTick()` to ensure DOM has completed rendering\n this.$nextTick(function () {\n attemptFocus(_this4.getButtonForTab($tab));\n });\n },\n // Emit a click event on a specified `` component instance\n emitTabClick: function emitTabClick(tab, event) {\n if (isEvent(event) && tab && tab.$emit && !tab.disabled) {\n tab.$emit(EVENT_NAME_CLICK, event);\n }\n },\n // Click handler\n clickTab: function clickTab($tab, event) {\n this.activateTab($tab);\n this.emitTabClick($tab, event);\n },\n // Move to first non-disabled tab\n firstTab: function firstTab(focus) {\n var $tab = this.tabs.find(notDisabled);\n\n if (this.activateTab($tab) && focus) {\n this.focusButton($tab);\n this.emitTabClick($tab, focus);\n }\n },\n // Move to previous non-disabled tab\n previousTab: function previousTab(focus) {\n var currentIndex = mathMax(this.currentTab, 0);\n var $tab = this.tabs.slice(0, currentIndex).reverse().find(notDisabled);\n\n if (this.activateTab($tab) && focus) {\n this.focusButton($tab);\n this.emitTabClick($tab, focus);\n }\n },\n // Move to next non-disabled tab\n nextTab: function nextTab(focus) {\n var currentIndex = mathMax(this.currentTab, -1);\n var $tab = this.tabs.slice(currentIndex + 1).find(notDisabled);\n\n if (this.activateTab($tab) && focus) {\n this.focusButton($tab);\n this.emitTabClick($tab, focus);\n }\n },\n // Move to last non-disabled tab\n lastTab: function lastTab(focus) {\n var $tab = this.tabs.slice().reverse().find(notDisabled);\n\n if (this.activateTab($tab) && focus) {\n this.focusButton($tab);\n this.emitTabClick($tab, focus);\n }\n }\n },\n render: function render(h) {\n var _this5 = this;\n\n var align = this.align,\n card = this.card,\n end = this.end,\n fill = this.fill,\n firstTab = this.firstTab,\n justified = this.justified,\n lastTab = this.lastTab,\n nextTab = this.nextTab,\n noKeyNav = this.noKeyNav,\n noNavStyle = this.noNavStyle,\n pills = this.pills,\n previousTab = this.previousTab,\n small = this.small,\n $tabs = this.tabs,\n vertical = this.vertical; // Currently active tab\n\n var $activeTab = $tabs.find(function ($tab) {\n return $tab.localActive && !$tab.disabled;\n }); // Tab button to allow focusing when no active tab found (keynav only)\n\n var $fallbackTab = $tabs.find(function ($tab) {\n return !$tab.disabled;\n }); // For each `` found create the tab buttons\n\n var $buttons = $tabs.map(function ($tab, index) {\n var _on;\n\n var safeId = $tab.safeId; // Ensure at least one tab button is focusable when keynav enabled (if possible)\n\n var tabIndex = null;\n\n if (!noKeyNav) {\n // Buttons are not in tab index unless active, or a fallback tab\n tabIndex = -1;\n\n if ($tab === $activeTab || !$activeTab && $tab === $fallbackTab) {\n // Place tab button in tab sequence\n tabIndex = null;\n }\n }\n\n return h(BVTabButton, _defineProperty({\n props: {\n controls: safeId ? safeId() : null,\n id: $tab.controlledBy || (safeId ? safeId(\"_BV_tab_button_\") : null),\n noKeyNav: noKeyNav,\n posInSet: index + 1,\n setSize: $tabs.length,\n tab: $tab,\n tabIndex: tabIndex\n },\n on: (_on = {}, _defineProperty(_on, EVENT_NAME_CLICK, function (event) {\n _this5.clickTab($tab, event);\n }), _defineProperty(_on, EVENT_NAME_FIRST, firstTab), _defineProperty(_on, EVENT_NAME_PREV, previousTab), _defineProperty(_on, EVENT_NAME_NEXT, nextTab), _defineProperty(_on, EVENT_NAME_LAST, lastTab), _on),\n key: $tab[COMPONENT_UID_KEY] || index,\n ref: 'buttons'\n }, REF_FOR_KEY, true));\n });\n var $nav = h(BNav, {\n class: this.localNavClass,\n attrs: {\n role: 'tablist',\n id: this.safeId('_BV_tab_controls_')\n },\n props: {\n fill: fill,\n justified: justified,\n align: align,\n tabs: !noNavStyle && !pills,\n pills: !noNavStyle && pills,\n vertical: vertical,\n small: small,\n cardHeader: card && !vertical\n },\n ref: 'nav'\n }, [this.normalizeSlot(SLOT_NAME_TABS_START) || h(), $buttons, this.normalizeSlot(SLOT_NAME_TABS_END) || h()]);\n $nav = h('div', {\n class: [{\n 'card-header': card && !vertical && !end,\n 'card-footer': card && !vertical && end,\n 'col-auto': vertical\n }, this.navWrapperClass],\n key: 'bv-tabs-nav'\n }, [$nav]);\n var $children = this.normalizeSlot() || [];\n var $empty = h();\n\n if ($children.length === 0) {\n $empty = h('div', {\n class: ['tab-pane', 'active', {\n 'card-body': card\n }],\n key: 'bv-empty-tab'\n }, this.normalizeSlot(SLOT_NAME_EMPTY));\n }\n\n var $content = h('div', {\n staticClass: 'tab-content',\n class: [{\n col: vertical\n }, this.contentClass],\n attrs: {\n id: this.safeId('_BV_tab_container_')\n },\n key: 'bv-content',\n ref: 'content'\n }, [$children, $empty]); // Render final output\n\n return h(this.tag, {\n staticClass: 'tabs',\n class: {\n row: vertical,\n 'no-gutters': vertical && card\n },\n attrs: {\n id: this.safeId()\n }\n }, [end ? $content : h(), $nav, end ? h() : $content]);\n }\n});","import { BTable } from './table';\nimport { BTableLite } from './table-lite';\nimport { BTableSimple } from './table-simple';\nimport { BTbody } from './tbody';\nimport { BThead } from './thead';\nimport { BTfoot } from './tfoot';\nimport { BTr } from './tr';\nimport { BTd } from './td';\nimport { BTh } from './th';\nimport { pluginFactory } from '../../utils/plugins';\nvar TableLitePlugin = /*#__PURE__*/pluginFactory({\n components: {\n BTableLite: BTableLite\n }\n});\nvar TableSimplePlugin = /*#__PURE__*/pluginFactory({\n components: {\n BTableSimple: BTableSimple,\n BTbody: BTbody,\n BThead: BThead,\n BTfoot: BTfoot,\n BTr: BTr,\n BTd: BTd,\n BTh: BTh\n }\n});\nvar TablePlugin = /*#__PURE__*/pluginFactory({\n components: {\n BTable: BTable\n },\n plugins: {\n TableLitePlugin: TableLitePlugin,\n TableSimplePlugin: TableSimplePlugin\n }\n});\nexport { // Plugins\nTablePlugin, TableLitePlugin, TableSimplePlugin, // Table components\nBTable, BTableLite, BTableSimple, // Helper components\nBTbody, BThead, BTfoot, BTr, BTd, BTh };","var _objectSpread2, _watch;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_TAB } from '../../constants/components';\nimport { MODEL_EVENT_NAME_PREFIX } from '../../constants/events';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_OBJECT, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_TITLE } from '../../constants/slots';\nimport { sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { BVTransition } from '../transition/bv-transition'; // --- Constants ---\n\nvar MODEL_PROP_NAME_ACTIVE = 'active';\nvar MODEL_EVENT_NAME_ACTIVE = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_ACTIVE; // --- Props ---\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, idProps), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, MODEL_PROP_NAME_ACTIVE, makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_objectSpread2, \"buttonId\", makeProp(PROP_TYPE_STRING)), _defineProperty(_objectSpread2, \"disabled\", makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_objectSpread2, \"lazy\", makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_objectSpread2, \"noBody\", makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_objectSpread2, \"tag\", makeProp(PROP_TYPE_STRING, 'div')), _defineProperty(_objectSpread2, \"title\", makeProp(PROP_TYPE_STRING)), _defineProperty(_objectSpread2, \"titleItemClass\", makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)), _defineProperty(_objectSpread2, \"titleLinkAttributes\", makeProp(PROP_TYPE_OBJECT)), _defineProperty(_objectSpread2, \"titleLinkClass\", makeProp(PROP_TYPE_ARRAY_OBJECT_STRING)), _objectSpread2))), NAME_TAB); // --- Main component ---\n// @vue/component\n\nexport var BTab = /*#__PURE__*/extend({\n name: NAME_TAB,\n mixins: [idMixin, normalizeSlotMixin],\n inject: {\n getBvTabs: {\n default: function _default() {\n return function () {\n return {};\n };\n }\n }\n },\n props: props,\n data: function data() {\n return {\n localActive: this[MODEL_PROP_NAME_ACTIVE] && !this.disabled\n };\n },\n computed: {\n bvTabs: function bvTabs() {\n return this.getBvTabs();\n },\n // For parent sniffing of child\n _isTab: function _isTab() {\n return true;\n },\n tabClasses: function tabClasses() {\n var active = this.localActive,\n disabled = this.disabled;\n return [{\n active: active,\n disabled: disabled,\n 'card-body': this.bvTabs.card && !this.noBody\n }, // Apply `activeTabClass` styles when this tab is active\n active ? this.bvTabs.activeTabClass : null];\n },\n controlledBy: function controlledBy() {\n return this.buttonId || this.safeId('__BV_tab_button__');\n },\n computedNoFade: function computedNoFade() {\n return !(this.bvTabs.fade || false);\n },\n computedLazy: function computedLazy() {\n return this.bvTabs.lazy || this.lazy;\n }\n },\n watch: (_watch = {}, _defineProperty(_watch, MODEL_PROP_NAME_ACTIVE, function (newValue, oldValue) {\n if (newValue !== oldValue) {\n if (newValue) {\n // If activated post mount\n this.activate();\n } else {\n /* istanbul ignore next */\n if (!this.deactivate()) {\n // Tab couldn't be deactivated, so we reset the synced active prop\n // Deactivation will fail if no other tabs to activate\n this.$emit(MODEL_EVENT_NAME_ACTIVE, this.localActive);\n }\n }\n }\n }), _defineProperty(_watch, \"disabled\", function disabled(newValue, oldValue) {\n if (newValue !== oldValue) {\n var firstTab = this.bvTabs.firstTab;\n\n if (newValue && this.localActive && firstTab) {\n this.localActive = false;\n firstTab();\n }\n }\n }), _defineProperty(_watch, \"localActive\", function localActive(newValue) {\n // Make `active` prop work with `.sync` modifier\n this.$emit(MODEL_EVENT_NAME_ACTIVE, newValue);\n }), _watch),\n mounted: function mounted() {\n // Inform `` of our presence\n this.registerTab();\n },\n updated: function updated() {\n // Force the tab button content to update (since slots are not reactive)\n // Only done if we have a title slot, as the title prop is reactive\n var updateButton = this.bvTabs.updateButton;\n\n if (updateButton && this.hasNormalizedSlot(SLOT_NAME_TITLE)) {\n updateButton(this);\n }\n },\n beforeDestroy: function beforeDestroy() {\n // Inform `` of our departure\n this.unregisterTab();\n },\n methods: {\n // Private methods\n registerTab: function registerTab() {\n // Inform `` of our presence\n var registerTab = this.bvTabs.registerTab;\n\n if (registerTab) {\n registerTab(this);\n }\n },\n unregisterTab: function unregisterTab() {\n // Inform `` of our departure\n var unregisterTab = this.bvTabs.unregisterTab;\n\n if (unregisterTab) {\n unregisterTab(this);\n }\n },\n // Public methods\n activate: function activate() {\n // Not inside a `` component or tab is disabled\n var activateTab = this.bvTabs.activateTab;\n return activateTab && !this.disabled ? activateTab(this) : false;\n },\n deactivate: function deactivate() {\n // Not inside a `` component or not active to begin with\n var deactivateTab = this.bvTabs.deactivateTab;\n return deactivateTab && this.localActive ? deactivateTab(this) : false;\n }\n },\n render: function render(h) {\n var localActive = this.localActive;\n var $content = h(this.tag, {\n staticClass: 'tab-pane',\n class: this.tabClasses,\n directives: [{\n name: 'show',\n value: localActive\n }],\n attrs: {\n role: 'tabpanel',\n id: this.safeId(),\n 'aria-hidden': localActive ? 'false' : 'true',\n 'aria-labelledby': this.controlledBy || null\n },\n ref: 'panel'\n }, // Render content lazily if requested\n [localActive || !this.computedLazy ? this.normalizeSlot() : h()]);\n return h(BVTransition, {\n props: {\n mode: 'out-in',\n noFade: this.computedNoFade\n }\n }, [$content]);\n }\n});","var _watch;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { Portal, Wormhole } from 'portal-vue';\nimport { COMPONENT_UID_KEY, extend } from '../../vue';\nimport { NAME_TOAST, NAME_TOASTER } from '../../constants/components';\nimport { EVENT_NAME_CHANGE, EVENT_NAME_DESTROYED, EVENT_NAME_HIDDEN, EVENT_NAME_HIDE, EVENT_NAME_SHOW, EVENT_NAME_SHOWN, EVENT_OPTIONS_NO_CAPTURE } from '../../constants/events';\nimport { PROP_TYPE_ARRAY_OBJECT_STRING, PROP_TYPE_BOOLEAN, PROP_TYPE_NUMBER_STRING, PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_DEFAULT, SLOT_NAME_TOAST_TITLE } from '../../constants/slots';\nimport { BvEvent } from '../../utils/bv-event.class';\nimport { requestAF } from '../../utils/dom';\nimport { getRootActionEventName, getRootEventName, eventOnOff } from '../../utils/events';\nimport { mathMax } from '../../utils/math';\nimport { makeModelMixin } from '../../utils/model';\nimport { toInteger } from '../../utils/number';\nimport { pick, sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable, pluckProps } from '../../utils/props';\nimport { isLink } from '../../utils/router';\nimport { createNewChildComponent } from '../../utils/create-new-child-component';\nimport { attrsMixin } from '../../mixins/attrs';\nimport { idMixin, props as idProps } from '../../mixins/id';\nimport { listenOnRootMixin } from '../../mixins/listen-on-root';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot';\nimport { scopedStyleMixin } from '../../mixins/scoped-style';\nimport { BButtonClose } from '../button/button-close';\nimport { BLink, props as BLinkProps } from '../link/link';\nimport { BVTransition } from '../transition/bv-transition';\nimport { BToaster } from './toaster'; // --- Constants ---\n\nvar _makeModelMixin = makeModelMixin('visible', {\n type: PROP_TYPE_BOOLEAN,\n defaultValue: false,\n event: EVENT_NAME_CHANGE\n}),\n modelMixin = _makeModelMixin.mixin,\n modelProps = _makeModelMixin.props,\n MODEL_PROP_NAME = _makeModelMixin.prop,\n MODEL_EVENT_NAME = _makeModelMixin.event;\n\nvar MIN_DURATION = 1000; // --- Props ---\n\nvar linkProps = pick(BLinkProps, ['href', 'to']);\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, idProps), modelProps), linkProps), {}, {\n appendToast: makeProp(PROP_TYPE_BOOLEAN, false),\n autoHideDelay: makeProp(PROP_TYPE_NUMBER_STRING, 5000),\n bodyClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n headerClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n headerTag: makeProp(PROP_TYPE_STRING, 'header'),\n // Switches role to 'status' and aria-live to 'polite'\n isStatus: makeProp(PROP_TYPE_BOOLEAN, false),\n noAutoHide: makeProp(PROP_TYPE_BOOLEAN, false),\n noCloseButton: makeProp(PROP_TYPE_BOOLEAN, false),\n noFade: makeProp(PROP_TYPE_BOOLEAN, false),\n noHoverPause: makeProp(PROP_TYPE_BOOLEAN, false),\n solid: makeProp(PROP_TYPE_BOOLEAN, false),\n // Render the toast in place, rather than in a portal-target\n static: makeProp(PROP_TYPE_BOOLEAN, false),\n title: makeProp(PROP_TYPE_STRING),\n toastClass: makeProp(PROP_TYPE_ARRAY_OBJECT_STRING),\n toaster: makeProp(PROP_TYPE_STRING, 'b-toaster-top-right'),\n variant: makeProp(PROP_TYPE_STRING)\n})), NAME_TOAST); // --- Main component ---\n// @vue/component\n\nexport var BToast = /*#__PURE__*/extend({\n name: NAME_TOAST,\n mixins: [attrsMixin, idMixin, modelMixin, listenOnRootMixin, normalizeSlotMixin, scopedStyleMixin],\n inheritAttrs: false,\n props: props,\n data: function data() {\n return {\n isMounted: false,\n doRender: false,\n localShow: false,\n isTransitioning: false,\n isHiding: false,\n order: 0,\n dismissStarted: 0,\n resumeDismiss: 0\n };\n },\n computed: {\n toastClasses: function toastClasses() {\n var appendToast = this.appendToast,\n variant = this.variant;\n return _defineProperty({\n 'b-toast-solid': this.solid,\n 'b-toast-append': appendToast,\n 'b-toast-prepend': !appendToast\n }, \"b-toast-\".concat(variant), variant);\n },\n slotScope: function slotScope() {\n var hide = this.hide;\n return {\n hide: hide\n };\n },\n computedDuration: function computedDuration() {\n // Minimum supported duration is 1 second\n return mathMax(toInteger(this.autoHideDelay, 0), MIN_DURATION);\n },\n computedToaster: function computedToaster() {\n return String(this.toaster);\n },\n transitionHandlers: function transitionHandlers() {\n return {\n beforeEnter: this.onBeforeEnter,\n afterEnter: this.onAfterEnter,\n beforeLeave: this.onBeforeLeave,\n afterLeave: this.onAfterLeave\n };\n },\n computedAttrs: function computedAttrs() {\n return _objectSpread(_objectSpread({}, this.bvAttrs), {}, {\n id: this.safeId(),\n tabindex: '0'\n });\n }\n },\n watch: (_watch = {}, _defineProperty(_watch, MODEL_PROP_NAME, function (newValue) {\n this[newValue ? 'show' : 'hide']();\n }), _defineProperty(_watch, \"localShow\", function localShow(newValue) {\n if (newValue !== this[MODEL_PROP_NAME]) {\n this.$emit(MODEL_EVENT_NAME, newValue);\n }\n }), _defineProperty(_watch, \"toaster\", function toaster() {\n // If toaster target changed, make sure toaster exists\n this.$nextTick(this.ensureToaster);\n }), _defineProperty(_watch, \"static\", function _static(newValue) {\n // If static changes to true, and the toast is showing,\n // ensure the toaster target exists\n if (newValue && this.localShow) {\n this.ensureToaster();\n }\n }), _watch),\n created: function created() {\n // Create private non-reactive props\n this.$_dismissTimer = null;\n },\n mounted: function mounted() {\n var _this = this;\n\n this.isMounted = true;\n this.$nextTick(function () {\n if (_this[MODEL_PROP_NAME]) {\n requestAF(function () {\n _this.show();\n });\n }\n }); // Listen for global $root show events\n\n this.listenOnRoot(getRootActionEventName(NAME_TOAST, EVENT_NAME_SHOW), function (id) {\n if (id === _this.safeId()) {\n _this.show();\n }\n }); // Listen for global $root hide events\n\n this.listenOnRoot(getRootActionEventName(NAME_TOAST, EVENT_NAME_HIDE), function (id) {\n if (!id || id === _this.safeId()) {\n _this.hide();\n }\n }); // Make sure we hide when toaster is destroyed\n\n /* istanbul ignore next: difficult to test */\n\n this.listenOnRoot(getRootEventName(NAME_TOASTER, EVENT_NAME_DESTROYED), function (toaster) {\n /* istanbul ignore next */\n if (toaster === _this.computedToaster) {\n _this.hide();\n }\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.clearDismissTimer();\n },\n methods: {\n show: function show() {\n var _this2 = this;\n\n if (!this.localShow) {\n this.ensureToaster();\n var showEvent = this.buildEvent(EVENT_NAME_SHOW);\n this.emitEvent(showEvent);\n this.dismissStarted = this.resumeDismiss = 0;\n this.order = Date.now() * (this.appendToast ? 1 : -1);\n this.isHiding = false;\n this.doRender = true;\n this.$nextTick(function () {\n // We show the toast after we have rendered the portal and b-toast wrapper\n // so that screen readers will properly announce the toast\n requestAF(function () {\n _this2.localShow = true;\n });\n });\n }\n },\n hide: function hide() {\n var _this3 = this;\n\n if (this.localShow) {\n var hideEvent = this.buildEvent(EVENT_NAME_HIDE);\n this.emitEvent(hideEvent);\n this.setHoverHandler(false);\n this.dismissStarted = this.resumeDismiss = 0;\n this.clearDismissTimer();\n this.isHiding = true;\n requestAF(function () {\n _this3.localShow = false;\n });\n }\n },\n buildEvent: function buildEvent(type) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return new BvEvent(type, _objectSpread(_objectSpread({\n cancelable: false,\n target: this.$el || null,\n relatedTarget: null\n }, options), {}, {\n vueTarget: this,\n componentId: this.safeId()\n }));\n },\n emitEvent: function emitEvent(bvEvent) {\n var type = bvEvent.type;\n this.emitOnRoot(getRootEventName(NAME_TOAST, type), bvEvent);\n this.$emit(type, bvEvent);\n },\n ensureToaster: function ensureToaster() {\n if (this.static) {\n return;\n }\n\n var computedToaster = this.computedToaster;\n\n if (!Wormhole.hasTarget(computedToaster)) {\n var div = document.createElement('div');\n document.body.appendChild(div);\n var toaster = createNewChildComponent(this.bvEventRoot, BToaster, {\n propsData: {\n name: computedToaster\n }\n });\n toaster.$mount(div);\n }\n },\n startDismissTimer: function startDismissTimer() {\n this.clearDismissTimer();\n\n if (!this.noAutoHide) {\n this.$_dismissTimer = setTimeout(this.hide, this.resumeDismiss || this.computedDuration);\n this.dismissStarted = Date.now();\n this.resumeDismiss = 0;\n }\n },\n clearDismissTimer: function clearDismissTimer() {\n clearTimeout(this.$_dismissTimer);\n this.$_dismissTimer = null;\n },\n setHoverHandler: function setHoverHandler(on) {\n var el = this.$refs['b-toast'];\n eventOnOff(on, el, 'mouseenter', this.onPause, EVENT_OPTIONS_NO_CAPTURE);\n eventOnOff(on, el, 'mouseleave', this.onUnPause, EVENT_OPTIONS_NO_CAPTURE);\n },\n onPause: function onPause() {\n // Determine time remaining, and then pause timer\n if (this.noAutoHide || this.noHoverPause || !this.$_dismissTimer || this.resumeDismiss) {\n return;\n }\n\n var passed = Date.now() - this.dismissStarted;\n\n if (passed > 0) {\n this.clearDismissTimer();\n this.resumeDismiss = mathMax(this.computedDuration - passed, MIN_DURATION);\n }\n },\n onUnPause: function onUnPause() {\n // Restart timer with max of time remaining or 1 second\n if (this.noAutoHide || this.noHoverPause || !this.resumeDismiss) {\n this.resumeDismiss = this.dismissStarted = 0;\n return;\n }\n\n this.startDismissTimer();\n },\n onLinkClick: function onLinkClick() {\n var _this4 = this;\n\n // We delay the close to allow time for the\n // browser to process the link click\n this.$nextTick(function () {\n requestAF(function () {\n _this4.hide();\n });\n });\n },\n onBeforeEnter: function onBeforeEnter() {\n this.isTransitioning = true;\n },\n onAfterEnter: function onAfterEnter() {\n this.isTransitioning = false;\n var hiddenEvent = this.buildEvent(EVENT_NAME_SHOWN);\n this.emitEvent(hiddenEvent);\n this.startDismissTimer();\n this.setHoverHandler(true);\n },\n onBeforeLeave: function onBeforeLeave() {\n this.isTransitioning = true;\n },\n onAfterLeave: function onAfterLeave() {\n this.isTransitioning = false;\n this.order = 0;\n this.resumeDismiss = this.dismissStarted = 0;\n var hiddenEvent = this.buildEvent(EVENT_NAME_HIDDEN);\n this.emitEvent(hiddenEvent);\n this.doRender = false;\n },\n // Render helper for generating the toast\n makeToast: function makeToast(h) {\n var _this5 = this;\n\n var title = this.title,\n slotScope = this.slotScope;\n var link = isLink(this);\n var $headerContent = [];\n var $title = this.normalizeSlot(SLOT_NAME_TOAST_TITLE, slotScope);\n\n if ($title) {\n $headerContent.push($title);\n } else if (title) {\n $headerContent.push(h('strong', {\n staticClass: 'mr-2'\n }, title));\n }\n\n if (!this.noCloseButton) {\n $headerContent.push(h(BButtonClose, {\n staticClass: 'ml-auto mb-1',\n on: {\n click: function click() {\n _this5.hide();\n }\n }\n }));\n }\n\n var $header = h();\n\n if ($headerContent.length > 0) {\n $header = h(this.headerTag, {\n staticClass: 'toast-header',\n class: this.headerClass\n }, $headerContent);\n }\n\n var $body = h(link ? BLink : 'div', {\n staticClass: 'toast-body',\n class: this.bodyClass,\n props: link ? pluckProps(linkProps, this) : {},\n on: link ? {\n click: this.onLinkClick\n } : {}\n }, this.normalizeSlot(SLOT_NAME_DEFAULT, slotScope));\n return h('div', {\n staticClass: 'toast',\n class: this.toastClass,\n attrs: this.computedAttrs,\n key: \"toast-\".concat(this[COMPONENT_UID_KEY]),\n ref: 'toast'\n }, [$header, $body]);\n }\n },\n render: function render(h) {\n if (!this.doRender || !this.isMounted) {\n return h();\n }\n\n var order = this.order,\n isStatic = this.static,\n isHiding = this.isHiding,\n isStatus = this.isStatus;\n var name = \"b-toast-\".concat(this[COMPONENT_UID_KEY]);\n var $toast = h('div', {\n staticClass: 'b-toast',\n class: this.toastClasses,\n attrs: _objectSpread(_objectSpread({}, isStatic ? {} : this.scopedStyleAttrs), {}, {\n id: this.safeId('_toast_outer'),\n role: isHiding ? null : isStatus ? 'status' : 'alert',\n 'aria-live': isHiding ? null : isStatus ? 'polite' : 'assertive',\n 'aria-atomic': isHiding ? null : 'true'\n }),\n key: name,\n ref: 'b-toast'\n }, [h(BVTransition, {\n props: {\n noFade: this.noFade\n },\n on: this.transitionHandlers\n }, [this.localShow ? this.makeToast(h) : h()])]);\n return h(Portal, {\n props: {\n name: name,\n to: this.computedToaster,\n order: order,\n slim: true,\n disabled: isStatic\n }\n }, [$toast]);\n }\n});","import { BTabs } from './tabs';\nimport { BTab } from './tab';\nimport { pluginFactory } from '../../utils/plugins';\nvar TabsPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BTabs: BTabs,\n BTab: BTab\n }\n});\nexport { TabsPlugin, BTabs, BTab };","import { BTime } from './time';\nimport { pluginFactory } from '../../utils/plugins';\nvar TimePlugin = /*#__PURE__*/pluginFactory({\n components: {\n BTime: BTime\n }\n});\nexport { TimePlugin, BTime };","import { PortalTarget, Wormhole } from 'portal-vue';\nimport { extend } from '../../vue';\nimport { NAME_TOASTER } from '../../constants/components';\nimport { EVENT_NAME_DESTROYED } from '../../constants/events';\nimport { PROP_TYPE_STRING } from '../../constants/props';\nimport { removeClass, requestAF } from '../../utils/dom';\nimport { getRootEventName } from '../../utils/events';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { warn } from '../../utils/warn';\nimport { listenOnRootMixin } from '../../mixins/listen-on-root';\nimport { normalizeSlotMixin } from '../../mixins/normalize-slot'; // --- Helper components ---\n// @vue/component\n\nexport var DefaultTransition = /*#__PURE__*/extend({\n mixins: [normalizeSlotMixin],\n data: function data() {\n return {\n // Transition classes base name\n name: 'b-toaster'\n };\n },\n methods: {\n onAfterEnter: function onAfterEnter(el) {\n var _this = this;\n\n // Work around a Vue.js bug where `*-enter-to` class is not removed\n // See: https://github.com/vuejs/vue/pull/7901\n // The `*-move` class is also stuck on elements that moved,\n // but there are no JavaScript hooks to handle after move\n // See: https://github.com/vuejs/vue/pull/7906\n requestAF(function () {\n removeClass(el, \"\".concat(_this.name, \"-enter-to\"));\n });\n }\n },\n render: function render(h) {\n return h('transition-group', {\n props: {\n tag: 'div',\n name: this.name\n },\n on: {\n afterEnter: this.onAfterEnter\n }\n }, this.normalizeSlot());\n }\n}); // --- Props ---\n\nexport var props = makePropsConfigurable({\n // Allowed: 'true' or 'false' or `null`\n ariaAtomic: makeProp(PROP_TYPE_STRING),\n ariaLive: makeProp(PROP_TYPE_STRING),\n name: makeProp(PROP_TYPE_STRING, undefined, true),\n // Required\n // Aria role\n role: makeProp(PROP_TYPE_STRING)\n}, NAME_TOASTER); // --- Main component ---\n// @vue/component\n\nexport var BToaster = /*#__PURE__*/extend({\n name: NAME_TOASTER,\n mixins: [listenOnRootMixin],\n props: props,\n data: function data() {\n return {\n // We don't render on SSR or if a an existing target found\n doRender: false,\n dead: false,\n // Toaster names cannot change once created\n staticName: this.name\n };\n },\n beforeMount: function beforeMount() {\n var name = this.name;\n this.staticName = name;\n /* istanbul ignore if */\n\n if (Wormhole.hasTarget(name)) {\n warn(\"A \\\"\\\" with name \\\"\".concat(name, \"\\\" already exists in the document.\"), NAME_TOASTER);\n this.dead = true;\n } else {\n this.doRender = true;\n }\n },\n beforeDestroy: function beforeDestroy() {\n // Let toasts made with `this.$bvToast.toast()` know that this toaster\n // is being destroyed and should should also destroy/hide themselves\n if (this.doRender) {\n this.emitOnRoot(getRootEventName(NAME_TOASTER, EVENT_NAME_DESTROYED), this.name);\n }\n },\n destroyed: function destroyed() {\n // Remove from DOM if needed\n var $el = this.$el;\n /* istanbul ignore next: difficult to test */\n\n if ($el && $el.parentNode) {\n $el.parentNode.removeChild($el);\n }\n },\n render: function render(h) {\n var $toaster = h('div', {\n class: ['d-none', {\n 'b-dead-toaster': this.dead\n }]\n });\n\n if (this.doRender) {\n var $target = h(PortalTarget, {\n staticClass: 'b-toaster-slot',\n props: {\n name: this.staticName,\n multiple: true,\n tag: 'div',\n slim: false,\n // transition: this.transition || DefaultTransition\n transition: DefaultTransition\n }\n });\n $toaster = h('div', {\n staticClass: 'b-toaster',\n class: [this.staticName],\n attrs: {\n id: this.staticName,\n // Fallback to null to make sure attribute doesn't exist\n role: this.role || null,\n 'aria-live': this.ariaLive,\n 'aria-atomic': this.ariaAtomic\n }\n }, [$target]);\n }\n\n return $toaster;\n }\n});","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n/**\n * Plugin for adding `$bvToast` property to all Vue instances\n */\nimport { NAME_TOAST, NAME_TOASTER, NAME_TOAST_POP } from '../../../constants/components';\nimport { EVENT_NAME_DESTROYED, EVENT_NAME_HIDDEN, EVENT_NAME_HIDE, EVENT_NAME_SHOW, HOOK_EVENT_NAME_DESTROYED } from '../../../constants/events';\nimport { useParentMixin } from '../../../mixins/use-parent';\nimport { concat } from '../../../utils/array';\nimport { getComponentConfig } from '../../../utils/config';\nimport { requestAF } from '../../../utils/dom';\nimport { getRootEventName, getRootActionEventName } from '../../../utils/events';\nimport { isUndefined, isString } from '../../../utils/inspect';\nimport { assign, defineProperties, defineProperty, hasOwnProperty, keys, omit, readonlyDescriptor } from '../../../utils/object';\nimport { pluginFactory } from '../../../utils/plugins';\nimport { warn, warnNotClient } from '../../../utils/warn';\nimport { createNewChildComponent } from '../../../utils/create-new-child-component';\nimport { getEventRoot } from '../../../utils/get-event-root';\nimport { BToast, props as toastProps } from '../toast'; // --- Constants ---\n\nvar PROP_NAME = '$bvToast';\nvar PROP_NAME_PRIV = '_bv__toast'; // Base toast props that are allowed\n// Some may be ignored or overridden on some message boxes\n// Prop ID is allowed, but really only should be used for testing\n// We need to add it in explicitly as it comes from the `idMixin`\n\nvar BASE_PROPS = ['id'].concat(_toConsumableArray(keys(omit(toastProps, ['static', 'visible'])))); // Map prop names to toast slot names\n\nvar propsToSlots = {\n toastContent: 'default',\n title: 'toast-title'\n}; // --- Helper methods ---\n// Method to filter only recognized props that are not undefined\n\nvar filterOptions = function filterOptions(options) {\n return BASE_PROPS.reduce(function (memo, key) {\n if (!isUndefined(options[key])) {\n memo[key] = options[key];\n }\n\n return memo;\n }, {});\n}; // Method to install `$bvToast` VM injection\n\n\nvar plugin = function plugin(Vue) {\n // Create a private sub-component constructor that\n // extends BToast and self-destructs after hidden\n // @vue/component\n var BVToastPop = Vue.extend({\n name: NAME_TOAST_POP,\n extends: BToast,\n mixins: [useParentMixin],\n destroyed: function destroyed() {\n // Make sure we not in document any more\n var $el = this.$el;\n\n if ($el && $el.parentNode) {\n $el.parentNode.removeChild($el);\n }\n },\n mounted: function mounted() {\n var _this = this;\n\n // Self destruct handler\n var handleDestroy = function handleDestroy() {\n // Ensure the toast has been force hidden\n _this.localShow = false;\n _this.doRender = false;\n\n _this.$nextTick(function () {\n _this.$nextTick(function () {\n // In a `requestAF()` to release control back to application\n // and to allow the portal-target time to remove the content\n requestAF(function () {\n _this.$destroy();\n });\n });\n });\n }; // Self destruct if parent destroyed\n\n\n this.bvParent.$once(HOOK_EVENT_NAME_DESTROYED, handleDestroy); // Self destruct after hidden\n\n this.$once(EVENT_NAME_HIDDEN, handleDestroy); // Self destruct when toaster is destroyed\n\n this.listenOnRoot(getRootEventName(NAME_TOASTER, EVENT_NAME_DESTROYED), function (toaster) {\n /* istanbul ignore next: hard to test */\n if (toaster === _this.toaster) {\n handleDestroy();\n }\n });\n }\n }); // Private method to generate the on-demand toast\n\n var makeToast = function makeToast(props, parent) {\n if (warnNotClient(PROP_NAME)) {\n /* istanbul ignore next */\n return;\n } // Create an instance of `BVToastPop` component\n\n\n var toast = createNewChildComponent(parent, BVToastPop, {\n // We set parent as the local VM so these toasts can emit events on the\n // app `$root`, and it ensures `BToast` is destroyed when parent is destroyed\n propsData: _objectSpread(_objectSpread(_objectSpread({}, filterOptions(getComponentConfig(NAME_TOAST))), omit(props, keys(propsToSlots))), {}, {\n // Props that can't be overridden\n static: false,\n visible: true\n })\n }); // Convert certain props to slots\n\n keys(propsToSlots).forEach(function (prop) {\n var value = props[prop];\n\n if (!isUndefined(value)) {\n // Can be a string, or array of VNodes\n if (prop === 'title' && isString(value)) {\n // Special case for title if it is a string, we wrap in a \n value = [parent.$createElement('strong', {\n class: 'mr-2'\n }, value)];\n }\n\n toast.$slots[propsToSlots[prop]] = concat(value);\n }\n }); // Create a mount point (a DIV) and mount it (which triggers the show)\n\n var div = document.createElement('div');\n document.body.appendChild(div);\n toast.$mount(div);\n }; // Declare BvToast instance property class\n\n\n var BvToast = /*#__PURE__*/function () {\n function BvToast(vm) {\n _classCallCheck(this, BvToast);\n\n // Assign the new properties to this instance\n assign(this, {\n _vm: vm,\n _root: getEventRoot(vm)\n }); // Set these properties as read-only and non-enumerable\n\n defineProperties(this, {\n _vm: readonlyDescriptor(),\n _root: readonlyDescriptor()\n });\n } // --- Public Instance methods ---\n // Opens a user defined toast and returns immediately\n\n\n _createClass(BvToast, [{\n key: \"toast\",\n value: function toast(content) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!content || warnNotClient(PROP_NAME)) {\n /* istanbul ignore next */\n return;\n }\n\n makeToast(_objectSpread(_objectSpread({}, filterOptions(options)), {}, {\n toastContent: content\n }), this._vm);\n } // shows a `` component with the specified ID\n\n }, {\n key: \"show\",\n value: function show(id) {\n if (id) {\n this._root.$emit(getRootActionEventName(NAME_TOAST, EVENT_NAME_SHOW), id);\n }\n } // Hide a toast with specified ID, or if not ID all toasts\n\n }, {\n key: \"hide\",\n value: function hide() {\n var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\n this._root.$emit(getRootActionEventName(NAME_TOAST, EVENT_NAME_HIDE), id);\n }\n }]);\n\n return BvToast;\n }(); // Add our instance mixin\n\n\n Vue.mixin({\n beforeCreate: function beforeCreate() {\n // Because we need access to `$root` for `$emits`, and VM for parenting,\n // we have to create a fresh instance of `BvToast` for each VM\n this[PROP_NAME_PRIV] = new BvToast(this);\n }\n }); // Define our read-only `$bvToast` instance property\n // Placed in an if just in case in HMR mode\n\n if (!hasOwnProperty(Vue.prototype, PROP_NAME)) {\n defineProperty(Vue.prototype, PROP_NAME, {\n get: function get() {\n /* istanbul ignore next */\n if (!this || !this[PROP_NAME_PRIV]) {\n warn(\"\\\"\".concat(PROP_NAME, \"\\\" must be accessed from a Vue instance \\\"this\\\" context.\"), NAME_TOAST);\n }\n\n return this[PROP_NAME_PRIV];\n }\n });\n }\n};\n\nexport var BVToastPlugin = /*#__PURE__*/pluginFactory({\n plugins: {\n plugin: plugin\n }\n});","import { BVToastPlugin } from './helpers/bv-toast';\nimport { BToast } from './toast';\nimport { BToaster } from './toaster';\nimport { pluginFactory } from '../../utils/plugins';\nvar ToastPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BToast: BToast,\n BToaster: BToaster\n },\n // $bvToast injection\n plugins: {\n BVToastPlugin: BVToastPlugin\n }\n});\nexport { ToastPlugin, BToast, BToaster };","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { NAME_TOOLTIP } from '../../constants/components';\nimport { IS_BROWSER } from '../../constants/env';\nimport { EVENT_NAME_SHOW } from '../../constants/events';\nimport { concat } from '../../utils/array';\nimport { isVue3, nextTick } from '../../vue';\nimport { getComponentConfig } from '../../utils/config';\nimport { getScopeId } from '../../utils/get-scope-id';\nimport { identity } from '../../utils/identity';\nimport { getInstanceFromDirective } from '../../utils/get-instance-from-directive';\nimport { isFunction, isNumber, isPlainObject, isString, isUndefined, isUndefinedOrNull } from '../../utils/inspect';\nimport { looseEqual } from '../../utils/loose-equal';\nimport { toInteger } from '../../utils/number';\nimport { keys } from '../../utils/object';\nimport { createNewChildComponent } from '../../utils/create-new-child-component';\nimport { BVTooltip } from '../../components/tooltip/helpers/bv-tooltip'; // Key which we use to store tooltip object on element\n\nvar BV_TOOLTIP = '__BV_Tooltip__'; // Default trigger\n\nvar DefaultTrigger = 'hover focus'; // Valid event triggers\n\nvar validTriggers = {\n focus: true,\n hover: true,\n click: true,\n blur: true,\n manual: true\n}; // Directive modifier test regular expressions. Pre-compile for performance\n\nvar htmlRE = /^html$/i;\nvar noninteractiveRE = /^noninteractive$/i;\nvar noFadeRE = /^nofade$/i;\nvar placementRE = /^(auto|top(left|right)?|bottom(left|right)?|left(top|bottom)?|right(top|bottom)?)$/i;\nvar boundaryRE = /^(window|viewport|scrollParent)$/i;\nvar delayRE = /^d\\d+$/i;\nvar delayShowRE = /^ds\\d+$/i;\nvar delayHideRE = /^dh\\d+$/i;\nvar offsetRE = /^o-?\\d+$/i;\nvar variantRE = /^v-.+$/i;\nvar spacesRE = /\\s+/; // Build a Tooltip config based on bindings (if any)\n// Arguments and modifiers take precedence over passed value config object\n\nvar parseBindings = function parseBindings(bindings, vnode)\n/* istanbul ignore next: not easy to test */\n{\n // We start out with a basic config\n var config = {\n title: undefined,\n trigger: '',\n // Default set below if needed\n placement: 'top',\n fallbackPlacement: 'flip',\n container: false,\n // Default of body\n animation: true,\n offset: 0,\n id: null,\n html: false,\n interactive: true,\n disabled: false,\n delay: getComponentConfig(NAME_TOOLTIP, 'delay', 50),\n boundary: String(getComponentConfig(NAME_TOOLTIP, 'boundary', 'scrollParent')),\n boundaryPadding: toInteger(getComponentConfig(NAME_TOOLTIP, 'boundaryPadding', 5), 0),\n variant: getComponentConfig(NAME_TOOLTIP, 'variant'),\n customClass: getComponentConfig(NAME_TOOLTIP, 'customClass')\n }; // Process `bindings.value`\n\n if (isString(bindings.value) || isNumber(bindings.value)) {\n // Value is tooltip content (HTML optionally supported)\n config.title = bindings.value;\n } else if (isFunction(bindings.value)) {\n // Title generator function\n config.title = bindings.value;\n } else if (isPlainObject(bindings.value)) {\n // Value is config object, so merge\n config = _objectSpread(_objectSpread({}, config), bindings.value);\n } // If title is not provided, try title attribute\n\n\n if (isUndefined(config.title)) {\n // Try attribute\n var attrs = isVue3 ? vnode.props : (vnode.data || {}).attrs;\n config.title = attrs && !isUndefinedOrNull(attrs.title) ? attrs.title : undefined;\n } // Normalize delay\n\n\n if (!isPlainObject(config.delay)) {\n config.delay = {\n show: toInteger(config.delay, 0),\n hide: toInteger(config.delay, 0)\n };\n } // If argument, assume element ID of container element\n\n\n if (bindings.arg) {\n // Element ID specified as arg\n // We must prepend '#' to become a CSS selector\n config.container = \"#\".concat(bindings.arg);\n } // Process modifiers\n\n\n keys(bindings.modifiers).forEach(function (mod) {\n if (htmlRE.test(mod)) {\n // Title allows HTML\n config.html = true;\n } else if (noninteractiveRE.test(mod)) {\n // Noninteractive\n config.interactive = false;\n } else if (noFadeRE.test(mod)) {\n // No animation\n config.animation = false;\n } else if (placementRE.test(mod)) {\n // Placement of tooltip\n config.placement = mod;\n } else if (boundaryRE.test(mod)) {\n // Boundary of tooltip\n mod = mod === 'scrollparent' ? 'scrollParent' : mod;\n config.boundary = mod;\n } else if (delayRE.test(mod)) {\n // Delay value\n var delay = toInteger(mod.slice(1), 0);\n config.delay.show = delay;\n config.delay.hide = delay;\n } else if (delayShowRE.test(mod)) {\n // Delay show value\n config.delay.show = toInteger(mod.slice(2), 0);\n } else if (delayHideRE.test(mod)) {\n // Delay hide value\n config.delay.hide = toInteger(mod.slice(2), 0);\n } else if (offsetRE.test(mod)) {\n // Offset value, negative allowed\n config.offset = toInteger(mod.slice(1), 0);\n } else if (variantRE.test(mod)) {\n // Variant\n config.variant = mod.slice(2) || null;\n }\n }); // Special handling of event trigger modifiers trigger is\n // a space separated list\n\n var selectedTriggers = {}; // Parse current config object trigger\n\n concat(config.trigger || '').filter(identity).join(' ').trim().toLowerCase().split(spacesRE).forEach(function (trigger) {\n if (validTriggers[trigger]) {\n selectedTriggers[trigger] = true;\n }\n }); // Parse modifiers for triggers\n\n keys(bindings.modifiers).forEach(function (mod) {\n mod = mod.toLowerCase();\n\n if (validTriggers[mod]) {\n // If modifier is a valid trigger\n selectedTriggers[mod] = true;\n }\n }); // Sanitize triggers\n\n config.trigger = keys(selectedTriggers).join(' ');\n\n if (config.trigger === 'blur') {\n // Blur by itself is useless, so convert it to 'focus'\n config.trigger = 'focus';\n }\n\n if (!config.trigger) {\n // Use default trigger\n config.trigger = DefaultTrigger;\n } // Return the config\n\n\n return config;\n}; // Add/update Tooltip on our element\n\n\nvar applyTooltip = function applyTooltip(el, bindings, vnode) {\n if (!IS_BROWSER) {\n /* istanbul ignore next */\n return;\n }\n\n var config = parseBindings(bindings, vnode);\n\n if (!el[BV_TOOLTIP]) {\n var parent = getInstanceFromDirective(vnode, bindings);\n el[BV_TOOLTIP] = createNewChildComponent(parent, BVTooltip, {\n // Add the parent's scoped style attribute data\n _scopeId: getScopeId(parent, undefined)\n });\n el[BV_TOOLTIP].__bv_prev_data__ = {};\n el[BV_TOOLTIP].$on(EVENT_NAME_SHOW, function ()\n /* istanbul ignore next: for now */\n {\n // Before showing the tooltip, we update the title if it is a function\n if (isFunction(config.title)) {\n el[BV_TOOLTIP].updateData({\n title: config.title(el)\n });\n }\n });\n }\n\n var data = {\n title: config.title,\n triggers: config.trigger,\n placement: config.placement,\n fallbackPlacement: config.fallbackPlacement,\n variant: config.variant,\n customClass: config.customClass,\n container: config.container,\n boundary: config.boundary,\n delay: config.delay,\n offset: config.offset,\n noFade: !config.animation,\n id: config.id,\n interactive: config.interactive,\n disabled: config.disabled,\n html: config.html\n };\n var oldData = el[BV_TOOLTIP].__bv_prev_data__;\n el[BV_TOOLTIP].__bv_prev_data__ = data;\n\n if (!looseEqual(data, oldData)) {\n // We only update the instance if data has changed\n var newData = {\n target: el\n };\n keys(data).forEach(function (prop) {\n // We only pass data properties that have changed\n if (data[prop] !== oldData[prop]) {\n // if title is a function, we execute it here\n newData[prop] = prop === 'title' && isFunction(data[prop]) ? data[prop](el) : data[prop];\n }\n });\n el[BV_TOOLTIP].updateData(newData);\n }\n}; // Remove Tooltip on our element\n\n\nvar removeTooltip = function removeTooltip(el) {\n if (el[BV_TOOLTIP]) {\n el[BV_TOOLTIP].$destroy();\n el[BV_TOOLTIP] = null;\n }\n\n delete el[BV_TOOLTIP];\n}; // Export our directive\n\n\nexport var VBTooltip = {\n bind: function bind(el, bindings, vnode) {\n applyTooltip(el, bindings, vnode);\n },\n // We use `componentUpdated` here instead of `update`, as the former\n // waits until the containing component and children have finished updating\n componentUpdated: function componentUpdated(el, bindings, vnode) {\n // Performed in a `$nextTick()` to prevent render update loops\n nextTick(function () {\n applyTooltip(el, bindings, vnode);\n });\n },\n unbind: function unbind(el) {\n removeTooltip(el);\n }\n};","import { VBTooltip } from './tooltip';\nimport { pluginFactory } from '../../utils/plugins';\nvar VBTooltipPlugin = /*#__PURE__*/pluginFactory({\n directives: {\n VBTooltip: VBTooltip\n }\n});\nexport { VBTooltipPlugin, VBTooltip };","import { BTooltip } from './tooltip';\nimport { VBTooltipPlugin } from '../../directives/tooltip';\nimport { pluginFactory } from '../../utils/plugins';\nvar TooltipPlugin = /*#__PURE__*/pluginFactory({\n components: {\n BTooltip: BTooltip\n },\n plugins: {\n VBTooltipPlugin: VBTooltipPlugin\n }\n});\nexport { TooltipPlugin, BTooltip };","import { pluginFactory } from '../utils/plugins'; // Component group plugins\n\nimport { AlertPlugin } from './alert';\nimport { AspectPlugin } from './aspect';\nimport { AvatarPlugin } from './avatar';\nimport { BadgePlugin } from './badge';\nimport { BreadcrumbPlugin } from './breadcrumb';\nimport { ButtonPlugin } from './button';\nimport { ButtonGroupPlugin } from './button-group';\nimport { ButtonToolbarPlugin } from './button-toolbar';\nimport { CalendarPlugin } from './calendar';\nimport { CardPlugin } from './card';\nimport { CarouselPlugin } from './carousel';\nimport { CollapsePlugin } from './collapse';\nimport { DropdownPlugin } from './dropdown';\nimport { EmbedPlugin } from './embed';\nimport { FormPlugin } from './form';\nimport { FormCheckboxPlugin } from './form-checkbox';\nimport { FormDatepickerPlugin } from './form-datepicker';\nimport { FormFilePlugin } from './form-file';\nimport { FormGroupPlugin } from './form-group';\nimport { FormInputPlugin } from './form-input';\nimport { FormRadioPlugin } from './form-radio';\nimport { FormRatingPlugin } from './form-rating';\nimport { FormSelectPlugin } from './form-select';\nimport { FormSpinbuttonPlugin } from './form-spinbutton';\nimport { FormTagsPlugin } from './form-tags';\nimport { FormTextareaPlugin } from './form-textarea';\nimport { FormTimepickerPlugin } from './form-timepicker';\nimport { ImagePlugin } from './image';\nimport { InputGroupPlugin } from './input-group';\nimport { JumbotronPlugin } from './jumbotron';\nimport { LayoutPlugin } from './layout';\nimport { LinkPlugin } from './link';\nimport { ListGroupPlugin } from './list-group';\nimport { MediaPlugin } from './media';\nimport { ModalPlugin } from './modal';\nimport { NavPlugin } from './nav';\nimport { NavbarPlugin } from './navbar';\nimport { OverlayPlugin } from './overlay';\nimport { PaginationPlugin } from './pagination';\nimport { PaginationNavPlugin } from './pagination-nav';\nimport { PopoverPlugin } from './popover';\nimport { ProgressPlugin } from './progress';\nimport { SidebarPlugin } from './sidebar';\nimport { SkeletonPlugin } from './skeleton';\nimport { SpinnerPlugin } from './spinner'; // Table plugin includes TableLitePlugin and TableSimplePlugin\n\nimport { TablePlugin } from './table';\nimport { TabsPlugin } from './tabs';\nimport { TimePlugin } from './time';\nimport { ToastPlugin } from './toast';\nimport { TooltipPlugin } from './tooltip'; // Main plugin to install all component group plugins\n\nexport var componentsPlugin = /*#__PURE__*/pluginFactory({\n plugins: {\n AlertPlugin: AlertPlugin,\n AspectPlugin: AspectPlugin,\n AvatarPlugin: AvatarPlugin,\n BadgePlugin: BadgePlugin,\n BreadcrumbPlugin: BreadcrumbPlugin,\n ButtonPlugin: ButtonPlugin,\n ButtonGroupPlugin: ButtonGroupPlugin,\n ButtonToolbarPlugin: ButtonToolbarPlugin,\n CalendarPlugin: CalendarPlugin,\n CardPlugin: CardPlugin,\n CarouselPlugin: CarouselPlugin,\n CollapsePlugin: CollapsePlugin,\n DropdownPlugin: DropdownPlugin,\n EmbedPlugin: EmbedPlugin,\n FormPlugin: FormPlugin,\n FormCheckboxPlugin: FormCheckboxPlugin,\n FormDatepickerPlugin: FormDatepickerPlugin,\n FormFilePlugin: FormFilePlugin,\n FormGroupPlugin: FormGroupPlugin,\n FormInputPlugin: FormInputPlugin,\n FormRadioPlugin: FormRadioPlugin,\n FormRatingPlugin: FormRatingPlugin,\n FormSelectPlugin: FormSelectPlugin,\n FormSpinbuttonPlugin: FormSpinbuttonPlugin,\n FormTagsPlugin: FormTagsPlugin,\n FormTextareaPlugin: FormTextareaPlugin,\n FormTimepickerPlugin: FormTimepickerPlugin,\n ImagePlugin: ImagePlugin,\n InputGroupPlugin: InputGroupPlugin,\n JumbotronPlugin: JumbotronPlugin,\n LayoutPlugin: LayoutPlugin,\n LinkPlugin: LinkPlugin,\n ListGroupPlugin: ListGroupPlugin,\n MediaPlugin: MediaPlugin,\n ModalPlugin: ModalPlugin,\n NavPlugin: NavPlugin,\n NavbarPlugin: NavbarPlugin,\n OverlayPlugin: OverlayPlugin,\n PaginationPlugin: PaginationPlugin,\n PaginationNavPlugin: PaginationNavPlugin,\n PopoverPlugin: PopoverPlugin,\n ProgressPlugin: ProgressPlugin,\n SidebarPlugin: SidebarPlugin,\n SkeletonPlugin: SkeletonPlugin,\n SpinnerPlugin: SpinnerPlugin,\n TablePlugin: TablePlugin,\n TabsPlugin: TabsPlugin,\n TimePlugin: TimePlugin,\n ToastPlugin: ToastPlugin,\n TooltipPlugin: TooltipPlugin\n }\n});","import { VBHover } from './hover';\nimport { pluginFactory } from '../../utils/plugins';\nvar VBHoverPlugin = /*#__PURE__*/pluginFactory({\n directives: {\n VBHover: VBHover\n }\n});\nexport { VBHoverPlugin, VBHover };","import { VBModal } from './modal';\nimport { pluginFactory } from '../../utils/plugins';\nvar VBModalPlugin = /*#__PURE__*/pluginFactory({\n directives: {\n VBModal: VBModal\n }\n});\nexport { VBModalPlugin, VBModal };","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n/*\n * Scrollspy class definition\n */\nimport { EVENT_OPTIONS_NO_CAPTURE } from '../../../constants/events';\nimport { RX_HREF } from '../../../constants/regex';\nimport { addClass, closest, getAttr, getBCR, hasClass, isElement, isVisible, matches, offset, position, removeClass, select, selectAll } from '../../../utils/dom';\nimport { getRootEventName, eventOn, eventOff } from '../../../utils/events';\nimport { identity } from '../../../utils/identity';\nimport { isString, isUndefined } from '../../../utils/inspect';\nimport { mathMax } from '../../../utils/math';\nimport { toInteger } from '../../../utils/number';\nimport { hasOwnProperty, toString as objectToString } from '../../../utils/object';\nimport { observeDom } from '../../../utils/observe-dom';\nimport { warn } from '../../../utils/warn';\n/*\n * Constants / Defaults\n */\n\nvar NAME = 'v-b-scrollspy';\nvar CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item';\nvar CLASS_NAME_ACTIVE = 'active';\nvar SELECTOR_NAV_LIST_GROUP = '.nav, .list-group';\nvar SELECTOR_NAV_LINKS = '.nav-link';\nvar SELECTOR_NAV_ITEMS = '.nav-item';\nvar SELECTOR_LIST_ITEMS = '.list-group-item';\nvar SELECTOR_DROPDOWN = '.dropdown, .dropup';\nvar SELECTOR_DROPDOWN_ITEMS = '.dropdown-item';\nvar SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle';\nvar ROOT_EVENT_NAME_ACTIVATE = getRootEventName('BVScrollspy', 'activate');\nvar METHOD_OFFSET = 'offset';\nvar METHOD_POSITION = 'position';\nvar Default = {\n element: 'body',\n offset: 10,\n method: 'auto',\n throttle: 75\n};\nvar DefaultType = {\n element: '(string|element|component)',\n offset: 'number',\n method: 'string',\n throttle: 'number'\n}; // Transition Events\n\nvar TransitionEndEvents = ['webkitTransitionEnd', 'transitionend', 'otransitionend', 'oTransitionEnd'];\n/*\n * Utility Methods\n */\n// Better var type detection\n\nvar toType = function toType(obj)\n/* istanbul ignore next: not easy to test */\n{\n return objectToString(obj).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}; // Check config properties for expected types\n\n/* istanbul ignore next */\n\n\nvar typeCheckConfig = function typeCheckConfig(componentName, config, configTypes)\n/* istanbul ignore next: not easy to test */\n{\n for (var property in configTypes) {\n if (hasOwnProperty(configTypes, property)) {\n var expectedTypes = configTypes[property];\n var value = config[property];\n var valueType = value && isElement(value) ? 'element' : toType(value); // handle Vue instances\n\n valueType = value && value._isVue ? 'component' : valueType;\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n /* istanbul ignore next */\n warn(\"\".concat(componentName, \": Option \\\"\").concat(property, \"\\\" provided type \\\"\").concat(valueType, \"\\\" but expected type \\\"\").concat(expectedTypes, \"\\\"\"));\n }\n }\n }\n};\n/*\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\n/* istanbul ignore next: not easy to test */\n\n\nexport var BVScrollspy\n/* istanbul ignore next: not easy to test */\n= /*#__PURE__*/function () {\n function BVScrollspy(element, config, $root) {\n _classCallCheck(this, BVScrollspy);\n\n // The element we activate links in\n this.$el = element;\n this.$scroller = null;\n this.$selector = [SELECTOR_NAV_LINKS, SELECTOR_LIST_ITEMS, SELECTOR_DROPDOWN_ITEMS].join(',');\n this.$offsets = [];\n this.$targets = [];\n this.$activeTarget = null;\n this.$scrollHeight = 0;\n this.$resizeTimeout = null;\n this.$scrollerObserver = null;\n this.$targetsObserver = null;\n this.$root = $root || null;\n this.$config = null;\n this.updateConfig(config);\n }\n\n _createClass(BVScrollspy, [{\n key: \"updateConfig\",\n value: function updateConfig(config, $root) {\n if (this.$scroller) {\n // Just in case out scroll element has changed\n this.unlisten();\n this.$scroller = null;\n }\n\n var cfg = _objectSpread(_objectSpread({}, this.constructor.Default), config);\n\n if ($root) {\n this.$root = $root;\n }\n\n typeCheckConfig(this.constructor.Name, cfg, this.constructor.DefaultType);\n this.$config = cfg;\n\n if (this.$root) {\n var self = this;\n this.$root.$nextTick(function () {\n self.listen();\n });\n } else {\n this.listen();\n }\n }\n }, {\n key: \"dispose\",\n value: function dispose() {\n this.unlisten();\n clearTimeout(this.$resizeTimeout);\n this.$resizeTimeout = null;\n this.$el = null;\n this.$config = null;\n this.$scroller = null;\n this.$selector = null;\n this.$offsets = null;\n this.$targets = null;\n this.$activeTarget = null;\n this.$scrollHeight = null;\n }\n }, {\n key: \"listen\",\n value: function listen() {\n var _this = this;\n\n var scroller = this.getScroller();\n\n if (scroller && scroller.tagName !== 'BODY') {\n eventOn(scroller, 'scroll', this, EVENT_OPTIONS_NO_CAPTURE);\n }\n\n eventOn(window, 'scroll', this, EVENT_OPTIONS_NO_CAPTURE);\n eventOn(window, 'resize', this, EVENT_OPTIONS_NO_CAPTURE);\n eventOn(window, 'orientationchange', this, EVENT_OPTIONS_NO_CAPTURE);\n TransitionEndEvents.forEach(function (eventName) {\n eventOn(window, eventName, _this, EVENT_OPTIONS_NO_CAPTURE);\n });\n this.setObservers(true); // Schedule a refresh\n\n this.handleEvent('refresh');\n }\n }, {\n key: \"unlisten\",\n value: function unlisten() {\n var _this2 = this;\n\n var scroller = this.getScroller();\n this.setObservers(false);\n\n if (scroller && scroller.tagName !== 'BODY') {\n eventOff(scroller, 'scroll', this, EVENT_OPTIONS_NO_CAPTURE);\n }\n\n eventOff(window, 'scroll', this, EVENT_OPTIONS_NO_CAPTURE);\n eventOff(window, 'resize', this, EVENT_OPTIONS_NO_CAPTURE);\n eventOff(window, 'orientationchange', this, EVENT_OPTIONS_NO_CAPTURE);\n TransitionEndEvents.forEach(function (eventName) {\n eventOff(window, eventName, _this2, EVENT_OPTIONS_NO_CAPTURE);\n });\n }\n }, {\n key: \"setObservers\",\n value: function setObservers(on) {\n var _this3 = this;\n\n // We observe both the scroller for content changes, and the target links\n this.$scrollerObserver && this.$scrollerObserver.disconnect();\n this.$targetsObserver && this.$targetsObserver.disconnect();\n this.$scrollerObserver = null;\n this.$targetsObserver = null;\n\n if (on) {\n this.$targetsObserver = observeDom(this.$el, function () {\n _this3.handleEvent('mutation');\n }, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['href']\n });\n this.$scrollerObserver = observeDom(this.getScroller(), function () {\n _this3.handleEvent('mutation');\n }, {\n subtree: true,\n childList: true,\n characterData: true,\n attributes: true,\n attributeFilter: ['id', 'style', 'class']\n });\n }\n } // General event handler\n\n }, {\n key: \"handleEvent\",\n value: function handleEvent(event) {\n var type = isString(event) ? event : event.type;\n var self = this;\n\n var resizeThrottle = function resizeThrottle() {\n if (!self.$resizeTimeout) {\n self.$resizeTimeout = setTimeout(function () {\n self.refresh();\n self.process();\n self.$resizeTimeout = null;\n }, self.$config.throttle);\n }\n };\n\n if (type === 'scroll') {\n if (!this.$scrollerObserver) {\n // Just in case we are added to the DOM before the scroll target is\n // We re-instantiate our listeners, just in case\n this.listen();\n }\n\n this.process();\n } else if (/(resize|orientationchange|mutation|refresh)/.test(type)) {\n // Postpone these events by throttle time\n resizeThrottle();\n }\n } // Refresh the list of target links on the element we are applied to\n\n }, {\n key: \"refresh\",\n value: function refresh() {\n var _this4 = this;\n\n var scroller = this.getScroller();\n\n if (!scroller) {\n return;\n }\n\n var autoMethod = scroller !== scroller.window ? METHOD_POSITION : METHOD_OFFSET;\n var method = this.$config.method === 'auto' ? autoMethod : this.$config.method;\n var methodFn = method === METHOD_POSITION ? position : offset;\n var offsetBase = method === METHOD_POSITION ? this.getScrollTop() : 0;\n this.$offsets = [];\n this.$targets = [];\n this.$scrollHeight = this.getScrollHeight(); // Find all the unique link HREFs that we will control\n\n selectAll(this.$selector, this.$el) // Get HREF value\n .map(function (link) {\n return getAttr(link, 'href');\n }) // Filter out HREFs that do not match our RegExp\n .filter(function (href) {\n return href && RX_HREF.test(href || '');\n }) // Find all elements with ID that match HREF hash\n .map(function (href) {\n // Convert HREF into an ID (including # at beginning)\n var id = href.replace(RX_HREF, '$1').trim();\n\n if (!id) {\n return null;\n } // Find the element with the ID specified by id\n\n\n var el = select(id, scroller);\n\n if (el && isVisible(el)) {\n return {\n offset: toInteger(methodFn(el).top, 0) + offsetBase,\n target: id\n };\n }\n\n return null;\n }).filter(identity) // Sort them by their offsets (smallest first)\n .sort(function (a, b) {\n return a.offset - b.offset;\n }) // record only unique targets/offsets\n .reduce(function (memo, item) {\n if (!memo[item.target]) {\n _this4.$offsets.push(item.offset);\n\n _this4.$targets.push(item.target);\n\n memo[item.target] = true;\n }\n\n return memo;\n }, {}); // Return this for easy chaining\n\n return this;\n } // Handle activating/clearing\n\n }, {\n key: \"process\",\n value: function process() {\n var scrollTop = this.getScrollTop() + this.$config.offset;\n var scrollHeight = this.getScrollHeight();\n var maxScroll = this.$config.offset + scrollHeight - this.getOffsetHeight();\n\n if (this.$scrollHeight !== scrollHeight) {\n this.refresh();\n }\n\n if (scrollTop >= maxScroll) {\n var target = this.$targets[this.$targets.length - 1];\n\n if (this.$activeTarget !== target) {\n this.activate(target);\n }\n\n return;\n }\n\n if (this.$activeTarget && scrollTop < this.$offsets[0] && this.$offsets[0] > 0) {\n this.$activeTarget = null;\n this.clear();\n return;\n }\n\n for (var i = this.$offsets.length; i--;) {\n var isActiveTarget = this.$activeTarget !== this.$targets[i] && scrollTop >= this.$offsets[i] && (isUndefined(this.$offsets[i + 1]) || scrollTop < this.$offsets[i + 1]);\n\n if (isActiveTarget) {\n this.activate(this.$targets[i]);\n }\n }\n }\n }, {\n key: \"getScroller\",\n value: function getScroller() {\n if (this.$scroller) {\n return this.$scroller;\n }\n\n var scroller = this.$config.element;\n\n if (!scroller) {\n return null;\n } else if (isElement(scroller.$el)) {\n scroller = scroller.$el;\n } else if (isString(scroller)) {\n scroller = select(scroller);\n }\n\n if (!scroller) {\n return null;\n }\n\n this.$scroller = scroller.tagName === 'BODY' ? window : scroller;\n return this.$scroller;\n }\n }, {\n key: \"getScrollTop\",\n value: function getScrollTop() {\n var scroller = this.getScroller();\n return scroller === window ? scroller.pageYOffset : scroller.scrollTop;\n }\n }, {\n key: \"getScrollHeight\",\n value: function getScrollHeight() {\n return this.getScroller().scrollHeight || mathMax(document.body.scrollHeight, document.documentElement.scrollHeight);\n }\n }, {\n key: \"getOffsetHeight\",\n value: function getOffsetHeight() {\n var scroller = this.getScroller();\n return scroller === window ? window.innerHeight : getBCR(scroller).height;\n }\n }, {\n key: \"activate\",\n value: function activate(target) {\n var _this5 = this;\n\n this.$activeTarget = target;\n this.clear(); // Grab the list of target links ()\n\n var links = selectAll(this.$selector // Split out the base selectors\n .split(',') // Map to a selector that matches links with HREF ending in the ID (including '#')\n .map(function (selector) {\n return \"\".concat(selector, \"[href$=\\\"\").concat(target, \"\\\"]\");\n }) // Join back into a single selector string\n .join(','), this.$el);\n links.forEach(function (link) {\n if (hasClass(link, CLASS_NAME_DROPDOWN_ITEM)) {\n // This is a dropdown item, so find the .dropdown-toggle and set its state\n var dropdown = closest(SELECTOR_DROPDOWN, link);\n\n if (dropdown) {\n _this5.setActiveState(select(SELECTOR_DROPDOWN_TOGGLE, dropdown), true);\n } // Also set this link's state\n\n\n _this5.setActiveState(link, true);\n } else {\n // Set triggered link as active\n _this5.setActiveState(link, true);\n\n if (matches(link.parentElement, SELECTOR_NAV_ITEMS)) {\n // Handle nav-link inside nav-item, and set nav-item active\n _this5.setActiveState(link.parentElement, true);\n } // Set triggered links parents as active\n // With both and markup a parent is the previous sibling of any nav ancestor\n\n\n var el = link;\n\n while (el) {\n el = closest(SELECTOR_NAV_LIST_GROUP, el);\n var sibling = el ? el.previousElementSibling : null;\n\n if (sibling && matches(sibling, \"\".concat(SELECTOR_NAV_LINKS, \", \").concat(SELECTOR_LIST_ITEMS))) {\n _this5.setActiveState(sibling, true);\n } // Handle special case where nav-link is inside a nav-item\n\n\n if (sibling && matches(sibling, SELECTOR_NAV_ITEMS)) {\n _this5.setActiveState(select(SELECTOR_NAV_LINKS, sibling), true); // Add active state to nav-item as well\n\n\n _this5.setActiveState(sibling, true);\n }\n }\n }\n }); // Signal event to via $root, passing ID of activated target and reference to array of links\n\n if (links && links.length > 0 && this.$root) {\n this.$root.$emit(ROOT_EVENT_NAME_ACTIVATE, target, links);\n }\n }\n }, {\n key: \"clear\",\n value: function clear() {\n var _this6 = this;\n\n selectAll(\"\".concat(this.$selector, \", \").concat(SELECTOR_NAV_ITEMS), this.$el).filter(function (el) {\n return hasClass(el, CLASS_NAME_ACTIVE);\n }).forEach(function (el) {\n return _this6.setActiveState(el, false);\n });\n }\n }, {\n key: \"setActiveState\",\n value: function setActiveState(el, active) {\n if (!el) {\n return;\n }\n\n if (active) {\n addClass(el, CLASS_NAME_ACTIVE);\n } else {\n removeClass(el, CLASS_NAME_ACTIVE);\n }\n }\n }], [{\n key: \"Name\",\n get: function get() {\n return NAME;\n }\n }, {\n key: \"Default\",\n get: function get() {\n return Default;\n }\n }, {\n key: \"DefaultType\",\n get: function get() {\n return DefaultType;\n }\n }]);\n\n return BVScrollspy;\n}();","import { IS_BROWSER } from '../../constants/env';\nimport { isNumber, isObject, isString } from '../../utils/inspect';\nimport { mathRound } from '../../utils/math';\nimport { toInteger } from '../../utils/number';\nimport { keys } from '../../utils/object';\nimport { getEventRoot } from '../../utils/get-event-root';\nimport { getInstanceFromDirective } from '../../utils/get-instance-from-directive';\nimport { BVScrollspy } from './helpers/bv-scrollspy.class'; // Key we use to store our instance\n\nvar BV_SCROLLSPY = '__BV_Scrollspy__'; // Pre-compiled regular expressions\n\nvar onlyDigitsRE = /^\\d+$/;\nvar offsetRE = /^(auto|position|offset)$/; // Build a Scrollspy config based on bindings (if any)\n// Arguments and modifiers take precedence over passed value config object\n\n/* istanbul ignore next: not easy to test */\n\nvar parseBindings = function parseBindings(bindings)\n/* istanbul ignore next: not easy to test */\n{\n var config = {}; // If argument, assume element ID\n\n if (bindings.arg) {\n // Element ID specified as arg\n // We must prepend '#' to become a CSS selector\n config.element = \"#\".concat(bindings.arg);\n } // Process modifiers\n\n\n keys(bindings.modifiers).forEach(function (mod) {\n if (onlyDigitsRE.test(mod)) {\n // Offset value\n config.offset = toInteger(mod, 0);\n } else if (offsetRE.test(mod)) {\n // Offset method\n config.method = mod;\n }\n }); // Process value\n\n if (isString(bindings.value)) {\n // Value is a CSS ID or selector\n config.element = bindings.value;\n } else if (isNumber(bindings.value)) {\n // Value is offset\n config.offset = mathRound(bindings.value);\n } else if (isObject(bindings.value)) {\n // Value is config object\n // Filter the object based on our supported config options\n keys(bindings.value).filter(function (k) {\n return !!BVScrollspy.DefaultType[k];\n }).forEach(function (k) {\n config[k] = bindings.value[k];\n });\n }\n\n return config;\n}; // Add or update Scrollspy on our element\n\n\nvar applyScrollspy = function applyScrollspy(el, bindings, vnode)\n/* istanbul ignore next: not easy to test */\n{\n if (!IS_BROWSER) {\n /* istanbul ignore next */\n return;\n }\n\n var config = parseBindings(bindings);\n\n if (el[BV_SCROLLSPY]) {\n el[BV_SCROLLSPY].updateConfig(config, getEventRoot(getInstanceFromDirective(vnode, bindings)));\n } else {\n el[BV_SCROLLSPY] = new BVScrollspy(el, config, getEventRoot(getInstanceFromDirective(vnode, bindings)));\n }\n}; // Remove Scrollspy on our element\n\n/* istanbul ignore next: not easy to test */\n\n\nvar removeScrollspy = function removeScrollspy(el)\n/* istanbul ignore next: not easy to test */\n{\n if (el[BV_SCROLLSPY]) {\n el[BV_SCROLLSPY].dispose();\n el[BV_SCROLLSPY] = null;\n delete el[BV_SCROLLSPY];\n }\n};\n/*\n * Export our directive\n */\n\n\nexport var VBScrollspy = {\n /* istanbul ignore next: not easy to test */\n bind: function bind(el, bindings, vnode) {\n applyScrollspy(el, bindings, vnode);\n },\n\n /* istanbul ignore next: not easy to test */\n inserted: function inserted(el, bindings, vnode) {\n applyScrollspy(el, bindings, vnode);\n },\n\n /* istanbul ignore next: not easy to test */\n update: function update(el, bindings, vnode) {\n if (bindings.value !== bindings.oldValue) {\n applyScrollspy(el, bindings, vnode);\n }\n },\n\n /* istanbul ignore next: not easy to test */\n componentUpdated: function componentUpdated(el, bindings, vnode) {\n if (bindings.value !== bindings.oldValue) {\n applyScrollspy(el, bindings, vnode);\n }\n },\n\n /* istanbul ignore next: not easy to test */\n unbind: function unbind(el) {\n removeScrollspy(el);\n }\n};","import { VBScrollspy } from './scrollspy';\nimport { pluginFactory } from '../../utils/plugins';\nvar VBScrollspyPlugin = /*#__PURE__*/pluginFactory({\n directives: {\n VBScrollspy: VBScrollspy\n }\n});\nexport { VBScrollspyPlugin, VBScrollspy };","import { VBVisible } from './visible';\nimport { pluginFactory } from '../../utils/plugins';\nvar VBVisiblePlugin = /*#__PURE__*/pluginFactory({\n directives: {\n VBVisible: VBVisible\n }\n});\nexport { VBVisiblePlugin, VBVisible };","import { pluginFactory } from '../utils/plugins';\nimport { VBHoverPlugin } from './hover';\nimport { VBModalPlugin } from './modal';\nimport { VBPopoverPlugin } from './popover';\nimport { VBScrollspyPlugin } from './scrollspy';\nimport { VBTogglePlugin } from './toggle';\nimport { VBTooltipPlugin } from './tooltip';\nimport { VBVisiblePlugin } from './visible'; // Main plugin for installing all directive plugins\n\nexport var directivesPlugin = /*#__PURE__*/pluginFactory({\n plugins: {\n VBHoverPlugin: VBHoverPlugin,\n VBModalPlugin: VBModalPlugin,\n VBPopoverPlugin: VBPopoverPlugin,\n VBScrollspyPlugin: VBScrollspyPlugin,\n VBTogglePlugin: VBTogglePlugin,\n VBTooltipPlugin: VBTooltipPlugin,\n VBVisiblePlugin: VBVisiblePlugin\n }\n});","/*!\n * BootstrapVue 2.23.1\n *\n * @link https://bootstrap-vue.org\n * @source https://github.com/bootstrap-vue/bootstrap-vue\n * @copyright (c) 2016-2022 BootstrapVue\n * @license MIT\n * https://github.com/bootstrap-vue/bootstrap-vue/blob/master/LICENSE\n */\nimport { installFactory } from './utils/plugins';\nimport { componentsPlugin } from './components';\nimport { directivesPlugin } from './directives';\nimport { BVConfigPlugin } from './bv-config';\nvar NAME = 'BootstrapVue'; // --- BootstrapVue installer ---\n\nvar install = /*#__PURE__*/installFactory({\n plugins: {\n componentsPlugin: componentsPlugin,\n directivesPlugin: directivesPlugin\n }\n}); // --- BootstrapVue plugin ---\n\nvar BootstrapVue = /*#__PURE__*/{\n install: install,\n NAME: NAME\n}; // --- Named exports for BvConfigPlugin ---\n\nexport { // Installer exported in case the consumer does not import `default`\n// as the plugin in CommonJS build (or does not have interop enabled for CommonJS)\n// Both the following will work:\n// BootstrapVue = require('bootstrap-vue')\n// BootstrapVue = require('bootstrap-vue').default\n// Vue.use(BootstrapVue)\ninstall, NAME, // BootstrapVue config plugin\nBVConfigPlugin, // `BVConfigPlugin` has been documented as `BVConfig` as well,\n// so we add an alias to the shorter name for backwards compat\nBVConfigPlugin as BVConfig, // Main BootstrapVue plugin\nBootstrapVue }; // --- Export named injection plugins ---\n// TODO:\n// We should probably move injections into their own\n// parent directory (i.e. `/src/injections`)\n\nexport { BVModalPlugin } from './components/modal/helpers/bv-modal';\nexport { BVToastPlugin } from './components/toast/helpers/bv-toast'; // Webpack 4 has optimization difficulties with re-export of re-exports,\n// so we import the components individually here for better tree shaking\n//\n// Webpack v5 fixes the optimizations with re-export of re-exports so this\n// can be reverted back to `export * from './table'` when Webpack v5 is released\n// See: https://github.com/webpack/webpack/pull/9203 (available in Webpack v5.0.0-alpha.15)\n// -- Export Icon components and IconPlugin/BootstrapVueIcons ---\n// export * from './icons'\n\nexport { IconsPlugin, BootstrapVueIcons } from './icons/plugin';\nexport { BIcon } from './icons/icon';\nexport { BIconstack } from './icons/iconstack'; // This re-export is only a single level deep, which\n// Webpack 4 (usually) handles correctly when tree shaking\n\nexport * from './icons/icons'; // --- Export all individual components and component group plugins as named exports ---\n// export * from './components/alert'\n\nexport { AlertPlugin } from './components/alert';\nexport { BAlert } from './components/alert/alert'; // export * from './components/aspect'\n\nexport { AspectPlugin } from './components/aspect';\nexport { BAspect } from './components/aspect/aspect'; // export * from './components/avatar'\n\nexport { AvatarPlugin } from './components/avatar';\nexport { BAvatar } from './components/avatar/avatar';\nexport { BAvatarGroup } from './components/avatar/avatar-group'; // export * from './components/badge'\n\nexport { BadgePlugin } from './components/badge';\nexport { BBadge } from './components/badge/badge'; // export * from './components/breadcrumb'\n\nexport { BreadcrumbPlugin } from './components/breadcrumb';\nexport { BBreadcrumb } from './components/breadcrumb/breadcrumb';\nexport { BBreadcrumbItem } from './components/breadcrumb/breadcrumb-item'; // export * from './components/button'\n\nexport { ButtonPlugin } from './components/button';\nexport { BButton } from './components/button/button';\nexport { BButtonClose } from './components/button/button-close'; // export * from './components/button-group'\n\nexport { ButtonGroupPlugin } from './components/button-group';\nexport { BButtonGroup } from './components/button-group/button-group'; // export * from './components/button-toolbar'\n\nexport { ButtonToolbarPlugin } from './components/button-toolbar';\nexport { BButtonToolbar } from './components/button-toolbar/button-toolbar'; // export * from './components/calendar'\n\nexport { CalendarPlugin } from './components/calendar';\nexport { BCalendar } from './components/calendar/calendar'; // export * from './components/card'\n\nexport { CardPlugin } from './components/card';\nexport { BCard } from './components/card/card';\nexport { BCardBody } from './components/card/card-body';\nexport { BCardFooter } from './components/card/card-footer';\nexport { BCardGroup } from './components/card/card-group';\nexport { BCardHeader } from './components/card/card-header';\nexport { BCardImg } from './components/card/card-img';\nexport { BCardImgLazy } from './components/card/card-img-lazy';\nexport { BCardSubTitle } from './components/card/card-sub-title';\nexport { BCardText } from './components/card/card-text';\nexport { BCardTitle } from './components/card/card-title'; // export * from './components/carousel'\n\nexport { CarouselPlugin } from './components/carousel';\nexport { BCarousel } from './components/carousel/carousel';\nexport { BCarouselSlide } from './components/carousel/carousel-slide'; // export * from './components/collapse'\n\nexport { CollapsePlugin } from './components/collapse';\nexport { BCollapse } from './components/collapse/collapse'; // export * from './components/dropdown'\n\nexport { DropdownPlugin } from './components/dropdown';\nexport { BDropdown } from './components/dropdown/dropdown';\nexport { BDropdownItem } from './components/dropdown/dropdown-item';\nexport { BDropdownItemButton } from './components/dropdown/dropdown-item-button';\nexport { BDropdownDivider } from './components/dropdown/dropdown-divider';\nexport { BDropdownForm } from './components/dropdown/dropdown-form';\nexport { BDropdownGroup } from './components/dropdown/dropdown-group';\nexport { BDropdownHeader } from './components/dropdown/dropdown-header';\nexport { BDropdownText } from './components/dropdown/dropdown-text'; // export * from './components/embed'\n\nexport { EmbedPlugin } from './components/embed';\nexport { BEmbed } from './components/embed/embed'; // export * from './components/form'\n\nexport { FormPlugin } from './components/form';\nexport { BForm } from './components/form/form';\nexport { BFormDatalist } from './components/form/form-datalist';\nexport { BFormText } from './components/form/form-text';\nexport { BFormInvalidFeedback } from './components/form/form-invalid-feedback';\nexport { BFormValidFeedback } from './components/form/form-valid-feedback'; // export * from './components/form-checkbox'\n\nexport { FormCheckboxPlugin } from './components/form-checkbox';\nexport { BFormCheckbox } from './components/form-checkbox/form-checkbox';\nexport { BFormCheckboxGroup } from './components/form-checkbox/form-checkbox-group'; // export * from './components/form-datepicker'\n\nexport { FormDatepickerPlugin } from './components/form-datepicker';\nexport { BFormDatepicker } from './components/form-datepicker/form-datepicker'; // export * from './components/form-file'\n\nexport { FormFilePlugin } from './components/form-file';\nexport { BFormFile } from './components/form-file/form-file'; // export * from './components/form-group'\n\nexport { FormGroupPlugin } from './components/form-group';\nexport { BFormGroup } from './components/form-group/form-group'; // export * from './components/form-input'\n\nexport { FormInputPlugin } from './components/form-input';\nexport { BFormInput } from './components/form-input/form-input'; // export * from './components/form-radio'\n\nexport { FormRadioPlugin } from './components/form-radio';\nexport { BFormRadio } from './components/form-radio/form-radio';\nexport { BFormRadioGroup } from './components/form-radio/form-radio-group'; // export * from './components/form-rating'\n\nexport { FormRatingPlugin } from './components/form-rating';\nexport { BFormRating } from './components/form-rating/form-rating'; // export * from './components/form-tags'\n\nexport { FormTagsPlugin } from './components/form-tags';\nexport { BFormTags } from './components/form-tags/form-tags';\nexport { BFormTag } from './components/form-tags/form-tag'; // export * from './components/form-select'\n\nexport { FormSelectPlugin } from './components/form-select';\nexport { BFormSelect } from './components/form-select/form-select';\nexport { BFormSelectOption } from './components/form-select/form-select-option';\nexport { BFormSelectOptionGroup } from './components/form-select/form-select-option-group'; // export * from './components/form-spinbutton'\n\nexport { FormSpinbuttonPlugin } from './components/form-spinbutton';\nexport { BFormSpinbutton } from './components/form-spinbutton/form-spinbutton'; // export * from './components/form-textarea'\n\nexport { FormTextareaPlugin } from './components/form-textarea';\nexport { BFormTextarea } from './components/form-textarea/form-textarea'; // export * from './components/form-timepicker'\n\nexport { FormTimepickerPlugin } from './components/form-timepicker';\nexport { BFormTimepicker } from './components/form-timepicker/form-timepicker'; // export * from './components/image'\n\nexport { ImagePlugin } from './components/image';\nexport { BImg } from './components/image/img';\nexport { BImgLazy } from './components/image/img-lazy'; // export * from './components/input-group'\n\nexport { InputGroupPlugin } from './components/input-group';\nexport { BInputGroup } from './components/input-group/input-group';\nexport { BInputGroupAddon } from './components/input-group/input-group-addon';\nexport { BInputGroupAppend } from './components/input-group/input-group-append';\nexport { BInputGroupPrepend } from './components/input-group/input-group-prepend';\nexport { BInputGroupText } from './components/input-group/input-group-text'; // export * from './components/jumbotron'\n\nexport { JumbotronPlugin } from './components/jumbotron';\nexport { BJumbotron } from './components/jumbotron/jumbotron'; // export * from './components/layout'\n\nexport { LayoutPlugin } from './components/layout';\nexport { BContainer } from './components/layout/container';\nexport { BRow } from './components/layout/row';\nexport { BCol } from './components/layout/col';\nexport { BFormRow } from './components/layout/form-row'; // export * from './components/link'\n\nexport { LinkPlugin } from './components/link';\nexport { BLink } from './components/link/link'; // export * from './components/list-group'\n\nexport { ListGroupPlugin } from './components/list-group';\nexport { BListGroup } from './components/list-group/list-group';\nexport { BListGroupItem } from './components/list-group/list-group-item'; // export * from './components/media'\n\nexport { MediaPlugin } from './components/media';\nexport { BMedia } from './components/media/media';\nexport { BMediaAside } from './components/media/media-aside';\nexport { BMediaBody } from './components/media/media-body'; // export * from './components/modal'\n\nexport { ModalPlugin } from './components/modal';\nexport { BModal } from './components/modal/modal'; // export * from './components/nav'\n\nexport { NavPlugin } from './components/nav';\nexport { BNav } from './components/nav/nav';\nexport { BNavForm } from './components/nav/nav-form';\nexport { BNavItem } from './components/nav/nav-item';\nexport { BNavItemDropdown } from './components/nav/nav-item-dropdown';\nexport { BNavText } from './components/nav/nav-text'; // export * from './components/navbar'\n\nexport { NavbarPlugin } from './components/navbar';\nexport { BNavbar } from './components/navbar/navbar';\nexport { BNavbarBrand } from './components/navbar/navbar-brand';\nexport { BNavbarNav } from './components/navbar/navbar-nav';\nexport { BNavbarToggle } from './components/navbar/navbar-toggle'; // export * from './components/overlay'\n\nexport { OverlayPlugin } from './components/overlay';\nexport { BOverlay } from './components/overlay/overlay'; // export * from './components/pagination'\n\nexport { PaginationPlugin } from './components/pagination';\nexport { BPagination } from './components/pagination/pagination'; // export * from './components/pagination-nav'\n\nexport { PaginationNavPlugin } from './components/pagination-nav';\nexport { BPaginationNav } from './components/pagination-nav/pagination-nav'; // export * from './components/popover'\n\nexport { PopoverPlugin } from './components/popover';\nexport { BPopover } from './components/popover/popover'; // export * from './components/progress'\n\nexport { ProgressPlugin } from './components/progress';\nexport { BProgress } from './components/progress/progress';\nexport { BProgressBar } from './components/progress/progress-bar'; // export * from './components/sidebar'\n\nexport { SidebarPlugin } from './components/sidebar';\nexport { BSidebar } from './components/sidebar/sidebar'; // export * from './components/skeleton'\n\nexport { SkeletonPlugin } from './components/skeleton';\nexport { BSkeleton } from './components/skeleton/skeleton';\nexport { BSkeletonIcon } from './components/skeleton/skeleton-icon';\nexport { BSkeletonImg } from './components/skeleton/skeleton-img';\nexport { BSkeletonTable } from './components/skeleton/skeleton-table';\nexport { BSkeletonWrapper } from './components/skeleton/skeleton-wrapper'; // export * from './components/spinner'\n\nexport { SpinnerPlugin } from './components/spinner';\nexport { BSpinner } from './components/spinner/spinner'; // export * from './components/table'\n\nexport { TablePlugin, TableLitePlugin, TableSimplePlugin } from './components/table';\nexport { BTable } from './components/table/table';\nexport { BTableLite } from './components/table/table-lite';\nexport { BTableSimple } from './components/table/table-simple';\nexport { BTbody } from './components/table/tbody';\nexport { BThead } from './components/table/thead';\nexport { BTfoot } from './components/table/tfoot';\nexport { BTr } from './components/table/tr';\nexport { BTh } from './components/table/th';\nexport { BTd } from './components/table/td'; // export * from './components/tabs'\n\nexport { TabsPlugin } from './components/tabs';\nexport { BTabs } from './components/tabs/tabs';\nexport { BTab } from './components/tabs/tab'; // export * from './components/time'\n\nexport { TimePlugin } from './components/time';\nexport { BTime } from './components/time/time'; // export * from './components/toast'\n\nexport { ToastPlugin } from './components/toast';\nexport { BToast } from './components/toast/toast';\nexport { BToaster } from './components/toast/toaster'; // export * from './components/tooltip'\n\nexport { TooltipPlugin } from './components/tooltip';\nexport { BTooltip } from './components/tooltip/tooltip'; // --- Named exports of all directives (VB) and plugins (VBPlugin) ---\n// Webpack 4 has optimization difficulties with re-export of re-exports,\n// so we import the directives individually here for better tree shaking\n//\n// Webpack v5 fixes the optimizations with re-export of re-exports so this\n// can be reverted back to `export * from './scrollspy'` when Webpack v5 is released\n// https://github.com/webpack/webpack/pull/9203 (available in Webpack v5.0.0-alpha.15)\n// export * from './directives/hover'\n\nexport { VBHoverPlugin } from './directives/hover';\nexport { VBHover } from './directives/hover/hover'; // export * from './directives/modal'\n\nexport { VBModalPlugin } from './directives/modal';\nexport { VBModal } from './directives/modal/modal'; // export * from './directives/popover'\n\nexport { VBPopoverPlugin } from './directives/popover';\nexport { VBPopover } from './directives/popover/popover'; // export * from './directives/scrollspy'\n\nexport { VBScrollspyPlugin } from './directives/scrollspy';\nexport { VBScrollspy } from './directives/scrollspy/scrollspy'; // export * from './directives/toggle'\n\nexport { VBTogglePlugin } from './directives/toggle';\nexport { VBToggle } from './directives/toggle/toggle'; // export * from './directives/tooltip'\n\nexport { VBTooltipPlugin } from './directives/tooltip';\nexport { VBTooltip } from './directives/tooltip/tooltip'; // export * from './directives/tooltip'\n\nexport { VBVisiblePlugin } from './directives/visible';\nexport { VBVisible } from './directives/visible/visible'; // Default export is the BootstrapVue plugin\n\nexport default BootstrapVue;","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _iterableToArray(iter) { if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nimport { isArray, isPlainObject } from './inspect';\nimport { keys } from './object';\nexport var cloneDeep = function cloneDeep(obj) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : obj;\n\n if (isArray(obj)) {\n return obj.reduce(function (result, val) {\n return [].concat(_toConsumableArray(result), [cloneDeep(val, val)]);\n }, []);\n }\n\n if (isPlainObject(obj)) {\n return keys(obj).reduce(function (result, key) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, cloneDeep(obj[key], obj[key])));\n }, {});\n }\n\n return defaultValue;\n};","import { Vue } from '../vue';\nimport { DEFAULT_BREAKPOINT, PROP_NAME } from '../constants/config';\nimport { cloneDeep } from './clone-deep';\nimport { memoize } from './memoize'; // --- Constants ---\n\nvar VueProto = Vue.prototype; // --- Getter methods ---\n// All methods return a deep clone (immutable) copy of the config value,\n// to prevent mutation of the user config object\n// Get the current config\n\nexport var getConfig = function getConfig() {\n var bvConfig = VueProto[PROP_NAME];\n return bvConfig ? bvConfig.getConfig() : {};\n}; // Method to grab a config value based on a dotted/array notation key\n\nexport var getConfigValue = function getConfigValue(key) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n var bvConfig = VueProto[PROP_NAME];\n return bvConfig ? bvConfig.getConfigValue(key, defaultValue) : cloneDeep(defaultValue);\n}; // Method to grab a config value for a particular component\n\nexport var getComponentConfig = function getComponentConfig(key) {\n var propKey = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n // Return the particular config value for key if specified,\n // otherwise we return the full config (or an empty object if not found)\n return propKey ? getConfigValue(\"\".concat(key, \".\").concat(propKey), defaultValue) : getConfigValue(key, {});\n}; // Get all breakpoint names\n\nexport var getBreakpoints = function getBreakpoints() {\n return getConfigValue('breakpoints', DEFAULT_BREAKPOINT);\n}; // Private method for caching breakpoint names\n\nvar _getBreakpointsCached = memoize(function () {\n return getBreakpoints();\n}); // Get all breakpoint names (cached)\n\n\nexport var getBreakpointsCached = function getBreakpointsCached() {\n return cloneDeep(_getBreakpointsCached());\n}; // Get breakpoints with the smallest breakpoint set as ''\n// Useful for components that create breakpoint specific props\n\nexport var getBreakpointsUp = function getBreakpointsUp() {\n var breakpoints = getBreakpoints();\n breakpoints[0] = '';\n return breakpoints;\n}; // Get breakpoints with the smallest breakpoint set as '' (cached)\n// Useful for components that create breakpoint specific props\n\nexport var getBreakpointsUpCached = memoize(function () {\n var breakpoints = getBreakpointsCached();\n breakpoints[0] = '';\n return breakpoints;\n}); // Get breakpoints with the largest breakpoint set as ''\n\nexport var getBreakpointsDown = function getBreakpointsDown() {\n var breakpoints = getBreakpoints();\n breakpoints[breakpoints.length - 1] = '';\n return breakpoints;\n}; // Get breakpoints with the largest breakpoint set as '' (cached)\n// Useful for components that create breakpoint specific props\n\n/* istanbul ignore next: we don't use this method anywhere, yet */\n\nexport var getBreakpointsDownCached = function getBreakpointsDownCached() {\n var breakpoints = getBreakpointsCached();\n breakpoints[breakpoints.length - 1] = '';\n return breakpoints;\n};","import { RX_ARRAY_NOTATION } from '../constants/regex';\nimport { identity } from './identity';\nimport { isArray, isNull, isObject, isUndefinedOrNull } from './inspect';\n/**\n * Get property defined by dot/array notation in string, returns undefined if not found\n *\n * @link https://gist.github.com/jeneg/9767afdcca45601ea44930ea03e0febf#gistcomment-1935901\n *\n * @param {Object} obj\n * @param {string|Array} path\n * @return {*}\n */\n\nexport var getRaw = function getRaw(obj, path) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n // Handle array of path values\n path = isArray(path) ? path.join('.') : path; // If no path or no object passed\n\n if (!path || !isObject(obj)) {\n return defaultValue;\n } // Handle edge case where user has dot(s) in top-level item field key\n // See https://github.com/bootstrap-vue/bootstrap-vue/issues/2762\n // Switched to `in` operator vs `hasOwnProperty` to handle obj.prototype getters\n // https://github.com/bootstrap-vue/bootstrap-vue/issues/3463\n\n\n if (path in obj) {\n return obj[path];\n } // Handle string array notation (numeric indices only)\n\n\n path = String(path).replace(RX_ARRAY_NOTATION, '.$1');\n var steps = path.split('.').filter(identity); // Handle case where someone passes a string of only dots\n\n if (steps.length === 0) {\n return defaultValue;\n } // Traverse path in object to find result\n // Switched to `in` operator vs `hasOwnProperty` to handle obj.prototype getters\n // https://github.com/bootstrap-vue/bootstrap-vue/issues/3463\n\n\n return steps.every(function (step) {\n return isObject(obj) && step in obj && !isUndefinedOrNull(obj = obj[step]);\n }) ? obj : isNull(obj) ? null : defaultValue;\n};\n/**\n * Get property defined by dot/array notation in string.\n *\n * @link https://gist.github.com/jeneg/9767afdcca45601ea44930ea03e0febf#gistcomment-1935901\n *\n * @param {Object} obj\n * @param {string|Array} path\n * @param {*} defaultValue (optional)\n * @return {*}\n */\n\nexport var get = function get(obj, path) {\n var defaultValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var value = getRaw(obj, path);\n return isUndefinedOrNull(value) ? defaultValue : value;\n};","export var identity = function identity(x) {\n return x;\n};","function _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nimport { RX_NUMBER } from '../constants/regex';\nimport { File } from '../constants/safe-types'; // --- Convenience inspection utilities ---\n\nexport var toType = function toType(value) {\n return _typeof(value);\n};\nexport var toRawType = function toRawType(value) {\n return Object.prototype.toString.call(value).slice(8, -1);\n};\nexport var toRawTypeLC = function toRawTypeLC(value) {\n return toRawType(value).toLowerCase();\n};\nexport var isUndefined = function isUndefined(value) {\n return value === undefined;\n};\nexport var isNull = function isNull(value) {\n return value === null;\n};\nexport var isEmptyString = function isEmptyString(value) {\n return value === '';\n};\nexport var isUndefinedOrNull = function isUndefinedOrNull(value) {\n return isUndefined(value) || isNull(value);\n};\nexport var isUndefinedOrNullOrEmpty = function isUndefinedOrNullOrEmpty(value) {\n return isUndefinedOrNull(value) || isEmptyString(value);\n};\nexport var isFunction = function isFunction(value) {\n return toType(value) === 'function';\n};\nexport var isBoolean = function isBoolean(value) {\n return toType(value) === 'boolean';\n};\nexport var isString = function isString(value) {\n return toType(value) === 'string';\n};\nexport var isNumber = function isNumber(value) {\n return toType(value) === 'number';\n};\nexport var isNumeric = function isNumeric(value) {\n return RX_NUMBER.test(String(value));\n};\nexport var isPrimitive = function isPrimitive(value) {\n return isBoolean(value) || isString(value) || isNumber(value);\n};\nexport var isArray = function isArray(value) {\n return Array.isArray(value);\n}; // Quick object check\n// This is primarily used to tell Objects from primitive values\n// when we know the value is a JSON-compliant type\n// Note object could be a complex type like array, Date, etc.\n\nexport var isObject = function isObject(obj) {\n return obj !== null && _typeof(obj) === 'object';\n}; // Strict object type check\n// Only returns true for plain JavaScript objects\n\nexport var isPlainObject = function isPlainObject(obj) {\n return Object.prototype.toString.call(obj) === '[object Object]';\n};\nexport var isDate = function isDate(value) {\n return value instanceof Date;\n};\nexport var isEvent = function isEvent(value) {\n return value instanceof Event;\n};\nexport var isFile = function isFile(value) {\n return value instanceof File;\n};\nexport var isRegExp = function isRegExp(value) {\n return toRawType(value) === 'RegExp';\n};\nexport var isPromise = function isPromise(value) {\n return !isUndefinedOrNull(value) && isFunction(value.then) && isFunction(value.catch);\n};","// Math utilty functions\nexport var mathMin = Math.min;\nexport var mathMax = Math.max;\nexport var mathAbs = Math.abs;\nexport var mathCeil = Math.ceil;\nexport var mathFloor = Math.floor;\nexport var mathPow = Math.pow;\nexport var mathRound = Math.round;","import { create } from './object';\nexport var memoize = function memoize(fn) {\n var cache = create(null);\n return function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var argsKey = JSON.stringify(args);\n return cache[argsKey] = cache[argsKey] || fn.apply(null, args);\n };\n};","// Number utilities\n// Converts a value (string, number, etc.) to an integer number\n// Assumes radix base 10\nexport var toInteger = function toInteger(value) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;\n var integer = parseInt(value, 10);\n return isNaN(integer) ? defaultValue : integer;\n}; // Converts a value (string, number, etc.) to a number\n\nexport var toFloat = function toFloat(value) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : NaN;\n var float = parseFloat(value);\n return isNaN(float) ? defaultValue : float;\n}; // Converts a value (string, number, etc.) to a string\n// representation with `precision` digits after the decimal\n// Returns the string 'NaN' if the value cannot be converted\n\nexport var toFixed = function toFixed(val, precision) {\n return toFloat(val).toFixed(toInteger(precision, 0));\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { isObject } from './inspect'; // --- Static ---\n\nexport var assign = function assign() {\n return Object.assign.apply(Object, arguments);\n};\nexport var create = function create(proto, optionalProps) {\n return Object.create(proto, optionalProps);\n};\nexport var defineProperties = function defineProperties(obj, props) {\n return Object.defineProperties(obj, props);\n};\nexport var defineProperty = function defineProperty(obj, prop, descriptor) {\n return Object.defineProperty(obj, prop, descriptor);\n};\nexport var freeze = function freeze(obj) {\n return Object.freeze(obj);\n};\nexport var getOwnPropertyNames = function getOwnPropertyNames(obj) {\n return Object.getOwnPropertyNames(obj);\n};\nexport var getOwnPropertyDescriptor = function getOwnPropertyDescriptor(obj, prop) {\n return Object.getOwnPropertyDescriptor(obj, prop);\n};\nexport var getOwnPropertySymbols = function getOwnPropertySymbols(obj) {\n return Object.getOwnPropertySymbols(obj);\n};\nexport var getPrototypeOf = function getPrototypeOf(obj) {\n return Object.getPrototypeOf(obj);\n};\nexport var is = function is(value1, value2) {\n return Object.is(value1, value2);\n};\nexport var isFrozen = function isFrozen(obj) {\n return Object.isFrozen(obj);\n};\nexport var keys = function keys(obj) {\n return Object.keys(obj);\n}; // --- \"Instance\" ---\n\nexport var hasOwnProperty = function hasOwnProperty(obj, prop) {\n return Object.prototype.hasOwnProperty.call(obj, prop);\n};\nexport var toString = function toString(obj) {\n return Object.prototype.toString.call(obj);\n}; // --- Utilities ---\n// Shallow copy an object\n\nexport var clone = function clone(obj) {\n return _objectSpread({}, obj);\n}; // Return a shallow copy of object with the specified properties only\n// See: https://gist.github.com/bisubus/2da8af7e801ffd813fab7ac221aa7afc\n\nexport var pick = function pick(obj, props) {\n return keys(obj).filter(function (key) {\n return props.indexOf(key) !== -1;\n }).reduce(function (result, key) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, obj[key]));\n }, {});\n}; // Return a shallow copy of object with the specified properties omitted\n// See: https://gist.github.com/bisubus/2da8af7e801ffd813fab7ac221aa7afc\n\nexport var omit = function omit(obj, props) {\n return keys(obj).filter(function (key) {\n return props.indexOf(key) === -1;\n }).reduce(function (result, key) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, obj[key]));\n }, {});\n}; // Merges two object deeply together\n// See: https://gist.github.com/Salakar/1d7137de9cb8b704e48a\n\nexport var mergeDeep = function mergeDeep(target, source) {\n if (isObject(target) && isObject(source)) {\n keys(source).forEach(function (key) {\n if (isObject(source[key])) {\n if (!target[key] || !isObject(target[key])) {\n target[key] = source[key];\n }\n\n mergeDeep(target[key], source[key]);\n } else {\n assign(target, _defineProperty({}, key, source[key]));\n }\n });\n }\n\n return target;\n}; // Returns a shallow copy of the object with keys in sorted order\n\nexport var sortKeys = function sortKeys(obj) {\n return keys(obj).sort().reduce(function (result, key) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, obj[key]));\n }, {});\n}; // Convenience method to create a read-only descriptor\n\nexport var readonlyDescriptor = function readonlyDescriptor() {\n return {\n enumerable: true,\n configurable: false,\n writable: false\n };\n};","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nimport { Vue as OurVue } from '../vue';\nimport { NAME, PROP_NAME } from '../constants/config';\nimport { cloneDeep } from './clone-deep';\nimport { getRaw } from './get';\nimport { isArray, isPlainObject, isString, isUndefined } from './inspect';\nimport { getOwnPropertyNames } from './object';\nimport { warn } from './warn'; // Config manager class\n\nvar BvConfig = /*#__PURE__*/function () {\n function BvConfig() {\n _classCallCheck(this, BvConfig);\n\n this.$_config = {};\n } // Method to merge in user config parameters\n\n\n _createClass(BvConfig, [{\n key: \"setConfig\",\n value: function setConfig() {\n var _this = this;\n\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n /* istanbul ignore next */\n if (!isPlainObject(config)) {\n return;\n }\n\n var configKeys = getOwnPropertyNames(config);\n configKeys.forEach(function (key) {\n /* istanbul ignore next */\n var subConfig = config[key];\n\n if (key === 'breakpoints') {\n /* istanbul ignore if */\n if (!isArray(subConfig) || subConfig.length < 2 || subConfig.some(function (b) {\n return !isString(b) || b.length === 0;\n })) {\n warn('\"breakpoints\" must be an array of at least 2 breakpoint names', NAME);\n } else {\n _this.$_config[key] = cloneDeep(subConfig);\n }\n } else if (isPlainObject(subConfig)) {\n // Component prop defaults\n _this.$_config[key] = getOwnPropertyNames(subConfig).reduce(function (config, prop) {\n if (!isUndefined(subConfig[prop])) {\n config[prop] = cloneDeep(subConfig[prop]);\n }\n\n return config;\n }, _this.$_config[key] || {});\n }\n });\n } // Clear the config\n\n }, {\n key: \"resetConfig\",\n value: function resetConfig() {\n this.$_config = {};\n } // Returns a deep copy of the user config\n\n }, {\n key: \"getConfig\",\n value: function getConfig() {\n return cloneDeep(this.$_config);\n } // Returns a deep copy of the config value\n\n }, {\n key: \"getConfigValue\",\n value: function getConfigValue(key) {\n var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n return cloneDeep(getRaw(this.$_config, key, defaultValue));\n }\n }]);\n\n return BvConfig;\n}(); // Method for applying a global config\n\n\nexport var setConfig = function setConfig() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var Vue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : OurVue;\n // Ensure we have a `$bvConfig` Object on the Vue prototype\n // We set on Vue and OurVue just in case consumer has not set an alias of `vue`\n Vue.prototype[PROP_NAME] = OurVue.prototype[PROP_NAME] = Vue.prototype[PROP_NAME] || OurVue.prototype[PROP_NAME] || new BvConfig(); // Apply the config values\n\n Vue.prototype[PROP_NAME].setConfig(config);\n}; // Method for resetting the user config\n// Exported for testing purposes only\n\nexport var resetConfig = function resetConfig() {\n if (OurVue.prototype[PROP_NAME] && OurVue.prototype[PROP_NAME].resetConfig) {\n OurVue.prototype[PROP_NAME].resetConfig();\n }\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { Vue as OurVue } from '../vue';\nimport { HAS_WINDOW_SUPPORT, IS_JSDOM } from '../constants/env';\nimport { setConfig } from './config-set';\nimport { warn } from './warn';\n/**\n * Checks if there are multiple instances of Vue, and warns (once) about possible issues.\n * @param {object} Vue\n */\n\nexport var checkMultipleVue = function () {\n var checkMultipleVueWarned = false;\n var MULTIPLE_VUE_WARNING = ['Multiple instances of Vue detected!', 'You may need to set up an alias for Vue in your bundler config.', 'See: https://bootstrap-vue.org/docs#using-module-bundlers'].join('\\n');\n return function (Vue) {\n /* istanbul ignore next */\n if (!checkMultipleVueWarned && OurVue !== Vue && !IS_JSDOM) {\n warn(MULTIPLE_VUE_WARNING);\n }\n\n checkMultipleVueWarned = true;\n };\n}();\n/**\n * Plugin install factory function.\n * @param {object} { components, directives }\n * @returns {function} plugin install function\n */\n\nexport var installFactory = function installFactory() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n components = _ref.components,\n directives = _ref.directives,\n plugins = _ref.plugins;\n\n var install = function install(Vue) {\n var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (install.installed) {\n /* istanbul ignore next */\n return;\n }\n\n install.installed = true;\n checkMultipleVue(Vue);\n setConfig(config, Vue);\n registerComponents(Vue, components);\n registerDirectives(Vue, directives);\n registerPlugins(Vue, plugins);\n };\n\n install.installed = false;\n return install;\n};\n/**\n * Plugin install factory function (no plugin config option).\n * @param {object} { components, directives }\n * @returns {function} plugin install function\n */\n\nexport var installFactoryNoConfig = function installFactoryNoConfig() {\n var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n components = _ref2.components,\n directives = _ref2.directives,\n plugins = _ref2.plugins;\n\n var install = function install(Vue) {\n if (install.installed) {\n /* istanbul ignore next */\n return;\n }\n\n install.installed = true;\n checkMultipleVue(Vue);\n registerComponents(Vue, components);\n registerDirectives(Vue, directives);\n registerPlugins(Vue, plugins);\n };\n\n install.installed = false;\n return install;\n};\n/**\n * Plugin object factory function.\n * @param {object} { components, directives, plugins }\n * @returns {object} plugin install object\n */\n\nexport var pluginFactory = function pluginFactory() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var extend = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return _objectSpread(_objectSpread({}, extend), {}, {\n install: installFactory(options)\n });\n};\n/**\n * Plugin object factory function (no config option).\n * @param {object} { components, directives, plugins }\n * @returns {object} plugin install object\n */\n\nexport var pluginFactoryNoConfig = function pluginFactoryNoConfig() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var extend = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return _objectSpread(_objectSpread({}, extend), {}, {\n install: installFactoryNoConfig(options)\n });\n};\n/**\n * Load a group of plugins.\n * @param {object} Vue\n * @param {object} Plugin definitions\n */\n\nexport var registerPlugins = function registerPlugins(Vue) {\n var plugins = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n for (var plugin in plugins) {\n if (plugin && plugins[plugin]) {\n Vue.use(plugins[plugin]);\n }\n }\n};\n/**\n * Load a component.\n * @param {object} Vue\n * @param {string} Component name\n * @param {object} Component definition\n */\n\nexport var registerComponent = function registerComponent(Vue, name, def) {\n if (Vue && name && def) {\n Vue.component(name, def);\n }\n};\n/**\n * Load a group of components.\n * @param {object} Vue\n * @param {object} Object of component definitions\n */\n\nexport var registerComponents = function registerComponents(Vue) {\n var components = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n for (var component in components) {\n registerComponent(Vue, component, components[component]);\n }\n};\n/**\n * Load a directive.\n * @param {object} Vue\n * @param {string} Directive name\n * @param {object} Directive definition\n */\n\nexport var registerDirective = function registerDirective(Vue, name, def) {\n if (Vue && name && def) {\n // Ensure that any leading V is removed from the\n // name, as Vue adds it automatically\n Vue.directive(name.replace(/^VB/, 'B'), def);\n }\n};\n/**\n * Load a group of directives.\n * @param {object} Vue\n * @param {object} Object of directive definitions\n */\n\nexport var registerDirectives = function registerDirectives(Vue) {\n var directives = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n for (var directive in directives) {\n registerDirective(Vue, directive, directives[directive]);\n }\n};\n/**\n * Install plugin if window.Vue available\n * @param {object} Plugin definition\n */\n\nexport var vueUse = function vueUse(VuePlugin) {\n /* istanbul ignore next */\n if (HAS_WINDOW_SUPPORT && window.Vue) {\n window.Vue.use(VuePlugin);\n }\n /* istanbul ignore next */\n\n\n if (HAS_WINDOW_SUPPORT && VuePlugin.NAME) {\n window[VuePlugin.NAME] = VuePlugin;\n }\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { PROP_TYPE_ANY } from '../constants/props';\nimport { cloneDeep } from './clone-deep';\nimport { getComponentConfig } from './config';\nimport { identity } from './identity';\nimport { isArray, isFunction, isObject, isUndefined } from './inspect';\nimport { clone, hasOwnProperty, keys } from './object';\nimport { lowerFirst, upperFirst } from './string'; // Prefix a property\n\nexport var prefixPropName = function prefixPropName(prefix, value) {\n return prefix + upperFirst(value);\n}; // Remove a prefix from a property\n\nexport var unprefixPropName = function unprefixPropName(prefix, value) {\n return lowerFirst(value.replace(prefix, ''));\n}; // Suffix can be a falsey value so nothing is appended to string\n// (helps when looping over props & some shouldn't change)\n// Use data last parameters to allow for currying\n\nexport var suffixPropName = function suffixPropName(suffix, value) {\n return value + (suffix ? upperFirst(suffix) : '');\n}; // Generates a prop object\n\nexport var makeProp = function makeProp() {\n var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : PROP_TYPE_ANY;\n var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n var requiredOrValidator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;\n var validator = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;\n var required = requiredOrValidator === true;\n validator = required ? validator : requiredOrValidator;\n return _objectSpread(_objectSpread(_objectSpread({}, type ? {\n type: type\n } : {}), required ? {\n required: required\n } : isUndefined(value) ? {} : {\n default: isObject(value) ? function () {\n return value;\n } : value\n }), isUndefined(validator) ? {} : {\n validator: validator\n });\n}; // Copies props from one array/object to a new array/object\n// Prop values are also cloned as new references to prevent possible\n// mutation of original prop object values\n// Optionally accepts a function to transform the prop name\n\nexport var copyProps = function copyProps(props) {\n var transformFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : identity;\n\n if (isArray(props)) {\n return props.map(transformFn);\n }\n\n var copied = {};\n\n for (var prop in props) {\n /* istanbul ignore else */\n if (hasOwnProperty(props, prop)) {\n // If the prop value is an object, do a shallow clone\n // to prevent potential mutations to the original object\n copied[transformFn(prop)] = isObject(props[prop]) ? clone(props[prop]) : props[prop];\n }\n }\n\n return copied;\n}; // Given an array of properties or an object of property keys,\n// plucks all the values off the target object, returning a new object\n// that has props that reference the original prop values\n\nexport var pluckProps = function pluckProps(keysToPluck, objToPluck) {\n var transformFn = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : identity;\n return (isArray(keysToPluck) ? keysToPluck.slice() : keys(keysToPluck)).reduce(function (memo, prop) {\n memo[transformFn(prop)] = objToPluck[prop];\n return memo;\n }, {});\n}; // Make a prop object configurable by global configuration\n// Replaces the current `default` key of each prop with a `getComponentConfig()`\n// call that falls back to the current default value of the prop\n\nexport var makePropConfigurable = function makePropConfigurable(prop, key, componentKey) {\n return _objectSpread(_objectSpread({}, cloneDeep(prop)), {}, {\n default: function bvConfigurablePropDefault() {\n var value = getComponentConfig(componentKey, key, prop.default);\n return isFunction(value) ? value() : value;\n }\n });\n}; // Make a props object configurable by global configuration\n// Replaces the current `default` key of each prop with a `getComponentConfig()`\n// call that falls back to the current default value of the prop\n\nexport var makePropsConfigurable = function makePropsConfigurable(props, componentKey) {\n return keys(props).reduce(function (result, key) {\n return _objectSpread(_objectSpread({}, result), {}, _defineProperty({}, key, makePropConfigurable(props[key], key, componentKey)));\n }, {});\n}; // Get function name we use in `makePropConfigurable()`\n// for the prop default value override to compare\n// against in `hasPropFunction()`\n\nvar configurablePropDefaultFnName = makePropConfigurable({}, '', '').default.name; // Detect wether the given value is currently a function\n// and isn't the props default function\n\nexport var hasPropFunction = function hasPropFunction(fn) {\n return isFunction(fn) && fn.name && fn.name !== configurablePropDefaultFnName;\n};","// String utilities\nimport { RX_HYPHENATE, RX_LOWER_UPPER, RX_REGEXP_REPLACE, RX_START_SPACE_WORD, RX_TRIM_LEFT, RX_TRIM_RIGHT, RX_UNDERSCORE, RX_UN_KEBAB } from '../constants/regex';\nimport { isArray, isPlainObject, isString, isUndefinedOrNull } from './inspect'; // --- Utilities ---\n// Converts PascalCase or camelCase to kebab-case\n\nexport var kebabCase = function kebabCase(str) {\n return str.replace(RX_HYPHENATE, '-$1').toLowerCase();\n}; // Converts a kebab-case or camelCase string to PascalCase\n\nexport var pascalCase = function pascalCase(str) {\n str = kebabCase(str).replace(RX_UN_KEBAB, function (_, c) {\n return c ? c.toUpperCase() : '';\n });\n return str.charAt(0).toUpperCase() + str.slice(1);\n}; // Converts a string, including strings in camelCase or snake_case, into Start Case\n// It keeps original single quote and hyphen in the word\n// https://github.com/UrbanCompass/to-start-case\n\nexport var startCase = function startCase(str) {\n return str.replace(RX_UNDERSCORE, ' ').replace(RX_LOWER_UPPER, function (str, $1, $2) {\n return $1 + ' ' + $2;\n }).replace(RX_START_SPACE_WORD, function (str, $1, $2) {\n return $1 + $2.toUpperCase();\n });\n}; // Lowercases the first letter of a string and returns a new string\n\nexport var lowerFirst = function lowerFirst(str) {\n str = isString(str) ? str.trim() : String(str);\n return str.charAt(0).toLowerCase() + str.slice(1);\n}; // Uppercases the first letter of a string and returns a new string\n\nexport var upperFirst = function upperFirst(str) {\n str = isString(str) ? str.trim() : String(str);\n return str.charAt(0).toUpperCase() + str.slice(1);\n}; // Escape characters to be used in building a regular expression\n\nexport var escapeRegExp = function escapeRegExp(str) {\n return str.replace(RX_REGEXP_REPLACE, '\\\\$&');\n}; // Convert a value to a string that can be rendered\n// `undefined`/`null` will be converted to `''`\n// Plain objects and arrays will be JSON stringified\n\nexport var toString = function toString(val) {\n var spaces = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;\n return isUndefinedOrNull(val) ? '' : isArray(val) || isPlainObject(val) && val.toString === Object.prototype.toString ? JSON.stringify(val, null, spaces) : String(val);\n}; // Remove leading white space from a string\n\nexport var trimLeft = function trimLeft(str) {\n return toString(str).replace(RX_TRIM_LEFT, '');\n}; // Remove Trailing white space from a string\n\nexport var trimRight = function trimRight(str) {\n return toString(str).replace(RX_TRIM_RIGHT, '');\n}; // Remove leading and trailing white space from a string\n\nexport var trim = function trim(str) {\n return toString(str).trim();\n}; // Lower case a string\n\nexport var lowerCase = function lowerCase(str) {\n return toString(str).toLowerCase();\n}; // Upper case a string\n\nexport var upperCase = function upperCase(str) {\n return toString(str).toUpperCase();\n};","/**\n * Utilities to get information about the current environment\n */\nexport var getEnv = function getEnv(key) {\n var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var env = typeof process !== 'undefined' && process ? process.env || {} : {};\n\n if (!key) {\n /* istanbul ignore next */\n return env;\n }\n\n return env[key] || fallback;\n};\nexport var getNoWarn = function getNoWarn() {\n return getEnv('BOOTSTRAP_VUE_NO_WARN') || getEnv('NODE_ENV') === 'production';\n};","import { IS_BROWSER, HAS_PROMISE_SUPPORT, HAS_MUTATION_OBSERVER_SUPPORT } from '../constants/env';\nimport { getNoWarn } from './env';\n/**\n * Log a warning message to the console with BootstrapVue formatting\n * @param {string} message\n */\n\nexport var warn = function warn(message)\n/* istanbul ignore next */\n{\n var source = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n\n if (!getNoWarn()) {\n console.warn(\"[BootstrapVue warn]: \".concat(source ? \"\".concat(source, \" - \") : '').concat(message));\n }\n};\n/**\n * Warn when no Promise support is given\n * @param {string} source\n * @returns {boolean} warned\n */\n\nexport var warnNotClient = function warnNotClient(source) {\n /* istanbul ignore else */\n if (IS_BROWSER) {\n return false;\n } else {\n warn(\"\".concat(source, \": Can not be called during SSR.\"));\n return true;\n }\n};\n/**\n * Warn when no Promise support is given\n * @param {string} source\n * @returns {boolean} warned\n */\n\nexport var warnNoPromiseSupport = function warnNoPromiseSupport(source) {\n /* istanbul ignore else */\n if (HAS_PROMISE_SUPPORT) {\n return false;\n } else {\n warn(\"\".concat(source, \": Requires Promise support.\"));\n return true;\n }\n};\n/**\n * Warn when no MutationObserver support is given\n * @param {string} source\n * @returns {boolean} warned\n */\n\nexport var warnNoMutationObserverSupport = function warnNoMutationObserverSupport(source) {\n /* istanbul ignore else */\n if (HAS_MUTATION_OBSERVER_SUPPORT) {\n return false;\n } else {\n warn(\"\".concat(source, \": Requires MutationObserver support.\"));\n return true;\n }\n};","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nimport Vue from 'vue';\nimport { mergeData } from 'vue-functional-data-merge'; // --- Constants ---\n\nvar COMPONENT_UID_KEY = '_uid';\nvar isVue3 = Vue.version.startsWith('3');\nexport var REF_FOR_KEY = isVue3 ? 'ref_for' : 'refInFor';\nvar ALLOWED_FIELDS_IN_DATA = ['class', 'staticClass', 'style', 'attrs', 'props', 'domProps', 'on', 'nativeOn', 'directives', 'scopedSlots', 'slot', 'key', 'ref', 'refInFor'];\nvar extend = Vue.extend.bind(Vue);\n\nif (isVue3) {\n var originalExtend = Vue.extend;\n var KNOWN_COMPONENTS = ['router-link', 'transition', 'transition-group'];\n var originalVModelDynamicCreated = Vue.vModelDynamic.created;\n var originalVModelDynamicBeforeUpdate = Vue.vModelDynamic.beforeUpdate; // See https://github.com/vuejs/vue-next/pull/4121 for details\n\n Vue.vModelDynamic.created = function (el, binding, vnode) {\n originalVModelDynamicCreated.call(this, el, binding, vnode);\n\n if (!el._assign) {\n el._assign = function () {};\n }\n };\n\n Vue.vModelDynamic.beforeUpdate = function (el, binding, vnode) {\n originalVModelDynamicBeforeUpdate.call(this, el, binding, vnode);\n\n if (!el._assign) {\n el._assign = function () {};\n }\n };\n\n extend = function patchedBootstrapVueExtend(definition) {\n if (_typeof(definition) === 'object' && definition.render && !definition.__alreadyPatched) {\n var originalRender = definition.render;\n definition.__alreadyPatched = true;\n\n definition.render = function (h) {\n var patchedH = function patchedH(tag, dataObjOrChildren, rawSlots) {\n var slots = rawSlots === undefined ? [] : [Array.isArray(rawSlots) ? rawSlots.filter(Boolean) : rawSlots];\n var isTag = typeof tag === 'string' && !KNOWN_COMPONENTS.includes(tag);\n var isSecondArgumentDataObject = dataObjOrChildren && _typeof(dataObjOrChildren) === 'object' && !Array.isArray(dataObjOrChildren);\n\n if (!isSecondArgumentDataObject) {\n return h.apply(void 0, [tag, dataObjOrChildren].concat(slots));\n }\n\n var attrs = dataObjOrChildren.attrs,\n props = dataObjOrChildren.props,\n restData = _objectWithoutProperties(dataObjOrChildren, [\"attrs\", \"props\"]);\n\n var normalizedData = _objectSpread(_objectSpread({}, restData), {}, {\n attrs: attrs,\n props: isTag ? {} : props\n });\n\n if (tag === 'router-link' && !normalizedData.slots && !normalizedData.scopedSlots) {\n // terrible workaround to fix router-link rendering with compat vue-router\n normalizedData.scopedSlots = {\n $hasNormal: function $hasNormal() {}\n };\n }\n\n return h.apply(void 0, [tag, normalizedData].concat(slots));\n };\n\n if (definition.functional) {\n var _ctx$children, _ctx$children$default;\n\n var ctx = arguments[1];\n\n var patchedCtx = _objectSpread({}, ctx);\n\n patchedCtx.data = {\n attrs: _objectSpread({}, ctx.data.attrs || {}),\n props: _objectSpread({}, ctx.data.props || {})\n };\n Object.keys(ctx.data || {}).forEach(function (key) {\n if (ALLOWED_FIELDS_IN_DATA.includes(key)) {\n patchedCtx.data[key] = ctx.data[key];\n } else if (key in ctx.props) {\n patchedCtx.data.props[key] = ctx.data[key];\n } else if (!key.startsWith('on')) {\n patchedCtx.data.attrs[key] = ctx.data[key];\n }\n });\n var IGNORED_CHILDREN_KEYS = ['_ctx'];\n var children = ((_ctx$children = ctx.children) === null || _ctx$children === void 0 ? void 0 : (_ctx$children$default = _ctx$children.default) === null || _ctx$children$default === void 0 ? void 0 : _ctx$children$default.call(_ctx$children)) || ctx.children;\n\n if (children && Object.keys(patchedCtx.children).filter(function (k) {\n return !IGNORED_CHILDREN_KEYS.includes(k);\n }).length === 0) {\n delete patchedCtx.children;\n } else {\n patchedCtx.children = children;\n }\n\n patchedCtx.data.on = ctx.listeners;\n return originalRender.call(this, patchedH, patchedCtx);\n }\n\n return originalRender.call(this, patchedH);\n };\n }\n\n return originalExtend.call(this, definition);\n }.bind(Vue);\n}\n\nvar nextTick = Vue.nextTick;\nexport { COMPONENT_UID_KEY, Vue, mergeData, isVue3, nextTick, extend };","/*!\n * FilePondPluginFileValidateType 1.2.9\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n\n(function(global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n ? (module.exports = factory())\n : typeof define === 'function' && define.amd\n ? define(factory)\n : ((global = global || self), (global.FilePondPluginFileValidateType = factory()));\n})(this, function() {\n 'use strict';\n\n var plugin = function plugin(_ref) {\n var addFilter = _ref.addFilter,\n utils = _ref.utils;\n // get quick reference to Type utils\n var Type = utils.Type,\n isString = utils.isString,\n replaceInString = utils.replaceInString,\n guesstimateMimeType = utils.guesstimateMimeType,\n getExtensionFromFilename = utils.getExtensionFromFilename,\n getFilenameFromURL = utils.getFilenameFromURL;\n\n var mimeTypeMatchesWildCard = function mimeTypeMatchesWildCard(mimeType, wildcard) {\n var mimeTypeGroup = (/^[^/]+/.exec(mimeType) || []).pop(); // image/png -> image\n var wildcardGroup = wildcard.slice(0, -2); // image/* -> image\n return mimeTypeGroup === wildcardGroup;\n };\n\n var isValidMimeType = function isValidMimeType(acceptedTypes, userInputType) {\n return acceptedTypes.some(function(acceptedType) {\n // accepted is wildcard mime type\n if (/\\*$/.test(acceptedType)) {\n return mimeTypeMatchesWildCard(userInputType, acceptedType);\n }\n\n // is normal mime type\n return acceptedType === userInputType;\n });\n };\n\n var getItemType = function getItemType(item) {\n // if the item is a url we guess the mime type by the extension\n var type = '';\n if (isString(item)) {\n var filename = getFilenameFromURL(item);\n var extension = getExtensionFromFilename(filename);\n if (extension) {\n type = guesstimateMimeType(extension);\n }\n } else {\n type = item.type;\n }\n\n return type;\n };\n\n var validateFile = function validateFile(item, acceptedFileTypes, typeDetector) {\n // no types defined, everything is allowed \\o/\n if (acceptedFileTypes.length === 0) {\n return true;\n }\n\n // gets the item type\n var type = getItemType(item);\n\n // no type detector, test now\n if (!typeDetector) {\n return isValidMimeType(acceptedFileTypes, type);\n }\n\n // use type detector\n return new Promise(function(resolve, reject) {\n typeDetector(item, type)\n .then(function(detectedType) {\n if (isValidMimeType(acceptedFileTypes, detectedType)) {\n resolve();\n } else {\n reject();\n }\n })\n .catch(reject);\n });\n };\n\n var applyMimeTypeMap = function applyMimeTypeMap(map) {\n return function(acceptedFileType) {\n return map[acceptedFileType] === null\n ? false\n : map[acceptedFileType] || acceptedFileType;\n };\n };\n\n // setup attribute mapping for accept\n addFilter('SET_ATTRIBUTE_TO_OPTION_MAP', function(map) {\n return Object.assign(map, {\n accept: 'acceptedFileTypes',\n });\n });\n\n // filtering if an item is allowed in hopper\n addFilter('ALLOW_HOPPER_ITEM', function(file, _ref2) {\n var query = _ref2.query;\n // if we are not doing file type validation exit\n if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {\n return true;\n }\n\n // we validate the file against the accepted file types\n return validateFile(file, query('GET_ACCEPTED_FILE_TYPES'));\n });\n\n // called for each file that is loaded\n // right before it is set to the item state\n // should return a promise\n addFilter('LOAD_FILE', function(file, _ref3) {\n var query = _ref3.query;\n return new Promise(function(resolve, reject) {\n if (!query('GET_ALLOW_FILE_TYPE_VALIDATION')) {\n resolve(file);\n return;\n }\n\n var acceptedFileTypes = query('GET_ACCEPTED_FILE_TYPES');\n\n // custom type detector method\n var typeDetector = query('GET_FILE_VALIDATE_TYPE_DETECT_TYPE');\n\n // if invalid, exit here\n var validationResult = validateFile(file, acceptedFileTypes, typeDetector);\n\n var handleRejection = function handleRejection() {\n var acceptedFileTypesMapped = acceptedFileTypes\n .map(\n applyMimeTypeMap(\n query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES_MAP')\n )\n )\n .filter(function(label) {\n return label !== false;\n });\n\n var acceptedFileTypesMappedUnique = acceptedFileTypesMapped.filter(function(\n item,\n index\n ) {\n return acceptedFileTypesMapped.indexOf(item) === index;\n });\n\n reject({\n status: {\n main: query('GET_LABEL_FILE_TYPE_NOT_ALLOWED'),\n sub: replaceInString(\n query('GET_FILE_VALIDATE_TYPE_LABEL_EXPECTED_TYPES'),\n {\n allTypes: acceptedFileTypesMappedUnique.join(', '),\n allButLastType: acceptedFileTypesMappedUnique\n .slice(0, -1)\n .join(', '),\n lastType:\n acceptedFileTypesMappedUnique[\n acceptedFileTypesMappedUnique.length - 1\n ],\n }\n ),\n },\n });\n };\n\n // has returned new filename immidiately\n if (typeof validationResult === 'boolean') {\n if (!validationResult) {\n return handleRejection();\n }\n return resolve(file);\n }\n\n // is promise\n validationResult\n .then(function() {\n resolve(file);\n })\n .catch(handleRejection);\n });\n });\n\n // expose plugin\n return {\n // default options\n options: {\n // Enable or disable file type validation\n allowFileTypeValidation: [true, Type.BOOLEAN],\n\n // What file types to accept\n acceptedFileTypes: [[], Type.ARRAY],\n // - must be comma separated\n // - mime types: image/png, image/jpeg, image/gif\n // - extensions: .png, .jpg, .jpeg ( not enabled yet )\n // - wildcards: image/*\n\n // label to show when a type is not allowed\n labelFileTypeNotAllowed: ['File is of invalid type', Type.STRING],\n\n // nicer label\n fileValidateTypeLabelExpectedTypes: [\n 'Expects {allButLastType} or {lastType}',\n Type.STRING,\n ],\n\n // map mime types to extensions\n fileValidateTypeLabelExpectedTypesMap: [{}, Type.OBJECT],\n\n // Custom function to detect type of file\n fileValidateTypeDetectType: [null, Type.FUNCTION],\n },\n };\n };\n\n // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags\n var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n if (isBrowser) {\n document.dispatchEvent(new CustomEvent('FilePond:pluginloaded', { detail: plugin }));\n }\n\n return plugin;\n});\n","/*!\n * FilePondPluginImagePreview 4.6.12\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n\n(function(global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n ? (module.exports = factory())\n : typeof define === 'function' && define.amd\n ? define(factory)\n : ((global = global || self),\n (global.FilePondPluginImagePreview = factory()));\n})(this, function() {\n 'use strict';\n\n // test if file is of type image and can be viewed in canvas\n var isPreviewableImage = function isPreviewableImage(file) {\n return /^image/.test(file.type);\n };\n\n function _typeof(obj) {\n if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {\n _typeof = function(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function(obj) {\n return obj &&\n typeof Symbol === 'function' &&\n obj.constructor === Symbol &&\n obj !== Symbol.prototype\n ? 'symbol'\n : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n var REACT_ELEMENT_TYPE;\n\n function _jsx(type, props, key, children) {\n if (!REACT_ELEMENT_TYPE) {\n REACT_ELEMENT_TYPE =\n (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n }\n\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n props = {\n children: void 0\n };\n }\n\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = new Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null\n };\n }\n\n function _asyncIterator(iterable) {\n var method;\n\n if (typeof Symbol === 'function') {\n if (Symbol.asyncIterator) {\n method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n\n if (Symbol.iterator) {\n method = iterable[Symbol.iterator];\n if (method != null) return method.call(iterable);\n }\n }\n\n throw new TypeError('Object is not async iterable');\n }\n\n function _AwaitValue(value) {\n this.wrapped = value;\n }\n\n function _AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function(resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg);\n var value = result.value;\n var wrappedAwait = value instanceof _AwaitValue;\n Promise.resolve(wrappedAwait ? value.wrapped : value).then(\n function(arg) {\n if (wrappedAwait) {\n resume('next', arg);\n return;\n }\n\n settle(result.done ? 'return' : 'normal', arg);\n },\n function(err) {\n resume('throw', err);\n }\n );\n } catch (err) {\n settle('throw', err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case 'return':\n front.resolve({\n value: value,\n done: true\n });\n break;\n\n case 'throw':\n front.reject(value);\n break;\n\n default:\n front.resolve({\n value: value,\n done: false\n });\n break;\n }\n\n front = front.next;\n\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n if (typeof gen.return !== 'function') {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === 'function' && Symbol.asyncIterator) {\n _AsyncGenerator.prototype[Symbol.asyncIterator] = function() {\n return this;\n };\n }\n\n _AsyncGenerator.prototype.next = function(arg) {\n return this._invoke('next', arg);\n };\n\n _AsyncGenerator.prototype.throw = function(arg) {\n return this._invoke('throw', arg);\n };\n\n _AsyncGenerator.prototype.return = function(arg) {\n return this._invoke('return', arg);\n };\n\n function _wrapAsyncGenerator(fn) {\n return function() {\n return new _AsyncGenerator(fn.apply(this, arguments));\n };\n }\n\n function _awaitAsyncGenerator(value) {\n return new _AwaitValue(value);\n }\n\n function _asyncGeneratorDelegate(inner, awaitWrap) {\n var iter = {},\n waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function(resolve) {\n resolve(inner[key](value));\n });\n return {\n done: false,\n value: awaitWrap(value)\n };\n }\n\n if (typeof Symbol === 'function' && Symbol.iterator) {\n iter[Symbol.iterator] = function() {\n return this;\n };\n }\n\n iter.next = function(value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n\n return pump('next', value);\n };\n\n if (typeof inner.throw === 'function') {\n iter.throw = function(value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n\n return pump('throw', value);\n };\n }\n\n if (typeof inner.return === 'function') {\n iter.return = function(value) {\n return pump('return', value);\n };\n }\n\n return iter;\n }\n\n function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n }\n\n function _asyncToGenerator(fn) {\n return function() {\n var self = this,\n args = arguments;\n return new Promise(function(resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(\n gen,\n resolve,\n reject,\n _next,\n _throw,\n 'next',\n value\n );\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);\n }\n\n _next(undefined);\n });\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _defineEnumerableProperties(obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if ('value' in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n\n if (Object.getOwnPropertySymbols) {\n var objectSymbols = Object.getOwnPropertySymbols(descs);\n\n for (var i = 0; i < objectSymbols.length; i++) {\n var sym = objectSymbols[i];\n var desc = descs[sym];\n desc.configurable = desc.enumerable = true;\n if ('value' in desc) desc.writable = true;\n Object.defineProperty(obj, sym, desc);\n }\n }\n\n return obj;\n }\n\n function _defaults(obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n\n return obj;\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function _extends() {\n _extends =\n Object.assign ||\n function(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n }\n\n function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(\n Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n })\n );\n }\n\n ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function');\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf\n ? Object.getPrototypeOf\n : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf =\n Object.setPrototypeOf ||\n function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function isNativeReflectConstruct() {\n if (typeof Reflect === 'undefined' || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === 'function') return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n }\n\n function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n }\n\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf('[native code]') !== -1;\n }\n\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map === 'function' ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== 'function') {\n throw new TypeError(\n 'Super expression must either be null or a function'\n );\n }\n\n if (typeof _cache !== 'undefined') {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n }\n\n function _instanceof(left, right) {\n if (\n right != null &&\n typeof Symbol !== 'undefined' &&\n right[Symbol.hasInstance]\n ) {\n return right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n }\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule\n ? obj\n : {\n default: obj\n };\n }\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc =\n Object.defineProperty && Object.getOwnPropertyDescriptor\n ? Object.getOwnPropertyDescriptor(obj, key)\n : {};\n\n if (desc.get || desc.set) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n }\n\n newObj.default = obj;\n return newObj;\n }\n }\n\n function _newArrowCheck(innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError('Cannot instantiate an arrow function');\n }\n }\n\n function _objectDestructuringEmpty(obj) {\n if (obj == null) throw new TypeError('Cannot destructure undefined');\n }\n\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n\n function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\n \"this hasn't been initialised - super() hasn't been called\"\n );\n }\n\n return self;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (typeof call === 'object' || typeof call === 'function')) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n }\n\n function _get(target, property, receiver) {\n if (typeof Reflect !== 'undefined' && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n }\n\n function set(target, property, value, receiver) {\n if (typeof Reflect !== 'undefined' && Reflect.set) {\n set = Reflect.set;\n } else {\n set = function set(target, property, value, receiver) {\n var base = _superPropBase(target, property);\n\n var desc;\n\n if (base) {\n desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.set) {\n desc.set.call(receiver, value);\n return true;\n } else if (!desc.writable) {\n return false;\n }\n }\n\n desc = Object.getOwnPropertyDescriptor(receiver, property);\n\n if (desc) {\n if (!desc.writable) {\n return false;\n }\n\n desc.value = value;\n Object.defineProperty(receiver, property, desc);\n } else {\n _defineProperty(receiver, property, value);\n }\n\n return true;\n };\n }\n\n return set(target, property, value, receiver);\n }\n\n function _set(target, property, value, receiver, isStrict) {\n var s = set(target, property, value, receiver || target);\n\n if (!s && isStrict) {\n throw new Error('failed to set property');\n }\n\n return value;\n }\n\n function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n return Object.freeze(\n Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n })\n );\n }\n\n function _taggedTemplateLiteralLoose(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n strings.raw = raw;\n return strings;\n }\n\n function _temporalRef(val, name) {\n if (val === _temporalUndefined) {\n throw new ReferenceError(name + ' is not defined - temporal dead zone');\n } else {\n return val;\n }\n }\n\n function _readOnlyError(name) {\n throw new Error('\"' + name + '\" is read-only');\n }\n\n function _classNameTDZError(name) {\n throw new Error(\n 'Class \"' + name + '\" cannot be referenced in computed property keys.'\n );\n }\n\n var _temporalUndefined = {};\n\n function _slicedToArray(arr, i) {\n return (\n _arrayWithHoles(arr) ||\n _iterableToArrayLimit(arr, i) ||\n _nonIterableRest()\n );\n }\n\n function _slicedToArrayLoose(arr, i) {\n return (\n _arrayWithHoles(arr) ||\n _iterableToArrayLimitLoose(arr, i) ||\n _nonIterableRest()\n );\n }\n\n function _toArray(arr) {\n return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest();\n }\n\n function _toConsumableArray(arr) {\n return (\n _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread()\n );\n }\n\n function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++)\n arr2[i] = arr[i];\n\n return arr2;\n }\n }\n\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n\n function _iterableToArray(iter) {\n if (\n Symbol.iterator in Object(iter) ||\n Object.prototype.toString.call(iter) === '[object Arguments]'\n )\n return Array.from(iter);\n }\n\n function _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (\n var _i = arr[Symbol.iterator](), _s;\n !(_n = (_s = _i.next()).done);\n _n = true\n ) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i['return'] != null) _i['return']();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n function _iterableToArrayLimitLoose(arr, i) {\n var _arr = [];\n\n for (\n var _iterator = arr[Symbol.iterator](), _step;\n !(_step = _iterator.next()).done;\n\n ) {\n _arr.push(_step.value);\n\n if (i && _arr.length === i) break;\n }\n\n return _arr;\n }\n\n function _nonIterableSpread() {\n throw new TypeError('Invalid attempt to spread non-iterable instance');\n }\n\n function _nonIterableRest() {\n throw new TypeError('Invalid attempt to destructure non-iterable instance');\n }\n\n function _skipFirstGeneratorNext(fn) {\n return function() {\n var it = fn.apply(this, arguments);\n it.next();\n return it;\n };\n }\n\n function _toPrimitive(input, hint) {\n if (typeof input !== 'object' || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n\n if (prim !== undefined) {\n var res = prim.call(input, hint || 'default');\n if (typeof res !== 'object') return res;\n throw new TypeError('@@toPrimitive must return a primitive value.');\n }\n\n return (hint === 'string' ? String : Number)(input);\n }\n\n function _toPropertyKey(arg) {\n var key = _toPrimitive(arg, 'string');\n\n return typeof key === 'symbol' ? key : String(key);\n }\n\n function _initializerWarningHelper(descriptor, context) {\n throw new Error(\n 'Decorating class property failed. Please ensure that ' +\n 'proposal-class-properties is enabled and set to use loose mode. ' +\n 'To use proposal-class-properties in spec mode with decorators, wait for ' +\n 'the next major version of decorators in stage 2.'\n );\n }\n\n function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer\n ? descriptor.initializer.call(context)\n : void 0\n });\n }\n\n function _applyDecoratedDescriptor(\n target,\n property,\n decorators,\n descriptor,\n context\n ) {\n var desc = {};\n Object.keys(descriptor).forEach(function(key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators\n .slice()\n .reverse()\n .reduce(function(desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n\n var id = 0;\n\n function _classPrivateFieldLooseKey(name) {\n return '__private_' + id++ + '_' + name;\n }\n\n function _classPrivateFieldLooseBase(receiver, privateKey) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError('attempted to use private field on non-instance');\n }\n\n return receiver;\n }\n\n function _classPrivateFieldGet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError('attempted to get private field on non-instance');\n }\n\n var descriptor = privateMap.get(receiver);\n\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n\n return descriptor.value;\n }\n\n function _classPrivateFieldSet(receiver, privateMap, value) {\n if (!privateMap.has(receiver)) {\n throw new TypeError('attempted to set private field on non-instance');\n }\n\n var descriptor = privateMap.get(receiver);\n\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n throw new TypeError('attempted to set read only private field');\n }\n\n descriptor.value = value;\n }\n\n return value;\n }\n\n function _classStaticPrivateFieldSpecGet(\n receiver,\n classConstructor,\n descriptor\n ) {\n if (receiver !== classConstructor) {\n throw new TypeError('Private static access of wrong provenance');\n }\n\n return descriptor.value;\n }\n\n function _classStaticPrivateFieldSpecSet(\n receiver,\n classConstructor,\n descriptor,\n value\n ) {\n if (receiver !== classConstructor) {\n throw new TypeError('Private static access of wrong provenance');\n }\n\n if (!descriptor.writable) {\n throw new TypeError('attempted to set read only private field');\n }\n\n descriptor.value = value;\n return value;\n }\n\n function _classStaticPrivateMethodGet(receiver, classConstructor, method) {\n if (receiver !== classConstructor) {\n throw new TypeError('Private static access of wrong provenance');\n }\n\n return method;\n }\n\n function _classStaticPrivateMethodSet() {\n throw new TypeError('attempted to set read only static private field');\n }\n\n function _decorate(decorators, factory, superClass, mixins) {\n var api = _getDecoratorsApi();\n\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n api = mixins[i](api);\n }\n }\n\n var r = factory(function initialize(O) {\n api.initializeInstanceElements(O, decorated.elements);\n }, superClass);\n var decorated = api.decorateClass(\n _coalesceClassElements(r.d.map(_createElementDescriptor)),\n decorators\n );\n api.initializeClassElements(r.F, decorated.elements);\n return api.runClassFinishers(r.F, decorated.finishers);\n }\n\n function _getDecoratorsApi() {\n _getDecoratorsApi = function() {\n return api;\n };\n\n var api = {\n elementsDefinitionOrder: [['method'], ['field']],\n initializeInstanceElements: function(O, elements) {\n ['method', 'field'].forEach(function(kind) {\n elements.forEach(function(element) {\n if (element.kind === kind && element.placement === 'own') {\n this.defineClassElement(O, element);\n }\n }, this);\n }, this);\n },\n initializeClassElements: function(F, elements) {\n var proto = F.prototype;\n ['method', 'field'].forEach(function(kind) {\n elements.forEach(function(element) {\n var placement = element.placement;\n\n if (\n element.kind === kind &&\n (placement === 'static' || placement === 'prototype')\n ) {\n var receiver = placement === 'static' ? F : proto;\n this.defineClassElement(receiver, element);\n }\n }, this);\n }, this);\n },\n defineClassElement: function(receiver, element) {\n var descriptor = element.descriptor;\n\n if (element.kind === 'field') {\n var initializer = element.initializer;\n descriptor = {\n enumerable: descriptor.enumerable,\n writable: descriptor.writable,\n configurable: descriptor.configurable,\n value: initializer === void 0 ? void 0 : initializer.call(receiver)\n };\n }\n\n Object.defineProperty(receiver, element.key, descriptor);\n },\n decorateClass: function(elements, decorators) {\n var newElements = [];\n var finishers = [];\n var placements = {\n static: [],\n prototype: [],\n own: []\n };\n elements.forEach(function(element) {\n this.addElementPlacement(element, placements);\n }, this);\n elements.forEach(function(element) {\n if (!_hasDecorators(element)) return newElements.push(element);\n var elementFinishersExtras = this.decorateElement(\n element,\n placements\n );\n newElements.push(elementFinishersExtras.element);\n newElements.push.apply(newElements, elementFinishersExtras.extras);\n finishers.push.apply(finishers, elementFinishersExtras.finishers);\n }, this);\n\n if (!decorators) {\n return {\n elements: newElements,\n finishers: finishers\n };\n }\n\n var result = this.decorateConstructor(newElements, decorators);\n finishers.push.apply(finishers, result.finishers);\n result.finishers = finishers;\n return result;\n },\n addElementPlacement: function(element, placements, silent) {\n var keys = placements[element.placement];\n\n if (!silent && keys.indexOf(element.key) !== -1) {\n throw new TypeError('Duplicated element (' + element.key + ')');\n }\n\n keys.push(element.key);\n },\n decorateElement: function(element, placements) {\n var extras = [];\n var finishers = [];\n\n for (\n var decorators = element.decorators, i = decorators.length - 1;\n i >= 0;\n i--\n ) {\n var keys = placements[element.placement];\n keys.splice(keys.indexOf(element.key), 1);\n var elementObject = this.fromElementDescriptor(element);\n var elementFinisherExtras = this.toElementFinisherExtras(\n (0, decorators[i])(elementObject) || elementObject\n );\n element = elementFinisherExtras.element;\n this.addElementPlacement(element, placements);\n\n if (elementFinisherExtras.finisher) {\n finishers.push(elementFinisherExtras.finisher);\n }\n\n var newExtras = elementFinisherExtras.extras;\n\n if (newExtras) {\n for (var j = 0; j < newExtras.length; j++) {\n this.addElementPlacement(newExtras[j], placements);\n }\n\n extras.push.apply(extras, newExtras);\n }\n }\n\n return {\n element: element,\n finishers: finishers,\n extras: extras\n };\n },\n decorateConstructor: function(elements, decorators) {\n var finishers = [];\n\n for (var i = decorators.length - 1; i >= 0; i--) {\n var obj = this.fromClassDescriptor(elements);\n var elementsAndFinisher = this.toClassDescriptor(\n (0, decorators[i])(obj) || obj\n );\n\n if (elementsAndFinisher.finisher !== undefined) {\n finishers.push(elementsAndFinisher.finisher);\n }\n\n if (elementsAndFinisher.elements !== undefined) {\n elements = elementsAndFinisher.elements;\n\n for (var j = 0; j < elements.length - 1; j++) {\n for (var k = j + 1; k < elements.length; k++) {\n if (\n elements[j].key === elements[k].key &&\n elements[j].placement === elements[k].placement\n ) {\n throw new TypeError(\n 'Duplicated element (' + elements[j].key + ')'\n );\n }\n }\n }\n }\n }\n\n return {\n elements: elements,\n finishers: finishers\n };\n },\n fromElementDescriptor: function(element) {\n var obj = {\n kind: element.kind,\n key: element.key,\n placement: element.placement,\n descriptor: element.descriptor\n };\n var desc = {\n value: 'Descriptor',\n configurable: true\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n if (element.kind === 'field') obj.initializer = element.initializer;\n return obj;\n },\n toElementDescriptors: function(elementObjects) {\n if (elementObjects === undefined) return;\n return _toArray(elementObjects).map(function(elementObject) {\n var element = this.toElementDescriptor(elementObject);\n this.disallowProperty(\n elementObject,\n 'finisher',\n 'An element descriptor'\n );\n this.disallowProperty(\n elementObject,\n 'extras',\n 'An element descriptor'\n );\n return element;\n }, this);\n },\n toElementDescriptor: function(elementObject) {\n var kind = String(elementObject.kind);\n\n if (kind !== 'method' && kind !== 'field') {\n throw new TypeError(\n 'An element descriptor\\'s .kind property must be either \"method\" or' +\n ' \"field\", but a decorator created an element descriptor with' +\n ' .kind \"' +\n kind +\n '\"'\n );\n }\n\n var key = _toPropertyKey(elementObject.key);\n\n var placement = String(elementObject.placement);\n\n if (\n placement !== 'static' &&\n placement !== 'prototype' &&\n placement !== 'own'\n ) {\n throw new TypeError(\n 'An element descriptor\\'s .placement property must be one of \"static\",' +\n ' \"prototype\" or \"own\", but a decorator created an element descriptor' +\n ' with .placement \"' +\n placement +\n '\"'\n );\n }\n\n var descriptor = elementObject.descriptor;\n this.disallowProperty(\n elementObject,\n 'elements',\n 'An element descriptor'\n );\n var element = {\n kind: kind,\n key: key,\n placement: placement,\n descriptor: Object.assign({}, descriptor)\n };\n\n if (kind !== 'field') {\n this.disallowProperty(\n elementObject,\n 'initializer',\n 'A method descriptor'\n );\n } else {\n this.disallowProperty(\n descriptor,\n 'get',\n 'The property descriptor of a field descriptor'\n );\n this.disallowProperty(\n descriptor,\n 'set',\n 'The property descriptor of a field descriptor'\n );\n this.disallowProperty(\n descriptor,\n 'value',\n 'The property descriptor of a field descriptor'\n );\n element.initializer = elementObject.initializer;\n }\n\n return element;\n },\n toElementFinisherExtras: function(elementObject) {\n var element = this.toElementDescriptor(elementObject);\n\n var finisher = _optionalCallableProperty(elementObject, 'finisher');\n\n var extras = this.toElementDescriptors(elementObject.extras);\n return {\n element: element,\n finisher: finisher,\n extras: extras\n };\n },\n fromClassDescriptor: function(elements) {\n var obj = {\n kind: 'class',\n elements: elements.map(this.fromElementDescriptor, this)\n };\n var desc = {\n value: 'Descriptor',\n configurable: true\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n return obj;\n },\n toClassDescriptor: function(obj) {\n var kind = String(obj.kind);\n\n if (kind !== 'class') {\n throw new TypeError(\n 'A class descriptor\\'s .kind property must be \"class\", but a decorator' +\n ' created a class descriptor with .kind \"' +\n kind +\n '\"'\n );\n }\n\n this.disallowProperty(obj, 'key', 'A class descriptor');\n this.disallowProperty(obj, 'placement', 'A class descriptor');\n this.disallowProperty(obj, 'descriptor', 'A class descriptor');\n this.disallowProperty(obj, 'initializer', 'A class descriptor');\n this.disallowProperty(obj, 'extras', 'A class descriptor');\n\n var finisher = _optionalCallableProperty(obj, 'finisher');\n\n var elements = this.toElementDescriptors(obj.elements);\n return {\n elements: elements,\n finisher: finisher\n };\n },\n runClassFinishers: function(constructor, finishers) {\n for (var i = 0; i < finishers.length; i++) {\n var newConstructor = (0, finishers[i])(constructor);\n\n if (newConstructor !== undefined) {\n if (typeof newConstructor !== 'function') {\n throw new TypeError('Finishers must return a constructor.');\n }\n\n constructor = newConstructor;\n }\n }\n\n return constructor;\n },\n disallowProperty: function(obj, name, objectType) {\n if (obj[name] !== undefined) {\n throw new TypeError(\n objectType + \" can't have a .\" + name + ' property.'\n );\n }\n }\n };\n return api;\n }\n\n function _createElementDescriptor(def) {\n var key = _toPropertyKey(def.key);\n\n var descriptor;\n\n if (def.kind === 'method') {\n descriptor = {\n value: def.value,\n writable: true,\n configurable: true,\n enumerable: false\n };\n } else if (def.kind === 'get') {\n descriptor = {\n get: def.value,\n configurable: true,\n enumerable: false\n };\n } else if (def.kind === 'set') {\n descriptor = {\n set: def.value,\n configurable: true,\n enumerable: false\n };\n } else if (def.kind === 'field') {\n descriptor = {\n configurable: true,\n writable: true,\n enumerable: true\n };\n }\n\n var element = {\n kind: def.kind === 'field' ? 'field' : 'method',\n key: key,\n placement: def.static\n ? 'static'\n : def.kind === 'field'\n ? 'own'\n : 'prototype',\n descriptor: descriptor\n };\n if (def.decorators) element.decorators = def.decorators;\n if (def.kind === 'field') element.initializer = def.value;\n return element;\n }\n\n function _coalesceGetterSetter(element, other) {\n if (element.descriptor.get !== undefined) {\n other.descriptor.get = element.descriptor.get;\n } else {\n other.descriptor.set = element.descriptor.set;\n }\n }\n\n function _coalesceClassElements(elements) {\n var newElements = [];\n\n var isSameElement = function(other) {\n return (\n other.kind === 'method' &&\n other.key === element.key &&\n other.placement === element.placement\n );\n };\n\n for (var i = 0; i < elements.length; i++) {\n var element = elements[i];\n var other;\n\n if (\n element.kind === 'method' &&\n (other = newElements.find(isSameElement))\n ) {\n if (\n _isDataDescriptor(element.descriptor) ||\n _isDataDescriptor(other.descriptor)\n ) {\n if (_hasDecorators(element) || _hasDecorators(other)) {\n throw new ReferenceError(\n 'Duplicated methods (' + element.key + \") can't be decorated.\"\n );\n }\n\n other.descriptor = element.descriptor;\n } else {\n if (_hasDecorators(element)) {\n if (_hasDecorators(other)) {\n throw new ReferenceError(\n \"Decorators can't be placed on different accessors with for \" +\n 'the same property (' +\n element.key +\n ').'\n );\n }\n\n other.decorators = element.decorators;\n }\n\n _coalesceGetterSetter(element, other);\n }\n } else {\n newElements.push(element);\n }\n }\n\n return newElements;\n }\n\n function _hasDecorators(element) {\n return element.decorators && element.decorators.length;\n }\n\n function _isDataDescriptor(desc) {\n return (\n desc !== undefined &&\n !(desc.value === undefined && desc.writable === undefined)\n );\n }\n\n function _optionalCallableProperty(obj, name) {\n var value = obj[name];\n\n if (value !== undefined && typeof value !== 'function') {\n throw new TypeError(\"Expected '\" + name + \"' to be a function\");\n }\n\n return value;\n }\n\n function _classPrivateMethodGet(receiver, privateSet, fn) {\n if (!privateSet.has(receiver)) {\n throw new TypeError('attempted to get private field on non-instance');\n }\n\n return fn;\n }\n\n function _classPrivateMethodSet() {\n throw new TypeError('attempted to reassign private method');\n }\n\n function _wrapRegExp(re, groups) {\n _wrapRegExp = function(re, groups) {\n return new BabelRegExp(re, groups);\n };\n\n var _RegExp = _wrapNativeSuper(RegExp);\n\n var _super = RegExp.prototype;\n\n var _groups = new WeakMap();\n\n function BabelRegExp(re, groups) {\n var _this = _RegExp.call(this, re);\n\n _groups.set(_this, groups);\n\n return _this;\n }\n\n _inherits(BabelRegExp, _RegExp);\n\n BabelRegExp.prototype.exec = function(str) {\n var result = _super.exec.call(this, str);\n\n if (result) result.groups = buildGroups(result, this);\n return result;\n };\n\n BabelRegExp.prototype[Symbol.replace] = function(str, substitution) {\n if (typeof substitution === 'string') {\n var groups = _groups.get(this);\n\n return _super[Symbol.replace].call(\n this,\n str,\n substitution.replace(/\\$<([^>]+)>/g, function(_, name) {\n return '$' + groups[name];\n })\n );\n } else if (typeof substitution === 'function') {\n var _this = this;\n\n return _super[Symbol.replace].call(this, str, function() {\n var args = [];\n args.push.apply(args, arguments);\n\n if (typeof args[args.length - 1] !== 'object') {\n args.push(buildGroups(args, _this));\n }\n\n return substitution.apply(this, args);\n });\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n };\n\n function buildGroups(result, re) {\n var g = _groups.get(re);\n\n return Object.keys(g).reduce(function(groups, name) {\n groups[name] = result[g[name]];\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments);\n }\n\n var vectorMultiply = function vectorMultiply(v, amount) {\n return createVector(v.x * amount, v.y * amount);\n };\n\n var vectorAdd = function vectorAdd(a, b) {\n return createVector(a.x + b.x, a.y + b.y);\n };\n\n var vectorNormalize = function vectorNormalize(v) {\n var l = Math.sqrt(v.x * v.x + v.y * v.y);\n if (l === 0) {\n return {\n x: 0,\n y: 0\n };\n }\n return createVector(v.x / l, v.y / l);\n };\n\n var vectorRotate = function vectorRotate(v, radians, origin) {\n var cos = Math.cos(radians);\n var sin = Math.sin(radians);\n var t = createVector(v.x - origin.x, v.y - origin.y);\n return createVector(\n origin.x + cos * t.x - sin * t.y,\n origin.y + sin * t.x + cos * t.y\n );\n };\n\n var createVector = function createVector() {\n var x =\n arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y =\n arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n return { x: x, y: y };\n };\n\n var getMarkupValue = function getMarkupValue(value, size) {\n var scalar =\n arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var axis = arguments.length > 3 ? arguments[3] : undefined;\n if (typeof value === 'string') {\n return parseFloat(value) * scalar;\n }\n if (typeof value === 'number') {\n return value * (axis ? size[axis] : Math.min(size.width, size.height));\n }\n return;\n };\n\n var getMarkupStyles = function getMarkupStyles(markup, size, scale) {\n var lineStyle = markup.borderStyle || markup.lineStyle || 'solid';\n var fill = markup.backgroundColor || markup.fontColor || 'transparent';\n var stroke = markup.borderColor || markup.lineColor || 'transparent';\n var strokeWidth = getMarkupValue(\n markup.borderWidth || markup.lineWidth,\n size,\n scale\n );\n var lineCap = markup.lineCap || 'round';\n var lineJoin = markup.lineJoin || 'round';\n var dashes =\n typeof lineStyle === 'string'\n ? ''\n : lineStyle\n .map(function(v) {\n return getMarkupValue(v, size, scale);\n })\n .join(',');\n var opacity = markup.opacity || 1;\n return {\n 'stroke-linecap': lineCap,\n 'stroke-linejoin': lineJoin,\n 'stroke-width': strokeWidth || 0,\n 'stroke-dasharray': dashes,\n stroke: stroke,\n fill: fill,\n opacity: opacity\n };\n };\n\n var isDefined = function isDefined(value) {\n return value != null;\n };\n\n var getMarkupRect = function getMarkupRect(rect, size) {\n var scalar =\n arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n var left =\n getMarkupValue(rect.x, size, scalar, 'width') ||\n getMarkupValue(rect.left, size, scalar, 'width');\n var top =\n getMarkupValue(rect.y, size, scalar, 'height') ||\n getMarkupValue(rect.top, size, scalar, 'height');\n var width = getMarkupValue(rect.width, size, scalar, 'width');\n var height = getMarkupValue(rect.height, size, scalar, 'height');\n var right = getMarkupValue(rect.right, size, scalar, 'width');\n var bottom = getMarkupValue(rect.bottom, size, scalar, 'height');\n\n if (!isDefined(top)) {\n if (isDefined(height) && isDefined(bottom)) {\n top = size.height - height - bottom;\n } else {\n top = bottom;\n }\n }\n\n if (!isDefined(left)) {\n if (isDefined(width) && isDefined(right)) {\n left = size.width - width - right;\n } else {\n left = right;\n }\n }\n\n if (!isDefined(width)) {\n if (isDefined(left) && isDefined(right)) {\n width = size.width - left - right;\n } else {\n width = 0;\n }\n }\n\n if (!isDefined(height)) {\n if (isDefined(top) && isDefined(bottom)) {\n height = size.height - top - bottom;\n } else {\n height = 0;\n }\n }\n\n return {\n x: left || 0,\n y: top || 0,\n width: width || 0,\n height: height || 0\n };\n };\n\n var pointsToPathShape = function pointsToPathShape(points) {\n return points\n .map(function(point, index) {\n return ''\n .concat(index === 0 ? 'M' : 'L', ' ')\n .concat(point.x, ' ')\n .concat(point.y);\n })\n .join(' ');\n };\n\n var setAttributes = function setAttributes(element, attr) {\n return Object.keys(attr).forEach(function(key) {\n return element.setAttribute(key, attr[key]);\n });\n };\n\n var ns = 'http://www.w3.org/2000/svg';\n var svg = function svg(tag, attr) {\n var element = document.createElementNS(ns, tag);\n if (attr) {\n setAttributes(element, attr);\n }\n return element;\n };\n\n var updateRect = function updateRect(element) {\n return setAttributes(\n element,\n Object.assign({}, element.rect, element.styles)\n );\n };\n\n var updateEllipse = function updateEllipse(element) {\n var cx = element.rect.x + element.rect.width * 0.5;\n var cy = element.rect.y + element.rect.height * 0.5;\n var rx = element.rect.width * 0.5;\n var ry = element.rect.height * 0.5;\n return setAttributes(\n element,\n Object.assign(\n {\n cx: cx,\n cy: cy,\n rx: rx,\n ry: ry\n },\n element.styles\n )\n );\n };\n\n var IMAGE_FIT_STYLE = {\n contain: 'xMidYMid meet',\n cover: 'xMidYMid slice'\n };\n\n var updateImage = function updateImage(element, markup) {\n setAttributes(\n element,\n Object.assign({}, element.rect, element.styles, {\n preserveAspectRatio: IMAGE_FIT_STYLE[markup.fit] || 'none'\n })\n );\n };\n\n var TEXT_ANCHOR = {\n left: 'start',\n center: 'middle',\n right: 'end'\n };\n\n var updateText = function updateText(element, markup, size, scale) {\n var fontSize = getMarkupValue(markup.fontSize, size, scale);\n var fontFamily = markup.fontFamily || 'sans-serif';\n var fontWeight = markup.fontWeight || 'normal';\n var textAlign = TEXT_ANCHOR[markup.textAlign] || 'start';\n\n setAttributes(\n element,\n Object.assign({}, element.rect, element.styles, {\n 'stroke-width': 0,\n 'font-weight': fontWeight,\n 'font-size': fontSize,\n 'font-family': fontFamily,\n 'text-anchor': textAlign\n })\n );\n\n // update text\n if (element.text !== markup.text) {\n element.text = markup.text;\n element.textContent = markup.text.length ? markup.text : ' ';\n }\n };\n\n var updateLine = function updateLine(element, markup, size, scale) {\n setAttributes(\n element,\n Object.assign({}, element.rect, element.styles, {\n fill: 'none'\n })\n );\n\n var line = element.childNodes[0];\n var begin = element.childNodes[1];\n var end = element.childNodes[2];\n\n var origin = element.rect;\n\n var target = {\n x: element.rect.x + element.rect.width,\n y: element.rect.y + element.rect.height\n };\n\n setAttributes(line, {\n x1: origin.x,\n y1: origin.y,\n x2: target.x,\n y2: target.y\n });\n\n if (!markup.lineDecoration) return;\n\n begin.style.display = 'none';\n end.style.display = 'none';\n\n var v = vectorNormalize({\n x: target.x - origin.x,\n y: target.y - origin.y\n });\n\n var l = getMarkupValue(0.05, size, scale);\n\n if (markup.lineDecoration.indexOf('arrow-begin') !== -1) {\n var arrowBeginRotationPoint = vectorMultiply(v, l);\n var arrowBeginCenter = vectorAdd(origin, arrowBeginRotationPoint);\n var arrowBeginA = vectorRotate(origin, 2, arrowBeginCenter);\n var arrowBeginB = vectorRotate(origin, -2, arrowBeginCenter);\n\n setAttributes(begin, {\n style: 'display:block;',\n d: 'M'\n .concat(arrowBeginA.x, ',')\n .concat(arrowBeginA.y, ' L')\n .concat(origin.x, ',')\n .concat(origin.y, ' L')\n .concat(arrowBeginB.x, ',')\n .concat(arrowBeginB.y)\n });\n }\n\n if (markup.lineDecoration.indexOf('arrow-end') !== -1) {\n var arrowEndRotationPoint = vectorMultiply(v, -l);\n var arrowEndCenter = vectorAdd(target, arrowEndRotationPoint);\n var arrowEndA = vectorRotate(target, 2, arrowEndCenter);\n var arrowEndB = vectorRotate(target, -2, arrowEndCenter);\n\n setAttributes(end, {\n style: 'display:block;',\n d: 'M'\n .concat(arrowEndA.x, ',')\n .concat(arrowEndA.y, ' L')\n .concat(target.x, ',')\n .concat(target.y, ' L')\n .concat(arrowEndB.x, ',')\n .concat(arrowEndB.y)\n });\n }\n };\n\n var updatePath = function updatePath(element, markup, size, scale) {\n setAttributes(\n element,\n Object.assign({}, element.styles, {\n fill: 'none',\n d: pointsToPathShape(\n markup.points.map(function(point) {\n return {\n x: getMarkupValue(point.x, size, scale, 'width'),\n y: getMarkupValue(point.y, size, scale, 'height')\n };\n })\n )\n })\n );\n };\n\n var createShape = function createShape(node) {\n return function(markup) {\n return svg(node, { id: markup.id });\n };\n };\n\n var createImage = function createImage(markup) {\n var shape = svg('image', {\n id: markup.id,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round',\n opacity: '0'\n });\n\n shape.onload = function() {\n shape.setAttribute('opacity', markup.opacity || 1);\n };\n shape.setAttributeNS(\n 'http://www.w3.org/1999/xlink',\n 'xlink:href',\n markup.src\n );\n return shape;\n };\n\n var createLine = function createLine(markup) {\n var shape = svg('g', {\n id: markup.id,\n 'stroke-linecap': 'round',\n 'stroke-linejoin': 'round'\n });\n\n var line = svg('line');\n shape.appendChild(line);\n\n var begin = svg('path');\n shape.appendChild(begin);\n\n var end = svg('path');\n shape.appendChild(end);\n\n return shape;\n };\n\n var CREATE_TYPE_ROUTES = {\n image: createImage,\n rect: createShape('rect'),\n ellipse: createShape('ellipse'),\n text: createShape('text'),\n path: createShape('path'),\n line: createLine\n };\n\n var UPDATE_TYPE_ROUTES = {\n rect: updateRect,\n ellipse: updateEllipse,\n image: updateImage,\n text: updateText,\n path: updatePath,\n line: updateLine\n };\n\n var createMarkupByType = function createMarkupByType(type, markup) {\n return CREATE_TYPE_ROUTES[type](markup);\n };\n\n var updateMarkupByType = function updateMarkupByType(\n element,\n type,\n markup,\n size,\n scale\n ) {\n if (type !== 'path') {\n element.rect = getMarkupRect(markup, size, scale);\n }\n element.styles = getMarkupStyles(markup, size, scale);\n UPDATE_TYPE_ROUTES[type](element, markup, size, scale);\n };\n\n var MARKUP_RECT = [\n 'x',\n 'y',\n 'left',\n 'top',\n 'right',\n 'bottom',\n 'width',\n 'height'\n ];\n\n var toOptionalFraction = function toOptionalFraction(value) {\n return typeof value === 'string' && /%/.test(value)\n ? parseFloat(value) / 100\n : value;\n };\n\n // adds default markup properties, clones markup\n var prepareMarkup = function prepareMarkup(markup) {\n var _markup = _slicedToArray(markup, 2),\n type = _markup[0],\n props = _markup[1];\n\n var rect = props.points\n ? {}\n : MARKUP_RECT.reduce(function(prev, curr) {\n prev[curr] = toOptionalFraction(props[curr]);\n return prev;\n }, {});\n\n return [\n type,\n Object.assign(\n {\n zIndex: 0\n },\n props,\n rect\n )\n ];\n };\n\n var sortMarkupByZIndex = function sortMarkupByZIndex(a, b) {\n if (a[1].zIndex > b[1].zIndex) {\n return 1;\n }\n if (a[1].zIndex < b[1].zIndex) {\n return -1;\n }\n return 0;\n };\n\n var createMarkupView = function createMarkupView(_) {\n return _.utils.createView({\n name: 'image-preview-markup',\n tag: 'svg',\n ignoreRect: true,\n mixins: {\n apis: ['width', 'height', 'crop', 'markup', 'resize', 'dirty']\n },\n\n write: function write(_ref) {\n var root = _ref.root,\n props = _ref.props;\n\n if (!props.dirty) return;\n var crop = props.crop,\n resize = props.resize,\n markup = props.markup;\n\n var viewWidth = props.width;\n var viewHeight = props.height;\n\n var cropWidth = crop.width;\n var cropHeight = crop.height;\n\n if (resize) {\n var _size = resize.size;\n\n var outputWidth = _size && _size.width;\n var outputHeight = _size && _size.height;\n var outputFit = resize.mode;\n var outputUpscale = resize.upscale;\n\n if (outputWidth && !outputHeight) outputHeight = outputWidth;\n if (outputHeight && !outputWidth) outputWidth = outputHeight;\n\n var shouldUpscale =\n cropWidth < outputWidth && cropHeight < outputHeight;\n\n if (!shouldUpscale || (shouldUpscale && outputUpscale)) {\n var scalarWidth = outputWidth / cropWidth;\n var scalarHeight = outputHeight / cropHeight;\n\n if (outputFit === 'force') {\n cropWidth = outputWidth;\n cropHeight = outputHeight;\n } else {\n var scalar;\n if (outputFit === 'cover') {\n scalar = Math.max(scalarWidth, scalarHeight);\n } else if (outputFit === 'contain') {\n scalar = Math.min(scalarWidth, scalarHeight);\n }\n cropWidth = cropWidth * scalar;\n cropHeight = cropHeight * scalar;\n }\n }\n }\n\n var size = {\n width: viewWidth,\n height: viewHeight\n };\n\n root.element.setAttribute('width', size.width);\n root.element.setAttribute('height', size.height);\n\n var scale = Math.min(viewWidth / cropWidth, viewHeight / cropHeight);\n\n // clear\n root.element.innerHTML = '';\n\n // get filter\n var markupFilter = root.query('GET_IMAGE_PREVIEW_MARKUP_FILTER');\n\n // draw new\n markup\n .filter(markupFilter)\n .map(prepareMarkup)\n .sort(sortMarkupByZIndex)\n .forEach(function(markup) {\n var _markup = _slicedToArray(markup, 2),\n type = _markup[0],\n settings = _markup[1];\n\n // create\n var element = createMarkupByType(type, settings);\n\n // update\n updateMarkupByType(element, type, settings, size, scale);\n\n // add\n root.element.appendChild(element);\n });\n }\n });\n };\n\n var createVector$1 = function createVector(x, y) {\n return { x: x, y: y };\n };\n\n var vectorDot = function vectorDot(a, b) {\n return a.x * b.x + a.y * b.y;\n };\n\n var vectorSubtract = function vectorSubtract(a, b) {\n return createVector$1(a.x - b.x, a.y - b.y);\n };\n\n var vectorDistanceSquared = function vectorDistanceSquared(a, b) {\n return vectorDot(vectorSubtract(a, b), vectorSubtract(a, b));\n };\n\n var vectorDistance = function vectorDistance(a, b) {\n return Math.sqrt(vectorDistanceSquared(a, b));\n };\n\n var getOffsetPointOnEdge = function getOffsetPointOnEdge(length, rotation) {\n var a = length;\n\n var A = 1.5707963267948966;\n var B = rotation;\n var C = 1.5707963267948966 - rotation;\n\n var sinA = Math.sin(A);\n var sinB = Math.sin(B);\n var sinC = Math.sin(C);\n var cosC = Math.cos(C);\n var ratio = a / sinA;\n var b = ratio * sinB;\n var c = ratio * sinC;\n\n return createVector$1(cosC * b, cosC * c);\n };\n\n var getRotatedRectSize = function getRotatedRectSize(rect, rotation) {\n var w = rect.width;\n var h = rect.height;\n\n var hor = getOffsetPointOnEdge(w, rotation);\n var ver = getOffsetPointOnEdge(h, rotation);\n\n var tl = createVector$1(rect.x + Math.abs(hor.x), rect.y - Math.abs(hor.y));\n\n var tr = createVector$1(\n rect.x + rect.width + Math.abs(ver.y),\n rect.y + Math.abs(ver.x)\n );\n\n var bl = createVector$1(\n rect.x - Math.abs(ver.y),\n rect.y + rect.height - Math.abs(ver.x)\n );\n\n return {\n width: vectorDistance(tl, tr),\n height: vectorDistance(tl, bl)\n };\n };\n\n var calculateCanvasSize = function calculateCanvasSize(\n image,\n canvasAspectRatio\n ) {\n var zoom =\n arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n\n var imageAspectRatio = image.height / image.width;\n\n // determine actual pixels on x and y axis\n var canvasWidth = 1;\n var canvasHeight = canvasAspectRatio;\n var imgWidth = 1;\n var imgHeight = imageAspectRatio;\n if (imgHeight > canvasHeight) {\n imgHeight = canvasHeight;\n imgWidth = imgHeight / imageAspectRatio;\n }\n\n var scalar = Math.max(canvasWidth / imgWidth, canvasHeight / imgHeight);\n var width = image.width / (zoom * scalar * imgWidth);\n var height = width * canvasAspectRatio;\n\n return {\n width: width,\n height: height\n };\n };\n\n var getImageRectZoomFactor = function getImageRectZoomFactor(\n imageRect,\n cropRect,\n rotation,\n center\n ) {\n // calculate available space round image center position\n var cx = center.x > 0.5 ? 1 - center.x : center.x;\n var cy = center.y > 0.5 ? 1 - center.y : center.y;\n var imageWidth = cx * 2 * imageRect.width;\n var imageHeight = cy * 2 * imageRect.height;\n\n // calculate rotated crop rectangle size\n var rotatedCropSize = getRotatedRectSize(cropRect, rotation);\n\n // calculate scalar required to fit image\n return Math.max(\n rotatedCropSize.width / imageWidth,\n rotatedCropSize.height / imageHeight\n );\n };\n\n var getCenteredCropRect = function getCenteredCropRect(\n container,\n aspectRatio\n ) {\n var width = container.width;\n var height = width * aspectRatio;\n if (height > container.height) {\n height = container.height;\n width = height / aspectRatio;\n }\n var x = (container.width - width) * 0.5;\n var y = (container.height - height) * 0.5;\n\n return {\n x: x,\n y: y,\n width: width,\n height: height\n };\n };\n\n var getCurrentCropSize = function getCurrentCropSize(imageSize) {\n var crop =\n arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var zoom = crop.zoom,\n rotation = crop.rotation,\n center = crop.center,\n aspectRatio = crop.aspectRatio;\n\n if (!aspectRatio) aspectRatio = imageSize.height / imageSize.width;\n\n var canvasSize = calculateCanvasSize(imageSize, aspectRatio, zoom);\n\n var canvasCenter = {\n x: canvasSize.width * 0.5,\n y: canvasSize.height * 0.5\n };\n\n var stage = {\n x: 0,\n y: 0,\n width: canvasSize.width,\n height: canvasSize.height,\n center: canvasCenter\n };\n\n var shouldLimit = typeof crop.scaleToFit === 'undefined' || crop.scaleToFit;\n\n var stageZoomFactor = getImageRectZoomFactor(\n imageSize,\n getCenteredCropRect(stage, aspectRatio),\n rotation,\n shouldLimit ? center : { x: 0.5, y: 0.5 }\n );\n\n var scale = zoom * stageZoomFactor;\n\n // start drawing\n return {\n widthFloat: canvasSize.width / scale,\n heightFloat: canvasSize.height / scale,\n width: Math.round(canvasSize.width / scale),\n height: Math.round(canvasSize.height / scale)\n };\n };\n\n var IMAGE_SCALE_SPRING_PROPS = {\n type: 'spring',\n stiffness: 0.5,\n damping: 0.45,\n mass: 10\n };\n\n // does horizontal and vertical flipping\n var createBitmapView = function createBitmapView(_) {\n return _.utils.createView({\n name: 'image-bitmap',\n ignoreRect: true,\n mixins: { styles: ['scaleX', 'scaleY'] },\n create: function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n root.appendChild(props.image);\n }\n });\n };\n\n // shifts and rotates image\n var createImageCanvasWrapper = function createImageCanvasWrapper(_) {\n return _.utils.createView({\n name: 'image-canvas-wrapper',\n tag: 'div',\n ignoreRect: true,\n mixins: {\n apis: ['crop', 'width', 'height'],\n\n styles: [\n 'originX',\n 'originY',\n 'translateX',\n 'translateY',\n 'scaleX',\n 'scaleY',\n 'rotateZ'\n ],\n\n animations: {\n originX: IMAGE_SCALE_SPRING_PROPS,\n originY: IMAGE_SCALE_SPRING_PROPS,\n scaleX: IMAGE_SCALE_SPRING_PROPS,\n scaleY: IMAGE_SCALE_SPRING_PROPS,\n translateX: IMAGE_SCALE_SPRING_PROPS,\n translateY: IMAGE_SCALE_SPRING_PROPS,\n rotateZ: IMAGE_SCALE_SPRING_PROPS\n }\n },\n\n create: function create(_ref2) {\n var root = _ref2.root,\n props = _ref2.props;\n props.width = props.image.width;\n props.height = props.image.height;\n root.ref.bitmap = root.appendChildView(\n root.createChildView(createBitmapView(_), { image: props.image })\n );\n },\n write: function write(_ref3) {\n var root = _ref3.root,\n props = _ref3.props;\n var flip = props.crop.flip;\n var bitmap = root.ref.bitmap;\n bitmap.scaleX = flip.horizontal ? -1 : 1;\n bitmap.scaleY = flip.vertical ? -1 : 1;\n }\n });\n };\n\n // clips canvas to correct aspect ratio\n var createClipView = function createClipView(_) {\n return _.utils.createView({\n name: 'image-clip',\n tag: 'div',\n ignoreRect: true,\n mixins: {\n apis: [\n 'crop',\n 'markup',\n 'resize',\n 'width',\n 'height',\n 'dirty',\n 'background'\n ],\n\n styles: ['width', 'height', 'opacity'],\n animations: {\n opacity: { type: 'tween', duration: 250 }\n }\n },\n\n didWriteView: function didWriteView(_ref4) {\n var root = _ref4.root,\n props = _ref4.props;\n if (!props.background) return;\n root.element.style.backgroundColor = props.background;\n },\n create: function create(_ref5) {\n var root = _ref5.root,\n props = _ref5.props;\n\n root.ref.image = root.appendChildView(\n root.createChildView(\n createImageCanvasWrapper(_),\n Object.assign({}, props)\n )\n );\n\n root.ref.createMarkup = function() {\n if (root.ref.markup) return;\n root.ref.markup = root.appendChildView(\n root.createChildView(createMarkupView(_), Object.assign({}, props))\n );\n };\n\n root.ref.destroyMarkup = function() {\n if (!root.ref.markup) return;\n root.removeChildView(root.ref.markup);\n root.ref.markup = null;\n };\n\n // set up transparency grid\n var transparencyIndicator = root.query(\n 'GET_IMAGE_PREVIEW_TRANSPARENCY_INDICATOR'\n );\n if (transparencyIndicator === null) return;\n\n // grid pattern\n if (transparencyIndicator === 'grid') {\n root.element.dataset.transparencyIndicator = transparencyIndicator;\n }\n // basic color\n else {\n root.element.dataset.transparencyIndicator = 'color';\n }\n },\n write: function write(_ref6) {\n var root = _ref6.root,\n props = _ref6.props,\n shouldOptimize = _ref6.shouldOptimize;\n var crop = props.crop,\n markup = props.markup,\n resize = props.resize,\n dirty = props.dirty,\n width = props.width,\n height = props.height;\n\n root.ref.image.crop = crop;\n\n var stage = {\n x: 0,\n y: 0,\n width: width,\n height: height,\n center: {\n x: width * 0.5,\n y: height * 0.5\n }\n };\n\n var image = {\n width: root.ref.image.width,\n height: root.ref.image.height\n };\n\n var origin = {\n x: crop.center.x * image.width,\n y: crop.center.y * image.height\n };\n\n var translation = {\n x: stage.center.x - image.width * crop.center.x,\n y: stage.center.y - image.height * crop.center.y\n };\n\n var rotation = Math.PI * 2 + (crop.rotation % (Math.PI * 2));\n\n var cropAspectRatio = crop.aspectRatio || image.height / image.width;\n\n var shouldLimit =\n typeof crop.scaleToFit === 'undefined' || crop.scaleToFit;\n\n var stageZoomFactor = getImageRectZoomFactor(\n image,\n getCenteredCropRect(stage, cropAspectRatio),\n\n rotation,\n shouldLimit ? crop.center : { x: 0.5, y: 0.5 }\n );\n\n var scale = crop.zoom * stageZoomFactor;\n\n // update markup view\n if (markup && markup.length) {\n root.ref.createMarkup();\n root.ref.markup.width = width;\n root.ref.markup.height = height;\n root.ref.markup.resize = resize;\n root.ref.markup.dirty = dirty;\n root.ref.markup.markup = markup;\n root.ref.markup.crop = getCurrentCropSize(image, crop);\n } else if (root.ref.markup) {\n root.ref.destroyMarkup();\n }\n\n // update image view\n var imageView = root.ref.image;\n\n // don't update clip layout\n if (shouldOptimize) {\n imageView.originX = null;\n imageView.originY = null;\n imageView.translateX = null;\n imageView.translateY = null;\n imageView.rotateZ = null;\n imageView.scaleX = null;\n imageView.scaleY = null;\n return;\n }\n\n imageView.originX = origin.x;\n imageView.originY = origin.y;\n imageView.translateX = translation.x;\n imageView.translateY = translation.y;\n imageView.rotateZ = rotation;\n imageView.scaleX = scale;\n imageView.scaleY = scale;\n }\n });\n };\n\n var createImageView = function createImageView(_) {\n return _.utils.createView({\n name: 'image-preview',\n tag: 'div',\n ignoreRect: true,\n mixins: {\n apis: ['image', 'crop', 'markup', 'resize', 'dirty', 'background'],\n\n styles: ['translateY', 'scaleX', 'scaleY', 'opacity'],\n\n animations: {\n scaleX: IMAGE_SCALE_SPRING_PROPS,\n scaleY: IMAGE_SCALE_SPRING_PROPS,\n translateY: IMAGE_SCALE_SPRING_PROPS,\n opacity: { type: 'tween', duration: 400 }\n }\n },\n\n create: function create(_ref7) {\n var root = _ref7.root,\n props = _ref7.props;\n root.ref.clip = root.appendChildView(\n root.createChildView(createClipView(_), {\n id: props.id,\n image: props.image,\n crop: props.crop,\n markup: props.markup,\n resize: props.resize,\n dirty: props.dirty,\n background: props.background\n })\n );\n },\n write: function write(_ref8) {\n var root = _ref8.root,\n props = _ref8.props,\n shouldOptimize = _ref8.shouldOptimize;\n var clip = root.ref.clip;\n var image = props.image,\n crop = props.crop,\n markup = props.markup,\n resize = props.resize,\n dirty = props.dirty;\n\n clip.crop = crop;\n clip.markup = markup;\n clip.resize = resize;\n clip.dirty = dirty;\n\n // don't update clip layout\n clip.opacity = shouldOptimize ? 0 : 1;\n\n // don't re-render if optimizing or hidden (width will be zero resulting in weird animations)\n if (shouldOptimize || root.rect.element.hidden) return;\n\n // calculate scaled preview image size\n var imageAspectRatio = image.height / image.width;\n var aspectRatio = crop.aspectRatio || imageAspectRatio;\n\n // calculate container size\n var containerWidth = root.rect.inner.width;\n var containerHeight = root.rect.inner.height;\n\n var fixedPreviewHeight = root.query('GET_IMAGE_PREVIEW_HEIGHT');\n var minPreviewHeight = root.query('GET_IMAGE_PREVIEW_MIN_HEIGHT');\n var maxPreviewHeight = root.query('GET_IMAGE_PREVIEW_MAX_HEIGHT');\n\n var panelAspectRatio = root.query('GET_PANEL_ASPECT_RATIO');\n var allowMultiple = root.query('GET_ALLOW_MULTIPLE');\n\n if (panelAspectRatio && !allowMultiple) {\n fixedPreviewHeight = containerWidth * panelAspectRatio;\n aspectRatio = panelAspectRatio;\n }\n\n // determine clip width and height\n var clipHeight =\n fixedPreviewHeight !== null\n ? fixedPreviewHeight\n : Math.max(\n minPreviewHeight,\n Math.min(containerWidth * aspectRatio, maxPreviewHeight)\n );\n\n var clipWidth = clipHeight / aspectRatio;\n if (clipWidth > containerWidth) {\n clipWidth = containerWidth;\n clipHeight = clipWidth * aspectRatio;\n }\n\n if (clipHeight > containerHeight) {\n clipHeight = containerHeight;\n clipWidth = containerHeight / aspectRatio;\n }\n\n clip.width = clipWidth;\n clip.height = clipHeight;\n }\n });\n };\n\n var SVG_MASK =\n '\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n ';\n\n var SVGMaskUniqueId = 0;\n\n var createImageOverlayView = function createImageOverlayView(fpAPI) {\n return fpAPI.utils.createView({\n name: 'image-preview-overlay',\n tag: 'div',\n ignoreRect: true,\n create: function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n var mask = SVG_MASK;\n if (document.querySelector('base')) {\n var url = new URL(\n window.location.href.replace(window.location.hash, '')\n ).href;\n mask = mask.replace(/url\\(\\#/g, 'url(' + url + '#');\n }\n\n SVGMaskUniqueId++;\n root.element.classList.add(\n 'filepond--image-preview-overlay-'.concat(props.status)\n );\n\n root.element.innerHTML = mask.replace(/__UID__/g, SVGMaskUniqueId);\n },\n mixins: {\n styles: ['opacity'],\n animations: {\n opacity: { type: 'spring', mass: 25 }\n }\n }\n });\n };\n\n /**\n * Bitmap Worker\n */\n var BitmapWorker = function BitmapWorker() {\n self.onmessage = function(e) {\n createImageBitmap(e.data.message.file).then(function(bitmap) {\n self.postMessage({ id: e.data.id, message: bitmap }, [bitmap]);\n });\n };\n };\n\n /**\n * ColorMatrix Worker\n */\n var ColorMatrixWorker = function ColorMatrixWorker() {\n self.onmessage = function(e) {\n var imageData = e.data.message.imageData;\n var matrix = e.data.message.colorMatrix;\n\n var data = imageData.data;\n var l = data.length;\n\n var m11 = matrix[0];\n var m12 = matrix[1];\n var m13 = matrix[2];\n var m14 = matrix[3];\n var m15 = matrix[4];\n\n var m21 = matrix[5];\n var m22 = matrix[6];\n var m23 = matrix[7];\n var m24 = matrix[8];\n var m25 = matrix[9];\n\n var m31 = matrix[10];\n var m32 = matrix[11];\n var m33 = matrix[12];\n var m34 = matrix[13];\n var m35 = matrix[14];\n\n var m41 = matrix[15];\n var m42 = matrix[16];\n var m43 = matrix[17];\n var m44 = matrix[18];\n var m45 = matrix[19];\n\n var index = 0,\n r = 0.0,\n g = 0.0,\n b = 0.0,\n a = 0.0;\n\n for (; index < l; index += 4) {\n r = data[index] / 255;\n g = data[index + 1] / 255;\n b = data[index + 2] / 255;\n a = data[index + 3] / 255;\n data[index] = Math.max(\n 0,\n Math.min((r * m11 + g * m12 + b * m13 + a * m14 + m15) * 255, 255)\n );\n data[index + 1] = Math.max(\n 0,\n Math.min((r * m21 + g * m22 + b * m23 + a * m24 + m25) * 255, 255)\n );\n data[index + 2] = Math.max(\n 0,\n Math.min((r * m31 + g * m32 + b * m33 + a * m34 + m35) * 255, 255)\n );\n data[index + 3] = Math.max(\n 0,\n Math.min((r * m41 + g * m42 + b * m43 + a * m44 + m45) * 255, 255)\n );\n }\n\n self.postMessage({ id: e.data.id, message: imageData }, [\n imageData.data.buffer\n ]);\n };\n };\n\n var getImageSize = function getImageSize(url, cb) {\n var image = new Image();\n image.onload = function() {\n var width = image.naturalWidth;\n var height = image.naturalHeight;\n image = null;\n cb(width, height);\n };\n image.src = url;\n };\n\n var transforms = {\n 1: function _() {\n return [1, 0, 0, 1, 0, 0];\n },\n 2: function _(width) {\n return [-1, 0, 0, 1, width, 0];\n },\n 3: function _(width, height) {\n return [-1, 0, 0, -1, width, height];\n },\n 4: function _(width, height) {\n return [1, 0, 0, -1, 0, height];\n },\n 5: function _() {\n return [0, 1, 1, 0, 0, 0];\n },\n 6: function _(width, height) {\n return [0, 1, -1, 0, height, 0];\n },\n 7: function _(width, height) {\n return [0, -1, -1, 0, height, width];\n },\n 8: function _(width) {\n return [0, -1, 1, 0, 0, width];\n }\n };\n\n var fixImageOrientation = function fixImageOrientation(\n ctx,\n width,\n height,\n orientation\n ) {\n // no orientation supplied\n if (orientation === -1) {\n return;\n }\n\n ctx.transform.apply(ctx, transforms[orientation](width, height));\n };\n\n // draws the preview image to canvas\n var createPreviewImage = function createPreviewImage(\n data,\n width,\n height,\n orientation\n ) {\n // can't draw on half pixels\n width = Math.round(width);\n height = Math.round(height);\n\n // draw image\n var canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n var ctx = canvas.getContext('2d');\n\n // if is rotated incorrectly swap width and height\n if (orientation >= 5 && orientation <= 8) {\n var _ref = [height, width];\n width = _ref[0];\n height = _ref[1];\n }\n\n // correct image orientation\n fixImageOrientation(ctx, width, height, orientation);\n\n // draw the image\n ctx.drawImage(data, 0, 0, width, height);\n\n return canvas;\n };\n\n var isBitmap = function isBitmap(file) {\n return /^image/.test(file.type) && !/svg/.test(file.type);\n };\n\n var MAX_WIDTH = 10;\n var MAX_HEIGHT = 10;\n\n var calculateAverageColor = function calculateAverageColor(image) {\n var scalar = Math.min(MAX_WIDTH / image.width, MAX_HEIGHT / image.height);\n\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n var width = (canvas.width = Math.ceil(image.width * scalar));\n var height = (canvas.height = Math.ceil(image.height * scalar));\n ctx.drawImage(image, 0, 0, width, height);\n var data = null;\n try {\n data = ctx.getImageData(0, 0, width, height).data;\n } catch (e) {\n return null;\n }\n var l = data.length;\n\n var r = 0;\n var g = 0;\n var b = 0;\n var i = 0;\n\n for (; i < l; i += 4) {\n r += data[i] * data[i];\n g += data[i + 1] * data[i + 1];\n b += data[i + 2] * data[i + 2];\n }\n\n r = averageColor(r, l);\n g = averageColor(g, l);\n b = averageColor(b, l);\n\n return { r: r, g: g, b: b };\n };\n\n var averageColor = function averageColor(c, l) {\n return Math.floor(Math.sqrt(c / (l / 4)));\n };\n\n var cloneCanvas = function cloneCanvas(origin, target) {\n target = target || document.createElement('canvas');\n target.width = origin.width;\n target.height = origin.height;\n var ctx = target.getContext('2d');\n ctx.drawImage(origin, 0, 0);\n return target;\n };\n\n var cloneImageData = function cloneImageData(imageData) {\n var id;\n try {\n id = new ImageData(imageData.width, imageData.height);\n } catch (e) {\n var canvas = document.createElement('canvas');\n var ctx = canvas.getContext('2d');\n id = ctx.createImageData(imageData.width, imageData.height);\n }\n id.data.set(new Uint8ClampedArray(imageData.data));\n return id;\n };\n\n var loadImage = function loadImage(url) {\n return new Promise(function(resolve, reject) {\n var img = new Image();\n img.crossOrigin = 'Anonymous';\n img.onload = function() {\n resolve(img);\n };\n img.onerror = function(e) {\n reject(e);\n };\n img.src = url;\n });\n };\n\n var createImageWrapperView = function createImageWrapperView(_) {\n // create overlay view\n var OverlayView = createImageOverlayView(_);\n\n var ImageView = createImageView(_);\n var createWorker = _.utils.createWorker;\n\n var applyFilter = function applyFilter(root, filter, target) {\n return new Promise(function(resolve) {\n // will store image data for future filter updates\n if (!root.ref.imageData) {\n root.ref.imageData = target\n .getContext('2d')\n .getImageData(0, 0, target.width, target.height);\n }\n\n // get image data reference\n var imageData = cloneImageData(root.ref.imageData);\n\n if (!filter || filter.length !== 20) {\n target.getContext('2d').putImageData(imageData, 0, 0);\n return resolve();\n }\n\n var worker = createWorker(ColorMatrixWorker);\n worker.post(\n {\n imageData: imageData,\n colorMatrix: filter\n },\n\n function(response) {\n // apply filtered colors\n target.getContext('2d').putImageData(response, 0, 0);\n\n // stop worker\n worker.terminate();\n\n // done!\n resolve();\n },\n [imageData.data.buffer]\n );\n });\n };\n\n var removeImageView = function removeImageView(root, imageView) {\n root.removeChildView(imageView);\n imageView.image.width = 1;\n imageView.image.height = 1;\n imageView._destroy();\n };\n\n // remove an image\n var shiftImage = function shiftImage(_ref) {\n var root = _ref.root;\n var imageView = root.ref.images.shift();\n imageView.opacity = 0;\n imageView.translateY = -15;\n root.ref.imageViewBin.push(imageView);\n return imageView;\n };\n\n // add new image\n var pushImage = function pushImage(_ref2) {\n var root = _ref2.root,\n props = _ref2.props,\n image = _ref2.image;\n var id = props.id;\n var item = root.query('GET_ITEM', { id: id });\n if (!item) return;\n\n var crop = item.getMetadata('crop') || {\n center: {\n x: 0.5,\n y: 0.5\n },\n\n flip: {\n horizontal: false,\n vertical: false\n },\n\n zoom: 1,\n rotation: 0,\n aspectRatio: null\n };\n\n var background = root.query(\n 'GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR'\n );\n\n var markup;\n var resize;\n var dirty = false;\n if (root.query('GET_IMAGE_PREVIEW_MARKUP_SHOW')) {\n markup = item.getMetadata('markup') || [];\n resize = item.getMetadata('resize');\n dirty = true;\n }\n\n // append image presenter\n var imageView = root.appendChildView(\n root.createChildView(ImageView, {\n id: id,\n image: image,\n crop: crop,\n resize: resize,\n markup: markup,\n dirty: dirty,\n background: background,\n opacity: 0,\n scaleX: 1.15,\n scaleY: 1.15,\n translateY: 15\n }),\n\n root.childViews.length\n );\n\n root.ref.images.push(imageView);\n\n // reveal the preview image\n imageView.opacity = 1;\n imageView.scaleX = 1;\n imageView.scaleY = 1;\n imageView.translateY = 0;\n\n // the preview is now ready to be drawn\n setTimeout(function() {\n root.dispatch('DID_IMAGE_PREVIEW_SHOW', { id: id });\n }, 250);\n };\n\n var updateImage = function updateImage(_ref3) {\n var root = _ref3.root,\n props = _ref3.props;\n var item = root.query('GET_ITEM', { id: props.id });\n if (!item) return;\n var imageView = root.ref.images[root.ref.images.length - 1];\n imageView.crop = item.getMetadata('crop');\n imageView.background = root.query(\n 'GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR'\n );\n\n if (root.query('GET_IMAGE_PREVIEW_MARKUP_SHOW')) {\n imageView.dirty = true;\n imageView.resize = item.getMetadata('resize');\n imageView.markup = item.getMetadata('markup');\n }\n };\n\n // replace image preview\n var didUpdateItemMetadata = function didUpdateItemMetadata(_ref4) {\n var root = _ref4.root,\n props = _ref4.props,\n action = _ref4.action;\n // only filter and crop trigger redraw\n if (!/crop|filter|markup|resize/.test(action.change.key)) return;\n\n // no images to update, exit\n if (!root.ref.images.length) return;\n\n // no item found, exit\n var item = root.query('GET_ITEM', { id: props.id });\n if (!item) return;\n\n // for now, update existing image when filtering\n if (/filter/.test(action.change.key)) {\n var imageView = root.ref.images[root.ref.images.length - 1];\n applyFilter(root, action.change.value, imageView.image);\n return;\n }\n\n if (/crop|markup|resize/.test(action.change.key)) {\n var crop = item.getMetadata('crop');\n var image = root.ref.images[root.ref.images.length - 1];\n\n // if aspect ratio has changed, we need to create a new image\n if (\n crop &&\n crop.aspectRatio &&\n image.crop &&\n image.crop.aspectRatio &&\n Math.abs(crop.aspectRatio - image.crop.aspectRatio) > 0.00001\n ) {\n var _imageView = shiftImage({ root: root });\n pushImage({\n root: root,\n props: props,\n image: cloneCanvas(_imageView.image)\n });\n }\n // if not, we can update the current image\n else {\n updateImage({ root: root, props: props });\n }\n }\n };\n\n var canCreateImageBitmap = function canCreateImageBitmap(file) {\n // Firefox versions before 58 will freeze when running createImageBitmap\n // in a Web Worker so we detect those versions and return false for support\n var userAgent = window.navigator.userAgent;\n var isFirefox = userAgent.match(/Firefox\\/([0-9]+)\\./);\n var firefoxVersion = isFirefox ? parseInt(isFirefox[1]) : null;\n if (firefoxVersion !== null && firefoxVersion <= 58) return false;\n\n return 'createImageBitmap' in window && isBitmap(file);\n };\n\n /**\n * Write handler for when preview container has been created\n */\n var didCreatePreviewContainer = function didCreatePreviewContainer(_ref5) {\n var root = _ref5.root,\n props = _ref5.props;\n var id = props.id;\n\n // we need to get the file data to determine the eventual image size\n var item = root.query('GET_ITEM', id);\n if (!item) return;\n\n // get url to file (we'll revoke it later on when done)\n var fileURL = URL.createObjectURL(item.file);\n\n // determine image size of this item\n getImageSize(fileURL, function(width, height) {\n // we can now scale the panel to the final size\n root.dispatch('DID_IMAGE_PREVIEW_CALCULATE_SIZE', {\n id: id,\n width: width,\n height: height\n });\n });\n };\n\n var drawPreview = function drawPreview(_ref6) {\n var root = _ref6.root,\n props = _ref6.props;\n var id = props.id;\n\n // we need to get the file data to determine the eventual image size\n var item = root.query('GET_ITEM', id);\n if (!item) return;\n\n // get url to file (we'll revoke it later on when done)\n var fileURL = URL.createObjectURL(item.file);\n\n // fallback\n var loadPreviewFallback = function loadPreviewFallback() {\n // let's scale the image in the main thread :(\n loadImage(fileURL).then(previewImageLoaded);\n };\n\n // image is now ready\n var previewImageLoaded = function previewImageLoaded(imageData) {\n // the file url is no longer needed\n URL.revokeObjectURL(fileURL);\n\n // draw the scaled down version here and use that as source so bitmapdata can be closed\n // orientation info\n var exif = item.getMetadata('exif') || {};\n var orientation = exif.orientation || -1;\n\n // get width and height from action, and swap if orientation is incorrect\n var width = imageData.width,\n height = imageData.height;\n\n // if no width or height, just return early.\n if (!width || !height) return;\n\n if (orientation >= 5 && orientation <= 8) {\n var _ref7 = [height, width];\n width = _ref7[0];\n height = _ref7[1];\n }\n\n // scale canvas based on pixel density\n // we multiply by .75 as that creates smaller but still clear images on screens with high res displays\n var pixelDensityFactor = Math.max(1, window.devicePixelRatio * 0.75);\n\n // we want as much pixels to work with as possible,\n // this multiplies the minimum image resolution,\n // so when zooming in it doesn't get too blurry\n var zoomFactor = root.query('GET_IMAGE_PREVIEW_ZOOM_FACTOR');\n\n // imaeg scale factor\n var scaleFactor = zoomFactor * pixelDensityFactor;\n\n // calculate scaled preview image size\n var previewImageRatio = height / width;\n\n // calculate image preview height and width\n var previewContainerWidth = root.rect.element.width;\n var previewContainerHeight = root.rect.element.height;\n\n var imageWidth = previewContainerWidth;\n var imageHeight = imageWidth * previewImageRatio;\n\n if (previewImageRatio > 1) {\n imageWidth = Math.min(width, previewContainerWidth * scaleFactor);\n imageHeight = imageWidth * previewImageRatio;\n } else {\n imageHeight = Math.min(height, previewContainerHeight * scaleFactor);\n imageWidth = imageHeight / previewImageRatio;\n }\n\n // transfer to image tag so no canvas memory wasted on iOS\n var previewImage = createPreviewImage(\n imageData,\n imageWidth,\n imageHeight,\n orientation\n );\n\n // done\n var done = function done() {\n // calculate average image color, disabled for now\n var averageColor = root.query(\n 'GET_IMAGE_PREVIEW_CALCULATE_AVERAGE_IMAGE_COLOR'\n )\n ? calculateAverageColor(data)\n : null;\n item.setMetadata('color', averageColor, true);\n\n // data has been transferred to canvas ( if was ImageBitmap )\n if ('close' in imageData) {\n imageData.close();\n }\n\n // show the overlay\n root.ref.overlayShadow.opacity = 1;\n\n // create the first image\n pushImage({ root: root, props: props, image: previewImage });\n };\n\n // apply filter\n var filter = item.getMetadata('filter');\n if (filter) {\n applyFilter(root, filter, previewImage).then(done);\n } else {\n done();\n }\n };\n\n // if we support scaling using createImageBitmap we use a worker\n if (canCreateImageBitmap(item.file)) {\n // let's scale the image in a worker\n var worker = createWorker(BitmapWorker);\n\n worker.post(\n {\n file: item.file\n },\n\n function(imageBitmap) {\n // destroy worker\n worker.terminate();\n\n // no bitmap returned, must be something wrong,\n // try the oldschool way\n if (!imageBitmap) {\n loadPreviewFallback();\n return;\n }\n\n // yay we got our bitmap, let's continue showing the preview\n previewImageLoaded(imageBitmap);\n }\n );\n } else {\n // create fallback preview\n loadPreviewFallback();\n }\n };\n\n /**\n * Write handler for when the preview image is ready to be animated\n */\n var didDrawPreview = function didDrawPreview(_ref8) {\n var root = _ref8.root;\n // get last added image\n var image = root.ref.images[root.ref.images.length - 1];\n image.translateY = 0;\n image.scaleX = 1.0;\n image.scaleY = 1.0;\n image.opacity = 1;\n };\n\n /**\n * Write handler for when the preview has been loaded\n */\n var restoreOverlay = function restoreOverlay(_ref9) {\n var root = _ref9.root;\n root.ref.overlayShadow.opacity = 1;\n root.ref.overlayError.opacity = 0;\n root.ref.overlaySuccess.opacity = 0;\n };\n\n var didThrowError = function didThrowError(_ref10) {\n var root = _ref10.root;\n root.ref.overlayShadow.opacity = 0.25;\n root.ref.overlayError.opacity = 1;\n };\n\n var didCompleteProcessing = function didCompleteProcessing(_ref11) {\n var root = _ref11.root;\n root.ref.overlayShadow.opacity = 0.25;\n root.ref.overlaySuccess.opacity = 1;\n };\n\n /**\n * Constructor\n */\n var create = function create(_ref12) {\n var root = _ref12.root;\n // image view\n root.ref.images = [];\n\n // the preview image data (we need this to filter the image)\n root.ref.imageData = null;\n\n // image bin\n root.ref.imageViewBin = [];\n\n // image overlays\n root.ref.overlayShadow = root.appendChildView(\n root.createChildView(OverlayView, {\n opacity: 0,\n status: 'idle'\n })\n );\n\n root.ref.overlaySuccess = root.appendChildView(\n root.createChildView(OverlayView, {\n opacity: 0,\n status: 'success'\n })\n );\n\n root.ref.overlayError = root.appendChildView(\n root.createChildView(OverlayView, {\n opacity: 0,\n status: 'failure'\n })\n );\n };\n\n return _.utils.createView({\n name: 'image-preview-wrapper',\n create: create,\n styles: ['height'],\n apis: ['height'],\n destroy: function destroy(_ref13) {\n var root = _ref13.root;\n // we resize the image so memory on iOS 12 is released more quickly (it seems)\n root.ref.images.forEach(function(imageView) {\n imageView.image.width = 1;\n imageView.image.height = 1;\n });\n },\n didWriteView: function didWriteView(_ref14) {\n var root = _ref14.root;\n root.ref.images.forEach(function(imageView) {\n imageView.dirty = false;\n });\n },\n write: _.utils.createRoute(\n {\n // image preview stated\n DID_IMAGE_PREVIEW_DRAW: didDrawPreview,\n DID_IMAGE_PREVIEW_CONTAINER_CREATE: didCreatePreviewContainer,\n DID_FINISH_CALCULATE_PREVIEWSIZE: drawPreview,\n DID_UPDATE_ITEM_METADATA: didUpdateItemMetadata,\n\n // file states\n DID_THROW_ITEM_LOAD_ERROR: didThrowError,\n DID_THROW_ITEM_PROCESSING_ERROR: didThrowError,\n DID_THROW_ITEM_INVALID: didThrowError,\n DID_COMPLETE_ITEM_PROCESSING: didCompleteProcessing,\n DID_START_ITEM_PROCESSING: restoreOverlay,\n DID_REVERT_ITEM_PROCESSING: restoreOverlay\n },\n\n function(_ref15) {\n var root = _ref15.root;\n // views on death row\n var viewsToRemove = root.ref.imageViewBin.filter(function(imageView) {\n return imageView.opacity === 0;\n });\n\n // views to retain\n root.ref.imageViewBin = root.ref.imageViewBin.filter(function(\n imageView\n ) {\n return imageView.opacity > 0;\n });\n\n // remove these views\n viewsToRemove.forEach(function(imageView) {\n return removeImageView(root, imageView);\n });\n viewsToRemove.length = 0;\n }\n )\n });\n };\n\n /**\n * Image Preview Plugin\n */\n var plugin = function plugin(fpAPI) {\n var addFilter = fpAPI.addFilter,\n utils = fpAPI.utils;\n var Type = utils.Type,\n createRoute = utils.createRoute,\n isFile = utils.isFile;\n\n // imagePreviewView\n var imagePreviewView = createImageWrapperView(fpAPI);\n\n // called for each view that is created right after the 'create' method\n addFilter('CREATE_VIEW', function(viewAPI) {\n // get reference to created view\n var is = viewAPI.is,\n view = viewAPI.view,\n query = viewAPI.query;\n\n // only hook up to item view and only if is enabled for this cropper\n if (!is('file') || !query('GET_ALLOW_IMAGE_PREVIEW')) return;\n\n // create the image preview plugin, but only do so if the item is an image\n var didLoadItem = function didLoadItem(_ref) {\n var root = _ref.root,\n props = _ref.props;\n var id = props.id;\n var item = query('GET_ITEM', id);\n\n // item could theoretically have been removed in the mean time\n if (!item || !isFile(item.file) || item.archived) return;\n\n // get the file object\n var file = item.file;\n\n // exit if this is not an image\n if (!isPreviewableImage(file)) return;\n\n // test if is filtered\n if (!query('GET_IMAGE_PREVIEW_FILTER_ITEM')(item)) return;\n\n // exit if image size is too high and no createImageBitmap support\n // this would simply bring the browser to its knees and that is not what we want\n var supportsCreateImageBitmap = 'createImageBitmap' in (window || {});\n var maxPreviewFileSize = query('GET_IMAGE_PREVIEW_MAX_FILE_SIZE');\n if (\n !supportsCreateImageBitmap &&\n maxPreviewFileSize &&\n file.size > maxPreviewFileSize\n )\n return;\n\n // set preview view\n root.ref.imagePreview = view.appendChildView(\n view.createChildView(imagePreviewView, { id: id })\n );\n\n // update height if is fixed\n var fixedPreviewHeight = root.query('GET_IMAGE_PREVIEW_HEIGHT');\n if (fixedPreviewHeight) {\n root.dispatch('DID_UPDATE_PANEL_HEIGHT', {\n id: item.id,\n height: fixedPreviewHeight\n });\n }\n\n // now ready\n var queue =\n !supportsCreateImageBitmap &&\n file.size > query('GET_IMAGE_PREVIEW_MAX_INSTANT_PREVIEW_FILE_SIZE');\n root.dispatch('DID_IMAGE_PREVIEW_CONTAINER_CREATE', { id: id }, queue);\n };\n\n var rescaleItem = function rescaleItem(root, props) {\n if (!root.ref.imagePreview) return;\n var id = props.id;\n\n // get item\n var item = root.query('GET_ITEM', { id: id });\n if (!item) return;\n\n // if is fixed height or panel has aspect ratio, exit here, height has already been defined\n var panelAspectRatio = root.query('GET_PANEL_ASPECT_RATIO');\n var itemPanelAspectRatio = root.query('GET_ITEM_PANEL_ASPECT_RATIO');\n var fixedHeight = root.query('GET_IMAGE_PREVIEW_HEIGHT');\n if (panelAspectRatio || itemPanelAspectRatio || fixedHeight) return;\n\n // no data!\n var _root$ref = root.ref,\n imageWidth = _root$ref.imageWidth,\n imageHeight = _root$ref.imageHeight;\n if (!imageWidth || !imageHeight) return;\n\n // get height min and max\n var minPreviewHeight = root.query('GET_IMAGE_PREVIEW_MIN_HEIGHT');\n var maxPreviewHeight = root.query('GET_IMAGE_PREVIEW_MAX_HEIGHT');\n\n // orientation info\n var exif = item.getMetadata('exif') || {};\n var orientation = exif.orientation || -1;\n\n // get width and height from action, and swap of orientation is incorrect\n if (orientation >= 5 && orientation <= 8) {\n var _ref2 = [imageHeight, imageWidth];\n imageWidth = _ref2[0];\n imageHeight = _ref2[1];\n }\n\n // scale up width and height when we're dealing with an SVG\n if (!isBitmap(item.file) || root.query('GET_IMAGE_PREVIEW_UPSCALE')) {\n var scalar = 2048 / imageWidth;\n imageWidth *= scalar;\n imageHeight *= scalar;\n }\n\n // image aspect ratio\n var imageAspectRatio = imageHeight / imageWidth;\n\n // we need the item to get to the crop size\n var previewAspectRatio =\n (item.getMetadata('crop') || {}).aspectRatio || imageAspectRatio;\n\n // preview height range\n var previewHeightMax = Math.max(\n minPreviewHeight,\n Math.min(imageHeight, maxPreviewHeight)\n );\n\n var itemWidth = root.rect.element.width;\n var previewHeight = Math.min(\n itemWidth * previewAspectRatio,\n previewHeightMax\n );\n\n // request update to panel height\n root.dispatch('DID_UPDATE_PANEL_HEIGHT', {\n id: item.id,\n height: previewHeight\n });\n };\n\n var didResizeView = function didResizeView(_ref3) {\n var root = _ref3.root;\n // actions in next write operation\n root.ref.shouldRescale = true;\n };\n\n var didUpdateItemMetadata = function didUpdateItemMetadata(_ref4) {\n var root = _ref4.root,\n action = _ref4.action;\n if (action.change.key !== 'crop') return;\n\n // actions in next write operation\n root.ref.shouldRescale = true;\n };\n\n var didCalculatePreviewSize = function didCalculatePreviewSize(_ref5) {\n var root = _ref5.root,\n action = _ref5.action;\n // remember dimensions\n root.ref.imageWidth = action.width;\n root.ref.imageHeight = action.height;\n\n // actions in next write operation\n root.ref.shouldRescale = true;\n root.ref.shouldDrawPreview = true;\n\n // as image load could take a while and fire when draw loop is resting we need to give it a kick\n root.dispatch('KICK');\n };\n\n // start writing\n view.registerWriter(\n createRoute(\n {\n DID_RESIZE_ROOT: didResizeView,\n DID_STOP_RESIZE: didResizeView,\n DID_LOAD_ITEM: didLoadItem,\n DID_IMAGE_PREVIEW_CALCULATE_SIZE: didCalculatePreviewSize,\n DID_UPDATE_ITEM_METADATA: didUpdateItemMetadata\n },\n\n function(_ref6) {\n var root = _ref6.root,\n props = _ref6.props;\n // no preview view attached\n if (!root.ref.imagePreview) return;\n\n // don't do anything while hidden\n if (root.rect.element.hidden) return;\n\n // resize the item panel\n if (root.ref.shouldRescale) {\n rescaleItem(root, props);\n root.ref.shouldRescale = false;\n }\n\n if (root.ref.shouldDrawPreview) {\n // queue till next frame so we're sure the height has been applied this forces the draw image call inside the wrapper view to use the correct height\n requestAnimationFrame(function() {\n // this requestAnimationFrame nesting is horrible but it fixes an issue with 100hz displays on Chrome\n // https://github.com/pqina/filepond-plugin-image-preview/issues/57\n requestAnimationFrame(function() {\n root.dispatch('DID_FINISH_CALCULATE_PREVIEWSIZE', {\n id: props.id\n });\n });\n });\n\n root.ref.shouldDrawPreview = false;\n }\n }\n )\n );\n });\n\n // expose plugin\n return {\n options: {\n // Enable or disable image preview\n allowImagePreview: [true, Type.BOOLEAN],\n\n // filters file items to determine which are shown as preview\n imagePreviewFilterItem: [\n function() {\n return true;\n },\n Type.FUNCTION\n ],\n\n // Fixed preview height\n imagePreviewHeight: [null, Type.INT],\n\n // Min image height\n imagePreviewMinHeight: [44, Type.INT],\n\n // Max image height\n imagePreviewMaxHeight: [256, Type.INT],\n\n // Max size of preview file for when createImageBitmap is not supported\n imagePreviewMaxFileSize: [null, Type.INT],\n\n // The amount of extra pixels added to the image preview to allow comfortable zooming\n imagePreviewZoomFactor: [2, Type.INT],\n\n // Should we upscale small images to fit the max bounding box of the preview area\n imagePreviewUpscale: [false, Type.BOOLEAN],\n\n // Max size of preview file that we allow to try to instant preview if createImageBitmap is not supported, else image is queued for loading\n imagePreviewMaxInstantPreviewFileSize: [1000000, Type.INT],\n\n // Style of the transparancy indicator used behind images\n imagePreviewTransparencyIndicator: [null, Type.STRING],\n\n // Enables or disables reading average image color\n imagePreviewCalculateAverageImageColor: [false, Type.BOOLEAN],\n\n // Enables or disables the previewing of markup\n imagePreviewMarkupShow: [true, Type.BOOLEAN],\n\n // Allows filtering of markup to only show certain shapes\n imagePreviewMarkupFilter: [\n function() {\n return true;\n },\n Type.FUNCTION\n ]\n }\n };\n };\n\n // fire pluginloaded event if running in browser, this allows registering the plugin when using async script tags\n var isBrowser =\n typeof window !== 'undefined' && typeof window.document !== 'undefined';\n if (isBrowser) {\n document.dispatchEvent(\n new CustomEvent('FilePond:pluginloaded', { detail: plugin })\n );\n }\n\n return plugin;\n});\n","/*!\n * FilePond 4.32.5\n * Licensed under MIT, https://opensource.org/licenses/MIT/\n * Please visit https://pqina.nl/filepond/ for details.\n */\n\n/* eslint-disable */\n\n(function(global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined'\n ? factory(exports)\n : typeof define === 'function' && define.amd\n ? define(['exports'], factory)\n : ((global = global || self), factory((global.FilePond = {})));\n})(this, function(exports) {\n 'use strict';\n\n var isNode = function isNode(value) {\n return value instanceof HTMLElement;\n };\n\n var createStore = function createStore(initialState) {\n var queries = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var actions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n // internal state\n var state = Object.assign({}, initialState);\n\n // contains all actions for next frame, is clear when actions are requested\n var actionQueue = [];\n var dispatchQueue = [];\n\n // returns a duplicate of the current state\n var getState = function getState() {\n return Object.assign({}, state);\n };\n\n // returns a duplicate of the actions array and clears the actions array\n var processActionQueue = function processActionQueue() {\n // create copy of actions queue\n var queue = [].concat(actionQueue);\n\n // clear actions queue (we don't want no double actions)\n actionQueue.length = 0;\n\n return queue;\n };\n\n // processes actions that might block the main UI thread\n var processDispatchQueue = function processDispatchQueue() {\n // create copy of actions queue\n var queue = [].concat(dispatchQueue);\n\n // clear actions queue (we don't want no double actions)\n dispatchQueue.length = 0;\n\n // now dispatch these actions\n queue.forEach(function(_ref) {\n var type = _ref.type,\n data = _ref.data;\n dispatch(type, data);\n });\n };\n\n // adds a new action, calls its handler and\n var dispatch = function dispatch(type, data, isBlocking) {\n // is blocking action (should never block if document is hidden)\n if (isBlocking && !document.hidden) {\n dispatchQueue.push({ type: type, data: data });\n return;\n }\n\n // if this action has a handler, handle the action\n if (actionHandlers[type]) {\n actionHandlers[type](data);\n }\n\n // now add action\n actionQueue.push({\n type: type,\n data: data,\n });\n };\n\n var query = function query(str) {\n var _queryHandles;\n for (\n var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n return queryHandles[str]\n ? (_queryHandles = queryHandles)[str].apply(_queryHandles, args)\n : null;\n };\n\n var api = {\n getState: getState,\n processActionQueue: processActionQueue,\n processDispatchQueue: processDispatchQueue,\n dispatch: dispatch,\n query: query,\n };\n\n var queryHandles = {};\n queries.forEach(function(query) {\n queryHandles = Object.assign({}, query(state), {}, queryHandles);\n });\n\n var actionHandlers = {};\n actions.forEach(function(action) {\n actionHandlers = Object.assign({}, action(dispatch, query, state), {}, actionHandlers);\n });\n\n return api;\n };\n\n var defineProperty = function defineProperty(obj, property, definition) {\n if (typeof definition === 'function') {\n obj[property] = definition;\n return;\n }\n Object.defineProperty(obj, property, Object.assign({}, definition));\n };\n\n var forin = function forin(obj, cb) {\n for (var key in obj) {\n if (!obj.hasOwnProperty(key)) {\n continue;\n }\n\n cb(key, obj[key]);\n }\n };\n\n var createObject = function createObject(definition) {\n var obj = {};\n forin(definition, function(property) {\n defineProperty(obj, property, definition[property]);\n });\n return obj;\n };\n\n var attr = function attr(node, name) {\n var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n if (value === null) {\n return node.getAttribute(name) || node.hasAttribute(name);\n }\n node.setAttribute(name, value);\n };\n\n var ns = 'http://www.w3.org/2000/svg';\n var svgElements = ['svg', 'path']; // only svg elements used\n\n var isSVGElement = function isSVGElement(tag) {\n return svgElements.includes(tag);\n };\n\n var createElement = function createElement(tag, className) {\n var attributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n if (typeof className === 'object') {\n attributes = className;\n className = null;\n }\n var element = isSVGElement(tag)\n ? document.createElementNS(ns, tag)\n : document.createElement(tag);\n if (className) {\n if (isSVGElement(tag)) {\n attr(element, 'class', className);\n } else {\n element.className = className;\n }\n }\n forin(attributes, function(name, value) {\n attr(element, name, value);\n });\n return element;\n };\n\n var appendChild = function appendChild(parent) {\n return function(child, index) {\n if (typeof index !== 'undefined' && parent.children[index]) {\n parent.insertBefore(child, parent.children[index]);\n } else {\n parent.appendChild(child);\n }\n };\n };\n\n var appendChildView = function appendChildView(parent, childViews) {\n return function(view, index) {\n if (typeof index !== 'undefined') {\n childViews.splice(index, 0, view);\n } else {\n childViews.push(view);\n }\n\n return view;\n };\n };\n\n var removeChildView = function removeChildView(parent, childViews) {\n return function(view) {\n // remove from child views\n childViews.splice(childViews.indexOf(view), 1);\n\n // remove the element\n if (view.element.parentNode) {\n parent.removeChild(view.element);\n }\n\n return view;\n };\n };\n\n var IS_BROWSER = (function() {\n return typeof window !== 'undefined' && typeof window.document !== 'undefined';\n })();\n var isBrowser = function isBrowser() {\n return IS_BROWSER;\n };\n\n var testElement = isBrowser() ? createElement('svg') : {};\n var getChildCount =\n 'children' in testElement\n ? function(el) {\n return el.children.length;\n }\n : function(el) {\n return el.childNodes.length;\n };\n\n var getViewRect = function getViewRect(elementRect, childViews, offset, scale) {\n var left = offset[0] || elementRect.left;\n var top = offset[1] || elementRect.top;\n var right = left + elementRect.width;\n var bottom = top + elementRect.height * (scale[1] || 1);\n\n var rect = {\n // the rectangle of the element itself\n element: Object.assign({}, elementRect),\n\n // the rectangle of the element expanded to contain its children, does not include any margins\n inner: {\n left: elementRect.left,\n top: elementRect.top,\n right: elementRect.right,\n bottom: elementRect.bottom,\n },\n\n // the rectangle of the element expanded to contain its children including own margin and child margins\n // margins will be added after we've recalculated the size\n outer: {\n left: left,\n top: top,\n right: right,\n bottom: bottom,\n },\n };\n\n // expand rect to fit all child rectangles\n childViews\n .filter(function(childView) {\n return !childView.isRectIgnored();\n })\n .map(function(childView) {\n return childView.rect;\n })\n .forEach(function(childViewRect) {\n expandRect(rect.inner, Object.assign({}, childViewRect.inner));\n expandRect(rect.outer, Object.assign({}, childViewRect.outer));\n });\n\n // calculate inner width and height\n calculateRectSize(rect.inner);\n\n // append additional margin (top and left margins are included in top and left automatically)\n rect.outer.bottom += rect.element.marginBottom;\n rect.outer.right += rect.element.marginRight;\n\n // calculate outer width and height\n calculateRectSize(rect.outer);\n\n return rect;\n };\n\n var expandRect = function expandRect(parent, child) {\n // adjust for parent offset\n child.top += parent.top;\n child.right += parent.left;\n child.bottom += parent.top;\n child.left += parent.left;\n\n if (child.bottom > parent.bottom) {\n parent.bottom = child.bottom;\n }\n\n if (child.right > parent.right) {\n parent.right = child.right;\n }\n };\n\n var calculateRectSize = function calculateRectSize(rect) {\n rect.width = rect.right - rect.left;\n rect.height = rect.bottom - rect.top;\n };\n\n var isNumber = function isNumber(value) {\n return typeof value === 'number';\n };\n\n /**\n * Determines if position is at destination\n * @param position\n * @param destination\n * @param velocity\n * @param errorMargin\n * @returns {boolean}\n */\n var thereYet = function thereYet(position, destination, velocity) {\n var errorMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0.001;\n return Math.abs(position - destination) < errorMargin && Math.abs(velocity) < errorMargin;\n };\n\n /**\n * Spring animation\n */\n var spring =\n // default options\n function spring() // method definition\n {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$stiffness = _ref.stiffness,\n stiffness = _ref$stiffness === void 0 ? 0.5 : _ref$stiffness,\n _ref$damping = _ref.damping,\n damping = _ref$damping === void 0 ? 0.75 : _ref$damping,\n _ref$mass = _ref.mass,\n mass = _ref$mass === void 0 ? 10 : _ref$mass;\n var target = null;\n var position = null;\n var velocity = 0;\n var resting = false;\n\n // updates spring state\n var interpolate = function interpolate(ts, skipToEndState) {\n // in rest, don't animate\n if (resting) return;\n\n // need at least a target or position to do springy things\n if (!(isNumber(target) && isNumber(position))) {\n resting = true;\n velocity = 0;\n return;\n }\n\n // calculate spring force\n var f = -(position - target) * stiffness;\n\n // update velocity by adding force based on mass\n velocity += f / mass;\n\n // update position by adding velocity\n position += velocity;\n\n // slow down based on amount of damping\n velocity *= damping;\n\n // we've arrived if we're near target and our velocity is near zero\n if (thereYet(position, target, velocity) || skipToEndState) {\n position = target;\n velocity = 0;\n resting = true;\n\n // we done\n api.onupdate(position);\n api.oncomplete(position);\n } else {\n // progress update\n api.onupdate(position);\n }\n };\n\n /**\n * Set new target value\n * @param value\n */\n var setTarget = function setTarget(value) {\n // if currently has no position, set target and position to this value\n if (isNumber(value) && !isNumber(position)) {\n position = value;\n }\n\n // next target value will not be animated to\n if (target === null) {\n target = value;\n position = value;\n }\n\n // let start moving to target\n target = value;\n\n // already at target\n if (position === target || typeof target === 'undefined') {\n // now resting as target is current position, stop moving\n resting = true;\n velocity = 0;\n\n // done!\n api.onupdate(position);\n api.oncomplete(position);\n\n return;\n }\n\n resting = false;\n };\n\n // need 'api' to call onupdate callback\n var api = createObject({\n interpolate: interpolate,\n target: {\n set: setTarget,\n get: function get() {\n return target;\n },\n },\n\n resting: {\n get: function get() {\n return resting;\n },\n },\n\n onupdate: function onupdate(value) {},\n oncomplete: function oncomplete(value) {},\n });\n\n return api;\n };\n\n var easeLinear = function easeLinear(t) {\n return t;\n };\n var easeInOutQuad = function easeInOutQuad(t) {\n return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n };\n\n var tween =\n // default values\n function tween() // method definition\n {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$duration = _ref.duration,\n duration = _ref$duration === void 0 ? 500 : _ref$duration,\n _ref$easing = _ref.easing,\n easing = _ref$easing === void 0 ? easeInOutQuad : _ref$easing,\n _ref$delay = _ref.delay,\n delay = _ref$delay === void 0 ? 0 : _ref$delay;\n var start = null;\n var t;\n var p;\n var resting = true;\n var reverse = false;\n var target = null;\n\n var interpolate = function interpolate(ts, skipToEndState) {\n if (resting || target === null) return;\n\n if (start === null) {\n start = ts;\n }\n\n if (ts - start < delay) return;\n\n t = ts - start - delay;\n\n if (t >= duration || skipToEndState) {\n t = 1;\n p = reverse ? 0 : 1;\n api.onupdate(p * target);\n api.oncomplete(p * target);\n resting = true;\n } else {\n p = t / duration;\n api.onupdate((t >= 0 ? easing(reverse ? 1 - p : p) : 0) * target);\n }\n };\n\n // need 'api' to call onupdate callback\n var api = createObject({\n interpolate: interpolate,\n target: {\n get: function get() {\n return reverse ? 0 : target;\n },\n set: function set(value) {\n // is initial value\n if (target === null) {\n target = value;\n api.onupdate(value);\n api.oncomplete(value);\n return;\n }\n\n // want to tween to a smaller value and have a current value\n if (value < target) {\n target = 1;\n reverse = true;\n } else {\n // not tweening to a smaller value\n reverse = false;\n target = value;\n }\n\n // let's go!\n resting = false;\n start = null;\n },\n },\n\n resting: {\n get: function get() {\n return resting;\n },\n },\n\n onupdate: function onupdate(value) {},\n oncomplete: function oncomplete(value) {},\n });\n\n return api;\n };\n\n var animator = {\n spring: spring,\n tween: tween,\n };\n\n /*\n { type: 'spring', stiffness: .5, damping: .75, mass: 10 };\n { translation: { type: 'spring', ... }, ... }\n { translation: { x: { type: 'spring', ... } } }\n */\n var createAnimator = function createAnimator(definition, category, property) {\n // default is single definition\n // we check if transform is set, if so, we check if property is set\n var def =\n definition[category] && typeof definition[category][property] === 'object'\n ? definition[category][property]\n : definition[category] || definition;\n\n var type = typeof def === 'string' ? def : def.type;\n var props = typeof def === 'object' ? Object.assign({}, def) : {};\n\n return animator[type] ? animator[type](props) : null;\n };\n\n var addGetSet = function addGetSet(keys, obj, props) {\n var overwrite = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n obj = Array.isArray(obj) ? obj : [obj];\n obj.forEach(function(o) {\n keys.forEach(function(key) {\n var name = key;\n var getter = function getter() {\n return props[key];\n };\n var setter = function setter(value) {\n return (props[key] = value);\n };\n\n if (typeof key === 'object') {\n name = key.key;\n getter = key.getter || getter;\n setter = key.setter || setter;\n }\n\n if (o[name] && !overwrite) {\n return;\n }\n\n o[name] = {\n get: getter,\n set: setter,\n };\n });\n });\n };\n\n // add to state,\n // add getters and setters to internal and external api (if not set)\n // setup animators\n\n var animations = function animations(_ref) {\n var mixinConfig = _ref.mixinConfig,\n viewProps = _ref.viewProps,\n viewInternalAPI = _ref.viewInternalAPI,\n viewExternalAPI = _ref.viewExternalAPI;\n // initial properties\n var initialProps = Object.assign({}, viewProps);\n\n // list of all active animations\n var animations = [];\n\n // setup animators\n forin(mixinConfig, function(property, animation) {\n var animator = createAnimator(animation);\n if (!animator) {\n return;\n }\n\n // when the animator updates, update the view state value\n animator.onupdate = function(value) {\n viewProps[property] = value;\n };\n\n // set animator target\n animator.target = initialProps[property];\n\n // when value is set, set the animator target value\n var prop = {\n key: property,\n setter: function setter(value) {\n // if already at target, we done!\n if (animator.target === value) {\n return;\n }\n\n animator.target = value;\n },\n getter: function getter() {\n return viewProps[property];\n },\n };\n\n // add getters and setters\n addGetSet([prop], [viewInternalAPI, viewExternalAPI], viewProps, true);\n\n // add it to the list for easy updating from the _write method\n animations.push(animator);\n });\n\n // expose internal write api\n return {\n write: function write(ts) {\n var skipToEndState = document.hidden;\n var resting = true;\n animations.forEach(function(animation) {\n if (!animation.resting) resting = false;\n animation.interpolate(ts, skipToEndState);\n });\n return resting;\n },\n destroy: function destroy() {},\n };\n };\n\n var addEvent = function addEvent(element) {\n return function(type, fn) {\n element.addEventListener(type, fn);\n };\n };\n\n var removeEvent = function removeEvent(element) {\n return function(type, fn) {\n element.removeEventListener(type, fn);\n };\n };\n\n // mixin\n var listeners = function listeners(_ref) {\n var mixinConfig = _ref.mixinConfig,\n viewProps = _ref.viewProps,\n viewInternalAPI = _ref.viewInternalAPI,\n viewExternalAPI = _ref.viewExternalAPI,\n viewState = _ref.viewState,\n view = _ref.view;\n var events = [];\n\n var add = addEvent(view.element);\n var remove = removeEvent(view.element);\n\n viewExternalAPI.on = function(type, fn) {\n events.push({\n type: type,\n fn: fn,\n });\n\n add(type, fn);\n };\n\n viewExternalAPI.off = function(type, fn) {\n events.splice(\n events.findIndex(function(event) {\n return event.type === type && event.fn === fn;\n }),\n 1\n );\n\n remove(type, fn);\n };\n\n return {\n write: function write() {\n // not busy\n return true;\n },\n destroy: function destroy() {\n events.forEach(function(event) {\n remove(event.type, event.fn);\n });\n },\n };\n };\n\n // add to external api and link to props\n\n var apis = function apis(_ref) {\n var mixinConfig = _ref.mixinConfig,\n viewProps = _ref.viewProps,\n viewExternalAPI = _ref.viewExternalAPI;\n addGetSet(mixinConfig, viewExternalAPI, viewProps);\n };\n\n var isDefined = function isDefined(value) {\n return value != null;\n };\n\n // add to state,\n // add getters and setters to internal and external api (if not set)\n // set initial state based on props in viewProps\n // apply as transforms each frame\n\n var defaults = {\n opacity: 1,\n scaleX: 1,\n scaleY: 1,\n translateX: 0,\n translateY: 0,\n rotateX: 0,\n rotateY: 0,\n rotateZ: 0,\n originX: 0,\n originY: 0,\n };\n\n var styles = function styles(_ref) {\n var mixinConfig = _ref.mixinConfig,\n viewProps = _ref.viewProps,\n viewInternalAPI = _ref.viewInternalAPI,\n viewExternalAPI = _ref.viewExternalAPI,\n view = _ref.view;\n // initial props\n var initialProps = Object.assign({}, viewProps);\n\n // current props\n var currentProps = {};\n\n // we will add those properties to the external API and link them to the viewState\n addGetSet(mixinConfig, [viewInternalAPI, viewExternalAPI], viewProps);\n\n // override rect on internal and external rect getter so it takes in account transforms\n var getOffset = function getOffset() {\n return [viewProps['translateX'] || 0, viewProps['translateY'] || 0];\n };\n\n var getScale = function getScale() {\n return [viewProps['scaleX'] || 0, viewProps['scaleY'] || 0];\n };\n var getRect = function getRect() {\n return view.rect\n ? getViewRect(view.rect, view.childViews, getOffset(), getScale())\n : null;\n };\n viewInternalAPI.rect = { get: getRect };\n viewExternalAPI.rect = { get: getRect };\n\n // apply view props\n mixinConfig.forEach(function(key) {\n viewProps[key] =\n typeof initialProps[key] === 'undefined' ? defaults[key] : initialProps[key];\n });\n\n // expose api\n return {\n write: function write() {\n // see if props have changed\n if (!propsHaveChanged(currentProps, viewProps)) {\n return;\n }\n\n // moves element to correct position on screen\n applyStyles(view.element, viewProps);\n\n // store new transforms\n Object.assign(currentProps, Object.assign({}, viewProps));\n\n // no longer busy\n return true;\n },\n destroy: function destroy() {},\n };\n };\n\n var propsHaveChanged = function propsHaveChanged(currentProps, newProps) {\n // different amount of keys\n if (Object.keys(currentProps).length !== Object.keys(newProps).length) {\n return true;\n }\n\n // lets analyze the individual props\n for (var prop in newProps) {\n if (newProps[prop] !== currentProps[prop]) {\n return true;\n }\n }\n\n return false;\n };\n\n var applyStyles = function applyStyles(element, _ref2) {\n var opacity = _ref2.opacity,\n perspective = _ref2.perspective,\n translateX = _ref2.translateX,\n translateY = _ref2.translateY,\n scaleX = _ref2.scaleX,\n scaleY = _ref2.scaleY,\n rotateX = _ref2.rotateX,\n rotateY = _ref2.rotateY,\n rotateZ = _ref2.rotateZ,\n originX = _ref2.originX,\n originY = _ref2.originY,\n width = _ref2.width,\n height = _ref2.height;\n\n var transforms = '';\n var styles = '';\n\n // handle transform origin\n if (isDefined(originX) || isDefined(originY)) {\n styles += 'transform-origin: ' + (originX || 0) + 'px ' + (originY || 0) + 'px;';\n }\n\n // transform order is relevant\n // 0. perspective\n if (isDefined(perspective)) {\n transforms += 'perspective(' + perspective + 'px) ';\n }\n\n // 1. translate\n if (isDefined(translateX) || isDefined(translateY)) {\n transforms +=\n 'translate3d(' + (translateX || 0) + 'px, ' + (translateY || 0) + 'px, 0) ';\n }\n\n // 2. scale\n if (isDefined(scaleX) || isDefined(scaleY)) {\n transforms +=\n 'scale3d(' +\n (isDefined(scaleX) ? scaleX : 1) +\n ', ' +\n (isDefined(scaleY) ? scaleY : 1) +\n ', 1) ';\n }\n\n // 3. rotate\n if (isDefined(rotateZ)) {\n transforms += 'rotateZ(' + rotateZ + 'rad) ';\n }\n\n if (isDefined(rotateX)) {\n transforms += 'rotateX(' + rotateX + 'rad) ';\n }\n\n if (isDefined(rotateY)) {\n transforms += 'rotateY(' + rotateY + 'rad) ';\n }\n\n // add transforms\n if (transforms.length) {\n styles += 'transform:' + transforms + ';';\n }\n\n // add opacity\n if (isDefined(opacity)) {\n styles += 'opacity:' + opacity + ';';\n\n // if we reach zero, we make the element inaccessible\n if (opacity === 0) {\n styles += 'visibility:hidden;';\n }\n\n // if we're below 100% opacity this element can't be clicked\n if (opacity < 1) {\n styles += 'pointer-events:none;';\n }\n }\n\n // add height\n if (isDefined(height)) {\n styles += 'height:' + height + 'px;';\n }\n\n // add width\n if (isDefined(width)) {\n styles += 'width:' + width + 'px;';\n }\n\n // apply styles\n var elementCurrentStyle = element.elementCurrentStyle || '';\n\n // if new styles does not match current styles, lets update!\n if (styles.length !== elementCurrentStyle.length || styles !== elementCurrentStyle) {\n element.style.cssText = styles;\n // store current styles so we can compare them to new styles later on\n // _not_ getting the style value is faster\n element.elementCurrentStyle = styles;\n }\n };\n\n var Mixins = {\n styles: styles,\n listeners: listeners,\n animations: animations,\n apis: apis,\n };\n\n var updateRect = function updateRect() {\n var rect = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var element = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var style = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n if (!element.layoutCalculated) {\n rect.paddingTop = parseInt(style.paddingTop, 10) || 0;\n rect.marginTop = parseInt(style.marginTop, 10) || 0;\n rect.marginRight = parseInt(style.marginRight, 10) || 0;\n rect.marginBottom = parseInt(style.marginBottom, 10) || 0;\n rect.marginLeft = parseInt(style.marginLeft, 10) || 0;\n element.layoutCalculated = true;\n }\n\n rect.left = element.offsetLeft || 0;\n rect.top = element.offsetTop || 0;\n rect.width = element.offsetWidth || 0;\n rect.height = element.offsetHeight || 0;\n\n rect.right = rect.left + rect.width;\n rect.bottom = rect.top + rect.height;\n\n rect.scrollTop = element.scrollTop;\n\n rect.hidden = element.offsetParent === null;\n\n return rect;\n };\n\n var createView =\n // default view definition\n function createView() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},\n _ref$tag = _ref.tag,\n tag = _ref$tag === void 0 ? 'div' : _ref$tag,\n _ref$name = _ref.name,\n name = _ref$name === void 0 ? null : _ref$name,\n _ref$attributes = _ref.attributes,\n attributes = _ref$attributes === void 0 ? {} : _ref$attributes,\n _ref$read = _ref.read,\n read = _ref$read === void 0 ? function() {} : _ref$read,\n _ref$write = _ref.write,\n write = _ref$write === void 0 ? function() {} : _ref$write,\n _ref$create = _ref.create,\n create = _ref$create === void 0 ? function() {} : _ref$create,\n _ref$destroy = _ref.destroy,\n destroy = _ref$destroy === void 0 ? function() {} : _ref$destroy,\n _ref$filterFrameActio = _ref.filterFrameActionsForChild,\n filterFrameActionsForChild =\n _ref$filterFrameActio === void 0\n ? function(child, actions) {\n return actions;\n }\n : _ref$filterFrameActio,\n _ref$didCreateView = _ref.didCreateView,\n didCreateView = _ref$didCreateView === void 0 ? function() {} : _ref$didCreateView,\n _ref$didWriteView = _ref.didWriteView,\n didWriteView = _ref$didWriteView === void 0 ? function() {} : _ref$didWriteView,\n _ref$ignoreRect = _ref.ignoreRect,\n ignoreRect = _ref$ignoreRect === void 0 ? false : _ref$ignoreRect,\n _ref$ignoreRectUpdate = _ref.ignoreRectUpdate,\n ignoreRectUpdate = _ref$ignoreRectUpdate === void 0 ? false : _ref$ignoreRectUpdate,\n _ref$mixins = _ref.mixins,\n mixins = _ref$mixins === void 0 ? [] : _ref$mixins;\n return function(\n // each view requires reference to store\n store\n ) {\n var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // root element should not be changed\n var element = createElement(tag, 'filepond--' + name, attributes);\n\n // style reference should also not be changed\n var style = window.getComputedStyle(element, null);\n\n // element rectangle\n var rect = updateRect();\n var frameRect = null;\n\n // rest state\n var isResting = false;\n\n // pretty self explanatory\n var childViews = [];\n\n // loaded mixins\n var activeMixins = [];\n\n // references to created children\n var ref = {};\n\n // state used for each instance\n var state = {};\n\n // list of writers that will be called to update this view\n var writers = [\n write, // default writer\n ];\n\n var readers = [\n read, // default reader\n ];\n\n var destroyers = [\n destroy, // default destroy\n ];\n\n // core view methods\n var getElement = function getElement() {\n return element;\n };\n var getChildViews = function getChildViews() {\n return childViews.concat();\n };\n var getReference = function getReference() {\n return ref;\n };\n var createChildView = function createChildView(store) {\n return function(view, props) {\n return view(store, props);\n };\n };\n var getRect = function getRect() {\n if (frameRect) {\n return frameRect;\n }\n frameRect = getViewRect(rect, childViews, [0, 0], [1, 1]);\n return frameRect;\n };\n var getStyle = function getStyle() {\n return style;\n };\n\n /**\n * Read data from DOM\n * @private\n */\n var _read = function _read() {\n frameRect = null;\n\n // read child views\n childViews.forEach(function(child) {\n return child._read();\n });\n\n var shouldUpdate = !(ignoreRectUpdate && rect.width && rect.height);\n if (shouldUpdate) {\n updateRect(rect, element, style);\n }\n\n // readers\n var api = { root: internalAPI, props: props, rect: rect };\n readers.forEach(function(reader) {\n return reader(api);\n });\n };\n\n /**\n * Write data to DOM\n * @private\n */\n var _write = function _write(ts, frameActions, shouldOptimize) {\n // if no actions, we assume that the view is resting\n var resting = frameActions.length === 0;\n\n // writers\n writers.forEach(function(writer) {\n var writerResting = writer({\n props: props,\n root: internalAPI,\n actions: frameActions,\n timestamp: ts,\n shouldOptimize: shouldOptimize,\n });\n\n if (writerResting === false) {\n resting = false;\n }\n });\n\n // run mixins\n activeMixins.forEach(function(mixin) {\n // if one of the mixins is still busy after write operation, we are not resting\n var mixinResting = mixin.write(ts);\n if (mixinResting === false) {\n resting = false;\n }\n });\n\n // updates child views that are currently attached to the DOM\n childViews\n .filter(function(child) {\n return !!child.element.parentNode;\n })\n .forEach(function(child) {\n // if a child view is not resting, we are not resting\n var childResting = child._write(\n ts,\n filterFrameActionsForChild(child, frameActions),\n shouldOptimize\n );\n\n if (!childResting) {\n resting = false;\n }\n });\n\n // append new elements to DOM and update those\n childViews\n //.filter(child => !child.element.parentNode)\n .forEach(function(child, index) {\n // skip\n if (child.element.parentNode) {\n return;\n }\n\n // append to DOM\n internalAPI.appendChild(child.element, index);\n\n // call read (need to know the size of these elements)\n child._read();\n\n // re-call write\n child._write(\n ts,\n filterFrameActionsForChild(child, frameActions),\n shouldOptimize\n );\n\n // we just added somthing to the dom, no rest\n resting = false;\n });\n\n // update resting state\n isResting = resting;\n\n didWriteView({\n props: props,\n root: internalAPI,\n actions: frameActions,\n timestamp: ts,\n });\n\n // let parent know if we are resting\n return resting;\n };\n\n var _destroy = function _destroy() {\n activeMixins.forEach(function(mixin) {\n return mixin.destroy();\n });\n destroyers.forEach(function(destroyer) {\n destroyer({ root: internalAPI, props: props });\n });\n childViews.forEach(function(child) {\n return child._destroy();\n });\n };\n\n // sharedAPI\n var sharedAPIDefinition = {\n element: {\n get: getElement,\n },\n\n style: {\n get: getStyle,\n },\n\n childViews: {\n get: getChildViews,\n },\n };\n\n // private API definition\n var internalAPIDefinition = Object.assign({}, sharedAPIDefinition, {\n rect: {\n get: getRect,\n },\n\n // access to custom children references\n ref: {\n get: getReference,\n },\n\n // dom modifiers\n is: function is(needle) {\n return name === needle;\n },\n appendChild: appendChild(element),\n createChildView: createChildView(store),\n linkView: function linkView(view) {\n childViews.push(view);\n return view;\n },\n unlinkView: function unlinkView(view) {\n childViews.splice(childViews.indexOf(view), 1);\n },\n appendChildView: appendChildView(element, childViews),\n removeChildView: removeChildView(element, childViews),\n registerWriter: function registerWriter(writer) {\n return writers.push(writer);\n },\n registerReader: function registerReader(reader) {\n return readers.push(reader);\n },\n registerDestroyer: function registerDestroyer(destroyer) {\n return destroyers.push(destroyer);\n },\n invalidateLayout: function invalidateLayout() {\n return (element.layoutCalculated = false);\n },\n\n // access to data store\n dispatch: store.dispatch,\n query: store.query,\n });\n\n // public view API methods\n var externalAPIDefinition = {\n element: {\n get: getElement,\n },\n\n childViews: {\n get: getChildViews,\n },\n\n rect: {\n get: getRect,\n },\n\n resting: {\n get: function get() {\n return isResting;\n },\n },\n\n isRectIgnored: function isRectIgnored() {\n return ignoreRect;\n },\n _read: _read,\n _write: _write,\n _destroy: _destroy,\n };\n\n // mixin API methods\n var mixinAPIDefinition = Object.assign({}, sharedAPIDefinition, {\n rect: {\n get: function get() {\n return rect;\n },\n },\n });\n\n // add mixin functionality\n Object.keys(mixins)\n .sort(function(a, b) {\n // move styles to the back of the mixin list (so adjustments of other mixins are applied to the props correctly)\n if (a === 'styles') {\n return 1;\n } else if (b === 'styles') {\n return -1;\n }\n return 0;\n })\n .forEach(function(key) {\n var mixinAPI = Mixins[key]({\n mixinConfig: mixins[key],\n viewProps: props,\n viewState: state,\n viewInternalAPI: internalAPIDefinition,\n viewExternalAPI: externalAPIDefinition,\n view: createObject(mixinAPIDefinition),\n });\n\n if (mixinAPI) {\n activeMixins.push(mixinAPI);\n }\n });\n\n // construct private api\n var internalAPI = createObject(internalAPIDefinition);\n\n // create the view\n create({\n root: internalAPI,\n props: props,\n });\n\n // append created child views to root node\n var childCount = getChildCount(element); // need to know the current child count so appending happens in correct order\n childViews.forEach(function(child, index) {\n internalAPI.appendChild(child.element, childCount + index);\n });\n\n // call did create\n didCreateView(internalAPI);\n\n // expose public api\n return createObject(externalAPIDefinition);\n };\n };\n\n var createPainter = function createPainter(read, write) {\n var fps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 60;\n\n var name = '__framePainter';\n\n // set global painter\n if (window[name]) {\n window[name].readers.push(read);\n window[name].writers.push(write);\n return;\n }\n\n window[name] = {\n readers: [read],\n writers: [write],\n };\n\n var painter = window[name];\n\n var interval = 1000 / fps;\n var last = null;\n var id = null;\n var requestTick = null;\n var cancelTick = null;\n\n var setTimerType = function setTimerType() {\n if (document.hidden) {\n requestTick = function requestTick() {\n return window.setTimeout(function() {\n return tick(performance.now());\n }, interval);\n };\n cancelTick = function cancelTick() {\n return window.clearTimeout(id);\n };\n } else {\n requestTick = function requestTick() {\n return window.requestAnimationFrame(tick);\n };\n cancelTick = function cancelTick() {\n return window.cancelAnimationFrame(id);\n };\n }\n };\n\n document.addEventListener('visibilitychange', function() {\n if (cancelTick) cancelTick();\n setTimerType();\n tick(performance.now());\n });\n\n var tick = function tick(ts) {\n // queue next tick\n id = requestTick(tick);\n\n // limit fps\n if (!last) {\n last = ts;\n }\n\n var delta = ts - last;\n\n if (delta <= interval) {\n // skip frame\n return;\n }\n\n // align next frame\n last = ts - (delta % interval);\n\n // update view\n painter.readers.forEach(function(read) {\n return read();\n });\n painter.writers.forEach(function(write) {\n return write(ts);\n });\n };\n\n setTimerType();\n tick(performance.now());\n\n return {\n pause: function pause() {\n cancelTick(id);\n },\n };\n };\n\n var createRoute = function createRoute(routes, fn) {\n return function(_ref) {\n var root = _ref.root,\n props = _ref.props,\n _ref$actions = _ref.actions,\n actions = _ref$actions === void 0 ? [] : _ref$actions,\n timestamp = _ref.timestamp,\n shouldOptimize = _ref.shouldOptimize;\n actions\n .filter(function(action) {\n return routes[action.type];\n })\n .forEach(function(action) {\n return routes[action.type]({\n root: root,\n props: props,\n action: action.data,\n timestamp: timestamp,\n shouldOptimize: shouldOptimize,\n });\n });\n\n if (fn) {\n fn({\n root: root,\n props: props,\n actions: actions,\n timestamp: timestamp,\n shouldOptimize: shouldOptimize,\n });\n }\n };\n };\n\n var insertBefore = function insertBefore(newNode, referenceNode) {\n return referenceNode.parentNode.insertBefore(newNode, referenceNode);\n };\n\n var insertAfter = function insertAfter(newNode, referenceNode) {\n return referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);\n };\n\n var isArray = function isArray(value) {\n return Array.isArray(value);\n };\n\n var isEmpty = function isEmpty(value) {\n return value == null;\n };\n\n var trim = function trim(str) {\n return str.trim();\n };\n\n var toString = function toString(value) {\n return '' + value;\n };\n\n var toArray = function toArray(value) {\n var splitter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';\n if (isEmpty(value)) {\n return [];\n }\n if (isArray(value)) {\n return value;\n }\n return toString(value)\n .split(splitter)\n .map(trim)\n .filter(function(str) {\n return str.length;\n });\n };\n\n var isBoolean = function isBoolean(value) {\n return typeof value === 'boolean';\n };\n\n var toBoolean = function toBoolean(value) {\n return isBoolean(value) ? value : value === 'true';\n };\n\n var isString = function isString(value) {\n return typeof value === 'string';\n };\n\n var toNumber = function toNumber(value) {\n return isNumber(value)\n ? value\n : isString(value)\n ? toString(value).replace(/[a-z]+/gi, '')\n : 0;\n };\n\n var toInt = function toInt(value) {\n return parseInt(toNumber(value), 10);\n };\n\n var toFloat = function toFloat(value) {\n return parseFloat(toNumber(value));\n };\n\n var isInt = function isInt(value) {\n return isNumber(value) && isFinite(value) && Math.floor(value) === value;\n };\n\n var toBytes = function toBytes(value) {\n var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n // is in bytes\n if (isInt(value)) {\n return value;\n }\n\n // is natural file size\n var naturalFileSize = toString(value).trim();\n\n // if is value in megabytes\n if (/MB$/i.test(naturalFileSize)) {\n naturalFileSize = naturalFileSize.replace(/MB$i/, '').trim();\n return toInt(naturalFileSize) * base * base;\n }\n\n // if is value in kilobytes\n if (/KB/i.test(naturalFileSize)) {\n naturalFileSize = naturalFileSize.replace(/KB$i/, '').trim();\n return toInt(naturalFileSize) * base;\n }\n\n return toInt(naturalFileSize);\n };\n\n var isFunction = function isFunction(value) {\n return typeof value === 'function';\n };\n\n var toFunctionReference = function toFunctionReference(string) {\n var ref = self;\n var levels = string.split('.');\n var level = null;\n while ((level = levels.shift())) {\n ref = ref[level];\n if (!ref) {\n return null;\n }\n }\n return ref;\n };\n\n var methods = {\n process: 'POST',\n patch: 'PATCH',\n revert: 'DELETE',\n fetch: 'GET',\n restore: 'GET',\n load: 'GET',\n };\n\n var createServerAPI = function createServerAPI(outline) {\n var api = {};\n\n api.url = isString(outline) ? outline : outline.url || '';\n api.timeout = outline.timeout ? parseInt(outline.timeout, 10) : 0;\n api.headers = outline.headers ? outline.headers : {};\n\n forin(methods, function(key) {\n api[key] = createAction(key, outline[key], methods[key], api.timeout, api.headers);\n });\n\n // remove process if no url or process on outline\n api.process = outline.process || isString(outline) || outline.url ? api.process : null;\n\n // special treatment for remove\n api.remove = outline.remove || null;\n\n // remove generic headers from api object\n delete api.headers;\n\n return api;\n };\n\n var createAction = function createAction(name, outline, method, timeout, headers) {\n // is explicitely set to null so disable\n if (outline === null) {\n return null;\n }\n\n // if is custom function, done! Dev handles everything.\n if (typeof outline === 'function') {\n return outline;\n }\n\n // build action object\n var action = {\n url: method === 'GET' || method === 'PATCH' ? '?' + name + '=' : '',\n method: method,\n headers: headers,\n withCredentials: false,\n timeout: timeout,\n onload: null,\n ondata: null,\n onerror: null,\n };\n\n // is a single url\n if (isString(outline)) {\n action.url = outline;\n return action;\n }\n\n // overwrite\n Object.assign(action, outline);\n\n // see if should reformat headers;\n if (isString(action.headers)) {\n var parts = action.headers.split(/:(.+)/);\n action.headers = {\n header: parts[0],\n value: parts[1],\n };\n }\n\n // if is bool withCredentials\n action.withCredentials = toBoolean(action.withCredentials);\n\n return action;\n };\n\n var toServerAPI = function toServerAPI(value) {\n return createServerAPI(value);\n };\n\n var isNull = function isNull(value) {\n return value === null;\n };\n\n var isObject = function isObject(value) {\n return typeof value === 'object' && value !== null;\n };\n\n var isAPI = function isAPI(value) {\n return (\n isObject(value) &&\n isString(value.url) &&\n isObject(value.process) &&\n isObject(value.revert) &&\n isObject(value.restore) &&\n isObject(value.fetch)\n );\n };\n\n var getType = function getType(value) {\n if (isArray(value)) {\n return 'array';\n }\n\n if (isNull(value)) {\n return 'null';\n }\n\n if (isInt(value)) {\n return 'int';\n }\n\n if (/^[0-9]+ ?(?:GB|MB|KB)$/gi.test(value)) {\n return 'bytes';\n }\n\n if (isAPI(value)) {\n return 'api';\n }\n\n return typeof value;\n };\n\n var replaceSingleQuotes = function replaceSingleQuotes(str) {\n return str\n .replace(/{\\s*'/g, '{\"')\n .replace(/'\\s*}/g, '\"}')\n .replace(/'\\s*:/g, '\":')\n .replace(/:\\s*'/g, ':\"')\n .replace(/,\\s*'/g, ',\"')\n .replace(/'\\s*,/g, '\",');\n };\n\n var conversionTable = {\n array: toArray,\n boolean: toBoolean,\n int: function int(value) {\n return getType(value) === 'bytes' ? toBytes(value) : toInt(value);\n },\n number: toFloat,\n float: toFloat,\n bytes: toBytes,\n string: function string(value) {\n return isFunction(value) ? value : toString(value);\n },\n function: function _function(value) {\n return toFunctionReference(value);\n },\n serverapi: toServerAPI,\n object: function object(value) {\n try {\n return JSON.parse(replaceSingleQuotes(value));\n } catch (e) {\n return null;\n }\n },\n };\n\n var convertTo = function convertTo(value, type) {\n return conversionTable[type](value);\n };\n\n var getValueByType = function getValueByType(newValue, defaultValue, valueType) {\n // can always assign default value\n if (newValue === defaultValue) {\n return newValue;\n }\n\n // get the type of the new value\n var newValueType = getType(newValue);\n\n // is valid type?\n if (newValueType !== valueType) {\n // is string input, let's attempt to convert\n var convertedValue = convertTo(newValue, valueType);\n\n // what is the type now\n newValueType = getType(convertedValue);\n\n // no valid conversions found\n if (convertedValue === null) {\n throw 'Trying to assign value with incorrect type to \"' +\n option +\n '\", allowed type: \"' +\n valueType +\n '\"';\n } else {\n newValue = convertedValue;\n }\n }\n\n // assign new value\n return newValue;\n };\n\n var createOption = function createOption(defaultValue, valueType) {\n var currentValue = defaultValue;\n return {\n enumerable: true,\n get: function get() {\n return currentValue;\n },\n set: function set(newValue) {\n currentValue = getValueByType(newValue, defaultValue, valueType);\n },\n };\n };\n\n var createOptions = function createOptions(options) {\n var obj = {};\n forin(options, function(prop) {\n var optionDefinition = options[prop];\n obj[prop] = createOption(optionDefinition[0], optionDefinition[1]);\n });\n return createObject(obj);\n };\n\n var createInitialState = function createInitialState(options) {\n return {\n // model\n items: [],\n\n // timeout used for calling update items\n listUpdateTimeout: null,\n\n // timeout used for stacking metadata updates\n itemUpdateTimeout: null,\n\n // queue of items waiting to be processed\n processingQueue: [],\n\n // options\n options: createOptions(options),\n };\n };\n\n var fromCamels = function fromCamels(string) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';\n return string\n .split(/(?=[A-Z])/)\n .map(function(part) {\n return part.toLowerCase();\n })\n .join(separator);\n };\n\n var createOptionAPI = function createOptionAPI(store, options) {\n var obj = {};\n forin(options, function(key) {\n obj[key] = {\n get: function get() {\n return store.getState().options[key];\n },\n set: function set(value) {\n store.dispatch('SET_' + fromCamels(key, '_').toUpperCase(), {\n value: value,\n });\n },\n };\n });\n return obj;\n };\n\n var createOptionActions = function createOptionActions(options) {\n return function(dispatch, query, state) {\n var obj = {};\n forin(options, function(key) {\n var name = fromCamels(key, '_').toUpperCase();\n\n obj['SET_' + name] = function(action) {\n try {\n state.options[key] = action.value;\n } catch (e) {} // nope, failed\n\n // we successfully set the value of this option\n dispatch('DID_SET_' + name, { value: state.options[key] });\n };\n });\n return obj;\n };\n };\n\n var createOptionQueries = function createOptionQueries(options) {\n return function(state) {\n var obj = {};\n forin(options, function(key) {\n obj['GET_' + fromCamels(key, '_').toUpperCase()] = function(action) {\n return state.options[key];\n };\n });\n return obj;\n };\n };\n\n var InteractionMethod = {\n API: 1,\n DROP: 2,\n BROWSE: 3,\n PASTE: 4,\n NONE: 5,\n };\n\n var getUniqueId = function getUniqueId() {\n return Math.random()\n .toString(36)\n .substring(2, 11);\n };\n\n function _typeof(obj) {\n if (typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol') {\n _typeof = function(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function(obj) {\n return obj &&\n typeof Symbol === 'function' &&\n obj.constructor === Symbol &&\n obj !== Symbol.prototype\n ? 'symbol'\n : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n var REACT_ELEMENT_TYPE;\n\n function _jsx(type, props, key, children) {\n if (!REACT_ELEMENT_TYPE) {\n REACT_ELEMENT_TYPE =\n (typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element')) ||\n 0xeac7;\n }\n\n var defaultProps = type && type.defaultProps;\n var childrenLength = arguments.length - 3;\n\n if (!props && childrenLength !== 0) {\n props = {\n children: void 0,\n };\n }\n\n if (props && defaultProps) {\n for (var propName in defaultProps) {\n if (props[propName] === void 0) {\n props[propName] = defaultProps[propName];\n }\n }\n } else if (!props) {\n props = defaultProps || {};\n }\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = new Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 3];\n }\n\n props.children = childArray;\n }\n\n return {\n $$typeof: REACT_ELEMENT_TYPE,\n type: type,\n key: key === undefined ? null : '' + key,\n ref: null,\n props: props,\n _owner: null,\n };\n }\n\n function _asyncIterator(iterable) {\n var method;\n\n if (typeof Symbol !== 'undefined') {\n if (Symbol.asyncIterator) {\n method = iterable[Symbol.asyncIterator];\n if (method != null) return method.call(iterable);\n }\n\n if (Symbol.iterator) {\n method = iterable[Symbol.iterator];\n if (method != null) return method.call(iterable);\n }\n }\n\n throw new TypeError('Object is not async iterable');\n }\n\n function _AwaitValue(value) {\n this.wrapped = value;\n }\n\n function _AsyncGenerator(gen) {\n var front, back;\n\n function send(key, arg) {\n return new Promise(function(resolve, reject) {\n var request = {\n key: key,\n arg: arg,\n resolve: resolve,\n reject: reject,\n next: null,\n };\n\n if (back) {\n back = back.next = request;\n } else {\n front = back = request;\n resume(key, arg);\n }\n });\n }\n\n function resume(key, arg) {\n try {\n var result = gen[key](arg);\n var value = result.value;\n var wrappedAwait = value instanceof _AwaitValue;\n Promise.resolve(wrappedAwait ? value.wrapped : value).then(\n function(arg) {\n if (wrappedAwait) {\n resume('next', arg);\n return;\n }\n\n settle(result.done ? 'return' : 'normal', arg);\n },\n function(err) {\n resume('throw', err);\n }\n );\n } catch (err) {\n settle('throw', err);\n }\n }\n\n function settle(type, value) {\n switch (type) {\n case 'return':\n front.resolve({\n value: value,\n done: true,\n });\n break;\n\n case 'throw':\n front.reject(value);\n break;\n\n default:\n front.resolve({\n value: value,\n done: false,\n });\n break;\n }\n\n front = front.next;\n\n if (front) {\n resume(front.key, front.arg);\n } else {\n back = null;\n }\n }\n\n this._invoke = send;\n\n if (typeof gen.return !== 'function') {\n this.return = undefined;\n }\n }\n\n if (typeof Symbol === 'function' && Symbol.asyncIterator) {\n _AsyncGenerator.prototype[Symbol.asyncIterator] = function() {\n return this;\n };\n }\n\n _AsyncGenerator.prototype.next = function(arg) {\n return this._invoke('next', arg);\n };\n\n _AsyncGenerator.prototype.throw = function(arg) {\n return this._invoke('throw', arg);\n };\n\n _AsyncGenerator.prototype.return = function(arg) {\n return this._invoke('return', arg);\n };\n\n function _wrapAsyncGenerator(fn) {\n return function() {\n return new _AsyncGenerator(fn.apply(this, arguments));\n };\n }\n\n function _awaitAsyncGenerator(value) {\n return new _AwaitValue(value);\n }\n\n function _asyncGeneratorDelegate(inner, awaitWrap) {\n var iter = {},\n waiting = false;\n\n function pump(key, value) {\n waiting = true;\n value = new Promise(function(resolve) {\n resolve(inner[key](value));\n });\n return {\n done: false,\n value: awaitWrap(value),\n };\n }\n\n if (typeof Symbol === 'function' && Symbol.iterator) {\n iter[Symbol.iterator] = function() {\n return this;\n };\n }\n\n iter.next = function(value) {\n if (waiting) {\n waiting = false;\n return value;\n }\n\n return pump('next', value);\n };\n\n if (typeof inner.throw === 'function') {\n iter.throw = function(value) {\n if (waiting) {\n waiting = false;\n throw value;\n }\n\n return pump('throw', value);\n };\n }\n\n if (typeof inner.return === 'function') {\n iter.return = function(value) {\n return pump('return', value);\n };\n }\n\n return iter;\n }\n\n function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n }\n\n function _asyncToGenerator(fn) {\n return function() {\n var self = this,\n args = arguments;\n return new Promise(function(resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);\n }\n\n _next(undefined);\n });\n };\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError('Cannot call a class as a function');\n }\n }\n\n function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if ('value' in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n }\n\n function _defineEnumerableProperties(obj, descs) {\n for (var key in descs) {\n var desc = descs[key];\n desc.configurable = desc.enumerable = true;\n if ('value' in desc) desc.writable = true;\n Object.defineProperty(obj, key, desc);\n }\n\n if (Object.getOwnPropertySymbols) {\n var objectSymbols = Object.getOwnPropertySymbols(descs);\n\n for (var i = 0; i < objectSymbols.length; i++) {\n var sym = objectSymbols[i];\n var desc = descs[sym];\n desc.configurable = desc.enumerable = true;\n if ('value' in desc) desc.writable = true;\n Object.defineProperty(obj, sym, desc);\n }\n }\n\n return obj;\n }\n\n function _defaults(obj, defaults) {\n var keys = Object.getOwnPropertyNames(defaults);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = Object.getOwnPropertyDescriptor(defaults, key);\n\n if (value && value.configurable && obj[key] === undefined) {\n Object.defineProperty(obj, key, value);\n }\n }\n\n return obj;\n }\n\n function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true,\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n }\n\n function _extends() {\n _extends =\n Object.assign ||\n function(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n }\n\n function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(\n Object.getOwnPropertySymbols(source).filter(function(sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n })\n );\n }\n\n ownKeys.forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n }\n\n function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n if (enumerableOnly)\n symbols = symbols.filter(function(sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n });\n keys.push.apply(keys, symbols);\n }\n\n return keys;\n }\n\n function _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n\n if (i % 2) {\n ownKeys(source, true).forEach(function(key) {\n _defineProperty(target, key, source[key]);\n });\n } else if (Object.getOwnPropertyDescriptors) {\n Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));\n } else {\n ownKeys(source).forEach(function(key) {\n Object.defineProperty(\n target,\n key,\n Object.getOwnPropertyDescriptor(source, key)\n );\n });\n }\n }\n\n return target;\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function');\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true,\n },\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf\n ? Object.getPrototypeOf\n : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf =\n Object.setPrototypeOf ||\n function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function isNativeReflectConstruct() {\n if (typeof Reflect === 'undefined' || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === 'function') return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));\n return true;\n } catch (e) {\n return false;\n }\n }\n\n function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n }\n\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf('[native code]') !== -1;\n }\n\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map === 'function' ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== 'function') {\n throw new TypeError('Super expression must either be null or a function');\n }\n\n if (typeof _cache !== 'undefined') {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n }\n\n function _instanceof(left, right) {\n if (right != null && typeof Symbol !== 'undefined' && right[Symbol.hasInstance]) {\n return !!right[Symbol.hasInstance](left);\n } else {\n return left instanceof right;\n }\n }\n\n function _interopRequireDefault(obj) {\n return obj && obj.__esModule\n ? obj\n : {\n default: obj,\n };\n }\n\n function _interopRequireWildcard(obj) {\n if (obj && obj.__esModule) {\n return obj;\n } else {\n var newObj = {};\n\n if (obj != null) {\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc =\n Object.defineProperty && Object.getOwnPropertyDescriptor\n ? Object.getOwnPropertyDescriptor(obj, key)\n : {};\n\n if (desc.get || desc.set) {\n Object.defineProperty(newObj, key, desc);\n } else {\n newObj[key] = obj[key];\n }\n }\n }\n }\n\n newObj.default = obj;\n return newObj;\n }\n }\n\n function _newArrowCheck(innerThis, boundThis) {\n if (innerThis !== boundThis) {\n throw new TypeError('Cannot instantiate an arrow function');\n }\n }\n\n function _objectDestructuringEmpty(obj) {\n if (obj == null) throw new TypeError('Cannot destructure undefined');\n }\n\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n\n function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (typeof call === 'object' || typeof call === 'function')) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n function _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = _getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n }\n\n function _get(target, property, receiver) {\n if (typeof Reflect !== 'undefined' && Reflect.get) {\n _get = Reflect.get;\n } else {\n _get = function _get(target, property, receiver) {\n var base = _superPropBase(target, property);\n\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(receiver);\n }\n\n return desc.value;\n };\n }\n\n return _get(target, property, receiver || target);\n }\n\n function set(target, property, value, receiver) {\n if (typeof Reflect !== 'undefined' && Reflect.set) {\n set = Reflect.set;\n } else {\n set = function set(target, property, value, receiver) {\n var base = _superPropBase(target, property);\n\n var desc;\n\n if (base) {\n desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.set) {\n desc.set.call(receiver, value);\n return true;\n } else if (!desc.writable) {\n return false;\n }\n }\n\n desc = Object.getOwnPropertyDescriptor(receiver, property);\n\n if (desc) {\n if (!desc.writable) {\n return false;\n }\n\n desc.value = value;\n Object.defineProperty(receiver, property, desc);\n } else {\n _defineProperty(receiver, property, value);\n }\n\n return true;\n };\n }\n\n return set(target, property, value, receiver);\n }\n\n function _set(target, property, value, receiver, isStrict) {\n var s = set(target, property, value, receiver || target);\n\n if (!s && isStrict) {\n throw new Error('failed to set property');\n }\n\n return value;\n }\n\n function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n return Object.freeze(\n Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw),\n },\n })\n );\n }\n\n function _taggedTemplateLiteralLoose(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n strings.raw = raw;\n return strings;\n }\n\n function _temporalRef(val, name) {\n if (val === _temporalUndefined) {\n throw new ReferenceError(name + ' is not defined - temporal dead zone');\n } else {\n return val;\n }\n }\n\n function _readOnlyError(name) {\n throw new Error('\"' + name + '\" is read-only');\n }\n\n function _classNameTDZError(name) {\n throw new Error('Class \"' + name + '\" cannot be referenced in computed property keys.');\n }\n\n var _temporalUndefined = {};\n\n function _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();\n }\n\n function _slicedToArrayLoose(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimitLoose(arr, i) || _nonIterableRest();\n }\n\n function _toArray(arr) {\n return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest();\n }\n\n function _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n }\n\n function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n }\n }\n\n function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n }\n\n function _iterableToArray(iter) {\n if (\n Symbol.iterator in Object(iter) ||\n Object.prototype.toString.call(iter) === '[object Arguments]'\n )\n return Array.from(iter);\n }\n\n function _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i['return'] != null) _i['return']();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n function _iterableToArrayLimitLoose(arr, i) {\n var _arr = [];\n\n for (var _iterator = arr[Symbol.iterator](), _step; !(_step = _iterator.next()).done; ) {\n _arr.push(_step.value);\n\n if (i && _arr.length === i) break;\n }\n\n return _arr;\n }\n\n function _nonIterableSpread() {\n throw new TypeError('Invalid attempt to spread non-iterable instance');\n }\n\n function _nonIterableRest() {\n throw new TypeError('Invalid attempt to destructure non-iterable instance');\n }\n\n function _skipFirstGeneratorNext(fn) {\n return function() {\n var it = fn.apply(this, arguments);\n it.next();\n return it;\n };\n }\n\n function _toPrimitive(input, hint) {\n if (typeof input !== 'object' || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n\n if (prim !== undefined) {\n var res = prim.call(input, hint || 'default');\n if (typeof res !== 'object') return res;\n throw new TypeError('@@toPrimitive must return a primitive value.');\n }\n\n return (hint === 'string' ? String : Number)(input);\n }\n\n function _toPropertyKey(arg) {\n var key = _toPrimitive(arg, 'string');\n\n return typeof key === 'symbol' ? key : String(key);\n }\n\n function _initializerWarningHelper(descriptor, context) {\n throw new Error(\n 'Decorating class property failed. Please ensure that ' +\n 'proposal-class-properties is enabled and set to use loose mode. ' +\n 'To use proposal-class-properties in spec mode with decorators, wait for ' +\n 'the next major version of decorators in stage 2.'\n );\n }\n\n function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0,\n });\n }\n\n function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function(key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators\n .slice()\n .reverse()\n .reduce(function(desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n\n return desc;\n }\n\n var id = 0;\n\n function _classPrivateFieldLooseKey(name) {\n return '__private_' + id++ + '_' + name;\n }\n\n function _classPrivateFieldLooseBase(receiver, privateKey) {\n if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {\n throw new TypeError('attempted to use private field on non-instance');\n }\n\n return receiver;\n }\n\n function _classPrivateFieldGet(receiver, privateMap) {\n var descriptor = privateMap.get(receiver);\n\n if (!descriptor) {\n throw new TypeError('attempted to get private field on non-instance');\n }\n\n if (descriptor.get) {\n return descriptor.get.call(receiver);\n }\n\n return descriptor.value;\n }\n\n function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = privateMap.get(receiver);\n\n if (!descriptor) {\n throw new TypeError('attempted to set private field on non-instance');\n }\n\n if (descriptor.set) {\n descriptor.set.call(receiver, value);\n } else {\n if (!descriptor.writable) {\n throw new TypeError('attempted to set read only private field');\n }\n\n descriptor.value = value;\n }\n\n return value;\n }\n\n function _classPrivateFieldDestructureSet(receiver, privateMap) {\n if (!privateMap.has(receiver)) {\n throw new TypeError('attempted to set private field on non-instance');\n }\n\n var descriptor = privateMap.get(receiver);\n\n if (descriptor.set) {\n if (!('__destrObj' in descriptor)) {\n descriptor.__destrObj = {\n set value(v) {\n descriptor.set.call(receiver, v);\n },\n };\n }\n\n return descriptor.__destrObj;\n } else {\n if (!descriptor.writable) {\n throw new TypeError('attempted to set read only private field');\n }\n\n return descriptor;\n }\n }\n\n function _classStaticPrivateFieldSpecGet(receiver, classConstructor, descriptor) {\n if (receiver !== classConstructor) {\n throw new TypeError('Private static access of wrong provenance');\n }\n\n return descriptor.value;\n }\n\n function _classStaticPrivateFieldSpecSet(receiver, classConstructor, descriptor, value) {\n if (receiver !== classConstructor) {\n throw new TypeError('Private static access of wrong provenance');\n }\n\n if (!descriptor.writable) {\n throw new TypeError('attempted to set read only private field');\n }\n\n descriptor.value = value;\n return value;\n }\n\n function _classStaticPrivateMethodGet(receiver, classConstructor, method) {\n if (receiver !== classConstructor) {\n throw new TypeError('Private static access of wrong provenance');\n }\n\n return method;\n }\n\n function _classStaticPrivateMethodSet() {\n throw new TypeError('attempted to set read only static private field');\n }\n\n function _decorate(decorators, factory, superClass, mixins) {\n var api = _getDecoratorsApi();\n\n if (mixins) {\n for (var i = 0; i < mixins.length; i++) {\n api = mixins[i](api);\n }\n }\n\n var r = factory(function initialize(O) {\n api.initializeInstanceElements(O, decorated.elements);\n }, superClass);\n var decorated = api.decorateClass(\n _coalesceClassElements(r.d.map(_createElementDescriptor)),\n decorators\n );\n api.initializeClassElements(r.F, decorated.elements);\n return api.runClassFinishers(r.F, decorated.finishers);\n }\n\n function _getDecoratorsApi() {\n _getDecoratorsApi = function() {\n return api;\n };\n\n var api = {\n elementsDefinitionOrder: [['method'], ['field']],\n initializeInstanceElements: function(O, elements) {\n ['method', 'field'].forEach(function(kind) {\n elements.forEach(function(element) {\n if (element.kind === kind && element.placement === 'own') {\n this.defineClassElement(O, element);\n }\n }, this);\n }, this);\n },\n initializeClassElements: function(F, elements) {\n var proto = F.prototype;\n ['method', 'field'].forEach(function(kind) {\n elements.forEach(function(element) {\n var placement = element.placement;\n\n if (\n element.kind === kind &&\n (placement === 'static' || placement === 'prototype')\n ) {\n var receiver = placement === 'static' ? F : proto;\n this.defineClassElement(receiver, element);\n }\n }, this);\n }, this);\n },\n defineClassElement: function(receiver, element) {\n var descriptor = element.descriptor;\n\n if (element.kind === 'field') {\n var initializer = element.initializer;\n descriptor = {\n enumerable: descriptor.enumerable,\n writable: descriptor.writable,\n configurable: descriptor.configurable,\n value: initializer === void 0 ? void 0 : initializer.call(receiver),\n };\n }\n\n Object.defineProperty(receiver, element.key, descriptor);\n },\n decorateClass: function(elements, decorators) {\n var newElements = [];\n var finishers = [];\n var placements = {\n static: [],\n prototype: [],\n own: [],\n };\n elements.forEach(function(element) {\n this.addElementPlacement(element, placements);\n }, this);\n elements.forEach(function(element) {\n if (!_hasDecorators(element)) return newElements.push(element);\n var elementFinishersExtras = this.decorateElement(element, placements);\n newElements.push(elementFinishersExtras.element);\n newElements.push.apply(newElements, elementFinishersExtras.extras);\n finishers.push.apply(finishers, elementFinishersExtras.finishers);\n }, this);\n\n if (!decorators) {\n return {\n elements: newElements,\n finishers: finishers,\n };\n }\n\n var result = this.decorateConstructor(newElements, decorators);\n finishers.push.apply(finishers, result.finishers);\n result.finishers = finishers;\n return result;\n },\n addElementPlacement: function(element, placements, silent) {\n var keys = placements[element.placement];\n\n if (!silent && keys.indexOf(element.key) !== -1) {\n throw new TypeError('Duplicated element (' + element.key + ')');\n }\n\n keys.push(element.key);\n },\n decorateElement: function(element, placements) {\n var extras = [];\n var finishers = [];\n\n for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) {\n var keys = placements[element.placement];\n keys.splice(keys.indexOf(element.key), 1);\n var elementObject = this.fromElementDescriptor(element);\n var elementFinisherExtras = this.toElementFinisherExtras(\n (0, decorators[i])(elementObject) || elementObject\n );\n element = elementFinisherExtras.element;\n this.addElementPlacement(element, placements);\n\n if (elementFinisherExtras.finisher) {\n finishers.push(elementFinisherExtras.finisher);\n }\n\n var newExtras = elementFinisherExtras.extras;\n\n if (newExtras) {\n for (var j = 0; j < newExtras.length; j++) {\n this.addElementPlacement(newExtras[j], placements);\n }\n\n extras.push.apply(extras, newExtras);\n }\n }\n\n return {\n element: element,\n finishers: finishers,\n extras: extras,\n };\n },\n decorateConstructor: function(elements, decorators) {\n var finishers = [];\n\n for (var i = decorators.length - 1; i >= 0; i--) {\n var obj = this.fromClassDescriptor(elements);\n var elementsAndFinisher = this.toClassDescriptor(\n (0, decorators[i])(obj) || obj\n );\n\n if (elementsAndFinisher.finisher !== undefined) {\n finishers.push(elementsAndFinisher.finisher);\n }\n\n if (elementsAndFinisher.elements !== undefined) {\n elements = elementsAndFinisher.elements;\n\n for (var j = 0; j < elements.length - 1; j++) {\n for (var k = j + 1; k < elements.length; k++) {\n if (\n elements[j].key === elements[k].key &&\n elements[j].placement === elements[k].placement\n ) {\n throw new TypeError(\n 'Duplicated element (' + elements[j].key + ')'\n );\n }\n }\n }\n }\n }\n\n return {\n elements: elements,\n finishers: finishers,\n };\n },\n fromElementDescriptor: function(element) {\n var obj = {\n kind: element.kind,\n key: element.key,\n placement: element.placement,\n descriptor: element.descriptor,\n };\n var desc = {\n value: 'Descriptor',\n configurable: true,\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n if (element.kind === 'field') obj.initializer = element.initializer;\n return obj;\n },\n toElementDescriptors: function(elementObjects) {\n if (elementObjects === undefined) return;\n return _toArray(elementObjects).map(function(elementObject) {\n var element = this.toElementDescriptor(elementObject);\n this.disallowProperty(elementObject, 'finisher', 'An element descriptor');\n this.disallowProperty(elementObject, 'extras', 'An element descriptor');\n return element;\n }, this);\n },\n toElementDescriptor: function(elementObject) {\n var kind = String(elementObject.kind);\n\n if (kind !== 'method' && kind !== 'field') {\n throw new TypeError(\n 'An element descriptor\\'s .kind property must be either \"method\" or' +\n ' \"field\", but a decorator created an element descriptor with' +\n ' .kind \"' +\n kind +\n '\"'\n );\n }\n\n var key = _toPropertyKey(elementObject.key);\n\n var placement = String(elementObject.placement);\n\n if (placement !== 'static' && placement !== 'prototype' && placement !== 'own') {\n throw new TypeError(\n 'An element descriptor\\'s .placement property must be one of \"static\",' +\n ' \"prototype\" or \"own\", but a decorator created an element descriptor' +\n ' with .placement \"' +\n placement +\n '\"'\n );\n }\n\n var descriptor = elementObject.descriptor;\n this.disallowProperty(elementObject, 'elements', 'An element descriptor');\n var element = {\n kind: kind,\n key: key,\n placement: placement,\n descriptor: Object.assign({}, descriptor),\n };\n\n if (kind !== 'field') {\n this.disallowProperty(elementObject, 'initializer', 'A method descriptor');\n } else {\n this.disallowProperty(\n descriptor,\n 'get',\n 'The property descriptor of a field descriptor'\n );\n this.disallowProperty(\n descriptor,\n 'set',\n 'The property descriptor of a field descriptor'\n );\n this.disallowProperty(\n descriptor,\n 'value',\n 'The property descriptor of a field descriptor'\n );\n element.initializer = elementObject.initializer;\n }\n\n return element;\n },\n toElementFinisherExtras: function(elementObject) {\n var element = this.toElementDescriptor(elementObject);\n\n var finisher = _optionalCallableProperty(elementObject, 'finisher');\n\n var extras = this.toElementDescriptors(elementObject.extras);\n return {\n element: element,\n finisher: finisher,\n extras: extras,\n };\n },\n fromClassDescriptor: function(elements) {\n var obj = {\n kind: 'class',\n elements: elements.map(this.fromElementDescriptor, this),\n };\n var desc = {\n value: 'Descriptor',\n configurable: true,\n };\n Object.defineProperty(obj, Symbol.toStringTag, desc);\n return obj;\n },\n toClassDescriptor: function(obj) {\n var kind = String(obj.kind);\n\n if (kind !== 'class') {\n throw new TypeError(\n 'A class descriptor\\'s .kind property must be \"class\", but a decorator' +\n ' created a class descriptor with .kind \"' +\n kind +\n '\"'\n );\n }\n\n this.disallowProperty(obj, 'key', 'A class descriptor');\n this.disallowProperty(obj, 'placement', 'A class descriptor');\n this.disallowProperty(obj, 'descriptor', 'A class descriptor');\n this.disallowProperty(obj, 'initializer', 'A class descriptor');\n this.disallowProperty(obj, 'extras', 'A class descriptor');\n\n var finisher = _optionalCallableProperty(obj, 'finisher');\n\n var elements = this.toElementDescriptors(obj.elements);\n return {\n elements: elements,\n finisher: finisher,\n };\n },\n runClassFinishers: function(constructor, finishers) {\n for (var i = 0; i < finishers.length; i++) {\n var newConstructor = (0, finishers[i])(constructor);\n\n if (newConstructor !== undefined) {\n if (typeof newConstructor !== 'function') {\n throw new TypeError('Finishers must return a constructor.');\n }\n\n constructor = newConstructor;\n }\n }\n\n return constructor;\n },\n disallowProperty: function(obj, name, objectType) {\n if (obj[name] !== undefined) {\n throw new TypeError(objectType + \" can't have a .\" + name + ' property.');\n }\n },\n };\n return api;\n }\n\n function _createElementDescriptor(def) {\n var key = _toPropertyKey(def.key);\n\n var descriptor;\n\n if (def.kind === 'method') {\n descriptor = {\n value: def.value,\n writable: true,\n configurable: true,\n enumerable: false,\n };\n } else if (def.kind === 'get') {\n descriptor = {\n get: def.value,\n configurable: true,\n enumerable: false,\n };\n } else if (def.kind === 'set') {\n descriptor = {\n set: def.value,\n configurable: true,\n enumerable: false,\n };\n } else if (def.kind === 'field') {\n descriptor = {\n configurable: true,\n writable: true,\n enumerable: true,\n };\n }\n\n var element = {\n kind: def.kind === 'field' ? 'field' : 'method',\n key: key,\n placement: def.static ? 'static' : def.kind === 'field' ? 'own' : 'prototype',\n descriptor: descriptor,\n };\n if (def.decorators) element.decorators = def.decorators;\n if (def.kind === 'field') element.initializer = def.value;\n return element;\n }\n\n function _coalesceGetterSetter(element, other) {\n if (element.descriptor.get !== undefined) {\n other.descriptor.get = element.descriptor.get;\n } else {\n other.descriptor.set = element.descriptor.set;\n }\n }\n\n function _coalesceClassElements(elements) {\n var newElements = [];\n\n var isSameElement = function(other) {\n return (\n other.kind === 'method' &&\n other.key === element.key &&\n other.placement === element.placement\n );\n };\n\n for (var i = 0; i < elements.length; i++) {\n var element = elements[i];\n var other;\n\n if (element.kind === 'method' && (other = newElements.find(isSameElement))) {\n if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) {\n if (_hasDecorators(element) || _hasDecorators(other)) {\n throw new ReferenceError(\n 'Duplicated methods (' + element.key + \") can't be decorated.\"\n );\n }\n\n other.descriptor = element.descriptor;\n } else {\n if (_hasDecorators(element)) {\n if (_hasDecorators(other)) {\n throw new ReferenceError(\n \"Decorators can't be placed on different accessors with for \" +\n 'the same property (' +\n element.key +\n ').'\n );\n }\n\n other.decorators = element.decorators;\n }\n\n _coalesceGetterSetter(element, other);\n }\n } else {\n newElements.push(element);\n }\n }\n\n return newElements;\n }\n\n function _hasDecorators(element) {\n return element.decorators && element.decorators.length;\n }\n\n function _isDataDescriptor(desc) {\n return desc !== undefined && !(desc.value === undefined && desc.writable === undefined);\n }\n\n function _optionalCallableProperty(obj, name) {\n var value = obj[name];\n\n if (value !== undefined && typeof value !== 'function') {\n throw new TypeError(\"Expected '\" + name + \"' to be a function\");\n }\n\n return value;\n }\n\n function _classPrivateMethodGet(receiver, privateSet, fn) {\n if (!privateSet.has(receiver)) {\n throw new TypeError('attempted to get private field on non-instance');\n }\n\n return fn;\n }\n\n function _classPrivateMethodSet() {\n throw new TypeError('attempted to reassign private method');\n }\n\n function _wrapRegExp(re, groups) {\n _wrapRegExp = function(re, groups) {\n return new BabelRegExp(re, groups);\n };\n\n var _RegExp = _wrapNativeSuper(RegExp);\n\n var _super = RegExp.prototype;\n\n var _groups = new WeakMap();\n\n function BabelRegExp(re, groups) {\n var _this = _RegExp.call(this, re);\n\n _groups.set(_this, groups);\n\n return _this;\n }\n\n _inherits(BabelRegExp, _RegExp);\n\n BabelRegExp.prototype.exec = function(str) {\n var result = _super.exec.call(this, str);\n\n if (result) result.groups = buildGroups(result, this);\n return result;\n };\n\n BabelRegExp.prototype[Symbol.replace] = function(str, substitution) {\n if (typeof substitution === 'string') {\n var groups = _groups.get(this);\n\n return _super[Symbol.replace].call(\n this,\n str,\n substitution.replace(/\\$<([^>]+)>/g, function(_, name) {\n return '$' + groups[name];\n })\n );\n } else if (typeof substitution === 'function') {\n var _this = this;\n\n return _super[Symbol.replace].call(this, str, function() {\n var args = [];\n args.push.apply(args, arguments);\n\n if (typeof args[args.length - 1] !== 'object') {\n args.push(buildGroups(args, _this));\n }\n\n return substitution.apply(this, args);\n });\n } else {\n return _super[Symbol.replace].call(this, str, substitution);\n }\n };\n\n function buildGroups(result, re) {\n var g = _groups.get(re);\n\n return Object.keys(g).reduce(function(groups, name) {\n groups[name] = result[g[name]];\n return groups;\n }, Object.create(null));\n }\n\n return _wrapRegExp.apply(this, arguments);\n }\n\n var arrayRemove = function arrayRemove(arr, index) {\n return arr.splice(index, 1);\n };\n\n var run = function run(cb, sync) {\n if (sync) {\n cb();\n } else if (document.hidden) {\n Promise.resolve(1).then(cb);\n } else {\n setTimeout(cb, 0);\n }\n };\n\n var on = function on() {\n var listeners = [];\n var off = function off(event, cb) {\n arrayRemove(\n listeners,\n listeners.findIndex(function(listener) {\n return listener.event === event && (listener.cb === cb || !cb);\n })\n );\n };\n var _fire = function fire(event, args, sync) {\n listeners\n .filter(function(listener) {\n return listener.event === event;\n })\n .map(function(listener) {\n return listener.cb;\n })\n .forEach(function(cb) {\n return run(function() {\n return cb.apply(void 0, _toConsumableArray(args));\n }, sync);\n });\n };\n return {\n fireSync: function fireSync(event) {\n for (\n var _len = arguments.length,\n args = new Array(_len > 1 ? _len - 1 : 0),\n _key = 1;\n _key < _len;\n _key++\n ) {\n args[_key - 1] = arguments[_key];\n }\n _fire(event, args, true);\n },\n fire: function fire(event) {\n for (\n var _len2 = arguments.length,\n args = new Array(_len2 > 1 ? _len2 - 1 : 0),\n _key2 = 1;\n _key2 < _len2;\n _key2++\n ) {\n args[_key2 - 1] = arguments[_key2];\n }\n _fire(event, args, false);\n },\n on: function on(event, cb) {\n listeners.push({ event: event, cb: cb });\n },\n onOnce: function onOnce(event, _cb) {\n listeners.push({\n event: event,\n cb: function cb() {\n off(event, _cb);\n _cb.apply(void 0, arguments);\n },\n });\n },\n off: off,\n };\n };\n\n var copyObjectPropertiesToObject = function copyObjectPropertiesToObject(\n src,\n target,\n excluded\n ) {\n Object.getOwnPropertyNames(src)\n .filter(function(property) {\n return !excluded.includes(property);\n })\n .forEach(function(key) {\n return Object.defineProperty(\n target,\n key,\n Object.getOwnPropertyDescriptor(src, key)\n );\n });\n };\n\n var PRIVATE = [\n 'fire',\n 'process',\n 'revert',\n 'load',\n 'on',\n 'off',\n 'onOnce',\n 'retryLoad',\n 'extend',\n 'archive',\n 'archived',\n 'release',\n 'released',\n 'requestProcessing',\n 'freeze',\n ];\n\n var createItemAPI = function createItemAPI(item) {\n var api = {};\n copyObjectPropertiesToObject(item, api, PRIVATE);\n return api;\n };\n\n var removeReleasedItems = function removeReleasedItems(items) {\n items.forEach(function(item, index) {\n if (item.released) {\n arrayRemove(items, index);\n }\n });\n };\n\n var ItemStatus = {\n INIT: 1,\n IDLE: 2,\n PROCESSING_QUEUED: 9,\n PROCESSING: 3,\n PROCESSING_COMPLETE: 5,\n PROCESSING_ERROR: 6,\n PROCESSING_REVERT_ERROR: 10,\n LOADING: 7,\n LOAD_ERROR: 8,\n };\n\n var FileOrigin = {\n INPUT: 1,\n LIMBO: 2,\n LOCAL: 3,\n };\n\n var getNonNumeric = function getNonNumeric(str) {\n return /[^0-9]+/.exec(str);\n };\n\n var getDecimalSeparator = function getDecimalSeparator() {\n return getNonNumeric((1.1).toLocaleString())[0];\n };\n\n var getThousandsSeparator = function getThousandsSeparator() {\n // Added for browsers that do not return the thousands separator (happend on native browser Android 4.4.4)\n // We check against the normal toString output and if they're the same return a comma when decimal separator is a dot\n var decimalSeparator = getDecimalSeparator();\n var thousandsStringWithSeparator = (1000.0).toLocaleString();\n var thousandsStringWithoutSeparator = (1000.0).toString();\n if (thousandsStringWithSeparator !== thousandsStringWithoutSeparator) {\n return getNonNumeric(thousandsStringWithSeparator)[0];\n }\n return decimalSeparator === '.' ? ',' : '.';\n };\n\n var Type = {\n BOOLEAN: 'boolean',\n INT: 'int',\n NUMBER: 'number',\n STRING: 'string',\n ARRAY: 'array',\n OBJECT: 'object',\n FUNCTION: 'function',\n ACTION: 'action',\n SERVER_API: 'serverapi',\n REGEX: 'regex',\n };\n\n // all registered filters\n var filters = [];\n\n // loops over matching filters and passes options to each filter, returning the mapped results\n var applyFilterChain = function applyFilterChain(key, value, utils) {\n return new Promise(function(resolve, reject) {\n // find matching filters for this key\n var matchingFilters = filters\n .filter(function(f) {\n return f.key === key;\n })\n .map(function(f) {\n return f.cb;\n });\n\n // resolve now\n if (matchingFilters.length === 0) {\n resolve(value);\n return;\n }\n\n // first filter to kick things of\n var initialFilter = matchingFilters.shift();\n\n // chain filters\n matchingFilters\n .reduce(\n // loop over promises passing value to next promise\n function(current, next) {\n return current.then(function(value) {\n return next(value, utils);\n });\n },\n\n // call initial filter, will return a promise\n initialFilter(value, utils)\n\n // all executed\n )\n .then(function(value) {\n return resolve(value);\n })\n .catch(function(error) {\n return reject(error);\n });\n });\n };\n\n var applyFilters = function applyFilters(key, value, utils) {\n return filters\n .filter(function(f) {\n return f.key === key;\n })\n .map(function(f) {\n return f.cb(value, utils);\n });\n };\n\n // adds a new filter to the list\n var addFilter = function addFilter(key, cb) {\n return filters.push({ key: key, cb: cb });\n };\n\n var extendDefaultOptions = function extendDefaultOptions(additionalOptions) {\n return Object.assign(defaultOptions, additionalOptions);\n };\n\n var getOptions = function getOptions() {\n return Object.assign({}, defaultOptions);\n };\n\n var setOptions = function setOptions(opts) {\n forin(opts, function(key, value) {\n // key does not exist, so this option cannot be set\n if (!defaultOptions[key]) {\n return;\n }\n defaultOptions[key][0] = getValueByType(\n value,\n defaultOptions[key][0],\n defaultOptions[key][1]\n );\n });\n };\n\n // default options on app\n var defaultOptions = {\n // the id to add to the root element\n id: [null, Type.STRING],\n\n // input field name to use\n name: ['filepond', Type.STRING],\n\n // disable the field\n disabled: [false, Type.BOOLEAN],\n\n // classname to put on wrapper\n className: [null, Type.STRING],\n\n // is the field required\n required: [false, Type.BOOLEAN],\n\n // Allow media capture when value is set\n captureMethod: [null, Type.STRING],\n // - \"camera\", \"microphone\" or \"camcorder\",\n // - Does not work with multiple on apple devices\n // - If set, acceptedFileTypes must be made to match with media wildcard \"image/*\", \"audio/*\" or \"video/*\"\n\n // sync `acceptedFileTypes` property with `accept` attribute\n allowSyncAcceptAttribute: [true, Type.BOOLEAN],\n\n // Feature toggles\n allowDrop: [true, Type.BOOLEAN], // Allow dropping of files\n allowBrowse: [true, Type.BOOLEAN], // Allow browsing the file system\n allowPaste: [true, Type.BOOLEAN], // Allow pasting files\n allowMultiple: [false, Type.BOOLEAN], // Allow multiple files (disabled by default, as multiple attribute is also required on input to allow multiple)\n allowReplace: [true, Type.BOOLEAN], // Allow dropping a file on other file to replace it (only works when multiple is set to false)\n allowRevert: [true, Type.BOOLEAN], // Allows user to revert file upload\n allowRemove: [true, Type.BOOLEAN], // Allow user to remove a file\n allowProcess: [true, Type.BOOLEAN], // Allows user to process a file, when set to false, this removes the file upload button\n allowReorder: [false, Type.BOOLEAN], // Allow reordering of files\n allowDirectoriesOnly: [false, Type.BOOLEAN], // Allow only selecting directories with browse (no support for filtering dnd at this point)\n\n // Try store file if `server` not set\n storeAsFile: [false, Type.BOOLEAN],\n\n // Revert mode\n forceRevert: [false, Type.BOOLEAN], // Set to 'force' to require the file to be reverted before removal\n\n // Input requirements\n maxFiles: [null, Type.INT], // Max number of files\n checkValidity: [false, Type.BOOLEAN], // Enables custom validity messages\n\n // Where to put file\n itemInsertLocationFreedom: [true, Type.BOOLEAN], // Set to false to always add items to begin or end of list\n itemInsertLocation: ['before', Type.STRING], // Default index in list to add items that have been dropped at the top of the list\n itemInsertInterval: [75, Type.INT],\n\n // Drag 'n Drop related\n dropOnPage: [false, Type.BOOLEAN], // Allow dropping of files anywhere on page (prevents browser from opening file if dropped outside of Up)\n dropOnElement: [true, Type.BOOLEAN], // Drop needs to happen on element (set to false to also load drops outside of Up)\n dropValidation: [false, Type.BOOLEAN], // Enable or disable validating files on drop\n ignoredFiles: [['.ds_store', 'thumbs.db', 'desktop.ini'], Type.ARRAY],\n\n // Upload related\n instantUpload: [true, Type.BOOLEAN], // Should upload files immediately on drop\n maxParallelUploads: [2, Type.INT], // Maximum files to upload in parallel\n allowMinimumUploadDuration: [true, Type.BOOLEAN], // if true uploads take at least 750 ms, this ensures the user sees the upload progress giving trust the upload actually happened\n\n // Chunks\n chunkUploads: [false, Type.BOOLEAN], // Enable chunked uploads\n chunkForce: [false, Type.BOOLEAN], // Force use of chunk uploads even for files smaller than chunk size\n chunkSize: [5000000, Type.INT], // Size of chunks (5MB default)\n chunkRetryDelays: [[500, 1000, 3000], Type.ARRAY], // Amount of times to retry upload of a chunk when it fails\n\n // The server api end points to use for uploading (see docs)\n server: [null, Type.SERVER_API],\n\n // File size calculations, can set to 1024, this is only used for display, properties use file size base 1000\n fileSizeBase: [1000, Type.INT],\n\n // Labels and status messages\n labelFileSizeBytes: ['bytes', Type.STRING],\n labelFileSizeKilobytes: ['KB', Type.STRING],\n labelFileSizeMegabytes: ['MB', Type.STRING],\n labelFileSizeGigabytes: ['GB', Type.STRING],\n\n labelDecimalSeparator: [getDecimalSeparator(), Type.STRING], // Default is locale separator\n labelThousandsSeparator: [getThousandsSeparator(), Type.STRING], // Default is locale separator\n\n labelIdle: [\n 'Drag & Drop your files or Browse ',\n Type.STRING,\n ],\n\n labelInvalidField: ['Field contains invalid files', Type.STRING],\n labelFileWaitingForSize: ['Waiting for size', Type.STRING],\n labelFileSizeNotAvailable: ['Size not available', Type.STRING],\n labelFileCountSingular: ['file in list', Type.STRING],\n labelFileCountPlural: ['files in list', Type.STRING],\n labelFileLoading: ['Loading', Type.STRING],\n labelFileAdded: ['Added', Type.STRING], // assistive only\n labelFileLoadError: ['Error during load', Type.STRING],\n labelFileRemoved: ['Removed', Type.STRING], // assistive only\n labelFileRemoveError: ['Error during remove', Type.STRING],\n labelFileProcessing: ['Uploading', Type.STRING],\n labelFileProcessingComplete: ['Upload complete', Type.STRING],\n labelFileProcessingAborted: ['Upload cancelled', Type.STRING],\n labelFileProcessingError: ['Error during upload', Type.STRING],\n labelFileProcessingRevertError: ['Error during revert', Type.STRING],\n\n labelTapToCancel: ['tap to cancel', Type.STRING],\n labelTapToRetry: ['tap to retry', Type.STRING],\n labelTapToUndo: ['tap to undo', Type.STRING],\n\n labelButtonRemoveItem: ['Remove', Type.STRING],\n labelButtonAbortItemLoad: ['Abort', Type.STRING],\n labelButtonRetryItemLoad: ['Retry', Type.STRING],\n labelButtonAbortItemProcessing: ['Cancel', Type.STRING],\n labelButtonUndoItemProcessing: ['Undo', Type.STRING],\n labelButtonRetryItemProcessing: ['Retry', Type.STRING],\n labelButtonProcessItem: ['Upload', Type.STRING],\n\n // make sure width and height plus viewpox are even numbers so icons are nicely centered\n iconRemove: [\n ' ',\n Type.STRING,\n ],\n\n iconProcess: [\n ' ',\n Type.STRING,\n ],\n\n iconRetry: [\n ' ',\n Type.STRING,\n ],\n\n iconUndo: [\n ' ',\n Type.STRING,\n ],\n\n iconDone: [\n ' ',\n Type.STRING,\n ],\n\n // event handlers\n oninit: [null, Type.FUNCTION],\n onwarning: [null, Type.FUNCTION],\n onerror: [null, Type.FUNCTION],\n onactivatefile: [null, Type.FUNCTION],\n oninitfile: [null, Type.FUNCTION],\n onaddfilestart: [null, Type.FUNCTION],\n onaddfileprogress: [null, Type.FUNCTION],\n onaddfile: [null, Type.FUNCTION],\n onprocessfilestart: [null, Type.FUNCTION],\n onprocessfileprogress: [null, Type.FUNCTION],\n onprocessfileabort: [null, Type.FUNCTION],\n onprocessfilerevert: [null, Type.FUNCTION],\n onprocessfile: [null, Type.FUNCTION],\n onprocessfiles: [null, Type.FUNCTION],\n onremovefile: [null, Type.FUNCTION],\n onpreparefile: [null, Type.FUNCTION],\n onupdatefiles: [null, Type.FUNCTION],\n onreorderfiles: [null, Type.FUNCTION],\n\n // hooks\n beforeDropFile: [null, Type.FUNCTION],\n beforeAddFile: [null, Type.FUNCTION],\n beforeRemoveFile: [null, Type.FUNCTION],\n beforePrepareFile: [null, Type.FUNCTION],\n\n // styles\n stylePanelLayout: [null, Type.STRING], // null 'integrated', 'compact', 'circle'\n stylePanelAspectRatio: [null, Type.STRING], // null or '3:2' or 1\n styleItemPanelAspectRatio: [null, Type.STRING],\n styleButtonRemoveItemPosition: ['left', Type.STRING],\n styleButtonProcessItemPosition: ['right', Type.STRING],\n styleLoadIndicatorPosition: ['right', Type.STRING],\n styleProgressIndicatorPosition: ['right', Type.STRING],\n styleButtonRemoveItemAlign: [false, Type.BOOLEAN],\n\n // custom initial files array\n files: [[], Type.ARRAY],\n\n // show support by displaying credits\n credits: [['https://pqina.nl/', 'Powered by PQINA'], Type.ARRAY],\n };\n\n var getItemByQuery = function getItemByQuery(items, query) {\n // just return first index\n if (isEmpty(query)) {\n return items[0] || null;\n }\n\n // query is index\n if (isInt(query)) {\n return items[query] || null;\n }\n\n // if query is item, get the id\n if (typeof query === 'object') {\n query = query.id;\n }\n\n // assume query is a string and return item by id\n return (\n items.find(function(item) {\n return item.id === query;\n }) || null\n );\n };\n\n var getNumericAspectRatioFromString = function getNumericAspectRatioFromString(aspectRatio) {\n if (isEmpty(aspectRatio)) {\n return aspectRatio;\n }\n if (/:/.test(aspectRatio)) {\n var parts = aspectRatio.split(':');\n return parts[1] / parts[0];\n }\n return parseFloat(aspectRatio);\n };\n\n var getActiveItems = function getActiveItems(items) {\n return items.filter(function(item) {\n return !item.archived;\n });\n };\n\n var Status = {\n EMPTY: 0,\n IDLE: 1, // waiting\n ERROR: 2, // a file is in error state\n BUSY: 3, // busy processing or loading\n READY: 4, // all files uploaded\n };\n\n var res = null;\n var canUpdateFileInput = function canUpdateFileInput() {\n if (res === null) {\n try {\n var dataTransfer = new DataTransfer();\n dataTransfer.items.add(new File(['hello world'], 'This_Works.txt'));\n var el = document.createElement('input');\n el.setAttribute('type', 'file');\n el.files = dataTransfer.files;\n res = el.files.length === 1;\n } catch (err) {\n res = false;\n }\n }\n return res;\n };\n\n var ITEM_ERROR = [\n ItemStatus.LOAD_ERROR,\n ItemStatus.PROCESSING_ERROR,\n ItemStatus.PROCESSING_REVERT_ERROR,\n ];\n\n var ITEM_BUSY = [\n ItemStatus.LOADING,\n ItemStatus.PROCESSING,\n ItemStatus.PROCESSING_QUEUED,\n ItemStatus.INIT,\n ];\n\n var ITEM_READY = [ItemStatus.PROCESSING_COMPLETE];\n\n var isItemInErrorState = function isItemInErrorState(item) {\n return ITEM_ERROR.includes(item.status);\n };\n var isItemInBusyState = function isItemInBusyState(item) {\n return ITEM_BUSY.includes(item.status);\n };\n var isItemInReadyState = function isItemInReadyState(item) {\n return ITEM_READY.includes(item.status);\n };\n\n var isAsync = function isAsync(state) {\n return (\n isObject(state.options.server) &&\n (isObject(state.options.server.process) || isFunction(state.options.server.process))\n );\n };\n\n var queries = function queries(state) {\n return {\n GET_STATUS: function GET_STATUS() {\n var items = getActiveItems(state.items);\n var EMPTY = Status.EMPTY,\n ERROR = Status.ERROR,\n BUSY = Status.BUSY,\n IDLE = Status.IDLE,\n READY = Status.READY;\n\n if (items.length === 0) return EMPTY;\n\n if (items.some(isItemInErrorState)) return ERROR;\n\n if (items.some(isItemInBusyState)) return BUSY;\n\n if (items.some(isItemInReadyState)) return READY;\n\n return IDLE;\n },\n\n GET_ITEM: function GET_ITEM(query) {\n return getItemByQuery(state.items, query);\n },\n\n GET_ACTIVE_ITEM: function GET_ACTIVE_ITEM(query) {\n return getItemByQuery(getActiveItems(state.items), query);\n },\n\n GET_ACTIVE_ITEMS: function GET_ACTIVE_ITEMS() {\n return getActiveItems(state.items);\n },\n\n GET_ITEMS: function GET_ITEMS() {\n return state.items;\n },\n\n GET_ITEM_NAME: function GET_ITEM_NAME(query) {\n var item = getItemByQuery(state.items, query);\n return item ? item.filename : null;\n },\n\n GET_ITEM_SIZE: function GET_ITEM_SIZE(query) {\n var item = getItemByQuery(state.items, query);\n return item ? item.fileSize : null;\n },\n\n GET_STYLES: function GET_STYLES() {\n return Object.keys(state.options)\n .filter(function(key) {\n return /^style/.test(key);\n })\n .map(function(option) {\n return {\n name: option,\n value: state.options[option],\n };\n });\n },\n\n GET_PANEL_ASPECT_RATIO: function GET_PANEL_ASPECT_RATIO() {\n var isShapeCircle = /circle/.test(state.options.stylePanelLayout);\n var aspectRatio = isShapeCircle\n ? 1\n : getNumericAspectRatioFromString(state.options.stylePanelAspectRatio);\n return aspectRatio;\n },\n\n GET_ITEM_PANEL_ASPECT_RATIO: function GET_ITEM_PANEL_ASPECT_RATIO() {\n return state.options.styleItemPanelAspectRatio;\n },\n\n GET_ITEMS_BY_STATUS: function GET_ITEMS_BY_STATUS(status) {\n return getActiveItems(state.items).filter(function(item) {\n return item.status === status;\n });\n },\n\n GET_TOTAL_ITEMS: function GET_TOTAL_ITEMS() {\n return getActiveItems(state.items).length;\n },\n\n SHOULD_UPDATE_FILE_INPUT: function SHOULD_UPDATE_FILE_INPUT() {\n return state.options.storeAsFile && canUpdateFileInput() && !isAsync(state);\n },\n\n IS_ASYNC: function IS_ASYNC() {\n return isAsync(state);\n },\n\n GET_FILE_SIZE_LABELS: function GET_FILE_SIZE_LABELS(query) {\n return {\n labelBytes: query('GET_LABEL_FILE_SIZE_BYTES') || undefined,\n labelKilobytes: query('GET_LABEL_FILE_SIZE_KILOBYTES') || undefined,\n labelMegabytes: query('GET_LABEL_FILE_SIZE_MEGABYTES') || undefined,\n labelGigabytes: query('GET_LABEL_FILE_SIZE_GIGABYTES') || undefined,\n };\n },\n };\n };\n\n var hasRoomForItem = function hasRoomForItem(state) {\n var count = getActiveItems(state.items).length;\n\n // if cannot have multiple items, to add one item it should currently not contain items\n if (!state.options.allowMultiple) {\n return count === 0;\n }\n\n // if allows multiple items, we check if a max item count has been set, if not, there's no limit\n var maxFileCount = state.options.maxFiles;\n if (maxFileCount === null) {\n return true;\n }\n\n // we check if the current count is smaller than the max count, if so, another file can still be added\n if (count < maxFileCount) {\n return true;\n }\n\n // no more room for another file\n return false;\n };\n\n var limit = function limit(value, min, max) {\n return Math.max(Math.min(max, value), min);\n };\n\n var arrayInsert = function arrayInsert(arr, index, item) {\n return arr.splice(index, 0, item);\n };\n\n var insertItem = function insertItem(items, item, index) {\n if (isEmpty(item)) {\n return null;\n }\n\n // if index is undefined, append\n if (typeof index === 'undefined') {\n items.push(item);\n return item;\n }\n\n // limit the index to the size of the items array\n index = limit(index, 0, items.length);\n\n // add item to array\n arrayInsert(items, index, item);\n\n // expose\n return item;\n };\n\n var isBase64DataURI = function isBase64DataURI(str) {\n return /^\\s*data:([a-z]+\\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\\-._~:@\\/?%\\s]*)\\s*$/i.test(\n str\n );\n };\n\n var getFilenameFromURL = function getFilenameFromURL(url) {\n return ('' + url)\n .split('/')\n .pop()\n .split('?')\n .shift();\n };\n\n var getExtensionFromFilename = function getExtensionFromFilename(name) {\n return name.split('.').pop();\n };\n\n var guesstimateExtension = function guesstimateExtension(type) {\n // if no extension supplied, exit here\n if (typeof type !== 'string') {\n return '';\n }\n\n // get subtype\n var subtype = type.split('/').pop();\n\n // is svg subtype\n if (/svg/.test(subtype)) {\n return 'svg';\n }\n\n if (/zip|compressed/.test(subtype)) {\n return 'zip';\n }\n\n if (/plain/.test(subtype)) {\n return 'txt';\n }\n\n if (/msword/.test(subtype)) {\n return 'doc';\n }\n\n // if is valid subtype\n if (/[a-z]+/.test(subtype)) {\n // always use jpg extension\n if (subtype === 'jpeg') {\n return 'jpg';\n }\n\n // return subtype\n return subtype;\n }\n\n return '';\n };\n\n var leftPad = function leftPad(value) {\n var padding = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n return (padding + value).slice(-padding.length);\n };\n\n var getDateString = function getDateString() {\n var date = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new Date();\n return (\n date.getFullYear() +\n '-' +\n leftPad(date.getMonth() + 1, '00') +\n '-' +\n leftPad(date.getDate(), '00') +\n '_' +\n leftPad(date.getHours(), '00') +\n '-' +\n leftPad(date.getMinutes(), '00') +\n '-' +\n leftPad(date.getSeconds(), '00')\n );\n };\n\n var getFileFromBlob = function getFileFromBlob(blob, filename) {\n var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n var extension = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;\n var file =\n typeof type === 'string'\n ? blob.slice(0, blob.size, type)\n : blob.slice(0, blob.size, blob.type);\n file.lastModifiedDate = new Date();\n\n // copy relative path\n if (blob._relativePath) file._relativePath = blob._relativePath;\n\n // if blob has name property, use as filename if no filename supplied\n if (!isString(filename)) {\n filename = getDateString();\n }\n\n // if filename supplied but no extension and filename has extension\n if (filename && extension === null && getExtensionFromFilename(filename)) {\n file.name = filename;\n } else {\n extension = extension || guesstimateExtension(file.type);\n file.name = filename + (extension ? '.' + extension : '');\n }\n\n return file;\n };\n\n var getBlobBuilder = function getBlobBuilder() {\n return (window.BlobBuilder =\n window.BlobBuilder ||\n window.WebKitBlobBuilder ||\n window.MozBlobBuilder ||\n window.MSBlobBuilder);\n };\n\n var createBlob = function createBlob(arrayBuffer, mimeType) {\n var BB = getBlobBuilder();\n\n if (BB) {\n var bb = new BB();\n bb.append(arrayBuffer);\n return bb.getBlob(mimeType);\n }\n\n return new Blob([arrayBuffer], {\n type: mimeType,\n });\n };\n\n var getBlobFromByteStringWithMimeType = function getBlobFromByteStringWithMimeType(\n byteString,\n mimeType\n ) {\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n\n return createBlob(ab, mimeType);\n };\n\n var getMimeTypeFromBase64DataURI = function getMimeTypeFromBase64DataURI(dataURI) {\n return (/^data:(.+);/.exec(dataURI) || [])[1] || null;\n };\n\n var getBase64DataFromBase64DataURI = function getBase64DataFromBase64DataURI(dataURI) {\n // get data part of string (remove data:image/jpeg...,)\n var data = dataURI.split(',')[1];\n\n // remove any whitespace as that causes InvalidCharacterError in IE\n return data.replace(/\\s/g, '');\n };\n\n var getByteStringFromBase64DataURI = function getByteStringFromBase64DataURI(dataURI) {\n return atob(getBase64DataFromBase64DataURI(dataURI));\n };\n\n var getBlobFromBase64DataURI = function getBlobFromBase64DataURI(dataURI) {\n var mimeType = getMimeTypeFromBase64DataURI(dataURI);\n var byteString = getByteStringFromBase64DataURI(dataURI);\n\n return getBlobFromByteStringWithMimeType(byteString, mimeType);\n };\n\n var getFileFromBase64DataURI = function getFileFromBase64DataURI(dataURI, filename, extension) {\n return getFileFromBlob(getBlobFromBase64DataURI(dataURI), filename, null, extension);\n };\n\n var getFileNameFromHeader = function getFileNameFromHeader(header) {\n // test if is content disposition header, if not exit\n if (!/^content-disposition:/i.test(header)) return null;\n\n // get filename parts\n var matches = header\n .split(/filename=|filename\\*=.+''/)\n .splice(1)\n .map(function(name) {\n return name.trim().replace(/^[\"']|[;\"']{0,2}$/g, '');\n })\n .filter(function(name) {\n return name.length;\n });\n\n return matches.length ? decodeURI(matches[matches.length - 1]) : null;\n };\n\n var getFileSizeFromHeader = function getFileSizeFromHeader(header) {\n if (/content-length:/i.test(header)) {\n var size = header.match(/[0-9]+/)[0];\n return size ? parseInt(size, 10) : null;\n }\n return null;\n };\n\n var getTranfserIdFromHeader = function getTranfserIdFromHeader(header) {\n if (/x-content-transfer-id:/i.test(header)) {\n var id = (header.split(':')[1] || '').trim();\n return id || null;\n }\n return null;\n };\n\n var getFileInfoFromHeaders = function getFileInfoFromHeaders(headers) {\n var info = {\n source: null,\n name: null,\n size: null,\n };\n\n var rows = headers.split('\\n');\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n try {\n for (\n var _iterator = rows[Symbol.iterator](), _step;\n !(_iteratorNormalCompletion = (_step = _iterator.next()).done);\n _iteratorNormalCompletion = true\n ) {\n var header = _step.value;\n\n var name = getFileNameFromHeader(header);\n if (name) {\n info.name = name;\n continue;\n }\n\n var size = getFileSizeFromHeader(header);\n if (size) {\n info.size = size;\n continue;\n }\n\n var source = getTranfserIdFromHeader(header);\n if (source) {\n info.source = source;\n continue;\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n return info;\n };\n\n var createFileLoader = function createFileLoader(fetchFn) {\n var state = {\n source: null,\n complete: false,\n progress: 0,\n size: null,\n timestamp: null,\n duration: 0,\n request: null,\n };\n\n var getProgress = function getProgress() {\n return state.progress;\n };\n var abort = function abort() {\n if (state.request && state.request.abort) {\n state.request.abort();\n }\n };\n\n // load source\n var load = function load() {\n // get quick reference\n var source = state.source;\n\n api.fire('init', source);\n\n // Load Files\n if (source instanceof File) {\n api.fire('load', source);\n } else if (source instanceof Blob) {\n // Load blobs, set default name to current date\n api.fire('load', getFileFromBlob(source, source.name));\n } else if (isBase64DataURI(source)) {\n // Load base 64, set default name to current date\n api.fire('load', getFileFromBase64DataURI(source));\n } else {\n // Deal as if is external URL, let's load it!\n loadURL(source);\n }\n };\n\n // loads a url\n var loadURL = function loadURL(url) {\n // is remote url and no fetch method supplied\n if (!fetchFn) {\n api.fire('error', {\n type: 'error',\n body: \"Can't load URL\",\n code: 400,\n });\n\n return;\n }\n\n // set request start\n state.timestamp = Date.now();\n\n // load file\n state.request = fetchFn(\n url,\n function(response) {\n // update duration\n state.duration = Date.now() - state.timestamp;\n\n // done!\n state.complete = true;\n\n // turn blob response into a file\n if (response instanceof Blob) {\n response = getFileFromBlob(\n response,\n response.name || getFilenameFromURL(url)\n );\n }\n\n api.fire(\n 'load',\n // if has received blob, we go with blob, if no response, we return null\n response instanceof Blob ? response : response ? response.body : null\n );\n },\n function(error) {\n api.fire(\n 'error',\n typeof error === 'string'\n ? {\n type: 'error',\n code: 0,\n body: error,\n }\n : error\n );\n },\n function(computable, current, total) {\n // collected some meta data already\n if (total) {\n state.size = total;\n }\n\n // update duration\n state.duration = Date.now() - state.timestamp;\n\n // if we can't compute progress, we're not going to fire progress events\n if (!computable) {\n state.progress = null;\n return;\n }\n\n // update progress percentage\n state.progress = current / total;\n\n // expose\n api.fire('progress', state.progress);\n },\n function() {\n api.fire('abort');\n },\n function(response) {\n var fileinfo = getFileInfoFromHeaders(\n typeof response === 'string' ? response : response.headers\n );\n api.fire('meta', {\n size: state.size || fileinfo.size,\n filename: fileinfo.name,\n source: fileinfo.source,\n });\n }\n );\n };\n\n var api = Object.assign({}, on(), {\n setSource: function setSource(source) {\n return (state.source = source);\n },\n getProgress: getProgress, // file load progress\n abort: abort, // abort file load\n load: load, // start load\n });\n\n return api;\n };\n\n var isGet = function isGet(method) {\n return /GET|HEAD/.test(method);\n };\n\n var sendRequest = function sendRequest(data, url, options) {\n var api = {\n onheaders: function onheaders() {},\n onprogress: function onprogress() {},\n onload: function onload() {},\n ontimeout: function ontimeout() {},\n onerror: function onerror() {},\n onabort: function onabort() {},\n abort: function abort() {\n aborted = true;\n xhr.abort();\n },\n };\n\n // timeout identifier, only used when timeout is defined\n var aborted = false;\n var headersReceived = false;\n\n // set default options\n options = Object.assign(\n {\n method: 'POST',\n headers: {},\n withCredentials: false,\n },\n options\n );\n\n // encode url\n url = encodeURI(url);\n\n // if method is GET, add any received data to url\n\n if (isGet(options.method) && data) {\n url =\n '' +\n url +\n encodeURIComponent(typeof data === 'string' ? data : JSON.stringify(data));\n }\n\n // create request\n var xhr = new XMLHttpRequest();\n\n // progress of load\n var process = isGet(options.method) ? xhr : xhr.upload;\n process.onprogress = function(e) {\n // no progress event when aborted ( onprogress is called once after abort() )\n if (aborted) {\n return;\n }\n\n api.onprogress(e.lengthComputable, e.loaded, e.total);\n };\n\n // tries to get header info to the app as fast as possible\n xhr.onreadystatechange = function() {\n // not interesting in these states ('unsent' and 'openend' as they don't give us any additional info)\n if (xhr.readyState < 2) {\n return;\n }\n\n // no server response\n if (xhr.readyState === 4 && xhr.status === 0) {\n return;\n }\n\n if (headersReceived) {\n return;\n }\n\n headersReceived = true;\n\n // we've probably received some useful data in response headers\n api.onheaders(xhr);\n };\n\n // load successful\n xhr.onload = function() {\n // is classified as valid response\n if (xhr.status >= 200 && xhr.status < 300) {\n api.onload(xhr);\n } else {\n api.onerror(xhr);\n }\n };\n\n // error during load\n xhr.onerror = function() {\n return api.onerror(xhr);\n };\n\n // request aborted\n xhr.onabort = function() {\n aborted = true;\n api.onabort();\n };\n\n // request timeout\n xhr.ontimeout = function() {\n return api.ontimeout(xhr);\n };\n\n // open up open up!\n xhr.open(options.method, url, true);\n\n // set timeout if defined (do it after open so IE11 plays ball)\n if (isInt(options.timeout)) {\n xhr.timeout = options.timeout;\n }\n\n // add headers\n Object.keys(options.headers).forEach(function(key) {\n var value = unescape(encodeURIComponent(options.headers[key]));\n xhr.setRequestHeader(key, value);\n });\n\n // set type of response\n if (options.responseType) {\n xhr.responseType = options.responseType;\n }\n\n // set credentials\n if (options.withCredentials) {\n xhr.withCredentials = true;\n }\n\n // let's send our data\n xhr.send(data);\n\n return api;\n };\n\n var createResponse = function createResponse(type, code, body, headers) {\n return {\n type: type,\n code: code,\n body: body,\n headers: headers,\n };\n };\n\n var createTimeoutResponse = function createTimeoutResponse(cb) {\n return function(xhr) {\n cb(createResponse('error', 0, 'Timeout', xhr.getAllResponseHeaders()));\n };\n };\n\n var hasQS = function hasQS(str) {\n return /\\?/.test(str);\n };\n var buildURL = function buildURL() {\n var url = '';\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n parts.forEach(function(part) {\n url += hasQS(url) && hasQS(part) ? part.replace(/\\?/, '&') : part;\n });\n return url;\n };\n\n var createFetchFunction = function createFetchFunction() {\n var apiUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var action = arguments.length > 1 ? arguments[1] : undefined;\n // custom handler (should also handle file, load, error, progress and abort)\n if (typeof action === 'function') {\n return action;\n }\n\n // no action supplied\n if (!action || !isString(action.url)) {\n return null;\n }\n\n // set onload hanlder\n var onload =\n action.onload ||\n function(res) {\n return res;\n };\n var onerror =\n action.onerror ||\n function(res) {\n return null;\n };\n\n // internal handler\n return function(url, load, error, progress, abort, headers) {\n // do local or remote request based on if the url is external\n var request = sendRequest(\n url,\n buildURL(apiUrl, action.url),\n Object.assign({}, action, {\n responseType: 'blob',\n })\n );\n\n request.onload = function(xhr) {\n // get headers\n var headers = xhr.getAllResponseHeaders();\n\n // get filename\n var filename = getFileInfoFromHeaders(headers).name || getFilenameFromURL(url);\n\n // create response\n load(\n createResponse(\n 'load',\n xhr.status,\n action.method === 'HEAD'\n ? null\n : getFileFromBlob(onload(xhr.response), filename),\n headers\n )\n );\n };\n\n request.onerror = function(xhr) {\n error(\n createResponse(\n 'error',\n xhr.status,\n onerror(xhr.response) || xhr.statusText,\n xhr.getAllResponseHeaders()\n )\n );\n };\n\n request.onheaders = function(xhr) {\n headers(createResponse('headers', xhr.status, null, xhr.getAllResponseHeaders()));\n };\n\n request.ontimeout = createTimeoutResponse(error);\n request.onprogress = progress;\n request.onabort = abort;\n\n // should return request\n return request;\n };\n };\n\n var ChunkStatus = {\n QUEUED: 0,\n COMPLETE: 1,\n PROCESSING: 2,\n ERROR: 3,\n WAITING: 4,\n };\n\n /*\n function signature:\n (file, metadata, load, error, progress, abort, transfer, options) => {\n return {\n abort:() => {}\n }\n }\n */\n\n // apiUrl, action, name, file, metadata, load, error, progress, abort, transfer, options\n var processFileChunked = function processFileChunked(\n apiUrl,\n action,\n name,\n file,\n metadata,\n load,\n error,\n progress,\n abort,\n transfer,\n options\n ) {\n // all chunks\n var chunks = [];\n var chunkTransferId = options.chunkTransferId,\n chunkServer = options.chunkServer,\n chunkSize = options.chunkSize,\n chunkRetryDelays = options.chunkRetryDelays;\n\n // default state\n var state = {\n serverId: chunkTransferId,\n aborted: false,\n };\n\n // set onload handlers\n var ondata =\n action.ondata ||\n function(fd) {\n return fd;\n };\n var onload =\n action.onload ||\n function(xhr, method) {\n return method === 'HEAD' ? xhr.getResponseHeader('Upload-Offset') : xhr.response;\n };\n var onerror =\n action.onerror ||\n function(res) {\n return null;\n };\n\n // create server hook\n var requestTransferId = function requestTransferId(cb) {\n var formData = new FormData();\n\n // add metadata under same name\n if (isObject(metadata)) formData.append(name, JSON.stringify(metadata));\n\n var headers =\n typeof action.headers === 'function'\n ? action.headers(file, metadata)\n : Object.assign(\n {},\n\n action.headers,\n {\n 'Upload-Length': file.size,\n }\n );\n\n var requestParams = Object.assign({}, action, {\n headers: headers,\n });\n\n // send request object\n var request = sendRequest(\n ondata(formData),\n buildURL(apiUrl, action.url),\n requestParams\n );\n\n request.onload = function(xhr) {\n return cb(onload(xhr, requestParams.method));\n };\n\n request.onerror = function(xhr) {\n return error(\n createResponse(\n 'error',\n xhr.status,\n onerror(xhr.response) || xhr.statusText,\n xhr.getAllResponseHeaders()\n )\n );\n };\n\n request.ontimeout = createTimeoutResponse(error);\n };\n\n var requestTransferOffset = function requestTransferOffset(cb) {\n var requestUrl = buildURL(apiUrl, chunkServer.url, state.serverId);\n\n var headers =\n typeof action.headers === 'function'\n ? action.headers(state.serverId)\n : Object.assign(\n {},\n\n action.headers\n );\n\n var requestParams = {\n headers: headers,\n method: 'HEAD',\n };\n\n var request = sendRequest(null, requestUrl, requestParams);\n\n request.onload = function(xhr) {\n return cb(onload(xhr, requestParams.method));\n };\n\n request.onerror = function(xhr) {\n return error(\n createResponse(\n 'error',\n xhr.status,\n onerror(xhr.response) || xhr.statusText,\n xhr.getAllResponseHeaders()\n )\n );\n };\n\n request.ontimeout = createTimeoutResponse(error);\n };\n\n // create chunks\n var lastChunkIndex = Math.floor(file.size / chunkSize);\n for (var i = 0; i <= lastChunkIndex; i++) {\n var offset = i * chunkSize;\n var data = file.slice(offset, offset + chunkSize, 'application/offset+octet-stream');\n chunks[i] = {\n index: i,\n size: data.size,\n offset: offset,\n data: data,\n file: file,\n progress: 0,\n retries: _toConsumableArray(chunkRetryDelays),\n status: ChunkStatus.QUEUED,\n error: null,\n request: null,\n timeout: null,\n };\n }\n\n var completeProcessingChunks = function completeProcessingChunks() {\n return load(state.serverId);\n };\n\n var canProcessChunk = function canProcessChunk(chunk) {\n return chunk.status === ChunkStatus.QUEUED || chunk.status === ChunkStatus.ERROR;\n };\n\n var processChunk = function processChunk(chunk) {\n // processing is paused, wait here\n if (state.aborted) return;\n\n // get next chunk to process\n chunk = chunk || chunks.find(canProcessChunk);\n\n // no more chunks to process\n if (!chunk) {\n // all done?\n if (\n chunks.every(function(chunk) {\n return chunk.status === ChunkStatus.COMPLETE;\n })\n ) {\n completeProcessingChunks();\n }\n\n // no chunk to handle\n return;\n }\n\n // now processing this chunk\n chunk.status = ChunkStatus.PROCESSING;\n chunk.progress = null;\n\n // allow parsing of formdata\n var ondata =\n chunkServer.ondata ||\n function(fd) {\n return fd;\n };\n var onerror =\n chunkServer.onerror ||\n function(res) {\n return null;\n };\n var onload = chunkServer.onload || function() {};\n\n // send request object\n var requestUrl = buildURL(apiUrl, chunkServer.url, state.serverId);\n\n var headers =\n typeof chunkServer.headers === 'function'\n ? chunkServer.headers(chunk)\n : Object.assign(\n {},\n\n chunkServer.headers,\n {\n 'Content-Type': 'application/offset+octet-stream',\n 'Upload-Offset': chunk.offset,\n 'Upload-Length': file.size,\n 'Upload-Name': file.name,\n }\n );\n\n var request = (chunk.request = sendRequest(\n ondata(chunk.data),\n requestUrl,\n Object.assign({}, chunkServer, {\n headers: headers,\n })\n ));\n\n request.onload = function(xhr) {\n // allow hooking into request result\n onload(xhr, chunk.index, chunks.length);\n\n // done!\n chunk.status = ChunkStatus.COMPLETE;\n\n // remove request reference\n chunk.request = null;\n\n // start processing more chunks\n processChunks();\n };\n\n request.onprogress = function(lengthComputable, loaded, total) {\n chunk.progress = lengthComputable ? loaded : null;\n updateTotalProgress();\n };\n\n request.onerror = function(xhr) {\n chunk.status = ChunkStatus.ERROR;\n chunk.request = null;\n chunk.error = onerror(xhr.response) || xhr.statusText;\n if (!retryProcessChunk(chunk)) {\n error(\n createResponse(\n 'error',\n xhr.status,\n onerror(xhr.response) || xhr.statusText,\n xhr.getAllResponseHeaders()\n )\n );\n }\n };\n\n request.ontimeout = function(xhr) {\n chunk.status = ChunkStatus.ERROR;\n chunk.request = null;\n if (!retryProcessChunk(chunk)) {\n createTimeoutResponse(error)(xhr);\n }\n };\n\n request.onabort = function() {\n chunk.status = ChunkStatus.QUEUED;\n chunk.request = null;\n abort();\n };\n };\n\n var retryProcessChunk = function retryProcessChunk(chunk) {\n // no more retries left\n if (chunk.retries.length === 0) return false;\n\n // new retry\n chunk.status = ChunkStatus.WAITING;\n clearTimeout(chunk.timeout);\n chunk.timeout = setTimeout(function() {\n processChunk(chunk);\n }, chunk.retries.shift());\n\n // we're going to retry\n return true;\n };\n\n var updateTotalProgress = function updateTotalProgress() {\n // calculate total progress fraction\n var totalBytesTransfered = chunks.reduce(function(p, chunk) {\n if (p === null || chunk.progress === null) return null;\n return p + chunk.progress;\n }, 0);\n\n // can't compute progress\n if (totalBytesTransfered === null) return progress(false, 0, 0);\n\n // calculate progress values\n var totalSize = chunks.reduce(function(total, chunk) {\n return total + chunk.size;\n }, 0);\n\n // can update progress indicator\n progress(true, totalBytesTransfered, totalSize);\n };\n\n // process new chunks\n var processChunks = function processChunks() {\n var totalProcessing = chunks.filter(function(chunk) {\n return chunk.status === ChunkStatus.PROCESSING;\n }).length;\n if (totalProcessing >= 1) return;\n processChunk();\n };\n\n var abortChunks = function abortChunks() {\n chunks.forEach(function(chunk) {\n clearTimeout(chunk.timeout);\n if (chunk.request) {\n chunk.request.abort();\n }\n });\n };\n\n // let's go!\n if (!state.serverId) {\n requestTransferId(function(serverId) {\n // stop here if aborted, might have happened in between request and callback\n if (state.aborted) return;\n\n // pass back to item so we can use it if something goes wrong\n transfer(serverId);\n\n // store internally\n state.serverId = serverId;\n processChunks();\n });\n } else {\n requestTransferOffset(function(offset) {\n // stop here if aborted, might have happened in between request and callback\n if (state.aborted) return;\n\n // mark chunks with lower offset as complete\n chunks\n .filter(function(chunk) {\n return chunk.offset < offset;\n })\n .forEach(function(chunk) {\n chunk.status = ChunkStatus.COMPLETE;\n chunk.progress = chunk.size;\n });\n\n // continue processing\n processChunks();\n });\n }\n\n return {\n abort: function abort() {\n state.aborted = true;\n abortChunks();\n },\n };\n };\n\n /*\n function signature:\n (file, metadata, load, error, progress, abort) => {\n return {\n abort:() => {}\n }\n }\n */\n var createFileProcessorFunction = function createFileProcessorFunction(\n apiUrl,\n action,\n name,\n options\n ) {\n return function(file, metadata, load, error, progress, abort, transfer) {\n // no file received\n if (!file) return;\n\n // if was passed a file, and we can chunk it, exit here\n var canChunkUpload = options.chunkUploads;\n var shouldChunkUpload = canChunkUpload && file.size > options.chunkSize;\n var willChunkUpload = canChunkUpload && (shouldChunkUpload || options.chunkForce);\n if (file instanceof Blob && willChunkUpload)\n return processFileChunked(\n apiUrl,\n action,\n name,\n file,\n metadata,\n load,\n error,\n progress,\n abort,\n transfer,\n options\n );\n\n // set handlers\n var ondata =\n action.ondata ||\n function(fd) {\n return fd;\n };\n var onload =\n action.onload ||\n function(res) {\n return res;\n };\n var onerror =\n action.onerror ||\n function(res) {\n return null;\n };\n\n var headers =\n typeof action.headers === 'function'\n ? action.headers(file, metadata) || {}\n : Object.assign(\n {},\n\n action.headers\n );\n\n var requestParams = Object.assign({}, action, {\n headers: headers,\n });\n\n // create formdata object\n var formData = new FormData();\n\n // add metadata under same name\n if (isObject(metadata)) {\n formData.append(name, JSON.stringify(metadata));\n }\n\n // Turn into an array of objects so no matter what the input, we can handle it the same way\n (file instanceof Blob ? [{ name: null, file: file }] : file).forEach(function(item) {\n formData.append(\n name,\n item.file,\n item.name === null ? item.file.name : '' + item.name + item.file.name\n );\n });\n\n // send request object\n var request = sendRequest(\n ondata(formData),\n buildURL(apiUrl, action.url),\n requestParams\n );\n request.onload = function(xhr) {\n load(\n createResponse(\n 'load',\n xhr.status,\n onload(xhr.response),\n xhr.getAllResponseHeaders()\n )\n );\n };\n\n request.onerror = function(xhr) {\n error(\n createResponse(\n 'error',\n xhr.status,\n onerror(xhr.response) || xhr.statusText,\n xhr.getAllResponseHeaders()\n )\n );\n };\n\n request.ontimeout = createTimeoutResponse(error);\n request.onprogress = progress;\n request.onabort = abort;\n\n // should return request\n return request;\n };\n };\n\n var createProcessorFunction = function createProcessorFunction() {\n var apiUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var action = arguments.length > 1 ? arguments[1] : undefined;\n var name = arguments.length > 2 ? arguments[2] : undefined;\n var options = arguments.length > 3 ? arguments[3] : undefined;\n\n // custom handler (should also handle file, load, error, progress and abort)\n if (typeof action === 'function')\n return function() {\n for (\n var _len = arguments.length, params = new Array(_len), _key = 0;\n _key < _len;\n _key++\n ) {\n params[_key] = arguments[_key];\n }\n return action.apply(void 0, [name].concat(params, [options]));\n };\n\n // no action supplied\n if (!action || !isString(action.url)) return null;\n\n // internal handler\n return createFileProcessorFunction(apiUrl, action, name, options);\n };\n\n /*\n function signature:\n (uniqueFileId, load, error) => { }\n */\n var createRevertFunction = function createRevertFunction() {\n var apiUrl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n var action = arguments.length > 1 ? arguments[1] : undefined;\n // is custom implementation\n if (typeof action === 'function') {\n return action;\n }\n\n // no action supplied, return stub function, interface will work, but file won't be removed\n if (!action || !isString(action.url)) {\n return function(uniqueFileId, load) {\n return load();\n };\n }\n\n // set onload hanlder\n var onload =\n action.onload ||\n function(res) {\n return res;\n };\n var onerror =\n action.onerror ||\n function(res) {\n return null;\n };\n\n // internal implementation\n return function(uniqueFileId, load, error) {\n var request = sendRequest(\n uniqueFileId,\n apiUrl + action.url,\n action // contains method, headers and withCredentials properties\n );\n request.onload = function(xhr) {\n load(\n createResponse(\n 'load',\n xhr.status,\n onload(xhr.response),\n xhr.getAllResponseHeaders()\n )\n );\n };\n\n request.onerror = function(xhr) {\n error(\n createResponse(\n 'error',\n xhr.status,\n onerror(xhr.response) || xhr.statusText,\n xhr.getAllResponseHeaders()\n )\n );\n };\n\n request.ontimeout = createTimeoutResponse(error);\n\n return request;\n };\n };\n\n var getRandomNumber = function getRandomNumber() {\n var min = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var max = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n return min + Math.random() * (max - min);\n };\n\n var createPerceivedPerformanceUpdater = function createPerceivedPerformanceUpdater(cb) {\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var tickMin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 25;\n var tickMax = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 250;\n var timeout = null;\n var start = Date.now();\n\n var tick = function tick() {\n var runtime = Date.now() - start;\n var delay = getRandomNumber(tickMin, tickMax);\n\n if (runtime + delay > duration) {\n delay = runtime + delay - duration;\n }\n\n var progress = runtime / duration;\n if (progress >= 1 || document.hidden) {\n cb(1);\n return;\n }\n\n cb(progress);\n\n timeout = setTimeout(tick, delay);\n };\n\n if (duration > 0) tick();\n\n return {\n clear: function clear() {\n clearTimeout(timeout);\n },\n };\n };\n\n var createFileProcessor = function createFileProcessor(processFn, options) {\n var state = {\n complete: false,\n perceivedProgress: 0,\n perceivedPerformanceUpdater: null,\n progress: null,\n timestamp: null,\n perceivedDuration: 0,\n duration: 0,\n request: null,\n response: null,\n };\n var allowMinimumUploadDuration = options.allowMinimumUploadDuration;\n\n var process = function process(file, metadata) {\n var progressFn = function progressFn() {\n // we've not yet started the real download, stop here\n // the request might not go through, for instance, there might be some server trouble\n // if state.progress is null, the server does not allow computing progress and we show the spinner instead\n if (state.duration === 0 || state.progress === null) return;\n\n // as we're now processing, fire the progress event\n api.fire('progress', api.getProgress());\n };\n\n var completeFn = function completeFn() {\n state.complete = true;\n api.fire('load-perceived', state.response.body);\n };\n\n // let's start processing\n api.fire('start');\n\n // set request start\n state.timestamp = Date.now();\n\n // create perceived performance progress indicator\n state.perceivedPerformanceUpdater = createPerceivedPerformanceUpdater(\n function(progress) {\n state.perceivedProgress = progress;\n state.perceivedDuration = Date.now() - state.timestamp;\n\n progressFn();\n\n // if fake progress is done, and a response has been received,\n // and we've not yet called the complete method\n if (state.response && state.perceivedProgress === 1 && !state.complete) {\n // we done!\n completeFn();\n }\n },\n // random delay as in a list of files you start noticing\n // files uploading at the exact same speed\n allowMinimumUploadDuration ? getRandomNumber(750, 1500) : 0\n );\n\n // remember request so we can abort it later\n state.request = processFn(\n // the file to process\n file,\n\n // the metadata to send along\n metadata,\n\n // callbacks (load, error, progress, abort, transfer)\n // load expects the body to be a server id if\n // you want to make use of revert\n function(response) {\n // we put the response in state so we can access\n // it outside of this method\n state.response = isObject(response)\n ? response\n : {\n type: 'load',\n code: 200,\n body: '' + response,\n headers: {},\n };\n\n // update duration\n state.duration = Date.now() - state.timestamp;\n\n // force progress to 1 as we're now done\n state.progress = 1;\n\n // actual load is done let's share results\n api.fire('load', state.response.body);\n\n // we are really done\n // if perceived progress is 1 ( wait for perceived progress to complete )\n // or if server does not support progress ( null )\n if (\n !allowMinimumUploadDuration ||\n (allowMinimumUploadDuration && state.perceivedProgress === 1)\n ) {\n completeFn();\n }\n },\n\n // error is expected to be an object with type, code, body\n function(error) {\n // cancel updater\n state.perceivedPerformanceUpdater.clear();\n\n // update others about this error\n api.fire(\n 'error',\n isObject(error)\n ? error\n : {\n type: 'error',\n code: 0,\n body: '' + error,\n }\n );\n },\n\n // actual processing progress\n function(computable, current, total) {\n // update actual duration\n state.duration = Date.now() - state.timestamp;\n\n // update actual progress\n state.progress = computable ? current / total : null;\n\n progressFn();\n },\n\n // abort does not expect a value\n function() {\n // stop updater\n state.perceivedPerformanceUpdater.clear();\n\n // fire the abort event so we can switch visuals\n api.fire('abort', state.response ? state.response.body : null);\n },\n\n // register the id for this transfer\n function(transferId) {\n api.fire('transfer', transferId);\n }\n );\n };\n\n var abort = function abort() {\n // no request running, can't abort\n if (!state.request) return;\n\n // stop updater\n state.perceivedPerformanceUpdater.clear();\n\n // abort actual request\n if (state.request.abort) state.request.abort();\n\n // if has response object, we've completed the request\n state.complete = true;\n };\n\n var reset = function reset() {\n abort();\n state.complete = false;\n state.perceivedProgress = 0;\n state.progress = 0;\n state.timestamp = null;\n state.perceivedDuration = 0;\n state.duration = 0;\n state.request = null;\n state.response = null;\n };\n\n var getProgress = allowMinimumUploadDuration\n ? function() {\n return state.progress ? Math.min(state.progress, state.perceivedProgress) : null;\n }\n : function() {\n return state.progress || null;\n };\n\n var getDuration = allowMinimumUploadDuration\n ? function() {\n return Math.min(state.duration, state.perceivedDuration);\n }\n : function() {\n return state.duration;\n };\n\n var api = Object.assign({}, on(), {\n process: process, // start processing file\n abort: abort, // abort active process request\n getProgress: getProgress,\n getDuration: getDuration,\n reset: reset,\n });\n\n return api;\n };\n\n var getFilenameWithoutExtension = function getFilenameWithoutExtension(name) {\n return name.substring(0, name.lastIndexOf('.')) || name;\n };\n\n var createFileStub = function createFileStub(source) {\n var data = [source.name, source.size, source.type];\n\n // is blob or base64, then we need to set the name\n if (source instanceof Blob || isBase64DataURI(source)) {\n data[0] = source.name || getDateString();\n } else if (isBase64DataURI(source)) {\n // if is base64 data uri we need to determine the average size and type\n data[1] = source.length;\n data[2] = getMimeTypeFromBase64DataURI(source);\n } else if (isString(source)) {\n // url\n data[0] = getFilenameFromURL(source);\n data[1] = 0;\n data[2] = 'application/octet-stream';\n }\n\n return {\n name: data[0],\n size: data[1],\n type: data[2],\n };\n };\n\n var isFile = function isFile(value) {\n return !!(value instanceof File || (value instanceof Blob && value.name));\n };\n\n var deepCloneObject = function deepCloneObject(src) {\n if (!isObject(src)) return src;\n var target = isArray(src) ? [] : {};\n for (var key in src) {\n if (!src.hasOwnProperty(key)) continue;\n var v = src[key];\n target[key] = v && isObject(v) ? deepCloneObject(v) : v;\n }\n return target;\n };\n\n var createItem = function createItem() {\n var origin = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n var serverFileReference =\n arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var file = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n // unique id for this item, is used to identify the item across views\n var id = getUniqueId();\n\n /**\n * Internal item state\n */\n var state = {\n // is archived\n archived: false,\n\n // if is frozen, no longer fires events\n frozen: false,\n\n // removed from view\n released: false,\n\n // original source\n source: null,\n\n // file model reference\n file: file,\n\n // id of file on server\n serverFileReference: serverFileReference,\n\n // id of file transfer on server\n transferId: null,\n\n // is aborted\n processingAborted: false,\n\n // current item status\n status: serverFileReference ? ItemStatus.PROCESSING_COMPLETE : ItemStatus.INIT,\n\n // active processes\n activeLoader: null,\n activeProcessor: null,\n };\n\n // callback used when abort processing is called to link back to the resolve method\n var abortProcessingRequestComplete = null;\n\n /**\n * Externally added item metadata\n */\n var metadata = {};\n\n // item data\n var setStatus = function setStatus(status) {\n return (state.status = status);\n };\n\n // fire event unless the item has been archived\n var fire = function fire(event) {\n if (state.released || state.frozen) return;\n for (\n var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1;\n _key < _len;\n _key++\n ) {\n params[_key - 1] = arguments[_key];\n }\n api.fire.apply(api, [event].concat(params));\n };\n\n // file data\n var getFileExtension = function getFileExtension() {\n return getExtensionFromFilename(state.file.name);\n };\n var getFileType = function getFileType() {\n return state.file.type;\n };\n var getFileSize = function getFileSize() {\n return state.file.size;\n };\n var getFile = function getFile() {\n return state.file;\n };\n\n //\n // logic to load a file\n //\n var load = function load(source, loader, onload) {\n // remember the original item source\n state.source = source;\n\n // source is known\n api.fireSync('init');\n\n // file stub is already there\n if (state.file) {\n api.fireSync('load-skip');\n return;\n }\n\n // set a stub file object while loading the actual data\n state.file = createFileStub(source);\n\n // starts loading\n loader.on('init', function() {\n fire('load-init');\n });\n\n // we'eve received a size indication, let's update the stub\n loader.on('meta', function(meta) {\n // set size of file stub\n state.file.size = meta.size;\n\n // set name of file stub\n state.file.filename = meta.filename;\n\n // if has received source, we done\n if (meta.source) {\n origin = FileOrigin.LIMBO;\n state.serverFileReference = meta.source;\n state.status = ItemStatus.PROCESSING_COMPLETE;\n }\n\n // size has been updated\n fire('load-meta');\n });\n\n // the file is now loading we need to update the progress indicators\n loader.on('progress', function(progress) {\n setStatus(ItemStatus.LOADING);\n\n fire('load-progress', progress);\n });\n\n // an error was thrown while loading the file, we need to switch to error state\n loader.on('error', function(error) {\n setStatus(ItemStatus.LOAD_ERROR);\n\n fire('load-request-error', error);\n });\n\n // user or another process aborted the file load (cannot retry)\n loader.on('abort', function() {\n setStatus(ItemStatus.INIT);\n fire('load-abort');\n });\n\n // done loading\n loader.on('load', function(file) {\n // as we've now loaded the file the loader is no longer required\n state.activeLoader = null;\n\n // called when file has loaded succesfully\n var success = function success(result) {\n // set (possibly) transformed file\n state.file = isFile(result) ? result : state.file;\n\n // file received\n if (origin === FileOrigin.LIMBO && state.serverFileReference) {\n setStatus(ItemStatus.PROCESSING_COMPLETE);\n } else {\n setStatus(ItemStatus.IDLE);\n }\n\n fire('load');\n };\n\n var error = function error(result) {\n // set original file\n state.file = file;\n fire('load-meta');\n\n setStatus(ItemStatus.LOAD_ERROR);\n fire('load-file-error', result);\n };\n\n // if we already have a server file reference, we don't need to call the onload method\n if (state.serverFileReference) {\n success(file);\n return;\n }\n\n // no server id, let's give this file the full treatment\n onload(file, success, error);\n });\n\n // set loader source data\n loader.setSource(source);\n\n // set as active loader\n state.activeLoader = loader;\n\n // load the source data\n loader.load();\n };\n\n var retryLoad = function retryLoad() {\n if (!state.activeLoader) {\n return;\n }\n state.activeLoader.load();\n };\n\n var abortLoad = function abortLoad() {\n if (state.activeLoader) {\n state.activeLoader.abort();\n return;\n }\n setStatus(ItemStatus.INIT);\n fire('load-abort');\n };\n\n //\n // logic to process a file\n //\n var process = function process(processor, onprocess) {\n // processing was aborted\n if (state.processingAborted) {\n state.processingAborted = false;\n return;\n }\n\n // now processing\n setStatus(ItemStatus.PROCESSING);\n\n // reset abort callback\n abortProcessingRequestComplete = null;\n\n // if no file loaded we'll wait for the load event\n if (!(state.file instanceof Blob)) {\n api.on('load', function() {\n process(processor, onprocess);\n });\n return;\n }\n\n // setup processor\n processor.on('load', function(serverFileReference) {\n // need this id to be able to revert the upload\n state.transferId = null;\n state.serverFileReference = serverFileReference;\n });\n\n // register transfer id\n processor.on('transfer', function(transferId) {\n // need this id to be able to revert the upload\n state.transferId = transferId;\n });\n\n processor.on('load-perceived', function(serverFileReference) {\n // no longer required\n state.activeProcessor = null;\n\n // need this id to be able to rever the upload\n state.transferId = null;\n state.serverFileReference = serverFileReference;\n\n setStatus(ItemStatus.PROCESSING_COMPLETE);\n fire('process-complete', serverFileReference);\n });\n\n processor.on('start', function() {\n fire('process-start');\n });\n\n processor.on('error', function(error) {\n state.activeProcessor = null;\n setStatus(ItemStatus.PROCESSING_ERROR);\n fire('process-error', error);\n });\n\n processor.on('abort', function(serverFileReference) {\n state.activeProcessor = null;\n\n // if file was uploaded but processing was cancelled during perceived processor time store file reference\n state.serverFileReference = serverFileReference;\n\n setStatus(ItemStatus.IDLE);\n fire('process-abort');\n\n // has timeout so doesn't interfere with remove action\n if (abortProcessingRequestComplete) {\n abortProcessingRequestComplete();\n }\n });\n\n processor.on('progress', function(progress) {\n fire('process-progress', progress);\n });\n\n // when successfully transformed\n var success = function success(file) {\n // if was archived in the mean time, don't process\n if (state.archived) return;\n\n // process file!\n processor.process(file, Object.assign({}, metadata));\n };\n\n // something went wrong during transform phase\n var error = console.error;\n\n // start processing the file\n onprocess(state.file, success, error);\n\n // set as active processor\n state.activeProcessor = processor;\n };\n\n var requestProcessing = function requestProcessing() {\n state.processingAborted = false;\n setStatus(ItemStatus.PROCESSING_QUEUED);\n };\n\n var abortProcessing = function abortProcessing() {\n return new Promise(function(resolve) {\n if (!state.activeProcessor) {\n state.processingAborted = true;\n\n setStatus(ItemStatus.IDLE);\n fire('process-abort');\n\n resolve();\n return;\n }\n\n abortProcessingRequestComplete = function abortProcessingRequestComplete() {\n resolve();\n };\n\n state.activeProcessor.abort();\n });\n };\n\n //\n // logic to revert a processed file\n //\n var revert = function revert(revertFileUpload, forceRevert) {\n return new Promise(function(resolve, reject) {\n // a completed upload will have a serverFileReference, a failed chunked upload where\n // getting a serverId succeeded but >=0 chunks have been uploaded will have transferId set\n var serverTransferId =\n state.serverFileReference !== null\n ? state.serverFileReference\n : state.transferId;\n\n // cannot revert without a server id for this process\n if (serverTransferId === null) {\n resolve();\n return;\n }\n\n // revert the upload (fire and forget)\n revertFileUpload(\n serverTransferId,\n function() {\n // reset file server id and transfer id as now it's not available on the server\n state.serverFileReference = null;\n state.transferId = null;\n resolve();\n },\n function(error) {\n // don't set error state when reverting is optional, it will always resolve\n if (!forceRevert) {\n resolve();\n return;\n }\n\n // oh no errors\n setStatus(ItemStatus.PROCESSING_REVERT_ERROR);\n fire('process-revert-error');\n reject(error);\n }\n );\n\n // fire event\n setStatus(ItemStatus.IDLE);\n fire('process-revert');\n });\n };\n\n // exposed methods\n var _setMetadata = function setMetadata(key, value, silent) {\n var keys = key.split('.');\n var root = keys[0];\n var last = keys.pop();\n var data = metadata;\n keys.forEach(function(key) {\n return (data = data[key]);\n });\n\n // compare old value against new value, if they're the same, we're not updating\n if (JSON.stringify(data[last]) === JSON.stringify(value)) return;\n\n // update value\n data[last] = value;\n\n // fire update\n fire('metadata-update', {\n key: root,\n value: metadata[root],\n silent: silent,\n });\n };\n\n var getMetadata = function getMetadata(key) {\n return deepCloneObject(key ? metadata[key] : metadata);\n };\n\n var api = Object.assign(\n {\n id: {\n get: function get() {\n return id;\n },\n },\n origin: {\n get: function get() {\n return origin;\n },\n set: function set(value) {\n return (origin = value);\n },\n },\n serverId: {\n get: function get() {\n return state.serverFileReference;\n },\n },\n transferId: {\n get: function get() {\n return state.transferId;\n },\n },\n status: {\n get: function get() {\n return state.status;\n },\n },\n filename: {\n get: function get() {\n return state.file.name;\n },\n },\n filenameWithoutExtension: {\n get: function get() {\n return getFilenameWithoutExtension(state.file.name);\n },\n },\n fileExtension: { get: getFileExtension },\n fileType: { get: getFileType },\n fileSize: { get: getFileSize },\n file: { get: getFile },\n relativePath: {\n get: function get() {\n return state.file._relativePath;\n },\n },\n\n source: {\n get: function get() {\n return state.source;\n },\n },\n\n getMetadata: getMetadata,\n setMetadata: function setMetadata(key, value, silent) {\n if (isObject(key)) {\n var data = key;\n Object.keys(data).forEach(function(key) {\n _setMetadata(key, data[key], value);\n });\n return key;\n }\n _setMetadata(key, value, silent);\n return value;\n },\n\n extend: function extend(name, handler) {\n return (itemAPI[name] = handler);\n },\n\n abortLoad: abortLoad,\n retryLoad: retryLoad,\n requestProcessing: requestProcessing,\n abortProcessing: abortProcessing,\n\n load: load,\n process: process,\n revert: revert,\n },\n\n on(),\n {\n freeze: function freeze() {\n return (state.frozen = true);\n },\n\n release: function release() {\n return (state.released = true);\n },\n released: {\n get: function get() {\n return state.released;\n },\n },\n\n archive: function archive() {\n return (state.archived = true);\n },\n archived: {\n get: function get() {\n return state.archived;\n },\n },\n\n // replace source and file object\n setFile: function setFile(file) {\n return (state.file = file);\n },\n }\n );\n\n // create it here instead of returning it instantly so we can extend it later\n var itemAPI = createObject(api);\n\n return itemAPI;\n };\n\n var getItemIndexByQuery = function getItemIndexByQuery(items, query) {\n // just return first index\n if (isEmpty(query)) {\n return 0;\n }\n\n // invalid queries\n if (!isString(query)) {\n return -1;\n }\n\n // return item by id (or -1 if not found)\n return items.findIndex(function(item) {\n return item.id === query;\n });\n };\n\n var getItemById = function getItemById(items, itemId) {\n var index = getItemIndexByQuery(items, itemId);\n if (index < 0) {\n return;\n }\n return items[index] || null;\n };\n\n var fetchBlob = function fetchBlob(url, load, error, progress, abort, headers) {\n var request = sendRequest(null, url, {\n method: 'GET',\n responseType: 'blob',\n });\n\n request.onload = function(xhr) {\n // get headers\n var headers = xhr.getAllResponseHeaders();\n\n // get filename\n var filename = getFileInfoFromHeaders(headers).name || getFilenameFromURL(url);\n\n // create response\n load(\n createResponse('load', xhr.status, getFileFromBlob(xhr.response, filename), headers)\n );\n };\n\n request.onerror = function(xhr) {\n error(createResponse('error', xhr.status, xhr.statusText, xhr.getAllResponseHeaders()));\n };\n\n request.onheaders = function(xhr) {\n headers(createResponse('headers', xhr.status, null, xhr.getAllResponseHeaders()));\n };\n\n request.ontimeout = createTimeoutResponse(error);\n request.onprogress = progress;\n request.onabort = abort;\n\n // should return request\n return request;\n };\n\n var getDomainFromURL = function getDomainFromURL(url) {\n if (url.indexOf('//') === 0) {\n url = location.protocol + url;\n }\n return url\n .toLowerCase()\n .replace('blob:', '')\n .replace(/([a-z])?:\\/\\//, '$1')\n .split('/')[0];\n };\n\n var isExternalURL = function isExternalURL(url) {\n return (\n (url.indexOf(':') > -1 || url.indexOf('//') > -1) &&\n getDomainFromURL(location.href) !== getDomainFromURL(url)\n );\n };\n\n var dynamicLabel = function dynamicLabel(label) {\n return function() {\n return isFunction(label) ? label.apply(void 0, arguments) : label;\n };\n };\n\n var isMockItem = function isMockItem(item) {\n return !isFile(item.file);\n };\n\n var listUpdated = function listUpdated(dispatch, state) {\n clearTimeout(state.listUpdateTimeout);\n state.listUpdateTimeout = setTimeout(function() {\n dispatch('DID_UPDATE_ITEMS', { items: getActiveItems(state.items) });\n }, 0);\n };\n\n var optionalPromise = function optionalPromise(fn) {\n for (\n var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1;\n _key < _len;\n _key++\n ) {\n params[_key - 1] = arguments[_key];\n }\n return new Promise(function(resolve) {\n if (!fn) {\n return resolve(true);\n }\n\n var result = fn.apply(void 0, params);\n\n if (result == null) {\n return resolve(true);\n }\n\n if (typeof result === 'boolean') {\n return resolve(result);\n }\n\n if (typeof result.then === 'function') {\n result.then(resolve);\n }\n });\n };\n\n var sortItems = function sortItems(state, compare) {\n state.items.sort(function(a, b) {\n return compare(createItemAPI(a), createItemAPI(b));\n });\n };\n\n // returns item based on state\n var getItemByQueryFromState = function getItemByQueryFromState(state, itemHandler) {\n return function() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var query = _ref.query,\n _ref$success = _ref.success,\n success = _ref$success === void 0 ? function() {} : _ref$success,\n _ref$failure = _ref.failure,\n failure = _ref$failure === void 0 ? function() {} : _ref$failure,\n options = _objectWithoutProperties(_ref, ['query', 'success', 'failure']);\n var item = getItemByQuery(state.items, query);\n if (!item) {\n failure({\n error: createResponse('error', 0, 'Item not found'),\n file: null,\n });\n\n return;\n }\n itemHandler(item, success, failure, options || {});\n };\n };\n\n var actions = function actions(dispatch, query, state) {\n return {\n /**\n * Aborts all ongoing processes\n */\n ABORT_ALL: function ABORT_ALL() {\n getActiveItems(state.items).forEach(function(item) {\n item.freeze();\n item.abortLoad();\n item.abortProcessing();\n });\n },\n\n /**\n * Sets initial files\n */\n DID_SET_FILES: function DID_SET_FILES(_ref2) {\n var _ref2$value = _ref2.value,\n value = _ref2$value === void 0 ? [] : _ref2$value;\n // map values to file objects\n var files = value.map(function(file) {\n return {\n source: file.source ? file.source : file,\n options: file.options,\n };\n });\n\n // loop over files, if file is in list, leave it be, if not, remove\n // test if items should be moved\n var activeItems = getActiveItems(state.items);\n\n activeItems.forEach(function(item) {\n // if item not is in new value, remove\n if (\n !files.find(function(file) {\n return file.source === item.source || file.source === item.file;\n })\n ) {\n dispatch('REMOVE_ITEM', { query: item, remove: false });\n }\n });\n\n // add new files\n activeItems = getActiveItems(state.items);\n files.forEach(function(file, index) {\n // if file is already in list\n if (\n activeItems.find(function(item) {\n return item.source === file.source || item.file === file.source;\n })\n )\n return;\n\n // not in list, add\n dispatch(\n 'ADD_ITEM',\n Object.assign({}, file, {\n interactionMethod: InteractionMethod.NONE,\n index: index,\n })\n );\n });\n },\n\n DID_UPDATE_ITEM_METADATA: function DID_UPDATE_ITEM_METADATA(_ref3) {\n var id = _ref3.id,\n action = _ref3.action,\n change = _ref3.change;\n // don't do anything\n if (change.silent) return;\n\n // if is called multiple times in close succession we combined all calls together to save resources\n clearTimeout(state.itemUpdateTimeout);\n state.itemUpdateTimeout = setTimeout(function() {\n var item = getItemById(state.items, id);\n\n // only revert and attempt to upload when we're uploading to a server\n if (!query('IS_ASYNC')) {\n // should we update the output data\n applyFilterChain('SHOULD_PREPARE_OUTPUT', false, {\n item: item,\n query: query,\n action: action,\n change: change,\n }).then(function(shouldPrepareOutput) {\n // plugins determined the output data should be prepared (or not), can be adjusted with beforePrepareOutput hook\n var beforePrepareFile = query('GET_BEFORE_PREPARE_FILE');\n if (beforePrepareFile)\n shouldPrepareOutput = beforePrepareFile(item, shouldPrepareOutput);\n\n if (!shouldPrepareOutput) return;\n\n dispatch(\n 'REQUEST_PREPARE_OUTPUT',\n {\n query: id,\n item: item,\n success: function success(file) {\n dispatch('DID_PREPARE_OUTPUT', { id: id, file: file });\n },\n },\n\n true\n );\n });\n\n return;\n }\n\n // if is local item we need to enable upload button so change can be propagated to server\n if (item.origin === FileOrigin.LOCAL) {\n dispatch('DID_LOAD_ITEM', {\n id: item.id,\n error: null,\n serverFileReference: item.source,\n });\n }\n\n // for async scenarios\n var upload = function upload() {\n // we push this forward a bit so the interface is updated correctly\n setTimeout(function() {\n dispatch('REQUEST_ITEM_PROCESSING', { query: id });\n }, 32);\n };\n\n var revert = function revert(doUpload) {\n item.revert(\n createRevertFunction(\n state.options.server.url,\n state.options.server.revert\n ),\n query('GET_FORCE_REVERT')\n )\n .then(doUpload ? upload : function() {})\n .catch(function() {});\n };\n\n var abort = function abort(doUpload) {\n item.abortProcessing().then(doUpload ? upload : function() {});\n };\n\n // if we should re-upload the file immediately\n if (item.status === ItemStatus.PROCESSING_COMPLETE) {\n return revert(state.options.instantUpload);\n }\n\n // if currently uploading, cancel upload\n if (item.status === ItemStatus.PROCESSING) {\n return abort(state.options.instantUpload);\n }\n\n if (state.options.instantUpload) {\n upload();\n }\n }, 0);\n },\n\n MOVE_ITEM: function MOVE_ITEM(_ref4) {\n var query = _ref4.query,\n index = _ref4.index;\n var item = getItemByQuery(state.items, query);\n if (!item) return;\n var currentIndex = state.items.indexOf(item);\n index = limit(index, 0, state.items.length - 1);\n if (currentIndex === index) return;\n state.items.splice(index, 0, state.items.splice(currentIndex, 1)[0]);\n },\n\n SORT: function SORT(_ref5) {\n var compare = _ref5.compare;\n sortItems(state, compare);\n dispatch('DID_SORT_ITEMS', {\n items: query('GET_ACTIVE_ITEMS'),\n });\n },\n\n ADD_ITEMS: function ADD_ITEMS(_ref6) {\n var items = _ref6.items,\n index = _ref6.index,\n interactionMethod = _ref6.interactionMethod,\n _ref6$success = _ref6.success,\n success = _ref6$success === void 0 ? function() {} : _ref6$success,\n _ref6$failure = _ref6.failure,\n failure = _ref6$failure === void 0 ? function() {} : _ref6$failure;\n var currentIndex = index;\n\n if (index === -1 || typeof index === 'undefined') {\n var insertLocation = query('GET_ITEM_INSERT_LOCATION');\n var totalItems = query('GET_TOTAL_ITEMS');\n currentIndex = insertLocation === 'before' ? 0 : totalItems;\n }\n\n var ignoredFiles = query('GET_IGNORED_FILES');\n var isValidFile = function isValidFile(source) {\n return isFile(source)\n ? !ignoredFiles.includes(source.name.toLowerCase())\n : !isEmpty(source);\n };\n var validItems = items.filter(isValidFile);\n\n var promises = validItems.map(function(source) {\n return new Promise(function(resolve, reject) {\n dispatch('ADD_ITEM', {\n interactionMethod: interactionMethod,\n source: source.source || source,\n success: resolve,\n failure: reject,\n index: currentIndex++,\n options: source.options || {},\n });\n });\n });\n\n Promise.all(promises)\n .then(success)\n .catch(failure);\n },\n\n /**\n * @param source\n * @param index\n * @param interactionMethod\n */\n ADD_ITEM: function ADD_ITEM(_ref7) {\n var source = _ref7.source,\n _ref7$index = _ref7.index,\n index = _ref7$index === void 0 ? -1 : _ref7$index,\n interactionMethod = _ref7.interactionMethod,\n _ref7$success = _ref7.success,\n success = _ref7$success === void 0 ? function() {} : _ref7$success,\n _ref7$failure = _ref7.failure,\n failure = _ref7$failure === void 0 ? function() {} : _ref7$failure,\n _ref7$options = _ref7.options,\n options = _ref7$options === void 0 ? {} : _ref7$options;\n // if no source supplied\n if (isEmpty(source)) {\n failure({\n error: createResponse('error', 0, 'No source'),\n file: null,\n });\n\n return;\n }\n\n // filter out invalid file items, used to filter dropped directory contents\n if (\n isFile(source) &&\n state.options.ignoredFiles.includes(source.name.toLowerCase())\n ) {\n // fail silently\n return;\n }\n\n // test if there's still room in the list of files\n if (!hasRoomForItem(state)) {\n // if multiple allowed, we can't replace\n // or if only a single item is allowed but we're not allowed to replace it we exit\n if (\n state.options.allowMultiple ||\n (!state.options.allowMultiple && !state.options.allowReplace)\n ) {\n var error = createResponse('warning', 0, 'Max files');\n\n dispatch('DID_THROW_MAX_FILES', {\n source: source,\n error: error,\n });\n\n failure({ error: error, file: null });\n\n return;\n }\n\n // let's replace the item\n // id of first item we're about to remove\n var _item = getActiveItems(state.items)[0];\n\n // if has been processed remove it from the server as well\n if (\n _item.status === ItemStatus.PROCESSING_COMPLETE ||\n _item.status === ItemStatus.PROCESSING_REVERT_ERROR\n ) {\n var forceRevert = query('GET_FORCE_REVERT');\n _item\n .revert(\n createRevertFunction(\n state.options.server.url,\n state.options.server.revert\n ),\n forceRevert\n )\n .then(function() {\n if (!forceRevert) return;\n\n // try to add now\n dispatch('ADD_ITEM', {\n source: source,\n index: index,\n interactionMethod: interactionMethod,\n success: success,\n failure: failure,\n options: options,\n });\n })\n .catch(function() {}); // no need to handle this catch state for now\n\n if (forceRevert) return;\n }\n\n // remove first item as it will be replaced by this item\n dispatch('REMOVE_ITEM', { query: _item.id });\n }\n\n // where did the file originate\n var origin =\n options.type === 'local'\n ? FileOrigin.LOCAL\n : options.type === 'limbo'\n ? FileOrigin.LIMBO\n : FileOrigin.INPUT;\n\n // create a new blank item\n var item = createItem(\n // where did this file come from\n origin,\n\n // an input file never has a server file reference\n origin === FileOrigin.INPUT ? null : source,\n\n // file mock data, if defined\n options.file\n );\n\n // set initial meta data\n Object.keys(options.metadata || {}).forEach(function(key) {\n item.setMetadata(key, options.metadata[key]);\n });\n\n // created the item, let plugins add methods\n applyFilters('DID_CREATE_ITEM', item, { query: query, dispatch: dispatch });\n\n // where to insert new items\n var itemInsertLocation = query('GET_ITEM_INSERT_LOCATION');\n\n // adjust index if is not allowed to pick location\n if (!state.options.itemInsertLocationFreedom) {\n index = itemInsertLocation === 'before' ? -1 : state.items.length;\n }\n\n // add item to list\n insertItem(state.items, item, index);\n\n // sort items in list\n if (isFunction(itemInsertLocation) && source) {\n sortItems(state, itemInsertLocation);\n }\n\n // get a quick reference to the item id\n var id = item.id;\n\n // observe item events\n item.on('init', function() {\n dispatch('DID_INIT_ITEM', { id: id });\n });\n\n item.on('load-init', function() {\n dispatch('DID_START_ITEM_LOAD', { id: id });\n });\n\n item.on('load-meta', function() {\n dispatch('DID_UPDATE_ITEM_META', { id: id });\n });\n\n item.on('load-progress', function(progress) {\n dispatch('DID_UPDATE_ITEM_LOAD_PROGRESS', { id: id, progress: progress });\n });\n\n item.on('load-request-error', function(error) {\n var mainStatus = dynamicLabel(state.options.labelFileLoadError)(error);\n\n // is client error, no way to recover\n if (error.code >= 400 && error.code < 500) {\n dispatch('DID_THROW_ITEM_INVALID', {\n id: id,\n error: error,\n status: {\n main: mainStatus,\n sub: error.code + ' (' + error.body + ')',\n },\n });\n\n // reject the file so can be dealt with through API\n failure({ error: error, file: createItemAPI(item) });\n return;\n }\n\n // is possible server error, so might be possible to retry\n dispatch('DID_THROW_ITEM_LOAD_ERROR', {\n id: id,\n error: error,\n status: {\n main: mainStatus,\n sub: state.options.labelTapToRetry,\n },\n });\n });\n\n item.on('load-file-error', function(error) {\n dispatch('DID_THROW_ITEM_INVALID', {\n id: id,\n error: error.status,\n status: error.status,\n });\n\n failure({ error: error.status, file: createItemAPI(item) });\n });\n\n item.on('load-abort', function() {\n dispatch('REMOVE_ITEM', { query: id });\n });\n\n item.on('load-skip', function() {\n item.on('metadata-update', function(change) {\n if (!isFile(item.file)) return;\n dispatch('DID_UPDATE_ITEM_METADATA', { id: id, change: change });\n });\n\n dispatch('COMPLETE_LOAD_ITEM', {\n query: id,\n item: item,\n data: {\n source: source,\n success: success,\n },\n });\n });\n\n item.on('load', function() {\n var handleAdd = function handleAdd(shouldAdd) {\n // no should not add this file\n if (!shouldAdd) {\n dispatch('REMOVE_ITEM', {\n query: id,\n });\n\n return;\n }\n\n // now interested in metadata updates\n item.on('metadata-update', function(change) {\n dispatch('DID_UPDATE_ITEM_METADATA', { id: id, change: change });\n });\n\n // let plugins decide if the output data should be prepared at this point\n // means we'll do this and wait for idle state\n applyFilterChain('SHOULD_PREPARE_OUTPUT', false, {\n item: item,\n query: query,\n }).then(function(shouldPrepareOutput) {\n // plugins determined the output data should be prepared (or not), can be adjusted with beforePrepareOutput hook\n var beforePrepareFile = query('GET_BEFORE_PREPARE_FILE');\n if (beforePrepareFile)\n shouldPrepareOutput = beforePrepareFile(item, shouldPrepareOutput);\n\n var loadComplete = function loadComplete() {\n dispatch('COMPLETE_LOAD_ITEM', {\n query: id,\n item: item,\n data: {\n source: source,\n success: success,\n },\n });\n\n listUpdated(dispatch, state);\n };\n\n // exit\n if (shouldPrepareOutput) {\n // wait for idle state and then run PREPARE_OUTPUT\n dispatch(\n 'REQUEST_PREPARE_OUTPUT',\n {\n query: id,\n item: item,\n success: function success(file) {\n dispatch('DID_PREPARE_OUTPUT', { id: id, file: file });\n loadComplete();\n },\n },\n\n true\n );\n\n return;\n }\n\n loadComplete();\n });\n };\n\n // item loaded, allow plugins to\n // - read data (quickly)\n // - add metadata\n applyFilterChain('DID_LOAD_ITEM', item, { query: query, dispatch: dispatch })\n .then(function() {\n optionalPromise(query('GET_BEFORE_ADD_FILE'), createItemAPI(item)).then(\n handleAdd\n );\n })\n .catch(function(e) {\n if (!e || !e.error || !e.status) return handleAdd(false);\n dispatch('DID_THROW_ITEM_INVALID', {\n id: id,\n error: e.error,\n status: e.status,\n });\n });\n });\n\n item.on('process-start', function() {\n dispatch('DID_START_ITEM_PROCESSING', { id: id });\n });\n\n item.on('process-progress', function(progress) {\n dispatch('DID_UPDATE_ITEM_PROCESS_PROGRESS', { id: id, progress: progress });\n });\n\n item.on('process-error', function(error) {\n dispatch('DID_THROW_ITEM_PROCESSING_ERROR', {\n id: id,\n error: error,\n status: {\n main: dynamicLabel(state.options.labelFileProcessingError)(error),\n sub: state.options.labelTapToRetry,\n },\n });\n });\n\n item.on('process-revert-error', function(error) {\n dispatch('DID_THROW_ITEM_PROCESSING_REVERT_ERROR', {\n id: id,\n error: error,\n status: {\n main: dynamicLabel(state.options.labelFileProcessingRevertError)(error),\n sub: state.options.labelTapToRetry,\n },\n });\n });\n\n item.on('process-complete', function(serverFileReference) {\n dispatch('DID_COMPLETE_ITEM_PROCESSING', {\n id: id,\n error: null,\n serverFileReference: serverFileReference,\n });\n\n dispatch('DID_DEFINE_VALUE', { id: id, value: serverFileReference });\n });\n\n item.on('process-abort', function() {\n dispatch('DID_ABORT_ITEM_PROCESSING', { id: id });\n });\n\n item.on('process-revert', function() {\n dispatch('DID_REVERT_ITEM_PROCESSING', { id: id });\n dispatch('DID_DEFINE_VALUE', { id: id, value: null });\n });\n\n // let view know the item has been inserted\n dispatch('DID_ADD_ITEM', {\n id: id,\n index: index,\n interactionMethod: interactionMethod,\n });\n\n listUpdated(dispatch, state);\n\n // start loading the source\n var _ref8 = state.options.server || {},\n url = _ref8.url,\n load = _ref8.load,\n restore = _ref8.restore,\n fetch = _ref8.fetch;\n\n item.load(\n source,\n\n // this creates a function that loads the file based on the type of file (string, base64, blob, file) and location of file (local, remote, limbo)\n createFileLoader(\n origin === FileOrigin.INPUT\n ? // input, if is remote, see if should use custom fetch, else use default fetchBlob\n isString(source) && isExternalURL(source)\n ? fetch\n ? createFetchFunction(url, fetch)\n : fetchBlob // remote url\n : fetchBlob // try to fetch url\n : // limbo or local\n origin === FileOrigin.LIMBO\n ? createFetchFunction(url, restore) // limbo\n : createFetchFunction(url, load) // local\n ),\n\n // called when the file is loaded so it can be piped through the filters\n function(file, success, error) {\n // let's process the file\n applyFilterChain('LOAD_FILE', file, { query: query })\n .then(success)\n .catch(error);\n }\n );\n },\n\n REQUEST_PREPARE_OUTPUT: function REQUEST_PREPARE_OUTPUT(_ref9) {\n var item = _ref9.item,\n success = _ref9.success,\n _ref9$failure = _ref9.failure,\n failure = _ref9$failure === void 0 ? function() {} : _ref9$failure;\n // error response if item archived\n var err = {\n error: createResponse('error', 0, 'Item not found'),\n file: null,\n };\n\n // don't handle archived items, an item could have been archived (load aborted) while waiting to be prepared\n if (item.archived) return failure(err);\n\n // allow plugins to alter the file data\n applyFilterChain('PREPARE_OUTPUT', item.file, { query: query, item: item }).then(\n function(result) {\n applyFilterChain('COMPLETE_PREPARE_OUTPUT', result, {\n query: query,\n item: item,\n }).then(function(result) {\n // don't handle archived items, an item could have been archived (load aborted) while being prepared\n if (item.archived) return failure(err);\n\n // we done!\n success(result);\n });\n }\n );\n },\n\n COMPLETE_LOAD_ITEM: function COMPLETE_LOAD_ITEM(_ref10) {\n var item = _ref10.item,\n data = _ref10.data;\n var success = data.success,\n source = data.source;\n\n // sort items in list\n var itemInsertLocation = query('GET_ITEM_INSERT_LOCATION');\n if (isFunction(itemInsertLocation) && source) {\n sortItems(state, itemInsertLocation);\n }\n\n // let interface know the item has loaded\n dispatch('DID_LOAD_ITEM', {\n id: item.id,\n error: null,\n serverFileReference: item.origin === FileOrigin.INPUT ? null : source,\n });\n\n // item has been successfully loaded and added to the\n // list of items so can now be safely returned for use\n success(createItemAPI(item));\n\n // if this is a local server file we need to show a different state\n if (item.origin === FileOrigin.LOCAL) {\n dispatch('DID_LOAD_LOCAL_ITEM', { id: item.id });\n return;\n }\n\n // if is a temp server file we prevent async upload call here (as the file is already on the server)\n if (item.origin === FileOrigin.LIMBO) {\n dispatch('DID_COMPLETE_ITEM_PROCESSING', {\n id: item.id,\n error: null,\n serverFileReference: source,\n });\n\n dispatch('DID_DEFINE_VALUE', {\n id: item.id,\n value: item.serverId || source,\n });\n\n return;\n }\n\n // id we are allowed to upload the file immediately, lets do it\n if (query('IS_ASYNC') && state.options.instantUpload) {\n dispatch('REQUEST_ITEM_PROCESSING', { query: item.id });\n }\n },\n\n RETRY_ITEM_LOAD: getItemByQueryFromState(state, function(item) {\n // try loading the source one more time\n item.retryLoad();\n }),\n\n REQUEST_ITEM_PREPARE: getItemByQueryFromState(state, function(item, _success, failure) {\n dispatch(\n 'REQUEST_PREPARE_OUTPUT',\n {\n query: item.id,\n item: item,\n success: function success(file) {\n dispatch('DID_PREPARE_OUTPUT', { id: item.id, file: file });\n _success({\n file: item,\n output: file,\n });\n },\n failure: failure,\n },\n\n true\n );\n }),\n\n REQUEST_ITEM_PROCESSING: getItemByQueryFromState(state, function(\n item,\n success,\n failure\n ) {\n // cannot be queued (or is already queued)\n var itemCanBeQueuedForProcessing =\n // waiting for something\n item.status === ItemStatus.IDLE ||\n // processing went wrong earlier\n item.status === ItemStatus.PROCESSING_ERROR;\n\n // not ready to be processed\n if (!itemCanBeQueuedForProcessing) {\n var processNow = function processNow() {\n return dispatch('REQUEST_ITEM_PROCESSING', {\n query: item,\n success: success,\n failure: failure,\n });\n };\n\n var process = function process() {\n return document.hidden ? processNow() : setTimeout(processNow, 32);\n };\n\n // if already done processing or tried to revert but didn't work, try again\n if (\n item.status === ItemStatus.PROCESSING_COMPLETE ||\n item.status === ItemStatus.PROCESSING_REVERT_ERROR\n ) {\n item.revert(\n createRevertFunction(\n state.options.server.url,\n state.options.server.revert\n ),\n query('GET_FORCE_REVERT')\n )\n .then(process)\n .catch(function() {}); // don't continue with processing if something went wrong\n } else if (item.status === ItemStatus.PROCESSING) {\n item.abortProcessing().then(process);\n }\n\n return;\n }\n\n // already queued for processing\n if (item.status === ItemStatus.PROCESSING_QUEUED) return;\n\n item.requestProcessing();\n\n dispatch('DID_REQUEST_ITEM_PROCESSING', { id: item.id });\n\n dispatch('PROCESS_ITEM', { query: item, success: success, failure: failure }, true);\n }),\n\n PROCESS_ITEM: getItemByQueryFromState(state, function(item, success, failure) {\n var maxParallelUploads = query('GET_MAX_PARALLEL_UPLOADS');\n var totalCurrentUploads = query('GET_ITEMS_BY_STATUS', ItemStatus.PROCESSING)\n .length;\n\n // queue and wait till queue is freed up\n if (totalCurrentUploads === maxParallelUploads) {\n // queue for later processing\n state.processingQueue.push({\n id: item.id,\n success: success,\n failure: failure,\n });\n\n // stop it!\n return;\n }\n\n // if was not queued or is already processing exit here\n if (item.status === ItemStatus.PROCESSING) return;\n\n var processNext = function processNext() {\n // process queueud items\n var queueEntry = state.processingQueue.shift();\n\n // no items left\n if (!queueEntry) return;\n\n // get item reference\n var id = queueEntry.id,\n success = queueEntry.success,\n failure = queueEntry.failure;\n var itemReference = getItemByQuery(state.items, id);\n\n // if item was archived while in queue, jump to next\n if (!itemReference || itemReference.archived) {\n processNext();\n return;\n }\n\n // process queued item\n dispatch(\n 'PROCESS_ITEM',\n { query: id, success: success, failure: failure },\n true\n );\n };\n\n // we done function\n item.onOnce('process-complete', function() {\n success(createItemAPI(item));\n processNext();\n\n // if origin is local, and we're instant uploading, trigger remove of original\n // as revert will remove file from list\n var server = state.options.server;\n var instantUpload = state.options.instantUpload;\n if (\n instantUpload &&\n item.origin === FileOrigin.LOCAL &&\n isFunction(server.remove)\n ) {\n var noop = function noop() {};\n item.origin = FileOrigin.LIMBO;\n state.options.server.remove(item.source, noop, noop);\n }\n\n // All items processed? No errors?\n var allItemsProcessed =\n query('GET_ITEMS_BY_STATUS', ItemStatus.PROCESSING_COMPLETE).length ===\n state.items.length;\n if (allItemsProcessed) {\n dispatch('DID_COMPLETE_ITEM_PROCESSING_ALL');\n }\n });\n\n // we error function\n item.onOnce('process-error', function(error) {\n failure({ error: error, file: createItemAPI(item) });\n processNext();\n });\n\n // start file processing\n var options = state.options;\n item.process(\n createFileProcessor(\n createProcessorFunction(\n options.server.url,\n options.server.process,\n options.name,\n {\n chunkTransferId: item.transferId,\n chunkServer: options.server.patch,\n chunkUploads: options.chunkUploads,\n chunkForce: options.chunkForce,\n chunkSize: options.chunkSize,\n chunkRetryDelays: options.chunkRetryDelays,\n }\n ),\n\n {\n allowMinimumUploadDuration: query('GET_ALLOW_MINIMUM_UPLOAD_DURATION'),\n }\n ),\n\n // called when the file is about to be processed so it can be piped through the transform filters\n function(file, success, error) {\n // allow plugins to alter the file data\n applyFilterChain('PREPARE_OUTPUT', file, { query: query, item: item })\n .then(function(file) {\n dispatch('DID_PREPARE_OUTPUT', { id: item.id, file: file });\n\n success(file);\n })\n .catch(error);\n }\n );\n }),\n\n RETRY_ITEM_PROCESSING: getItemByQueryFromState(state, function(item) {\n dispatch('REQUEST_ITEM_PROCESSING', { query: item });\n }),\n\n REQUEST_REMOVE_ITEM: getItemByQueryFromState(state, function(item) {\n optionalPromise(query('GET_BEFORE_REMOVE_FILE'), createItemAPI(item)).then(function(\n shouldRemove\n ) {\n if (!shouldRemove) {\n return;\n }\n dispatch('REMOVE_ITEM', { query: item });\n });\n }),\n\n RELEASE_ITEM: getItemByQueryFromState(state, function(item) {\n item.release();\n }),\n\n REMOVE_ITEM: getItemByQueryFromState(state, function(item, success, failure, options) {\n var removeFromView = function removeFromView() {\n // get id reference\n var id = item.id;\n\n // archive the item, this does not remove it from the list\n getItemById(state.items, id).archive();\n\n // tell the view the item has been removed\n dispatch('DID_REMOVE_ITEM', { error: null, id: id, item: item });\n\n // now the list has been modified\n listUpdated(dispatch, state);\n\n // correctly removed\n success(createItemAPI(item));\n };\n\n // if this is a local file and the `server.remove` function has been configured,\n // send source there so dev can remove file from server\n var server = state.options.server;\n if (\n item.origin === FileOrigin.LOCAL &&\n server &&\n isFunction(server.remove) &&\n options.remove !== false\n ) {\n dispatch('DID_START_ITEM_REMOVE', { id: item.id });\n\n server.remove(\n item.source,\n function() {\n return removeFromView();\n },\n function(status) {\n dispatch('DID_THROW_ITEM_REMOVE_ERROR', {\n id: item.id,\n error: createResponse('error', 0, status, null),\n status: {\n main: dynamicLabel(state.options.labelFileRemoveError)(status),\n sub: state.options.labelTapToRetry,\n },\n });\n }\n );\n } else {\n // if is requesting revert and can revert need to call revert handler (not calling request_ because that would also trigger beforeRemoveHook)\n if (\n (options.revert &&\n item.origin !== FileOrigin.LOCAL &&\n item.serverId !== null) ||\n // if chunked uploads are enabled and we're uploading in chunks for this specific file\n // or if the file isn't big enough for chunked uploads but chunkForce is set then call\n // revert before removing from the view...\n (state.options.chunkUploads && item.file.size > state.options.chunkSize) ||\n (state.options.chunkUploads && state.options.chunkForce)\n ) {\n item.revert(\n createRevertFunction(\n state.options.server.url,\n state.options.server.revert\n ),\n query('GET_FORCE_REVERT')\n );\n }\n\n // can now safely remove from view\n removeFromView();\n }\n }),\n\n ABORT_ITEM_LOAD: getItemByQueryFromState(state, function(item) {\n item.abortLoad();\n }),\n\n ABORT_ITEM_PROCESSING: getItemByQueryFromState(state, function(item) {\n // test if is already processed\n if (item.serverId) {\n dispatch('REVERT_ITEM_PROCESSING', { id: item.id });\n return;\n }\n\n // abort\n item.abortProcessing().then(function() {\n var shouldRemove = state.options.instantUpload;\n if (shouldRemove) {\n dispatch('REMOVE_ITEM', { query: item.id });\n }\n });\n }),\n\n REQUEST_REVERT_ITEM_PROCESSING: getItemByQueryFromState(state, function(item) {\n // not instant uploading, revert immediately\n if (!state.options.instantUpload) {\n dispatch('REVERT_ITEM_PROCESSING', { query: item });\n return;\n }\n\n // if we're instant uploading the file will also be removed if we revert,\n // so if a before remove file hook is defined we need to run it now\n var handleRevert = function handleRevert(shouldRevert) {\n if (!shouldRevert) return;\n dispatch('REVERT_ITEM_PROCESSING', { query: item });\n };\n\n var fn = query('GET_BEFORE_REMOVE_FILE');\n if (!fn) {\n return handleRevert(true);\n }\n\n var requestRemoveResult = fn(createItemAPI(item));\n if (requestRemoveResult == null) {\n // undefined or null\n return handleRevert(true);\n }\n\n if (typeof requestRemoveResult === 'boolean') {\n return handleRevert(requestRemoveResult);\n }\n\n if (typeof requestRemoveResult.then === 'function') {\n requestRemoveResult.then(handleRevert);\n }\n }),\n\n REVERT_ITEM_PROCESSING: getItemByQueryFromState(state, function(item) {\n item.revert(\n createRevertFunction(state.options.server.url, state.options.server.revert),\n query('GET_FORCE_REVERT')\n )\n .then(function() {\n var shouldRemove = state.options.instantUpload || isMockItem(item);\n if (shouldRemove) {\n dispatch('REMOVE_ITEM', { query: item.id });\n }\n })\n .catch(function() {});\n }),\n\n SET_OPTIONS: function SET_OPTIONS(_ref11) {\n var options = _ref11.options;\n // get all keys passed\n var optionKeys = Object.keys(options);\n\n // get prioritized keyed to include (remove once not in options object)\n var prioritizedOptionKeys = PrioritizedOptions.filter(function(key) {\n return optionKeys.includes(key);\n });\n\n // order the keys, prioritized first, then rest\n var orderedOptionKeys = [].concat(\n _toConsumableArray(prioritizedOptionKeys),\n _toConsumableArray(\n Object.keys(options).filter(function(key) {\n return !prioritizedOptionKeys.includes(key);\n })\n )\n );\n\n // dispatch set event for each option\n orderedOptionKeys.forEach(function(key) {\n dispatch('SET_' + fromCamels(key, '_').toUpperCase(), {\n value: options[key],\n });\n });\n },\n };\n };\n\n var PrioritizedOptions = ['server'];\n\n var formatFilename = function formatFilename(name) {\n return name;\n };\n\n var createElement$1 = function createElement(tagName) {\n return document.createElement(tagName);\n };\n\n var text = function text(node, value) {\n var textNode = node.childNodes[0];\n if (!textNode) {\n textNode = document.createTextNode(value);\n node.appendChild(textNode);\n } else if (value !== textNode.nodeValue) {\n textNode.nodeValue = value;\n }\n };\n\n var polarToCartesian = function polarToCartesian(centerX, centerY, radius, angleInDegrees) {\n var angleInRadians = (((angleInDegrees % 360) - 90) * Math.PI) / 180.0;\n return {\n x: centerX + radius * Math.cos(angleInRadians),\n y: centerY + radius * Math.sin(angleInRadians),\n };\n };\n\n var describeArc = function describeArc(x, y, radius, startAngle, endAngle, arcSweep) {\n var start = polarToCartesian(x, y, radius, endAngle);\n var end = polarToCartesian(x, y, radius, startAngle);\n return ['M', start.x, start.y, 'A', radius, radius, 0, arcSweep, 0, end.x, end.y].join(' ');\n };\n\n var percentageArc = function percentageArc(x, y, radius, from, to) {\n var arcSweep = 1;\n if (to > from && to - from <= 0.5) {\n arcSweep = 0;\n }\n if (from > to && from - to >= 0.5) {\n arcSweep = 0;\n }\n return describeArc(\n x,\n y,\n radius,\n Math.min(0.9999, from) * 360,\n Math.min(0.9999, to) * 360,\n arcSweep\n );\n };\n\n var create = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n // start at 0\n props.spin = false;\n props.progress = 0;\n props.opacity = 0;\n\n // svg\n var svg = createElement('svg');\n root.ref.path = createElement('path', {\n 'stroke-width': 2,\n 'stroke-linecap': 'round',\n });\n\n svg.appendChild(root.ref.path);\n\n root.ref.svg = svg;\n\n root.appendChild(svg);\n };\n\n var write = function write(_ref2) {\n var root = _ref2.root,\n props = _ref2.props;\n if (props.opacity === 0) {\n return;\n }\n\n if (props.align) {\n root.element.dataset.align = props.align;\n }\n\n // get width of stroke\n var ringStrokeWidth = parseInt(attr(root.ref.path, 'stroke-width'), 10);\n\n // calculate size of ring\n var size = root.rect.element.width * 0.5;\n\n // ring state\n var ringFrom = 0;\n var ringTo = 0;\n\n // now in busy mode\n if (props.spin) {\n ringFrom = 0;\n ringTo = 0.5;\n } else {\n ringFrom = 0;\n ringTo = props.progress;\n }\n\n // get arc path\n var coordinates = percentageArc(size, size, size - ringStrokeWidth, ringFrom, ringTo);\n\n // update progress bar\n attr(root.ref.path, 'd', coordinates);\n\n // hide while contains 0 value\n attr(root.ref.path, 'stroke-opacity', props.spin || props.progress > 0 ? 1 : 0);\n };\n\n var progressIndicator = createView({\n tag: 'div',\n name: 'progress-indicator',\n ignoreRectUpdate: true,\n ignoreRect: true,\n create: create,\n write: write,\n mixins: {\n apis: ['progress', 'spin', 'align'],\n styles: ['opacity'],\n animations: {\n opacity: { type: 'tween', duration: 500 },\n progress: {\n type: 'spring',\n stiffness: 0.95,\n damping: 0.65,\n mass: 10,\n },\n },\n },\n });\n\n var create$1 = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n root.element.innerHTML = (props.icon || '') + ('' + props.label + ' ');\n\n props.isDisabled = false;\n };\n\n var write$1 = function write(_ref2) {\n var root = _ref2.root,\n props = _ref2.props;\n var isDisabled = props.isDisabled;\n var shouldDisable = root.query('GET_DISABLED') || props.opacity === 0;\n\n if (shouldDisable && !isDisabled) {\n props.isDisabled = true;\n attr(root.element, 'disabled', 'disabled');\n } else if (!shouldDisable && isDisabled) {\n props.isDisabled = false;\n root.element.removeAttribute('disabled');\n }\n };\n\n var fileActionButton = createView({\n tag: 'button',\n attributes: {\n type: 'button',\n },\n\n ignoreRect: true,\n ignoreRectUpdate: true,\n name: 'file-action-button',\n mixins: {\n apis: ['label'],\n styles: ['translateX', 'translateY', 'scaleX', 'scaleY', 'opacity'],\n animations: {\n scaleX: 'spring',\n scaleY: 'spring',\n translateX: 'spring',\n translateY: 'spring',\n opacity: { type: 'tween', duration: 250 },\n },\n\n listeners: true,\n },\n\n create: create$1,\n write: write$1,\n });\n\n var toNaturalFileSize = function toNaturalFileSize(bytes) {\n var decimalSeparator =\n arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';\n var base = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var _options$labelBytes = options.labelBytes,\n labelBytes = _options$labelBytes === void 0 ? 'bytes' : _options$labelBytes,\n _options$labelKilobyt = options.labelKilobytes,\n labelKilobytes = _options$labelKilobyt === void 0 ? 'KB' : _options$labelKilobyt,\n _options$labelMegabyt = options.labelMegabytes,\n labelMegabytes = _options$labelMegabyt === void 0 ? 'MB' : _options$labelMegabyt,\n _options$labelGigabyt = options.labelGigabytes,\n labelGigabytes = _options$labelGigabyt === void 0 ? 'GB' : _options$labelGigabyt;\n\n // no negative byte sizes\n bytes = Math.round(Math.abs(bytes));\n\n var KB = base;\n var MB = base * base;\n var GB = base * base * base;\n\n // just bytes\n if (bytes < KB) {\n return bytes + ' ' + labelBytes;\n }\n\n // kilobytes\n if (bytes < MB) {\n return Math.floor(bytes / KB) + ' ' + labelKilobytes;\n }\n\n // megabytes\n if (bytes < GB) {\n return removeDecimalsWhenZero(bytes / MB, 1, decimalSeparator) + ' ' + labelMegabytes;\n }\n\n // gigabytes\n return removeDecimalsWhenZero(bytes / GB, 2, decimalSeparator) + ' ' + labelGigabytes;\n };\n\n var removeDecimalsWhenZero = function removeDecimalsWhenZero(value, decimalCount, separator) {\n return value\n .toFixed(decimalCount)\n .split('.')\n .filter(function(part) {\n return part !== '0';\n })\n .join(separator);\n };\n\n var create$2 = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n // filename\n var fileName = createElement$1('span');\n fileName.className = 'filepond--file-info-main';\n // hide for screenreaders\n // the file is contained in a fieldset with legend that contains the filename\n // no need to read it twice\n attr(fileName, 'aria-hidden', 'true');\n root.appendChild(fileName);\n root.ref.fileName = fileName;\n\n // filesize\n var fileSize = createElement$1('span');\n fileSize.className = 'filepond--file-info-sub';\n root.appendChild(fileSize);\n root.ref.fileSize = fileSize;\n\n // set initial values\n text(fileSize, root.query('GET_LABEL_FILE_WAITING_FOR_SIZE'));\n text(fileName, formatFilename(root.query('GET_ITEM_NAME', props.id)));\n };\n\n var updateFile = function updateFile(_ref2) {\n var root = _ref2.root,\n props = _ref2.props;\n text(\n root.ref.fileSize,\n toNaturalFileSize(\n root.query('GET_ITEM_SIZE', props.id),\n '.',\n root.query('GET_FILE_SIZE_BASE'),\n root.query('GET_FILE_SIZE_LABELS', root.query)\n )\n );\n\n text(root.ref.fileName, formatFilename(root.query('GET_ITEM_NAME', props.id)));\n };\n\n var updateFileSizeOnError = function updateFileSizeOnError(_ref3) {\n var root = _ref3.root,\n props = _ref3.props;\n // if size is available don't fallback to unknown size message\n if (isInt(root.query('GET_ITEM_SIZE', props.id))) {\n updateFile({ root: root, props: props });\n return;\n }\n\n text(root.ref.fileSize, root.query('GET_LABEL_FILE_SIZE_NOT_AVAILABLE'));\n };\n\n var fileInfo = createView({\n name: 'file-info',\n ignoreRect: true,\n ignoreRectUpdate: true,\n write: createRoute({\n DID_LOAD_ITEM: updateFile,\n DID_UPDATE_ITEM_META: updateFile,\n DID_THROW_ITEM_LOAD_ERROR: updateFileSizeOnError,\n DID_THROW_ITEM_INVALID: updateFileSizeOnError,\n }),\n\n didCreateView: function didCreateView(root) {\n applyFilters('CREATE_VIEW', Object.assign({}, root, { view: root }));\n },\n create: create$2,\n mixins: {\n styles: ['translateX', 'translateY'],\n animations: {\n translateX: 'spring',\n translateY: 'spring',\n },\n },\n });\n\n var toPercentage = function toPercentage(value) {\n return Math.round(value * 100);\n };\n\n var create$3 = function create(_ref) {\n var root = _ref.root;\n\n // main status\n var main = createElement$1('span');\n main.className = 'filepond--file-status-main';\n root.appendChild(main);\n root.ref.main = main;\n\n // sub status\n var sub = createElement$1('span');\n sub.className = 'filepond--file-status-sub';\n root.appendChild(sub);\n root.ref.sub = sub;\n\n didSetItemLoadProgress({ root: root, action: { progress: null } });\n };\n\n var didSetItemLoadProgress = function didSetItemLoadProgress(_ref2) {\n var root = _ref2.root,\n action = _ref2.action;\n var title =\n action.progress === null\n ? root.query('GET_LABEL_FILE_LOADING')\n : root.query('GET_LABEL_FILE_LOADING') + ' ' + toPercentage(action.progress) + '%';\n\n text(root.ref.main, title);\n text(root.ref.sub, root.query('GET_LABEL_TAP_TO_CANCEL'));\n };\n\n var didSetItemProcessProgress = function didSetItemProcessProgress(_ref3) {\n var root = _ref3.root,\n action = _ref3.action;\n var title =\n action.progress === null\n ? root.query('GET_LABEL_FILE_PROCESSING')\n : root.query('GET_LABEL_FILE_PROCESSING') +\n ' ' +\n toPercentage(action.progress) +\n '%';\n\n text(root.ref.main, title);\n text(root.ref.sub, root.query('GET_LABEL_TAP_TO_CANCEL'));\n };\n\n var didRequestItemProcessing = function didRequestItemProcessing(_ref4) {\n var root = _ref4.root;\n text(root.ref.main, root.query('GET_LABEL_FILE_PROCESSING'));\n text(root.ref.sub, root.query('GET_LABEL_TAP_TO_CANCEL'));\n };\n\n var didAbortItemProcessing = function didAbortItemProcessing(_ref5) {\n var root = _ref5.root;\n text(root.ref.main, root.query('GET_LABEL_FILE_PROCESSING_ABORTED'));\n text(root.ref.sub, root.query('GET_LABEL_TAP_TO_RETRY'));\n };\n\n var didCompleteItemProcessing = function didCompleteItemProcessing(_ref6) {\n var root = _ref6.root;\n text(root.ref.main, root.query('GET_LABEL_FILE_PROCESSING_COMPLETE'));\n text(root.ref.sub, root.query('GET_LABEL_TAP_TO_UNDO'));\n };\n\n var clear = function clear(_ref7) {\n var root = _ref7.root;\n text(root.ref.main, '');\n text(root.ref.sub, '');\n };\n\n var error = function error(_ref8) {\n var root = _ref8.root,\n action = _ref8.action;\n text(root.ref.main, action.status.main);\n text(root.ref.sub, action.status.sub);\n };\n\n var fileStatus = createView({\n name: 'file-status',\n ignoreRect: true,\n ignoreRectUpdate: true,\n write: createRoute({\n DID_LOAD_ITEM: clear,\n DID_REVERT_ITEM_PROCESSING: clear,\n DID_REQUEST_ITEM_PROCESSING: didRequestItemProcessing,\n DID_ABORT_ITEM_PROCESSING: didAbortItemProcessing,\n DID_COMPLETE_ITEM_PROCESSING: didCompleteItemProcessing,\n DID_UPDATE_ITEM_PROCESS_PROGRESS: didSetItemProcessProgress,\n DID_UPDATE_ITEM_LOAD_PROGRESS: didSetItemLoadProgress,\n DID_THROW_ITEM_LOAD_ERROR: error,\n DID_THROW_ITEM_INVALID: error,\n DID_THROW_ITEM_PROCESSING_ERROR: error,\n DID_THROW_ITEM_PROCESSING_REVERT_ERROR: error,\n DID_THROW_ITEM_REMOVE_ERROR: error,\n }),\n\n didCreateView: function didCreateView(root) {\n applyFilters('CREATE_VIEW', Object.assign({}, root, { view: root }));\n },\n create: create$3,\n mixins: {\n styles: ['translateX', 'translateY', 'opacity'],\n animations: {\n opacity: { type: 'tween', duration: 250 },\n translateX: 'spring',\n translateY: 'spring',\n },\n },\n });\n\n /**\n * Button definitions for the file view\n */\n\n var Buttons = {\n AbortItemLoad: {\n label: 'GET_LABEL_BUTTON_ABORT_ITEM_LOAD',\n action: 'ABORT_ITEM_LOAD',\n className: 'filepond--action-abort-item-load',\n align: 'LOAD_INDICATOR_POSITION', // right\n },\n RetryItemLoad: {\n label: 'GET_LABEL_BUTTON_RETRY_ITEM_LOAD',\n action: 'RETRY_ITEM_LOAD',\n icon: 'GET_ICON_RETRY',\n className: 'filepond--action-retry-item-load',\n align: 'BUTTON_PROCESS_ITEM_POSITION', // right\n },\n RemoveItem: {\n label: 'GET_LABEL_BUTTON_REMOVE_ITEM',\n action: 'REQUEST_REMOVE_ITEM',\n icon: 'GET_ICON_REMOVE',\n className: 'filepond--action-remove-item',\n align: 'BUTTON_REMOVE_ITEM_POSITION', // left\n },\n ProcessItem: {\n label: 'GET_LABEL_BUTTON_PROCESS_ITEM',\n action: 'REQUEST_ITEM_PROCESSING',\n icon: 'GET_ICON_PROCESS',\n className: 'filepond--action-process-item',\n align: 'BUTTON_PROCESS_ITEM_POSITION', // right\n },\n AbortItemProcessing: {\n label: 'GET_LABEL_BUTTON_ABORT_ITEM_PROCESSING',\n action: 'ABORT_ITEM_PROCESSING',\n className: 'filepond--action-abort-item-processing',\n align: 'BUTTON_PROCESS_ITEM_POSITION', // right\n },\n RetryItemProcessing: {\n label: 'GET_LABEL_BUTTON_RETRY_ITEM_PROCESSING',\n action: 'RETRY_ITEM_PROCESSING',\n icon: 'GET_ICON_RETRY',\n className: 'filepond--action-retry-item-processing',\n align: 'BUTTON_PROCESS_ITEM_POSITION', // right\n },\n RevertItemProcessing: {\n label: 'GET_LABEL_BUTTON_UNDO_ITEM_PROCESSING',\n action: 'REQUEST_REVERT_ITEM_PROCESSING',\n icon: 'GET_ICON_UNDO',\n className: 'filepond--action-revert-item-processing',\n align: 'BUTTON_PROCESS_ITEM_POSITION', // right\n },\n };\n\n // make a list of buttons, we can then remove buttons from this list if they're disabled\n var ButtonKeys = [];\n forin(Buttons, function(key) {\n ButtonKeys.push(key);\n });\n\n var calculateFileInfoOffset = function calculateFileInfoOffset(root) {\n if (getRemoveIndicatorAligment(root) === 'right') return 0;\n var buttonRect = root.ref.buttonRemoveItem.rect.element;\n return buttonRect.hidden ? null : buttonRect.width + buttonRect.left;\n };\n\n var calculateButtonWidth = function calculateButtonWidth(root) {\n var buttonRect = root.ref.buttonAbortItemLoad.rect.element;\n return buttonRect.width;\n };\n\n // Force on full pixels so text stays crips\n var calculateFileVerticalCenterOffset = function calculateFileVerticalCenterOffset(root) {\n return Math.floor(root.ref.buttonRemoveItem.rect.element.height / 4);\n };\n var calculateFileHorizontalCenterOffset = function calculateFileHorizontalCenterOffset(root) {\n return Math.floor(root.ref.buttonRemoveItem.rect.element.left / 2);\n };\n\n var getLoadIndicatorAlignment = function getLoadIndicatorAlignment(root) {\n return root.query('GET_STYLE_LOAD_INDICATOR_POSITION');\n };\n var getProcessIndicatorAlignment = function getProcessIndicatorAlignment(root) {\n return root.query('GET_STYLE_PROGRESS_INDICATOR_POSITION');\n };\n var getRemoveIndicatorAligment = function getRemoveIndicatorAligment(root) {\n return root.query('GET_STYLE_BUTTON_REMOVE_ITEM_POSITION');\n };\n\n var DefaultStyle = {\n buttonAbortItemLoad: { opacity: 0 },\n buttonRetryItemLoad: { opacity: 0 },\n buttonRemoveItem: { opacity: 0 },\n buttonProcessItem: { opacity: 0 },\n buttonAbortItemProcessing: { opacity: 0 },\n buttonRetryItemProcessing: { opacity: 0 },\n buttonRevertItemProcessing: { opacity: 0 },\n loadProgressIndicator: { opacity: 0, align: getLoadIndicatorAlignment },\n processProgressIndicator: { opacity: 0, align: getProcessIndicatorAlignment },\n processingCompleteIndicator: { opacity: 0, scaleX: 0.75, scaleY: 0.75 },\n info: { translateX: 0, translateY: 0, opacity: 0 },\n status: { translateX: 0, translateY: 0, opacity: 0 },\n };\n\n var IdleStyle = {\n buttonRemoveItem: { opacity: 1 },\n buttonProcessItem: { opacity: 1 },\n info: { translateX: calculateFileInfoOffset },\n status: { translateX: calculateFileInfoOffset },\n };\n\n var ProcessingStyle = {\n buttonAbortItemProcessing: { opacity: 1 },\n processProgressIndicator: { opacity: 1 },\n status: { opacity: 1 },\n };\n\n var StyleMap = {\n DID_THROW_ITEM_INVALID: {\n buttonRemoveItem: { opacity: 1 },\n info: { translateX: calculateFileInfoOffset },\n status: { translateX: calculateFileInfoOffset, opacity: 1 },\n },\n\n DID_START_ITEM_LOAD: {\n buttonAbortItemLoad: { opacity: 1 },\n loadProgressIndicator: { opacity: 1 },\n status: { opacity: 1 },\n },\n\n DID_THROW_ITEM_LOAD_ERROR: {\n buttonRetryItemLoad: { opacity: 1 },\n buttonRemoveItem: { opacity: 1 },\n info: { translateX: calculateFileInfoOffset },\n status: { opacity: 1 },\n },\n\n DID_START_ITEM_REMOVE: {\n processProgressIndicator: { opacity: 1, align: getRemoveIndicatorAligment },\n info: { translateX: calculateFileInfoOffset },\n status: { opacity: 0 },\n },\n\n DID_THROW_ITEM_REMOVE_ERROR: {\n processProgressIndicator: { opacity: 0, align: getRemoveIndicatorAligment },\n buttonRemoveItem: { opacity: 1 },\n info: { translateX: calculateFileInfoOffset },\n status: { opacity: 1, translateX: calculateFileInfoOffset },\n },\n\n DID_LOAD_ITEM: IdleStyle,\n DID_LOAD_LOCAL_ITEM: {\n buttonRemoveItem: { opacity: 1 },\n info: { translateX: calculateFileInfoOffset },\n status: { translateX: calculateFileInfoOffset },\n },\n\n DID_START_ITEM_PROCESSING: ProcessingStyle,\n DID_REQUEST_ITEM_PROCESSING: ProcessingStyle,\n DID_UPDATE_ITEM_PROCESS_PROGRESS: ProcessingStyle,\n DID_COMPLETE_ITEM_PROCESSING: {\n buttonRevertItemProcessing: { opacity: 1 },\n info: { opacity: 1 },\n status: { opacity: 1 },\n },\n\n DID_THROW_ITEM_PROCESSING_ERROR: {\n buttonRemoveItem: { opacity: 1 },\n buttonRetryItemProcessing: { opacity: 1 },\n status: { opacity: 1 },\n info: { translateX: calculateFileInfoOffset },\n },\n\n DID_THROW_ITEM_PROCESSING_REVERT_ERROR: {\n buttonRevertItemProcessing: { opacity: 1 },\n status: { opacity: 1 },\n info: { opacity: 1 },\n },\n\n DID_ABORT_ITEM_PROCESSING: {\n buttonRemoveItem: { opacity: 1 },\n buttonProcessItem: { opacity: 1 },\n info: { translateX: calculateFileInfoOffset },\n status: { opacity: 1 },\n },\n\n DID_REVERT_ITEM_PROCESSING: IdleStyle,\n };\n\n // complete indicator view\n var processingCompleteIndicatorView = createView({\n create: function create(_ref) {\n var root = _ref.root;\n root.element.innerHTML = root.query('GET_ICON_DONE');\n },\n name: 'processing-complete-indicator',\n ignoreRect: true,\n mixins: {\n styles: ['scaleX', 'scaleY', 'opacity'],\n animations: {\n scaleX: 'spring',\n scaleY: 'spring',\n opacity: { type: 'tween', duration: 250 },\n },\n },\n });\n\n /**\n * Creates the file view\n */\n var create$4 = function create(_ref2) {\n var root = _ref2.root,\n props = _ref2.props;\n // copy Buttons object\n var LocalButtons = Object.keys(Buttons).reduce(function(prev, curr) {\n prev[curr] = Object.assign({}, Buttons[curr]);\n return prev;\n }, {});\n var id = props.id;\n\n // allow reverting upload\n var allowRevert = root.query('GET_ALLOW_REVERT');\n\n // allow remove file\n var allowRemove = root.query('GET_ALLOW_REMOVE');\n\n // allow processing upload\n var allowProcess = root.query('GET_ALLOW_PROCESS');\n\n // is instant uploading, need this to determine the icon of the undo button\n var instantUpload = root.query('GET_INSTANT_UPLOAD');\n\n // is async set up\n var isAsync = root.query('IS_ASYNC');\n\n // should align remove item buttons\n var alignRemoveItemButton = root.query('GET_STYLE_BUTTON_REMOVE_ITEM_ALIGN');\n\n // enabled buttons array\n var buttonFilter;\n if (isAsync) {\n if (allowProcess && !allowRevert) {\n // only remove revert button\n buttonFilter = function buttonFilter(key) {\n return !/RevertItemProcessing/.test(key);\n };\n } else if (!allowProcess && allowRevert) {\n // only remove process button\n buttonFilter = function buttonFilter(key) {\n return !/ProcessItem|RetryItemProcessing|AbortItemProcessing/.test(key);\n };\n } else if (!allowProcess && !allowRevert) {\n // remove all process buttons\n buttonFilter = function buttonFilter(key) {\n return !/Process/.test(key);\n };\n }\n } else {\n // no process controls available\n buttonFilter = function buttonFilter(key) {\n return !/Process/.test(key);\n };\n }\n\n var enabledButtons = buttonFilter ? ButtonKeys.filter(buttonFilter) : ButtonKeys.concat();\n\n // update icon and label for revert button when instant uploading\n if (instantUpload && allowRevert) {\n LocalButtons['RevertItemProcessing'].label = 'GET_LABEL_BUTTON_REMOVE_ITEM';\n LocalButtons['RevertItemProcessing'].icon = 'GET_ICON_REMOVE';\n }\n\n // remove last button (revert) if not allowed\n if (isAsync && !allowRevert) {\n var map = StyleMap['DID_COMPLETE_ITEM_PROCESSING'];\n map.info.translateX = calculateFileHorizontalCenterOffset;\n map.info.translateY = calculateFileVerticalCenterOffset;\n map.status.translateY = calculateFileVerticalCenterOffset;\n map.processingCompleteIndicator = { opacity: 1, scaleX: 1, scaleY: 1 };\n }\n\n // should align center\n if (isAsync && !allowProcess) {\n [\n 'DID_START_ITEM_PROCESSING',\n 'DID_REQUEST_ITEM_PROCESSING',\n 'DID_UPDATE_ITEM_PROCESS_PROGRESS',\n 'DID_THROW_ITEM_PROCESSING_ERROR',\n ].forEach(function(key) {\n StyleMap[key].status.translateY = calculateFileVerticalCenterOffset;\n });\n StyleMap['DID_THROW_ITEM_PROCESSING_ERROR'].status.translateX = calculateButtonWidth;\n }\n\n // move remove button to right\n if (alignRemoveItemButton && allowRevert) {\n LocalButtons['RevertItemProcessing'].align = 'BUTTON_REMOVE_ITEM_POSITION';\n var _map = StyleMap['DID_COMPLETE_ITEM_PROCESSING'];\n _map.info.translateX = calculateFileInfoOffset;\n _map.status.translateY = calculateFileVerticalCenterOffset;\n _map.processingCompleteIndicator = { opacity: 1, scaleX: 1, scaleY: 1 };\n }\n\n // show/hide RemoveItem button\n if (!allowRemove) {\n LocalButtons['RemoveItem'].disabled = true;\n }\n\n // create the button views\n forin(LocalButtons, function(key, definition) {\n // create button\n var buttonView = root.createChildView(fileActionButton, {\n label: root.query(definition.label),\n icon: root.query(definition.icon),\n opacity: 0,\n });\n\n // should be appended?\n if (enabledButtons.includes(key)) {\n root.appendChildView(buttonView);\n }\n\n // toggle\n if (definition.disabled) {\n buttonView.element.setAttribute('disabled', 'disabled');\n buttonView.element.setAttribute('hidden', 'hidden');\n }\n\n // add position attribute\n buttonView.element.dataset.align = root.query('GET_STYLE_' + definition.align);\n\n // add class\n buttonView.element.classList.add(definition.className);\n\n // handle interactions\n buttonView.on('click', function(e) {\n e.stopPropagation();\n if (definition.disabled) return;\n root.dispatch(definition.action, { query: id });\n });\n\n // set reference\n root.ref['button' + key] = buttonView;\n });\n\n // checkmark\n root.ref.processingCompleteIndicator = root.appendChildView(\n root.createChildView(processingCompleteIndicatorView)\n );\n\n root.ref.processingCompleteIndicator.element.dataset.align = root.query(\n 'GET_STYLE_BUTTON_PROCESS_ITEM_POSITION'\n );\n\n // create file info view\n root.ref.info = root.appendChildView(root.createChildView(fileInfo, { id: id }));\n\n // create file status view\n root.ref.status = root.appendChildView(root.createChildView(fileStatus, { id: id }));\n\n // add progress indicators\n var loadIndicatorView = root.appendChildView(\n root.createChildView(progressIndicator, {\n opacity: 0,\n align: root.query('GET_STYLE_LOAD_INDICATOR_POSITION'),\n })\n );\n\n loadIndicatorView.element.classList.add('filepond--load-indicator');\n root.ref.loadProgressIndicator = loadIndicatorView;\n\n var progressIndicatorView = root.appendChildView(\n root.createChildView(progressIndicator, {\n opacity: 0,\n align: root.query('GET_STYLE_PROGRESS_INDICATOR_POSITION'),\n })\n );\n\n progressIndicatorView.element.classList.add('filepond--process-indicator');\n root.ref.processProgressIndicator = progressIndicatorView;\n\n // current active styles\n root.ref.activeStyles = [];\n };\n\n var write$2 = function write(_ref3) {\n var root = _ref3.root,\n actions = _ref3.actions,\n props = _ref3.props;\n // route actions\n route({ root: root, actions: actions, props: props });\n\n // select last state change action\n var action = actions\n .concat()\n .filter(function(action) {\n return /^DID_/.test(action.type);\n })\n .reverse()\n .find(function(action) {\n return StyleMap[action.type];\n });\n\n // a new action happened, let's get the matching styles\n if (action) {\n // define new active styles\n root.ref.activeStyles = [];\n\n var stylesToApply = StyleMap[action.type];\n forin(DefaultStyle, function(name, defaultStyles) {\n // get reference to control\n var control = root.ref[name];\n\n // loop over all styles for this control\n forin(defaultStyles, function(key, defaultValue) {\n var value =\n stylesToApply[name] && typeof stylesToApply[name][key] !== 'undefined'\n ? stylesToApply[name][key]\n : defaultValue;\n root.ref.activeStyles.push({ control: control, key: key, value: value });\n });\n });\n }\n\n // apply active styles to element\n root.ref.activeStyles.forEach(function(_ref4) {\n var control = _ref4.control,\n key = _ref4.key,\n value = _ref4.value;\n control[key] = typeof value === 'function' ? value(root) : value;\n });\n };\n\n var route = createRoute({\n DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING: function DID_SET_LABEL_BUTTON_ABORT_ITEM_PROCESSING(\n _ref5\n ) {\n var root = _ref5.root,\n action = _ref5.action;\n root.ref.buttonAbortItemProcessing.label = action.value;\n },\n DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD: function DID_SET_LABEL_BUTTON_ABORT_ITEM_LOAD(_ref6) {\n var root = _ref6.root,\n action = _ref6.action;\n root.ref.buttonAbortItemLoad.label = action.value;\n },\n DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL: function DID_SET_LABEL_BUTTON_ABORT_ITEM_REMOVAL(\n _ref7\n ) {\n var root = _ref7.root,\n action = _ref7.action;\n root.ref.buttonAbortItemRemoval.label = action.value;\n },\n DID_REQUEST_ITEM_PROCESSING: function DID_REQUEST_ITEM_PROCESSING(_ref8) {\n var root = _ref8.root;\n root.ref.processProgressIndicator.spin = true;\n root.ref.processProgressIndicator.progress = 0;\n },\n DID_START_ITEM_LOAD: function DID_START_ITEM_LOAD(_ref9) {\n var root = _ref9.root;\n root.ref.loadProgressIndicator.spin = true;\n root.ref.loadProgressIndicator.progress = 0;\n },\n DID_START_ITEM_REMOVE: function DID_START_ITEM_REMOVE(_ref10) {\n var root = _ref10.root;\n root.ref.processProgressIndicator.spin = true;\n root.ref.processProgressIndicator.progress = 0;\n },\n DID_UPDATE_ITEM_LOAD_PROGRESS: function DID_UPDATE_ITEM_LOAD_PROGRESS(_ref11) {\n var root = _ref11.root,\n action = _ref11.action;\n root.ref.loadProgressIndicator.spin = false;\n root.ref.loadProgressIndicator.progress = action.progress;\n },\n DID_UPDATE_ITEM_PROCESS_PROGRESS: function DID_UPDATE_ITEM_PROCESS_PROGRESS(_ref12) {\n var root = _ref12.root,\n action = _ref12.action;\n root.ref.processProgressIndicator.spin = false;\n root.ref.processProgressIndicator.progress = action.progress;\n },\n });\n\n var file = createView({\n create: create$4,\n write: write$2,\n didCreateView: function didCreateView(root) {\n applyFilters('CREATE_VIEW', Object.assign({}, root, { view: root }));\n },\n name: 'file',\n });\n\n /**\n * Creates the file view\n */\n var create$5 = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n\n // filename\n root.ref.fileName = createElement$1('legend');\n root.appendChild(root.ref.fileName);\n\n // file appended\n root.ref.file = root.appendChildView(root.createChildView(file, { id: props.id }));\n\n // data has moved to data.js\n root.ref.data = false;\n };\n\n /**\n * Data storage\n */\n var didLoadItem = function didLoadItem(_ref2) {\n var root = _ref2.root,\n props = _ref2.props;\n // updates the legend of the fieldset so screenreaders can better group buttons\n text(root.ref.fileName, formatFilename(root.query('GET_ITEM_NAME', props.id)));\n };\n\n var fileWrapper = createView({\n create: create$5,\n ignoreRect: true,\n write: createRoute({\n DID_LOAD_ITEM: didLoadItem,\n }),\n\n didCreateView: function didCreateView(root) {\n applyFilters('CREATE_VIEW', Object.assign({}, root, { view: root }));\n },\n tag: 'fieldset',\n name: 'file-wrapper',\n });\n\n var PANEL_SPRING_PROPS = { type: 'spring', damping: 0.6, mass: 7 };\n\n var create$6 = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n [\n {\n name: 'top',\n },\n\n {\n name: 'center',\n props: {\n translateY: null,\n scaleY: null,\n },\n\n mixins: {\n animations: {\n scaleY: PANEL_SPRING_PROPS,\n },\n\n styles: ['translateY', 'scaleY'],\n },\n },\n\n {\n name: 'bottom',\n props: {\n translateY: null,\n },\n\n mixins: {\n animations: {\n translateY: PANEL_SPRING_PROPS,\n },\n\n styles: ['translateY'],\n },\n },\n ].forEach(function(section) {\n createSection(root, section, props.name);\n });\n\n root.element.classList.add('filepond--' + props.name);\n\n root.ref.scalable = null;\n };\n\n var createSection = function createSection(root, section, className) {\n var viewConstructor = createView({\n name: 'panel-' + section.name + ' filepond--' + className,\n mixins: section.mixins,\n ignoreRectUpdate: true,\n });\n\n var view = root.createChildView(viewConstructor, section.props);\n\n root.ref[section.name] = root.appendChildView(view);\n };\n\n var write$3 = function write(_ref2) {\n var root = _ref2.root,\n props = _ref2.props;\n\n // update scalable state\n if (root.ref.scalable === null || props.scalable !== root.ref.scalable) {\n root.ref.scalable = isBoolean(props.scalable) ? props.scalable : true;\n root.element.dataset.scalable = root.ref.scalable;\n }\n\n // no height, can't set\n if (!props.height) return;\n\n // get child rects\n var topRect = root.ref.top.rect.element;\n var bottomRect = root.ref.bottom.rect.element;\n\n // make sure height never is smaller than bottom and top seciton heights combined (will probably never happen, but who knows)\n var height = Math.max(topRect.height + bottomRect.height, props.height);\n\n // offset center part\n root.ref.center.translateY = topRect.height;\n\n // scale center part\n // use math ceil to prevent transparent lines because of rounding errors\n root.ref.center.scaleY = (height - topRect.height - bottomRect.height) / 100;\n\n // offset bottom part\n root.ref.bottom.translateY = height - bottomRect.height;\n };\n\n var panel = createView({\n name: 'panel',\n read: function read(_ref3) {\n var root = _ref3.root,\n props = _ref3.props;\n return (props.heightCurrent = root.ref.bottom.translateY);\n },\n write: write$3,\n create: create$6,\n ignoreRect: true,\n mixins: {\n apis: ['height', 'heightCurrent', 'scalable'],\n },\n });\n\n var createDragHelper = function createDragHelper(items) {\n var itemIds = items.map(function(item) {\n return item.id;\n });\n var prevIndex = undefined;\n return {\n setIndex: function setIndex(index) {\n prevIndex = index;\n },\n getIndex: function getIndex() {\n return prevIndex;\n },\n getItemIndex: function getItemIndex(item) {\n return itemIds.indexOf(item.id);\n },\n };\n };\n\n var ITEM_TRANSLATE_SPRING = {\n type: 'spring',\n stiffness: 0.75,\n damping: 0.45,\n mass: 10,\n };\n\n var ITEM_SCALE_SPRING = 'spring';\n\n var StateMap = {\n DID_START_ITEM_LOAD: 'busy',\n DID_UPDATE_ITEM_LOAD_PROGRESS: 'loading',\n DID_THROW_ITEM_INVALID: 'load-invalid',\n DID_THROW_ITEM_LOAD_ERROR: 'load-error',\n DID_LOAD_ITEM: 'idle',\n DID_THROW_ITEM_REMOVE_ERROR: 'remove-error',\n DID_START_ITEM_REMOVE: 'busy',\n DID_START_ITEM_PROCESSING: 'busy processing',\n DID_REQUEST_ITEM_PROCESSING: 'busy processing',\n DID_UPDATE_ITEM_PROCESS_PROGRESS: 'processing',\n DID_COMPLETE_ITEM_PROCESSING: 'processing-complete',\n DID_THROW_ITEM_PROCESSING_ERROR: 'processing-error',\n DID_THROW_ITEM_PROCESSING_REVERT_ERROR: 'processing-revert-error',\n DID_ABORT_ITEM_PROCESSING: 'cancelled',\n DID_REVERT_ITEM_PROCESSING: 'idle',\n };\n\n /**\n * Creates the file view\n */\n var create$7 = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n // select\n root.ref.handleClick = function(e) {\n return root.dispatch('DID_ACTIVATE_ITEM', { id: props.id });\n };\n\n // set id\n root.element.id = 'filepond--item-' + props.id;\n root.element.addEventListener('click', root.ref.handleClick);\n\n // file view\n root.ref.container = root.appendChildView(\n root.createChildView(fileWrapper, { id: props.id })\n );\n\n // file panel\n root.ref.panel = root.appendChildView(root.createChildView(panel, { name: 'item-panel' }));\n\n // default start height\n root.ref.panel.height = null;\n\n // by default not marked for removal\n props.markedForRemoval = false;\n\n // if not allowed to reorder file items, exit here\n if (!root.query('GET_ALLOW_REORDER')) return;\n\n // set to idle so shows grab cursor\n root.element.dataset.dragState = 'idle';\n\n var grab = function grab(e) {\n if (!e.isPrimary) return;\n\n var removedActivateListener = false;\n\n var origin = {\n x: e.pageX,\n y: e.pageY,\n };\n\n props.dragOrigin = {\n x: root.translateX,\n y: root.translateY,\n };\n\n props.dragCenter = {\n x: e.offsetX,\n y: e.offsetY,\n };\n\n var dragState = createDragHelper(root.query('GET_ACTIVE_ITEMS'));\n\n root.dispatch('DID_GRAB_ITEM', { id: props.id, dragState: dragState });\n\n var drag = function drag(e) {\n if (!e.isPrimary) return;\n\n e.stopPropagation();\n e.preventDefault();\n\n props.dragOffset = {\n x: e.pageX - origin.x,\n y: e.pageY - origin.y,\n };\n\n // if dragged stop listening to clicks, will re-add when done dragging\n var dist =\n props.dragOffset.x * props.dragOffset.x +\n props.dragOffset.y * props.dragOffset.y;\n if (dist > 16 && !removedActivateListener) {\n removedActivateListener = true;\n root.element.removeEventListener('click', root.ref.handleClick);\n }\n\n root.dispatch('DID_DRAG_ITEM', { id: props.id, dragState: dragState });\n };\n\n var drop = function drop(e) {\n if (!e.isPrimary) return;\n\n props.dragOffset = {\n x: e.pageX - origin.x,\n y: e.pageY - origin.y,\n };\n\n reset();\n };\n\n var cancel = function cancel() {\n reset();\n };\n\n var reset = function reset() {\n document.removeEventListener('pointercancel', cancel);\n document.removeEventListener('pointermove', drag);\n document.removeEventListener('pointerup', drop);\n\n root.dispatch('DID_DROP_ITEM', { id: props.id, dragState: dragState });\n\n // start listening to clicks again\n if (removedActivateListener) {\n setTimeout(function() {\n return root.element.addEventListener('click', root.ref.handleClick);\n }, 0);\n }\n };\n\n document.addEventListener('pointercancel', cancel);\n document.addEventListener('pointermove', drag);\n document.addEventListener('pointerup', drop);\n };\n\n root.element.addEventListener('pointerdown', grab);\n };\n\n var route$1 = createRoute({\n DID_UPDATE_PANEL_HEIGHT: function DID_UPDATE_PANEL_HEIGHT(_ref2) {\n var root = _ref2.root,\n action = _ref2.action;\n root.height = action.height;\n },\n });\n\n var write$4 = createRoute(\n {\n DID_GRAB_ITEM: function DID_GRAB_ITEM(_ref3) {\n var root = _ref3.root,\n props = _ref3.props;\n props.dragOrigin = {\n x: root.translateX,\n y: root.translateY,\n };\n },\n DID_DRAG_ITEM: function DID_DRAG_ITEM(_ref4) {\n var root = _ref4.root;\n root.element.dataset.dragState = 'drag';\n },\n DID_DROP_ITEM: function DID_DROP_ITEM(_ref5) {\n var root = _ref5.root,\n props = _ref5.props;\n props.dragOffset = null;\n props.dragOrigin = null;\n root.element.dataset.dragState = 'drop';\n },\n },\n\n function(_ref6) {\n var root = _ref6.root,\n actions = _ref6.actions,\n props = _ref6.props,\n shouldOptimize = _ref6.shouldOptimize;\n if (root.element.dataset.dragState === 'drop') {\n if (root.scaleX <= 1) {\n root.element.dataset.dragState = 'idle';\n }\n }\n\n // select last state change action\n var action = actions\n .concat()\n .filter(function(action) {\n return /^DID_/.test(action.type);\n })\n .reverse()\n .find(function(action) {\n return StateMap[action.type];\n });\n\n // no need to set same state twice\n if (action && action.type !== props.currentState) {\n // set current state\n props.currentState = action.type;\n\n // set state\n root.element.dataset.filepondItemState = StateMap[props.currentState] || '';\n }\n\n // route actions\n var aspectRatio =\n root.query('GET_ITEM_PANEL_ASPECT_RATIO') || root.query('GET_PANEL_ASPECT_RATIO');\n if (!aspectRatio) {\n route$1({ root: root, actions: actions, props: props });\n if (!root.height && root.ref.container.rect.element.height > 0) {\n root.height = root.ref.container.rect.element.height;\n }\n } else if (!shouldOptimize) {\n root.height = root.rect.element.width * aspectRatio;\n }\n\n // sync panel height with item height\n if (shouldOptimize) {\n root.ref.panel.height = null;\n }\n\n root.ref.panel.height = root.height;\n }\n );\n\n var item = createView({\n create: create$7,\n write: write$4,\n destroy: function destroy(_ref7) {\n var root = _ref7.root,\n props = _ref7.props;\n root.element.removeEventListener('click', root.ref.handleClick);\n root.dispatch('RELEASE_ITEM', { query: props.id });\n },\n tag: 'li',\n name: 'item',\n mixins: {\n apis: [\n 'id',\n 'interactionMethod',\n 'markedForRemoval',\n 'spawnDate',\n 'dragCenter',\n 'dragOrigin',\n 'dragOffset',\n ],\n\n styles: ['translateX', 'translateY', 'scaleX', 'scaleY', 'opacity', 'height'],\n animations: {\n scaleX: ITEM_SCALE_SPRING,\n scaleY: ITEM_SCALE_SPRING,\n translateX: ITEM_TRANSLATE_SPRING,\n translateY: ITEM_TRANSLATE_SPRING,\n opacity: { type: 'tween', duration: 150 },\n },\n },\n });\n\n var getItemsPerRow = function(horizontalSpace, itemWidth) {\n // add one pixel leeway, when using percentages for item width total items can be 1.99 per row\n\n return Math.max(1, Math.floor((horizontalSpace + 1) / itemWidth));\n };\n\n var getItemIndexByPosition = function getItemIndexByPosition(view, children, positionInView) {\n if (!positionInView) return;\n\n var horizontalSpace = view.rect.element.width;\n // const children = view.childViews;\n var l = children.length;\n var last = null;\n\n // -1, don't move items to accomodate (either add to top or bottom)\n if (l === 0 || positionInView.top < children[0].rect.element.top) return -1;\n\n // let's get the item width\n var item = children[0];\n var itemRect = item.rect.element;\n var itemHorizontalMargin = itemRect.marginLeft + itemRect.marginRight;\n var itemWidth = itemRect.width + itemHorizontalMargin;\n var itemsPerRow = getItemsPerRow(horizontalSpace, itemWidth);\n\n // stack\n if (itemsPerRow === 1) {\n for (var index = 0; index < l; index++) {\n var child = children[index];\n var childMid = child.rect.outer.top + child.rect.element.height * 0.5;\n if (positionInView.top < childMid) {\n return index;\n }\n }\n return l;\n }\n\n // grid\n var itemVerticalMargin = itemRect.marginTop + itemRect.marginBottom;\n var itemHeight = itemRect.height + itemVerticalMargin;\n for (var _index = 0; _index < l; _index++) {\n var indexX = _index % itemsPerRow;\n var indexY = Math.floor(_index / itemsPerRow);\n\n var offsetX = indexX * itemWidth;\n var offsetY = indexY * itemHeight;\n\n var itemTop = offsetY - itemRect.marginTop;\n var itemRight = offsetX + itemWidth;\n var itemBottom = offsetY + itemHeight + itemRect.marginBottom;\n\n if (positionInView.top < itemBottom && positionInView.top > itemTop) {\n if (positionInView.left < itemRight) {\n return _index;\n } else if (_index !== l - 1) {\n last = _index;\n } else {\n last = null;\n }\n }\n }\n\n if (last !== null) {\n return last;\n }\n\n return l;\n };\n\n var dropAreaDimensions = {\n height: 0,\n width: 0,\n get getHeight() {\n return this.height;\n },\n set setHeight(val) {\n if (this.height === 0 || val === 0) this.height = val;\n },\n get getWidth() {\n return this.width;\n },\n set setWidth(val) {\n if (this.width === 0 || val === 0) this.width = val;\n },\n setDimensions: function setDimensions(height, width) {\n if (this.height === 0 || height === 0) this.height = height;\n if (this.width === 0 || width === 0) this.width = width;\n },\n };\n\n var create$8 = function create(_ref) {\n var root = _ref.root;\n // need to set role to list as otherwise it won't be read as a list by VoiceOver\n attr(root.element, 'role', 'list');\n\n root.ref.lastItemSpanwDate = Date.now();\n };\n\n /**\n * Inserts a new item\n * @param root\n * @param action\n */\n var addItemView = function addItemView(_ref2) {\n var root = _ref2.root,\n action = _ref2.action;\n var id = action.id,\n index = action.index,\n interactionMethod = action.interactionMethod;\n\n root.ref.addIndex = index;\n\n var now = Date.now();\n var spawnDate = now;\n var opacity = 1;\n\n if (interactionMethod !== InteractionMethod.NONE) {\n opacity = 0;\n var cooldown = root.query('GET_ITEM_INSERT_INTERVAL');\n var dist = now - root.ref.lastItemSpanwDate;\n spawnDate = dist < cooldown ? now + (cooldown - dist) : now;\n }\n\n root.ref.lastItemSpanwDate = spawnDate;\n\n root.appendChildView(\n root.createChildView(\n // view type\n item,\n\n // props\n {\n spawnDate: spawnDate,\n id: id,\n opacity: opacity,\n interactionMethod: interactionMethod,\n }\n ),\n\n index\n );\n };\n\n var moveItem = function moveItem(item, x, y) {\n var vx = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var vy = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 1;\n // set to null to remove animation while dragging\n if (item.dragOffset) {\n item.translateX = null;\n item.translateY = null;\n item.translateX = item.dragOrigin.x + item.dragOffset.x;\n item.translateY = item.dragOrigin.y + item.dragOffset.y;\n item.scaleX = 1.025;\n item.scaleY = 1.025;\n } else {\n item.translateX = x;\n item.translateY = y;\n\n if (Date.now() > item.spawnDate) {\n // reveal element\n if (item.opacity === 0) {\n introItemView(item, x, y, vx, vy);\n }\n\n // make sure is default scale every frame\n item.scaleX = 1;\n item.scaleY = 1;\n item.opacity = 1;\n }\n }\n };\n\n var introItemView = function introItemView(item, x, y, vx, vy) {\n if (item.interactionMethod === InteractionMethod.NONE) {\n item.translateX = null;\n item.translateX = x;\n item.translateY = null;\n item.translateY = y;\n } else if (item.interactionMethod === InteractionMethod.DROP) {\n item.translateX = null;\n item.translateX = x - vx * 20;\n\n item.translateY = null;\n item.translateY = y - vy * 10;\n\n item.scaleX = 0.8;\n item.scaleY = 0.8;\n } else if (item.interactionMethod === InteractionMethod.BROWSE) {\n item.translateY = null;\n item.translateY = y - 30;\n } else if (item.interactionMethod === InteractionMethod.API) {\n item.translateX = null;\n item.translateX = x - 30;\n item.translateY = null;\n }\n };\n\n /**\n * Removes an existing item\n * @param root\n * @param action\n */\n var removeItemView = function removeItemView(_ref3) {\n var root = _ref3.root,\n action = _ref3.action;\n var id = action.id;\n\n // get the view matching the given id\n var view = root.childViews.find(function(child) {\n return child.id === id;\n });\n\n // if no view found, exit\n if (!view) {\n return;\n }\n\n // animate view out of view\n view.scaleX = 0.9;\n view.scaleY = 0.9;\n view.opacity = 0;\n\n // mark for removal\n view.markedForRemoval = true;\n };\n\n var getItemHeight = function getItemHeight(child) {\n return (\n child.rect.element.height +\n child.rect.element.marginBottom * 0.5 +\n child.rect.element.marginTop * 0.5\n );\n };\n var getItemWidth = function getItemWidth(child) {\n return (\n child.rect.element.width +\n child.rect.element.marginLeft * 0.5 +\n child.rect.element.marginRight * 0.5\n );\n };\n\n var dragItem = function dragItem(_ref4) {\n var root = _ref4.root,\n action = _ref4.action;\n var id = action.id,\n dragState = action.dragState;\n\n // reference to item\n var item = root.query('GET_ITEM', { id: id });\n\n // get the view matching the given id\n var view = root.childViews.find(function(child) {\n return child.id === id;\n });\n\n var numItems = root.childViews.length;\n var oldIndex = dragState.getItemIndex(item);\n\n // if no view found, exit\n if (!view) return;\n\n var dragPosition = {\n x: view.dragOrigin.x + view.dragOffset.x + view.dragCenter.x,\n y: view.dragOrigin.y + view.dragOffset.y + view.dragCenter.y,\n };\n\n // get drag area dimensions\n var dragHeight = getItemHeight(view);\n var dragWidth = getItemWidth(view);\n\n // get rows and columns (There will always be at least one row and one column if a file is present)\n var cols = Math.floor(root.rect.outer.width / dragWidth);\n if (cols > numItems) cols = numItems;\n\n // rows are used to find when we have left the preview area bounding box\n var rows = Math.floor(numItems / cols + 1);\n\n dropAreaDimensions.setHeight = dragHeight * rows;\n dropAreaDimensions.setWidth = dragWidth * cols;\n\n // get new index of dragged item\n var location = {\n y: Math.floor(dragPosition.y / dragHeight),\n x: Math.floor(dragPosition.x / dragWidth),\n getGridIndex: function getGridIndex() {\n if (\n dragPosition.y > dropAreaDimensions.getHeight ||\n dragPosition.y < 0 ||\n dragPosition.x > dropAreaDimensions.getWidth ||\n dragPosition.x < 0\n )\n return oldIndex;\n return this.y * cols + this.x;\n },\n getColIndex: function getColIndex() {\n var items = root.query('GET_ACTIVE_ITEMS');\n var visibleChildren = root.childViews.filter(function(child) {\n return child.rect.element.height;\n });\n var children = items.map(function(item) {\n return visibleChildren.find(function(childView) {\n return childView.id === item.id;\n });\n });\n\n var currentIndex = children.findIndex(function(child) {\n return child === view;\n });\n var dragHeight = getItemHeight(view);\n var l = children.length;\n var idx = l;\n var childHeight = 0;\n var childBottom = 0;\n var childTop = 0;\n for (var i = 0; i < l; i++) {\n childHeight = getItemHeight(children[i]);\n childTop = childBottom;\n childBottom = childTop + childHeight;\n if (dragPosition.y < childBottom) {\n if (currentIndex > i) {\n if (dragPosition.y < childTop + dragHeight) {\n idx = i;\n break;\n }\n continue;\n }\n idx = i;\n break;\n }\n }\n return idx;\n },\n };\n\n // get new index\n var index = cols > 1 ? location.getGridIndex() : location.getColIndex();\n root.dispatch('MOVE_ITEM', { query: view, index: index });\n\n // if the index of the item changed, dispatch reorder action\n var currentIndex = dragState.getIndex();\n\n if (currentIndex === undefined || currentIndex !== index) {\n dragState.setIndex(index);\n\n if (currentIndex === undefined) return;\n\n root.dispatch('DID_REORDER_ITEMS', {\n items: root.query('GET_ACTIVE_ITEMS'),\n origin: oldIndex,\n target: index,\n });\n }\n };\n\n /**\n * Setup action routes\n */\n var route$2 = createRoute({\n DID_ADD_ITEM: addItemView,\n DID_REMOVE_ITEM: removeItemView,\n DID_DRAG_ITEM: dragItem,\n });\n\n /**\n * Write to view\n * @param root\n * @param actions\n * @param props\n */\n var write$5 = function write(_ref5) {\n var root = _ref5.root,\n props = _ref5.props,\n actions = _ref5.actions,\n shouldOptimize = _ref5.shouldOptimize;\n // route actions\n route$2({ root: root, props: props, actions: actions });\n var dragCoordinates = props.dragCoordinates;\n\n // available space on horizontal axis\n var horizontalSpace = root.rect.element.width;\n\n // only draw children that have dimensions\n var visibleChildren = root.childViews.filter(function(child) {\n return child.rect.element.height;\n });\n\n // sort based on current active items\n var children = root\n .query('GET_ACTIVE_ITEMS')\n .map(function(item) {\n return visibleChildren.find(function(child) {\n return child.id === item.id;\n });\n })\n .filter(function(item) {\n return item;\n });\n\n // get index\n var dragIndex = dragCoordinates\n ? getItemIndexByPosition(root, children, dragCoordinates)\n : null;\n\n // add index is used to reserve the dropped/added item index till the actual item is rendered\n var addIndex = root.ref.addIndex || null;\n\n // add index no longer needed till possibly next draw\n root.ref.addIndex = null;\n\n var dragIndexOffset = 0;\n var removeIndexOffset = 0;\n var addIndexOffset = 0;\n\n if (children.length === 0) return;\n\n var childRect = children[0].rect.element;\n var itemVerticalMargin = childRect.marginTop + childRect.marginBottom;\n var itemHorizontalMargin = childRect.marginLeft + childRect.marginRight;\n var itemWidth = childRect.width + itemHorizontalMargin;\n var itemHeight = childRect.height + itemVerticalMargin;\n var itemsPerRow = getItemsPerRow(horizontalSpace, itemWidth);\n\n // stack\n if (itemsPerRow === 1) {\n var offsetY = 0;\n var dragOffset = 0;\n\n children.forEach(function(child, index) {\n if (dragIndex) {\n var dist = index - dragIndex;\n if (dist === -2) {\n dragOffset = -itemVerticalMargin * 0.25;\n } else if (dist === -1) {\n dragOffset = -itemVerticalMargin * 0.75;\n } else if (dist === 0) {\n dragOffset = itemVerticalMargin * 0.75;\n } else if (dist === 1) {\n dragOffset = itemVerticalMargin * 0.25;\n } else {\n dragOffset = 0;\n }\n }\n\n if (shouldOptimize) {\n child.translateX = null;\n child.translateY = null;\n }\n\n if (!child.markedForRemoval) {\n moveItem(child, 0, offsetY + dragOffset);\n }\n\n var itemHeight = child.rect.element.height + itemVerticalMargin;\n\n var visualHeight = itemHeight * (child.markedForRemoval ? child.opacity : 1);\n\n offsetY += visualHeight;\n });\n }\n // grid\n else {\n var prevX = 0;\n var prevY = 0;\n\n children.forEach(function(child, index) {\n if (index === dragIndex) {\n dragIndexOffset = 1;\n }\n\n if (index === addIndex) {\n addIndexOffset += 1;\n }\n\n if (child.markedForRemoval && child.opacity < 0.5) {\n removeIndexOffset -= 1;\n }\n\n var visualIndex = index + addIndexOffset + dragIndexOffset + removeIndexOffset;\n\n var indexX = visualIndex % itemsPerRow;\n var indexY = Math.floor(visualIndex / itemsPerRow);\n\n var offsetX = indexX * itemWidth;\n var offsetY = indexY * itemHeight;\n\n var vectorX = Math.sign(offsetX - prevX);\n var vectorY = Math.sign(offsetY - prevY);\n\n prevX = offsetX;\n prevY = offsetY;\n\n if (child.markedForRemoval) return;\n\n if (shouldOptimize) {\n child.translateX = null;\n child.translateY = null;\n }\n\n moveItem(child, offsetX, offsetY, vectorX, vectorY);\n });\n }\n };\n\n /**\n * Filters actions that are meant specifically for a certain child of the list\n * @param child\n * @param actions\n */\n var filterSetItemActions = function filterSetItemActions(child, actions) {\n return actions.filter(function(action) {\n // if action has an id, filter out actions that don't have this child id\n if (action.data && action.data.id) {\n return child.id === action.data.id;\n }\n\n // allow all other actions\n return true;\n });\n };\n\n var list = createView({\n create: create$8,\n write: write$5,\n tag: 'ul',\n name: 'list',\n didWriteView: function didWriteView(_ref6) {\n var root = _ref6.root;\n root.childViews\n .filter(function(view) {\n return view.markedForRemoval && view.opacity === 0 && view.resting;\n })\n .forEach(function(view) {\n view._destroy();\n root.removeChildView(view);\n });\n },\n filterFrameActionsForChild: filterSetItemActions,\n mixins: {\n apis: ['dragCoordinates'],\n },\n });\n\n var create$9 = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n root.ref.list = root.appendChildView(root.createChildView(list));\n props.dragCoordinates = null;\n props.overflowing = false;\n };\n\n var storeDragCoordinates = function storeDragCoordinates(_ref2) {\n var root = _ref2.root,\n props = _ref2.props,\n action = _ref2.action;\n if (!root.query('GET_ITEM_INSERT_LOCATION_FREEDOM')) return;\n props.dragCoordinates = {\n left: action.position.scopeLeft - root.ref.list.rect.element.left,\n top:\n action.position.scopeTop -\n (root.rect.outer.top + root.rect.element.marginTop + root.rect.element.scrollTop),\n };\n };\n\n var clearDragCoordinates = function clearDragCoordinates(_ref3) {\n var props = _ref3.props;\n props.dragCoordinates = null;\n };\n\n var route$3 = createRoute({\n DID_DRAG: storeDragCoordinates,\n DID_END_DRAG: clearDragCoordinates,\n });\n\n var write$6 = function write(_ref4) {\n var root = _ref4.root,\n props = _ref4.props,\n actions = _ref4.actions;\n\n // route actions\n route$3({ root: root, props: props, actions: actions });\n\n // current drag position\n root.ref.list.dragCoordinates = props.dragCoordinates;\n\n // if currently overflowing but no longer received overflow\n if (props.overflowing && !props.overflow) {\n props.overflowing = false;\n\n // reset overflow state\n root.element.dataset.state = '';\n root.height = null;\n }\n\n // if is not overflowing currently but does receive overflow value\n if (props.overflow) {\n var newHeight = Math.round(props.overflow);\n if (newHeight !== root.height) {\n props.overflowing = true;\n root.element.dataset.state = 'overflow';\n root.height = newHeight;\n }\n }\n };\n\n var listScroller = createView({\n create: create$9,\n write: write$6,\n name: 'list-scroller',\n mixins: {\n apis: ['overflow', 'dragCoordinates'],\n styles: ['height', 'translateY'],\n animations: {\n translateY: 'spring',\n },\n },\n });\n\n var attrToggle = function attrToggle(element, name, state) {\n var enabledValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';\n if (state) {\n attr(element, name, enabledValue);\n } else {\n element.removeAttribute(name);\n }\n };\n\n var resetFileInput = function resetFileInput(input) {\n // no value, no need to reset\n if (!input || input.value === '') {\n return;\n }\n\n try {\n // for modern browsers\n input.value = '';\n } catch (err) {}\n\n // for IE10\n if (input.value) {\n // quickly append input to temp form and reset form\n var form = createElement$1('form');\n var parentNode = input.parentNode;\n var ref = input.nextSibling;\n form.appendChild(input);\n form.reset();\n\n // re-inject input where it originally was\n if (ref) {\n parentNode.insertBefore(input, ref);\n } else {\n parentNode.appendChild(input);\n }\n }\n };\n\n var create$a = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n\n // set id so can be referenced from outside labels\n root.element.id = 'filepond--browser-' + props.id;\n\n // set name of element (is removed when a value is set)\n attr(root.element, 'name', root.query('GET_NAME'));\n\n // we have to link this element to the status element\n attr(root.element, 'aria-controls', 'filepond--assistant-' + props.id);\n\n // set label, we use labelled by as otherwise the screenreader does not read the \"browse\" text in the label (as it has tabindex: 0)\n attr(root.element, 'aria-labelledby', 'filepond--drop-label-' + props.id);\n\n // set configurable props\n setAcceptedFileTypes({\n root: root,\n action: { value: root.query('GET_ACCEPTED_FILE_TYPES') },\n });\n toggleAllowMultiple({ root: root, action: { value: root.query('GET_ALLOW_MULTIPLE') } });\n toggleDirectoryFilter({\n root: root,\n action: { value: root.query('GET_ALLOW_DIRECTORIES_ONLY') },\n });\n toggleDisabled({ root: root });\n toggleRequired({ root: root, action: { value: root.query('GET_REQUIRED') } });\n setCaptureMethod({ root: root, action: { value: root.query('GET_CAPTURE_METHOD') } });\n\n // handle changes to the input field\n root.ref.handleChange = function(e) {\n if (!root.element.value) {\n return;\n }\n\n // extract files and move value of webkitRelativePath path to _relativePath\n var files = Array.from(root.element.files).map(function(file) {\n file._relativePath = file.webkitRelativePath;\n return file;\n });\n\n // we add a little delay so the OS file select window can move out of the way before we add our file\n setTimeout(function() {\n // load files\n props.onload(files);\n\n // reset input, it's just for exposing a method to drop files, should not retain any state\n resetFileInput(root.element);\n }, 250);\n };\n\n root.element.addEventListener('change', root.ref.handleChange);\n };\n\n var setAcceptedFileTypes = function setAcceptedFileTypes(_ref2) {\n var root = _ref2.root,\n action = _ref2.action;\n if (!root.query('GET_ALLOW_SYNC_ACCEPT_ATTRIBUTE')) return;\n attrToggle(\n root.element,\n 'accept',\n !!action.value,\n action.value ? action.value.join(',') : ''\n );\n };\n\n var toggleAllowMultiple = function toggleAllowMultiple(_ref3) {\n var root = _ref3.root,\n action = _ref3.action;\n attrToggle(root.element, 'multiple', action.value);\n };\n\n var toggleDirectoryFilter = function toggleDirectoryFilter(_ref4) {\n var root = _ref4.root,\n action = _ref4.action;\n attrToggle(root.element, 'webkitdirectory', action.value);\n };\n\n var toggleDisabled = function toggleDisabled(_ref5) {\n var root = _ref5.root;\n var isDisabled = root.query('GET_DISABLED');\n var doesAllowBrowse = root.query('GET_ALLOW_BROWSE');\n var disableField = isDisabled || !doesAllowBrowse;\n attrToggle(root.element, 'disabled', disableField);\n };\n\n var toggleRequired = function toggleRequired(_ref6) {\n var root = _ref6.root,\n action = _ref6.action;\n // want to remove required, always possible\n if (!action.value) {\n attrToggle(root.element, 'required', false);\n }\n // if want to make required, only possible when zero items\n else if (root.query('GET_TOTAL_ITEMS') === 0) {\n attrToggle(root.element, 'required', true);\n }\n };\n\n var setCaptureMethod = function setCaptureMethod(_ref7) {\n var root = _ref7.root,\n action = _ref7.action;\n attrToggle(\n root.element,\n 'capture',\n !!action.value,\n action.value === true ? '' : action.value\n );\n };\n\n var updateRequiredStatus = function updateRequiredStatus(_ref8) {\n var root = _ref8.root;\n var element = root.element;\n // always remove the required attribute when more than zero items\n if (root.query('GET_TOTAL_ITEMS') > 0) {\n attrToggle(element, 'required', false);\n attrToggle(element, 'name', false);\n } else {\n // add name attribute\n attrToggle(element, 'name', true, root.query('GET_NAME'));\n\n // remove any validation messages\n var shouldCheckValidity = root.query('GET_CHECK_VALIDITY');\n if (shouldCheckValidity) {\n element.setCustomValidity('');\n }\n\n // we only add required if the field has been deemed required\n if (root.query('GET_REQUIRED')) {\n attrToggle(element, 'required', true);\n }\n }\n };\n\n var updateFieldValidityStatus = function updateFieldValidityStatus(_ref9) {\n var root = _ref9.root;\n var shouldCheckValidity = root.query('GET_CHECK_VALIDITY');\n if (!shouldCheckValidity) return;\n root.element.setCustomValidity(root.query('GET_LABEL_INVALID_FIELD'));\n };\n\n var browser = createView({\n tag: 'input',\n name: 'browser',\n ignoreRect: true,\n ignoreRectUpdate: true,\n attributes: {\n type: 'file',\n },\n\n create: create$a,\n destroy: function destroy(_ref10) {\n var root = _ref10.root;\n root.element.removeEventListener('change', root.ref.handleChange);\n },\n write: createRoute({\n DID_LOAD_ITEM: updateRequiredStatus,\n DID_REMOVE_ITEM: updateRequiredStatus,\n DID_THROW_ITEM_INVALID: updateFieldValidityStatus,\n\n DID_SET_DISABLED: toggleDisabled,\n DID_SET_ALLOW_BROWSE: toggleDisabled,\n DID_SET_ALLOW_DIRECTORIES_ONLY: toggleDirectoryFilter,\n DID_SET_ALLOW_MULTIPLE: toggleAllowMultiple,\n DID_SET_ACCEPTED_FILE_TYPES: setAcceptedFileTypes,\n DID_SET_CAPTURE_METHOD: setCaptureMethod,\n DID_SET_REQUIRED: toggleRequired,\n }),\n });\n\n var Key = {\n ENTER: 13,\n SPACE: 32,\n };\n\n var create$b = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n // create the label and link it to the file browser\n var label = createElement$1('label');\n attr(label, 'for', 'filepond--browser-' + props.id);\n\n // use for labeling file input (aria-labelledby on file input)\n attr(label, 'id', 'filepond--drop-label-' + props.id);\n\n // handle keys\n root.ref.handleKeyDown = function(e) {\n var isActivationKey = e.keyCode === Key.ENTER || e.keyCode === Key.SPACE;\n if (!isActivationKey) return;\n // stops from triggering the element a second time\n e.preventDefault();\n\n // click link (will then in turn activate file input)\n root.ref.label.click();\n };\n\n root.ref.handleClick = function(e) {\n var isLabelClick = e.target === label || label.contains(e.target);\n\n // don't want to click twice\n if (isLabelClick) return;\n\n // click link (will then in turn activate file input)\n root.ref.label.click();\n };\n\n // attach events\n label.addEventListener('keydown', root.ref.handleKeyDown);\n root.element.addEventListener('click', root.ref.handleClick);\n\n // update\n updateLabelValue(label, props.caption);\n\n // add!\n root.appendChild(label);\n root.ref.label = label;\n };\n\n var updateLabelValue = function updateLabelValue(label, value) {\n label.innerHTML = value;\n var clickable = label.querySelector('.filepond--label-action');\n if (clickable) {\n attr(clickable, 'tabindex', '0');\n }\n return value;\n };\n\n var dropLabel = createView({\n name: 'drop-label',\n ignoreRect: true,\n create: create$b,\n destroy: function destroy(_ref2) {\n var root = _ref2.root;\n root.ref.label.addEventListener('keydown', root.ref.handleKeyDown);\n root.element.removeEventListener('click', root.ref.handleClick);\n },\n write: createRoute({\n DID_SET_LABEL_IDLE: function DID_SET_LABEL_IDLE(_ref3) {\n var root = _ref3.root,\n action = _ref3.action;\n updateLabelValue(root.ref.label, action.value);\n },\n }),\n\n mixins: {\n styles: ['opacity', 'translateX', 'translateY'],\n animations: {\n opacity: { type: 'tween', duration: 150 },\n translateX: 'spring',\n translateY: 'spring',\n },\n },\n });\n\n var blob = createView({\n name: 'drip-blob',\n ignoreRect: true,\n mixins: {\n styles: ['translateX', 'translateY', 'scaleX', 'scaleY', 'opacity'],\n animations: {\n scaleX: 'spring',\n scaleY: 'spring',\n translateX: 'spring',\n translateY: 'spring',\n opacity: { type: 'tween', duration: 250 },\n },\n },\n });\n\n var addBlob = function addBlob(_ref) {\n var root = _ref.root;\n var centerX = root.rect.element.width * 0.5;\n var centerY = root.rect.element.height * 0.5;\n\n root.ref.blob = root.appendChildView(\n root.createChildView(blob, {\n opacity: 0,\n scaleX: 2.5,\n scaleY: 2.5,\n translateX: centerX,\n translateY: centerY,\n })\n );\n };\n\n var moveBlob = function moveBlob(_ref2) {\n var root = _ref2.root,\n action = _ref2.action;\n if (!root.ref.blob) {\n addBlob({ root: root });\n return;\n }\n\n root.ref.blob.translateX = action.position.scopeLeft;\n root.ref.blob.translateY = action.position.scopeTop;\n root.ref.blob.scaleX = 1;\n root.ref.blob.scaleY = 1;\n root.ref.blob.opacity = 1;\n };\n\n var hideBlob = function hideBlob(_ref3) {\n var root = _ref3.root;\n if (!root.ref.blob) {\n return;\n }\n root.ref.blob.opacity = 0;\n };\n\n var explodeBlob = function explodeBlob(_ref4) {\n var root = _ref4.root;\n if (!root.ref.blob) {\n return;\n }\n root.ref.blob.scaleX = 2.5;\n root.ref.blob.scaleY = 2.5;\n root.ref.blob.opacity = 0;\n };\n\n var write$7 = function write(_ref5) {\n var root = _ref5.root,\n props = _ref5.props,\n actions = _ref5.actions;\n route$4({ root: root, props: props, actions: actions });\n var blob = root.ref.blob;\n\n if (actions.length === 0 && blob && blob.opacity === 0) {\n root.removeChildView(blob);\n root.ref.blob = null;\n }\n };\n\n var route$4 = createRoute({\n DID_DRAG: moveBlob,\n DID_DROP: explodeBlob,\n DID_END_DRAG: hideBlob,\n });\n\n var drip = createView({\n ignoreRect: true,\n ignoreRectUpdate: true,\n name: 'drip',\n write: write$7,\n });\n\n var setInputFiles = function setInputFiles(element, files) {\n try {\n // Create a DataTransfer instance and add a newly created file\n var dataTransfer = new DataTransfer();\n files.forEach(function(file) {\n if (file instanceof File) {\n dataTransfer.items.add(file);\n } else {\n dataTransfer.items.add(\n new File([file], file.name, {\n type: file.type,\n })\n );\n }\n });\n\n // Assign the DataTransfer files list to the file input\n element.files = dataTransfer.files;\n } catch (err) {\n return false;\n }\n return true;\n };\n\n var create$c = function create(_ref) {\n var root = _ref.root;\n root.ref.fields = {};\n var legend = document.createElement('legend');\n legend.textContent = 'Files';\n root.element.appendChild(legend);\n };\n\n var getField = function getField(root, id) {\n return root.ref.fields[id];\n };\n\n var syncFieldPositionsWithItems = function syncFieldPositionsWithItems(root) {\n root.query('GET_ACTIVE_ITEMS').forEach(function(item) {\n if (!root.ref.fields[item.id]) return;\n root.element.appendChild(root.ref.fields[item.id]);\n });\n };\n\n var didReorderItems = function didReorderItems(_ref2) {\n var root = _ref2.root;\n return syncFieldPositionsWithItems(root);\n };\n\n var didAddItem = function didAddItem(_ref3) {\n var root = _ref3.root,\n action = _ref3.action;\n var fileItem = root.query('GET_ITEM', action.id);\n var isLocalFile = fileItem.origin === FileOrigin.LOCAL;\n var shouldUseFileInput = !isLocalFile && root.query('SHOULD_UPDATE_FILE_INPUT');\n var dataContainer = createElement$1('input');\n dataContainer.type = shouldUseFileInput ? 'file' : 'hidden';\n dataContainer.name = root.query('GET_NAME');\n root.ref.fields[action.id] = dataContainer;\n syncFieldPositionsWithItems(root);\n };\n\n var didLoadItem$1 = function didLoadItem(_ref4) {\n var root = _ref4.root,\n action = _ref4.action;\n var field = getField(root, action.id);\n if (!field) return;\n\n // store server ref in hidden input\n if (action.serverFileReference !== null) field.value = action.serverFileReference;\n\n // store file item in file input\n if (!root.query('SHOULD_UPDATE_FILE_INPUT')) return;\n\n var fileItem = root.query('GET_ITEM', action.id);\n setInputFiles(field, [fileItem.file]);\n };\n\n var didPrepareOutput = function didPrepareOutput(_ref5) {\n var root = _ref5.root,\n action = _ref5.action;\n // this timeout pushes the handler after 'load'\n if (!root.query('SHOULD_UPDATE_FILE_INPUT')) return;\n setTimeout(function() {\n var field = getField(root, action.id);\n if (!field) return;\n setInputFiles(field, [action.file]);\n }, 0);\n };\n\n var didSetDisabled = function didSetDisabled(_ref6) {\n var root = _ref6.root;\n root.element.disabled = root.query('GET_DISABLED');\n };\n\n var didRemoveItem = function didRemoveItem(_ref7) {\n var root = _ref7.root,\n action = _ref7.action;\n var field = getField(root, action.id);\n if (!field) return;\n if (field.parentNode) field.parentNode.removeChild(field);\n delete root.ref.fields[action.id];\n };\n\n // only runs for server files. will refuse to update the value if the field\n // is a file field\n var didDefineValue = function didDefineValue(_ref8) {\n var root = _ref8.root,\n action = _ref8.action;\n var field = getField(root, action.id);\n if (!field) return;\n if (action.value === null) {\n // clear field value\n field.removeAttribute('value');\n } else {\n // set field value\n if (field.type != 'file') {\n field.value = action.value;\n }\n }\n syncFieldPositionsWithItems(root);\n };\n\n var write$8 = createRoute({\n DID_SET_DISABLED: didSetDisabled,\n DID_ADD_ITEM: didAddItem,\n DID_LOAD_ITEM: didLoadItem$1,\n DID_REMOVE_ITEM: didRemoveItem,\n DID_DEFINE_VALUE: didDefineValue,\n DID_PREPARE_OUTPUT: didPrepareOutput,\n DID_REORDER_ITEMS: didReorderItems,\n DID_SORT_ITEMS: didReorderItems,\n });\n\n var data = createView({\n tag: 'fieldset',\n name: 'data',\n create: create$c,\n write: write$8,\n ignoreRect: true,\n });\n\n var getRootNode = function getRootNode(element) {\n return 'getRootNode' in element ? element.getRootNode() : document;\n };\n\n var images = ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'svg', 'tiff'];\n var text$1 = ['css', 'csv', 'html', 'txt'];\n var map = {\n zip: 'zip|compressed',\n epub: 'application/epub+zip',\n };\n\n var guesstimateMimeType = function guesstimateMimeType() {\n var extension = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n extension = extension.toLowerCase();\n if (images.includes(extension)) {\n return (\n 'image/' +\n (extension === 'jpg' ? 'jpeg' : extension === 'svg' ? 'svg+xml' : extension)\n );\n }\n if (text$1.includes(extension)) {\n return 'text/' + extension;\n }\n\n return map[extension] || '';\n };\n\n var requestDataTransferItems = function requestDataTransferItems(dataTransfer) {\n return new Promise(function(resolve, reject) {\n // try to get links from transfer, if found we'll exit immediately (unless a file is in the dataTransfer as well, this is because Firefox could represent the file as a URL and a file object at the same time)\n var links = getLinks(dataTransfer);\n if (links.length && !hasFiles(dataTransfer)) {\n return resolve(links);\n }\n // try to get files from the transfer\n getFiles(dataTransfer).then(resolve);\n });\n };\n\n /**\n * Test if datatransfer has files\n */\n var hasFiles = function hasFiles(dataTransfer) {\n if (dataTransfer.files) return dataTransfer.files.length > 0;\n return false;\n };\n\n /**\n * Extracts files from a DataTransfer object\n */\n var getFiles = function getFiles(dataTransfer) {\n return new Promise(function(resolve, reject) {\n // get the transfer items as promises\n var promisedFiles = (dataTransfer.items ? Array.from(dataTransfer.items) : [])\n // only keep file system items (files and directories)\n .filter(function(item) {\n return isFileSystemItem(item);\n })\n\n // map each item to promise\n .map(function(item) {\n return getFilesFromItem(item);\n });\n\n // if is empty, see if we can extract some info from the files property as a fallback\n if (!promisedFiles.length) {\n // TODO: test for directories (should not be allowed)\n // Use FileReader, problem is that the files property gets lost in the process\n resolve(dataTransfer.files ? Array.from(dataTransfer.files) : []);\n return;\n }\n\n // done!\n Promise.all(promisedFiles)\n .then(function(returnedFileGroups) {\n // flatten groups\n var files = [];\n returnedFileGroups.forEach(function(group) {\n files.push.apply(files, group);\n });\n\n // done (filter out empty files)!\n resolve(\n files\n .filter(function(file) {\n return file;\n })\n .map(function(file) {\n if (!file._relativePath)\n file._relativePath = file.webkitRelativePath;\n return file;\n })\n );\n })\n .catch(console.error);\n });\n };\n\n var isFileSystemItem = function isFileSystemItem(item) {\n if (isEntry(item)) {\n var entry = getAsEntry(item);\n if (entry) {\n return entry.isFile || entry.isDirectory;\n }\n }\n return item.kind === 'file';\n };\n\n var getFilesFromItem = function getFilesFromItem(item) {\n return new Promise(function(resolve, reject) {\n if (isDirectoryEntry(item)) {\n getFilesInDirectory(getAsEntry(item))\n .then(resolve)\n .catch(reject);\n return;\n }\n\n resolve([item.getAsFile()]);\n });\n };\n\n var getFilesInDirectory = function getFilesInDirectory(entry) {\n return new Promise(function(resolve, reject) {\n var files = [];\n\n // the total entries to read\n var dirCounter = 0;\n var fileCounter = 0;\n\n var resolveIfDone = function resolveIfDone() {\n if (fileCounter === 0 && dirCounter === 0) {\n resolve(files);\n }\n };\n\n // the recursive function\n var readEntries = function readEntries(dirEntry) {\n dirCounter++;\n\n var directoryReader = dirEntry.createReader();\n\n // directories are returned in batches, we need to process all batches before we're done\n var readBatch = function readBatch() {\n directoryReader.readEntries(function(entries) {\n if (entries.length === 0) {\n dirCounter--;\n resolveIfDone();\n return;\n }\n\n entries.forEach(function(entry) {\n // recursively read more directories\n if (entry.isDirectory) {\n readEntries(entry);\n } else {\n // read as file\n fileCounter++;\n\n entry.file(function(file) {\n var correctedFile = correctMissingFileType(file);\n if (entry.fullPath)\n correctedFile._relativePath = entry.fullPath;\n files.push(correctedFile);\n fileCounter--;\n resolveIfDone();\n });\n }\n });\n\n // try to get next batch of files\n readBatch();\n }, reject);\n };\n\n // read first batch of files\n readBatch();\n };\n\n // go!\n readEntries(entry);\n });\n };\n\n var correctMissingFileType = function correctMissingFileType(file) {\n if (file.type.length) return file;\n var date = file.lastModifiedDate;\n var name = file.name;\n var type = guesstimateMimeType(getExtensionFromFilename(file.name));\n if (!type.length) return file;\n file = file.slice(0, file.size, type);\n file.name = name;\n file.lastModifiedDate = date;\n return file;\n };\n\n var isDirectoryEntry = function isDirectoryEntry(item) {\n return isEntry(item) && (getAsEntry(item) || {}).isDirectory;\n };\n\n var isEntry = function isEntry(item) {\n return 'webkitGetAsEntry' in item;\n };\n\n var getAsEntry = function getAsEntry(item) {\n return item.webkitGetAsEntry();\n };\n\n /**\n * Extracts links from a DataTransfer object\n */\n var getLinks = function getLinks(dataTransfer) {\n var links = [];\n try {\n // look in meta data property\n links = getLinksFromTransferMetaData(dataTransfer);\n if (links.length) {\n return links;\n }\n links = getLinksFromTransferURLData(dataTransfer);\n } catch (e) {\n // nope nope nope (probably IE trouble)\n }\n return links;\n };\n\n var getLinksFromTransferURLData = function getLinksFromTransferURLData(dataTransfer) {\n var data = dataTransfer.getData('url');\n if (typeof data === 'string' && data.length) {\n return [data];\n }\n return [];\n };\n\n var getLinksFromTransferMetaData = function getLinksFromTransferMetaData(dataTransfer) {\n var data = dataTransfer.getData('text/html');\n if (typeof data === 'string' && data.length) {\n var matches = data.match(/src\\s*=\\s*\"(.+?)\"/);\n if (matches) {\n return [matches[1]];\n }\n }\n return [];\n };\n\n var dragNDropObservers = [];\n\n var eventPosition = function eventPosition(e) {\n return {\n pageLeft: e.pageX,\n pageTop: e.pageY,\n scopeLeft: e.offsetX || e.layerX,\n scopeTop: e.offsetY || e.layerY,\n };\n };\n\n var createDragNDropClient = function createDragNDropClient(\n element,\n scopeToObserve,\n filterElement\n ) {\n var observer = getDragNDropObserver(scopeToObserve);\n\n var client = {\n element: element,\n filterElement: filterElement,\n state: null,\n ondrop: function ondrop() {},\n onenter: function onenter() {},\n ondrag: function ondrag() {},\n onexit: function onexit() {},\n onload: function onload() {},\n allowdrop: function allowdrop() {},\n };\n\n client.destroy = observer.addListener(client);\n\n return client;\n };\n\n var getDragNDropObserver = function getDragNDropObserver(element) {\n // see if already exists, if so, return\n var observer = dragNDropObservers.find(function(item) {\n return item.element === element;\n });\n if (observer) {\n return observer;\n }\n\n // create new observer, does not yet exist for this element\n var newObserver = createDragNDropObserver(element);\n dragNDropObservers.push(newObserver);\n return newObserver;\n };\n\n var createDragNDropObserver = function createDragNDropObserver(element) {\n var clients = [];\n\n var routes = {\n dragenter: dragenter,\n dragover: dragover,\n dragleave: dragleave,\n drop: drop,\n };\n\n var handlers = {};\n\n forin(routes, function(event, createHandler) {\n handlers[event] = createHandler(element, clients);\n element.addEventListener(event, handlers[event], false);\n });\n\n var observer = {\n element: element,\n addListener: function addListener(client) {\n // add as client\n clients.push(client);\n\n // return removeListener function\n return function() {\n // remove client\n clients.splice(clients.indexOf(client), 1);\n\n // if no more clients, clean up observer\n if (clients.length === 0) {\n dragNDropObservers.splice(dragNDropObservers.indexOf(observer), 1);\n\n forin(routes, function(event) {\n element.removeEventListener(event, handlers[event], false);\n });\n }\n };\n },\n };\n\n return observer;\n };\n\n var elementFromPoint = function elementFromPoint(root, point) {\n if (!('elementFromPoint' in root)) {\n root = document;\n }\n return root.elementFromPoint(point.x, point.y);\n };\n\n var isEventTarget = function isEventTarget(e, target) {\n // get root\n var root = getRootNode(target);\n\n // get element at position\n // if root is not actual shadow DOM and does not have elementFromPoint method, use the one on document\n var elementAtPosition = elementFromPoint(root, {\n x: e.pageX - window.pageXOffset,\n y: e.pageY - window.pageYOffset,\n });\n\n // test if target is the element or if one of its children is\n return elementAtPosition === target || target.contains(elementAtPosition);\n };\n\n var initialTarget = null;\n\n var setDropEffect = function setDropEffect(dataTransfer, effect) {\n // is in try catch as IE11 will throw error if not\n try {\n dataTransfer.dropEffect = effect;\n } catch (e) {}\n };\n\n var dragenter = function dragenter(root, clients) {\n return function(e) {\n e.preventDefault();\n\n initialTarget = e.target;\n\n clients.forEach(function(client) {\n var element = client.element,\n onenter = client.onenter;\n\n if (isEventTarget(e, element)) {\n client.state = 'enter';\n\n // fire enter event\n onenter(eventPosition(e));\n }\n });\n };\n };\n\n var dragover = function dragover(root, clients) {\n return function(e) {\n e.preventDefault();\n\n var dataTransfer = e.dataTransfer;\n\n requestDataTransferItems(dataTransfer).then(function(items) {\n var overDropTarget = false;\n\n clients.some(function(client) {\n var filterElement = client.filterElement,\n element = client.element,\n onenter = client.onenter,\n onexit = client.onexit,\n ondrag = client.ondrag,\n allowdrop = client.allowdrop;\n\n // by default we can drop\n setDropEffect(dataTransfer, 'copy');\n\n // allow transfer of these items\n var allowsTransfer = allowdrop(items);\n\n // only used when can be dropped on page\n if (!allowsTransfer) {\n setDropEffect(dataTransfer, 'none');\n return;\n }\n\n // targetting this client\n if (isEventTarget(e, element)) {\n overDropTarget = true;\n\n // had no previous state, means we are entering this client\n if (client.state === null) {\n client.state = 'enter';\n onenter(eventPosition(e));\n return;\n }\n\n // now over element (no matter if it allows the drop or not)\n client.state = 'over';\n\n // needs to allow transfer\n if (filterElement && !allowsTransfer) {\n setDropEffect(dataTransfer, 'none');\n return;\n }\n\n // dragging\n ondrag(eventPosition(e));\n } else {\n // should be over an element to drop\n if (filterElement && !overDropTarget) {\n setDropEffect(dataTransfer, 'none');\n }\n\n // might have just left this client?\n if (client.state) {\n client.state = null;\n onexit(eventPosition(e));\n }\n }\n });\n });\n };\n };\n\n var drop = function drop(root, clients) {\n return function(e) {\n e.preventDefault();\n\n var dataTransfer = e.dataTransfer;\n\n requestDataTransferItems(dataTransfer).then(function(items) {\n clients.forEach(function(client) {\n var filterElement = client.filterElement,\n element = client.element,\n ondrop = client.ondrop,\n onexit = client.onexit,\n allowdrop = client.allowdrop;\n\n client.state = null;\n\n // if we're filtering on element we need to be over the element to drop\n if (filterElement && !isEventTarget(e, element)) return;\n\n // no transfer for this client\n if (!allowdrop(items)) return onexit(eventPosition(e));\n\n // we can drop these items on this client\n ondrop(eventPosition(e), items);\n });\n });\n };\n };\n\n var dragleave = function dragleave(root, clients) {\n return function(e) {\n if (initialTarget !== e.target) {\n return;\n }\n\n clients.forEach(function(client) {\n var onexit = client.onexit;\n\n client.state = null;\n\n onexit(eventPosition(e));\n });\n };\n };\n\n var createHopper = function createHopper(scope, validateItems, options) {\n // is now hopper scope\n scope.classList.add('filepond--hopper');\n\n // shortcuts\n var catchesDropsOnPage = options.catchesDropsOnPage,\n requiresDropOnElement = options.requiresDropOnElement,\n _options$filterItems = options.filterItems,\n filterItems =\n _options$filterItems === void 0\n ? function(items) {\n return items;\n }\n : _options$filterItems;\n\n // create a dnd client\n var client = createDragNDropClient(\n scope,\n catchesDropsOnPage ? document.documentElement : scope,\n requiresDropOnElement\n );\n\n // current client state\n var lastState = '';\n var currentState = '';\n\n // determines if a file may be dropped\n client.allowdrop = function(items) {\n // TODO: if we can, throw error to indicate the items cannot by dropped\n\n return validateItems(filterItems(items));\n };\n\n client.ondrop = function(position, items) {\n var filteredItems = filterItems(items);\n\n if (!validateItems(filteredItems)) {\n api.ondragend(position);\n return;\n }\n\n currentState = 'drag-drop';\n\n api.onload(filteredItems, position);\n };\n\n client.ondrag = function(position) {\n api.ondrag(position);\n };\n\n client.onenter = function(position) {\n currentState = 'drag-over';\n\n api.ondragstart(position);\n };\n\n client.onexit = function(position) {\n currentState = 'drag-exit';\n\n api.ondragend(position);\n };\n\n var api = {\n updateHopperState: function updateHopperState() {\n if (lastState !== currentState) {\n scope.dataset.hopperState = currentState;\n lastState = currentState;\n }\n },\n onload: function onload() {},\n ondragstart: function ondragstart() {},\n ondrag: function ondrag() {},\n ondragend: function ondragend() {},\n destroy: function destroy() {\n // destroy client\n client.destroy();\n },\n };\n\n return api;\n };\n\n var listening = false;\n var listeners$1 = [];\n\n var handlePaste = function handlePaste(e) {\n // if is pasting in input or textarea and the target is outside of a filepond scope, ignore\n var activeEl = document.activeElement;\n var isActiveElementEditable =\n activeEl &&\n (/textarea|input/i.test(activeEl.nodeName) ||\n activeEl.getAttribute('contenteditable') === 'true');\n\n if (isActiveElementEditable) {\n // test textarea or input is contained in filepond root\n var inScope = false;\n var element = activeEl;\n while (element !== document.body) {\n if (element.classList.contains('filepond--root')) {\n inScope = true;\n break;\n }\n element = element.parentNode;\n }\n\n if (!inScope) return;\n }\n\n requestDataTransferItems(e.clipboardData).then(function(files) {\n // no files received\n if (!files.length) {\n return;\n }\n\n // notify listeners of received files\n listeners$1.forEach(function(listener) {\n return listener(files);\n });\n });\n };\n\n var listen = function listen(cb) {\n // can't add twice\n if (listeners$1.includes(cb)) {\n return;\n }\n\n // add initial listener\n listeners$1.push(cb);\n\n // setup paste listener for entire page\n if (listening) {\n return;\n }\n\n listening = true;\n document.addEventListener('paste', handlePaste);\n };\n\n var unlisten = function unlisten(listener) {\n arrayRemove(listeners$1, listeners$1.indexOf(listener));\n\n // clean up\n if (listeners$1.length === 0) {\n document.removeEventListener('paste', handlePaste);\n listening = false;\n }\n };\n\n var createPaster = function createPaster() {\n var cb = function cb(files) {\n api.onload(files);\n };\n\n var api = {\n destroy: function destroy() {\n unlisten(cb);\n },\n onload: function onload() {},\n };\n\n listen(cb);\n\n return api;\n };\n\n /**\n * Creates the file view\n */\n var create$d = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n root.element.id = 'filepond--assistant-' + props.id;\n attr(root.element, 'role', 'alert');\n attr(root.element, 'aria-live', 'polite');\n attr(root.element, 'aria-relevant', 'additions');\n };\n\n var addFilesNotificationTimeout = null;\n var notificationClearTimeout = null;\n\n var filenames = [];\n\n var assist = function assist(root, message) {\n root.element.textContent = message;\n };\n\n var clear$1 = function clear(root) {\n root.element.textContent = '';\n };\n\n var listModified = function listModified(root, filename, label) {\n var total = root.query('GET_TOTAL_ITEMS');\n assist(\n root,\n label +\n ' ' +\n filename +\n ', ' +\n total +\n ' ' +\n (total === 1\n ? root.query('GET_LABEL_FILE_COUNT_SINGULAR')\n : root.query('GET_LABEL_FILE_COUNT_PLURAL'))\n );\n\n // clear group after set amount of time so the status is not read twice\n clearTimeout(notificationClearTimeout);\n notificationClearTimeout = setTimeout(function() {\n clear$1(root);\n }, 1500);\n };\n\n var isUsingFilePond = function isUsingFilePond(root) {\n return root.element.parentNode.contains(document.activeElement);\n };\n\n var itemAdded = function itemAdded(_ref2) {\n var root = _ref2.root,\n action = _ref2.action;\n if (!isUsingFilePond(root)) {\n return;\n }\n\n root.element.textContent = '';\n var item = root.query('GET_ITEM', action.id);\n filenames.push(item.filename);\n\n clearTimeout(addFilesNotificationTimeout);\n addFilesNotificationTimeout = setTimeout(function() {\n listModified(root, filenames.join(', '), root.query('GET_LABEL_FILE_ADDED'));\n filenames.length = 0;\n }, 750);\n };\n\n var itemRemoved = function itemRemoved(_ref3) {\n var root = _ref3.root,\n action = _ref3.action;\n if (!isUsingFilePond(root)) {\n return;\n }\n\n var item = action.item;\n listModified(root, item.filename, root.query('GET_LABEL_FILE_REMOVED'));\n };\n\n var itemProcessed = function itemProcessed(_ref4) {\n var root = _ref4.root,\n action = _ref4.action;\n // will also notify the user when FilePond is not being used, as the user might be occupied with other activities while uploading a file\n\n var item = root.query('GET_ITEM', action.id);\n var filename = item.filename;\n var label = root.query('GET_LABEL_FILE_PROCESSING_COMPLETE');\n\n assist(root, filename + ' ' + label);\n };\n\n var itemProcessedUndo = function itemProcessedUndo(_ref5) {\n var root = _ref5.root,\n action = _ref5.action;\n var item = root.query('GET_ITEM', action.id);\n var filename = item.filename;\n var label = root.query('GET_LABEL_FILE_PROCESSING_ABORTED');\n\n assist(root, filename + ' ' + label);\n };\n\n var itemError = function itemError(_ref6) {\n var root = _ref6.root,\n action = _ref6.action;\n var item = root.query('GET_ITEM', action.id);\n var filename = item.filename;\n\n // will also notify the user when FilePond is not being used, as the user might be occupied with other activities while uploading a file\n\n assist(root, action.status.main + ' ' + filename + ' ' + action.status.sub);\n };\n\n var assistant = createView({\n create: create$d,\n ignoreRect: true,\n ignoreRectUpdate: true,\n write: createRoute({\n DID_LOAD_ITEM: itemAdded,\n DID_REMOVE_ITEM: itemRemoved,\n DID_COMPLETE_ITEM_PROCESSING: itemProcessed,\n\n DID_ABORT_ITEM_PROCESSING: itemProcessedUndo,\n DID_REVERT_ITEM_PROCESSING: itemProcessedUndo,\n\n DID_THROW_ITEM_REMOVE_ERROR: itemError,\n DID_THROW_ITEM_LOAD_ERROR: itemError,\n DID_THROW_ITEM_INVALID: itemError,\n DID_THROW_ITEM_PROCESSING_ERROR: itemError,\n }),\n\n tag: 'span',\n name: 'assistant',\n });\n\n var toCamels = function toCamels(string) {\n var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '-';\n return string.replace(new RegExp(separator + '.', 'g'), function(sub) {\n return sub.charAt(1).toUpperCase();\n });\n };\n\n var debounce = function debounce(func) {\n var interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 16;\n var immidiateOnly =\n arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n var last = Date.now();\n var timeout = null;\n\n return function() {\n for (\n var _len = arguments.length, args = new Array(_len), _key = 0;\n _key < _len;\n _key++\n ) {\n args[_key] = arguments[_key];\n }\n clearTimeout(timeout);\n\n var dist = Date.now() - last;\n\n var fn = function fn() {\n last = Date.now();\n func.apply(void 0, args);\n };\n\n if (dist < interval) {\n // we need to delay by the difference between interval and dist\n // for example: if distance is 10 ms and interval is 16 ms,\n // we need to wait an additional 6ms before calling the function)\n if (!immidiateOnly) {\n timeout = setTimeout(fn, interval - dist);\n }\n } else {\n // go!\n fn();\n }\n };\n };\n\n var MAX_FILES_LIMIT = 1000000;\n\n var prevent = function prevent(e) {\n return e.preventDefault();\n };\n\n var create$e = function create(_ref) {\n var root = _ref.root,\n props = _ref.props;\n // Add id\n var id = root.query('GET_ID');\n if (id) {\n root.element.id = id;\n }\n\n // Add className\n var className = root.query('GET_CLASS_NAME');\n if (className) {\n className\n .split(' ')\n .filter(function(name) {\n return name.length;\n })\n .forEach(function(name) {\n root.element.classList.add(name);\n });\n }\n\n // Field label\n root.ref.label = root.appendChildView(\n root.createChildView(\n dropLabel,\n Object.assign({}, props, {\n translateY: null,\n caption: root.query('GET_LABEL_IDLE'),\n })\n )\n );\n\n // List of items\n root.ref.list = root.appendChildView(\n root.createChildView(listScroller, { translateY: null })\n );\n\n // Background panel\n root.ref.panel = root.appendChildView(root.createChildView(panel, { name: 'panel-root' }));\n\n // Assistant notifies assistive tech when content changes\n root.ref.assistant = root.appendChildView(\n root.createChildView(assistant, Object.assign({}, props))\n );\n\n // Data\n root.ref.data = root.appendChildView(root.createChildView(data, Object.assign({}, props)));\n\n // Measure (tests if fixed height was set)\n // DOCTYPE needs to be set for this to work\n root.ref.measure = createElement$1('div');\n root.ref.measure.style.height = '100%';\n root.element.appendChild(root.ref.measure);\n\n // information on the root height or fixed height status\n root.ref.bounds = null;\n\n // apply initial style properties\n root.query('GET_STYLES')\n .filter(function(style) {\n return !isEmpty(style.value);\n })\n .map(function(_ref2) {\n var name = _ref2.name,\n value = _ref2.value;\n root.element.dataset[name] = value;\n });\n\n // determine if width changed\n root.ref.widthPrevious = null;\n root.ref.widthUpdated = debounce(function() {\n root.ref.updateHistory = [];\n root.dispatch('DID_RESIZE_ROOT');\n }, 250);\n\n // history of updates\n root.ref.previousAspectRatio = null;\n root.ref.updateHistory = [];\n\n // prevent scrolling and zooming on iOS (only if supports pointer events, for then we can enable reorder)\n var canHover = window.matchMedia('(pointer: fine) and (hover: hover)').matches;\n var hasPointerEvents = 'PointerEvent' in window;\n if (root.query('GET_ALLOW_REORDER') && hasPointerEvents && !canHover) {\n root.element.addEventListener('touchmove', prevent, { passive: false });\n root.element.addEventListener('gesturestart', prevent);\n }\n\n // add credits\n var credits = root.query('GET_CREDITS');\n var hasCredits = credits.length === 2;\n if (hasCredits) {\n var frag = document.createElement('a');\n frag.className = 'filepond--credits';\n frag.href = credits[0];\n frag.tabIndex = -1;\n frag.target = '_blank';\n frag.rel = 'noopener noreferrer nofollow';\n frag.textContent = credits[1];\n root.element.appendChild(frag);\n root.ref.credits = frag;\n }\n };\n\n var write$9 = function write(_ref3) {\n var root = _ref3.root,\n props = _ref3.props,\n actions = _ref3.actions;\n // route actions\n route$5({ root: root, props: props, actions: actions });\n\n // apply style properties\n actions\n .filter(function(action) {\n return /^DID_SET_STYLE_/.test(action.type);\n })\n .filter(function(action) {\n return !isEmpty(action.data.value);\n })\n .map(function(_ref4) {\n var type = _ref4.type,\n data = _ref4.data;\n var name = toCamels(type.substring(8).toLowerCase(), '_');\n root.element.dataset[name] = data.value;\n root.invalidateLayout();\n });\n\n if (root.rect.element.hidden) return;\n\n if (root.rect.element.width !== root.ref.widthPrevious) {\n root.ref.widthPrevious = root.rect.element.width;\n root.ref.widthUpdated();\n }\n\n // get box bounds, we do this only once\n var bounds = root.ref.bounds;\n if (!bounds) {\n bounds = root.ref.bounds = calculateRootBoundingBoxHeight(root);\n\n // destroy measure element\n root.element.removeChild(root.ref.measure);\n root.ref.measure = null;\n }\n\n // get quick references to various high level parts of the upload tool\n var _root$ref = root.ref,\n hopper = _root$ref.hopper,\n label = _root$ref.label,\n list = _root$ref.list,\n panel = _root$ref.panel;\n\n // sets correct state to hopper scope\n if (hopper) {\n hopper.updateHopperState();\n }\n\n // bool to indicate if we're full or not\n var aspectRatio = root.query('GET_PANEL_ASPECT_RATIO');\n var isMultiItem = root.query('GET_ALLOW_MULTIPLE');\n var totalItems = root.query('GET_TOTAL_ITEMS');\n var maxItems = isMultiItem ? root.query('GET_MAX_FILES') || MAX_FILES_LIMIT : 1;\n var atMaxCapacity = totalItems === maxItems;\n\n // action used to add item\n var addAction = actions.find(function(action) {\n return action.type === 'DID_ADD_ITEM';\n });\n\n // if reached max capacity and we've just reached it\n if (atMaxCapacity && addAction) {\n // get interaction type\n var interactionMethod = addAction.data.interactionMethod;\n\n // hide label\n label.opacity = 0;\n\n if (isMultiItem) {\n label.translateY = -40;\n } else {\n if (interactionMethod === InteractionMethod.API) {\n label.translateX = 40;\n } else if (interactionMethod === InteractionMethod.BROWSE) {\n label.translateY = 40;\n } else {\n label.translateY = 30;\n }\n }\n } else if (!atMaxCapacity) {\n label.opacity = 1;\n label.translateX = 0;\n label.translateY = 0;\n }\n\n var listItemMargin = calculateListItemMargin(root);\n\n var listHeight = calculateListHeight(root);\n\n var labelHeight = label.rect.element.height;\n var currentLabelHeight = !isMultiItem || atMaxCapacity ? 0 : labelHeight;\n\n var listMarginTop = atMaxCapacity ? list.rect.element.marginTop : 0;\n var listMarginBottom = totalItems === 0 ? 0 : list.rect.element.marginBottom;\n\n var visualHeight =\n currentLabelHeight + listMarginTop + listHeight.visual + listMarginBottom;\n var boundsHeight =\n currentLabelHeight + listMarginTop + listHeight.bounds + listMarginBottom;\n\n // link list to label bottom position\n list.translateY =\n Math.max(0, currentLabelHeight - list.rect.element.marginTop) - listItemMargin.top;\n\n if (aspectRatio) {\n // fixed aspect ratio\n\n // calculate height based on width\n var width = root.rect.element.width;\n var height = width * aspectRatio;\n\n // clear history if aspect ratio has changed\n if (aspectRatio !== root.ref.previousAspectRatio) {\n root.ref.previousAspectRatio = aspectRatio;\n root.ref.updateHistory = [];\n }\n\n // remember this width\n var history = root.ref.updateHistory;\n history.push(width);\n\n var MAX_BOUNCES = 2;\n if (history.length > MAX_BOUNCES * 2) {\n var l = history.length;\n var bottom = l - 10;\n var bounces = 0;\n for (var i = l; i >= bottom; i--) {\n if (history[i] === history[i - 2]) {\n bounces++;\n }\n\n if (bounces >= MAX_BOUNCES) {\n // dont adjust height\n return;\n }\n }\n }\n\n // fix height of panel so it adheres to aspect ratio\n panel.scalable = false;\n panel.height = height;\n\n // available height for list\n var listAvailableHeight =\n // the height of the panel minus the label height\n height -\n currentLabelHeight -\n // the room we leave open between the end of the list and the panel bottom\n (listMarginBottom - listItemMargin.bottom) -\n // if we're full we need to leave some room between the top of the panel and the list\n (atMaxCapacity ? listMarginTop : 0);\n\n if (listHeight.visual > listAvailableHeight) {\n list.overflow = listAvailableHeight;\n } else {\n list.overflow = null;\n }\n\n // set container bounds (so pushes siblings downwards)\n root.height = height;\n } else if (bounds.fixedHeight) {\n // fixed height\n\n // fix height of panel\n panel.scalable = false;\n\n // available height for list\n var _listAvailableHeight =\n // the height of the panel minus the label height\n bounds.fixedHeight -\n currentLabelHeight -\n // the room we leave open between the end of the list and the panel bottom\n (listMarginBottom - listItemMargin.bottom) -\n // if we're full we need to leave some room between the top of the panel and the list\n (atMaxCapacity ? listMarginTop : 0);\n\n // set list height\n if (listHeight.visual > _listAvailableHeight) {\n list.overflow = _listAvailableHeight;\n } else {\n list.overflow = null;\n }\n\n // no need to set container bounds as these are handles by CSS fixed height\n } else if (bounds.cappedHeight) {\n // max-height\n\n // not a fixed height panel\n var isCappedHeight = visualHeight >= bounds.cappedHeight;\n var panelHeight = Math.min(bounds.cappedHeight, visualHeight);\n panel.scalable = true;\n panel.height = isCappedHeight\n ? panelHeight\n : panelHeight - listItemMargin.top - listItemMargin.bottom;\n\n // available height for list\n var _listAvailableHeight2 =\n // the height of the panel minus the label height\n panelHeight -\n currentLabelHeight -\n // the room we leave open between the end of the list and the panel bottom\n (listMarginBottom - listItemMargin.bottom) -\n // if we're full we need to leave some room between the top of the panel and the list\n (atMaxCapacity ? listMarginTop : 0);\n\n // set list height (if is overflowing)\n if (visualHeight > bounds.cappedHeight && listHeight.visual > _listAvailableHeight2) {\n list.overflow = _listAvailableHeight2;\n } else {\n list.overflow = null;\n }\n\n // set container bounds (so pushes siblings downwards)\n root.height = Math.min(\n bounds.cappedHeight,\n boundsHeight - listItemMargin.top - listItemMargin.bottom\n );\n } else {\n // flexible height\n\n // not a fixed height panel\n var itemMargin = totalItems > 0 ? listItemMargin.top + listItemMargin.bottom : 0;\n panel.scalable = true;\n panel.height = Math.max(labelHeight, visualHeight - itemMargin);\n\n // set container bounds (so pushes siblings downwards)\n root.height = Math.max(labelHeight, boundsHeight - itemMargin);\n }\n\n // move credits to bottom\n if (root.ref.credits && panel.heightCurrent)\n root.ref.credits.style.transform = 'translateY(' + panel.heightCurrent + 'px)';\n };\n\n var calculateListItemMargin = function calculateListItemMargin(root) {\n var item = root.ref.list.childViews[0].childViews[0];\n return item\n ? {\n top: item.rect.element.marginTop,\n bottom: item.rect.element.marginBottom,\n }\n : {\n top: 0,\n bottom: 0,\n };\n };\n\n var calculateListHeight = function calculateListHeight(root) {\n var visual = 0;\n var bounds = 0;\n\n // get file list reference\n var scrollList = root.ref.list;\n var itemList = scrollList.childViews[0];\n var visibleChildren = itemList.childViews.filter(function(child) {\n return child.rect.element.height;\n });\n var children = root\n .query('GET_ACTIVE_ITEMS')\n .map(function(item) {\n return visibleChildren.find(function(child) {\n return child.id === item.id;\n });\n })\n .filter(function(item) {\n return item;\n });\n\n // no children, done!\n if (children.length === 0) return { visual: visual, bounds: bounds };\n\n var horizontalSpace = itemList.rect.element.width;\n var dragIndex = getItemIndexByPosition(itemList, children, scrollList.dragCoordinates);\n\n var childRect = children[0].rect.element;\n\n var itemVerticalMargin = childRect.marginTop + childRect.marginBottom;\n var itemHorizontalMargin = childRect.marginLeft + childRect.marginRight;\n\n var itemWidth = childRect.width + itemHorizontalMargin;\n var itemHeight = childRect.height + itemVerticalMargin;\n\n var newItem = typeof dragIndex !== 'undefined' && dragIndex >= 0 ? 1 : 0;\n var removedItem = children.find(function(child) {\n return child.markedForRemoval && child.opacity < 0.45;\n })\n ? -1\n : 0;\n var verticalItemCount = children.length + newItem + removedItem;\n var itemsPerRow = getItemsPerRow(horizontalSpace, itemWidth);\n\n // stack\n if (itemsPerRow === 1) {\n children.forEach(function(item) {\n var height = item.rect.element.height + itemVerticalMargin;\n bounds += height;\n visual += height * item.opacity;\n });\n }\n // grid\n else {\n bounds = Math.ceil(verticalItemCount / itemsPerRow) * itemHeight;\n visual = bounds;\n }\n\n return { visual: visual, bounds: bounds };\n };\n\n var calculateRootBoundingBoxHeight = function calculateRootBoundingBoxHeight(root) {\n var height = root.ref.measureHeight || null;\n var cappedHeight = parseInt(root.style.maxHeight, 10) || null;\n var fixedHeight = height === 0 ? null : height;\n\n return {\n cappedHeight: cappedHeight,\n fixedHeight: fixedHeight,\n };\n };\n\n var exceedsMaxFiles = function exceedsMaxFiles(root, items) {\n var allowReplace = root.query('GET_ALLOW_REPLACE');\n var allowMultiple = root.query('GET_ALLOW_MULTIPLE');\n var totalItems = root.query('GET_TOTAL_ITEMS');\n var maxItems = root.query('GET_MAX_FILES');\n\n // total amount of items being dragged\n var totalBrowseItems = items.length;\n\n // if does not allow multiple items and dragging more than one item\n if (!allowMultiple && totalBrowseItems > 1) {\n root.dispatch('DID_THROW_MAX_FILES', {\n source: items,\n error: createResponse('warning', 0, 'Max files'),\n });\n\n return true;\n }\n\n // limit max items to one if not allowed to drop multiple items\n maxItems = allowMultiple ? maxItems : 1;\n\n if (!allowMultiple && allowReplace) {\n // There is only one item, so there is room to replace or add an item\n return false;\n }\n\n // no more room?\n var hasMaxItems = isInt(maxItems);\n if (hasMaxItems && totalItems + totalBrowseItems > maxItems) {\n root.dispatch('DID_THROW_MAX_FILES', {\n source: items,\n error: createResponse('warning', 0, 'Max files'),\n });\n\n return true;\n }\n\n return false;\n };\n\n var getDragIndex = function getDragIndex(list, children, position) {\n var itemList = list.childViews[0];\n return getItemIndexByPosition(itemList, children, {\n left: position.scopeLeft - itemList.rect.element.left,\n top:\n position.scopeTop -\n (list.rect.outer.top + list.rect.element.marginTop + list.rect.element.scrollTop),\n });\n };\n\n /**\n * Enable or disable file drop functionality\n */\n var toggleDrop = function toggleDrop(root) {\n var isAllowed = root.query('GET_ALLOW_DROP');\n var isDisabled = root.query('GET_DISABLED');\n var enabled = isAllowed && !isDisabled;\n if (enabled && !root.ref.hopper) {\n var hopper = createHopper(\n root.element,\n function(items) {\n // allow quick validation of dropped items\n var beforeDropFile =\n root.query('GET_BEFORE_DROP_FILE') ||\n function() {\n return true;\n };\n\n // all items should be validated by all filters as valid\n var dropValidation = root.query('GET_DROP_VALIDATION');\n return dropValidation\n ? items.every(function(item) {\n return (\n applyFilters('ALLOW_HOPPER_ITEM', item, {\n query: root.query,\n }).every(function(result) {\n return result === true;\n }) && beforeDropFile(item)\n );\n })\n : true;\n },\n {\n filterItems: function filterItems(items) {\n var ignoredFiles = root.query('GET_IGNORED_FILES');\n return items.filter(function(item) {\n if (isFile(item)) {\n return !ignoredFiles.includes(item.name.toLowerCase());\n }\n return true;\n });\n },\n catchesDropsOnPage: root.query('GET_DROP_ON_PAGE'),\n requiresDropOnElement: root.query('GET_DROP_ON_ELEMENT'),\n }\n );\n\n hopper.onload = function(items, position) {\n // get item children elements and sort based on list sort\n var list = root.ref.list.childViews[0];\n var visibleChildren = list.childViews.filter(function(child) {\n return child.rect.element.height;\n });\n var children = root\n .query('GET_ACTIVE_ITEMS')\n .map(function(item) {\n return visibleChildren.find(function(child) {\n return child.id === item.id;\n });\n })\n .filter(function(item) {\n return item;\n });\n\n applyFilterChain('ADD_ITEMS', items, { dispatch: root.dispatch }).then(function(\n queue\n ) {\n // these files don't fit so stop here\n if (exceedsMaxFiles(root, queue)) return false;\n\n // go\n root.dispatch('ADD_ITEMS', {\n items: queue,\n index: getDragIndex(root.ref.list, children, position),\n interactionMethod: InteractionMethod.DROP,\n });\n });\n\n root.dispatch('DID_DROP', { position: position });\n\n root.dispatch('DID_END_DRAG', { position: position });\n };\n\n hopper.ondragstart = function(position) {\n root.dispatch('DID_START_DRAG', { position: position });\n };\n\n hopper.ondrag = debounce(function(position) {\n root.dispatch('DID_DRAG', { position: position });\n });\n\n hopper.ondragend = function(position) {\n root.dispatch('DID_END_DRAG', { position: position });\n };\n\n root.ref.hopper = hopper;\n\n root.ref.drip = root.appendChildView(root.createChildView(drip));\n } else if (!enabled && root.ref.hopper) {\n root.ref.hopper.destroy();\n root.ref.hopper = null;\n root.removeChildView(root.ref.drip);\n }\n };\n\n /**\n * Enable or disable browse functionality\n */\n var toggleBrowse = function toggleBrowse(root, props) {\n var isAllowed = root.query('GET_ALLOW_BROWSE');\n var isDisabled = root.query('GET_DISABLED');\n var enabled = isAllowed && !isDisabled;\n if (enabled && !root.ref.browser) {\n root.ref.browser = root.appendChildView(\n root.createChildView(\n browser,\n Object.assign({}, props, {\n onload: function onload(items) {\n applyFilterChain('ADD_ITEMS', items, {\n dispatch: root.dispatch,\n }).then(function(queue) {\n // these files don't fit so stop here\n if (exceedsMaxFiles(root, queue)) return false;\n\n // add items!\n root.dispatch('ADD_ITEMS', {\n items: queue,\n index: -1,\n interactionMethod: InteractionMethod.BROWSE,\n });\n });\n },\n })\n ),\n\n 0\n );\n } else if (!enabled && root.ref.browser) {\n root.removeChildView(root.ref.browser);\n root.ref.browser = null;\n }\n };\n\n /**\n * Enable or disable paste functionality\n */\n var togglePaste = function togglePaste(root) {\n var isAllowed = root.query('GET_ALLOW_PASTE');\n var isDisabled = root.query('GET_DISABLED');\n var enabled = isAllowed && !isDisabled;\n if (enabled && !root.ref.paster) {\n root.ref.paster = createPaster();\n root.ref.paster.onload = function(items) {\n applyFilterChain('ADD_ITEMS', items, { dispatch: root.dispatch }).then(function(\n queue\n ) {\n // these files don't fit so stop here\n if (exceedsMaxFiles(root, queue)) return false;\n\n // add items!\n root.dispatch('ADD_ITEMS', {\n items: queue,\n index: -1,\n interactionMethod: InteractionMethod.PASTE,\n });\n });\n };\n } else if (!enabled && root.ref.paster) {\n root.ref.paster.destroy();\n root.ref.paster = null;\n }\n };\n\n /**\n * Route actions\n */\n var route$5 = createRoute({\n DID_SET_ALLOW_BROWSE: function DID_SET_ALLOW_BROWSE(_ref5) {\n var root = _ref5.root,\n props = _ref5.props;\n toggleBrowse(root, props);\n },\n DID_SET_ALLOW_DROP: function DID_SET_ALLOW_DROP(_ref6) {\n var root = _ref6.root;\n toggleDrop(root);\n },\n DID_SET_ALLOW_PASTE: function DID_SET_ALLOW_PASTE(_ref7) {\n var root = _ref7.root;\n togglePaste(root);\n },\n DID_SET_DISABLED: function DID_SET_DISABLED(_ref8) {\n var root = _ref8.root,\n props = _ref8.props;\n toggleDrop(root);\n togglePaste(root);\n toggleBrowse(root, props);\n var isDisabled = root.query('GET_DISABLED');\n if (isDisabled) {\n root.element.dataset.disabled = 'disabled';\n } else {\n // delete root.element.dataset.disabled; <= this does not work on iOS 10\n root.element.removeAttribute('data-disabled');\n }\n },\n });\n\n var root = createView({\n name: 'root',\n read: function read(_ref9) {\n var root = _ref9.root;\n if (root.ref.measure) {\n root.ref.measureHeight = root.ref.measure.offsetHeight;\n }\n },\n create: create$e,\n write: write$9,\n destroy: function destroy(_ref10) {\n var root = _ref10.root;\n if (root.ref.paster) {\n root.ref.paster.destroy();\n }\n if (root.ref.hopper) {\n root.ref.hopper.destroy();\n }\n root.element.removeEventListener('touchmove', prevent);\n root.element.removeEventListener('gesturestart', prevent);\n },\n mixins: {\n styles: ['height'],\n },\n });\n\n // creates the app\n var createApp = function createApp() {\n var initialOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // let element\n var originalElement = null;\n\n // get default options\n var defaultOptions = getOptions();\n\n // create the data store, this will contain all our app info\n var store = createStore(\n // initial state (should be serializable)\n createInitialState(defaultOptions),\n\n // queries\n [queries, createOptionQueries(defaultOptions)],\n\n // action handlers\n [actions, createOptionActions(defaultOptions)]\n );\n\n // set initial options\n store.dispatch('SET_OPTIONS', { options: initialOptions });\n\n // kick thread if visibility changes\n var visibilityHandler = function visibilityHandler() {\n if (document.hidden) return;\n store.dispatch('KICK');\n };\n document.addEventListener('visibilitychange', visibilityHandler);\n\n // re-render on window resize start and finish\n var resizeDoneTimer = null;\n var isResizing = false;\n var isResizingHorizontally = false;\n var initialWindowWidth = null;\n var currentWindowWidth = null;\n var resizeHandler = function resizeHandler() {\n if (!isResizing) {\n isResizing = true;\n }\n clearTimeout(resizeDoneTimer);\n resizeDoneTimer = setTimeout(function() {\n isResizing = false;\n initialWindowWidth = null;\n currentWindowWidth = null;\n if (isResizingHorizontally) {\n isResizingHorizontally = false;\n store.dispatch('DID_STOP_RESIZE');\n }\n }, 500);\n };\n window.addEventListener('resize', resizeHandler);\n\n // render initial view\n var view = root(store, { id: getUniqueId() });\n\n //\n // PRIVATE API -------------------------------------------------------------------------------------\n //\n var isResting = false;\n var isHidden = false;\n\n var readWriteApi = {\n // necessary for update loop\n\n /**\n * Reads from dom (never call manually)\n * @private\n */\n _read: function _read() {\n // test if we're resizing horizontally\n // TODO: see if we can optimize this by measuring root rect\n if (isResizing) {\n currentWindowWidth = window.innerWidth;\n if (!initialWindowWidth) {\n initialWindowWidth = currentWindowWidth;\n }\n\n if (!isResizingHorizontally && currentWindowWidth !== initialWindowWidth) {\n store.dispatch('DID_START_RESIZE');\n isResizingHorizontally = true;\n }\n }\n\n if (isHidden && isResting) {\n // test if is no longer hidden\n isResting = view.element.offsetParent === null;\n }\n\n // if resting, no need to read as numbers will still all be correct\n if (isResting) return;\n\n // read view data\n view._read();\n\n // if is hidden we need to know so we exit rest mode when revealed\n isHidden = view.rect.element.hidden;\n },\n\n /**\n * Writes to dom (never call manually)\n * @private\n */\n _write: function _write(ts) {\n // get all actions from store\n var actions = store\n .processActionQueue()\n\n // filter out set actions (these will automatically trigger DID_SET)\n .filter(function(action) {\n return !/^SET_/.test(action.type);\n });\n\n // if was idling and no actions stop here\n if (isResting && !actions.length) return;\n\n // some actions might trigger events\n routeActionsToEvents(actions);\n\n // update the view\n isResting = view._write(ts, actions, isResizingHorizontally);\n\n // will clean up all archived items\n removeReleasedItems(store.query('GET_ITEMS'));\n\n // now idling\n if (isResting) {\n store.processDispatchQueue();\n }\n },\n };\n\n //\n // EXPOSE EVENTS -------------------------------------------------------------------------------------\n //\n var createEvent = function createEvent(name) {\n return function(data) {\n // create default event\n var event = {\n type: name,\n };\n\n // no data to add\n if (!data) {\n return event;\n }\n\n // copy relevant props\n if (data.hasOwnProperty('error')) {\n event.error = data.error ? Object.assign({}, data.error) : null;\n }\n\n if (data.status) {\n event.status = Object.assign({}, data.status);\n }\n\n if (data.file) {\n event.output = data.file;\n }\n\n // only source is available, else add item if possible\n if (data.source) {\n event.file = data.source;\n } else if (data.item || data.id) {\n var item = data.item ? data.item : store.query('GET_ITEM', data.id);\n event.file = item ? createItemAPI(item) : null;\n }\n\n // map all items in a possible items array\n if (data.items) {\n event.items = data.items.map(createItemAPI);\n }\n\n // if this is a progress event add the progress amount\n if (/progress/.test(name)) {\n event.progress = data.progress;\n }\n\n // copy relevant props\n if (data.hasOwnProperty('origin') && data.hasOwnProperty('target')) {\n event.origin = data.origin;\n event.target = data.target;\n }\n\n return event;\n };\n };\n\n var eventRoutes = {\n DID_DESTROY: createEvent('destroy'),\n\n DID_INIT: createEvent('init'),\n\n DID_THROW_MAX_FILES: createEvent('warning'),\n\n DID_INIT_ITEM: createEvent('initfile'),\n DID_START_ITEM_LOAD: createEvent('addfilestart'),\n DID_UPDATE_ITEM_LOAD_PROGRESS: createEvent('addfileprogress'),\n DID_LOAD_ITEM: createEvent('addfile'),\n\n DID_THROW_ITEM_INVALID: [createEvent('error'), createEvent('addfile')],\n\n DID_THROW_ITEM_LOAD_ERROR: [createEvent('error'), createEvent('addfile')],\n\n DID_THROW_ITEM_REMOVE_ERROR: [createEvent('error'), createEvent('removefile')],\n\n DID_PREPARE_OUTPUT: createEvent('preparefile'),\n\n DID_START_ITEM_PROCESSING: createEvent('processfilestart'),\n DID_UPDATE_ITEM_PROCESS_PROGRESS: createEvent('processfileprogress'),\n DID_ABORT_ITEM_PROCESSING: createEvent('processfileabort'),\n DID_COMPLETE_ITEM_PROCESSING: createEvent('processfile'),\n DID_COMPLETE_ITEM_PROCESSING_ALL: createEvent('processfiles'),\n DID_REVERT_ITEM_PROCESSING: createEvent('processfilerevert'),\n\n DID_THROW_ITEM_PROCESSING_ERROR: [createEvent('error'), createEvent('processfile')],\n\n DID_REMOVE_ITEM: createEvent('removefile'),\n\n DID_UPDATE_ITEMS: createEvent('updatefiles'),\n\n DID_ACTIVATE_ITEM: createEvent('activatefile'),\n\n DID_REORDER_ITEMS: createEvent('reorderfiles'),\n };\n\n var exposeEvent = function exposeEvent(event) {\n // create event object to be dispatched\n var detail = Object.assign({ pond: exports }, event);\n delete detail.type;\n view.element.dispatchEvent(\n new CustomEvent('FilePond:' + event.type, {\n // event info\n detail: detail,\n\n // event behaviour\n bubbles: true,\n cancelable: true,\n composed: true, // triggers listeners outside of shadow root\n })\n );\n\n // event object to params used for `on()` event handlers and callbacks `oninit()`\n var params = [];\n\n // if is possible error event, make it the first param\n if (event.hasOwnProperty('error')) {\n params.push(event.error);\n }\n\n // file is always section\n if (event.hasOwnProperty('file')) {\n params.push(event.file);\n }\n\n // append other props\n var filtered = ['type', 'error', 'file'];\n Object.keys(event)\n .filter(function(key) {\n return !filtered.includes(key);\n })\n .forEach(function(key) {\n return params.push(event[key]);\n });\n\n // on(type, () => { })\n exports.fire.apply(exports, [event.type].concat(params));\n\n // oninit = () => {}\n var handler = store.query('GET_ON' + event.type.toUpperCase());\n if (handler) {\n handler.apply(void 0, params);\n }\n };\n\n var routeActionsToEvents = function routeActionsToEvents(actions) {\n if (!actions.length) return;\n actions\n .filter(function(action) {\n return eventRoutes[action.type];\n })\n .forEach(function(action) {\n var routes = eventRoutes[action.type];\n (Array.isArray(routes) ? routes : [routes]).forEach(function(route) {\n // this isn't fantastic, but because of the stacking of settimeouts plugins can handle the did_load before the did_init\n if (action.type === 'DID_INIT_ITEM') {\n exposeEvent(route(action.data));\n } else {\n setTimeout(function() {\n exposeEvent(route(action.data));\n }, 0);\n }\n });\n });\n };\n\n //\n // PUBLIC API -------------------------------------------------------------------------------------\n //\n var setOptions = function setOptions(options) {\n return store.dispatch('SET_OPTIONS', { options: options });\n };\n\n var getFile = function getFile(query) {\n return store.query('GET_ACTIVE_ITEM', query);\n };\n\n var prepareFile = function prepareFile(query) {\n return new Promise(function(resolve, reject) {\n store.dispatch('REQUEST_ITEM_PREPARE', {\n query: query,\n success: function success(item) {\n resolve(item);\n },\n failure: function failure(error) {\n reject(error);\n },\n });\n });\n };\n\n var addFile = function addFile(source) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n return new Promise(function(resolve, reject) {\n addFiles([{ source: source, options: options }], { index: options.index })\n .then(function(items) {\n return resolve(items && items[0]);\n })\n .catch(reject);\n });\n };\n\n var isFilePondFile = function isFilePondFile(obj) {\n return obj.file && obj.id;\n };\n\n var removeFile = function removeFile(query, options) {\n // if only passed options\n if (typeof query === 'object' && !isFilePondFile(query) && !options) {\n options = query;\n query = undefined;\n }\n\n // request item removal\n store.dispatch('REMOVE_ITEM', Object.assign({}, options, { query: query }));\n\n // see if item has been removed\n return store.query('GET_ACTIVE_ITEM', query) === null;\n };\n\n var addFiles = function addFiles() {\n for (\n var _len = arguments.length, args = new Array(_len), _key = 0;\n _key < _len;\n _key++\n ) {\n args[_key] = arguments[_key];\n }\n return new Promise(function(resolve, reject) {\n var sources = [];\n var options = {};\n\n // user passed a sources array\n if (isArray(args[0])) {\n sources.push.apply(sources, args[0]);\n Object.assign(options, args[1] || {});\n } else {\n // user passed sources as arguments, last one might be options object\n var lastArgument = args[args.length - 1];\n if (typeof lastArgument === 'object' && !(lastArgument instanceof Blob)) {\n Object.assign(options, args.pop());\n }\n\n // add rest to sources\n sources.push.apply(sources, args);\n }\n\n store.dispatch('ADD_ITEMS', {\n items: sources,\n index: options.index,\n interactionMethod: InteractionMethod.API,\n success: resolve,\n failure: reject,\n });\n });\n };\n\n var getFiles = function getFiles() {\n return store.query('GET_ACTIVE_ITEMS');\n };\n\n var processFile = function processFile(query) {\n return new Promise(function(resolve, reject) {\n store.dispatch('REQUEST_ITEM_PROCESSING', {\n query: query,\n success: function success(item) {\n resolve(item);\n },\n failure: function failure(error) {\n reject(error);\n },\n });\n });\n };\n\n var prepareFiles = function prepareFiles() {\n for (\n var _len2 = arguments.length, args = new Array(_len2), _key2 = 0;\n _key2 < _len2;\n _key2++\n ) {\n args[_key2] = arguments[_key2];\n }\n var queries = Array.isArray(args[0]) ? args[0] : args;\n var items = queries.length ? queries : getFiles();\n return Promise.all(items.map(prepareFile));\n };\n\n var processFiles = function processFiles() {\n for (\n var _len3 = arguments.length, args = new Array(_len3), _key3 = 0;\n _key3 < _len3;\n _key3++\n ) {\n args[_key3] = arguments[_key3];\n }\n var queries = Array.isArray(args[0]) ? args[0] : args;\n if (!queries.length) {\n var files = getFiles().filter(function(item) {\n return (\n !(item.status === ItemStatus.IDLE && item.origin === FileOrigin.LOCAL) &&\n item.status !== ItemStatus.PROCESSING &&\n item.status !== ItemStatus.PROCESSING_COMPLETE &&\n item.status !== ItemStatus.PROCESSING_REVERT_ERROR\n );\n });\n\n return Promise.all(files.map(processFile));\n }\n return Promise.all(queries.map(processFile));\n };\n\n var removeFiles = function removeFiles() {\n for (\n var _len4 = arguments.length, args = new Array(_len4), _key4 = 0;\n _key4 < _len4;\n _key4++\n ) {\n args[_key4] = arguments[_key4];\n }\n\n var queries = Array.isArray(args[0]) ? args[0] : args;\n\n var options;\n if (typeof queries[queries.length - 1] === 'object') {\n options = queries.pop();\n } else if (Array.isArray(args[0])) {\n options = args[1];\n }\n\n var files = getFiles();\n\n if (!queries.length)\n return Promise.all(\n files.map(function(file) {\n return removeFile(file, options);\n })\n );\n\n // when removing by index the indexes shift after each file removal so we need to convert indexes to ids\n var mappedQueries = queries\n .map(function(query) {\n return isNumber(query) ? (files[query] ? files[query].id : null) : query;\n })\n .filter(function(query) {\n return query;\n });\n\n return mappedQueries.map(function(q) {\n return removeFile(q, options);\n });\n };\n\n var exports = Object.assign(\n {},\n\n on(),\n {},\n\n readWriteApi,\n {},\n\n createOptionAPI(store, defaultOptions),\n {\n /**\n * Override options defined in options object\n * @param options\n */\n setOptions: setOptions,\n\n /**\n * Load the given file\n * @param source - the source of the file (either a File, base64 data uri or url)\n * @param options - object, { index: 0 }\n */\n addFile: addFile,\n\n /**\n * Load the given files\n * @param sources - the sources of the files to load\n * @param options - object, { index: 0 }\n */\n addFiles: addFiles,\n\n /**\n * Returns the file objects matching the given query\n * @param query { string, number, null }\n */\n getFile: getFile,\n\n /**\n * Upload file with given name\n * @param query { string, number, null }\n */\n processFile: processFile,\n\n /**\n * Request prepare output for file with given name\n * @param query { string, number, null }\n */\n prepareFile: prepareFile,\n\n /**\n * Removes a file by its name\n * @param query { string, number, null }\n */\n removeFile: removeFile,\n\n /**\n * Moves a file to a new location in the files list\n */\n moveFile: function moveFile(query, index) {\n return store.dispatch('MOVE_ITEM', { query: query, index: index });\n },\n\n /**\n * Returns all files (wrapped in public api)\n */\n getFiles: getFiles,\n\n /**\n * Starts uploading all files\n */\n processFiles: processFiles,\n\n /**\n * Clears all files from the files list\n */\n removeFiles: removeFiles,\n\n /**\n * Starts preparing output of all files\n */\n prepareFiles: prepareFiles,\n\n /**\n * Sort list of files\n */\n sort: function sort(compare) {\n return store.dispatch('SORT', { compare: compare });\n },\n\n /**\n * Browse the file system for a file\n */\n browse: function browse() {\n // needs to be trigger directly as user action needs to be traceable (is not traceable in requestAnimationFrame)\n var input = view.element.querySelector('input[type=file]');\n if (input) {\n input.click();\n }\n },\n\n /**\n * Destroys the app\n */\n destroy: function destroy() {\n // request destruction\n exports.fire('destroy', view.element);\n\n // stop active processes (file uploads, fetches, stuff like that)\n // loop over items and depending on states call abort for ongoing processes\n store.dispatch('ABORT_ALL');\n\n // destroy view\n view._destroy();\n\n // stop listening to resize\n window.removeEventListener('resize', resizeHandler);\n\n // stop listening to the visiblitychange event\n document.removeEventListener('visibilitychange', visibilityHandler);\n\n // dispatch destroy\n store.dispatch('DID_DESTROY');\n },\n\n /**\n * Inserts the plugin before the target element\n */\n insertBefore: function insertBefore$1(element) {\n return insertBefore(view.element, element);\n },\n\n /**\n * Inserts the plugin after the target element\n */\n insertAfter: function insertAfter$1(element) {\n return insertAfter(view.element, element);\n },\n\n /**\n * Appends the plugin to the target element\n */\n appendTo: function appendTo(element) {\n return element.appendChild(view.element);\n },\n\n /**\n * Replaces an element with the app\n */\n replaceElement: function replaceElement(element) {\n // insert the app before the element\n insertBefore(view.element, element);\n\n // remove the original element\n element.parentNode.removeChild(element);\n\n // remember original element\n originalElement = element;\n },\n\n /**\n * Restores the original element\n */\n restoreElement: function restoreElement() {\n if (!originalElement) {\n return; // no element to restore\n }\n\n // restore original element\n insertAfter(originalElement, view.element);\n\n // remove our element\n view.element.parentNode.removeChild(view.element);\n\n // remove reference\n originalElement = null;\n },\n\n /**\n * Returns true if the app root is attached to given element\n * @param element\n */\n isAttachedTo: function isAttachedTo(element) {\n return view.element === element || originalElement === element;\n },\n\n /**\n * Returns the root element\n */\n element: {\n get: function get() {\n return view.element;\n },\n },\n\n /**\n * Returns the current pond status\n */\n status: {\n get: function get() {\n return store.query('GET_STATUS');\n },\n },\n }\n );\n\n // Done!\n store.dispatch('DID_INIT');\n\n // create actual api object\n return createObject(exports);\n };\n\n var createAppObject = function createAppObject() {\n var customOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n // default options\n var defaultOptions = {};\n forin(getOptions(), function(key, value) {\n defaultOptions[key] = value[0];\n });\n\n // set app options\n var app = createApp(\n Object.assign(\n {},\n\n defaultOptions,\n {},\n\n customOptions\n )\n );\n\n // return the plugin instance\n return app;\n };\n\n var lowerCaseFirstLetter = function lowerCaseFirstLetter(string) {\n return string.charAt(0).toLowerCase() + string.slice(1);\n };\n\n var attributeNameToPropertyName = function attributeNameToPropertyName(attributeName) {\n return toCamels(attributeName.replace(/^data-/, ''));\n };\n\n var mapObject = function mapObject(object, propertyMap) {\n // remove unwanted\n forin(propertyMap, function(selector, mapping) {\n forin(object, function(property, value) {\n // create regexp shortcut\n var selectorRegExp = new RegExp(selector);\n\n // tests if\n var matches = selectorRegExp.test(property);\n\n // no match, skip\n if (!matches) {\n return;\n }\n\n // if there's a mapping, the original property is always removed\n delete object[property];\n\n // should only remove, we done!\n if (mapping === false) {\n return;\n }\n\n // move value to new property\n if (isString(mapping)) {\n object[mapping] = value;\n return;\n }\n\n // move to group\n var group = mapping.group;\n if (isObject(mapping) && !object[group]) {\n object[group] = {};\n }\n\n object[group][lowerCaseFirstLetter(property.replace(selectorRegExp, ''))] = value;\n });\n\n // do submapping\n if (mapping.mapping) {\n mapObject(object[mapping.group], mapping.mapping);\n }\n });\n };\n\n var getAttributesAsObject = function getAttributesAsObject(node) {\n var attributeMapping =\n arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n // turn attributes into object\n var attributes = [];\n forin(node.attributes, function(index) {\n attributes.push(node.attributes[index]);\n });\n\n var output = attributes\n .filter(function(attribute) {\n return attribute.name;\n })\n .reduce(function(obj, attribute) {\n var value = attr(node, attribute.name);\n\n obj[attributeNameToPropertyName(attribute.name)] =\n value === attribute.name ? true : value;\n return obj;\n }, {});\n\n // do mapping of object properties\n mapObject(output, attributeMapping);\n\n return output;\n };\n\n var createAppAtElement = function createAppAtElement(element) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n // how attributes of the input element are mapped to the options for the plugin\n var attributeMapping = {\n // translate to other name\n '^class$': 'className',\n '^multiple$': 'allowMultiple',\n '^capture$': 'captureMethod',\n '^webkitdirectory$': 'allowDirectoriesOnly',\n\n // group under single property\n '^server': {\n group: 'server',\n mapping: {\n '^process': {\n group: 'process',\n },\n\n '^revert': {\n group: 'revert',\n },\n\n '^fetch': {\n group: 'fetch',\n },\n\n '^restore': {\n group: 'restore',\n },\n\n '^load': {\n group: 'load',\n },\n },\n },\n\n // don't include in object\n '^type$': false,\n '^files$': false,\n };\n\n // add additional option translators\n applyFilters('SET_ATTRIBUTE_TO_OPTION_MAP', attributeMapping);\n\n // create final options object by setting options object and then overriding options supplied on element\n var mergedOptions = Object.assign({}, options);\n\n var attributeOptions = getAttributesAsObject(\n element.nodeName === 'FIELDSET' ? element.querySelector('input[type=file]') : element,\n attributeMapping\n );\n\n // merge with options object\n Object.keys(attributeOptions).forEach(function(key) {\n if (isObject(attributeOptions[key])) {\n if (!isObject(mergedOptions[key])) {\n mergedOptions[key] = {};\n }\n Object.assign(mergedOptions[key], attributeOptions[key]);\n } else {\n mergedOptions[key] = attributeOptions[key];\n }\n });\n\n // if parent is a fieldset, get files from parent by selecting all input fields that are not file upload fields\n // these will then be automatically set to the initial files\n mergedOptions.files = (options.files || []).concat(\n Array.from(element.querySelectorAll('input:not([type=file])')).map(function(input) {\n return {\n source: input.value,\n options: {\n type: input.dataset.type,\n },\n };\n })\n );\n\n // build plugin\n var app = createAppObject(mergedOptions);\n\n // add already selected files\n if (element.files) {\n Array.from(element.files).forEach(function(file) {\n app.addFile(file);\n });\n }\n\n // replace the target element\n app.replaceElement(element);\n\n // expose\n return app;\n };\n\n // if an element is passed, we create the instance at that element, if not, we just create an up object\n var createApp$1 = function createApp() {\n return isNode(arguments.length <= 0 ? undefined : arguments[0])\n ? createAppAtElement.apply(void 0, arguments)\n : createAppObject.apply(void 0, arguments);\n };\n\n var PRIVATE_METHODS = ['fire', '_read', '_write'];\n\n var createAppAPI = function createAppAPI(app) {\n var api = {};\n\n copyObjectPropertiesToObject(app, api, PRIVATE_METHODS);\n\n return api;\n };\n\n /**\n * Replaces placeholders in given string with replacements\n * @param string - \"Foo {bar}\"\"\n * @param replacements - { \"bar\": 10 }\n */\n var replaceInString = function replaceInString(string, replacements) {\n return string.replace(/(?:{([a-zA-Z]+)})/g, function(match, group) {\n return replacements[group];\n });\n };\n\n var createWorker = function createWorker(fn) {\n var workerBlob = new Blob(['(', fn.toString(), ')()'], {\n type: 'application/javascript',\n });\n\n var workerURL = URL.createObjectURL(workerBlob);\n var worker = new Worker(workerURL);\n\n return {\n transfer: function transfer(message, cb) {},\n post: function post(message, cb, transferList) {\n var id = getUniqueId();\n\n worker.onmessage = function(e) {\n if (e.data.id === id) {\n cb(e.data.message);\n }\n };\n\n worker.postMessage(\n {\n id: id,\n message: message,\n },\n\n transferList\n );\n },\n terminate: function terminate() {\n worker.terminate();\n URL.revokeObjectURL(workerURL);\n },\n };\n };\n\n var loadImage = function loadImage(url) {\n return new Promise(function(resolve, reject) {\n var img = new Image();\n img.onload = function() {\n resolve(img);\n };\n img.onerror = function(e) {\n reject(e);\n };\n img.src = url;\n });\n };\n\n var renameFile = function renameFile(file, name) {\n var renamedFile = file.slice(0, file.size, file.type);\n renamedFile.lastModifiedDate = file.lastModifiedDate;\n renamedFile.name = name;\n return renamedFile;\n };\n\n var copyFile = function copyFile(file) {\n return renameFile(file, file.name);\n };\n\n // already registered plugins (can't register twice)\n var registeredPlugins = [];\n\n // pass utils to plugin\n var createAppPlugin = function createAppPlugin(plugin) {\n // already registered\n if (registeredPlugins.includes(plugin)) {\n return;\n }\n\n // remember this plugin\n registeredPlugins.push(plugin);\n\n // setup!\n var pluginOutline = plugin({\n addFilter: addFilter,\n utils: {\n Type: Type,\n forin: forin,\n isString: isString,\n isFile: isFile,\n toNaturalFileSize: toNaturalFileSize,\n replaceInString: replaceInString,\n getExtensionFromFilename: getExtensionFromFilename,\n getFilenameWithoutExtension: getFilenameWithoutExtension,\n guesstimateMimeType: guesstimateMimeType,\n getFileFromBlob: getFileFromBlob,\n getFilenameFromURL: getFilenameFromURL,\n createRoute: createRoute,\n createWorker: createWorker,\n createView: createView,\n createItemAPI: createItemAPI,\n loadImage: loadImage,\n copyFile: copyFile,\n renameFile: renameFile,\n createBlob: createBlob,\n applyFilterChain: applyFilterChain,\n text: text,\n getNumericAspectRatioFromString: getNumericAspectRatioFromString,\n },\n\n views: {\n fileActionButton: fileActionButton,\n },\n });\n\n // add plugin options to default options\n extendDefaultOptions(pluginOutline.options);\n };\n\n // feature detection used by supported() method\n var isOperaMini = function isOperaMini() {\n return Object.prototype.toString.call(window.operamini) === '[object OperaMini]';\n };\n var hasPromises = function hasPromises() {\n return 'Promise' in window;\n };\n var hasBlobSlice = function hasBlobSlice() {\n return 'slice' in Blob.prototype;\n };\n var hasCreateObjectURL = function hasCreateObjectURL() {\n return 'URL' in window && 'createObjectURL' in window.URL;\n };\n var hasVisibility = function hasVisibility() {\n return 'visibilityState' in document;\n };\n var hasTiming = function hasTiming() {\n return 'performance' in window;\n }; // iOS 8.x\n var hasCSSSupports = function hasCSSSupports() {\n return 'supports' in (window.CSS || {});\n }; // use to detect Safari 9+\n var isIE11 = function isIE11() {\n return /MSIE|Trident/.test(window.navigator.userAgent);\n };\n\n var supported = (function() {\n // Runs immediately and then remembers result for subsequent calls\n var isSupported =\n // Has to be a browser\n isBrowser() &&\n // Can't run on Opera Mini due to lack of everything\n !isOperaMini() &&\n // Require these APIs to feature detect a modern browser\n hasVisibility() &&\n hasPromises() &&\n hasBlobSlice() &&\n hasCreateObjectURL() &&\n hasTiming() &&\n // doesn't need CSSSupports but is a good way to detect Safari 9+ (we do want to support IE11 though)\n (hasCSSSupports() || isIE11());\n\n return function() {\n return isSupported;\n };\n })();\n\n /**\n * Plugin internal state (over all instances)\n */\n var state = {\n // active app instances, used to redraw the apps and to find the later\n apps: [],\n };\n\n // plugin name\n var name = 'filepond';\n\n /**\n * Public Plugin methods\n */\n var fn = function fn() {};\n exports.Status = {};\n exports.FileStatus = {};\n exports.FileOrigin = {};\n exports.OptionTypes = {};\n exports.create = fn;\n exports.destroy = fn;\n exports.parse = fn;\n exports.find = fn;\n exports.registerPlugin = fn;\n exports.getOptions = fn;\n exports.setOptions = fn;\n\n // if not supported, no API\n if (supported()) {\n // start painter and fire load event\n createPainter(\n function() {\n state.apps.forEach(function(app) {\n return app._read();\n });\n },\n function(ts) {\n state.apps.forEach(function(app) {\n return app._write(ts);\n });\n }\n );\n\n // fire loaded event so we know when FilePond is available\n var dispatch = function dispatch() {\n // let others know we have area ready\n document.dispatchEvent(\n new CustomEvent('FilePond:loaded', {\n detail: {\n supported: supported,\n create: exports.create,\n destroy: exports.destroy,\n parse: exports.parse,\n find: exports.find,\n registerPlugin: exports.registerPlugin,\n setOptions: exports.setOptions,\n },\n })\n );\n\n // clean up event\n document.removeEventListener('DOMContentLoaded', dispatch);\n };\n\n if (document.readyState !== 'loading') {\n // move to back of execution queue, FilePond should have been exported by then\n setTimeout(function() {\n return dispatch();\n }, 0);\n } else {\n document.addEventListener('DOMContentLoaded', dispatch);\n }\n\n // updates the OptionTypes object based on the current options\n var updateOptionTypes = function updateOptionTypes() {\n return forin(getOptions(), function(key, value) {\n exports.OptionTypes[key] = value[1];\n });\n };\n\n exports.Status = Object.assign({}, Status);\n exports.FileOrigin = Object.assign({}, FileOrigin);\n exports.FileStatus = Object.assign({}, ItemStatus);\n\n exports.OptionTypes = {};\n updateOptionTypes();\n\n // create method, creates apps and adds them to the app array\n exports.create = function create() {\n var app = createApp$1.apply(void 0, arguments);\n app.on('destroy', exports.destroy);\n state.apps.push(app);\n return createAppAPI(app);\n };\n\n // destroys apps and removes them from the app array\n exports.destroy = function destroy(hook) {\n // returns true if the app was destroyed successfully\n var indexToRemove = state.apps.findIndex(function(app) {\n return app.isAttachedTo(hook);\n });\n if (indexToRemove >= 0) {\n // remove from apps\n var app = state.apps.splice(indexToRemove, 1)[0];\n\n // restore original dom element\n app.restoreElement();\n\n return true;\n }\n\n return false;\n };\n\n // parses the given context for plugins (does not include the context element itself)\n exports.parse = function parse(context) {\n // get all possible hooks\n var matchedHooks = Array.from(context.querySelectorAll('.' + name));\n\n // filter out already active hooks\n var newHooks = matchedHooks.filter(function(newHook) {\n return !state.apps.find(function(app) {\n return app.isAttachedTo(newHook);\n });\n });\n\n // create new instance for each hook\n return newHooks.map(function(hook) {\n return exports.create(hook);\n });\n };\n\n // returns an app based on the given element hook\n exports.find = function find(hook) {\n var app = state.apps.find(function(app) {\n return app.isAttachedTo(hook);\n });\n if (!app) {\n return null;\n }\n return createAppAPI(app);\n };\n\n // adds a plugin extension\n exports.registerPlugin = function registerPlugin() {\n for (\n var _len = arguments.length, plugins = new Array(_len), _key = 0;\n _key < _len;\n _key++\n ) {\n plugins[_key] = arguments[_key];\n }\n\n // register plugins\n plugins.forEach(createAppPlugin);\n\n // update OptionTypes, each plugin might have extended the default options\n updateOptionTypes();\n };\n\n exports.getOptions = function getOptions$1() {\n var opts = {};\n forin(getOptions(), function(key, value) {\n opts[key] = value[0];\n });\n return opts;\n };\n\n exports.setOptions = function setOptions$1(opts) {\n if (isObject(opts)) {\n // update existing plugins\n state.apps.forEach(function(app) {\n app.setOptions(opts);\n });\n\n // override defaults\n setOptions(opts);\n }\n\n // return new options\n return exports.getOptions();\n };\n }\n\n exports.supported = supported;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n});\n","function ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\n\nfunction _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nfunction _slicedToArray(arr, i) {\n return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();\n}\n\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return _arrayLikeToArray(arr);\n}\n\nfunction _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nfunction _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return _arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);\n}\n\nfunction _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n\n return arr2;\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nexport { _arrayLikeToArray as arrayLikeToArray, _arrayWithHoles as arrayWithHoles, _arrayWithoutHoles as arrayWithoutHoles, _defineProperty as defineProperty, _iterableToArray as iterableToArray, _iterableToArrayLimit as iterableToArrayLimit, _nonIterableRest as nonIterableRest, _nonIterableSpread as nonIterableSpread, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose, _slicedToArray as slicedToArray, _toConsumableArray as toConsumableArray, _typeof as typeof, _unsupportedIterableToArray as unsupportedIterableToArray };\n","import { slicedToArray as _slicedToArray } from '../_virtual/_rollupPluginBabelHelpers.js';\n\n/**\n * This function helps you to bind events from Google Maps API to Vue events\n *\n * @param {Object} vueInst the Vue instance\n * @param {Object} googleMapsInst the Google Maps instance\n * @param {string[]} events an array of string with all events that you want to bind\n * @returns {void}\n */\nfunction bindEvents(vueInst, googleMapsInst, events) {\n events.forEach(function (eventName) {\n if (vueInst.$gmapOptions.autoBindAllEvents || vueInst.$listeners[eventName]) {\n googleMapsInst.addListener(eventName, function (ev) {\n vueInst.$emit(eventName, ev);\n });\n }\n });\n}\n/**\n * Function that helps you to capitalize the first letter on a word\n *\n * @param {string} text the text that you want to capitalize\n * @returns {string}\n */\n\nfunction capitalizeFirstLetter(text) {\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n/**\n * Function that helps you to get all non nullable props from a component\n *\n * @param {Object} vueInst the Vue component instance\n * @param {Object} props the props object\n * @returns {Object}\n */\n\nfunction getPropsValues(vueInst, props) {\n return Object.keys(props).reduce(function (acc, prop) {\n if (vueInst[prop] !== undefined) {\n acc[prop] = vueInst[prop];\n }\n\n return acc;\n }, {});\n}\n/**\n * This function is a helper for return to the user the internal Google Maps promise\n * and can wait until it is ready.\n * This piece of code was orignally written by sindresorhus and can be seen here\n * @see https://github.com/sindresorhus/lazy-value/blob/master/index.js\n *\n * @param {Function} fn a function that actually return the promise or async value\n * @returns {Function} anonymous function that returns the value returned by the fn parameter\n */\n\nfunction getLazyValue(fn) {\n var called = false;\n var ret;\n return function () {\n if (!called) {\n called = true;\n ret = fn();\n }\n\n return ret;\n };\n}\n/**\n * Strips out the extraneous properties we have in our\n * mapped props definitions\n *\n * @param {Object} mappedProps the mapped props object\n * @returns {Object}\n */\n\nfunction mappedPropsToVueProps(mappedProps) {\n return Object.entries(mappedProps).map(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n key = _ref2[0],\n prop = _ref2[1];\n\n var value = {};\n if ('type' in prop) value.type = prop.type;\n if ('default' in prop) value.default = prop.default;\n if ('required' in prop) value.required = prop.required;\n return [key, value];\n }).reduce(function (acc, _ref3) {\n var _ref4 = _slicedToArray(_ref3, 2),\n key = _ref4[0],\n val = _ref4[1];\n\n acc[key] = val;\n return acc;\n }, {});\n}\n/**\n * This function simulates a down arrow key event when user\n * hits return (enter) on the autocomplete component selection\n * the first occurrence in the list.\n *\n * This piece of code was orignally written by amirnissim\n * and has been ported to Vanilla.js by GuillaumeLeclerc\n * @see http://stackoverflow.com/a/11703018/2694653\n *\n * @param {Object} input the HTML input node element reference\n * @returns {void}\n */\n\nfunction downArrowSimulator(input) {\n // eslint-disable-next-line no-underscore-dangle -- Is old style should be analyzed\n var _addEventListener = input.addEventListener ? input.addEventListener : input.attachEvent;\n /**\n * Add event listener wrapper that will replace to default addEventListener or attachEvent function\n *\n * @param {string} type the event type\n * @param {Function} listener function should be executed when the event is fired\n * @returns {void}\n */\n\n\n function addEventListenerWrapper(type, listener) {\n // Simulate a 'down arrow' keypress on hitting 'return' when no pac suggestion is selected,\n // and then trigger the original listener.\n if (type === 'keydown') {\n var origListener = listener; // eslint-disable-next-line no-param-reassign -- Is old style this should be analyzed\n\n listener = function (event) {\n var suggestionSelected = document ? document.getElementsByClassName('pac-item-selected').length > 0 : null;\n\n if (event.which === 13 && !suggestionSelected) {\n var simulatedEvent = document.createEvent('Event');\n simulatedEvent.keyCode = 40;\n simulatedEvent.which = 40;\n origListener.apply(input, [simulatedEvent]);\n }\n\n origListener.apply(input, [event]);\n };\n }\n\n _addEventListener.apply(input, [type, listener]);\n }\n\n input.addEventListener = addEventListenerWrapper;\n input.attachEvent = addEventListenerWrapper;\n}\n/**\n * When you have two-way bindings, but the actual bound value will not equal\n * the value you initially passed in, then to avoid an infinite loop you\n * need to increment a counter every time you pass in a value, decrement the\n * same counter every time the bound value changed, but only bubble up\n * the event when the counter is zero.\n *\n * @param {Function} fn Function to be executed to determine if the event was executed\n *\n Example:\n\n Let's say DrawingRecognitionCanvas is a deep-learning backed canvas\n that, when given the name of an object (e.g. 'dog'), draws a dog.\n But whenever the drawing on it changes, it also sends back its interpretation\n of the image by way of the @newObjectRecognized event.\n\n \n \n\n new TwoWayBindingWrapper((increment, decrement, shouldUpdate) => {\n this.$watch('identifiedObject', () => {\n // new object passed in\n increment()\n })\n this.$deepLearningBackend.on('drawingChanged', () => {\n recognizeObject(this.$deepLearningBackend)\n .then((object) => {\n decrement()\n if (shouldUpdate()) {\n this.$emit('newObjectRecognized', object.name)\n }\n })\n })\n })\n */\n\nfunction twoWayBindingWrapper(fn) {\n var counter = 0;\n fn(function () {\n counter += 1;\n }, function () {\n counter = Math.max(0, counter - 1);\n }, function () {\n return counter === 0;\n });\n}\n/**\n * Watch the individual properties of a PoD object, instead of the object\n * per se. This is different from a deep watch where both the reference\n * and the individual values are watched.\n *\n * In effect, it throttles the multiple $watch to execute at most once per tick.\n *\n * @param {Object} vueInst the component instance\n * @param {string[]} propertiesToTrack string array with all properties that you want to track\n * @param {Function} handler function to be fired when the prop change\n * @param {boolean} immediate=false\n * @returns {void}\n */\n\nfunction watchPrimitiveProperties(vueInst, propertiesToTrack, handler) {\n var immediate = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var isHandled = false;\n /**\n * Function in charge to execute the handler function if it was not fired\n *\n * @returns void\n */\n\n function requestHandle() {\n if (!isHandled) {\n isHandled = true;\n vueInst.$nextTick(function () {\n isHandled = false;\n handler();\n });\n }\n }\n\n propertiesToTrack.forEach(function (prop) {\n vueInst.$watch(prop, requestHandle, {\n immediate: immediate\n });\n });\n}\n/**\n * Binds the properties defined in props to the google maps instance.\n * If the prop is an Object type, and we wish to track the properties\n * of the object (e.g. the lat and lng of a LatLng), then we do a deep\n * watch. For deep watch, we also prevent the _changed event from being\n * emitted if the data source was external.\n *\n * @param {Object} vueInst the component instance\n * @param {Object} googleMapsInst the Google Maps instance\n * @param {Object} props object with the component props tha should be synched with the Google Maps instances props\n * @returns {void}\n */\n\nfunction bindProps(vueInst, googleMapsInst, props) {\n Object.keys(props).forEach(function (attribute) {\n var _props$attribute = props[attribute],\n twoWay = _props$attribute.twoWay,\n type = _props$attribute.type,\n trackProperties = _props$attribute.trackProperties,\n noBind = _props$attribute.noBind;\n\n if (!noBind) {\n var setMethodName = \"set\".concat(capitalizeFirstLetter(attribute));\n var getMethodName = \"get\".concat(capitalizeFirstLetter(attribute));\n var eventName = \"\".concat(attribute.toLowerCase(), \"_changed\");\n var initialValue = vueInst[attribute];\n\n if (typeof googleMapsInst[setMethodName] === 'undefined') {\n throw new Error( // TODO: Analyze all disabled rules in the file\n // eslint-disable-next-line no-underscore-dangle -- old code should be analyzed\n \"\".concat(setMethodName, \" is not a method of (the Maps object corresponding to) \").concat(vueInst.$options._componentTag));\n } // We need to avoid an endless\n // propChanged -> event emitted -> propChanged -> event emitted loop\n // although this may really be the user's responsibility\n\n\n if (type !== Object || !trackProperties) {\n // Track the object deeply\n vueInst.$watch(attribute, function () {\n var attributeValue = vueInst[attribute];\n googleMapsInst[setMethodName](attributeValue);\n }, {\n immediate: typeof initialValue !== 'undefined',\n deep: type === Object\n });\n } else {\n watchPrimitiveProperties(vueInst, trackProperties.map(function (prop) {\n return \"\".concat(attribute, \".\").concat(prop);\n }), function () {\n googleMapsInst[setMethodName](vueInst[attribute]);\n }, vueInst[attribute] !== undefined);\n }\n\n if (twoWay && (vueInst.$gmapOptions.autoBindAllEvents || vueInst.$listeners[eventName])) {\n googleMapsInst.addListener(eventName, function () {\n vueInst.$emit(eventName, googleMapsInst[getMethodName]());\n });\n }\n }\n });\n}\n\nexport { bindEvents, bindProps, capitalizeFirstLetter, downArrowSimulator, getLazyValue, getPropsValues, mappedPropsToVueProps, twoWayBindingWrapper, watchPrimitiveProperties };\n","/**\n * This are GoogleMapsOptions that we want to have like\n * props in our Vue component.\n * This properties are in the way that GoogleMaps accept it\n * and with extraneous properties for the VueJs API.\n * In a previous version of this plugin, to avoid repetition,\n * we created a .js file component with a `mappedProps` key on it\n * and used a variety of helper functions to clean it and bind it\n * to Vue props and watch them, etc.\n * To day our primary main goal is get a more intuitive and descriptive\n * API and a better documentation of it, following this goals we move\n * this extraneous properties to an independent file in order to consume\n * it when is needed.\n * Please you need to remind that you need to create properties in the\n * correspondent Vue component with the same names and the same values\n * for those properties that are not extraneous to Vue.\n */\nvar autocompleteMappedProps = {\n bounds: {\n type: Object\n },\n componentRestrictions: {\n type: Object,\n // Do not bind -- must check for undefined\n // in the property\n noBind: true\n },\n types: {\n type: Array,\n default: function _default() {\n return [];\n }\n }\n};\nvar drawingManagerMappedProps = {\n circleOptions: {\n type: Object,\n twoWay: false,\n noBind: true\n },\n markerOptions: {\n type: Object,\n twoWay: false,\n noBind: true\n },\n polygonOptions: {\n type: Object,\n twoWay: false,\n noBind: true\n },\n polylineOptions: {\n type: Object,\n twoWay: false,\n noBind: true\n },\n rectangleOptions: {\n type: Object,\n twoWay: false,\n noBind: true\n }\n};\nvar heatMapLayerMappedProps = {\n options: {\n type: Object,\n twoWay: false,\n default: function _default() {}\n },\n data: {\n type: Array,\n twoWay: true\n }\n};\nvar infoWindowMappedProps = {\n content: {\n type: Object,\n twoWay: true\n },\n options: {\n type: Object,\n required: false,\n default: function _default() {\n return {};\n }\n },\n position: {\n type: Object,\n twoWay: true\n },\n zIndex: {\n type: Number,\n twoWay: true\n }\n};\nvar kmlLayerMappedProps = {\n clickable: {\n type: Boolean,\n twoWay: true,\n noBind: true\n },\n map: {\n type: Object,\n twoWay: true\n },\n preserveViewport: {\n type: Boolean,\n twoWay: true,\n noBind: true\n },\n screenOverlays: {\n type: Boolean,\n twoWay: true,\n noBind: true\n },\n suppressInfoWindows: {\n type: Boolean,\n twoWay: true,\n noBind: true\n },\n url: {\n type: String,\n twoWay: false\n },\n zIndex: {\n type: Number,\n twoWay: true\n },\n options: {\n type: Object,\n default: function _default() {\n return {};\n }\n }\n};\nvar mapMappedProps = {\n center: {\n required: true,\n twoWay: true,\n type: Object,\n noBind: true\n },\n zoom: {\n required: false,\n twoWay: true,\n type: Number,\n noBind: true\n },\n heading: {\n type: Number,\n twoWay: true\n },\n mapTypeId: {\n twoWay: true,\n type: String\n },\n tilt: {\n twoWay: true,\n type: Number\n },\n options: {\n type: Object,\n default: function _default() {\n return {};\n }\n }\n};\nvar markerMappedProps = {\n animation: {\n twoWay: true,\n type: Number\n },\n attribution: {\n type: Object\n },\n clickable: {\n type: Boolean,\n twoWay: true,\n default: true\n },\n cursor: {\n type: String,\n twoWay: true\n },\n draggable: {\n type: Boolean,\n twoWay: true,\n default: false\n },\n icon: {\n twoWay: true\n },\n label: {},\n opacity: {\n type: Number,\n default: 1\n },\n options: {\n type: Object\n },\n place: {\n type: Object\n },\n position: {\n type: Object,\n twoWay: true\n },\n shape: {\n type: Object,\n twoWay: true\n },\n title: {\n type: String,\n twoWay: true\n },\n zIndex: {\n type: Number,\n twoWay: true\n },\n visible: {\n twoWay: true,\n default: true\n }\n};\nvar streetViewPanoramaMappedProps = {\n zoom: {\n twoWay: true,\n type: Number\n },\n pov: {\n twoWay: true,\n type: Object,\n trackProperties: ['pitch', 'heading']\n },\n position: {\n twoWay: true,\n type: Object,\n noBind: true\n },\n pano: {\n twoWay: true,\n type: String\n },\n motionTracking: {\n twoWay: false,\n type: Boolean\n },\n visible: {\n twoWay: true,\n type: Boolean,\n default: true\n },\n options: {\n twoWay: false,\n type: Object,\n default: function _default() {\n return {};\n }\n }\n};\nvar polygonMappedProps = {\n clickable: {\n type: Boolean,\n noBind: true\n },\n draggable: {\n type: Boolean\n },\n editable: {\n type: Boolean\n },\n fillColor: {\n type: String,\n noBind: true\n },\n fillOpacity: {\n type: Number,\n noBind: true\n },\n strokeColor: {\n type: String,\n noBind: true\n },\n strokeOpacity: {\n type: Number,\n noBind: true\n },\n strokePosition: {\n type: Number,\n noBind: true\n },\n strokeWeight: {\n type: Number,\n noBind: true\n },\n visible: {\n type: Boolean\n },\n options: {\n type: Object\n },\n path: {\n type: Array,\n twoWay: true,\n noBind: true\n },\n paths: {\n type: Array,\n twoWay: true,\n noBind: true\n }\n};\nvar polylineMappedProps = {\n clickable: {\n type: Boolean,\n noBind: true\n },\n draggable: {\n type: Boolean\n },\n editable: {\n type: Boolean\n },\n strokeColor: {\n type: String,\n noBind: true\n },\n strokeOpacity: {\n type: Number,\n noBind: true\n },\n strokeWeight: {\n type: Number,\n noBind: true\n },\n visible: {\n type: Boolean\n },\n options: {\n twoWay: false,\n type: Object\n },\n path: {\n type: Array,\n twoWay: true\n }\n};\nvar rectangleMappedProps = {\n bounds: {\n type: Object,\n twoWay: true\n },\n clickable: {\n type: Boolean,\n noBind: true\n },\n draggable: {\n type: Boolean,\n default: false\n },\n editable: {\n type: Boolean,\n default: false\n },\n fillColor: {\n type: String,\n noBind: true\n },\n fillOpacity: {\n type: Number,\n noBind: true\n },\n strokeColor: {\n type: String,\n noBind: true\n },\n strokeOpacity: {\n type: Number,\n noBind: true\n },\n strokePosition: {\n type: Number,\n noBind: true\n },\n strokeWeight: {\n type: Number,\n noBind: true\n },\n visible: {\n type: Boolean\n },\n options: {\n type: Object,\n twoWay: false\n }\n};\nvar circleMappedProps = {\n center: {\n type: Object,\n twoWay: true,\n required: true\n },\n radius: {\n type: Number,\n twoWay: true\n },\n clickable: {\n type: Boolean,\n noBind: true\n },\n draggable: {\n type: Boolean,\n default: false\n },\n editable: {\n type: Boolean,\n default: false\n },\n fillColor: {\n type: String,\n noBind: true\n },\n fillOpacity: {\n type: Number,\n noBind: true\n },\n strokeColor: {\n type: String,\n noBind: true\n },\n strokeOpacity: {\n type: Number,\n noBind: true\n },\n strokePosition: {\n type: Number,\n noBind: true\n },\n strokeWeight: {\n type: Number,\n noBind: true\n },\n visible: {\n type: Boolean\n },\n options: {\n type: Object,\n twoWay: false\n }\n};\nvar placeInputMappedProps = {\n bounds: {\n type: Object\n },\n defaultPlace: {\n type: String,\n default: ''\n },\n componentRestrictions: {\n type: Object,\n default: null\n },\n types: {\n type: Array,\n default: function _default() {\n return [];\n }\n },\n placeholder: {\n required: false,\n type: String\n },\n className: {\n required: false,\n type: String\n },\n label: {\n required: false,\n type: String,\n default: null\n },\n selectFirstOnEnter: {\n require: false,\n type: Boolean,\n default: false\n }\n};\nvar clusterIconMappedProps = {\n algorithm: {\n type: Object\n },\n onClusterClick: {\n type: Function\n },\n renderer: {\n type: Object\n },\n options: {\n type: Object\n }\n};\n\nexport { autocompleteMappedProps, circleMappedProps, clusterIconMappedProps, drawingManagerMappedProps, heatMapLayerMappedProps, infoWindowMappedProps, kmlLayerMappedProps, mapMappedProps, markerMappedProps, placeInputMappedProps, polygonMappedProps, polylineMappedProps, rectangleMappedProps, streetViewPanoramaMappedProps };\n","import { downArrowSimulator, getPropsValues, bindProps } from '../utils/helpers.js';\nimport { autocompleteMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n//\n\n/**\n * Autocomplete component\n * @displayName GmapAutocomplete\n * @see [source code](/guide/autocomplete.html#source-code)\n */\nvar script = {\n name: 'AutocompleteInput',\n props: {\n /**\n * Map bounds this is an LatLngBounds\n * object builded with\n * @value new google.maps.LatLngBounds(...)\n * @see [Map Bounds](https://developers.google.com/maps/documentation/javascript/places-autocomplete#set-the-bounds-on-creation-of-the-autocomplete-object)\n */\n bounds: {\n type: Object,\n default: undefined,\n },\n /**\n * Restrict the search to a specific country\n * @value `{[key: string]: string}`\n * @see [componentRestrictions](https://developers.google.com/maps/documentation/javascript/places-autocomplete#restrict-the-search-to-a-specific-country)\n */\n componentRestrictions: {\n type: Object,\n default: undefined,\n },\n /**\n * Map types this is an array of strings\n * @value string[]\n * @see [Map Bounds](https://developers.google.com/maps/documentation/javascript/places-autocomplete#set-the-bounds-on-creation-of-the-autocomplete-object)\n */\n types: {\n type: Array,\n default: undefined,\n },\n /**\n * Select the first result in the list when press enter keyboard\n * @values true, false\n */\n selectFirstOnEnter: {\n required: false,\n type: Boolean,\n default: false,\n },\n /**\n * the unique ref set to the component passed in the slot input\n */\n slotRefName: {\n required: false,\n type: String,\n default: 'input',\n },\n /**\n * The name of the ref to obtain the html input element\n * if its a child of component in the slot input\n * very useful whe we use a component like v-text-field of vuetify\n * that has a 'input' ref pointing to the final html input element\n */\n childRefName: {\n required: false,\n type: String,\n default: 'input',\n },\n /**\n * Other options that you can pass to the Google Mapas\n * Autocomplete API\n * @values geocode, address, regions\n * @see [Options](https://developers.google.com/maps/documentation/javascript/places-autocomplete#add-autocomplete)\n */\n options: {\n type: Object,\n default: undefined,\n },\n /**\n * To avoid paying for data that you don't need,\n * be sure to use Autocomplete.setFields() to specify\n * only the place data that you will use.\n *\n * @see [Place information](https://developers.google.com/maps/documentation/javascript/places-autocomplete#get-place-information)\n * @see [setFields](https://developers.google.com/maps/documentation/javascript/reference/places-widget#Autocomplete.setFields)\n * @see [PlaceResult](https://developers.google.com/maps/documentation/javascript/reference/places-service#PlaceResult)\n */\n setFieldsTo: {\n required: false,\n type: Array,\n default: null,\n },\n },\n watch: {\n /**\n * This watcher is incharge to update\n * the component restrictions when is\n * changed from the parent\n */\n componentRestrictions(v) {\n if (v !== undefined) {\n this.$autocomplete.setComponentRestrictions(v);\n }\n },\n },\n async mounted() {\n await this.$gmapApiPromiseLazy();\n\n let scopedInput = null;\n\n if (this.$scopedSlots.default) {\n if (!Object.keys(this.$scopedSlots.default()[0].context.$refs).length) {\n throw new Error(\n 'If you use the slot input you must add a ref to the element that you will use as the input, and if you use a vue component, eg: v-text-field, etc, you need to set the childRefName indicating what is the ref name of the html input elemnt behind your component.'\n );\n }\n\n scopedInput =\n this.$scopedSlots.default()[0].context.$refs[this.slotRefName];\n\n if (scopedInput && scopedInput.$refs) {\n scopedInput = scopedInput.$refs[this.childRefName];\n }\n\n if (scopedInput) {\n this.$refs.input = scopedInput;\n }\n }\n\n if (this.selectFirstOnEnter) {\n downArrowSimulator(this.$refs.input);\n }\n\n if (typeof google.maps.places.Autocomplete !== 'function') {\n throw new Error(\n \"google.maps.places.Autocomplete is undefined. Did you add 'places' to libraries when loading Google Maps?\"\n );\n }\n\n const autocompleteOptions = {\n ...getPropsValues(this, autocompleteMappedProps),\n ...this.options,\n };\n\n this.$autocomplete = new google.maps.places.Autocomplete(\n this.$refs.input,\n autocompleteOptions\n );\n\n bindProps(this, this.$autocomplete, autocompleteMappedProps);\n\n if (this.setFieldsTo) {\n this.$autocomplete.setFields(this.setFieldsTo);\n }\n\n // Not using `bindEvents` because we also want\n // to return the result of `getPlace()`\n this.$autocomplete.addListener('place_changed', () => {\n /**\n * Place change event\n * @event place_changed\n * @property {object} place `this.$autocomplete.getPlace()`\n * @see [Get place information](https://developers.google.com/maps/documentation/javascript/places-autocomplete#get-place-information)\n */\n this.$emit('place_changed', this.$autocomplete.getPlace());\n });\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$$autocomplete && this.$$autocomplete.setMap) {\n this.$$autocomplete.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier\n/* server only */\n, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {\n if (typeof shadowMode !== 'boolean') {\n createInjectorSSR = createInjector;\n createInjector = shadowMode;\n shadowMode = false;\n } // Vue.extend constructor export interop.\n\n\n const options = typeof script === 'function' ? script.options : script; // render functions\n\n if (template && template.render) {\n options.render = template.render;\n options.staticRenderFns = template.staticRenderFns;\n options._compiled = true; // functional template\n\n if (isFunctionalTemplate) {\n options.functional = true;\n }\n } // scopedId\n\n\n if (scopeId) {\n options._scopeId = scopeId;\n }\n\n let hook;\n\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context = context || // cached call\n this.$vnode && this.$vnode.ssrContext || // stateful\n this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional\n // 2.2 with runInNewContext: true\n\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__;\n } // inject component styles\n\n\n if (style) {\n style.call(this, createInjectorSSR(context));\n } // register component module identifier for async chunk inference\n\n\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier);\n }\n }; // used by ssr in case component is cached and beforeCreate\n // never gets called\n\n\n options._ssrRegister = hook;\n } else if (style) {\n hook = shadowMode ? function (context) {\n style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));\n } : function (context) {\n style.call(this, createInjector(context));\n };\n }\n\n if (hook) {\n if (options.functional) {\n // register for functional component in vue file\n const originalRender = options.render;\n\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context);\n return originalRender(h, context);\n };\n } else {\n // inject component registration as beforeCreate hook\n const existing = options.beforeCreate;\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook];\n }\n }\n\n return script;\n}\n\nexport { normalizeComponent as default };\n","import script from './autocomplete-input.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._t(\"default\",function(){return [_c('input',_vm._g(_vm._b({ref:\"input\"},'input',_vm.$attrs,false),_vm.$listeners))]},{\"attrs\":_vm.$attrs,\"listeners\":_vm.$listeners})],2)};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","/**\n * @class MapElementMixin\n *\n * Add a inject object to inject $mapPromise and a provide function to the\n * component this function save the returned Google Maps object in the $map\n * property after the $mapPromise is resolved.\n *\n * ## The mixin code:\n * ```js\n export default {\n inject: {\n $mapPromise: { default: 'abcdef' },\n },\n provide() {\n this.$mapPromise.then((map) => {\n this.$map = map;\n });\n\n return {};\n },\n };\n * ```\n *\n * @property $mapPromise - The map property that should return the `$map`. \n * **Note**: although this mixin is not \"providing\" anything,\n * components' expect the `$map` property to be present on the component.\n * In order for that to happen, this mixin must intercept the `$mapPromise\n * .then(() => {})` first before its component does so.\n *\n * Since a `provide()` on a mixin is executed before a `provide()` on the\n * component, putting this code in `provide()` ensures that the `$map` is\n * already set by the time the component's `provide()` is called.\n * @property $map - The Google map (valid only after the promise (`$mapPromise`) returns)\n */\nvar mapElementMixin = {\n inject: {\n $mapPromise: {\n default: 'abcdef'\n }\n },\n provide: function provide() {\n var _this = this;\n\n /**\n * **Note**: although this mixin is not \"providing\" anything,\n * components' expect the `$map` property to be present on the component.\n * In order for that to happen, this mixin must intercept the `$mapPromise\n * .then(() => {})` first before its component does so.\n *\n * Since a `provide()` on a mixin is executed before a `provide()` on the\n * component, putting this code in `provide()` ensures that the `$map` is\n * already set by the time the component's `provide()` is called.\n */\n this.$mapPromise.then(function (map) {\n _this.$map = map;\n });\n return {};\n }\n};\n\nexport { mapElementMixin as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { circleMappedProps } from '../utils/mapped-props-by-map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\n\n/**\n * Circle component\n * @displayName GmapCircle\n * @see [source code](/guide/circle.html#source-code)\n * @see [official reference](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#Circle)\n */\nvar script = {\n name: 'CircleShape',\n mixins: [mapElementMixin],\n render() {\n return '';\n },\n provide() {\n // events to bind with toWay\n const events = [\n 'click',\n 'dblclick',\n 'drag',\n 'dragend',\n 'dragstart',\n 'mousedown',\n 'mousemove',\n 'mouseout',\n 'mouseover',\n 'mouseup',\n 'rightclick',\n ];\n\n // Infowindow needs this to be immediately available\n const promise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n ...this.options,\n map,\n ...getPropsValues(this, circleMappedProps),\n };\n\n const { options: extraOptions, ...finalOptions } = initialOptions;\n\n this.$circleObject = new google.maps.Circle(finalOptions);\n\n bindProps(this, this.$circleObject, circleMappedProps);\n bindEvents(this, this.$circleObject, events);\n\n return this.$circleObject;\n })\n .catch((error) => {\n throw error;\n });\n\n // TODO: analyze the efects of only returns the instance and remove completely the promise\n this.$circlePromise = promise;\n return { $circlePromise: promise };\n },\n props: {\n /**\n * The center of the Circle.\n * @value { lat: 41.878, lng: -87.629 }\n * @see [Circle simple](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.center)\n */\n center: {\n type: Object,\n required: true,\n },\n /**\n * The radius in meters on the Earth's surface.\n * @value 10\n * @see [Circle simple](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.radius)\n */\n radius: {\n type: Number,\n default: 10,\n },\n /**\n * Indicates whether this Polygon handles mouse events. Defaults to true.\n * @value true, false\n * @see [Circle draggable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.clickable)\n */\n clickable: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, the user can drag this circle over the map. Defaults to false.\n * @value true, false\n * @see [Circle simple](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.draggable)\n */\n draggable: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, the user can edit this circle by dragging the control points shown at the center and around the circumference of the circle. Defaults to false.\n * @value true, false\n * @see [Circle simple](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.editable)\n */\n editable: {\n type: Boolean,\n default: false,\n },\n /**\n * The fill color. All CSS3 colors are supported except for extended named colors.\n * @value '#000'\n * @see [Circle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.fillColor)\n */\n fillColor: {\n type: String,\n default: '',\n },\n /**\n * The fill opacity between 0.0 and 1.0\n * @value 1\n * @see [Circle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.fillOpacity)\n */\n fillOpacity: {\n type: Number,\n default: 1,\n },\n /**\n * The stroke color. All CSS3 colors are supported except for extended named colors.\n * @value '#000'\n * @see [Circle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.strokeColor)\n */\n strokeColor: {\n type: String,\n default: '',\n },\n /**\n * The stroke opacity between 0.0 and 1.0.\n * @value 1\n * @see [Circle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.strokeOpacity)\n */\n strokeOpacity: {\n type: Number,\n default: 1,\n },\n /**\n * The stroke position. Defaults to CENTER.\n * @value 1\n * @see [Circle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.strokePosition)\n * @see [StrokePosition constant](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#StrokePosition)\n */\n strokePosition: {\n type: Number,\n default: 0,\n },\n /**\n * The stroke width in pixels.\n * @value 1\n * @see [Circle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.strokeWeight)\n */\n strokeWeight: {\n type: Number,\n default: 1,\n },\n /**\n * Whether this polyline is visible on the map. Defaults to true.\n * @value 1\n * @see [Circle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#CircleOptions.visible)\n */\n visible: {\n type: Boolean,\n default: true,\n },\n /**\n * The Google Maps circle options\n * @value {\n strokeColor: \"#FF0000\",\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: \"#FF0000\",\n fillOpacity: 0.35,\n map,\n center: citymap[city].center,\n radius: Math.sqrt(citymap[city].population) * 100,\n }\n * @see [Circle simple](https://developers.google.com/maps/documentation/javascript/examples/circle-simple)\n */\n options: {\n type: Object,\n default: undefined,\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$circleObject && this.$circleObject.setMap) {\n this.$circleObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './circle-shape.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = undefined;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n {},\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import KDBush from '../../../kdbush@3.0.0/node_modules/kdbush/src/index.js';\n\nconst defaultOptions = {\n minZoom: 0,\n // min zoom to generate clusters on\n maxZoom: 16,\n // max zoom level to cluster the points on\n minPoints: 2,\n // minimum points to form a cluster\n radius: 40,\n // cluster radius in pixels\n extent: 512,\n // tile extent (radius is calculated relative to it)\n nodeSize: 64,\n // size of the KD-tree leaf node, affects performance\n log: false,\n // whether to log timing info\n // whether to generate numeric ids for input features (in vector tiles)\n generateId: false,\n // a reduce function for calculating custom cluster properties\n reduce: null,\n // (accumulated, props) => { accumulated.sum += props.sum; }\n // properties to use for individual points when running the reducer\n map: props => props // props => ({sum: props.my_value})\n\n};\n\nconst fround = Math.fround || (tmp => x => {\n tmp[0] = +x;\n return tmp[0];\n})(new Float32Array(1));\n\nclass Supercluster {\n constructor(options) {\n this.options = extend(Object.create(defaultOptions), options);\n this.trees = new Array(this.options.maxZoom + 1);\n }\n\n load(points) {\n const {\n log,\n minZoom,\n maxZoom,\n nodeSize\n } = this.options;\n if (log) console.time('total time');\n const timerId = `prepare ${points.length} points`;\n if (log) console.time(timerId);\n this.points = points; // generate a cluster object for each point and index input points into a KD-tree\n\n let clusters = [];\n\n for (let i = 0; i < points.length; i++) {\n if (!points[i].geometry) continue;\n clusters.push(createPointCluster(points[i], i));\n }\n\n this.trees[maxZoom + 1] = new KDBush(clusters, getX, getY, nodeSize, Float32Array);\n if (log) console.timeEnd(timerId); // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n // results in a cluster hierarchy across zoom levels\n\n for (let z = maxZoom; z >= minZoom; z--) {\n const now = +Date.now(); // create a new set of clusters for the zoom and index them with a KD-tree\n\n clusters = this._cluster(clusters, z);\n this.trees[z] = new KDBush(clusters, getX, getY, nodeSize, Float32Array);\n if (log) console.log('z%d: %d clusters in %dms', z, clusters.length, +Date.now() - now);\n }\n\n if (log) console.timeEnd('total time');\n return this;\n }\n\n getClusters(bbox, zoom) {\n let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n const minLat = Math.max(-90, Math.min(90, bbox[1]));\n let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n const maxLat = Math.max(-90, Math.min(90, bbox[3]));\n\n if (bbox[2] - bbox[0] >= 360) {\n minLng = -180;\n maxLng = 180;\n } else if (minLng > maxLng) {\n const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);\n const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);\n return easternHem.concat(westernHem);\n }\n\n const tree = this.trees[this._limitZoom(zoom)];\n\n const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));\n const clusters = [];\n\n for (const id of ids) {\n const c = tree.points[id];\n clusters.push(c.numPoints ? getClusterJSON(c) : this.points[c.index]);\n }\n\n return clusters;\n }\n\n getChildren(clusterId) {\n const originId = this._getOriginId(clusterId);\n\n const originZoom = this._getOriginZoom(clusterId);\n\n const errorMsg = 'No cluster with the specified id.';\n const index = this.trees[originZoom];\n if (!index) throw new Error(errorMsg);\n const origin = index.points[originId];\n if (!origin) throw new Error(errorMsg);\n const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n const ids = index.within(origin.x, origin.y, r);\n const children = [];\n\n for (const id of ids) {\n const c = index.points[id];\n\n if (c.parentId === clusterId) {\n children.push(c.numPoints ? getClusterJSON(c) : this.points[c.index]);\n }\n }\n\n if (children.length === 0) throw new Error(errorMsg);\n return children;\n }\n\n getLeaves(clusterId, limit, offset) {\n limit = limit || 10;\n offset = offset || 0;\n const leaves = [];\n\n this._appendLeaves(leaves, clusterId, limit, offset, 0);\n\n return leaves;\n }\n\n getTile(z, x, y) {\n const tree = this.trees[this._limitZoom(z)];\n\n const z2 = Math.pow(2, z);\n const {\n extent,\n radius\n } = this.options;\n const p = radius / extent;\n const top = (y - p) / z2;\n const bottom = (y + 1 + p) / z2;\n const tile = {\n features: []\n };\n\n this._addTileFeatures(tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom), tree.points, x, y, z2, tile);\n\n if (x === 0) {\n this._addTileFeatures(tree.range(1 - p / z2, top, 1, bottom), tree.points, z2, y, z2, tile);\n }\n\n if (x === z2 - 1) {\n this._addTileFeatures(tree.range(0, top, p / z2, bottom), tree.points, -1, y, z2, tile);\n }\n\n return tile.features.length ? tile : null;\n }\n\n getClusterExpansionZoom(clusterId) {\n let expansionZoom = this._getOriginZoom(clusterId) - 1;\n\n while (expansionZoom <= this.options.maxZoom) {\n const children = this.getChildren(clusterId);\n expansionZoom++;\n if (children.length !== 1) break;\n clusterId = children[0].properties.cluster_id;\n }\n\n return expansionZoom;\n }\n\n _appendLeaves(result, clusterId, limit, offset, skipped) {\n const children = this.getChildren(clusterId);\n\n for (const child of children) {\n const props = child.properties;\n\n if (props && props.cluster) {\n if (skipped + props.point_count <= offset) {\n // skip the whole cluster\n skipped += props.point_count;\n } else {\n // enter the cluster\n skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped); // exit the cluster\n }\n } else if (skipped < offset) {\n // skip a single point\n skipped++;\n } else {\n // add a single point\n result.push(child);\n }\n\n if (result.length === limit) break;\n }\n\n return skipped;\n }\n\n _addTileFeatures(ids, points, x, y, z2, tile) {\n for (const i of ids) {\n const c = points[i];\n const isCluster = c.numPoints;\n let tags, px, py;\n\n if (isCluster) {\n tags = getClusterProperties(c);\n px = c.x;\n py = c.y;\n } else {\n const p = this.points[c.index];\n tags = p.properties;\n px = lngX(p.geometry.coordinates[0]);\n py = latY(p.geometry.coordinates[1]);\n }\n\n const f = {\n type: 1,\n geometry: [[Math.round(this.options.extent * (px * z2 - x)), Math.round(this.options.extent * (py * z2 - y))]],\n tags\n }; // assign id\n\n let id;\n\n if (isCluster) {\n id = c.id;\n } else if (this.options.generateId) {\n // optionally generate id\n id = c.index;\n } else if (this.points[c.index].id) {\n // keep id if already assigned\n id = this.points[c.index].id;\n }\n\n if (id !== undefined) f.id = id;\n tile.features.push(f);\n }\n }\n\n _limitZoom(z) {\n return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\n }\n\n _cluster(points, zoom) {\n const clusters = [];\n const {\n radius,\n extent,\n reduce,\n minPoints\n } = this.options;\n const r = radius / (extent * Math.pow(2, zoom)); // loop through each point\n\n for (let i = 0; i < points.length; i++) {\n const p = points[i]; // if we've already visited the point at this zoom level, skip it\n\n if (p.zoom <= zoom) continue;\n p.zoom = zoom; // find all nearby points\n\n const tree = this.trees[zoom + 1];\n const neighborIds = tree.within(p.x, p.y, r);\n const numPointsOrigin = p.numPoints || 1;\n let numPoints = numPointsOrigin; // count the number of points in a potential cluster\n\n for (const neighborId of neighborIds) {\n const b = tree.points[neighborId]; // filter out neighbors that are already processed\n\n if (b.zoom > zoom) numPoints += b.numPoints || 1;\n } // if there were neighbors to merge, and there are enough points to form a cluster\n\n\n if (numPoints > numPointsOrigin && numPoints >= minPoints) {\n let wx = p.x * numPointsOrigin;\n let wy = p.y * numPointsOrigin;\n let clusterProperties = reduce && numPointsOrigin > 1 ? this._map(p, true) : null; // encode both zoom and point index on which the cluster originated -- offset by total length of features\n\n const id = (i << 5) + (zoom + 1) + this.points.length;\n\n for (const neighborId of neighborIds) {\n const b = tree.points[neighborId];\n if (b.zoom <= zoom) continue;\n b.zoom = zoom; // save the zoom (so it doesn't get processed twice)\n\n const numPoints2 = b.numPoints || 1;\n wx += b.x * numPoints2; // accumulate coordinates for calculating weighted center\n\n wy += b.y * numPoints2;\n b.parentId = id;\n\n if (reduce) {\n if (!clusterProperties) clusterProperties = this._map(p, true);\n reduce(clusterProperties, this._map(b));\n }\n }\n\n p.parentId = id;\n clusters.push(createCluster(wx / numPoints, wy / numPoints, id, numPoints, clusterProperties));\n } else {\n // left points as unclustered\n clusters.push(p);\n\n if (numPoints > 1) {\n for (const neighborId of neighborIds) {\n const b = tree.points[neighborId];\n if (b.zoom <= zoom) continue;\n b.zoom = zoom;\n clusters.push(b);\n }\n }\n }\n }\n\n return clusters;\n } // get index of the point from which the cluster originated\n\n\n _getOriginId(clusterId) {\n return clusterId - this.points.length >> 5;\n } // get zoom of the point from which the cluster originated\n\n\n _getOriginZoom(clusterId) {\n return (clusterId - this.points.length) % 32;\n }\n\n _map(point, clone) {\n if (point.numPoints) {\n return clone ? extend({}, point.properties) : point.properties;\n }\n\n const original = this.points[point.index].properties;\n const result = this.options.map(original);\n return clone && result === original ? extend({}, result) : result;\n }\n\n}\n\nfunction createCluster(x, y, id, numPoints, properties) {\n return {\n x: fround(x),\n // weighted cluster center; round for consistency with Float32Array index\n y: fround(y),\n zoom: Infinity,\n // the last zoom the cluster was processed at\n id,\n // encodes index of the first child of the cluster and its zoom level\n parentId: -1,\n // parent cluster id\n numPoints,\n properties\n };\n}\n\nfunction createPointCluster(p, id) {\n const [x, y] = p.geometry.coordinates;\n return {\n x: fround(lngX(x)),\n // projected point coordinates\n y: fround(latY(y)),\n zoom: Infinity,\n // the last zoom the point was processed at\n index: id,\n // index of the source feature in the original input array,\n parentId: -1 // parent cluster id\n\n };\n}\n\nfunction getClusterJSON(cluster) {\n return {\n type: 'Feature',\n id: cluster.id,\n properties: getClusterProperties(cluster),\n geometry: {\n type: 'Point',\n coordinates: [xLng(cluster.x), yLat(cluster.y)]\n }\n };\n}\n\nfunction getClusterProperties(cluster) {\n const count = cluster.numPoints;\n const abbrev = count >= 10000 ? `${Math.round(count / 1000)}k` : count >= 1000 ? `${Math.round(count / 100) / 10}k` : count;\n return extend(extend({}, cluster.properties), {\n cluster: true,\n cluster_id: cluster.id,\n point_count: count,\n point_count_abbreviated: abbrev\n });\n} // longitude/latitude to spherical mercator in [0..1] range\n\n\nfunction lngX(lng) {\n return lng / 360 + 0.5;\n}\n\nfunction latY(lat) {\n const sin = Math.sin(lat * Math.PI / 180);\n const y = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n return y < 0 ? 0 : y > 1 ? 1 : y;\n} // spherical mercator to longitude/latitude\n\n\nfunction xLng(x) {\n return (x - 0.5) * 360;\n}\n\nfunction yLat(y) {\n const y2 = (180 - y * 360) * Math.PI / 180;\n return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n\nfunction extend(dest, src) {\n for (const id in src) dest[id] = src[id];\n\n return dest;\n}\n\nfunction getX(p) {\n return p.x;\n}\n\nfunction getY(p) {\n return p.y;\n}\n\nexport { Supercluster as default };\n","import Supercluster from '../../../../../supercluster@7.1.5/node_modules/supercluster/index.js';\nimport fastDeepEqual from '../../../../../fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n\nfunction __rest(s, e) {\n var t = {};\n\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nclass Cluster {\n constructor({\n markers,\n position\n }) {\n this.markers = markers;\n\n if (position) {\n if (position instanceof google.maps.LatLng) {\n this._position = position;\n } else {\n this._position = new google.maps.LatLng(position);\n }\n }\n }\n\n get bounds() {\n if (this.markers.length === 0 && !this._position) {\n return undefined;\n }\n\n return this.markers.reduce((bounds, marker) => {\n return bounds.extend(marker.getPosition());\n }, new google.maps.LatLngBounds(this._position, this._position));\n }\n\n get position() {\n return this._position || this.bounds.getCenter();\n }\n /**\n * Get the count of **visible** markers.\n */\n\n\n get count() {\n return this.markers.filter(m => m.getVisible()).length;\n }\n /**\n * Add a marker to the cluster.\n */\n\n\n push(marker) {\n this.markers.push(marker);\n }\n /**\n * Cleanup references and remove marker from map.\n */\n\n\n delete() {\n if (this.marker) {\n this.marker.setMap(null);\n delete this.marker;\n }\n\n this.markers.length = 0;\n }\n\n}\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @hidden\n */\n\n\nclass AbstractAlgorithm {\n constructor({\n maxZoom = 16\n }) {\n this.maxZoom = maxZoom;\n }\n /**\n * Helper function to bypass clustering based upon some map state such as\n * zoom, number of markers, etc.\n *\n * ```typescript\n * cluster({markers, map}: AlgorithmInput): Cluster[] {\n * if (shouldBypassClustering(map)) {\n * return this.noop({markers, map})\n * }\n * }\n * ```\n */\n\n\n noop({\n markers\n }) {\n return noop(markers);\n }\n\n}\n/**\n * @hidden\n */\n\n\nconst noop = markers => {\n const clusters = markers.map(marker => new Cluster({\n position: marker.getPosition(),\n markers: [marker]\n }));\n return clusters;\n};\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A very fast JavaScript algorithm for geospatial point clustering using KD trees.\n *\n * @see https://www.npmjs.com/package/supercluster for more information on options.\n */\n\n\nclass SuperClusterAlgorithm extends AbstractAlgorithm {\n constructor(_a) {\n var {\n maxZoom,\n radius = 60\n } = _a,\n options = __rest(_a, [\"maxZoom\", \"radius\"]);\n\n super({\n maxZoom\n });\n this.superCluster = new Supercluster(Object.assign({\n maxZoom: this.maxZoom,\n radius\n }, options));\n this.state = {\n zoom: null\n };\n }\n\n calculate(input) {\n let changed = false;\n\n if (!fastDeepEqual(input.markers, this.markers)) {\n changed = true; // TODO use proxy to avoid copy?\n\n this.markers = [...input.markers];\n const points = this.markers.map(marker => {\n return {\n type: \"Feature\",\n geometry: {\n type: \"Point\",\n coordinates: [marker.getPosition().lng(), marker.getPosition().lat()]\n },\n properties: {\n marker\n }\n };\n });\n this.superCluster.load(points);\n }\n\n const state = {\n zoom: input.map.getZoom()\n };\n\n if (!changed) {\n if (this.state.zoom > this.maxZoom && state.zoom > this.maxZoom) ;else {\n changed = changed || !fastDeepEqual(this.state, state);\n }\n }\n\n this.state = state;\n\n if (changed) {\n this.clusters = this.cluster(input);\n }\n\n return {\n clusters: this.clusters,\n changed\n };\n }\n\n cluster({\n map\n }) {\n return this.superCluster.getClusters([-180, -90, 180, 90], Math.round(map.getZoom())).map(this.transformCluster.bind(this));\n }\n\n transformCluster({\n geometry: {\n coordinates: [lng, lat]\n },\n properties\n }) {\n if (properties.cluster) {\n return new Cluster({\n markers: this.superCluster.getLeaves(properties.cluster_id, Infinity).map(leaf => leaf.properties.marker),\n position: new google.maps.LatLng({\n lat,\n lng\n })\n });\n } else {\n const marker = properties.marker;\n return new Cluster({\n markers: [marker],\n position: marker.getPosition()\n });\n }\n }\n\n}\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Provides statistics on all clusters in the current render cycle for use in {@link Renderer.render}.\n */\n\n\nclass ClusterStats {\n constructor(markers, clusters) {\n this.markers = {\n sum: markers.length\n };\n const clusterMarkerCounts = clusters.map(a => a.count);\n const clusterMarkerSum = clusterMarkerCounts.reduce((a, b) => a + b, 0);\n this.clusters = {\n count: clusters.length,\n markers: {\n mean: clusterMarkerSum / clusters.length,\n sum: clusterMarkerSum,\n min: Math.min(...clusterMarkerCounts),\n max: Math.max(...clusterMarkerCounts)\n }\n };\n }\n\n}\n\nclass DefaultRenderer {\n /**\n * The default render function for the library used by {@link MarkerClusterer}.\n *\n * Currently set to use the following:\n *\n * ```typescript\n * // change color if this cluster has more markers than the mean cluster\n * const color =\n * count > Math.max(10, stats.clusters.markers.mean)\n * ? \"#ff0000\"\n * : \"#0000ff\";\n *\n * // create svg url with fill color\n * const svg = window.btoa(`\n * \n * \n * \n * \n * \n * `);\n *\n * // create marker using svg icon\n * return new google.maps.Marker({\n * position,\n * icon: {\n * url: `data:image/svg+xml;base64,${svg}`,\n * scaledSize: new google.maps.Size(45, 45),\n * },\n * label: {\n * text: String(count),\n * color: \"rgba(255,255,255,0.9)\",\n * fontSize: \"12px\",\n * },\n * // adjust zIndex to be above other markers\n * zIndex: 1000 + count,\n * });\n * ```\n */\n render({\n count,\n position\n }, stats) {\n // change color if this cluster has more markers than the mean cluster\n const color = count > Math.max(10, stats.clusters.markers.mean) ? \"#ff0000\" : \"#0000ff\"; // create svg url with fill color\n\n const svg = window.btoa(`\n \n \n \n \n `); // create marker using svg icon\n\n return new google.maps.Marker({\n position,\n icon: {\n url: `data:image/svg+xml;base64,${svg}`,\n scaledSize: new google.maps.Size(45, 45)\n },\n label: {\n text: String(count),\n color: \"rgba(255,255,255,0.9)\",\n fontSize: \"12px\"\n },\n title: `Cluster of ${count} markers`,\n // adjust zIndex to be above other markers\n zIndex: Number(google.maps.Marker.MAX_ZINDEX) + count\n });\n }\n\n}\n/**\n * Copyright 2019 Google LLC. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Extends an object's prototype by another's.\n *\n * @param type1 The Type to be extended.\n * @param type2 The Type to extend with.\n * @ignore\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n\nfunction extend(type1, type2) {\n /* istanbul ignore next */\n // eslint-disable-next-line prefer-const\n for (let property in type2.prototype) {\n type1.prototype[property] = type2.prototype[property];\n }\n}\n/**\n * @ignore\n */\n\n\nclass OverlayViewSafe {\n constructor() {\n // MarkerClusterer implements google.maps.OverlayView interface. We use the\n // extend function to extend MarkerClusterer with google.maps.OverlayView\n // because it might not always be available when the code is defined so we\n // look for it at the last possible moment. If it doesn't exist now then\n // there is no point going ahead :)\n extend(OverlayViewSafe, google.maps.OverlayView);\n }\n\n}\n/**\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\nvar MarkerClustererEvents;\n\n(function (MarkerClustererEvents) {\n MarkerClustererEvents[\"CLUSTERING_BEGIN\"] = \"clusteringbegin\";\n MarkerClustererEvents[\"CLUSTERING_END\"] = \"clusteringend\";\n MarkerClustererEvents[\"CLUSTER_CLICK\"] = \"click\";\n})(MarkerClustererEvents || (MarkerClustererEvents = {}));\n\nconst defaultOnClusterClickHandler = (_, cluster, map) => {\n map.fitBounds(cluster.bounds);\n};\n/**\n * MarkerClusterer creates and manages per-zoom-level clusters for large amounts\n * of markers. See {@link MarkerClustererOptions} for more details.\n *\n */\n\n\nclass MarkerClusterer extends OverlayViewSafe {\n constructor({\n map,\n markers = [],\n algorithm = new SuperClusterAlgorithm({}),\n renderer = new DefaultRenderer(),\n onClusterClick = defaultOnClusterClickHandler\n }) {\n super();\n this.markers = [...markers];\n this.clusters = [];\n this.algorithm = algorithm;\n this.renderer = renderer;\n this.onClusterClick = onClusterClick;\n\n if (map) {\n this.setMap(map);\n }\n }\n\n addMarker(marker, noDraw) {\n if (this.markers.includes(marker)) {\n return;\n }\n\n this.markers.push(marker);\n\n if (!noDraw) {\n this.render();\n }\n }\n\n addMarkers(markers, noDraw) {\n markers.forEach(marker => {\n this.addMarker(marker, true);\n });\n\n if (!noDraw) {\n this.render();\n }\n }\n\n removeMarker(marker, noDraw) {\n const index = this.markers.indexOf(marker);\n\n if (index === -1) {\n // Marker is not in our list of markers, so do nothing:\n return false;\n }\n\n marker.setMap(null);\n this.markers.splice(index, 1); // Remove the marker from the list of managed markers\n\n if (!noDraw) {\n this.render();\n }\n\n return true;\n }\n\n removeMarkers(markers, noDraw) {\n let removed = false;\n markers.forEach(marker => {\n removed = this.removeMarker(marker, true) || removed;\n });\n\n if (removed && !noDraw) {\n this.render();\n }\n\n return removed;\n }\n\n clearMarkers(noDraw) {\n this.markers.length = 0;\n\n if (!noDraw) {\n this.render();\n }\n }\n /**\n * Recalculates and draws all the marker clusters.\n */\n\n\n render() {\n const map = this.getMap();\n\n if (map instanceof google.maps.Map && this.getProjection()) {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_BEGIN, this);\n const {\n clusters,\n changed\n } = this.algorithm.calculate({\n markers: this.markers,\n map,\n mapCanvasProjection: this.getProjection()\n }); // allow algorithms to return flag on whether the clusters/markers have changed\n\n if (changed || changed == undefined) {\n // reset visibility of markers and clusters\n this.reset(); // store new clusters\n\n this.clusters = clusters;\n this.renderClusters();\n }\n\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTERING_END, this);\n }\n }\n\n onAdd() {\n this.idleListener = this.getMap().addListener(\"idle\", this.render.bind(this));\n this.render();\n }\n\n onRemove() {\n google.maps.event.removeListener(this.idleListener);\n this.reset();\n }\n\n reset() {\n this.markers.forEach(marker => marker.setMap(null));\n this.clusters.forEach(cluster => cluster.delete());\n this.clusters = [];\n }\n\n renderClusters() {\n // generate stats to pass to renderers\n const stats = new ClusterStats(this.markers, this.clusters);\n const map = this.getMap();\n this.clusters.forEach(cluster => {\n if (cluster.markers.length === 1) {\n cluster.marker = cluster.markers[0];\n } else {\n cluster.marker = this.renderer.render(cluster, stats);\n\n if (this.onClusterClick) {\n cluster.marker.addListener(\"click\",\n /* istanbul ignore next */\n event => {\n google.maps.event.trigger(this, MarkerClustererEvents.CLUSTER_CLICK, cluster);\n this.onClusterClick(event, cluster, map);\n });\n }\n }\n\n cluster.marker.setMap(map);\n });\n }\n\n}\n\nexport { AbstractAlgorithm, Cluster, ClusterStats, DefaultRenderer, MarkerClusterer, MarkerClustererEvents, SuperClusterAlgorithm, defaultOnClusterClickHandler, noop };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { drawingManagerMappedProps } from '../utils/mapped-props-by-map-element.js';\nimport { getPropsValues, bindProps } from '../utils/helpers.js';\n\n//\n\n/**\n * DrawingManager component\n * @displayName GmapDrawingManager\n * @see [source code](/guide/drawing-manager.html#source-code)\n * @see [Official documentation](https://developers.google.com/maps/documentation/javascript/drawinglayer)\n * @see [Official reference](https://developers.google.com/maps/documentation/javascript/reference/drawing)\n */\nvar script = {\n name: 'DrawingManager',\n mixins: [mapElementMixin],\n provide() {\n // Infowindow needs this to be immediately available\n const promise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n // TODO: analyze the below line because I think it can be removed\n ...this.options,\n map,\n ...getPropsValues(this, drawingManagerMappedProps),\n };\n\n const { options: extraOptions, ...finalOptions } = initialOptions;\n\n this.drawingModes = Object.keys(finalOptions).reduce((modes, opt) => {\n const val = opt.split('Options');\n\n if (val.length > 1) {\n modes.push(val[0]);\n }\n\n return modes;\n }, []);\n\n const position =\n this.position && google.maps.ControlPosition[this.position]\n ? google.maps.ControlPosition[this.position]\n : google.maps.ControlPosition.TOP_LEFT;\n\n finalOptions.drawingMode = null;\n finalOptions.drawingControl = !this.$scopedSlots.default;\n finalOptions.drawingControlOptions = {\n drawingModes: this.drawingModes,\n position,\n };\n\n // https://stackoverflow.com/questions/1606797/use-of-apply-with-new-operator-is-this-possible\n this.$drawingManagerObject = new google.maps.drawing.DrawingManager(\n finalOptions\n );\n\n bindProps(this, this.$drawingManagerObject, drawingManagerMappedProps);\n\n this.$drawingManagerObject.addListener('overlaycomplete', (e) =>\n this.addShape(e)\n );\n\n this.$map.addListener('click', this.clearSelection);\n\n if (this && this.finalShapes && this.finalShapes.length) {\n this.drawAll();\n }\n\n return this.$drawingManagerObject;\n })\n .catch((error) => {\n throw error;\n });\n\n // TODO: analyze the efects of only returns the instance and remove completely the promise\n this.$drawingManagerPromise = promise;\n return { $drawingManagerPromise: promise };\n },\n props: {\n /**\n * The circle options\n * @see [circleOptions interface](https://developers.google.com/maps/documentation/javascript/reference/polygon#CircleOptions)\n */\n circleOptions: {\n type: Object,\n default: undefined,\n },\n /**\n * The marker options\n * @see [markerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions)\n */\n markerOptions: {\n type: Object,\n default: undefined,\n },\n /**\n * The polygon options\n * @see [polygonOptions interface](https://developers.google.com/maps/documentation/javascript/reference/polygon#PolygonOptions)\n */\n polygonOptions: {\n type: Object,\n default: undefined,\n },\n /**\n * The polyline options\n * @see [polylineOptions interface](https://developers.google.com/maps/documentation/javascript/reference/polygon#PolylineOptions)\n */\n polylineOptions: {\n type: Object,\n default: undefined,\n },\n /**\n * The rectangle options\n * @see [rectangleOptions interface](https://developers.google.com/maps/documentation/javascript/reference/polygon#RectangleOptions)\n */\n rectangleOptions: {\n type: Object,\n default: undefined,\n },\n /**\n * The position of the toolbar\n * **Possible values**: `'TOP_CENTER', 'TOP_LEFT', 'TOP_RIGHT', 'LEFT_TOP', 'RIGHT_TOP', 'LEFT_CENTER',\n * 'RIGHT_CENTER', 'LEFT_BOTTOM', 'RIGHT_BOTTOM', 'BOTTOM_CENTER', 'BOTTOM_LEFT', 'BOTTOM_RIGHT'`\n */\n position: {\n type: String,\n default: '',\n },\n /**\n * An array of shapes that you can set to render in the map and saves on it the new shapes that you add.\n */\n shapes: {\n type: Array,\n required: true,\n },\n },\n data() {\n return {\n selectedShape: null,\n drawingModes: [],\n options: {\n drawingMode: null,\n drawingControl: true,\n drawingControlOptions: {},\n },\n finalShapes: [],\n };\n },\n watch: {\n position(position) {\n if (this.$drawingManagerObject) {\n const drawingControlOptions = {\n position:\n position && google.maps.ControlPosition[position]\n ? google.maps.ControlPosition[position]\n : google.maps.ControlPosition.TOP_LEFT,\n drawingModes: this.drawingModes,\n };\n this.$drawingManagerObject.setOptions({ drawingControlOptions });\n }\n },\n circleOptions(circleOptions) {\n if (this.$drawingManagerObject) {\n this.$drawingManagerObject.setOptions({ circleOptions });\n }\n },\n markerOptions(markerOptions) {\n if (this.$drawingManagerObject) {\n this.$drawingManagerObject.setOptions({ markerOptions });\n }\n },\n polygonOptions(polygonOptions) {\n if (this.$drawingManagerObject) {\n this.$drawingManagerObject.setOptions({ polygonOptions });\n }\n },\n polylineOptions(polylineOptions) {\n if (this.$drawingManagerObject) {\n this.$drawingManagerObject.setOptions({ polylineOptions });\n }\n },\n rectangleOptions(rectangleOptions) {\n if (this.$drawingManagerObject) {\n this.$drawingManagerObject.setOptions({ rectangleOptions });\n }\n },\n },\n mounted() {\n this.finalShapes = [...this.shapes];\n },\n destroyed() {\n this.clearAll();\n\n // Note: not all Google Maps components support maps\n if (this.$drawingManagerObject && this.$drawingManagerObject.setMap) {\n this.$drawingManagerObject.setMap(null);\n }\n },\n methods: {\n /**\n * The setDrawingMode method is binded into the default component slot\n *\n * @method setDrawingMode\n * @param {string} mode - mode - Possible values 'marker', 'circle', 'polygon', 'polyline', 'rectangle', null\n * @returns {void}\n * @public\n */\n setDrawingMode(mode) {\n this.$drawingManagerObject.setDrawingMode(mode);\n },\n drawAll() {\n const shapeType = {\n circle: google.maps.Circle,\n marker: google.maps.Marker,\n polygon: google.maps.Polygon,\n polyline: google.maps.Polyline,\n rectangle: google.maps.Rectangle,\n };\n\n const self = this;\n this.finalShapes.forEach((shape) => {\n const shapeDrawing = new shapeType[shape.type](shape.overlay);\n shapeDrawing.setMap(this.$map);\n shape.overlay = shapeDrawing;\n google.maps.event.addListener(shapeDrawing, 'click', () => {\n self.setSelection(shape);\n });\n });\n },\n clearAll() {\n this.clearSelection();\n this.finalShapes.forEach((shape) => {\n shape.overlay.setMap(null);\n });\n },\n clearSelection() {\n if (this.selectedShape) {\n this.selectedShape.overlay.set('fillColor', '#777');\n this.selectedShape.overlay.set('strokeColor', '#999');\n this.selectedShape.overlay.setEditable(false);\n this.selectedShape.overlay.setDraggable(false);\n this.selectedShape = null;\n }\n },\n setSelection(shape) {\n this.clearSelection();\n this.selectedShape = shape;\n shape.overlay.setEditable(true);\n shape.overlay.setDraggable(true);\n this.selectedShape.overlay.set('fillColor', '#555');\n this.selectedShape.overlay.set('strokeColor', '#777');\n },\n /**\n * The deleteSelection method is binded into the default component slot\n *\n * @method deleteSelection\n * @param - It doesn't requires any parameter\n * @returns {void}\n * @public\n */\n deleteSelection() {\n if (this.selectedShape) {\n this.selectedShape.overlay.setMap(null);\n const index = this.finalShapes.indexOf(this.selectedShape);\n if (index > -1) {\n this.finalShapes.splice(index, 1);\n }\n }\n },\n addShape(shape) {\n this.setDrawingMode(null);\n this.finalShapes.push(shape);\n\n /**\n * update:shapes event\n * @event update:shapes\n * @property {array} place `this.finalShapes`\n */\n this.$emit('update:shapes', [...this.finalShapes]);\n\n const self = this;\n google.maps.event.addListener(shape.overlay, 'click', () => {\n self.setSelection(shape);\n });\n google.maps.event.addListener(shape.overlay, 'rightclick', () => {\n self.deleteSelection();\n });\n this.setSelection(shape);\n },\n },\n};\n\nexport { script as default };\n","import script from './drawing-manager.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_vm._t(\"default\",null,{\"setDrawingMode\":_vm.setDrawingMode,\"deleteSelection\":_vm.deleteSelection})],2)};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { heatMapLayerMappedProps } from '../utils/mapped-props-by-map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\n\n/**\n * HeatmapLayer component\n * @displayName HeatmapLayer\n * @see [source code](/guide/heatmap-layer.html#source-code)\n * @see [Official documentation](https://developers.google.com/maps/documentation/javascript/heatmaplayer)\n */\nvar script = {\n name: 'HeatmapLayer',\n mixins: [mapElementMixin],\n render() {\n return '';\n },\n provide() {\n const events = [];\n\n // Infowindow needs this to be immediately available\n const promise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n // TODO: analyze the below line because I think it can be removed\n ...this.options,\n map: this.$map,\n ...getPropsValues(this, heatMapLayerMappedProps),\n };\n\n const { options: extraOptions, ...finalOptions } = initialOptions;\n\n this.$heatmapLayerObject = new google.maps.visualization.HeatmapLayer(\n finalOptions\n );\n\n bindProps(this, this.$heatmapLayerObject, heatMapLayerMappedProps);\n bindEvents(this, this.$heatmapLayerObject, events);\n\n return this.$heatmapLayerObject;\n })\n .catch((error) => {\n throw error;\n });\n\n // TODO: analyze the efects of only returns the instance and remove completely the promise\n this.$heatmapLayerPromise = promise;\n return { $heatmapLayerPromise: promise };\n },\n props: {\n /**\n * Extra options that you want to pass to the component\n */\n options: {\n type: Object,\n default: () => {},\n },\n /**\n * The heat map data, is an array of `new google.maps.LatLng`,\n * @see [heatmap options](https://developers.google.com/maps/documentation/javascript/heatmaplayer#add-a-heatmap-layer)\n * @example `[new google.maps.LatLng(37.782, -122.447)]`\n */\n data: {\n type: Array,\n default: undefined,\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$heatmapLayerObject && this.$heatmapLayerObject.setMap) {\n this.$heatmapLayerObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './heatmap-layer.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = undefined;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n {},\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { infoWindowMappedProps } from '../utils/mapped-props-by-map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\n\n//\n\n/**\n * InfoWindow component\n * @displayName Info-Window\n * @see [source code](/guide/info-window.html#source-code)\n * @see [Official documentation](https://developers.google.com/maps/documentation/javascript/infowindows)\n * @see [Official reference](https://developers.google.com/maps/documentation/javascript/reference/info-window)\n */\nvar script = {\n name: 'InfoWindow',\n mixins: [mapElementMixin],\n inject: {\n $markerPromise: {\n default: null,\n },\n },\n provide() {\n const events = ['domready', 'closeclick', 'content_changed'];\n\n // Infowindow needs this to be immediately available\n const promise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n // TODO: analyze the below line because I think it can be removed\n ...this.options,\n map,\n ...getPropsValues(this, infoWindowMappedProps),\n };\n\n const {\n options: extraOptions,\n position,\n ...finalOptions\n } = initialOptions;\n\n finalOptions.content = this.$refs.flyaway;\n\n if (this.$markerPromise) {\n this.$markerPromise.then((markerObject) => {\n this.$markerObject = markerObject;\n return markerObject;\n });\n }\n\n this.$infoWindowObject = new google.maps.InfoWindow(finalOptions);\n\n bindProps(this, this.$infoWindowObject, infoWindowMappedProps);\n bindEvents(this, this.$infoWindowObject, events);\n\n // TODO: This function names should be analyzed\n /* eslint-disable no-underscore-dangle -- old style */\n this._openInfoWindow();\n this.$watch('opened', () => {\n this._openInfoWindow();\n });\n /* eslint-enable no-underscore-dangle */\n\n return this.$infoWindowObject;\n })\n .catch((error) => {\n throw error;\n });\n\n // TODO: analyze the efects of only returns the instance and remove completely the promise\n this.$infoWindowPromise = promise;\n return { $infoWindowPromise: promise };\n },\n props: {\n /**\n * NOTE: This prop overrides the content of the default slot, use only one of them, not both at the same time\n * Content to display in the InfoWindow. This can be an HTML element, a plain-text string, or a string containing HTML. The InfoWindow will be sized according to the content. To set an explicit size for the content, set content to be a HTML element with that size.\n * @value undefined\n * @see [InfoWindow content](https://developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindowOptions.content)\n */\n content: {\n type: [String, Object],\n default: undefined,\n },\n /**\n * Determines if the info-window is open or not\n */\n opened: {\n type: Boolean,\n default: true,\n },\n /**\n * Contains the LatLng at which this info window is anchored.\n * Note: An InfoWindow may be attached either to a Marker object\n * (in which case its position is based on the marker's location)\n * or on the map itself at a specified LatLng.\n *\n * The LatLng at which to display this InfoWindow. If the InfoWindow is opened with an anchor, the anchor's position will be used instead.\n * @value undefined\n * @type LatLng|LatLngLiteral\n * @see [InfoWindow position](https://developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindowOptions.position)\n */\n position: {\n type: Object,\n default: undefined,\n },\n /**\n * All InfoWindows are displayed on the map in order of their zIndex, with higher values displaying in front of InfoWindows with lower values. By default, InfoWindows are displayed according to their latitude, with InfoWindows of lower latitudes appearing in front of InfoWindows at higher latitudes. InfoWindows are always displayed in front of markers.\n * @value 0\n * @see [InfoWindow position](https://developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindowOptions.zIndex)\n */\n zIndex: {\n type: Number,\n default: 0,\n },\n /**\n * Extra options that you want to pass to the component\n */\n options: {\n type: Object,\n required: false,\n default: undefined,\n },\n },\n mounted() {\n const el = this.$refs.flyaway;\n el.parentNode.removeChild(el);\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$infoWindowObject && this.$infoWindowObject.setMap) {\n this.$infoWindowObject.setMap(null);\n }\n },\n methods: {\n // TODO: we need to analyze the following method name\n // eslint-disable-next-line no-underscore-dangle -- old code\n _openInfoWindow() {\n if (this.opened) {\n if (this.$markerObject !== null) {\n this.$infoWindowObject.open(this.$map, this.$markerObject);\n } else {\n this.$infoWindowObject.open(this.$map);\n }\n } else {\n this.$infoWindowObject.close();\n }\n },\n },\n};\n\nexport { script as default };\n","import script from './info-window.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{ref:\"flyaway\"},[_vm._t(\"default\")],2)])};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\nimport { kmlLayerMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n/**\n * KmlLayer component\n * @displayName Kml-Layer\n * @see [source code](/guide/kml-layer.html#source-code)\n * @see [Official documentation](https://developers.google.com/maps/documentation/javascript/kmllayer)\n * @see [Official reference](https://developers.google.com/maps/documentation/javascript/reference/kml)\n */\nvar script = {\n name: 'KmlLayer',\n mixins: [mapElementMixin],\n render() {\n return '';\n },\n provide() {\n const events = [\n 'click',\n 'rightclick',\n 'dblclick',\n 'mouseup',\n 'mousedown',\n 'mouseover',\n 'mouseout',\n ];\n\n // Infowindow needs this to be immediately available\n const promise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n // TODO: analyze the below line because I think it can be removed\n ...this.options,\n map,\n ...getPropsValues(this, kmlLayerMappedProps),\n };\n\n const { options: extraOptions, ...finalOptions } = initialOptions;\n\n this.$kmlLayerObject = new google.maps.KmlLayer(finalOptions);\n\n bindProps(this, this.$kmlLayerObject, kmlLayerMappedProps);\n bindEvents(this, this.$kmlLayerObject, events);\n\n return this.$kmlLayerObject;\n })\n .catch((error) => {\n throw error;\n });\n\n this.$kmlLayerPromise = promise;\n return { $kmlLayerPromise: promise };\n },\n props: {\n /**\n * If true, the layer receives mouse events. Default value is true.\n * @see [KmlLayerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/kml#KmlLayerOptions.clickable)\n */\n clickable: {\n type: Boolean,\n default: true,\n },\n /**\n * Specifies the Map on which to render the KmlLayer. You can hide a KmlLayer by setting this value to null within the setMap() method\n * @see [KmlLayerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/kml#KmlLayerOptions.map)\n */\n map: {\n type: Object,\n default: undefined,\n },\n /**\n * By default, the input map is centered and zoomed to the bounding box of the contents of the layer. If this option is set to true, the viewport is\n * left unchanged, unless the map's center and zoom were never set.\n * @see [KmlLayerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/kml#KmlLayerOptions.preserveViewport)\n */\n preserveViewport: {\n type: Boolean,\n default: false,\n },\n /**\n * Whether to render the screen overlays. Default true.\n * @see [KmlLayerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/kml#KmlLayerOptions.screenOverlays)\n */\n screenOverlays: {\n type: Boolean,\n default: false,\n },\n /**\n * Suppress the rendering of info windows when layer features are clicked.\n * @see [KmlLayerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/kml#KmlLayerOptions.suppressInfoWindows)\n */\n suppressInfoWindows: {\n type: Boolean,\n default: undefined,\n },\n /**\n * The URL of the KML document to display.\n * @see [KmlLayerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/kml#KmlLayerOptions.url)\n */\n url: {\n type: String,\n default: '',\n },\n /**\n * The z-index of the layer.\n * @see [KmlLayerOptions interface](https://developers.google.com/maps/documentation/javascript/reference/kml#KmlLayerOptions.zIndex)\n */\n zIndex: {\n type: Number,\n default: undefined,\n },\n /**\n * More options that you can pass to the component\n * @value boolean\n */\n options: {\n type: Object,\n default: undefined,\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$kmlLayerObject && this.$kmlLayerObject.setMap) {\n this.$kmlLayerObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './kml-layer.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = undefined;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n {},\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","/* eslint-disable no-underscore-dangle -- old style, should be analyzed */\n\n/**\n * @class MountableMixin\n *\n * Mixin for objects that are mounted by Google Maps Javascript API.\n *\n * These are objects that are sensitive to element resize operations\n * so it exposes a property which accepts a bus\n * ## The mixin code:\n * ```js\n export default {\n props: ['resizeBus'],\n\n data() {\n return {\n _actualResizeBus: null,\n };\n },\n\n created() {\n if (typeof this.resizeBus === 'undefined') {\n this.$data._actualResizeBus = this.$gmapDefaultResizeBus;\n } else {\n this.$data._actualResizeBus = this.resizeBus;\n }\n },\n\n methods: {\n _resizeCallback() {\n this.resize();\n },\n _delayedResizeCallback() {\n this.$nextTick(() => this._resizeCallback());\n },\n },\n\n watch: {\n resizeBus(newVal) {\n this.$data._actualResizeBus = newVal;\n },\n '$data._actualResizeBus': function actualResizeBus(newVal, oldVal) {\n if (oldVal) {\n oldVal.$off('resize', this._delayedResizeCallback);\n }\n if (newVal) {\n newVal.$on('resize', this._delayedResizeCallback);\n }\n },\n },\n\n destroyed() {\n if (this.$data._actualResizeBus) {\n this.$data._actualResizeBus.$off('resize', this._delayedResizeCallback);\n }\n },\n };\n * ```\n * @property {Function|undefined} resizeBus Vue props to set your custom resize bus function, otherwise it takes the default `$gmapDefaultResizeBus`\n * @property {Function|undefined} _actualResizeBus The current default resize bus function, **this should not be used outside of this mixin**\n */\nvar mountableMixin = {\n props: ['resizeBus'],\n data: function data() {\n return {\n _actualResizeBus: null\n };\n },\n created: function created() {\n if (typeof this.resizeBus === 'undefined') {\n this.$data._actualResizeBus = this.$gmapDefaultResizeBus;\n } else {\n this.$data._actualResizeBus = this.resizeBus;\n }\n },\n methods: {\n _resizeCallback: function _resizeCallback() {\n this.resize();\n },\n _delayedResizeCallback: function _delayedResizeCallback() {\n var _this = this;\n\n this.$nextTick(function () {\n return _this._resizeCallback();\n });\n }\n },\n watch: {\n resizeBus: function resizeBus(newVal) {\n this.$data._actualResizeBus = newVal;\n },\n '$data._actualResizeBus': function (newVal, oldVal) {\n if (oldVal) {\n oldVal.$off('resize', this._delayedResizeCallback);\n }\n\n if (newVal) {\n newVal.$on('resize', this._delayedResizeCallback);\n }\n }\n },\n destroyed: function destroyed() {\n if (this.$data._actualResizeBus) {\n this.$data._actualResizeBus.$off('resize', this._delayedResizeCallback);\n }\n }\n};\n/* eslint-enable no-underscore-dangle */\n\nexport { mountableMixin as default };\n","import mountableMixin from '../mixins/mountable.js';\nimport { getPropsValues, bindProps, bindEvents, twoWayBindingWrapper, watchPrimitiveProperties } from '../utils/helpers.js';\nimport { mapMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n//\n\n/**\n * Map component\n * @displayName Map\n * @see [source code](/guide/map.html#source-code)\n * @see [Official documentation](https://developers.google.com/maps/documentation/javascript/basics)\n * @see [Official reference](https://developers.google.com/maps/documentation/javascript/reference/map)\n */\nvar script = {\n name: 'MapLayer',\n mixins: [mountableMixin],\n provide() {\n this.$mapPromise = new Promise((resolve, reject) => {\n this.$mapPromiseDeferred = { resolve, reject };\n });\n\n return {\n $mapPromise: this.$mapPromise,\n };\n },\n props: {\n /**\n * The initial Map center.\n * @see https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions\n */\n center: {\n type: Object,\n required: true,\n },\n /**\n * The initial Map zoom level. Valid values: Integers between zero, and up to the supported maximum zoom level.\n * @see https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions\n */\n zoom: {\n type: Number,\n required: false,\n default: undefined,\n },\n /**\n * The heading for aerial imagery in degrees measured clockwise from cardinal direction North. Headings are snapped to the nearest available angle for which imagery is available.\n * @see https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions\n */\n heading: {\n type: Number,\n default: undefined,\n },\n /**\n * The initial Map mapTypeId. Defaults to ROADMAP.\n * @see https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions\n */\n mapTypeId: {\n type: String,\n default: 'roadmap',\n },\n /**\n * For vector maps, sets the angle of incidence of the map. The allowed values are restricted depending on the zoom level of the map. For raster maps, controls the automatic switching behavior for the angle of incidence of the map. The only allowed values are 0 and 45. The value 0 causes the map to always use a 0° overhead view regardless of the zoom level and viewport. The value 45 causes the tilt angle to automatically switch to 45 whenever 45° imagery is available for the current zoom level and viewport, and switch back to 0 whenever 45° imagery is not available (this is the default behavior). 45° imagery is only available for satellite and hybrid map types, within some locations, and at some zoom levels. Note: getTilt returns the current tilt angle, not the value specified by this option. Because getTilt and this option refer to different things, do not bind() the tilt property; doing so may yield unpredictable effects.\n * @see https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions\n */\n tilt: {\n type: Number,\n default: undefined,\n },\n /**\n * Extra options that you want pass to the component\n */\n options: {\n type: Object,\n default: undefined,\n },\n },\n data() {\n return {\n recyclePrefix: '__gmc__',\n };\n },\n computed: {\n finalLat() {\n return this.center && typeof this.center.lat === 'function'\n ? this.center.lat()\n : this.center.lat;\n },\n finalLng() {\n return this.center && typeof this.center.lng === 'function'\n ? this.center.lng()\n : this.center.lng;\n },\n finalLatLng() {\n return { lat: this.finalLat, lng: this.finalLng };\n },\n },\n watch: {\n zoom(zoom) {\n if (this.$mapObject) {\n this.$mapObject.setZoom(zoom);\n }\n },\n },\n beforeDestroy() {\n const recycleKey = this.getRecycleKey();\n if (window[recycleKey]) {\n window[recycleKey].div = this.$mapObject.getDiv();\n }\n },\n mounted() {\n return this.$gmapApiPromiseLazy()\n .then(() => {\n const events = [\n 'bounds_changed',\n 'click',\n 'dblclick',\n 'drag',\n 'dragend',\n 'dragstart',\n 'idle',\n 'mousemove',\n 'mouseout',\n 'mouseover',\n 'resize',\n 'rightclick',\n 'tilesloaded',\n ];\n\n // getting the DOM element where to create the map\n const element = this.$refs['vue-map'];\n\n // creating the map\n const initialOptions = {\n ...this.options,\n ...getPropsValues(this, mapMappedProps),\n };\n\n // don't use delete keyword in order to create a more predictable code for the engine\n const { options: extraOptions, ...finalOptions } = initialOptions;\n const options = finalOptions;\n\n const recycleKey = this.getRecycleKey();\n if (\n this &&\n this.options &&\n this.options.recycle &&\n window[recycleKey]\n ) {\n element.appendChild(window[recycleKey].div);\n this.$mapObject = window[recycleKey].map;\n this.$mapObject.setOptions(options);\n } else {\n // console.warn('[gmap-vue] New google map created')\n this.$mapObject = new google.maps.Map(element, options);\n window[recycleKey] = { map: this.$mapObject };\n }\n\n // binding properties (two and one way)\n bindProps(this, this.$mapObject, mapMappedProps);\n // binding events\n bindEvents(this, this.$mapObject, events);\n\n // manually trigger center and zoom\n twoWayBindingWrapper((increment, decrement, shouldUpdate) => {\n this.$mapObject.addListener('center_changed', () => {\n if (shouldUpdate()) {\n /**\n * This event is fired when the map center property changes. It sends the position displayed at the center of the map. If the center or bounds have not been set then the result is undefined. (types: `LatLng|undefined`)\n *\n * @event center_changed\n * @type {(LatLng|undefined)}\n */\n this.$emit('center_changed', this.$mapObject.getCenter());\n }\n decrement();\n });\n\n const updateCenter = () => {\n increment();\n this.$mapObject.setCenter(this.finalLatLng);\n };\n\n watchPrimitiveProperties(\n this,\n ['finalLat', 'finalLng'],\n updateCenter\n );\n });\n this.$mapObject.addListener('zoom_changed', () => {\n /**\n * This event is fired when the map zoom property changes. It sends the zoom of the map. If the zoom has not been set then the result is undefined. (types: `number|undefined`)\n *\n * @event zoom_changed\n * @type {(number|undefined)}\n */\n this.$emit('zoom_changed', this.$mapObject.getZoom());\n });\n this.$mapObject.addListener('bounds_changed', () => {\n /**\n * This event is fired when the viewport bounds have changed. It sends The lat/lng bounds of the current viewport.\n *\n * @event bounds_changed\n * @type {LatLngBounds}\n */\n this.$emit('bounds_changed', this.$mapObject.getBounds());\n });\n\n this.$mapPromiseDeferred.resolve(this.$mapObject);\n\n return this.$mapObject;\n })\n .catch((error) => {\n throw error;\n });\n },\n methods: {\n /**\n * This method trigger the resize event of Google Maps\n * @method resize\n * @param {undefined}\n * @returns {void}\n * @public\n */\n resize() {\n if (this.$mapObject) {\n google.maps.event.trigger(this.$mapObject, 'resize');\n }\n },\n /**\n * Preserve the previous center when resize the map\n * @method resizePreserveCenter\n * @param {undefined}\n * @returns {void}\n * @public\n */\n resizePreserveCenter() {\n if (!this.$mapObject) {\n return;\n }\n\n const oldCenter = this.$mapObject.getCenter();\n google.maps.event.trigger(this.$mapObject, 'resize');\n this.$mapObject.setCenter(oldCenter);\n },\n\n // Override mountableMixin::_resizeCallback\n // because resizePreserveCenter is usually the\n // expected behaviour\n // TODO: analyze the following disabled rule\n // eslint-disable-next-line no-underscore-dangle -- old code\n _resizeCallback() {\n this.resizePreserveCenter();\n },\n /**\n * Changes the center of the map by the given distance in pixels. If the distance is less than both the width and height of the map, the transition will be smoothly animated. Note that the map coordinate system increases from west to east (for x values) and north to south (for y values).\n * @method panBy\n * @param {number} x - Number of pixels to move the map in the x direction.\n * @param {number} y - Number of pixels to move the map in the y direction.\n * @returns {void}\n * @public\n */\n panBy(...args) {\n if (this.$mapObject) {\n this.$mapObject.panBy(...args);\n }\n },\n /**\n * Changes the center of the map to the given LatLng. If the change is less than both the width and height of the map, the transition will be smoothly animated.\n * @method panTo\n * @param {(LatLng|LatLngLiteral)} latLng - The new center latitude/longitude of the map. (types `LatLng|LatLngLiteral`)\n * @returns {void}\n * @public\n */\n panTo(...args) {\n if (this.$mapObject) {\n this.$mapObject.panTo(...args);\n }\n },\n /**\n * Pans the map by the minimum amount necessary to contain the given LatLngBounds. It makes no guarantee where on the map the bounds will be, except that the map will be panned to show as much of the bounds as possible inside {currentMapSizeInPx} - {padding}. For both raster and vector maps, the map's zoom, tilt, and heading will not be changed.\n * @method panToBounds\n * @param {(LatLngBounds|LatLngBoundsLiteral)} latLngBounds - The bounds to pan the map to. (types: `LatLngBounds|LatLngBoundsLiteral`)\n * @param {(number|Padding)} [padding] - optional Padding in pixels. A number value will yield the same padding on all 4 sides. The default value is 0. (types: `number|Padding`)\n * @returns {void}\n * @public\n */\n panToBounds(...args) {\n if (this.$mapObject) {\n this.$mapObject.panToBounds(...args);\n }\n },\n /**\n * Sets the viewport to contain the given bounds.\nNote: When the map is set to display: none, the fitBounds function reads the map's size as 0x0, and therefore does not do anything. To change the viewport while the map is hidden, set the map to visibility: hidden, thereby ensuring the map div has an actual size. For vector maps, this method sets the map's tilt and heading to their default zero values.\n * @method fitBounds\n * @param {(LatLngBounds|LatLngBoundsLiteral)} bounds - Bounds to show. (types: `LatLngBounds|LatLngBoundsLiteral`)\n * @param {(number|Padding)} [padding] - optional Padding in pixels. The bounds will be fit in the part of the map that remains after padding is removed. A number value will yield the same padding on all 4 sides. Supply 0 here to make a fitBounds idempotent on the result of getBounds. (types: `number|Padding`)\n * @returns {void}\n * @public\n */\n fitBounds(...args) {\n if (this.$mapObject) {\n this.$mapObject.fitBounds(...args);\n }\n },\n /**\n * Get the recycle key of the map\n * @method getRecycleKey\n * @param {undefined}\n * @returns {void}\n * @public\n */\n getRecycleKey() {\n return this && this.options && this.options.recycle\n ? this.recyclePrefix + this.options.recycle\n : this.recyclePrefix;\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$mapObject && this.$mapObject.setMap) {\n this.$mapObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","const isOldIE = typeof navigator !== 'undefined' && /msie [6-9]\\\\b/.test(navigator.userAgent.toLowerCase());\n\nfunction createInjector(context) {\n return (id, style) => addStyle(id, style);\n}\n\nlet HEAD;\nconst styles = {};\n\nfunction addStyle(id, css) {\n const group = isOldIE ? css.media || 'default' : id;\n const style = styles[group] || (styles[group] = {\n ids: new Set(),\n styles: []\n });\n\n if (!style.ids.has(id)) {\n style.ids.add(id);\n let code = css.source;\n\n if (css.map) {\n // https://developer.chrome.com/devtools/docs/javascript-debugging\n // this makes source maps inside style tags work properly in Chrome\n code += '\\n/*# sourceURL=' + css.map.sources[0] + ' */'; // http://stackoverflow.com/a/26603875\n\n code += '\\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */';\n }\n\n if (!style.element) {\n style.element = document.createElement('style');\n style.element.type = 'text/css';\n if (css.media) style.element.setAttribute('media', css.media);\n\n if (HEAD === undefined) {\n HEAD = document.head || document.getElementsByTagName('head')[0];\n }\n\n HEAD.appendChild(style.element);\n }\n\n if ('styleSheet' in style.element) {\n style.styles.push(code);\n style.element.styleSheet.cssText = style.styles.filter(Boolean).join('\\n');\n } else {\n const index = style.ids.size - 1;\n const textNode = document.createTextNode(code);\n const nodes = style.element.childNodes;\n if (nodes[index]) style.element.removeChild(nodes[index]);\n if (nodes.length) style.element.insertBefore(textNode, nodes[index]);else style.element.appendChild(textNode);\n }\n }\n}\n\nexport { createInjector as default };\n","import script from './map-layer.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\nimport createInjector from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/inject-style/browser.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"vue-map-container\"},[_c('div',{ref:\"vue-map\",staticClass:\"vue-map\"}),_vm._v(\" \"),_c('div',{staticClass:\"vue-map-hidden\"},[_vm._t(\"default\")],2),_vm._v(\" \"),_vm._t(\"visible\")],2)};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-58f81a38_0\", { source: \".vue-map-container{position:relative}.vue-map-container .vue-map{left:0;right:0;top:0;bottom:0;position:absolute}.vue-map-hidden{display:none}\", map: undefined, media: undefined });\n\n };\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n createInjector,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\nimport { markerMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n/**\n * Marker component\n * @displayName Marker\n * @see [source code](/guide/marker.html#source-code)\n * @see [Official documentation](https://developers.google.com/maps/documentation/javascript/markers)\n * @see [Official reference](https://developers.google.com/maps/documentation/javascript/reference/marker)\n */\nvar script = {\n name: 'MarkerIcon',\n mixins: [mapElementMixin],\n inject: {\n $clusterPromise: {\n default: null,\n },\n },\n provide() {\n const events = [\n 'click',\n 'rightclick',\n 'dblclick',\n 'drag',\n 'dragstart',\n 'dragend',\n 'mouseup',\n 'mousedown',\n 'mouseover',\n 'mouseout',\n ];\n\n const promise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n // TODO: analyze the below line because I think it can be removed\n ...this.options,\n map,\n ...getPropsValues(this, markerMappedProps),\n };\n\n const { options: extraOptions, ...finalOptions } = initialOptions;\n\n if (this.$clusterPromise) {\n finalOptions.map = null;\n }\n\n this.$markerObject = new google.maps.Marker(finalOptions);\n\n bindProps(this, this.$markerObject, markerMappedProps);\n bindEvents(this, this.$markerObject, events);\n\n this.$markerObject.addListener('dragend', () => {\n const newPosition = this.$markerObject.getPosition();\n /**\n * An event to detect when a position changes\n * @property {Object} position Object with lat and lng values, eg: { lat: 10.0, lng: 10.0 }\n */\n this.$emit('update:position', {\n lat: newPosition.lat(),\n lng: newPosition.lng(),\n });\n });\n\n if (this.$clusterPromise) {\n this.$clusterPromise.then((clusterObject) => {\n clusterObject.addMarker(this.$markerObject);\n this.$clusterObject = clusterObject;\n });\n }\n\n return this.$markerObject;\n })\n .catch((error) => {\n throw error;\n });\n\n this.$markerPromise = promise;\n return { $markerPromise: promise };\n },\n props: {\n /**\n * Which animation to play when marker is added to a map.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n animation: {\n type: Number,\n default: undefined,\n },\n /**\n * This property was not found on the Googole Maps documentation, but it was defined in the previous version of this component.\n * Any suggestion is welcome here.\n */\n attribution: {\n type: Object,\n default: undefined,\n },\n /**\n * If true, the marker receives mouse and touch events. Default value is true.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n clickable: {\n type: Boolean,\n default: true,\n },\n /**\n * Mouse cursor type to show on hover.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n cursor: {\n type: String,\n default: undefined,\n },\n /**\n * If true, the marker can be dragged. Default value is false.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n draggable: {\n type: Boolean,\n default: false,\n },\n /**\n * Icon for the foreground. If a string is provided, it is treated as though it were an Icon with the string as url.\n * Its type can be string|Icon|Symbol optional\n * @see [Icon type](https://developers.google.com/maps/documentation/javascript/reference/marker#Icon)\n * @see [Symbol type](https://developers.google.com/maps/documentation/javascript/reference/marker#Symbol)\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n icon: {\n type: [String, Object],\n default: undefined,\n },\n /**\n * Adds a label to the marker. A marker label is a letter or number that appears inside a marker. The label can either be a string, or a MarkerLabel object. If provided and MarkerOptions.title is not provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided label's text. Please note that the label is currently only used for accessibility text for non-optimized markers.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n label: {\n type: [String, Object],\n default: undefined,\n },\n /**\n * A number between 0.0, transparent, and 1.0, opaque.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n opacity: {\n type: Number,\n default: 1,\n },\n /**\n * Extra options passed to this component.\n */\n options: {\n type: Object,\n default: undefined,\n },\n /**\n * This property was not found on the Googole Maps documentation, but it was defined in the previous version of this component.\n * Any suggestion is welcome here.\n */\n place: {\n type: Object,\n default: undefined,\n },\n /**\n * Marker position. The position is required to display the marker and can be provided with Marker.setPosition if not provided at marker construction.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n position: {\n type: Object,\n default: undefined,\n },\n /**\n * Image map region definition used for drag/click.\n * @see [MarkerShape type](https://developers.google.com/maps/documentation/javascript/reference/marker#MarkerShape)\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n shape: {\n type: Object,\n default: undefined,\n },\n /**\n * Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the marker with the provided value. Please note that the title is currently only used for accessibility text for non-optimized markers.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n title: {\n type: String,\n default: undefined,\n },\n /**\n * If true, the marker is visible.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n visible: {\n type: Boolean,\n default: true,\n },\n /**\n * All markers are displayed on the map in order of their zIndex, with higher values displaying in front of markers with lower values. By default, markers are displayed according to their vertical position on screen, with lower markers appearing in front of markers further up the screen.\n * @see https://developers.google.com/maps/documentation/javascript/reference/marker\n */\n zIndex: {\n type: Number,\n default: undefined,\n },\n },\n destroyed() {\n if (!this.$markerObject) {\n return;\n }\n\n if (this.$clusterObject) {\n // Repaint will be performed in `updated()` of cluster\n this.$clusterObject.removeMarker(this.$markerObject, true);\n } else if (this.$markerObject && this.$markerObject.setMap) {\n this.$markerObject.setMap(null);\n }\n },\n render(h) {\n if (!this.$slots.default || this.$slots.default.length === 0) {\n return '';\n }\n if (this.$slots.default.length === 1) {\n // So that infowindows can have a marker parent\n return this.$slots.default[0];\n }\n\n /**\n * @slot Default slot of the component.\n */\n return h('div', this.$slots.default);\n },\n};\n\nexport { script as default };\n","import script from './marker-icon.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = undefined;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n {},\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import { getPropsValues, downArrowSimulator, bindProps } from '../utils/helpers.js';\nimport { placeInputMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n//\n\n/**\n * PlaceInput component\n * @deprecated\n * @displayName PlaceInput\n * @see [source code](/guide/place-input.html#source-code)\n * @see [Map Bounds](https://developers.google.com/maps/documentation/javascript/places-autocomplete#set-the-bounds-on-creation-of-the-autocomplete-object)\n */\nvar script = {\n name: 'PlaceInput',\n props: {\n /**\n * Map bounds this is an LatLngBounds\n * object builded with\n * @value new google.maps.LatLngBounds(...)\n * @see [Map Bounds](https://developers.google.com/maps/documentation/javascript/places-autocomplete#set-the-bounds-on-creation-of-the-autocomplete-object)\n */\n bounds: {\n type: Object,\n default: undefined,\n },\n /**\n * A default value for the html input\n * @value string\n */\n defaultPlace: {\n type: String,\n default: '',\n },\n /**\n * Restrict the search to a specific country\n * @value `{[key: string]: string}`\n * @see [componentRestrictions](https://developers.google.com/maps/documentation/javascript/places-autocomplete#restrict-the-search-to-a-specific-country)\n */\n componentRestrictions: {\n type: Object,\n default: null,\n },\n /**\n * Map types this is an array of strings\n * @value string[]\n * @see [Map Bounds](https://developers.google.com/maps/documentation/javascript/places-autocomplete#set-the-bounds-on-creation-of-the-autocomplete-object)\n */\n types: {\n type: Array,\n default: undefined,\n },\n /**\n * A placeholder for the html input\n * @value string\n */\n placeholder: {\n required: false,\n type: String,\n default: undefined,\n },\n /**\n * A html class name for the html input\n * @value string\n */\n className: {\n required: false,\n type: String,\n default: undefined,\n },\n /**\n * A label for the html input\n * @value string\n */\n label: {\n required: false,\n type: String,\n default: null,\n },\n /**\n * If true the first element on the list will be selected\n * when you press enter in the html input.\n * @value boolean\n */\n selectFirstOnEnter: {\n require: false,\n type: Boolean,\n default: false,\n },\n },\n created() {\n window.console.warn(\n 'The PlaceInput class is deprecated! Please consider using the Autocomplete input instead, it will be removed in the next major release of this plugin.'\n );\n },\n mounted() {\n const { input } = this.$refs;\n\n // Allow default place to be set\n input.value = this.defaultPlace;\n\n this.$watch('defaultPlace', () => {\n input.value = this.defaultPlace;\n });\n\n this.$gmapApiPromiseLazy().then(() => {\n const options = getPropsValues(this, placeInputMappedProps);\n\n if (this.selectFirstOnEnter) {\n downArrowSimulator(this.$refs.input);\n }\n\n if (typeof google.maps.places.Autocomplete !== 'function') {\n throw new Error(\n \"google.maps.places.Autocomplete is undefined. Did you add 'places' to libraries when loading Google Maps?\"\n );\n }\n\n this.$autoCompleter = new google.maps.places.Autocomplete(\n this.$refs.input,\n options\n );\n\n const {\n placeholder,\n place,\n defaultPlace,\n className,\n label,\n selectFirstOnEnter,\n ...rest\n } = placeInputMappedProps;\n\n bindProps(this, this.$autoCompleter, rest);\n\n this.$autoCompleter.addListener('place_changed', () => {\n /**\n * Place change event\n * @event place_changed\n * @property {object} place `this.$autocomplete.getPlace()`\n * @see [Get place information](https://developers.google.com/maps/documentation/javascript/places-autocomplete#get-place-information)\n */\n this.$emit('place_changed', this.$autoCompleter.getPlace());\n });\n });\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$autoCompleter && this.$autoCompleter.setMap) {\n this.$autoCompleter.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './place-input.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('label',[_c('span',{domProps:{\"textContent\":_vm._s(_vm.label)}}),_vm._v(\" \"),_c('input',{ref:\"input\",class:_vm.className,attrs:{\"type\":\"text\",\"placeholder\":_vm.placeholder}})])};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\nimport { polygonMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n/**\n * Polygon component\n * @displayName GmapPolygon\n * @see [source code](/guide/polygon.html#source-code)\n * @see [official docs](https://developers.google.com/maps/documentation/javascript/examples/polygon-arrays?hl=es)\n * @see [official reference](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#Polygon)\n */\nvar script = {\n name: 'PolygonShape',\n mixins: [mapElementMixin],\n render() {\n return '';\n },\n provide() {\n const events = [\n 'click',\n 'dblclick',\n 'drag',\n 'dragend',\n 'dragstart',\n 'mousedown',\n 'mousemove',\n 'mouseout',\n 'mouseover',\n 'mouseup',\n 'rightclick',\n ];\n\n const $polygonPromise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n ...this.options,\n map,\n ...getPropsValues(this, polygonMappedProps),\n };\n const {\n options: extraOptions,\n path: optionPath,\n paths: optionPaths,\n ...finalOptions\n } = initialOptions;\n\n this.$polygonObject = new google.maps.Polygon(finalOptions);\n\n bindProps(this, this.$polygonObject, polygonMappedProps);\n bindEvents(this, this.$polygonObject, events);\n\n let clearEvents = () => {};\n\n // Watch paths, on our own, because we do not want to set either when it is\n // empty\n this.$watch(\n 'paths',\n (paths) => {\n if (paths) {\n clearEvents();\n\n this.$polygonObject.setPaths(paths);\n\n const updatePaths = () => {\n /**\n * An event to detect when a paths changes\n * @property {array} paths `this.$polygonObject.getPaths()` |\n */\n this.$emit('paths_changed', this.$polygonObject.getPaths());\n };\n const eventListeners = [];\n\n const mvcArray = this.$polygonObject.getPaths();\n\n for (let i = 0; i < mvcArray.getLength(); i += 1) {\n const mvcPath = mvcArray.getAt(i);\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('insert_at', updatePaths),\n ]);\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('remove_at', updatePaths),\n ]);\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('set_at', updatePaths),\n ]);\n }\n\n eventListeners.push([\n mvcArray,\n mvcArray.addListener('insert_at', updatePaths),\n ]);\n eventListeners.push([\n mvcArray,\n mvcArray.addListener('remove_at', updatePaths),\n ]);\n eventListeners.push([\n mvcArray,\n mvcArray.addListener('set_at', updatePaths),\n ]);\n\n // TODO: analyze, we change map to forEach because clearEvents is a void function and the returned array is not used\n clearEvents = () => {\n eventListeners.forEach(([, listenerHandle]) => {\n google.maps.event.removeListener(listenerHandle);\n });\n };\n }\n },\n {\n deep: this.deepWatch,\n immediate: true,\n }\n );\n\n this.$watch(\n 'path',\n (path) => {\n if (path) {\n clearEvents();\n\n this.$polygonObject.setPaths(path);\n\n const mvcPath = this.$polygonObject.getPath();\n const eventListeners = [];\n\n const updatePaths = () => {\n /**\n * ### path_changed (undefined)\n *\n * An event to detect when a path change\n * @property {array} path `this.$polygonObject.getPath()`\n */\n this.$emit('path_changed', this.$polygonObject.getPath());\n };\n\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('insert_at', updatePaths),\n ]);\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('remove_at', updatePaths),\n ]);\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('set_at', updatePaths),\n ]);\n\n // TODO: analyze, we change map to forEach because clearEvents is a void function and the returned array is not used\n clearEvents = () => {\n eventListeners.forEach(([, listenerHandle]) => {\n google.maps.event.removeListener(listenerHandle);\n });\n };\n }\n },\n {\n deep: this.deepWatch,\n immediate: true,\n }\n );\n\n return this.$polygonObject;\n })\n .catch((error) => {\n throw error;\n });\n\n this.$polygonPromise = $polygonPromise;\n return { $polygonPromise };\n },\n props: {\n /**\n * If set true the object will be deep watched\n * @value boolean\n */\n deepWatch: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates whether this Polygon handles mouse events. Defaults to true.\n * @value true, false\n * @see [Polygon draggable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.clickable)\n */\n clickable: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the polygon is draggable\n * @value true, false\n * @see [Polygon dragable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.draggable)\n */\n draggable: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the polygon is editable\n * @value true, false\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.editable)\n */\n editable: {\n type: Boolean,\n default: false,\n },\n /**\n * The fill color. All CSS3 colors are supported except for extended named colors.\n * @value '#000'\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.fillColor)\n */\n fillColor: {\n type: String,\n default: '',\n },\n /**\n * The fill opacity between 0.0 and 1.0\n * @value 1\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.fillOpacity)\n */\n fillOpacity: {\n type: Number,\n default: 1,\n },\n /**\n * The stroke color. All CSS3 colors are supported except for extended named colors.\n * @value '#000'\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.strokeColor)\n */\n strokeColor: {\n type: String,\n default: '',\n },\n /**\n * The stroke opacity between 0.0 and 1.0.\n * @value 1\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.strokeOpacity)\n */\n strokeOpacity: {\n type: Number,\n default: 1,\n },\n /**\n * The stroke position. Defaults to CENTER.\n * @value 1\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.strokePosition)\n * @see [StrokePosition constant](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#StrokePosition)\n */\n strokePosition: {\n type: Number,\n default: 0,\n },\n /**\n * The stroke width in pixels.\n * @value 1\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.strokeWeight)\n */\n strokeWeight: {\n type: Number,\n default: 1,\n },\n /**\n * Whether this polyline is visible on the map. Defaults to true.\n * @value 1\n * @see [Polygon editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.visible)\n */\n visible: {\n type: Boolean,\n default: true,\n },\n /**\n * More options that you can pass to the component\n * @value boolean\n */\n options: {\n type: Object,\n default: undefined,\n },\n /**\n * Indicates if the polygon is editable\n * @value Array\n * @see [Polygon path](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.path)\n */\n path: {\n type: Array,\n noBind: true,\n default: undefined,\n },\n /**\n * Indicates if the polygon is editable\n * @value Array\n * @see [Polygon paths](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolygonOptions.paths)\n */\n paths: {\n type: Array,\n noBind: true,\n default: undefined,\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$polygonObject && this.$polygonObject.setMap) {\n this.$polygonObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './polygon-shape.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = undefined;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n {},\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\nimport { polylineMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n/**\n * PolyLine component\n * @displayName GmapPolyline\n * @see [source code](/guide/polyline.html#source-code)\n * @see [official docs](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#Polyline)\n * @see [official reference](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#Polyline)\n */\nvar script = {\n name: 'PolylineShape',\n mixins: [mapElementMixin],\n render() {\n return '';\n },\n provide() {\n const events = [\n 'click',\n 'dblclick',\n 'drag',\n 'dragend',\n 'dragstart',\n 'mousedown',\n 'mousemove',\n 'mouseout',\n 'mouseover',\n 'mouseup',\n 'rightclick',\n ];\n\n const promise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n ...this.options,\n map,\n ...getPropsValues(this, polylineMappedProps),\n };\n const { options: extraOptions, ...finalOptions } = initialOptions;\n\n this.$polylineObject = new google.maps.Polyline(finalOptions);\n\n bindProps(this, this.$polylineObject, polylineMappedProps);\n bindEvents(this, this.$polylineObject, events);\n\n let clearEvents = () => {};\n\n this.$watch(\n 'path',\n (path) => {\n if (path) {\n clearEvents();\n\n this.$polylineObject.setPath(path);\n\n const mvcPath = this.$polylineObject.getPath();\n const eventListeners = [];\n\n const updatePaths = () => {\n /**\n * An event to detect when a path change\n * @property {array} path `this.$polygonObject.getPath()`\n */\n this.$emit('path_changed', this.$polylineObject.getPath());\n };\n\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('insert_at', updatePaths),\n ]);\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('remove_at', updatePaths),\n ]);\n eventListeners.push([\n mvcPath,\n mvcPath.addListener('set_at', updatePaths),\n ]);\n\n clearEvents = () => {\n // TODO: analyze, we change map to forEach because clearEvents is a void function and the returned array is not used\n eventListeners.forEach(([, listenerHandle]) => {\n google.maps.event.removeListener(listenerHandle);\n });\n };\n }\n },\n {\n deep: this.deepWatch,\n immediate: true,\n }\n );\n\n return this.$polylineObject;\n })\n .catch((error) => {\n throw error;\n });\n\n // TODO: analyze the efects of only returns the instance and remove completely the promise\n this.$polylinePromise = promise;\n return { $polylinePromise: promise };\n },\n props: {\n /**\n * If set true the object will be deep watched\n * @value boolean\n */\n deepWatch: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates whether this Polygon handles mouse events. Defaults to true.\n * @value true, false\n * @see [Polyline draggable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.clickable)\n */\n clickable: {\n type: Boolean,\n default: false,\n },\n /**\n * Indicates if the polyline is draggable\n * @value true, false\n * @see [Polyline draggable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.draggable)\n */\n draggable: {\n type: Boolean,\n },\n /**\n * Indicates if the polygon is editable\n * @value true, false\n * @see [Polyline editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.editable)\n */\n editable: {\n type: Boolean,\n },\n /**\n * The stroke color. All CSS3 colors are supported except for extended named colors.\n * @value '#000'\n * @see [Polyline editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.strokeColor)\n */\n strokeColor: {\n type: String,\n default: '',\n },\n /**\n * The stroke opacity between 0.0 and 1.0.\n * @value 1\n * @see [Polyline editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.strokeOpacity)\n */\n strokeOpacity: {\n type: Number,\n default: 1,\n },\n /**\n * The stroke width in pixels.\n * @value 1\n * @see [Polyline editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.strokeWeight)\n */\n strokeWeight: {\n type: Number,\n default: 1,\n },\n /**\n * Whether this polyline is visible on the map. Defaults to true.\n * @value 1\n * @see [Polyline editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.visible)\n */\n visible: {\n type: Boolean,\n default: true,\n },\n /**\n * More options that you can pass to the component\n * @value boolean\n */\n options: {\n type: Object,\n default: undefined,\n },\n /**\n * Indicates if the polygon is editable\n * @value Array\n * @see [Polyline path](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#PolylineOptions.path)\n */\n path: {\n type: Array,\n default: undefined,\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$polylineObject && this.$polylineObject.setMap) {\n this.$polylineObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './polyline-shape.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = undefined;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n {},\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mapElementMixin from '../mixins/map-element.js';\nimport { getPropsValues, bindProps, bindEvents } from '../utils/helpers.js';\nimport { rectangleMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n/**\n * Rectangle component\n * @displayName GmapRectangle\n * @see [source code](/guide/rectangle.html#source-code)\n * @see [official docs](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#Rectangle)\n * @see [official reference](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#Rectangle)\n */\nvar script = {\n name: 'RectangleShape',\n mixins: [mapElementMixin],\n render() {\n return '';\n },\n provide() {\n const events = [\n 'click',\n 'dblclick',\n 'drag',\n 'dragend',\n 'dragstart',\n 'mousedown',\n 'mousemove',\n 'mouseout',\n 'mouseover',\n 'mouseup',\n 'rightclick',\n ];\n\n const $rectanglePromise = this.$mapPromise\n .then((map) => {\n this.$map = map;\n\n // Initialize the maps with the given options\n const initialOptions = {\n ...this.options,\n map,\n ...getPropsValues(this, rectangleMappedProps),\n };\n const { options: extraOptions, ...finalOptions } = initialOptions;\n\n this.$rectangleObject = new google.maps.Rectangle(finalOptions);\n\n bindProps(this, this.$rectangleObject, rectangleMappedProps);\n bindEvents(this, this.$rectangleObject, events);\n\n return this.$rectangleObject;\n })\n .catch((error) => {\n throw error;\n });\n\n this.$rectanglePromise = $rectanglePromise;\n return { $rectanglePromise };\n },\n props: {\n /**\n * The bounds.\n * @value object\n * @type LatLngBounds|LatLngBoundsLiteral\n * @see [Rectangle bounds](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.bounds)\n */\n bounds: {\n type: Object,\n default: undefined,\n },\n /**\n * Indicates whether this Polygon handles mouse events. Defaults to true.\n * @value true, false\n * @see [Rectangle draggable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.clickable)\n */\n clickable: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, the user can drag this rectangle over the map. Defaults to false.\n * @value boolean\n * @see [Rectangle draggable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.draggable)\n */\n draggable: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, the user can edit this rectangle by dragging the control points shown at the corners and on each edge. Defaults to false.\n * @value boolean\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.editable)\n */\n editable: {\n type: Boolean,\n default: false,\n },\n /**\n * The fill color. All CSS3 colors are supported except for extended named colors.\n * @value '#000'\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.fillColor)\n */\n fillColor: {\n type: String,\n default: '',\n },\n /**\n * The fill opacity between 0.0 and 1.0\n * @value 1\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.fillOpacity)\n */\n fillOpacity: {\n type: Number,\n default: 1,\n },\n /**\n * The stroke color. All CSS3 colors are supported except for extended named colors.\n * @value '#000'\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.strokeColor)\n */\n strokeColor: {\n type: String,\n default: '',\n },\n /**\n * The stroke opacity between 0.0 and 1.0.\n * @value 1\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.strokeOpacity)\n */\n strokeOpacity: {\n type: Number,\n default: 1,\n },\n /**\n * The stroke position. Defaults to CENTER.\n * @value 1\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.strokePosition)\n * @see [StrokePosition constant](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#StrokePosition)\n */\n strokePosition: {\n type: Number,\n default: 0,\n },\n /**\n * The stroke width in pixels.\n * @value 1\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.strokeWeight)\n */\n strokeWeight: {\n type: Number,\n default: 1,\n },\n /**\n * Whether this polyline is visible on the map. Defaults to true.\n * @value 1\n * @see [Rectangle editable](https://developers.google.com/maps/documentation/javascript/reference/polygon?hl=es#RectangleOptions.visible)\n */\n visible: {\n type: Boolean,\n default: true,\n },\n /**\n * More options that you can pass to the component\n * @value boolean\n */\n options: {\n type: Object,\n default: undefined,\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$rectangleObject && this.$rectangleObject.setMap) {\n this.$rectangleObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './rectangle-shape.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = undefined;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n {},\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import mountableMixin from '../mixins/mountable.js';\nimport { getPropsValues, bindProps, bindEvents, twoWayBindingWrapper, watchPrimitiveProperties } from '../utils/helpers.js';\nimport { streetViewPanoramaMappedProps } from '../utils/mapped-props-by-map-element.js';\n\n//\n\n/**\n * Street View Panorama component\n * @displayName GmapStreetViewPanorama\n * @see [source code](/guide/street-view-panorama.html#source-code)\n * @see [official docs](https://developers.google.com/maps/documentation/javascript/reference/street-view?hl=es#StreetViewPanorama)\n */\nvar script = {\n name: 'StreetViewPanorama',\n mixins: [mountableMixin],\n provide() {\n this.$panoPromise = new Promise((resolve, reject) => {\n this.$panoPromiseDeferred = { resolve, reject };\n });\n return {\n $panoPromise: this.$panoPromise,\n $mapPromise: this.$panoPromise, // so that we can use it with markers\n };\n },\n props: {\n /**\n * The zoom of the panorama, specified as a number. A zoom of 0 gives a 180 degrees Field of View.\n * @value number\n * @see [StreetViewPanorama zoom](https://developers.google.com/maps/documentation/javascript/reference/street-view?hl=es#StreetViewPanoramaOptions.zoom)\n */\n zoom: {\n type: Number,\n default: undefined,\n },\n /**\n * The camera orientation, specified as heading and pitch, for the panorama.\n * @value object\n * @type StreetViewPov\n * @see [StreetViewPanorama pov](https://developers.google.com/maps/documentation/javascript/reference/street-view?hl=es#StreetViewPanoramaOptions.pov)\n */\n pov: {\n type: Object,\n default: undefined,\n },\n /**\n * The LatLng position of the Street View panorama.\n * @value object\n * @type LatLng|LatLngLiteral\n * @see [StreetViewPanorama position](https://developers.google.com/maps/documentation/javascript/reference/street-view?hl=es#StreetViewPanoramaOptions.position)\n */\n position: {\n type: Object,\n default: undefined,\n },\n /**\n * The panorama ID, which should be set when specifying a custom panorama.\n * @value string\n * @see [StreetViewPanorama pano](https://developers.google.com/maps/documentation/javascript/reference/street-view?hl=es#StreetViewPanoramaOptions.pano)\n */\n pano: {\n type: String,\n default: undefined,\n },\n /**\n * Whether motion tracking is on or off. Enabled by default when the motion tracking control is present, so that the POV (point of view) follows the orientation of the device. This is primarily applicable to mobile devices. If motionTracking is set to false while motionTrackingControl is enabled, the motion tracking control appears but tracking is off. The user can tap the motion tracking control to toggle this option.\n * @value boolean\n * @see [StreetViewPanorama motionTracking](https://developers.google.com/maps/documentation/javascript/reference/street-view?hl=es#StreetViewPanoramaOptions.motionTracking)\n */\n motionTracking: {\n type: Boolean,\n },\n /**\n * If true, the Street View panorama is visible on load.\n * @value boolean\n * @see [StreetViewPanorama visible](https://developers.google.com/maps/documentation/javascript/reference/street-view?hl=es#StreetViewPanoramaOptions.visible)\n */\n visible: {\n type: Boolean,\n default: true,\n },\n /**\n * More options that you can pass to the component\n * @value boolean\n */\n options: {\n type: Object,\n default: undefined,\n },\n },\n replace: false, // necessary for css styles\n computed: {\n finalLat() {\n return this.position && typeof this.position.lat === 'function'\n ? this.position.lat()\n : this.position.lat;\n },\n finalLng() {\n return this.position && typeof this.position.lng === 'function'\n ? this.position.lng()\n : this.position.lng;\n },\n finalLatLng() {\n return {\n lat: this.finalLat,\n lng: this.finalLng,\n };\n },\n },\n watch: {\n zoom(zoom) {\n if (this.$panoObject) {\n this.$panoObject.setZoom(zoom);\n }\n },\n },\n mounted() {\n const events = ['closeclick', 'status_changed'];\n\n return this.$gmapApiPromiseLazy()\n .then(() => {\n // getting the DOM element where to create the map\n const element = this.$refs['vue-street-view-pano'];\n\n // creating the map\n const options = {\n ...this.options,\n ...getPropsValues(this, streetViewPanoramaMappedProps),\n };\n\n const { options: extraOptions, ...finalOptions } = options;\n\n this.$panoObject = new google.maps.StreetViewPanorama(\n element,\n finalOptions\n );\n\n // binding properties (two and one way)\n bindProps(this, this.$panoObject, streetViewPanoramaMappedProps);\n // binding events\n bindEvents(this, this.$panoObject, events);\n\n // manually trigger position\n twoWayBindingWrapper((increment, decrement, shouldUpdate) => {\n // Panos take a while to load\n increment();\n\n this.$panoObject.addListener('position_changed', () => {\n if (shouldUpdate()) {\n this.$emit('position_changed', this.$panoObject.getPosition());\n }\n decrement();\n });\n\n const updateCenter = () => {\n increment();\n this.$panoObject.setPosition(this.finalLatLng);\n };\n\n watchPrimitiveProperties(\n this,\n ['finalLat', 'finalLng'],\n updateCenter\n );\n });\n\n this.$panoPromiseDeferred.resolve(this.$panoObject);\n\n return this.$panoPromise;\n })\n .catch((error) => {\n throw error;\n });\n },\n methods: {\n resize() {\n if (this.$panoObject) {\n google.maps.event.trigger(this.$panoObject, 'resize');\n }\n },\n },\n destroyed() {\n // Note: not all Google Maps components support maps\n if (this.$panoObject && this.$panoObject.setMap) {\n this.$panoObject.setMap(null);\n }\n },\n};\n\nexport { script as default };\n","import script from './street-view-panorama.vue_rollup-plugin-vue_script.vue.js';\nimport normalizeComponent from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/normalize-component.mjs.js';\nimport createInjector from '../node_modules/.pnpm/vue-runtime-helpers@1.1.2/node_modules/vue-runtime-helpers/dist/inject-style/browser.mjs.js';\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"vue-street-view-pano-container\"},[_c('div',{ref:\"vue-street-view-pano\",staticClass:\"vue-street-view-pano\"}),_vm._v(\" \"),_vm._t(\"default\")],2)};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = function (inject) {\n if (!inject) return\n inject(\"data-v-32786ad9_0\", { source: \".vue-street-view-pano-container{position:relative}.vue-street-view-pano-container .vue-street-view-pano{left:0;right:0;top:0;bottom:0;position:absolute}\", map: undefined, media: undefined });\n\n };\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = /*#__PURE__*/normalizeComponent(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n createInjector,\n undefined,\n undefined\n );\n\nexport { __vue_component__ as default };\n","import { getLazyValue } from '../helpers.js';\n\n/**\n * This function allow to auto detect an external load of the Google Maps API\n * or load it dynamically from our component.\n *\n * @param {Function} resolveFn the function that indicates to the plugin that Google Maps is loaded\n * @param {Function} customCallback the custom callback to execute when the plugin load. This option will be removed on the next major release\n */\n\nfunction createCallbackAndChecksIfMapIsLoaded(resolveFn, customCallback) {\n var callbackExecuted = false;\n\n window.GoogleMapsCallback = function () {\n try {\n resolveFn();\n callbackExecuted = true; // TODO: this should be removed on the next major release\n\n if (customCallback) {\n customCallback();\n }\n } catch (error) {\n window.console.error('Error executing the GoogleMapsCallback', error);\n }\n };\n\n var timeoutId = setTimeout(function () {\n var intervalId = setInterval(function () {\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = undefined;\n }\n\n if ((window && window.google && window.google.maps) != null && !callbackExecuted) {\n window.GoogleMapsCallback();\n callbackExecuted = true;\n }\n\n if (callbackExecuted) {\n clearInterval(intervalId);\n intervalId = undefined;\n }\n }, 500);\n }, 1000);\n}\n/**\n * This function is a factory of the promise lazy creator\n * it helps you creating the function that will call the\n * Google Maps API in an async way\n *\n * @param {Function} googleMapsApiInitializer function that initialize the Google Maps API\n * @param {Object} GoogleMapsApi Vue instance that will help to know if the google API object is ready\n * @returns {Function}\n */\n\n\nfunction getPromiseLazyCreatorFn(googleMapsApiInitializer, GoogleMapsApi) {\n /**\n * The creator of the lazy promise\n *\n * @param {Object|undefined} options=undefined configuration object to initialize the GmapVue plugin\n * @param {boolean} options.dynamicLoad=false load the Google Maps API dynamically, if you set this to `true` the plugin doesn't load the Google Maps API\n * @param {boolean} options.installComponents=true install all components\n * @param {boolean} options.autoBindAllEvents=false auto bind all Google Maps API events\n * @param {Object|undefined} options.load=undefined options to configure the Google Maps API\n * @param {string} options.load.key your Google Maps API key\n * @param {string} options.load.libraries=places the Google Maps libraries that you will use eg: 'places,drawing,visualization'\n * @param {string|undefined} options.load.v=undefined the Google Maps API version, default latest\n * @param {string|undefined} options.load.callback=GoogleMapsCallback This must be ignored if have another callback that you need to run when Google Maps API is ready please use the `customCallback` option.\n * @param {string|undefined} options.load.customCallback=undefined This option was added on v3.0.0 but will be removed in the next major release. If you already have an script tag that loads Google Maps API and you want to use it set you callback in the `customCallback` option and our `GoogleMapsCallback` callback will execute your custom callback at the end; it must attached to the `window` object, is the only requirement.\n */\n return function promiseLazyCreator(options) {\n /**\n * Things to do once the API is loaded\n *\n * @returns {Object} the Google Maps API object\n */\n function onMapsReady() {\n GoogleMapsApi.isReady = true;\n return window.google;\n } // If library should load the API\n\n\n if (options && options.load && options.load.key || options.dynamicLoad) {\n return getLazyValue(function () {\n // This will only be evaluated once\n if (typeof window === 'undefined') {\n // server side -- never resolve this promise\n return new Promise(function () {}).then(onMapsReady);\n }\n\n return new Promise(function (resolve, reject) {\n try {\n createCallbackAndChecksIfMapIsLoaded(resolve, window[options && options.load && options.load.customCallback]);\n\n if (!options.dynamicLoad) {\n googleMapsApiInitializer(options.load, options.loadCn);\n }\n } catch (err) {\n reject(err);\n }\n }).then(onMapsReady);\n });\n } // If library should not handle API, provide\n // end-users with the global `GoogleMapsCallback: () => undefined`\n // when the Google Maps API has been loaded\n\n\n var promise = new Promise(function (resolve) {\n if (typeof window === 'undefined') {\n // Do nothing if run from server-side\n return;\n }\n\n createCallbackAndChecksIfMapIsLoaded(resolve, window[options && options.load && options.load.customCallback]);\n }).then(onMapsReady);\n return getLazyValue(function () {\n return promise;\n });\n };\n}\n\nexport { getPromiseLazyCreatorFn as default };\n","import { typeof as _typeof, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';\n\n/**\n * This function returns the initializer function, it is exported\n * in that way because we need to generate a closure to define a\n * private property called `isApiSetUp` to detect if the Google Maps\n * API was initializer in a previous execution.\n * The function that it exports is the function that we use inside\n * of promise-lazy file to initialize the Google Maps API if\n * it is required.\n *\n * @returns {Function} The initializer function\n */\nfunction createGoogleMapsAPIInitializer() {\n var isApiSetUp = false;\n /**\n * The initializer function, it adds into the head of the page the Google Maps API script tag to loads the library\n *\n * @param {Object|undefined} options=undefined The configuration Object. (@see https://developers.google.com/maps/documentation/javascript/url-params)\n * `libraries`.\n * @param {string} options.key Your Google Maps API key\n * @param {string} options.libraries=places The Google Maps libraries that you will use eg: 'places,drawing,visualization', can be given as an array too (@see https://developers.google.com/maps/documentation/javascript/libraries)\n * @param {string|undefined} options.v=undefined The Google Maps API version, default latest\n * @param {string|undefined} options.callback=GoogleMapsCallback This must be ignored if have another callback that you need to run when Google Maps API is ready please use the `customCallback` option.\n * @param {string|undefined} options.customCallback=undefined This option was added on v3.0.0 but will be removed in the next major release. If you already have an script tag that loads Google Maps API and you want to use it set you callback in the `customCallback` option and our `GoogleMapsCallback` callback will execute your custom callback at the end; it must attached to the `window` object, is the only requirement.\n * @param {boolean} loadCn=false Boolean. If set to true, the map will be loaded from google maps China\n * (@see https://developers.google.com/maps/documentation/javascript/basics#GoogleMapsChina)\n */\n\n var googleMapsAPIInitializer = function googleMapsAPIInitializer(options, loadCn) {\n /**\n * Allow options to be an object.\n * This is to support more esoteric means of loading Google Maps,\n * such as Google for business\n * https://developers.google.com/maps/documentation/javascript/get-api-key#premium-auth\n */\n if (_typeof(options) !== 'object') {\n throw new Error('options should be an object');\n } // Do nothing if run from server-side\n\n\n if (typeof document === 'undefined') {\n return;\n }\n\n var finalOptions = _objectSpread2({}, options);\n\n var libraries = finalOptions.libraries;\n\n if (!isApiSetUp) {\n isApiSetUp = true;\n var baseUrl = typeof loadCn === 'boolean' && loadCn ? 'https://maps.google.cn' : 'https://maps.googleapis.com';\n var googleMapScript = document.createElement('SCRIPT'); // libraries\n\n if (Array.isArray(libraries)) {\n finalOptions.libraries = libraries.join(',');\n }\n\n finalOptions.callback = 'GoogleMapsCallback';\n var query = Object.keys(finalOptions).map(function (key) {\n return \"\".concat(encodeURIComponent(key), \"=\").concat(encodeURIComponent(finalOptions[key]));\n }).join('&');\n var url = \"\".concat(baseUrl, \"/maps/api/js?\").concat(query);\n googleMapScript.setAttribute('src', url);\n googleMapScript.setAttribute('async', '');\n googleMapScript.setAttribute('defer', '');\n document.head.appendChild(googleMapScript);\n } else {\n window.console.info('You already started the loading of google maps');\n }\n };\n\n return googleMapsAPIInitializer;\n}\n\nvar googleMapsApiInitializer = createGoogleMapsAPIInitializer();\n\nexport { googleMapsApiInitializer as default };\n","import { objectSpread2 as _objectSpread2 } from './_virtual/_rollupPluginBabelHelpers.js';\nimport __vue_component__$c from './components/autocomplete-input.vue.js';\nimport __vue_component__$5 from './components/circle-shape.vue.js';\nimport __vue_component__$6 from './components/cluster-icon.vue.js';\nimport __vue_component__$8 from './components/drawing-manager.vue.js';\nimport __vue_component__ from './components/heatmap-layer.vue.js';\nimport __vue_component__$9 from './components/info-window.vue.js';\nimport __vue_component__$1 from './components/kml-layer.vue.js';\nimport __vue_component__$a from './components/map-layer.vue.js';\nimport __vue_component__$2 from './components/marker-icon.vue.js';\nimport __vue_component__$b from './components/place-input.vue.js';\nimport __vue_component__$4 from './components/polygon-shape.vue.js';\nimport __vue_component__$3 from './components/polyline-shape.vue.js';\nimport __vue_component__$7 from './components/rectangle-shape.vue.js';\nimport __vue_component__$d from './components/street-view-panorama.vue.js';\nimport mapElementMixin from './mixins/map-element.js';\nimport mountableMixin from './mixins/mountable.js';\nimport mapElement from './utils/factories/map-element.js';\nimport getPromiseLazyCreatorFn from './utils/factories/promise-lazy.js';\nimport googleMapsApiInitializer from './utils/initializer/google-maps-api-initializer.js';\n\n/**\n * HACK: Cluster should be loaded conditionally\n * However in the web version, it's not possible to write\n * `import 'gmap-vue/src/components/cluster'`, so we need to\n * import it anyway (but we don't have to register it)\n * Therefore we use babel-plugin-transform-inline-environment-variables to\n * set BUILD_DEV to truthy / falsy\n */\n// const Cluster = ((s) => s.default || s)(\n// require('./components/cluster-icon.vue')\n// );\n\n/**\n * @var\n * @type {Object|undefined}\n *\n * An independent Vue instance that helps us to know when the Google Maps API is loaded.\n */\n\nvar GoogleMapsApi; // TODO: analyze the possibility of use globalThis here\n\n/**\n * This function helps you to get the Google Maps API\n * when its ready on the window object\n * @function\n */\n\nfunction getGoogleMapsAPI() {\n return GoogleMapsApi.isReady && window.google;\n}\n/**\n * Export all components and mixins\n * @constant\n * @type {Object} components and mixins object\n * @property {Object} HeatmapLayer - Vue component HeatmapLayer\n * @property {Object} KmlLayer - Vue component KmlLayer\n * @property {Object} Marker - Vue component Marker\n * @property {Object} Polyline - Vue component Polyline\n * @property {Object} Polygon - Vue component Polygon\n * @property {Object} Circle - Vue component Circle\n * @property {Object} Cluster - Vue component Cluster\n * @property {Object} Rectangle - Vue component Rectangle\n * @property {Object} DrawingManager - Vue component DrawingManager\n * @property {Object} InfoWindow - Vue component InfoWindow\n * @property {Object} MapLayer - Vue component MapLayer\n * @property {Object} PlaceInput - Vue component PlaceInput\n * @property {Object} Autocomplete - Vue component Autocomplete\n * @property {Object} StreetViewPanorama - Vue component StreetViewPanorama\n * @property {Object} MapElementMixin - Vue component MapElementMixin\n * @property {Object} MountableMixin - Vue component MountableMixin\n */\n\n\nvar components = {\n HeatmapLayer: __vue_component__,\n KmlLayer: __vue_component__$1,\n Marker: __vue_component__$2,\n Polyline: __vue_component__$3,\n Polygon: __vue_component__$4,\n Circle: __vue_component__$5,\n Cluster: __vue_component__$6,\n Rectangle: __vue_component__$7,\n DrawingManager: __vue_component__$8,\n InfoWindow: __vue_component__$9,\n MapLayer: __vue_component__$a,\n PlaceInput: __vue_component__$b,\n Autocomplete: __vue_component__$c,\n StreetViewPanorama: __vue_component__$d,\n MapElementMixin: mapElementMixin,\n MountableMixin: mountableMixin\n};\n/**\n * Export all helpers\n * @constant\n * @type {Object} object containing all helpers\n * @property {Function} initGoogleMapsApi - function to initialize the Google Maps API\n * @property {Function} MapElementFactory - function to initialize the Google Maps API\n */\n\nvar helpers = {\n googleMapsApiInitializer: googleMapsApiInitializer,\n MapElementFactory: mapElement\n};\n/**\n * GmapVue install function\n *\n * @param {Object} Vue the vue instance\n * @param {Object|undefined} options=undefined configuration object to initialize the GmapVue plugin\n * @param {boolean} options.dynamicLoad=false load the Google Maps API dynamically, if you set this to `true` the plugin doesn't load the Google Maps API\n * @param {boolean} options.installComponents=true install all components\n * @param {boolean} options.autoBindAllEvents=false auto bind all Google Maps API events\n * @param {Object|undefined} options.load=undefined options to configure the Google Maps API\n * @param {string} options.load.key your Google Maps API key\n * @param {string} options.load.libraries=places the Google Maps libraries that you will use eg: 'places,drawing,visualization'\n * @param {string|undefined} options.load.v=undefined the Google Maps API version, default latest\n * @param {string|undefined} options.load.callback=GoogleMapsCallback This must be ignored if have another callback that you need to run when Google Maps API is ready please use the `customCallback` option.\n * @param {string|undefined} options.load.customCallback=undefined This option was added on v3.0.0 but will be removed in the next major release. If you already have an script tag that loads Google Maps API and you want to use it set you callback in the `customCallback` option and our `GoogleMapsCallback` callback will execute your custom callback at the end; it must attached to the `window` object, is the only requirement.\n */\n\nfunction gmapVuePluginInstallFn(Vue, options) {\n // see defaults\n var finalOptions = _objectSpread2({\n dynamicLoad: false,\n installComponents: true,\n autoBindAllEvents: false,\n load: {\n libraries: 'places'\n }\n }, options);\n /**\n * Update the global `GoogleMapsApi`. This will allow\n * components to use the `google` global reactively\n * via:\n * import { getGoogleMapsAPI } from 'gmap-vue'\n * export default { computed: { google: getGoogleMapsAPI } }\n */\n\n\n GoogleMapsApi = new Vue({\n data: {\n isReady: false\n }\n });\n var defaultResizeBus = new Vue();\n /**\n * Use a lazy to only load the API when\n * a GMap component is loaded\n *\n * @constant\n * @type {Function} the promise lazy creator function\n */\n\n var promiseLazyCreator = getPromiseLazyCreatorFn(googleMapsApiInitializer, GoogleMapsApi);\n /**\n * The gmapApiPromiseLazy function to can wait until Google Maps API is ready\n *\n * @constant\n * @type {Function}\n */\n\n var gmapApiPromiseLazy = promiseLazyCreator(finalOptions);\n /**\n * Instance properties\n *\n * In every component you have a references to\n * this.$gmapDefaultResizeBus - function to use the default resize bus\n * this.$gmapApiPromiseLazy - function that you can use to wait until Google Maps API is ready\n * this.$gmapOptions - object with the final options passed to Google Maps API to configure it\n */\n\n Vue.mixin({\n created: function created() {\n this.$gmapDefaultResizeBus = defaultResizeBus;\n this.$gmapApiPromiseLazy = gmapApiPromiseLazy;\n this.$gmapOptions = finalOptions;\n }\n });\n /**\n * Static properties\n *\n * These properties are the same references that you can find in the instance\n * but they are static because they are attached to the main Vue object.\n * Vue.$gmapDefaultResizeBus - function to use the default resize bus\n * Vue.$gmapApiPromiseLazy - function that you can use to wait until Google Maps API is ready\n * Vue.$gmapOptions - object with the final options passed to Google Maps API to configure it\n */\n\n Vue.$gmapDefaultResizeBus = defaultResizeBus;\n Vue.$gmapApiPromiseLazy = gmapApiPromiseLazy;\n Vue.$gmapOptions = finalOptions;\n\n if (finalOptions.installComponents) {\n Vue.component('GmapMap', __vue_component__$a);\n Vue.component('GmapMarker', __vue_component__$2);\n Vue.component('GmapInfoWindow', __vue_component__$9);\n Vue.component('GmapHeatmapLayer', __vue_component__);\n Vue.component('GmapKmlLayer', __vue_component__$1);\n Vue.component('GmapPolyline', __vue_component__$3);\n Vue.component('GmapPolygon', __vue_component__$4);\n Vue.component('GmapCircle', __vue_component__$5);\n Vue.component('GmapRectangle', __vue_component__$7);\n Vue.component('GmapDrawingManager', __vue_component__$8);\n Vue.component('GmapAutocomplete', __vue_component__$c);\n Vue.component('GmapPlaceInput', __vue_component__$b);\n Vue.component('GmapStreetViewPanorama', __vue_component__$d);\n }\n}\n/**\n * Export default of the default Vue object for plugins\n * Export for ESM modules\n *\n * @property {Function} install function to install the plugin\n * @see gmapVuePluginInstallFn\n */\n\nvar main = {\n install: gmapVuePluginInstallFn\n};\n\nexport { components, main as default, getGoogleMapsAPI, helpers, gmapVuePluginInstallFn as install };\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n}\n\nmodule.exports = arrayEach;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var Stack = require('./_Stack'),\n arrayEach = require('./_arrayEach'),\n assignValue = require('./_assignValue'),\n baseAssign = require('./_baseAssign'),\n baseAssignIn = require('./_baseAssignIn'),\n cloneBuffer = require('./_cloneBuffer'),\n copyArray = require('./_copyArray'),\n copySymbols = require('./_copySymbols'),\n copySymbolsIn = require('./_copySymbolsIn'),\n getAllKeys = require('./_getAllKeys'),\n getAllKeysIn = require('./_getAllKeysIn'),\n getTag = require('./_getTag'),\n initCloneArray = require('./_initCloneArray'),\n initCloneByTag = require('./_initCloneByTag'),\n initCloneObject = require('./_initCloneObject'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isMap = require('./isMap'),\n isObject = require('./isObject'),\n isSet = require('./isSet'),\n keys = require('./keys'),\n keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n}\n\nmodule.exports = baseClone;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var baseForOwn = require('./_baseForOwn'),\n createBaseEach = require('./_createBaseEach');\n\n/**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\nvar baseEach = createBaseEach(baseForOwn);\n\nmodule.exports = baseEach;\n","var baseEach = require('./_baseEach');\n\n/**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n}\n\nmodule.exports = baseFilter;\n","/**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = baseFindIndex;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var baseFor = require('./_baseFor'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\nmodule.exports = baseForOwn;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIsNaN = require('./_baseIsNaN'),\n strictIndexOf = require('./_strictIndexOf');\n\n/**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n}\n\nmodule.exports = baseIndexOf;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","/**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\nfunction baseIsNaN(value) {\n return value !== value;\n}\n\nmodule.exports = baseIsNaN;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","var getTag = require('./_getTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var arrayMap = require('./_arrayMap');\n\n/**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\nfunction baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n}\n\nmodule.exports = baseValues;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n","/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n}\n\nmodule.exports = cloneRegExp;\n","var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","var copyObject = require('./_copyObject'),\n getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n","var copyObject = require('./_copyObject'),\n getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var isArrayLike = require('./isArrayLike');\n\n/**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n}\n\nmodule.exports = createBaseEach;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n}\n\nmodule.exports = initCloneArray;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n cloneDataView = require('./_cloneDataView'),\n cloneRegExp = require('./_cloneRegExp'),\n cloneSymbol = require('./_cloneSymbol'),\n cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n}\n\nmodule.exports = initCloneByTag;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","/**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n}\n\nmodule.exports = strictIndexOf;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\nfunction clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = clone;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var baseFindIndex = require('./_baseFindIndex'),\n baseIteratee = require('./_baseIteratee'),\n toInteger = require('./toInteger');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\nfunction findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, baseIteratee(predicate, 3), index);\n}\n\nmodule.exports = findIndex;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","var baseIndexOf = require('./_baseIndexOf'),\n isArrayLike = require('./isArrayLike'),\n isString = require('./isString'),\n toInteger = require('./toInteger'),\n values = require('./values');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\nfunction includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n}\n\nmodule.exports = includes;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseKeys = require('./_baseKeys'),\n getTag = require('./_getTag'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLike = require('./isArrayLike'),\n isBuffer = require('./isBuffer'),\n isPrototype = require('./_isPrototype'),\n isTypedArray = require('./isTypedArray');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var baseIsMap = require('./_baseIsMap'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseIsSet = require('./_baseIsSet'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n","var baseGetTag = require('./_baseGetTag'),\n isArray = require('./isArray'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n 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',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** 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/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n 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 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '' + func(text) + '
';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles
'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %> ');\n * compiled({ 'value': '