\n */\n\n/**\n * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.\n * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\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(1);\n * // => false\n */\nfunction isObject(value) {\n // Avoid a V8 JIT bug in Chrome 19-20.\n // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport IconButton from './icon_button';\nimport Overlay from 'react-overlays/lib/Overlay';\nimport Motion from '../features/ui/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport detectPassiveEvents from 'detect-passive-events';\n\nconst listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;\nlet id = 0;\n\nclass DropdownMenu extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n items: PropTypes.array.isRequired,\n onClose: PropTypes.func.isRequired,\n style: PropTypes.object,\n placement: PropTypes.string,\n arrowOffsetLeft: PropTypes.string,\n arrowOffsetTop: PropTypes.string,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n style: {},\n placement: 'bottom',\n };\n\n state = {\n mounted: false,\n };\n\n handleDocumentClick = e => {\n if (this.node && !this.node.contains(e.target)) {\n this.props.onClose();\n }\n }\n\n componentDidMount () {\n document.addEventListener('click', this.handleDocumentClick, false);\n document.addEventListener('keydown', this.handleKeyDown, false);\n document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);\n if (this.focusedItem && this.props.openedViaKeyboard) {\n this.focusedItem.focus();\n }\n this.setState({ mounted: true });\n }\n\n componentWillUnmount () {\n document.removeEventListener('click', this.handleDocumentClick, false);\n document.removeEventListener('keydown', this.handleKeyDown, false);\n document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n setRef = c => {\n this.node = c;\n }\n\n setFocusRef = c => {\n this.focusedItem = c;\n }\n\n handleKeyDown = e => {\n const items = Array.from(this.node.getElementsByTagName('a'));\n const index = items.indexOf(document.activeElement);\n let element;\n\n switch(e.key) {\n case 'ArrowDown':\n element = items[index+1];\n if (element) {\n element.focus();\n }\n break;\n case 'ArrowUp':\n element = items[index-1];\n if (element) {\n element.focus();\n }\n break;\n case 'Tab':\n if (e.shiftKey) {\n element = items[index-1] || items[items.length-1];\n } else {\n element = items[index+1] || items[0];\n }\n if (element) {\n element.focus();\n e.preventDefault();\n e.stopPropagation();\n }\n break;\n case 'Home':\n element = items[0];\n if (element) {\n element.focus();\n }\n break;\n case 'End':\n element = items[items.length-1];\n if (element) {\n element.focus();\n }\n break;\n case 'Escape':\n this.props.onClose();\n break;\n }\n }\n\n handleItemKeyPress = e => {\n if (e.key === 'Enter' || e.key === ' ') {\n this.handleClick(e);\n }\n }\n\n handleClick = e => {\n const i = Number(e.currentTarget.getAttribute('data-index'));\n const { action, to } = this.props.items[i];\n\n this.props.onClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action(e);\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n renderItem (option, i) {\n if (option === null) {\n return ;\n }\n\n const { text, href = '#', target = '_blank', method } = option;\n\n return (\n \n \n {text}\n \n \n );\n }\n\n render () {\n const { items, style, placement, arrowOffsetLeft, arrowOffsetTop } = this.props;\n const { mounted } = this.state;\n\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n // It should not be transformed when mounting because the resulting\n // size will be used to determine the coordinate of the menu by\n // react-overlays\n \n
\n\n
\n {items.map((option, i) => this.renderItem(option, i))}\n \n
\n )}\n \n );\n }\n\n}\n\nexport default class Dropdown extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n icon: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired,\n size: PropTypes.number.isRequired,\n title: PropTypes.string,\n disabled: PropTypes.bool,\n status: ImmutablePropTypes.map,\n isUserTouching: PropTypes.func,\n isModalOpen: PropTypes.bool.isRequired,\n onOpen: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n dropdownPlacement: PropTypes.string,\n openDropdownId: PropTypes.number,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n title: 'Menu',\n };\n\n state = {\n id: id++,\n };\n\n handleClick = ({ target, type }) => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n } else {\n const { top } = target.getBoundingClientRect();\n const placement = top * 2 < innerHeight ? 'bottom' : 'top';\n this.props.onOpen(this.state.id, this.handleItemClick, placement, type !== 'click');\n }\n }\n\n handleClose = () => {\n if (this.activeElement) {\n this.activeElement.focus();\n this.activeElement = null;\n }\n this.props.onClose(this.state.id);\n }\n\n handleMouseDown = () => {\n if (!this.state.open) {\n this.activeElement = document.activeElement;\n }\n }\n\n handleButtonKeyDown = (e) => {\n switch(e.key) {\n case ' ':\n case 'Enter':\n this.handleMouseDown();\n break;\n }\n }\n\n handleKeyPress = (e) => {\n switch(e.key) {\n case ' ':\n case 'Enter':\n this.handleClick(e);\n e.stopPropagation();\n e.preventDefault();\n break;\n }\n }\n\n handleItemClick = e => {\n const i = Number(e.currentTarget.getAttribute('data-index'));\n const { action, to } = this.props.items[i];\n\n this.handleClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action();\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n setTargetRef = c => {\n this.target = c;\n }\n\n findTarget = () => {\n return this.target;\n }\n\n componentWillUnmount = () => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n }\n }\n\n render () {\n const { icon, items, size, title, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard } = this.props;\n const open = this.state.id === openDropdownId;\n\n return (\n \n \n\n \n \n \n
\n );\n }\n\n}\n","import { openDropdownMenu, closeDropdownMenu } from '../actions/dropdown_menu';\nimport { openModal, closeModal } from '../actions/modal';\nimport { connect } from 'react-redux';\nimport DropdownMenu from '../components/dropdown_menu';\nimport { isUserTouching } from '../is_mobile';\n\nconst mapStateToProps = state => ({\n isModalOpen: state.get('modal').modalType === 'ACTIONS',\n dropdownPlacement: state.getIn(['dropdown_menu', 'placement']),\n openDropdownId: state.getIn(['dropdown_menu', 'openId']),\n openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']),\n});\n\nconst mapDispatchToProps = (dispatch, { status, items }) => ({\n onOpen(id, onItemClick, dropdownPlacement, keyboard) {\n dispatch(isUserTouching() ? openModal('ACTIONS', {\n status,\n actions: items,\n onClick: onItemClick,\n }) : openDropdownMenu(id, dropdownPlacement, keyboard));\n },\n onClose(id) {\n dispatch(closeModal('ACTIONS'));\n dispatch(closeDropdownMenu(id));\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DropdownMenu);\n","import Rails from 'rails-ujs';\n\nexport const logOut = () => {\n const form = document.createElement('form');\n\n const methodInput = document.createElement('input');\n methodInput.setAttribute('name', '_method');\n methodInput.setAttribute('value', 'delete');\n methodInput.setAttribute('type', 'hidden');\n form.appendChild(methodInput);\n\n const csrfToken = Rails.csrfToken();\n const csrfParam = Rails.csrfParam();\n\n if (csrfParam && csrfToken) {\n const csrfInput = document.createElement('input');\n csrfInput.setAttribute('name', csrfParam);\n csrfInput.setAttribute('value', csrfToken);\n csrfInput.setAttribute('type', 'hidden');\n form.appendChild(csrfInput);\n }\n\n const submitButton = document.createElement('input');\n submitButton.setAttribute('type', 'submit');\n form.appendChild(submitButton);\n\n form.method = 'post';\n form.action = '/auth/sign_out';\n form.style.display = 'none';\n\n document.body.appendChild(form);\n submitButton.click();\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from 'flavours/glitch/components/icon';\n\nexport default class ColumnHeader extends React.PureComponent {\n\n static propTypes = {\n icon: PropTypes.string,\n type: PropTypes.string,\n active: PropTypes.bool,\n onClick: PropTypes.func,\n columnHeaderId: PropTypes.string,\n };\n\n handleClick = () => {\n this.props.onClick();\n }\n\n render () {\n const { icon, type, active, columnHeaderId } = this.props;\n let iconElement = '';\n\n if (icon) {\n iconElement = ;\n }\n\n return (\n \n \n {iconElement}\n {type}\n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\n\nexport default class ColumnHeader extends React.PureComponent {\n\n static propTypes = {\n icon: PropTypes.string,\n type: PropTypes.string,\n active: PropTypes.bool,\n onClick: PropTypes.func,\n columnHeaderId: PropTypes.string,\n };\n\n handleClick = () => {\n this.props.onClick();\n }\n\n render () {\n const { icon, type, active, columnHeaderId } = this.props;\n let iconElement = '';\n\n if (icon) {\n iconElement = ;\n }\n\n return (\n \n \n {iconElement}\n {type}\n \n \n );\n }\n\n}\n","/**\n * Copyright 2014-2015, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = function warning() {};\n\nif (process.env.NODE_ENV !== 'production') {\n warning = function warning(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.length < 10 || /^[s\\W]*$/.test(format)) {\n throw new Error('The warning format should be able to uniquely identify this ' + 'warning. Please, use a more descriptive format than: ' + format);\n }\n\n if (!condition) {\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n\n try {\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n };\n}\n\nmodule.exports = warning;","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nexports.__esModule = true;\nexports.default = void 0;\n\nvar _inDOM = _interopRequireDefault(require(\"./inDOM\"));\n\nvar vendors = ['', 'webkit', 'moz', 'o', 'ms'];\nvar cancel = 'clearTimeout';\nvar raf = fallback;\nvar compatRaf;\n\nvar getKey = function getKey(vendor, k) {\n return vendor + (!vendor ? k : k[0].toUpperCase() + k.substr(1)) + 'AnimationFrame';\n};\n\nif (_inDOM.default) {\n vendors.some(function (vendor) {\n var rafKey = getKey(vendor, 'request');\n\n if (rafKey in window) {\n cancel = getKey(vendor, 'cancel');\n return raf = function raf(cb) {\n return window[rafKey](cb);\n };\n }\n });\n}\n/* https://github.com/component/raf */\n\n\nvar prev = new Date().getTime();\n\nfunction fallback(fn) {\n var curr = new Date().getTime(),\n ms = Math.max(0, 16 - (curr - prev)),\n req = setTimeout(fn, ms);\n prev = curr;\n return req;\n}\n\ncompatRaf = function compatRaf(cb) {\n return raf(cb);\n};\n\ncompatRaf.cancel = function (id) {\n window[cancel] && typeof window[cancel] === 'function' && window[cancel](id);\n};\n\nvar _default = compatRaf;\nexports.default = _default;\nmodule.exports = exports[\"default\"];","\"use strict\";\n\nexports.__esModule = true;\nexports.isMobileSafari = isMobileSafari;\n\nfunction isMobileSafari() {\n return /iPad|iPhone|iPod/.test(window.navigator.platform) && /^((?!CriOS).)*Safari/.test(window.navigator.userAgent);\n}","module.exports = Array.isArray || function (arr) {\n return Object.prototype.toString.call(arr) == '[object Array]';\n};","/**\n * ISC License\n *\n * Copyright (c) 2018, Aleck Greenham\n *\n * Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\nimport PropTypes from \"prop-types\";\nimport React, { Component, PureComponent } from \"react\";\nimport isEqual from \"lodash.isequal\";\nimport ReactDOM from \"react-dom\";\nimport isBool from \"lodash.isboolean\";\nimport isObject from \"lodash.isobject\";\n\nvar classCallCheck = function classCallCheck(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n},\n createClass = function () {\n function e(e, t) {\n for (var o = 0; o < t.length; o++) {\n var n = t[o];\n n.enumerable = n.enumerable || !1, n.configurable = !0, \"value\" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);\n }\n }\n\n return function (t, o, n) {\n return o && e(t.prototype, o), n && e(t, n), t;\n };\n}(),\n _extends = Object.assign || function (e) {\n for (var t = 1; t < arguments.length; t++) {\n var o = arguments[t];\n\n for (var n in o) {\n Object.prototype.hasOwnProperty.call(o, n) && (e[n] = o[n]);\n }\n }\n\n return e;\n},\n inherits = function inherits(e, t) {\n if (\"function\" != typeof t && null !== t) throw new TypeError(\"Super expression must either be null or a function, not \" + typeof t);\n e.prototype = Object.create(t && t.prototype, {\n constructor: {\n value: e,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);\n},\n objectWithoutProperties = function objectWithoutProperties(e, t) {\n var o = {};\n\n for (var n in e) {\n t.indexOf(n) >= 0 || Object.prototype.hasOwnProperty.call(e, n) && (o[n] = e[n]);\n }\n\n return o;\n},\n possibleConstructorReturn = function possibleConstructorReturn(e, t) {\n if (!e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return !t || \"object\" != typeof t && \"function\" != typeof t ? e : t;\n},\n FocusTrap = function (e) {\n function t() {\n return classCallCheck(this, t), possibleConstructorReturn(this, (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments));\n }\n\n return inherits(t, Component), createClass(t, [{\n key: \"render\",\n value: function value() {\n var e = this.props,\n t = e.component,\n o = e.children,\n n = objectWithoutProperties(e, [\"component\", \"children\"]);\n return React.createElement(t, _extends({\n tabIndex: \"-1\"\n }, n), o);\n }\n }]), t;\n}();\n\nfunction sequencesFromKeyMap(e, t) {\n var o = e[t];\n return o ? Array.isArray(o) ? o : [o] : [t];\n}\n\nfunction hasChanged(e, t) {\n return !isEqual(e, t);\n}\n\nFocusTrap.defaultProps = {\n component: \"div\"\n};\n\nvar HotKeys = function (e) {\n function t(e, o) {\n classCallCheck(this, t);\n var n = possibleConstructorReturn(this, (t.__proto__ || Object.getPrototypeOf(t)).call(this, e, o));\n return n.onFocus = n.onFocus.bind(n), n.onBlur = n.onBlur.bind(n), n;\n }\n\n return inherits(t, Component), createClass(t, [{\n key: \"getChildContext\",\n value: function value() {\n return {\n hotKeyParent: this,\n hotKeyMap: this.__hotKeyMap__\n };\n }\n }, {\n key: \"componentWillMount\",\n value: function value() {\n this.updateMap();\n }\n }, {\n key: \"updateMap\",\n value: function value() {\n var e = this.buildMap();\n return !isEqual(e, this.__hotKeyMap__) && (this.__hotKeyMap__ = e, !0);\n }\n }, {\n key: \"buildMap\",\n value: function value() {\n var e = this.context.hotKeyMap || {},\n t = this.props.keyMap || {};\n return _extends({}, e, t);\n }\n }, {\n key: \"getMap\",\n value: function value() {\n return this.__hotKeyMap__;\n }\n }, {\n key: \"componentDidMount\",\n value: function value() {\n var e = require(\"mousetrap\");\n\n this.__mousetrap__ = new e(this.props.attach || ReactDOM.findDOMNode(this)), this.updateHotKeys(!0);\n }\n }, {\n key: \"componentDidUpdate\",\n value: function value(e) {\n this.updateHotKeys(!1, e);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function value() {\n this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(null), this.__mousetrap__ && this.__mousetrap__.reset();\n }\n }, {\n key: \"updateHotKeys\",\n value: function value() {\n var e = arguments.length > 0 && void 0 !== arguments[0] && arguments[0],\n t = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {},\n o = this.props.handlers,\n n = void 0 === o ? {} : o,\n r = t.handlers,\n s = void 0 === r ? n : r,\n a = this.updateMap();\n (e || a || hasChanged(n, s)) && (this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(null), this.syncHandlersToMousetrap());\n }\n }, {\n key: \"syncHandlersToMousetrap\",\n value: function value() {\n var e = this,\n t = this.props.handlers,\n o = void 0 === t ? {} : t,\n n = this.getMap(),\n r = [],\n s = this.__mousetrap__;\n Object.keys(o).forEach(function (t) {\n var s = o[t];\n sequencesFromKeyMap(n, t).forEach(function (t) {\n var o = void 0;\n isObject(t) && (o = t.action, t = t.sequence), r.push({\n callback: function callback(t, o) {\n if ((isBool(e.props.focused) ? e.props.focused : e.__isFocused__) && o !== e.__lastChildSequence__) return e.context.hotKeyParent && e.context.hotKeyParent.childHandledSequence(o), s(t, o);\n },\n action: o,\n sequence: t\n });\n });\n }), s.reset(), r.forEach(function (e) {\n var t = e.sequence,\n o = e.callback,\n n = e.action;\n return s.bind(t, o, n);\n });\n }\n }, {\n key: \"childHandledSequence\",\n value: function value() {\n var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : null;\n this.__lastChildSequence__ = e, this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(e);\n }\n }, {\n key: \"render\",\n value: function value() {\n var e = this.props,\n t = (e.keyMap, e.handlers, e.focused, e.attach, e.children),\n o = objectWithoutProperties(e, [\"keyMap\", \"handlers\", \"focused\", \"attach\", \"children\"]);\n return React.createElement(FocusTrap, _extends({}, o, {\n onFocus: this.onFocus,\n onBlur: this.onBlur\n }), t);\n }\n }, {\n key: \"onFocus\",\n value: function value() {\n var e;\n (this.__isFocused__ = !0, this.props.onFocus) && (e = this.props).onFocus.apply(e, arguments);\n }\n }, {\n key: \"onBlur\",\n value: function value() {\n var e;\n (this.__isFocused__ = !1, this.props.onBlur) && (e = this.props).onBlur.apply(e, arguments);\n this.context.hotKeyParent && this.context.hotKeyParent.childHandledSequence(null);\n }\n }]), t;\n}();\n\nHotKeys.childContextTypes = {\n hotKeyParent: PropTypes.any,\n hotKeyMap: PropTypes.object\n}, HotKeys.contextTypes = {\n hotKeyParent: PropTypes.any,\n hotKeyMap: PropTypes.object\n};\n\nvar withHotKeys = function withHotKeys(e) {\n return function (t) {\n return function (o) {\n function n(e) {\n classCallCheck(this, n);\n var t = possibleConstructorReturn(this, (n.__proto__ || Object.getPrototypeOf(n)).call(this, e));\n return t._setRef = t._setRef.bind(t), t.state = {\n handlers: {}\n }, t;\n }\n\n return inherits(n, PureComponent), createClass(n, [{\n key: \"componentDidMount\",\n value: function value() {\n this.setState({\n handlers: this._ref.hotKeyHandlers\n });\n }\n }, {\n key: \"_setRef\",\n value: function value(e) {\n this._ref = e;\n }\n }, {\n key: \"render\",\n value: function value() {\n var o = this.state.handlers;\n return React.createElement(HotKeys, {\n component: \"document-fragment\",\n keyMap: e,\n handlers: o\n }, React.createElement(t, _extends({\n ref: this._setRef\n }, this.props)));\n }\n }]), n;\n }();\n };\n};\n\nfunction HotKeyMapMixin() {\n var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};\n return {\n contextTypes: {\n hotKeyMap: PropTypes.object\n },\n childContextTypes: {\n hotKeyMap: PropTypes.object\n },\n getChildContext: function getChildContext() {\n return {\n hotKeyMap: this.__hotKeyMap__\n };\n },\n componentWillMount: function componentWillMount() {\n this.updateMap();\n },\n updateMap: function updateMap() {\n var e = this.buildMap();\n return !isEqual(e, this.__hotKeyMap__) && (this.__hotKeyMap__ = e, !0);\n },\n buildMap: function buildMap() {\n var t = this.context.hotKeyMap || {},\n o = this.props.keyMap || {};\n return _extends({}, t, e, o);\n },\n getMap: function getMap() {\n return this.__hotKeyMap__;\n }\n };\n}\n\nexport { HotKeys, withHotKeys, FocusTrap, HotKeyMapMixin };","/*global define:false */\n\n/**\n * Copyright 2012-2017 Craig Campbell\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 * Mousetrap is a simple keyboard shortcut library for Javascript with\n * no external dependencies\n *\n * @version 1.6.2\n * @url craig.is/killing/mice\n */\n(function (window, document, undefined) {\n // Check if mousetrap is used inside browser, if not, return\n if (!window) {\n return;\n }\n /**\n * mapping of special keycodes to their corresponding keys\n *\n * everything in this dictionary cannot use keypress events\n * so it has to be here to map to the correct keycodes for\n * keyup/keydown events\n *\n * @type {Object}\n */\n\n\n var _MAP = {\n 8: 'backspace',\n 9: 'tab',\n 13: 'enter',\n 16: 'shift',\n 17: 'ctrl',\n 18: 'alt',\n 20: 'capslock',\n 27: 'esc',\n 32: 'space',\n 33: 'pageup',\n 34: 'pagedown',\n 35: 'end',\n 36: 'home',\n 37: 'left',\n 38: 'up',\n 39: 'right',\n 40: 'down',\n 45: 'ins',\n 46: 'del',\n 91: 'meta',\n 93: 'meta',\n 224: 'meta'\n };\n /**\n * mapping for special characters so they can support\n *\n * this dictionary is only used incase you want to bind a\n * keyup or keydown event to one of these keys\n *\n * @type {Object}\n */\n\n var _KEYCODE_MAP = {\n 106: '*',\n 107: '+',\n 109: '-',\n 110: '.',\n 111: '/',\n 186: ';',\n 187: '=',\n 188: ',',\n 189: '-',\n 190: '.',\n 191: '/',\n 192: '`',\n 219: '[',\n 220: '\\\\',\n 221: ']',\n 222: '\\''\n };\n /**\n * this is a mapping of keys that require shift on a US keypad\n * back to the non shift equivelents\n *\n * this is so you can use keyup events with these keys\n *\n * note that this will only work reliably on US keyboards\n *\n * @type {Object}\n */\n\n var _SHIFT_MAP = {\n '~': '`',\n '!': '1',\n '@': '2',\n '#': '3',\n '$': '4',\n '%': '5',\n '^': '6',\n '&': '7',\n '*': '8',\n '(': '9',\n ')': '0',\n '_': '-',\n '+': '=',\n ':': ';',\n '\\\"': '\\'',\n '<': ',',\n '>': '.',\n '?': '/',\n '|': '\\\\'\n };\n /**\n * this is a list of special strings you can use to map\n * to modifier keys when you specify your keyboard shortcuts\n *\n * @type {Object}\n */\n\n var _SPECIAL_ALIASES = {\n 'option': 'alt',\n 'command': 'meta',\n 'return': 'enter',\n 'escape': 'esc',\n 'plus': '+',\n 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'\n };\n /**\n * variable to store the flipped version of _MAP from above\n * needed to check if we should use keypress or not when no action\n * is specified\n *\n * @type {Object|undefined}\n */\n\n var _REVERSE_MAP;\n /**\n * loop through the f keys, f1 to f19 and add them to the map\n * programatically\n */\n\n\n for (var i = 1; i < 20; ++i) {\n _MAP[111 + i] = 'f' + i;\n }\n /**\n * loop through to map numbers on the numeric keypad\n */\n\n\n for (i = 0; i <= 9; ++i) {\n // This needs to use a string cause otherwise since 0 is falsey\n // mousetrap will never fire for numpad 0 pressed as part of a keydown\n // event.\n //\n // @see https://github.com/ccampbell/mousetrap/pull/258\n _MAP[i + 96] = i.toString();\n }\n /**\n * cross browser add event method\n *\n * @param {Element|HTMLDocument} object\n * @param {string} type\n * @param {Function} callback\n * @returns void\n */\n\n\n function _addEvent(object, type, callback) {\n if (object.addEventListener) {\n object.addEventListener(type, callback, false);\n return;\n }\n\n object.attachEvent('on' + type, callback);\n }\n /**\n * takes the event and returns the key character\n *\n * @param {Event} e\n * @return {string}\n */\n\n\n function _characterFromEvent(e) {\n // for keypress events we should return the character as is\n if (e.type == 'keypress') {\n var character = String.fromCharCode(e.which); // if the shift key is not pressed then it is safe to assume\n // that we want the character to be lowercase. this means if\n // you accidentally have caps lock on then your key bindings\n // will continue to work\n //\n // the only side effect that might not be desired is if you\n // bind something like 'A' cause you want to trigger an\n // event when capital A is pressed caps lock will no longer\n // trigger the event. shift+a will though.\n\n if (!e.shiftKey) {\n character = character.toLowerCase();\n }\n\n return character;\n } // for non keypress events the special maps are needed\n\n\n if (_MAP[e.which]) {\n return _MAP[e.which];\n }\n\n if (_KEYCODE_MAP[e.which]) {\n return _KEYCODE_MAP[e.which];\n } // if it is not in the special map\n // with keydown and keyup events the character seems to always\n // come in as an uppercase character whether you are pressing shift\n // or not. we should make sure it is always lowercase for comparisons\n\n\n return String.fromCharCode(e.which).toLowerCase();\n }\n /**\n * checks if two arrays are equal\n *\n * @param {Array} modifiers1\n * @param {Array} modifiers2\n * @returns {boolean}\n */\n\n\n function _modifiersMatch(modifiers1, modifiers2) {\n return modifiers1.sort().join(',') === modifiers2.sort().join(',');\n }\n /**\n * takes a key event and figures out what the modifiers are\n *\n * @param {Event} e\n * @returns {Array}\n */\n\n\n function _eventModifiers(e) {\n var modifiers = [];\n\n if (e.shiftKey) {\n modifiers.push('shift');\n }\n\n if (e.altKey) {\n modifiers.push('alt');\n }\n\n if (e.ctrlKey) {\n modifiers.push('ctrl');\n }\n\n if (e.metaKey) {\n modifiers.push('meta');\n }\n\n return modifiers;\n }\n /**\n * prevents default for this event\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _preventDefault(e) {\n if (e.preventDefault) {\n e.preventDefault();\n return;\n }\n\n e.returnValue = false;\n }\n /**\n * stops propogation for this event\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _stopPropagation(e) {\n if (e.stopPropagation) {\n e.stopPropagation();\n return;\n }\n\n e.cancelBubble = true;\n }\n /**\n * determines if the keycode specified is a modifier key or not\n *\n * @param {string} key\n * @returns {boolean}\n */\n\n\n function _isModifier(key) {\n return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';\n }\n /**\n * reverses the map lookup so that we can look for specific keys\n * to see what can and can't use keypress\n *\n * @return {Object}\n */\n\n\n function _getReverseMap() {\n if (!_REVERSE_MAP) {\n _REVERSE_MAP = {};\n\n for (var key in _MAP) {\n // pull out the numeric keypad from here cause keypress should\n // be able to detect the keys from the character\n if (key > 95 && key < 112) {\n continue;\n }\n\n if (_MAP.hasOwnProperty(key)) {\n _REVERSE_MAP[_MAP[key]] = key;\n }\n }\n }\n\n return _REVERSE_MAP;\n }\n /**\n * picks the best action based on the key combination\n *\n * @param {string} key - character for key\n * @param {Array} modifiers\n * @param {string=} action passed in\n */\n\n\n function _pickBestAction(key, modifiers, action) {\n // if no action was picked in we should try to pick the one\n // that we think would work best for this key\n if (!action) {\n action = _getReverseMap()[key] ? 'keydown' : 'keypress';\n } // modifier keys don't work as expected with keypress,\n // switch to keydown\n\n\n if (action == 'keypress' && modifiers.length) {\n action = 'keydown';\n }\n\n return action;\n }\n /**\n * Converts from a string key combination to an array\n *\n * @param {string} combination like \"command+shift+l\"\n * @return {Array}\n */\n\n\n function _keysFromString(combination) {\n if (combination === '+') {\n return ['+'];\n }\n\n combination = combination.replace(/\\+{2}/g, '+plus');\n return combination.split('+');\n }\n /**\n * Gets info for a specific key combination\n *\n * @param {string} combination key combination (\"command+s\" or \"a\" or \"*\")\n * @param {string=} action\n * @returns {Object}\n */\n\n\n function _getKeyInfo(combination, action) {\n var keys;\n var key;\n var i;\n var modifiers = []; // take the keys from this pattern and figure out what the actual\n // pattern is all about\n\n keys = _keysFromString(combination);\n\n for (i = 0; i < keys.length; ++i) {\n key = keys[i]; // normalize key names\n\n if (_SPECIAL_ALIASES[key]) {\n key = _SPECIAL_ALIASES[key];\n } // if this is not a keypress event then we should\n // be smart about using shift keys\n // this will only work for US keyboards however\n\n\n if (action && action != 'keypress' && _SHIFT_MAP[key]) {\n key = _SHIFT_MAP[key];\n modifiers.push('shift');\n } // if this key is a modifier then add it to the list of modifiers\n\n\n if (_isModifier(key)) {\n modifiers.push(key);\n }\n } // depending on what the key combination is\n // we will try to pick the best event for it\n\n\n action = _pickBestAction(key, modifiers, action);\n return {\n key: key,\n modifiers: modifiers,\n action: action\n };\n }\n\n function _belongsTo(element, ancestor) {\n if (element === null || element === document) {\n return false;\n }\n\n if (element === ancestor) {\n return true;\n }\n\n return _belongsTo(element.parentNode, ancestor);\n }\n\n function Mousetrap(targetElement) {\n var self = this;\n targetElement = targetElement || document;\n\n if (!(self instanceof Mousetrap)) {\n return new Mousetrap(targetElement);\n }\n /**\n * element to attach key events to\n *\n * @type {Element}\n */\n\n\n self.target = targetElement;\n /**\n * a list of all the callbacks setup via Mousetrap.bind()\n *\n * @type {Object}\n */\n\n self._callbacks = {};\n /**\n * direct map of string combinations to callbacks used for trigger()\n *\n * @type {Object}\n */\n\n self._directMap = {};\n /**\n * keeps track of what level each sequence is at since multiple\n * sequences can start out with the same sequence\n *\n * @type {Object}\n */\n\n var _sequenceLevels = {};\n /**\n * variable to store the setTimeout call\n *\n * @type {null|number}\n */\n\n var _resetTimer;\n /**\n * temporary state where we will ignore the next keyup\n *\n * @type {boolean|string}\n */\n\n\n var _ignoreNextKeyup = false;\n /**\n * temporary state where we will ignore the next keypress\n *\n * @type {boolean}\n */\n\n var _ignoreNextKeypress = false;\n /**\n * are we currently inside of a sequence?\n * type of action (\"keyup\" or \"keydown\" or \"keypress\") or false\n *\n * @type {boolean|string}\n */\n\n var _nextExpectedAction = false;\n /**\n * resets all sequence counters except for the ones passed in\n *\n * @param {Object} doNotReset\n * @returns void\n */\n\n function _resetSequences(doNotReset) {\n doNotReset = doNotReset || {};\n var activeSequences = false,\n key;\n\n for (key in _sequenceLevels) {\n if (doNotReset[key]) {\n activeSequences = true;\n continue;\n }\n\n _sequenceLevels[key] = 0;\n }\n\n if (!activeSequences) {\n _nextExpectedAction = false;\n }\n }\n /**\n * finds all callbacks that match based on the keycode, modifiers,\n * and action\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event|Object} e\n * @param {string=} sequenceName - name of the sequence we are looking for\n * @param {string=} combination\n * @param {number=} level\n * @returns {Array}\n */\n\n\n function _getMatches(character, modifiers, e, sequenceName, combination, level) {\n var i;\n var callback;\n var matches = [];\n var action = e.type; // if there are no events related to this keycode\n\n if (!self._callbacks[character]) {\n return [];\n } // if a modifier key is coming up on its own we should allow it\n\n\n if (action == 'keyup' && _isModifier(character)) {\n modifiers = [character];\n } // loop through all callbacks for the key that was pressed\n // and see if any of them match\n\n\n for (i = 0; i < self._callbacks[character].length; ++i) {\n callback = self._callbacks[character][i]; // if a sequence name is not specified, but this is a sequence at\n // the wrong level then move onto the next match\n\n if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {\n continue;\n } // if the action we are looking for doesn't match the action we got\n // then we should keep going\n\n\n if (action != callback.action) {\n continue;\n } // if this is a keypress event and the meta key and control key\n // are not pressed that means that we need to only look at the\n // character, otherwise check the modifiers as well\n //\n // chrome will not fire a keypress if meta or control is down\n // safari will fire a keypress if meta or meta+shift is down\n // firefox will fire a keypress if meta or control is down\n\n\n if (action == 'keypress' && !e.metaKey && !e.ctrlKey || _modifiersMatch(modifiers, callback.modifiers)) {\n // when you bind a combination or sequence a second time it\n // should overwrite the first one. if a sequenceName or\n // combination is specified in this call it does just that\n //\n // @todo make deleting its own method?\n var deleteCombo = !sequenceName && callback.combo == combination;\n var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;\n\n if (deleteCombo || deleteSequence) {\n self._callbacks[character].splice(i, 1);\n }\n\n matches.push(callback);\n }\n }\n\n return matches;\n }\n /**\n * actually calls the callback function\n *\n * if your callback function returns false this will use the jquery\n * convention - prevent default and stop propogation on the event\n *\n * @param {Function} callback\n * @param {Event} e\n * @returns void\n */\n\n\n function _fireCallback(callback, e, combo, sequence) {\n // if this event should not happen stop here\n if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {\n return;\n }\n\n if (callback(e, combo) === false) {\n _preventDefault(e);\n\n _stopPropagation(e);\n }\n }\n /**\n * handles a character key event\n *\n * @param {string} character\n * @param {Array} modifiers\n * @param {Event} e\n * @returns void\n */\n\n\n self._handleKey = function (character, modifiers, e) {\n var callbacks = _getMatches(character, modifiers, e);\n\n var i;\n var doNotReset = {};\n var maxLevel = 0;\n var processedSequenceCallback = false; // Calculate the maxLevel for sequences so we can only execute the longest callback sequence\n\n for (i = 0; i < callbacks.length; ++i) {\n if (callbacks[i].seq) {\n maxLevel = Math.max(maxLevel, callbacks[i].level);\n }\n } // loop through matching callbacks for this key event\n\n\n for (i = 0; i < callbacks.length; ++i) {\n // fire for all sequence callbacks\n // this is because if for example you have multiple sequences\n // bound such as \"g i\" and \"g t\" they both need to fire the\n // callback for matching g cause otherwise you can only ever\n // match the first one\n if (callbacks[i].seq) {\n // only fire callbacks for the maxLevel to prevent\n // subsequences from also firing\n //\n // for example 'a option b' should not cause 'option b' to fire\n // even though 'option b' is part of the other sequence\n //\n // any sequences that do not match here will be discarded\n // below by the _resetSequences call\n if (callbacks[i].level != maxLevel) {\n continue;\n }\n\n processedSequenceCallback = true; // keep a list of which sequences were matches for later\n\n doNotReset[callbacks[i].seq] = 1;\n\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);\n\n continue;\n } // if there were no sequence matches but we are still here\n // that means this is a regular match so we should fire that\n\n\n if (!processedSequenceCallback) {\n _fireCallback(callbacks[i].callback, e, callbacks[i].combo);\n }\n } // if the key you pressed matches the type of sequence without\n // being a modifier (ie \"keyup\" or \"keypress\") then we should\n // reset all sequences that were not matched by this event\n //\n // this is so, for example, if you have the sequence \"h a t\" and you\n // type \"h e a r t\" it does not match. in this case the \"e\" will\n // cause the sequence to reset\n //\n // modifier keys are ignored because you can have a sequence\n // that contains modifiers such as \"enter ctrl+space\" and in most\n // cases the modifier key will be pressed before the next key\n //\n // also if you have a sequence such as \"ctrl+b a\" then pressing the\n // \"b\" key will trigger a \"keypress\" and a \"keydown\"\n //\n // the \"keydown\" is expected when there is a modifier, but the\n // \"keypress\" ends up matching the _nextExpectedAction since it occurs\n // after and that causes the sequence to reset\n //\n // we ignore keypresses in a sequence that directly follow a keydown\n // for the same character\n\n\n var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;\n\n if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {\n _resetSequences(doNotReset);\n }\n\n _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';\n };\n /**\n * handles a keydown event\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _handleKeyEvent(e) {\n // normalize e.which for key events\n // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion\n if (typeof e.which !== 'number') {\n e.which = e.keyCode;\n }\n\n var character = _characterFromEvent(e); // no character found then stop\n\n\n if (!character) {\n return;\n } // need to use === for the character check because the character can be 0\n\n\n if (e.type == 'keyup' && _ignoreNextKeyup === character) {\n _ignoreNextKeyup = false;\n return;\n }\n\n self.handleKey(character, _eventModifiers(e), e);\n }\n /**\n * called to set a 1 second timeout on the specified sequence\n *\n * this is so after each key press in the sequence you have 1 second\n * to press the next key before you have to start over\n *\n * @returns void\n */\n\n\n function _resetSequenceTimer() {\n clearTimeout(_resetTimer);\n _resetTimer = setTimeout(_resetSequences, 1000);\n }\n /**\n * binds a key sequence to an event\n *\n * @param {string} combo - combo specified in bind call\n * @param {Array} keys\n * @param {Function} callback\n * @param {string=} action\n * @returns void\n */\n\n\n function _bindSequence(combo, keys, callback, action) {\n // start off by adding a sequence level record for this combination\n // and setting the level to 0\n _sequenceLevels[combo] = 0;\n /**\n * callback to increase the sequence level for this sequence and reset\n * all other sequences that were active\n *\n * @param {string} nextAction\n * @returns {Function}\n */\n\n function _increaseSequence(nextAction) {\n return function () {\n _nextExpectedAction = nextAction;\n ++_sequenceLevels[combo];\n\n _resetSequenceTimer();\n };\n }\n /**\n * wraps the specified callback inside of another function in order\n * to reset all sequence counters as soon as this sequence is done\n *\n * @param {Event} e\n * @returns void\n */\n\n\n function _callbackAndReset(e) {\n _fireCallback(callback, e, combo); // we should ignore the next key up if the action is key down\n // or keypress. this is so if you finish a sequence and\n // release the key the final key will not trigger a keyup\n\n\n if (action !== 'keyup') {\n _ignoreNextKeyup = _characterFromEvent(e);\n } // weird race condition if a sequence ends with the key\n // another sequence begins with\n\n\n setTimeout(_resetSequences, 10);\n } // loop through keys one at a time and bind the appropriate callback\n // function. for any key leading up to the final one it should\n // increase the sequence. after the final, it should reset all sequences\n //\n // if an action is specified in the original bind call then that will\n // be used throughout. otherwise we will pass the action that the\n // next key in the sequence should match. this allows a sequence\n // to mix and match keypress and keydown events depending on which\n // ones are better suited to the key provided\n\n\n for (var i = 0; i < keys.length; ++i) {\n var isFinal = i + 1 === keys.length;\n var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);\n\n _bindSingle(keys[i], wrappedCallback, action, combo, i);\n }\n }\n /**\n * binds a single keyboard combination\n *\n * @param {string} combination\n * @param {Function} callback\n * @param {string=} action\n * @param {string=} sequenceName - name of sequence if part of sequence\n * @param {number=} level - what part of the sequence the command is\n * @returns void\n */\n\n\n function _bindSingle(combination, callback, action, sequenceName, level) {\n // store a direct mapped reference for use with Mousetrap.trigger\n self._directMap[combination + ':' + action] = callback; // make sure multiple spaces in a row become a single space\n\n combination = combination.replace(/\\s+/g, ' ');\n var sequence = combination.split(' ');\n var info; // if this pattern is a sequence of keys then run through this method\n // to reprocess each pattern one key at a time\n\n if (sequence.length > 1) {\n _bindSequence(combination, sequence, callback, action);\n\n return;\n }\n\n info = _getKeyInfo(combination, action); // make sure to initialize array if this is the first time\n // a callback is added for this key\n\n self._callbacks[info.key] = self._callbacks[info.key] || []; // remove an existing match if there is one\n\n _getMatches(info.key, info.modifiers, {\n type: info.action\n }, sequenceName, combination, level); // add this call back to the array\n // if it is a sequence put it at the beginning\n // if not put it at the end\n //\n // this is important because the way these are processed expects\n // the sequence ones to come first\n\n\n self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({\n callback: callback,\n modifiers: info.modifiers,\n action: info.action,\n seq: sequenceName,\n level: level,\n combo: combination\n });\n }\n /**\n * binds multiple combinations to the same callback\n *\n * @param {Array} combinations\n * @param {Function} callback\n * @param {string|undefined} action\n * @returns void\n */\n\n\n self._bindMultiple = function (combinations, callback, action) {\n for (var i = 0; i < combinations.length; ++i) {\n _bindSingle(combinations[i], callback, action);\n }\n }; // start!\n\n\n _addEvent(targetElement, 'keypress', _handleKeyEvent);\n\n _addEvent(targetElement, 'keydown', _handleKeyEvent);\n\n _addEvent(targetElement, 'keyup', _handleKeyEvent);\n }\n /**\n * binds an event to mousetrap\n *\n * can be a single key, a combination of keys separated with +,\n * an array of keys, or a sequence of keys separated by spaces\n *\n * be sure to list the modifier keys first to make sure that the\n * correct key ends up getting bound (the last key in the pattern)\n *\n * @param {string|Array} keys\n * @param {Function} callback\n * @param {string=} action - 'keypress', 'keydown', or 'keyup'\n * @returns void\n */\n\n\n Mousetrap.prototype.bind = function (keys, callback, action) {\n var self = this;\n keys = keys instanceof Array ? keys : [keys];\n\n self._bindMultiple.call(self, keys, callback, action);\n\n return self;\n };\n /**\n * unbinds an event to mousetrap\n *\n * the unbinding sets the callback function of the specified key combo\n * to an empty function and deletes the corresponding key in the\n * _directMap dict.\n *\n * TODO: actually remove this from the _callbacks dictionary instead\n * of binding an empty function\n *\n * the keycombo+action has to be exactly the same as\n * it was defined in the bind method\n *\n * @param {string|Array} keys\n * @param {string} action\n * @returns void\n */\n\n\n Mousetrap.prototype.unbind = function (keys, action) {\n var self = this;\n return self.bind.call(self, keys, function () {}, action);\n };\n /**\n * triggers an event that has already been bound\n *\n * @param {string} keys\n * @param {string=} action\n * @returns void\n */\n\n\n Mousetrap.prototype.trigger = function (keys, action) {\n var self = this;\n\n if (self._directMap[keys + ':' + action]) {\n self._directMap[keys + ':' + action]({}, keys);\n }\n\n return self;\n };\n /**\n * resets the library back to its initial state. this is useful\n * if you want to clear out the current keyboard shortcuts and bind\n * new ones - for example if you switch to another page\n *\n * @returns void\n */\n\n\n Mousetrap.prototype.reset = function () {\n var self = this;\n self._callbacks = {};\n self._directMap = {};\n return self;\n };\n /**\n * should we stop this event before firing off callbacks\n *\n * @param {Event} e\n * @param {Element} element\n * @return {boolean}\n */\n\n\n Mousetrap.prototype.stopCallback = function (e, element) {\n var self = this; // if the element has the class \"mousetrap\" then no need to stop\n\n if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {\n return false;\n }\n\n if (_belongsTo(element, self.target)) {\n return false;\n } // stop for input, select, and textarea\n\n\n return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;\n };\n /**\n * exposes _handleKey publicly so it can be overwritten by extensions\n */\n\n\n Mousetrap.prototype.handleKey = function () {\n var self = this;\n return self._handleKey.apply(self, arguments);\n };\n /**\n * allow custom key mappings\n */\n\n\n Mousetrap.addKeycodes = function (object) {\n for (var key in object) {\n if (object.hasOwnProperty(key)) {\n _MAP[key] = object[key];\n }\n }\n\n _REVERSE_MAP = null;\n };\n /**\n * Init the global mousetrap functions\n *\n * This method is needed to allow the global mousetrap functions to work\n * now that mousetrap is a constructor function.\n */\n\n\n Mousetrap.init = function () {\n var documentMousetrap = Mousetrap(document);\n\n for (var method in documentMousetrap) {\n if (method.charAt(0) !== '_') {\n Mousetrap[method] = function (method) {\n return function () {\n return documentMousetrap[method].apply(documentMousetrap, arguments);\n };\n }(method);\n }\n }\n };\n\n Mousetrap.init(); // expose mousetrap to the global object\n\n window.Mousetrap = Mousetrap; // expose as a common js module\n\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = Mousetrap;\n } // expose mousetrap as an AMD module\n\n\n if (typeof define === 'function' && define.amd) {\n define(function () {\n return Mousetrap;\n });\n }\n})(typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);","// Copyright (c) 2012 Mathieu Turcotte\n// Licensed under the MIT license.\nvar Backoff = require('./lib/backoff');\n\nvar ExponentialBackoffStrategy = require('./lib/strategy/exponential');\n\nvar FibonacciBackoffStrategy = require('./lib/strategy/fibonacci');\n\nvar FunctionCall = require('./lib/function_call.js');\n\nmodule.exports.Backoff = Backoff;\nmodule.exports.FunctionCall = FunctionCall;\nmodule.exports.FibonacciStrategy = FibonacciBackoffStrategy;\nmodule.exports.ExponentialStrategy = ExponentialBackoffStrategy; // Constructs a Fibonacci backoff.\n\nmodule.exports.fibonacci = function (options) {\n return new Backoff(new FibonacciBackoffStrategy(options));\n}; // Constructs an exponential backoff.\n\n\nmodule.exports.exponential = function (options) {\n return new Backoff(new ExponentialBackoffStrategy(options));\n}; // Constructs a FunctionCall for the given function and arguments.\n\n\nmodule.exports.call = function (fn, vargs, callback) {\n var args = Array.prototype.slice.call(arguments);\n fn = args[0];\n vargs = args.slice(1, args.length - 1);\n callback = args[args.length - 1];\n return new FunctionCall(fn, vargs, callback);\n};","/*\n * Copyright (c) 2012 Mathieu Turcotte\n * Licensed under the MIT license.\n */\nvar util = require('util');\n\nvar errors = module.exports = require('./errors');\n\nfunction failCheck(ExceptionConstructor, callee, messageFormat, formatArgs) {\n messageFormat = messageFormat || '';\n var message = util.format.apply(this, [messageFormat].concat(formatArgs));\n var error = new ExceptionConstructor(message);\n Error.captureStackTrace(error, callee);\n throw error;\n}\n\nfunction failArgumentCheck(callee, message, formatArgs) {\n failCheck(errors.IllegalArgumentError, callee, message, formatArgs);\n}\n\nfunction failStateCheck(callee, message, formatArgs) {\n failCheck(errors.IllegalStateError, callee, message, formatArgs);\n}\n\nmodule.exports.checkArgument = function (value, message) {\n if (!value) {\n failArgumentCheck(arguments.callee, message, Array.prototype.slice.call(arguments, 2));\n }\n};\n\nmodule.exports.checkState = function (value, message) {\n if (!value) {\n failStateCheck(arguments.callee, message, Array.prototype.slice.call(arguments, 2));\n }\n};\n\nmodule.exports.checkIsDef = function (value, message) {\n if (value !== undefined) {\n return value;\n }\n\n failArgumentCheck(arguments.callee, message || 'Expected value to be defined but was undefined.', Array.prototype.slice.call(arguments, 2));\n};\n\nmodule.exports.checkIsDefAndNotNull = function (value, message) {\n // Note that undefined == null.\n if (value != null) {\n return value;\n }\n\n failArgumentCheck(arguments.callee, message || 'Expected value to be defined and not null but got \"' + typeOf(value) + '\".', Array.prototype.slice.call(arguments, 2));\n}; // Fixed version of the typeOf operator which returns 'null' for null values\n// and 'array' for arrays.\n\n\nfunction typeOf(value) {\n var s = typeof value;\n\n if (s == 'object') {\n if (!value) {\n return 'null';\n } else if (value instanceof Array) {\n return 'array';\n }\n }\n\n return s;\n}\n\nfunction typeCheck(expect) {\n return function (value, message) {\n var type = typeOf(value);\n\n if (type == expect) {\n return value;\n }\n\n failArgumentCheck(arguments.callee, message || 'Expected \"' + expect + '\" but got \"' + type + '\".', Array.prototype.slice.call(arguments, 2));\n };\n}\n\nmodule.exports.checkIsString = typeCheck('string');\nmodule.exports.checkIsArray = typeCheck('array');\nmodule.exports.checkIsNumber = typeCheck('number');\nmodule.exports.checkIsBoolean = typeCheck('boolean');\nmodule.exports.checkIsFunction = typeCheck('function');\nmodule.exports.checkIsObject = typeCheck('object');","module.exports = function isBuffer(arg) {\n return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function';\n};","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n ctor.super_ = superCtor;\n\n var TempCtor = function TempCtor() {};\n\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n };\n}","/*\n * Copyright (c) 2012 Mathieu Turcotte\n * Licensed under the MIT license.\n */\nvar util = require('util');\n\nfunction IllegalArgumentError(message) {\n Error.call(this, message);\n this.message = message;\n}\n\nutil.inherits(IllegalArgumentError, Error);\nIllegalArgumentError.prototype.name = 'IllegalArgumentError';\n\nfunction IllegalStateError(message) {\n Error.call(this, message);\n this.message = message;\n}\n\nutil.inherits(IllegalStateError, Error);\nIllegalStateError.prototype.name = 'IllegalStateError';\nmodule.exports.IllegalStateError = IllegalStateError;\nmodule.exports.IllegalArgumentError = IllegalArgumentError;","// Copyright (c) 2012 Mathieu Turcotte\n// Licensed under the MIT license.\nvar util = require('util');\n\nvar precond = require('precond');\n\nvar BackoffStrategy = require('./strategy'); // Exponential backoff strategy.\n\n\nfunction ExponentialBackoffStrategy(options) {\n BackoffStrategy.call(this, options);\n this.backoffDelay_ = 0;\n this.nextBackoffDelay_ = this.getInitialDelay();\n this.factor_ = ExponentialBackoffStrategy.DEFAULT_FACTOR;\n\n if (options && options.factor !== undefined) {\n precond.checkArgument(options.factor > 1, 'Exponential factor should be greater than 1 but got %s.', options.factor);\n this.factor_ = options.factor;\n }\n}\n\nutil.inherits(ExponentialBackoffStrategy, BackoffStrategy); // Default multiplication factor used to compute the next backoff delay from\n// the current one. The value can be overridden by passing a custom factor as\n// part of the options.\n\nExponentialBackoffStrategy.DEFAULT_FACTOR = 2;\n\nExponentialBackoffStrategy.prototype.next_ = function () {\n this.backoffDelay_ = Math.min(this.nextBackoffDelay_, this.getMaxDelay());\n this.nextBackoffDelay_ = this.backoffDelay_ * this.factor_;\n return this.backoffDelay_;\n};\n\nExponentialBackoffStrategy.prototype.reset_ = function () {\n this.backoffDelay_ = 0;\n this.nextBackoffDelay_ = this.getInitialDelay();\n};\n\nmodule.exports = ExponentialBackoffStrategy;","// Copyright (c) 2012 Mathieu Turcotte\n// Licensed under the MIT license.\nvar events = require('events');\n\nvar precond = require('precond');\n\nvar util = require('util');\n\nvar Backoff = require('./backoff');\n\nvar FibonacciBackoffStrategy = require('./strategy/fibonacci'); // Wraps a function to be called in a backoff loop.\n\n\nfunction FunctionCall(fn, args, callback) {\n events.EventEmitter.call(this);\n precond.checkIsFunction(fn, 'Expected fn to be a function.');\n precond.checkIsArray(args, 'Expected args to be an array.');\n precond.checkIsFunction(callback, 'Expected callback to be a function.');\n this.function_ = fn;\n this.arguments_ = args;\n this.callback_ = callback;\n this.lastResult_ = [];\n this.numRetries_ = 0;\n this.backoff_ = null;\n this.strategy_ = null;\n this.failAfter_ = -1;\n this.retryPredicate_ = FunctionCall.DEFAULT_RETRY_PREDICATE_;\n this.state_ = FunctionCall.State_.PENDING;\n}\n\nutil.inherits(FunctionCall, events.EventEmitter); // States in which the call can be.\n\nFunctionCall.State_ = {\n // Call isn't started yet.\n PENDING: 0,\n // Call is in progress.\n RUNNING: 1,\n // Call completed successfully which means that either the wrapped function\n // returned successfully or the maximal number of backoffs was reached.\n COMPLETED: 2,\n // The call was aborted.\n ABORTED: 3\n}; // The default retry predicate which considers any error as retriable.\n\nFunctionCall.DEFAULT_RETRY_PREDICATE_ = function (err) {\n return true;\n}; // Checks whether the call is pending.\n\n\nFunctionCall.prototype.isPending = function () {\n return this.state_ == FunctionCall.State_.PENDING;\n}; // Checks whether the call is in progress.\n\n\nFunctionCall.prototype.isRunning = function () {\n return this.state_ == FunctionCall.State_.RUNNING;\n}; // Checks whether the call is completed.\n\n\nFunctionCall.prototype.isCompleted = function () {\n return this.state_ == FunctionCall.State_.COMPLETED;\n}; // Checks whether the call is aborted.\n\n\nFunctionCall.prototype.isAborted = function () {\n return this.state_ == FunctionCall.State_.ABORTED;\n}; // Sets the backoff strategy to use. Can only be called before the call is\n// started otherwise an exception will be thrown.\n\n\nFunctionCall.prototype.setStrategy = function (strategy) {\n precond.checkState(this.isPending(), 'FunctionCall in progress.');\n this.strategy_ = strategy;\n return this; // Return this for chaining.\n}; // Sets the predicate which will be used to determine whether the errors\n// returned from the wrapped function should be retried or not, e.g. a\n// network error would be retriable while a type error would stop the\n// function call.\n\n\nFunctionCall.prototype.retryIf = function (retryPredicate) {\n precond.checkState(this.isPending(), 'FunctionCall in progress.');\n this.retryPredicate_ = retryPredicate;\n return this;\n}; // Returns all intermediary results returned by the wrapped function since\n// the initial call.\n\n\nFunctionCall.prototype.getLastResult = function () {\n return this.lastResult_.concat();\n}; // Returns the number of times the wrapped function call was retried.\n\n\nFunctionCall.prototype.getNumRetries = function () {\n return this.numRetries_;\n}; // Sets the backoff limit.\n\n\nFunctionCall.prototype.failAfter = function (maxNumberOfRetry) {\n precond.checkState(this.isPending(), 'FunctionCall in progress.');\n this.failAfter_ = maxNumberOfRetry;\n return this; // Return this for chaining.\n}; // Aborts the call.\n\n\nFunctionCall.prototype.abort = function () {\n if (this.isCompleted() || this.isAborted()) {\n return;\n }\n\n if (this.isRunning()) {\n this.backoff_.reset();\n }\n\n this.state_ = FunctionCall.State_.ABORTED;\n this.lastResult_ = [new Error('Backoff aborted.')];\n this.emit('abort');\n this.doCallback_();\n}; // Initiates the call to the wrapped function. Accepts an optional factory\n// function used to create the backoff instance; used when testing.\n\n\nFunctionCall.prototype.start = function (backoffFactory) {\n precond.checkState(!this.isAborted(), 'FunctionCall is aborted.');\n precond.checkState(this.isPending(), 'FunctionCall already started.');\n var strategy = this.strategy_ || new FibonacciBackoffStrategy();\n this.backoff_ = backoffFactory ? backoffFactory(strategy) : new Backoff(strategy);\n this.backoff_.on('ready', this.doCall_.bind(this, true\n /* isRetry */\n ));\n this.backoff_.on('fail', this.doCallback_.bind(this));\n this.backoff_.on('backoff', this.handleBackoff_.bind(this));\n\n if (this.failAfter_ > 0) {\n this.backoff_.failAfter(this.failAfter_);\n }\n\n this.state_ = FunctionCall.State_.RUNNING;\n this.doCall_(false\n /* isRetry */\n );\n}; // Calls the wrapped function.\n\n\nFunctionCall.prototype.doCall_ = function (isRetry) {\n if (isRetry) {\n this.numRetries_++;\n }\n\n var eventArgs = ['call'].concat(this.arguments_);\n events.EventEmitter.prototype.emit.apply(this, eventArgs);\n var callback = this.handleFunctionCallback_.bind(this);\n this.function_.apply(null, this.arguments_.concat(callback));\n}; // Calls the wrapped function's callback with the last result returned by the\n// wrapped function.\n\n\nFunctionCall.prototype.doCallback_ = function () {\n this.callback_.apply(null, this.lastResult_);\n}; // Handles wrapped function's completion. This method acts as a replacement\n// for the original callback function.\n\n\nFunctionCall.prototype.handleFunctionCallback_ = function () {\n if (this.isAborted()) {\n return;\n }\n\n var args = Array.prototype.slice.call(arguments);\n this.lastResult_ = args; // Save last callback arguments.\n\n events.EventEmitter.prototype.emit.apply(this, ['callback'].concat(args));\n var err = args[0];\n\n if (err && this.retryPredicate_(err)) {\n this.backoff_.backoff(err);\n } else {\n this.state_ = FunctionCall.State_.COMPLETED;\n this.doCallback_();\n }\n}; // Handles the backoff event by reemitting it.\n\n\nFunctionCall.prototype.handleBackoff_ = function (number, delay, err) {\n this.emit('backoff', number, delay, err);\n};\n\nmodule.exports = FunctionCall;","var _extends = Object.assign || 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\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport hoistStatics from \"hoist-non-react-statics\";\nimport Route from \"./Route\";\n/**\n * A public higher-order component to access the imperative API\n */\n\nvar withRouter = function withRouter(Component) {\n var C = function C(props) {\n var wrappedComponentRef = props.wrappedComponentRef,\n remainingProps = _objectWithoutProperties(props, [\"wrappedComponentRef\"]);\n\n return React.createElement(Route, {\n children: function children(routeComponentProps) {\n return React.createElement(Component, _extends({}, remainingProps, routeComponentProps, {\n ref: wrappedComponentRef\n }));\n }\n });\n };\n\n C.displayName = \"withRouter(\" + (Component.displayName || Component.name) + \")\";\n C.WrappedComponent = Component;\n return hoistStatics(C, Component);\n};\n\nexport default withRouter;","// Written in this round about way for babel-transform-imports\nimport withRouter from \"react-router/es/withRouter\";\nexport default withRouter;","import React from 'react';\nimport ColumnHeader from './column_header';\nimport PropTypes from 'prop-types';\nimport { debounce } from 'lodash';\nimport { scrollTop } from 'flavours/glitch/util/scroll';\nimport { isMobile } from 'flavours/glitch/util/is_mobile';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n heading: PropTypes.string,\n icon: PropTypes.string,\n children: PropTypes.node,\n active: PropTypes.bool,\n hideHeadingOnMobile: PropTypes.bool,\n name: PropTypes.string,\n };\n\n handleHeaderClick = () => {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n scrollTop () {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n\n handleScroll = debounce(() => {\n if (typeof this._interruptScrollAnimation !== 'undefined') {\n this._interruptScrollAnimation();\n }\n }, 200)\n\n setRef = (c) => {\n this.node = c;\n }\n\n render () {\n const { heading, icon, children, active, hideHeadingOnMobile, name } = this.props;\n\n const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)));\n\n const columnHeaderId = showHeading && heading.replace(/ /g, '-');\n const header = showHeading && (\n \n );\n return (\n \n {header}\n {children}\n
\n );\n }\n\n}\n","import React from 'react';\nimport ColumnHeader from './column_header';\nimport PropTypes from 'prop-types';\nimport { debounce } from 'lodash';\nimport { scrollTop } from '../../../scroll';\nimport { isMobile } from '../../../is_mobile';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n heading: PropTypes.string,\n icon: PropTypes.string,\n children: PropTypes.node,\n active: PropTypes.bool,\n hideHeadingOnMobile: PropTypes.bool,\n };\n\n handleHeaderClick = () => {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n scrollTop () {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n\n handleScroll = debounce(() => {\n if (typeof this._interruptScrollAnimation !== 'undefined') {\n this._interruptScrollAnimation();\n }\n }, 200)\n\n setRef = (c) => {\n this.node = c;\n }\n\n render () {\n const { heading, icon, children, active, hideHeadingOnMobile } = this.props;\n\n const showHeading = heading && (!hideHeadingOnMobile || (hideHeadingOnMobile && !isMobile(window.innerWidth)));\n\n const columnHeaderId = showHeading && heading.replace(/ /g, '-');\n const header = showHeading && (\n \n );\n return (\n \n {header}\n {children}\n
\n );\n }\n\n}\n","/**\n * Buttons widget for controlling the notification clearing mode.\n * In idle state, the cleaning mode button is shown. When the mode is active,\n * a Confirm and Abort buttons are shown in its place.\n */\n\n\n// Package imports //\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport Icon from 'flavours/glitch/components/icon';\n\nconst messages = defineMessages({\n btnAll : { id: 'notification_purge.btn_all', defaultMessage: 'Select\\nall' },\n btnNone : { id: 'notification_purge.btn_none', defaultMessage: 'Select\\nnone' },\n btnInvert : { id: 'notification_purge.btn_invert', defaultMessage: 'Invert\\nselection' },\n btnApply : { id: 'notification_purge.btn_apply', defaultMessage: 'Clear\\nselected' },\n});\n\nexport default @injectIntl\nclass NotificationPurgeButtons extends ImmutablePureComponent {\n\n static propTypes = {\n onDeleteMarked : PropTypes.func.isRequired,\n onMarkAll : PropTypes.func.isRequired,\n onMarkNone : PropTypes.func.isRequired,\n onInvert : PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n markNewForDelete: PropTypes.bool,\n };\n\n render () {\n const { intl, markNewForDelete } = this.props;\n\n //className='active'\n return (\n \n \n ∀ {intl.formatMessage(messages.btnAll)}\n \n\n \n ∅ {intl.formatMessage(messages.btnNone)}\n \n\n \n ¬ {intl.formatMessage(messages.btnInvert)}\n \n\n \n {intl.formatMessage(messages.btnApply)}\n \n
\n );\n }\n\n}\n","// Package imports.\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl } from 'react-intl';\n\n// Our imports.\nimport NotificationPurgeButtons from 'flavours/glitch/components/notification_purge_buttons';\nimport {\n deleteMarkedNotifications,\n enterNotificationClearingMode,\n markAllNotifications,\n} from 'flavours/glitch/actions/notifications';\nimport { openModal } from 'flavours/glitch/actions/modal';\n\nconst messages = defineMessages({\n clearMessage: { id: 'notifications.marked_clear_confirmation', defaultMessage: 'Are you sure you want to permanently clear all selected notifications?' },\n clearConfirm: { id: 'notifications.marked_clear', defaultMessage: 'Clear selected notifications' },\n});\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n onEnterCleaningMode(yes) {\n dispatch(enterNotificationClearingMode(yes));\n },\n\n onDeleteMarked() {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.clearMessage),\n confirm: intl.formatMessage(messages.clearConfirm),\n onConfirm: () => dispatch(deleteMarkedNotifications()),\n }));\n },\n\n onMarkAll() {\n dispatch(markAllNotifications(true));\n },\n\n onMarkNone() {\n dispatch(markAllNotifications(false));\n },\n\n onInvert() {\n dispatch(markAllNotifications(null));\n },\n});\n\nconst mapStateToProps = state => ({\n markNewForDelete: state.getIn(['notifications', 'markNewForDelete']),\n});\n\nexport default injectIntl(connect(mapStateToProps, mapDispatchToProps)(NotificationPurgeButtons));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { defineMessages, FormattedMessage, injectIntl } from 'react-intl';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Icon from 'flavours/glitch/components/icon';\n\nimport NotificationPurgeButtonsContainer from 'flavours/glitch/containers/notification_purge_buttons_container';\n\nconst messages = defineMessages({\n show: { id: 'column_header.show_settings', defaultMessage: 'Show settings' },\n hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' },\n moveLeft: { id: 'column_header.moveLeft_settings', defaultMessage: 'Move column to the left' },\n moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' },\n enterNotifCleaning : { id: 'notification_purge.start', defaultMessage: 'Enter notification cleaning mode' },\n});\n\nexport default @injectIntl\nclass ColumnHeader extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n title: PropTypes.node,\n icon: PropTypes.string,\n active: PropTypes.bool,\n localSettings : ImmutablePropTypes.map,\n multiColumn: PropTypes.bool,\n extraButton: PropTypes.node,\n showBackButton: PropTypes.bool,\n notifCleaning: PropTypes.bool, // true only for the notification column\n notifCleaningActive: PropTypes.bool,\n onEnterCleaningMode: PropTypes.func,\n children: PropTypes.node,\n pinned: PropTypes.bool,\n onPin: PropTypes.func,\n onMove: PropTypes.func,\n onClick: PropTypes.func,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n collapsed: true,\n animating: false,\n animatingNCD: false,\n };\n\n historyBack = (skip) => {\n // if history is exhausted, or we would leave mastodon, just go to root.\n if (window.history.state) {\n const state = this.context.router.history.location.state;\n if (skip && state && state.mastodonBackSteps) {\n this.context.router.history.go(-state.mastodonBackSteps);\n } else {\n this.context.router.history.goBack();\n }\n } else {\n this.context.router.history.push('/');\n }\n }\n\n handleToggleClick = (e) => {\n e.stopPropagation();\n this.setState({ collapsed: !this.state.collapsed, animating: true });\n }\n\n handleTitleClick = () => {\n this.props.onClick();\n }\n\n handleMoveLeft = () => {\n this.props.onMove(-1);\n }\n\n handleMoveRight = () => {\n this.props.onMove(1);\n }\n\n handleBackClick = (event) => {\n this.historyBack(event.shiftKey);\n }\n\n handleTransitionEnd = () => {\n this.setState({ animating: false });\n }\n\n handleTransitionEndNCD = () => {\n this.setState({ animatingNCD: false });\n }\n\n handlePin = () => {\n if (!this.props.pinned) {\n this.historyBack();\n }\n this.props.onPin();\n }\n\n onEnterCleaningMode = () => {\n this.setState({ animatingNCD: true });\n this.props.onEnterCleaningMode(!this.props.notifCleaningActive);\n }\n\n render () {\n const { intl, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, notifCleaning, notifCleaningActive } = this.props;\n const { collapsed, animating, animatingNCD } = this.state;\n\n let title = this.props.title;\n\n const wrapperClassName = classNames('column-header__wrapper', {\n 'active': active,\n });\n\n const buttonClassName = classNames('column-header', {\n 'active': active,\n });\n\n const collapsibleClassName = classNames('column-header__collapsible', {\n 'collapsed': collapsed,\n 'animating': animating,\n });\n\n const collapsibleButtonClassName = classNames('column-header__button', {\n 'active': !collapsed,\n });\n\n const notifCleaningButtonClassName = classNames('column-header__button', {\n 'active': notifCleaningActive,\n });\n\n const notifCleaningDrawerClassName = classNames('ncd column-header__collapsible', {\n 'collapsed': !notifCleaningActive,\n 'animating': animatingNCD,\n });\n\n let extraContent, pinButton, moveButtons, backButton, collapseButton;\n\n //*glitch\n const msgEnterNotifCleaning = intl.formatMessage(messages.enterNotifCleaning);\n\n if (children) {\n extraContent = (\n \n {children}\n
\n );\n }\n\n if (multiColumn && pinned) {\n pinButton = ;\n\n moveButtons = (\n \n \n \n
\n );\n } else if (multiColumn) {\n pinButton = ;\n }\n\n if (!pinned && (multiColumn || showBackButton)) {\n backButton = (\n \n \n \n \n );\n }\n\n const collapsedContent = [\n extraContent,\n ];\n\n if (multiColumn) {\n collapsedContent.push(moveButtons);\n collapsedContent.push(pinButton);\n }\n\n if (children || multiColumn) {\n collapseButton = ;\n }\n\n const hasTitle = icon && title;\n\n return (\n \n
\n {hasTitle && (\n \n \n {title}\n \n )}\n\n {!hasTitle && backButton}\n\n \n {hasTitle && backButton}\n {extraButton}\n { notifCleaning ? (\n \n \n \n ) : null}\n {collapseButton}\n
\n \n\n { notifCleaning ? (\n
\n
\n {(notifCleaningActive || animatingNCD) ? ( ) : null }\n
\n
\n ) : null}\n\n
\n
\n {(!collapsed || animating) && collapsedContent}\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { createPortal } from 'react-dom';\nimport classNames from 'classnames';\nimport { FormattedMessage, injectIntl, defineMessages } from 'react-intl';\nimport Icon from 'mastodon/components/icon';\n\nconst messages = defineMessages({\n show: { id: 'column_header.show_settings', defaultMessage: 'Show settings' },\n hide: { id: 'column_header.hide_settings', defaultMessage: 'Hide settings' },\n moveLeft: { id: 'column_header.moveLeft_settings', defaultMessage: 'Move column to the left' },\n moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' },\n});\n\nexport default @injectIntl\nclass ColumnHeader extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n title: PropTypes.node,\n icon: PropTypes.string,\n active: PropTypes.bool,\n multiColumn: PropTypes.bool,\n extraButton: PropTypes.node,\n showBackButton: PropTypes.bool,\n children: PropTypes.node,\n pinned: PropTypes.bool,\n placeholder: PropTypes.bool,\n onPin: PropTypes.func,\n onMove: PropTypes.func,\n onClick: PropTypes.func,\n };\n\n state = {\n collapsed: true,\n animating: false,\n };\n\n historyBack = () => {\n if (window.history && window.history.length === 1) {\n this.context.router.history.push('/');\n } else {\n this.context.router.history.goBack();\n }\n }\n\n handleToggleClick = (e) => {\n e.stopPropagation();\n this.setState({ collapsed: !this.state.collapsed, animating: true });\n }\n\n handleTitleClick = () => {\n this.props.onClick();\n }\n\n handleMoveLeft = () => {\n this.props.onMove(-1);\n }\n\n handleMoveRight = () => {\n this.props.onMove(1);\n }\n\n handleBackClick = () => {\n this.historyBack();\n }\n\n handleTransitionEnd = () => {\n this.setState({ animating: false });\n }\n\n handlePin = () => {\n if (!this.props.pinned) {\n this.historyBack();\n }\n this.props.onPin();\n }\n\n render () {\n const { title, icon, active, children, pinned, multiColumn, extraButton, showBackButton, intl: { formatMessage }, placeholder } = this.props;\n const { collapsed, animating } = this.state;\n\n const wrapperClassName = classNames('column-header__wrapper', {\n 'active': active,\n });\n\n const buttonClassName = classNames('column-header', {\n 'active': active,\n });\n\n const collapsibleClassName = classNames('column-header__collapsible', {\n 'collapsed': collapsed,\n 'animating': animating,\n });\n\n const collapsibleButtonClassName = classNames('column-header__button', {\n 'active': !collapsed,\n });\n\n let extraContent, pinButton, moveButtons, backButton, collapseButton;\n\n if (children) {\n extraContent = (\n \n {children}\n
\n );\n }\n\n if (multiColumn && pinned) {\n pinButton = ;\n\n moveButtons = (\n \n \n \n
\n );\n } else if (multiColumn && this.props.onPin) {\n pinButton = ;\n }\n\n if (!pinned && (multiColumn || showBackButton)) {\n backButton = (\n \n \n \n \n );\n }\n\n const collapsedContent = [\n extraContent,\n ];\n\n if (multiColumn) {\n collapsedContent.push(moveButtons);\n collapsedContent.push(pinButton);\n }\n\n if (children || (multiColumn && this.props.onPin)) {\n collapseButton = ;\n }\n\n const hasTitle = icon && title;\n\n const component = (\n \n
\n {hasTitle && (\n \n \n {title}\n \n )}\n\n {!hasTitle && backButton}\n\n \n {hasTitle && backButton}\n {extraButton}\n {collapseButton}\n
\n \n\n
\n
\n {(!collapsed || animating) && collapsedContent}\n
\n
\n
\n );\n\n if (multiColumn || placeholder) {\n return component;\n } else {\n // The portal container and the component may be rendered to the DOM in\n // the same React render pass, so the container might not be available at\n // the time `render()` is called.\n const container = document.getElementById('tabs-bar__portal');\n if (container === null) {\n // The container wasn't available, force a re-render so that the\n // component can eventually be inserted in the container and not scroll\n // with the rest of the area.\n this.forceUpdate();\n return component;\n } else {\n return createPortal(component, container);\n }\n }\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\nimport Icon from 'mastodon/components/icon';\nimport { createPortal } from 'react-dom';\n\nexport default class ColumnBackButton extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n multiColumn: PropTypes.bool,\n };\n\n handleClick = () => {\n if (window.history && window.history.length === 1) {\n this.context.router.history.push('/');\n } else {\n this.context.router.history.goBack();\n }\n }\n\n render () {\n const { multiColumn } = this.props;\n\n const component = (\n \n \n \n \n );\n\n if (multiColumn) {\n return component;\n } else {\n // The portal container and the component may be rendered to the DOM in\n // the same React render pass, so the container might not be available at\n // the time `render()` is called.\n const container = document.getElementById('tabs-bar__portal');\n if (container === null) {\n // The container wasn't available, force a re-render so that the\n // component can eventually be inserted in the container and not scroll\n // with the rest of the area.\n this.forceUpdate();\n return component;\n } else {\n return createPortal(component, container);\n }\n }\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport detectPassiveEvents from 'detect-passive-events';\nimport { scrollTop } from 'flavours/glitch/util/scroll';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n children: PropTypes.node,\n extraClasses: PropTypes.string,\n name: PropTypes.string,\n label: PropTypes.string,\n };\n\n scrollTop () {\n const scrollable = this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n handleWheel = () => {\n if (typeof this._interruptScrollAnimation !== 'function') {\n return;\n }\n\n this._interruptScrollAnimation();\n }\n\n setRef = c => {\n this.node = c;\n }\n\n componentDidMount () {\n this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);\n }\n\n componentWillUnmount () {\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n\n render () {\n const { children, extraClasses, name, label } = this.props;\n\n return (\n \n {children}\n
\n );\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\nimport Icon from 'flavours/glitch/components/icon';\n\nexport default class ColumnBackButtonSlim extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleClick = (event) => {\n // if history is exhausted, or we would leave mastodon, just go to root.\n if (window.history.state) {\n const state = this.context.router.history.location.state;\n if (event.shiftKey && state && state.mastodonBackSteps) {\n this.context.router.history.go(-state.mastodonBackSteps);\n } else {\n this.context.router.history.goBack();\n }\n } else {\n this.context.router.history.push('/');\n }\n }\n\n render () {\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport detectPassiveEvents from 'detect-passive-events';\nimport { scrollTop } from '../scroll';\n\nexport default class Column extends React.PureComponent {\n\n static propTypes = {\n children: PropTypes.node,\n label: PropTypes.string,\n bindToDocument: PropTypes.bool,\n };\n\n scrollTop () {\n const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable');\n\n if (!scrollable) {\n return;\n }\n\n this._interruptScrollAnimation = scrollTop(scrollable);\n }\n\n handleWheel = () => {\n if (typeof this._interruptScrollAnimation !== 'function') {\n return;\n }\n\n this._interruptScrollAnimation();\n }\n\n setRef = c => {\n this.node = c;\n }\n\n componentDidMount () {\n if (this.props.bindToDocument) {\n document.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);\n } else {\n this.node.addEventListener('wheel', this.handleWheel, detectPassiveEvents.hasSupport ? { passive: true } : false);\n }\n }\n\n componentWillUnmount () {\n if (this.props.bindToDocument) {\n document.removeEventListener('wheel', this.handleWheel);\n } else {\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n }\n\n render () {\n const { label, children } = this.props;\n\n return (\n \n {children}\n
\n );\n }\n\n}\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport ColumnBackButton from './column_back_button';\nimport Icon from 'mastodon/components/icon';\n\nexport default class ColumnBackButtonSlim extends ColumnBackButton {\n\n render () {\n return (\n \n );\n }\n\n}\n","import WebSocketClient from 'websocket.js';\n\nconst randomIntUpTo = max => Math.floor(Math.random() * Math.floor(max));\n\nexport function connectStream(path, pollingRefresh = null, callbacks = () => ({ onConnect() {}, onDisconnect() {}, onReceive() {} })) {\n return (dispatch, getState) => {\n const streamingAPIBaseURL = getState().getIn(['meta', 'streaming_api_base_url']);\n const accessToken = getState().getIn(['meta', 'access_token']);\n const { onConnect, onDisconnect, onReceive } = callbacks(dispatch, getState);\n\n let polling = null;\n\n const setupPolling = () => {\n pollingRefresh(dispatch, () => {\n polling = setTimeout(() => setupPolling(), 20000 + randomIntUpTo(20000));\n });\n };\n\n const clearPolling = () => {\n if (polling) {\n clearTimeout(polling);\n polling = null;\n }\n };\n\n const subscription = getStream(streamingAPIBaseURL, accessToken, path, {\n connected () {\n if (pollingRefresh) {\n clearPolling();\n }\n\n onConnect();\n },\n\n disconnected () {\n if (pollingRefresh) {\n polling = setTimeout(() => setupPolling(), randomIntUpTo(40000));\n }\n\n onDisconnect();\n },\n\n received (data) {\n onReceive(data);\n },\n\n reconnected () {\n if (pollingRefresh) {\n clearPolling();\n pollingRefresh(dispatch);\n }\n\n onConnect();\n },\n\n });\n\n const disconnect = () => {\n if (subscription) {\n subscription.close();\n }\n\n clearPolling();\n };\n\n return disconnect;\n };\n}\n\n\nexport default function getStream(streamingAPIBaseURL, accessToken, stream, { connected, received, disconnected, reconnected }) {\n const params = [ `stream=${stream}` ];\n\n const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken);\n\n ws.onopen = connected;\n ws.onmessage = e => {\n if (e.data !== '')\n received(JSON.parse(e.data));\n };\n ws.onclose = disconnected;\n ws.onreconnect = reconnected;\n\n return ws;\n};\n","import { connectStream } from 'flavours/glitch/util/stream';\nimport {\n updateTimeline,\n deleteFromTimelines,\n expandHomeTimeline,\n connectTimeline,\n disconnectTimeline,\n} from './timelines';\nimport { updateNotifications, expandNotifications } from './notifications';\nimport { updateConversations } from './conversations';\nimport { fetchFilters } from './filters';\nimport { getLocale } from 'mastodon/locales';\n\nconst { messages } = getLocale();\n\nexport function connectTimelineStream (timelineId, path, pollingRefresh = null, accept = null) {\n\n return connectStream (path, pollingRefresh, (dispatch, getState) => {\n const locale = getState().getIn(['meta', 'locale']);\n\n return {\n onConnect() {\n dispatch(connectTimeline(timelineId));\n },\n\n onDisconnect() {\n dispatch(disconnectTimeline(timelineId));\n },\n\n onReceive (data) {\n switch(data.event) {\n case 'update':\n dispatch(updateTimeline(timelineId, JSON.parse(data.payload), accept));\n break;\n case 'delete':\n dispatch(deleteFromTimelines(data.payload));\n break;\n case 'notification':\n dispatch(updateNotifications(JSON.parse(data.payload), messages, locale));\n break;\n case 'conversation':\n dispatch(updateConversations(JSON.parse(data.payload)));\n break;\n case 'filters_changed':\n dispatch(fetchFilters());\n break;\n }\n },\n };\n });\n}\n\nconst refreshHomeTimelineAndNotification = (dispatch, done) => {\n dispatch(expandHomeTimeline({}, () => dispatch(expandNotifications({}, done))));\n};\n\nexport const connectUserStream = () => connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification);\nexport const connectCommunityStream = ({ onlyMedia } = {}) => connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`);\nexport const connectPublicStream = ({ onlyMedia } = {}) => connectTimelineStream(`public${onlyMedia ? ':media' : ''}`, `public${onlyMedia ? ':media' : ''}`);\nexport const connectHashtagStream = (id, tag, accept) => connectTimelineStream(`hashtag:${id}`, `hashtag&tag=${tag}`, null, accept);\nexport const connectDirectStream = () => connectTimelineStream('direct', 'direct');\nexport const connectListStream = id => connectTimelineStream(`list:${id}`, `list&list=${id}`);\n","import WebSocketClient from 'websocket.js';\n\nconst randomIntUpTo = max => Math.floor(Math.random() * Math.floor(max));\n\nexport function connectStream(path, pollingRefresh = null, callbacks = () => ({ onConnect() {}, onDisconnect() {}, onReceive() {} })) {\n return (dispatch, getState) => {\n const streamingAPIBaseURL = getState().getIn(['meta', 'streaming_api_base_url']);\n const accessToken = getState().getIn(['meta', 'access_token']);\n const { onConnect, onDisconnect, onReceive } = callbacks(dispatch, getState);\n\n let polling = null;\n\n const setupPolling = () => {\n pollingRefresh(dispatch, () => {\n polling = setTimeout(() => setupPolling(), 20000 + randomIntUpTo(20000));\n });\n };\n\n const clearPolling = () => {\n if (polling) {\n clearTimeout(polling);\n polling = null;\n }\n };\n\n const subscription = getStream(streamingAPIBaseURL, accessToken, path, {\n connected () {\n if (pollingRefresh) {\n clearPolling();\n }\n\n onConnect();\n },\n\n disconnected () {\n if (pollingRefresh) {\n polling = setTimeout(() => setupPolling(), randomIntUpTo(40000));\n }\n\n onDisconnect();\n },\n\n received (data) {\n onReceive(data);\n },\n\n reconnected () {\n if (pollingRefresh) {\n clearPolling();\n pollingRefresh(dispatch);\n }\n\n onConnect();\n },\n\n });\n\n const disconnect = () => {\n if (subscription) {\n subscription.close();\n }\n\n clearPolling();\n };\n\n return disconnect;\n };\n}\n\n\nexport default function getStream(streamingAPIBaseURL, accessToken, stream, { connected, received, disconnected, reconnected }) {\n const params = [ `stream=${stream}` ];\n\n const ws = new WebSocketClient(`${streamingAPIBaseURL}/api/v1/streaming/?${params.join('&')}`, accessToken);\n\n ws.onopen = connected;\n ws.onmessage = e => {\n if (e.data !== '')\n received(JSON.parse(e.data));\n };\n ws.onclose = disconnected;\n ws.onreconnect = reconnected;\n\n return ws;\n};\n","import { connectStream } from '../stream';\nimport {\n updateTimeline,\n deleteFromTimelines,\n expandHomeTimeline,\n connectTimeline,\n disconnectTimeline,\n} from './timelines';\nimport { updateNotifications, expandNotifications } from './notifications';\nimport { updateConversations } from './conversations';\nimport { fetchFilters } from './filters';\nimport { getLocale } from '../locales';\n\nconst { messages } = getLocale();\n\nexport function connectTimelineStream (timelineId, path, pollingRefresh = null, accept = null) {\n\n return connectStream (path, pollingRefresh, (dispatch, getState) => {\n const locale = getState().getIn(['meta', 'locale']);\n\n return {\n onConnect() {\n dispatch(connectTimeline(timelineId));\n },\n\n onDisconnect() {\n dispatch(disconnectTimeline(timelineId));\n },\n\n onReceive (data) {\n switch(data.event) {\n case 'update':\n dispatch(updateTimeline(timelineId, JSON.parse(data.payload), accept));\n break;\n case 'delete':\n dispatch(deleteFromTimelines(data.payload));\n break;\n case 'notification':\n dispatch(updateNotifications(JSON.parse(data.payload), messages, locale));\n break;\n case 'conversation':\n dispatch(updateConversations(JSON.parse(data.payload)));\n break;\n case 'filters_changed':\n dispatch(fetchFilters());\n break;\n }\n },\n };\n });\n}\n\nconst refreshHomeTimelineAndNotification = (dispatch, done) => {\n dispatch(expandHomeTimeline({}, () => dispatch(expandNotifications({}, done))));\n};\n\nexport const connectUserStream = () => connectTimelineStream('home', 'user', refreshHomeTimelineAndNotification);\nexport const connectCommunityStream = ({ onlyMedia } = {}) => connectTimelineStream(`community${onlyMedia ? ':media' : ''}`, `public:local${onlyMedia ? ':media' : ''}`);\nexport const connectPublicStream = ({ onlyMedia } = {}) => connectTimelineStream(`public${onlyMedia ? ':media' : ''}`, `public${onlyMedia ? ':media' : ''}`);\nexport const connectHashtagStream = (id, tag, accept) => connectTimelineStream(`hashtag:${id}`, `hashtag&tag=${tag}`, null, accept);\nexport const connectDirectStream = () => connectTimelineStream('direct', 'direct');\nexport const connectListStream = id => connectTimelineStream(`list:${id}`, `list&list=${id}`);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport IconButton from './icon_button';\nimport Overlay from 'react-overlays/lib/Overlay';\nimport Motion from 'flavours/glitch/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport detectPassiveEvents from 'detect-passive-events';\n\nconst listenerOptions = detectPassiveEvents.hasSupport ? { passive: true } : false;\nlet id = 0;\n\nclass DropdownMenu extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n items: PropTypes.array.isRequired,\n onClose: PropTypes.func.isRequired,\n style: PropTypes.object,\n placement: PropTypes.string,\n arrowOffsetLeft: PropTypes.string,\n arrowOffsetTop: PropTypes.string,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n style: {},\n placement: 'bottom',\n };\n\n state = {\n mounted: false,\n };\n\n handleDocumentClick = e => {\n if (this.node && !this.node.contains(e.target)) {\n this.props.onClose();\n }\n }\n\n componentDidMount () {\n document.addEventListener('click', this.handleDocumentClick, false);\n document.addEventListener('keydown', this.handleKeyDown, false);\n document.addEventListener('touchend', this.handleDocumentClick, listenerOptions);\n if (this.focusedItem && this.props.openedViaKeyboard) {\n this.focusedItem.focus();\n }\n this.setState({ mounted: true });\n }\n\n componentWillUnmount () {\n document.removeEventListener('click', this.handleDocumentClick, false);\n document.removeEventListener('keydown', this.handleKeyDown, false);\n document.removeEventListener('touchend', this.handleDocumentClick, listenerOptions);\n }\n\n setRef = c => {\n this.node = c;\n }\n\n setFocusRef = c => {\n this.focusedItem = c;\n }\n\n handleKeyDown = e => {\n const items = Array.from(this.node.getElementsByTagName('a'));\n const index = items.indexOf(document.activeElement);\n let element;\n\n switch(e.key) {\n case 'ArrowDown':\n element = items[index+1];\n if (element) {\n element.focus();\n }\n break;\n case 'ArrowUp':\n element = items[index-1];\n if (element) {\n element.focus();\n }\n break;\n case 'Tab':\n if (e.shiftKey) {\n element = items[index-1] || items[items.length-1];\n } else {\n element = items[index+1] || items[0];\n }\n if (element) {\n element.focus();\n e.preventDefault();\n e.stopPropagation();\n }\n break;\n case 'Home':\n element = items[0];\n if (element) {\n element.focus();\n }\n break;\n case 'End':\n element = items[items.length-1];\n if (element) {\n element.focus();\n }\n break;\n case 'Escape':\n this.props.onClose();\n break;\n }\n }\n\n handleItemKeyPress = e => {\n if (e.key === 'Enter' || e.key === ' ') {\n this.handleClick(e);\n }\n }\n\n handleClick = e => {\n const i = Number(e.currentTarget.getAttribute('data-index'));\n const { action, to } = this.props.items[i];\n\n this.props.onClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action();\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n renderItem (option, i) {\n if (option === null) {\n return ;\n }\n\n const { text, href = '#' } = option;\n\n return (\n \n \n {text}\n \n \n );\n }\n\n render () {\n const { items, style, placement, arrowOffsetLeft, arrowOffsetTop } = this.props;\n const { mounted } = this.state;\n\n return (\n \n {({ opacity, scaleX, scaleY }) => (\n // It should not be transformed when mounting because the resulting\n // size will be used to determine the coordinate of the menu by\n // react-overlays\n \n
\n\n
\n {items.map((option, i) => this.renderItem(option, i))}\n \n
\n )}\n \n );\n }\n\n}\n\nexport default class Dropdown extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n icon: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired,\n size: PropTypes.number.isRequired,\n ariaLabel: PropTypes.string,\n disabled: PropTypes.bool,\n status: ImmutablePropTypes.map,\n isUserTouching: PropTypes.func,\n isModalOpen: PropTypes.bool.isRequired,\n onOpen: PropTypes.func.isRequired,\n onClose: PropTypes.func.isRequired,\n dropdownPlacement: PropTypes.string,\n openDropdownId: PropTypes.number,\n openedViaKeyboard: PropTypes.bool,\n };\n\n static defaultProps = {\n ariaLabel: 'Menu',\n };\n\n state = {\n id: id++,\n };\n\n handleClick = ({ target, type }) => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n } else {\n const { top } = target.getBoundingClientRect();\n const placement = top * 2 < innerHeight ? 'bottom' : 'top';\n this.props.onOpen(this.state.id, this.handleItemClick, placement, type !== 'click');\n }\n }\n\n handleClose = () => {\n if (this.activeElement) {\n this.activeElement.focus();\n this.activeElement = null;\n }\n this.props.onClose(this.state.id);\n }\n\n handleMouseDown = () => {\n if (!this.state.open) {\n this.activeElement = document.activeElement;\n }\n }\n\n handleButtonKeyDown = (e) => {\n switch(e.key) {\n case ' ':\n case 'Enter':\n this.handleMouseDown();\n break;\n }\n }\n\n handleKeyPress = (e) => {\n switch(e.key) {\n case ' ':\n case 'Enter':\n this.handleClick(e);\n e.stopPropagation();\n e.preventDefault();\n break;\n }\n }\n\n handleItemClick = (i, e) => {\n const { action, to } = this.props.items[i];\n\n this.handleClose();\n\n if (typeof action === 'function') {\n e.preventDefault();\n action();\n } else if (to) {\n e.preventDefault();\n this.context.router.history.push(to);\n }\n }\n\n setTargetRef = c => {\n this.target = c;\n }\n\n findTarget = () => {\n return this.target;\n }\n\n componentWillUnmount = () => {\n if (this.state.id === this.props.openDropdownId) {\n this.handleClose();\n }\n }\n\n render () {\n const { icon, items, size, ariaLabel, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard } = this.props;\n const open = this.state.id === openDropdownId;\n\n return (\n \n \n\n \n \n \n
\n );\n }\n\n}\n","import { openDropdownMenu, closeDropdownMenu } from 'flavours/glitch/actions/dropdown_menu';\nimport { openModal, closeModal } from 'flavours/glitch/actions/modal';\nimport { connect } from 'react-redux';\nimport DropdownMenu from 'flavours/glitch/components/dropdown_menu';\nimport { isUserTouching } from 'flavours/glitch/util/is_mobile';\n\nconst mapStateToProps = state => ({\n isModalOpen: state.get('modal').modalType === 'ACTIONS',\n dropdownPlacement: state.getIn(['dropdown_menu', 'placement']),\n openDropdownId: state.getIn(['dropdown_menu', 'openId']),\n openedViaKeyboard: state.getIn(['dropdown_menu', 'keyboard']),\n});\n\nconst mapDispatchToProps = (dispatch, { status, items }) => ({\n onOpen(id, onItemClick, dropdownPlacement, keyboard) {\n dispatch(isUserTouching() ? openModal('ACTIONS', {\n status,\n actions: items.map(\n (item, i) => item ? {\n ...item,\n name: `${item.text}-${i}`,\n onClick: item.action ? ((e) => { return onItemClick(i, e) }) : null,\n } : null\n ),\n }) : openDropdownMenu(id, dropdownPlacement, keyboard));\n },\n onClose(id) {\n dispatch(closeModal('ACTIONS'));\n dispatch(closeDropdownMenu(id));\n },\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DropdownMenu);\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Avatar from 'flavours/glitch/components/avatar';\nimport Permalink from 'flavours/glitch/components/permalink';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { profileLink } from 'flavours/glitch/util/backend_links';\n\nexport default class NavigationBar extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n };\n\n render () {\n return (\n \n
\n {this.props.account.get('acct')} \n \n \n\n
\n
\n @{this.props.account.get('acct')} \n \n\n { profileLink !== undefined && (\n
\n )}\n
\n
\n );\n };\n}\n","import React from 'react';\nimport { Sparklines, SparklinesCurve } from 'react-sparklines';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Permalink from './permalink';\nimport { shortNumberFormat } from 'flavours/glitch/util/numbers';\n\nconst Hashtag = ({ hashtag }) => (\n \n
\n
\n #{hashtag.get('name')} \n \n\n
{shortNumberFormat(hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1)} }} />\n \n\n
\n {shortNumberFormat(hashtag.getIn(['history', 0, 'uses']) * 1 + hashtag.getIn(['history', 1, 'uses']) * 1)}\n
\n\n
\n day.get('uses')).toArray()}>\n \n \n
\n
\n);\n\nHashtag.propTypes = {\n hashtag: ImmutablePropTypes.map.isRequired,\n};\n\nexport default Hashtag;\n","import React from 'react';\nimport { Sparklines, SparklinesCurve } from 'react-sparklines';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Permalink from './permalink';\nimport { shortNumberFormat } from '../utils/numbers';\n\nconst Hashtag = ({ hashtag }) => (\n \n
\n
\n #{hashtag.get('name')} \n \n\n
{shortNumberFormat(hashtag.getIn(['history', 0, 'accounts']) * 1 + hashtag.getIn(['history', 1, 'accounts']) * 1)} }} />\n \n\n
\n {shortNumberFormat(hashtag.getIn(['history', 0, 'uses']) * 1 + hashtag.getIn(['history', 1, 'uses']) * 1)}\n
\n\n
\n day.get('uses')).toArray()}>\n \n \n
\n
\n);\n\nHashtag.propTypes = {\n hashtag: ImmutablePropTypes.map.isRequired,\n};\n\nexport default Hashtag;\n","// Wrapper to call requestIdleCallback() to schedule low-priority work.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API\n// for a good breakdown of the concepts behind this.\n\nimport Queue from 'tiny-queue';\n\nconst taskQueue = new Queue();\nlet runningRequestIdleCallback = false;\n\nfunction runTasks(deadline) {\n while (taskQueue.length && deadline.timeRemaining() > 0) {\n taskQueue.shift()();\n }\n if (taskQueue.length) {\n requestIdleCallback(runTasks);\n } else {\n runningRequestIdleCallback = false;\n }\n}\n\nfunction scheduleIdleTask(task) {\n taskQueue.push(task);\n if (!runningRequestIdleCallback) {\n runningRequestIdleCallback = true;\n requestIdleCallback(runTasks);\n }\n}\n\nexport default scheduleIdleTask;\n","import { connect } from 'react-redux';\nimport {\n changeSearch,\n clearSearch,\n submitSearch,\n showSearch,\n} from 'flavours/glitch/actions/search';\nimport Search from '../components/search';\n\nconst mapStateToProps = state => ({\n value: state.getIn(['search', 'value']),\n submitted: state.getIn(['search', 'submitted']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n\n onChange (value) {\n dispatch(changeSearch(value));\n },\n\n onClear () {\n dispatch(clearSearch());\n },\n\n onSubmit () {\n dispatch(submitSearch());\n },\n\n onShow () {\n dispatch(showSearch());\n },\n\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Search);\n","// Package imports.\nimport classNames from 'classnames';\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport { connect } from 'react-redux';\nimport spring from 'react-motion/lib/spring';\nimport {\n injectIntl,\n FormattedMessage,\n defineMessages,\n} from 'react-intl';\nimport Overlay from 'react-overlays/lib/Overlay';\n\n// Components.\nimport Icon from 'flavours/glitch/components/icon';\n\n// Utils.\nimport { focusRoot } from 'flavours/glitch/util/dom_helpers';\nimport { searchEnabled } from 'flavours/glitch/util/initial_state';\nimport Motion from 'flavours/glitch/util/optional_motion';\n\nconst messages = defineMessages({\n placeholder: { id: 'search.placeholder', defaultMessage: 'Search' },\n});\n\nclass SearchPopout extends React.PureComponent {\n\n static propTypes = {\n style: PropTypes.object,\n };\n\n render () {\n const { style } = this.props;\n const extraInformation = searchEnabled ? : ;\n return (\n \n
\n {({ opacity, scaleX, scaleY }) => (\n \n
\n\n
\n #example \n @username@domain \n URL \n URL \n \n\n {extraInformation}\n
\n )}\n \n
\n );\n }\n\n}\n\n// The component.\nexport default @injectIntl\nclass Search extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object.isRequired,\n };\n\n static propTypes = {\n value: PropTypes.string.isRequired,\n submitted: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n onShow: PropTypes.func.isRequired,\n openInRoute: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n expanded: false,\n };\n\n handleChange = (e) => {\n const { onChange } = this.props;\n if (onChange) {\n onChange(e.target.value);\n }\n }\n\n handleClear = (e) => {\n const {\n onClear,\n submitted,\n value,\n } = this.props;\n e.preventDefault(); // Prevents focus change ??\n if (onClear && (submitted || value && value.length)) {\n onClear();\n }\n }\n\n handleBlur = () => {\n this.setState({ expanded: false });\n }\n\n handleFocus = () => {\n const { onShow } = this.props;\n this.setState({ expanded: true });\n if (onShow) {\n onShow();\n }\n }\n\n handleKeyUp = (e) => {\n const { onSubmit } = this.props;\n switch (e.key) {\n case 'Enter':\n onSubmit();\n\n if (this.props.openInRoute) {\n this.context.router.history.push('/search');\n }\n break;\n case 'Escape':\n focusRoot();\n }\n }\n\n render () {\n const { intl, value, submitted } = this.props;\n const { expanded } = this.state;\n const hasValue = value.length > 0 || submitted;\n\n return (\n \n
\n {intl.formatMessage(messages.placeholder)} \n \n \n\n
\n \n \n
\n\n
\n \n \n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { autoPlayGif } from 'flavours/glitch/util/initial_state';\n\nexport default class AvatarOverlay extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n friend: ImmutablePropTypes.map.isRequired,\n animate: PropTypes.bool,\n };\n\n static defaultProps = {\n animate: autoPlayGif,\n };\n\n render() {\n const { account, friend, animate } = this.props;\n\n const baseStyle = {\n backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n const overlayStyle = {\n backgroundImage: `url(${friend.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { autoPlayGif } from 'flavours/glitch/util/initial_state';\n\nexport default class AvatarComposite extends React.PureComponent {\n\n static propTypes = {\n accounts: ImmutablePropTypes.list.isRequired,\n animate: PropTypes.bool,\n size: PropTypes.number.isRequired,\n };\n\n static defaultProps = {\n animate: autoPlayGif,\n };\n\n renderItem (account, size, index) {\n const { animate } = this.props;\n\n let width = 50;\n let height = 100;\n let top = 'auto';\n let left = 'auto';\n let bottom = 'auto';\n let right = 'auto';\n\n if (size === 1) {\n width = 100;\n }\n\n if (size === 4 || (size === 3 && index > 0)) {\n height = 50;\n }\n\n if (size === 2) {\n if (index === 0) {\n right = '1px';\n } else {\n left = '1px';\n }\n } else if (size === 3) {\n if (index === 0) {\n right = '1px';\n } else if (index > 0) {\n left = '1px';\n }\n\n if (index === 1) {\n bottom = '1px';\n } else if (index > 1) {\n top = '1px';\n }\n } else if (size === 4) {\n if (index === 0 || index === 2) {\n right = '1px';\n }\n\n if (index === 1 || index === 3) {\n left = '1px';\n }\n\n if (index < 2) {\n bottom = '1px';\n } else {\n top = '1px';\n }\n }\n\n const style = {\n left: left,\n top: top,\n right: right,\n bottom: bottom,\n width: `${width}%`,\n height: `${height}%`,\n backgroundSize: 'cover',\n backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n return (\n this.props.onAccountClick(account.get('id'), e)}\n title={`@${account.get('acct')}`}\n key={account.get('id')}\n >\n
\n \n );\n }\n\n render() {\n const { accounts, size } = this.props;\n\n return (\n \n {accounts.take(4).map((account, i) => this.renderItem(account, Math.min(accounts.size, 4), i))}\n\n {accounts.size > 4 && (\n \n +{accounts.size - 4}\n \n )}\n
\n );\n }\n\n}\n","export function autoUnfoldCW (settings, status) {\n if (!settings.getIn(['content_warnings', 'auto_unfold'])) {\n return false;\n }\n\n const rawRegex = settings.getIn(['content_warnings', 'filter']);\n\n if (!rawRegex) {\n return true;\n }\n\n let regex = null;\n\n try {\n regex = rawRegex && new RegExp(rawRegex.trim(), 'i');\n } catch (e) {\n // Bad regex, don't affect filters\n }\n\n if (!(status && regex)) {\n return undefined;\n }\n return !regex.test(status.get('spoiler_text'));\n}\n","// Wrapper to call requestIdleCallback() to schedule low-priority work.\n// See https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API\n// for a good breakdown of the concepts behind this.\n\nimport Queue from 'tiny-queue';\n\nconst taskQueue = new Queue();\nlet runningRequestIdleCallback = false;\n\nfunction runTasks(deadline) {\n while (taskQueue.length && deadline.timeRemaining() > 0) {\n taskQueue.shift()();\n }\n if (taskQueue.length) {\n requestIdleCallback(runTasks);\n } else {\n runningRequestIdleCallback = false;\n }\n}\n\nfunction scheduleIdleTask(task) {\n taskQueue.push(task);\n if (!runningRequestIdleCallback) {\n runningRequestIdleCallback = true;\n requestIdleCallback(runTasks);\n }\n}\n\nexport default scheduleIdleTask;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { autoPlayGif } from '../initial_state';\n\nexport default class AvatarOverlay extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n friend: ImmutablePropTypes.map.isRequired,\n animate: PropTypes.bool,\n };\n\n static defaultProps = {\n animate: autoPlayGif,\n };\n\n render() {\n const { account, friend, animate } = this.props;\n\n const baseStyle = {\n backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n const overlayStyle = {\n backgroundImage: `url(${friend.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { autoPlayGif } from '../initial_state';\n\nexport default class AvatarComposite extends React.PureComponent {\n\n static propTypes = {\n accounts: ImmutablePropTypes.list.isRequired,\n animate: PropTypes.bool,\n size: PropTypes.number.isRequired,\n };\n\n static defaultProps = {\n animate: autoPlayGif,\n };\n\n renderItem (account, size, index) {\n const { animate } = this.props;\n\n let width = 50;\n let height = 100;\n let top = 'auto';\n let left = 'auto';\n let bottom = 'auto';\n let right = 'auto';\n\n if (size === 1) {\n width = 100;\n }\n\n if (size === 4 || (size === 3 && index > 0)) {\n height = 50;\n }\n\n if (size === 2) {\n if (index === 0) {\n right = '1px';\n } else {\n left = '1px';\n }\n } else if (size === 3) {\n if (index === 0) {\n right = '1px';\n } else if (index > 0) {\n left = '1px';\n }\n\n if (index === 1) {\n bottom = '1px';\n } else if (index > 1) {\n top = '1px';\n }\n } else if (size === 4) {\n if (index === 0 || index === 2) {\n right = '1px';\n }\n\n if (index === 1 || index === 3) {\n left = '1px';\n }\n\n if (index < 2) {\n bottom = '1px';\n } else {\n top = '1px';\n }\n }\n\n const style = {\n left: left,\n top: top,\n right: right,\n bottom: bottom,\n width: `${width}%`,\n height: `${height}%`,\n backgroundSize: 'cover',\n backgroundImage: `url(${account.get(animate ? 'avatar' : 'avatar_static')})`,\n };\n\n return (\n
\n );\n }\n\n render() {\n const { accounts, size } = this.props;\n\n return (\n \n {accounts.take(4).map((account, i) => this.renderItem(account, Math.min(accounts.size, 4), i))}\n\n {accounts.size > 4 && (\n \n +{accounts.size - 4}\n \n )}\n
\n );\n }\n\n}\n","/**\n * Notification overlay\n */\n\n\n// Package imports.\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport Icon from 'flavours/glitch/components/icon';\n\nconst messages = defineMessages({\n markForDeletion: { id: 'notification.markForDeletion', defaultMessage: 'Mark for deletion' },\n});\n\nexport default @injectIntl\nclass NotificationOverlay extends ImmutablePureComponent {\n\n static propTypes = {\n notification : ImmutablePropTypes.map.isRequired,\n onMarkForDelete : PropTypes.func.isRequired,\n show : PropTypes.bool.isRequired,\n intl : PropTypes.object.isRequired,\n };\n\n onToggleMark = () => {\n const mark = !this.props.notification.get('markedForDelete');\n const id = this.props.notification.get('id');\n this.props.onMarkForDelete(id, mark);\n }\n\n render () {\n const { notification, show, intl } = this.props;\n\n const active = notification.get('markedForDelete');\n const label = intl.formatMessage(messages.markForDeletion);\n\n return show ? (\n \n
\n
\n {active ? ( ) : ''}\n
\n
\n
\n ) : null;\n }\n\n}\n","// Package imports.\nimport { connect } from 'react-redux';\n\n// Our imports.\nimport NotificationOverlay from '../components/overlay';\nimport { markNotificationForDelete } from 'flavours/glitch/actions/notifications';\n\nconst mapDispatchToProps = dispatch => ({\n onMarkForDelete(id, yes) {\n dispatch(markNotificationForDelete(id, yes));\n },\n});\n\nconst mapStateToProps = state => ({\n show: state.getIn(['notifications', 'cleaningMode']),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(NotificationOverlay);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport Overlay from 'react-overlays/lib/Overlay';\nimport Motion from '../../ui/util/optional_motion';\nimport spring from 'react-motion/lib/spring';\nimport { searchEnabled } from '../../../initial_state';\nimport Icon from 'mastodon/components/icon';\n\nconst messages = defineMessages({\n placeholder: { id: 'search.placeholder', defaultMessage: 'Search' },\n});\n\nclass SearchPopout extends React.PureComponent {\n\n static propTypes = {\n style: PropTypes.object,\n };\n\n render () {\n const { style } = this.props;\n const extraInformation = searchEnabled ? : ;\n return (\n \n
\n {({ opacity, scaleX, scaleY }) => (\n \n
\n\n
\n #example \n @username@domain \n URL \n URL \n \n\n {extraInformation}\n
\n )}\n \n
\n );\n }\n\n}\n\nexport default @injectIntl\nclass Search extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object.isRequired,\n };\n\n static propTypes = {\n value: PropTypes.string.isRequired,\n submitted: PropTypes.bool,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n onShow: PropTypes.func.isRequired,\n openInRoute: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n state = {\n expanded: false,\n };\n\n handleChange = (e) => {\n this.props.onChange(e.target.value);\n }\n\n handleClear = (e) => {\n e.preventDefault();\n\n if (this.props.value.length > 0 || this.props.submitted) {\n this.props.onClear();\n }\n }\n\n handleKeyUp = (e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n\n this.props.onSubmit();\n\n if (this.props.openInRoute) {\n this.context.router.history.push('/search');\n }\n } else if (e.key === 'Escape') {\n document.querySelector('.ui').parentElement.focus();\n }\n }\n\n handleFocus = () => {\n this.setState({ expanded: true });\n this.props.onShow();\n }\n\n handleBlur = () => {\n this.setState({ expanded: false });\n }\n\n render () {\n const { intl, value, submitted } = this.props;\n const { expanded } = this.state;\n const hasValue = value.length > 0 || submitted;\n\n return (\n \n
\n {intl.formatMessage(messages.placeholder)} \n \n \n\n
\n \n \n
\n\n
\n \n \n
\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport {\n changeSearch,\n clearSearch,\n submitSearch,\n showSearch,\n} from '../../../actions/search';\nimport Search from '../components/search';\n\nconst mapStateToProps = state => ({\n value: state.getIn(['search', 'value']),\n submitted: state.getIn(['search', 'submitted']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n\n onChange (value) {\n dispatch(changeSearch(value));\n },\n\n onClear () {\n dispatch(clearSearch());\n },\n\n onSubmit () {\n dispatch(submitSearch());\n },\n\n onShow () {\n dispatch(showSearch());\n },\n\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Search);\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport DropdownMenuContainer from '../../../containers/dropdown_menu_container';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },\n preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },\n follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },\n favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },\n lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },\n blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },\n domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },\n mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },\n filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },\n logout: { id: 'navigation_bar.logout', defaultMessage: 'Logout' },\n});\n\nexport default @injectIntl\nclass ActionBar extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n onLogout: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleLogout = () => {\n this.props.onLogout();\n }\n\n render () {\n const { intl } = this.props;\n\n let menu = [];\n\n menu.push({ text: intl.formatMessage(messages.preferences), href: '/user-settings' });\n menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });\n menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });\n menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' });\n menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });\n menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });\n menu.push({ text: intl.formatMessage(messages.filters), href: '/filters' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.logout), action: this.handleLogout });\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ActionBar from './action_bar';\nimport Avatar from '../../../components/avatar';\nimport Permalink from '../../../components/permalink';\nimport IconButton from '../../../components/icon_button';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\n\nexport default class NavigationBar extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n onLogout: PropTypes.func.isRequired,\n onClose: PropTypes.func,\n };\n\n render () {\n return (\n \n
\n {this.props.account.get('acct')} \n \n \n\n
\n
\n @{this.props.account.get('acct')} \n \n
\n\n
\n
\n );\n }\n\n}\n","// Package imports //\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage } from 'react-intl';\nimport Icon from 'flavours/glitch/components/icon';\n\nexport default class StatusPrepend extends React.PureComponent {\n\n static propTypes = {\n type: PropTypes.string.isRequired,\n account: ImmutablePropTypes.map.isRequired,\n parseClick: PropTypes.func.isRequired,\n notificationId: PropTypes.number,\n };\n\n handleClick = (e) => {\n const { account, parseClick } = this.props;\n parseClick(e, `/accounts/${account.get('id')}`);\n }\n\n Message = () => {\n const { type, account } = this.props;\n let link = (\n \n \n \n );\n switch (type) {\n case 'featured':\n return (\n \n );\n case 'reblogged_by':\n return (\n \n );\n case 'favourite':\n return (\n \n );\n case 'reblog':\n return (\n \n );\n case 'poll':\n return (\n \n );\n }\n return null;\n }\n\n render () {\n const { Message } = this;\n const { type } = this.props;\n\n return !type ? null : (\n \n );\n }\n\n}\n","// Package imports.\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\n// Mastodon imports.\nimport Avatar from './avatar';\nimport AvatarOverlay from './avatar_overlay';\nimport AvatarComposite from './avatar_composite';\nimport DisplayName from './display_name';\n\nexport default class StatusHeader extends React.PureComponent {\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n friend: ImmutablePropTypes.map,\n parseClick: PropTypes.func.isRequired,\n otherAccounts: ImmutablePropTypes.list,\n };\n\n // Handles clicks on account name/image\n handleClick = (id, e) => {\n const { parseClick } = this.props;\n parseClick(e, `/accounts/${id}`);\n }\n\n handleAccountClick = (e) => {\n const { status } = this.props;\n this.handleClick(status.getIn(['account', 'id']), e);\n }\n\n // Rendering.\n render () {\n const {\n status,\n friend,\n otherAccounts,\n } = this.props;\n\n const account = status.get('account');\n\n let statusAvatar;\n if (otherAccounts && otherAccounts.size > 0) {\n statusAvatar = ;\n } else if (friend === undefined || friend === null) {\n statusAvatar = ;\n } else {\n statusAvatar = ;\n }\n\n if (!otherAccounts) {\n return (\n \n );\n } else {\n // This is a DM conversation\n return (\n \n \n {statusAvatar}\n \n\n \n \n \n
\n );\n }\n }\n\n}\n","// Package imports.\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages, injectIntl } from 'react-intl';\n\n// Mastodon imports.\nimport IconButton from './icon_button';\nimport VisibilityIcon from './status_visibility_icon';\nimport Icon from 'flavours/glitch/components/icon';\n\n// Messages for use with internationalization stuff.\nconst messages = defineMessages({\n collapse: { id: 'status.collapse', defaultMessage: 'Collapse' },\n uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' },\n inReplyTo: { id: 'status.in_reply_to', defaultMessage: 'This toot is a reply' },\n previewCard: { id: 'status.has_preview_card', defaultMessage: 'Features an attached preview card' },\n pictures: { id: 'status.has_pictures', defaultMessage: 'Features attached pictures' },\n poll: { id: 'status.is_poll', defaultMessage: 'This toot is a poll' },\n video: { id: 'status.has_video', defaultMessage: 'Features attached videos' },\n audio: { id: 'status.has_audio', defaultMessage: 'Features attached audio files' },\n localOnly: { id: 'status.local_only', defaultMessage: 'Only visible from your instance' },\n});\n\nexport default @injectIntl\nclass StatusIcons extends React.PureComponent {\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n mediaIcon: PropTypes.string,\n collapsible: PropTypes.bool,\n collapsed: PropTypes.bool,\n directMessage: PropTypes.bool,\n setCollapsed: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n // Handles clicks on collapsed button\n handleCollapsedClick = (e) => {\n const { collapsed, setCollapsed } = this.props;\n if (e.button === 0) {\n setCollapsed(!collapsed);\n e.preventDefault();\n }\n }\n\n mediaIconTitleText () {\n const { intl, mediaIcon } = this.props;\n\n switch (mediaIcon) {\n case 'link':\n return intl.formatMessage(messages.previewCard);\n case 'picture-o':\n return intl.formatMessage(messages.pictures);\n case 'tasks':\n return intl.formatMessage(messages.poll);\n case 'video-camera':\n return intl.formatMessage(messages.video);\n case 'music':\n return intl.formatMessage(messages.audio);\n }\n }\n\n // Rendering.\n render () {\n const {\n status,\n mediaIcon,\n collapsible,\n collapsed,\n directMessage,\n intl,\n } = this.props;\n\n return (\n \n {status.get('in_reply_to_id', null) !== null ? (\n \n ) : null}\n {status.get('local_only') &&\n }\n {mediaIcon ? (\n \n ) : null}\n {!directMessage && }\n {collapsible ? (\n \n ) : null}\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport IconButton from './icon_button';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { me, isStaff, deleteOthersNotice } from 'flavours/glitch/util/initial_state';\nimport RelativeTimestamp from './relative_timestamp';\nimport { accountAdminLink, statusAdminLink } from 'flavours/glitch/util/backend_links';\n\nconst messages = defineMessages({\n delete: { id: 'status.delete', defaultMessage: 'Delete' },\n redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },\n direct: { id: 'status.direct', defaultMessage: 'Direct message @{name}' },\n mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n reply: { id: 'status.reply', defaultMessage: 'Reply' },\n share: { id: 'status.share', defaultMessage: 'Share' },\n more: { id: 'status.more', defaultMessage: 'More' },\n replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },\n reblog: { id: 'status.reblog', defaultMessage: 'Boost' },\n reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' },\n cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },\n favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },\n bookmark: { id: 'status.bookmark', defaultMessage: 'Bookmark' },\n open: { id: 'status.open', defaultMessage: 'Expand this status' },\n report: { id: 'status.report', defaultMessage: 'Report @{name}' },\n muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },\n unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },\n pin: { id: 'status.pin', defaultMessage: 'Pin on profile' },\n unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' },\n embed: { id: 'status.embed', defaultMessage: 'Embed' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n admin_status: { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' },\n copy: { id: 'status.copy', defaultMessage: 'Copy link to status' },\n hide: { id: 'status.hide', defaultMessage: 'Hide toot' },\n});\n\nconst obfuscatedCount = count => {\n if (count < 0) {\n return 0;\n } else if (count <= 1) {\n return count;\n } else {\n return '1+';\n }\n};\n\nexport default @injectIntl\nclass StatusActionBar extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onMute: PropTypes.func,\n onBlock: PropTypes.func,\n onReport: PropTypes.func,\n onEmbed: PropTypes.func,\n onMuteConversation: PropTypes.func,\n onPin: PropTypes.func,\n onBookmark: PropTypes.func,\n onFilter: PropTypes.func,\n withDismiss: PropTypes.bool,\n showReplyCount: PropTypes.bool,\n directMessage: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'showReplyCount',\n 'withDismiss',\n ]\n\n handleReplyClick = () => {\n if (me) {\n this.props.onReply(this.props.status, this.context.router.history);\n } else {\n this._openInteractionDialog('reply');\n }\n }\n\n handleShareClick = () => {\n navigator.share({\n text: this.props.status.get('search_index'),\n url: this.props.status.get('url'),\n });\n }\n\n handleFavouriteClick = (e) => {\n if (me) {\n this.props.onFavourite(this.props.status, e);\n } else {\n this._openInteractionDialog('favourite');\n }\n }\n\n handleBookmarkClick = (e) => {\n this.props.onBookmark(this.props.status, e);\n }\n\n handleReblogClick = e => {\n if (me) {\n this.props.onReblog(this.props.status, e);\n } else {\n this._openInteractionDialog('reblog');\n }\n }\n\n _openInteractionDialog = type => {\n window.open(`/interact/${this.props.status.get('id')}?type=${type}`, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');\n }\n\n handleDeleteClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history);\n }\n\n handleRedraftClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history, true);\n }\n\n handlePinClick = () => {\n this.props.onPin(this.props.status);\n }\n\n handleMentionClick = () => {\n this.props.onMention(this.props.status.get('account'), this.context.router.history);\n }\n\n handleDirectClick = () => {\n this.props.onDirect(this.props.status.get('account'), this.context.router.history);\n }\n\n handleMuteClick = () => {\n this.props.onMute(this.props.status.get('account'));\n }\n\n handleBlockClick = () => {\n this.props.onBlock(this.props.status);\n }\n\n handleOpen = () => {\n let state = {...this.context.router.history.location.state};\n if (state.mastodonModalOpen) {\n this.context.router.history.replace(`/statuses/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 });\n } else {\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`, state);\n }\n }\n\n handleEmbed = () => {\n this.props.onEmbed(this.props.status);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.status);\n }\n\n handleConversationMuteClick = () => {\n this.props.onMuteConversation(this.props.status);\n }\n\n handleCopy = () => {\n const url = this.props.status.get('url');\n const textarea = document.createElement('textarea');\n\n textarea.textContent = url;\n textarea.style.position = 'fixed';\n\n document.body.appendChild(textarea);\n\n try {\n textarea.select();\n document.execCommand('copy');\n } catch (e) {\n\n } finally {\n document.body.removeChild(textarea);\n }\n }\n\n handleFilterClick = () => {\n this.props.onFilter();\n }\n\n render () {\n const { status, intl, withDismiss, showReplyCount, directMessage } = this.props;\n\n const mutingConversation = status.get('muted');\n const anonymousAccess = !me;\n const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));\n const reblogDisabled = status.get('visibility') === 'direct' || (status.get('visibility') === 'private' && me !== status.getIn(['account', 'id']));\n const reblogMessage = status.get('visibility') === 'private' ? messages.reblog_private : messages.reblog;\n\n let menu = [];\n let reblogIcon = 'retweet';\n let replyIcon;\n let replyTitle;\n\n menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen });\n\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(messages.copy), action: this.handleCopy });\n menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed });\n }\n\n menu.push(null);\n\n if (status.getIn(['account', 'id']) === me || withDismiss) {\n menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });\n menu.push(null);\n }\n\n if (status.getIn(['account', 'id']) === me) {\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });\n }\n\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n } else {\n menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });\n menu.push({ text: intl.formatMessage(messages.direct, { name: status.getIn(['account', 'username']) }), action: this.handleDirectClick });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });\n menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });\n menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });\n\n if (isStaff && (accountAdminLink || statusAdminLink)) {\n menu.push(null);\n if (accountAdminLink !== undefined) {\n menu.push({\n text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }),\n href: accountAdminLink(status.getIn(['account', 'id'])),\n });\n }\n if (statusAdminLink !== undefined) {\n menu.push({\n text: intl.formatMessage(messages.admin_status),\n href: statusAdminLink(status.getIn(['account', 'id']), status.get('id')),\n });\n }\n }\n if ( deleteOthersNotice ) {\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n }\n }\n\n if (status.get('in_reply_to_id', null) === null) {\n replyIcon = 'reply';\n replyTitle = intl.formatMessage(messages.reply);\n } else {\n replyIcon = 'reply-all';\n replyTitle = intl.formatMessage(messages.replyAll);\n }\n\n const shareButton = ('share' in navigator) && status.get('visibility') === 'public' && (\n \n );\n\n const filterButton = status.get('filtered') && (\n \n );\n\n let replyButton = (\n \n );\n if (showReplyCount) {\n replyButton = (\n \n {replyButton}\n {obfuscatedCount(status.get('replies_count'))} \n
\n );\n }\n\n return (\n \n {replyButton}\n {!directMessage && [\n
,\n
,\n shareButton,\n
,\n filterButton,\n
\n \n
,\n ]}\n\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport StatusPrepend from './status_prepend';\nimport StatusHeader from './status_header';\nimport StatusIcons from './status_icons';\nimport StatusContent from './status_content';\nimport StatusActionBar from './status_action_bar';\nimport AttachmentList from './attachment_list';\nimport Card from '../features/status/components/card';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { MediaGallery, Video, Audio } from 'flavours/glitch/util/async-components';\nimport { HotKeys } from 'react-hotkeys';\nimport NotificationOverlayContainer from 'flavours/glitch/features/notifications/containers/overlay_container';\nimport classNames from 'classnames';\nimport { autoUnfoldCW } from 'flavours/glitch/util/content_warning';\nimport PollContainer from 'flavours/glitch/containers/poll_container';\nimport { displayMedia } from 'flavours/glitch/util/initial_state';\n\n// We use the component (and not the container) since we do not want\n// to use the progress bar to show download progress\nimport Bundle from '../features/ui/components/bundle';\n\nexport const textForScreenReader = (intl, status, rebloggedByText = false, expanded = false) => {\n const displayName = status.getIn(['account', 'display_name']);\n\n const values = [\n displayName.length === 0 ? status.getIn(['account', 'acct']).split('@')[0] : displayName,\n status.get('spoiler_text') && !expanded ? status.get('spoiler_text') : status.get('search_index').slice(status.get('spoiler_text').length),\n intl.formatDate(status.get('created_at'), { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }),\n status.getIn(['account', 'acct']),\n ];\n\n if (rebloggedByText) {\n values.push(rebloggedByText);\n }\n\n return values.join(', ');\n};\n\nexport const defaultMediaVisibility = (status, settings) => {\n if (!status) {\n return undefined;\n }\n\n if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {\n status = status.get('reblog');\n }\n\n if (settings.getIn(['media', 'reveal_behind_cw']) && !!status.get('spoiler_text')) {\n return true;\n }\n\n return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all');\n}\n\nexport default @injectIntl\nclass Status extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n containerId: PropTypes.string,\n id: PropTypes.string,\n status: ImmutablePropTypes.map,\n otherAccounts: ImmutablePropTypes.list,\n account: ImmutablePropTypes.map,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onBookmark: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onPin: PropTypes.func,\n onOpenMedia: PropTypes.func,\n onOpenVideo: PropTypes.func,\n onBlock: PropTypes.func,\n onEmbed: PropTypes.func,\n onHeightChange: PropTypes.func,\n muted: PropTypes.bool,\n collapse: PropTypes.bool,\n hidden: PropTypes.bool,\n unread: PropTypes.bool,\n prepend: PropTypes.string,\n withDismiss: PropTypes.bool,\n onMoveUp: PropTypes.func,\n onMoveDown: PropTypes.func,\n getScrollPosition: PropTypes.func,\n updateScrollBottom: PropTypes.func,\n expanded: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n cacheMediaWidth: PropTypes.func,\n cachedMediaWidth: PropTypes.number,\n onClick: PropTypes.func,\n };\n\n state = {\n isCollapsed: false,\n autoCollapsed: false,\n isExpanded: undefined,\n showMedia: undefined,\n statusId: undefined,\n revealBehindCW: undefined,\n showCard: false,\n forceFilter: undefined,\n }\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'account',\n 'settings',\n 'prepend',\n 'muted',\n 'collapse',\n 'notification',\n 'hidden',\n 'expanded',\n ]\n\n updateOnStates = [\n 'isExpanded',\n 'isCollapsed',\n 'showMedia',\n 'forceFilter',\n ]\n\n // If our settings have changed to disable collapsed statuses, then we\n // need to make sure that we uncollapse every one. We do that by watching\n // for changes to `settings.collapsed.enabled` in\n // `getderivedStateFromProps()`.\n\n // We also need to watch for changes on the `collapse` prop---if this\n // changes to anything other than `undefined`, then we need to collapse or\n // uncollapse our status accordingly.\n static getDerivedStateFromProps(nextProps, prevState) {\n let update = {};\n let updated = false;\n\n // Make sure the state mirrors props we track…\n if (nextProps.collapse !== prevState.collapseProp) {\n update.collapseProp = nextProps.collapse;\n updated = true;\n }\n if (nextProps.expanded !== prevState.expandedProp) {\n update.expandedProp = nextProps.expanded;\n updated = true;\n }\n\n // Update state based on new props\n if (!nextProps.settings.getIn(['collapsed', 'enabled'])) {\n if (prevState.isCollapsed) {\n update.isCollapsed = false;\n updated = true;\n }\n } else if (\n nextProps.collapse !== prevState.collapseProp &&\n nextProps.collapse !== undefined\n ) {\n update.isCollapsed = nextProps.collapse;\n if (nextProps.collapse) update.isExpanded = false;\n updated = true;\n }\n if (nextProps.expanded !== prevState.expandedProp &&\n nextProps.expanded !== undefined\n ) {\n update.isExpanded = nextProps.expanded;\n if (nextProps.expanded) update.isCollapsed = false;\n updated = true;\n }\n\n if (nextProps.expanded === undefined &&\n prevState.isExpanded === undefined &&\n update.isExpanded === undefined\n ) {\n const isExpanded = autoUnfoldCW(nextProps.settings, nextProps.status);\n if (isExpanded !== undefined) {\n update.isExpanded = isExpanded;\n updated = true;\n }\n }\n\n if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {\n update.showMedia = defaultMediaVisibility(nextProps.status, nextProps.settings);\n update.statusId = nextProps.status.get('id');\n updated = true;\n }\n\n if (nextProps.settings.getIn(['media', 'reveal_behind_cw']) !== prevState.revealBehindCW) {\n update.revealBehindCW = nextProps.settings.getIn(['media', 'reveal_behind_cw']);\n if (update.revealBehindCW) {\n update.showMedia = defaultMediaVisibility(nextProps.status, nextProps.settings);\n }\n updated = true;\n }\n\n return updated ? update : null;\n }\n\n // When mounting, we just check to see if our status should be collapsed,\n // and collapse it if so. We don't need to worry about whether collapsing\n // is enabled here, because `setCollapsed()` already takes that into\n // account.\n\n // The cases where a status should be collapsed are:\n //\n // - The `collapse` prop has been set to `true`\n // - The user has decided in local settings to collapse all statuses.\n // - The user has decided to collapse all notifications ('muted'\n // statuses).\n // - The user has decided to collapse long statuses and the status is\n // over 400px (without media, or 650px with).\n // - The status is a reply and the user has decided to collapse all\n // replies.\n // - The status contains media and the user has decided to collapse all\n // statuses with media.\n // - The status is a reblog the user has decided to collapse all\n // statuses which are reblogs.\n componentDidMount () {\n const { node } = this;\n const {\n status,\n settings,\n collapse,\n muted,\n prepend,\n } = this.props;\n\n // Prevent a crash when node is undefined. Not completely sure why this\n // happens, might be because status === null.\n if (node === undefined) return;\n\n const autoCollapseSettings = settings.getIn(['collapsed', 'auto']);\n\n if (function () {\n switch (true) {\n case !!collapse:\n case !!autoCollapseSettings.get('all'):\n case autoCollapseSettings.get('notifications') && !!muted:\n case autoCollapseSettings.get('lengthy') && node.clientHeight > (\n status.get('media_attachments').size && !muted ? 650 : 400\n ):\n case autoCollapseSettings.get('reblogs') && prepend === 'reblogged_by':\n case autoCollapseSettings.get('replies') && status.get('in_reply_to_id', null) !== null:\n case autoCollapseSettings.get('media') && !(status.get('spoiler_text').length) && !!status.get('media_attachments').size:\n return true;\n default:\n return false;\n }\n }()) {\n this.setCollapsed(true);\n // Hack to fix timeline jumps on second rendering when auto-collapsing\n this.setState({ autoCollapsed: true });\n }\n\n // Hack to fix timeline jumps when a preview card is fetched\n this.setState({\n showCard: !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card') && this.props.settings.get('inline_preview_cards'),\n });\n }\n\n // Hack to fix timeline jumps on second rendering when auto-collapsing\n // or on subsequent rendering when a preview card has been fetched\n getSnapshotBeforeUpdate (prevProps, prevState) {\n if (!this.props.getScrollPosition) return null;\n\n const { muted, hidden, status, settings } = this.props;\n\n const doShowCard = !muted && !hidden && status && status.get('card') && settings.get('inline_preview_cards');\n if (this.state.autoCollapsed || (doShowCard && !this.state.showCard)) {\n if (doShowCard) this.setState({ showCard: true });\n if (this.state.autoCollapsed) this.setState({ autoCollapsed: false });\n return this.props.getScrollPosition();\n } else {\n return null;\n }\n }\n\n componentDidUpdate (prevProps, prevState, snapshot) {\n if (snapshot !== null && this.props.updateScrollBottom && this.node.offsetTop < snapshot.top) {\n this.props.updateScrollBottom(snapshot.height - snapshot.top);\n }\n }\n\n componentWillUnmount() {\n if (this.node && this.props.getScrollPosition) {\n const position = this.props.getScrollPosition();\n if (position !== null && this.node.offsetTop < position.top) {\n requestAnimationFrame(() => { this.props.updateScrollBottom(position.height - position.top); });\n }\n }\n }\n\n // `setCollapsed()` sets the value of `isCollapsed` in our state, that is,\n // whether the toot is collapsed or not.\n\n // `setCollapsed()` automatically checks for us whether toot collapsing\n // is enabled, so we don't have to.\n setCollapsed = (value) => {\n if (this.props.settings.getIn(['collapsed', 'enabled'])) {\n this.setState({ isCollapsed: value });\n if (value) {\n this.setExpansion(false);\n }\n } else {\n this.setState({ isCollapsed: false });\n }\n }\n\n setExpansion = (value) => {\n this.setState({ isExpanded: value });\n if (value) {\n this.setCollapsed(false);\n }\n }\n\n // `parseClick()` takes a click event and responds appropriately.\n // If our status is collapsed, then clicking on it should uncollapse it.\n // If `Shift` is held, then clicking on it should collapse it.\n // Otherwise, we open the url handed to us in `destination`, if\n // applicable.\n parseClick = (e, destination) => {\n const { router } = this.context;\n const { status } = this.props;\n const { isCollapsed } = this.state;\n if (!router) return;\n\n if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey)) {\n if (isCollapsed) this.setCollapsed(false);\n else if (e.shiftKey) {\n this.setCollapsed(true);\n document.getSelection().removeAllRanges();\n } else if (this.props.onClick) {\n this.props.onClick();\n return;\n } else {\n if (destination === undefined) {\n destination = `/statuses/${\n status.getIn(['reblog', 'id'], status.get('id'))\n }`;\n }\n let state = {...router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n router.history.push(destination, state);\n }\n e.preventDefault();\n }\n }\n\n handleToggleMediaVisibility = () => {\n this.setState({ showMedia: !this.state.showMedia });\n }\n\n handleAccountClick = (e) => {\n if (this.context.router && e.button === 0) {\n const id = e.currentTarget.getAttribute('data-id');\n e.preventDefault();\n let state = {...this.context.router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n this.context.router.history.push(`/accounts/${id}`, state);\n }\n }\n\n handleExpandedToggle = () => {\n if (this.props.status.get('spoiler_text')) {\n this.setExpansion(!this.state.isExpanded);\n }\n };\n\n handleOpenVideo = (media, startTime) => {\n this.props.onOpenVideo(media, startTime);\n }\n\n handleHotkeyReply = e => {\n e.preventDefault();\n this.props.onReply(this.props.status, this.context.router.history);\n }\n\n handleHotkeyFavourite = (e) => {\n this.props.onFavourite(this.props.status, e);\n }\n\n handleHotkeyBoost = e => {\n this.props.onReblog(this.props.status, e);\n }\n\n handleHotkeyBookmark = e => {\n this.props.onBookmark(this.props.status, e);\n }\n\n handleHotkeyMention = e => {\n e.preventDefault();\n this.props.onMention(this.props.status.get('account'), this.context.router.history);\n }\n\n handleHotkeyOpen = () => {\n let state = {...this.context.router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`, state);\n }\n\n handleHotkeyOpenProfile = () => {\n let state = {...this.context.router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`, state);\n }\n\n handleHotkeyMoveUp = e => {\n this.props.onMoveUp(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));\n }\n\n handleHotkeyMoveDown = e => {\n this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured'));\n }\n\n handleHotkeyCollapse = e => {\n if (!this.props.settings.getIn(['collapsed', 'enabled']))\n return;\n\n this.setCollapsed(!this.state.isCollapsed);\n }\n\n handleHotkeyToggleSensitive = () => {\n this.handleToggleMediaVisibility();\n }\n\n handleUnfilterClick = e => {\n const { onUnfilter, status } = this.props;\n onUnfilter(status.get('reblog') ? status.get('reblog') : status, () => this.setState({ forceFilter: false }));\n }\n\n handleFilterClick = () => {\n this.setState({ forceFilter: true });\n }\n\n handleRef = c => {\n this.node = c;\n }\n\n renderLoadingMediaGallery () {\n return
;\n }\n\n renderLoadingVideoPlayer () {\n return
;\n }\n\n renderLoadingAudioPlayer () {\n return
;\n }\n\n render () {\n const {\n handleRef,\n parseClick,\n setExpansion,\n setCollapsed,\n } = this;\n const { router } = this.context;\n const {\n intl,\n status,\n account,\n otherAccounts,\n settings,\n collapsed,\n muted,\n prepend,\n intersectionObserverWrapper,\n onOpenVideo,\n onOpenMedia,\n notification,\n hidden,\n unread,\n featured,\n ...other\n } = this.props;\n const { isExpanded, isCollapsed, forceFilter } = this.state;\n let background = null;\n let attachments = null;\n let media = null;\n let mediaIcon = null;\n\n if (status === null) {\n return null;\n }\n\n const handlers = {\n reply: this.handleHotkeyReply,\n favourite: this.handleHotkeyFavourite,\n boost: this.handleHotkeyBoost,\n mention: this.handleHotkeyMention,\n open: this.handleHotkeyOpen,\n openProfile: this.handleHotkeyOpenProfile,\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n toggleSpoiler: this.handleExpandedToggle,\n bookmark: this.handleHotkeyBookmark,\n toggleCollapse: this.handleHotkeyCollapse,\n toggleSensitive: this.handleHotkeyToggleSensitive,\n };\n\n if (hidden) {\n return (\n \n \n {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}\n {' '}\n {status.get('content')}\n
\n \n );\n }\n\n const filtered = (status.get('filtered') || status.getIn(['reblog', 'filtered'])) && settings.get('filtering_behavior') !== 'content_warning';\n if (forceFilter === undefined ? filtered : forceFilter) {\n const minHandlers = this.props.muted ? {} : {\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n };\n\n return (\n \n \n \n {settings.get('filtering_behavior') !== 'upstream' && ' '}\n {settings.get('filtering_behavior') !== 'upstream' && (\n \n \n \n )}\n
\n \n );\n }\n\n // If user backgrounds for collapsed statuses are enabled, then we\n // initialize our background accordingly. This will only be rendered if\n // the status is collapsed.\n if (settings.getIn(['collapsed', 'backgrounds', 'user_backgrounds'])) {\n background = status.getIn(['account', 'header']);\n }\n\n // This handles our media attachments.\n // If a media file is of unknwon type or if the status is muted\n // (notification), we show a list of links instead of embedded media.\n\n // After we have generated our appropriate media element and stored it in\n // `media`, we snatch the thumbnail to use as our `background` if media\n // backgrounds for collapsed statuses are enabled.\n attachments = status.get('media_attachments');\n if (status.get('poll')) {\n media = ;\n mediaIcon = 'tasks';\n } else if (attachments.size > 0) {\n if (muted || attachments.some(item => item.get('type') === 'unknown')) {\n media = (\n \n );\n } else if (attachments.getIn([0, 'type']) === 'audio') {\n const attachment = status.getIn(['media_attachments', 0]);\n\n media = (\n \n {Component => (\n \n )}\n \n );\n mediaIcon = 'music';\n } else if (attachments.getIn([0, 'type']) === 'video') {\n const attachment = status.getIn(['media_attachments', 0]);\n\n media = (\n \n {Component => ( )}\n \n );\n mediaIcon = 'video-camera';\n } else { // Media type is 'image' or 'gifv'\n media = (\n \n {Component => (\n \n )}\n \n );\n mediaIcon = 'picture-o';\n }\n\n if (!status.get('sensitive') && !(status.get('spoiler_text').length > 0) && settings.getIn(['collapsed', 'backgrounds', 'preview_images'])) {\n background = attachments.getIn([0, 'preview_url']);\n }\n } else if (status.get('card') && settings.get('inline_preview_cards')) {\n media = (\n \n );\n mediaIcon = 'link';\n }\n\n // Here we prepare extra data-* attributes for CSS selectors.\n // Users can use those for theming, hiding avatars etc via UserStyle\n const selectorAttribs = {\n 'data-status-by': `@${status.getIn(['account', 'acct'])}`,\n };\n\n if (prepend && account) {\n const notifKind = {\n favourite: 'favourited',\n reblog: 'boosted',\n reblogged_by: 'boosted',\n }[prepend];\n\n selectorAttribs[`data-${notifKind}-by`] = `@${account.get('acct')}`;\n }\n\n let rebloggedByText;\n\n if (prepend === 'reblog') {\n rebloggedByText = intl.formatMessage({ id: 'status.reblogged_by', defaultMessage: '{name} boosted' }, { name: account.get('acct') });\n }\n\n const computedClass = classNames('status', `status-${status.get('visibility')}`, {\n collapsed: isCollapsed,\n 'has-background': isCollapsed && background,\n 'status__wrapper-reply': !!status.get('in_reply_to_id'),\n read: unread === false,\n muted,\n }, 'focusable');\n\n return (\n \n \n \n \n {prepend && account ? (\n \n ) : null}\n {!muted || !isCollapsed ? (\n \n ) : null}\n \n \n \n \n {!isCollapsed || !(muted || !settings.getIn(['collapsed', 'show_action_bar'])) ? (\n \n ) : null}\n {notification ? (\n \n ) : null}\n
\n \n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport IconButton from './icon_button';\nimport DropdownMenuContainer from '../containers/dropdown_menu_container';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { me, deleteOthersNotice, isStaff } from '../initial_state';\n\nconst messages = defineMessages({\n delete: { id: 'status.delete', defaultMessage: 'Delete' },\n redraft: { id: 'status.redraft', defaultMessage: 'Delete & re-draft' },\n direct: { id: 'status.direct', defaultMessage: 'Direct message @{name}' },\n mention: { id: 'status.mention', defaultMessage: 'Mention @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n reply: { id: 'status.reply', defaultMessage: 'Reply' },\n share: { id: 'status.share', defaultMessage: 'Share' },\n more: { id: 'status.more', defaultMessage: 'More' },\n replyAll: { id: 'status.replyAll', defaultMessage: 'Reply to thread' },\n reblog: { id: 'status.reblog', defaultMessage: 'Boost' },\n reblog_private: { id: 'status.reblog_private', defaultMessage: 'Boost to original audience' },\n cancel_reblog_private: { id: 'status.cancel_reblog_private', defaultMessage: 'Unboost' },\n cannot_reblog: { id: 'status.cannot_reblog', defaultMessage: 'This post cannot be boosted' },\n favourite: { id: 'status.favourite', defaultMessage: 'Favourite' },\n open: { id: 'status.open', defaultMessage: 'Expand this status' },\n report: { id: 'status.report', defaultMessage: 'Report @{name}' },\n muteConversation: { id: 'status.mute_conversation', defaultMessage: 'Mute conversation' },\n unmuteConversation: { id: 'status.unmute_conversation', defaultMessage: 'Unmute conversation' },\n pin: { id: 'status.pin', defaultMessage: 'Pin on profile' },\n unpin: { id: 'status.unpin', defaultMessage: 'Unpin from profile' },\n embed: { id: 'status.embed', defaultMessage: 'Embed' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n admin_status: { id: 'status.admin_status', defaultMessage: 'Open this status in the moderation interface' },\n copy: { id: 'status.copy', defaultMessage: 'Copy link to status' },\n});\n\nconst obfuscatedCount = count => {\n if (count < 0) {\n return 0;\n } else if (count <= 1) {\n return count;\n } else {\n return '1+';\n }\n};\n\nexport default @injectIntl\nclass StatusActionBar extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n status: ImmutablePropTypes.map.isRequired,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onMute: PropTypes.func,\n onBlock: PropTypes.func,\n onReport: PropTypes.func,\n onEmbed: PropTypes.func,\n onMuteConversation: PropTypes.func,\n onPin: PropTypes.func,\n withDismiss: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n };\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'withDismiss',\n ]\n\n handleReplyClick = () => {\n if (me) {\n this.props.onReply(this.props.status, this.context.router.history);\n } else {\n this._openInteractionDialog('reply');\n }\n }\n\n handleShareClick = () => {\n navigator.share({\n text: this.props.status.get('search_index'),\n url: this.props.status.get('url'),\n }).catch((e) => {\n if (e.name !== 'AbortError') console.error(e);\n });\n }\n\n handleFavouriteClick = () => {\n if (me) {\n this.props.onFavourite(this.props.status);\n } else {\n this._openInteractionDialog('favourite');\n }\n }\n\n handleReblogClick = e => {\n if (me) {\n this.props.onReblog(this.props.status, e);\n } else {\n this._openInteractionDialog('reblog');\n }\n }\n\n _openInteractionDialog = type => {\n window.open(`/interact/${this.props.status.get('id')}?type=${type}`, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes');\n }\n\n handleDeleteClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history);\n }\n\n handleRedraftClick = () => {\n this.props.onDelete(this.props.status, this.context.router.history, true);\n }\n\n handlePinClick = () => {\n this.props.onPin(this.props.status);\n }\n\n handleMentionClick = () => {\n this.props.onMention(this.props.status.get('account'), this.context.router.history);\n }\n\n handleDirectClick = () => {\n this.props.onDirect(this.props.status.get('account'), this.context.router.history);\n }\n\n handleMuteClick = () => {\n this.props.onMute(this.props.status.get('account'));\n }\n\n handleBlockClick = () => {\n this.props.onBlock(this.props.status);\n }\n\n handleOpen = () => {\n this.context.router.history.push(`/statuses/${this.props.status.get('id')}`);\n }\n\n handleEmbed = () => {\n this.props.onEmbed(this.props.status);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.status);\n }\n\n handleConversationMuteClick = () => {\n this.props.onMuteConversation(this.props.status);\n }\n\n handleCopy = () => {\n const url = this.props.status.get('url');\n const textarea = document.createElement('textarea');\n\n textarea.textContent = url;\n textarea.style.position = 'fixed';\n\n document.body.appendChild(textarea);\n\n try {\n textarea.select();\n document.execCommand('copy');\n } catch (e) {\n\n } finally {\n document.body.removeChild(textarea);\n }\n }\n\n render () {\n const { status, intl, withDismiss } = this.props;\n\n const mutingConversation = status.get('muted');\n const anonymousAccess = !me;\n const publicStatus = ['public', 'unlisted'].includes(status.get('visibility'));\n\n let menu = [];\n let reblogIcon = 'retweet';\n let replyIcon;\n let replyTitle;\n\n menu.push({ text: intl.formatMessage(messages.open), action: this.handleOpen });\n\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(messages.copy), action: this.handleCopy });\n menu.push({ text: intl.formatMessage(messages.embed), action: this.handleEmbed });\n }\n\n menu.push(null);\n\n if (status.getIn(['account', 'id']) === me || withDismiss) {\n menu.push({ text: intl.formatMessage(mutingConversation ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMuteClick });\n menu.push(null);\n }\n\n if (status.getIn(['account', 'id']) === me) {\n if (publicStatus) {\n menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });\n } else {\n if (status.get('visibility') === 'private') {\n menu.push({ text: intl.formatMessage(status.get('reblogged') ? messages.cancel_reblog_private : messages.reblog_private), action: this.handleReblogClick });\n }\n }\n\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n } else {\n menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });\n menu.push({ text: intl.formatMessage(messages.direct, { name: status.getIn(['account', 'username']) }), action: this.handleDirectClick });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mute, { name: status.getIn(['account', 'username']) }), action: this.handleMuteClick });\n menu.push({ text: intl.formatMessage(messages.block, { name: status.getIn(['account', 'username']) }), action: this.handleBlockClick });\n menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport });\n\n if (isStaff) {\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.admin_account, { name: status.getIn(['account', 'username']) }), href: `/admin/accounts/${status.getIn(['account', 'id'])}` });\n menu.push({ text: intl.formatMessage(messages.admin_status), href: `/admin/accounts/${status.getIn(['account', 'id'])}/statuses/${status.get('id')}` });\n }\n if ( deleteOthersNotice ) {\n menu.push({ text: intl.formatMessage(messages.delete), action: this.handleDeleteClick });\n }\n }\n\n if (status.get('visibility') === 'direct') {\n reblogIcon = 'envelope';\n } else if (status.get('visibility') === 'private') {\n reblogIcon = 'lock';\n }\n\n if (status.get('in_reply_to_id', null) === null) {\n replyIcon = 'reply';\n replyTitle = intl.formatMessage(messages.reply);\n } else {\n replyIcon = 'reply-all';\n replyTitle = intl.formatMessage(messages.replyAll);\n }\n\n const shareButton = ('share' in navigator) && status.get('visibility') === 'public' && (\n \n );\n\n return (\n \n
{obfuscatedCount(status.get('replies_count'))}
\n
\n
\n {shareButton}\n\n
\n \n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport Avatar from './avatar';\nimport AvatarOverlay from './avatar_overlay';\nimport AvatarComposite from './avatar_composite';\nimport RelativeTimestamp from './relative_timestamp';\nimport DisplayName from './display_name';\nimport StatusContent from './status_content';\nimport StatusActionBar from './status_action_bar';\nimport AttachmentList from './attachment_list';\nimport Card from '../features/status/components/card';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { MediaGallery, Video, Audio } from '../features/ui/util/async-components';\nimport { HotKeys } from 'react-hotkeys';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\nimport { displayMedia } from '../initial_state';\n\n// We use the component (and not the container) since we do not want\n// to use the progress bar to show download progress\nimport Bundle from '../features/ui/components/bundle';\n\nexport const textForScreenReader = (intl, status, rebloggedByText = false) => {\n const displayName = status.getIn(['account', 'display_name']);\n\n const values = [\n displayName.length === 0 ? status.getIn(['account', 'acct']).split('@')[0] : displayName,\n status.get('spoiler_text') && status.get('hidden') ? status.get('spoiler_text') : status.get('search_index').slice(status.get('spoiler_text').length),\n intl.formatDate(status.get('created_at'), { hour: '2-digit', minute: '2-digit', month: 'short', day: 'numeric' }),\n status.getIn(['account', 'acct']),\n ];\n\n if (rebloggedByText) {\n values.push(rebloggedByText);\n }\n\n return values.join(', ');\n};\n\nexport const defaultMediaVisibility = (status) => {\n if (!status) {\n return undefined;\n }\n\n if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {\n status = status.get('reblog');\n }\n\n return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all');\n};\n\nexport default @injectIntl\nclass Status extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n status: ImmutablePropTypes.map,\n account: ImmutablePropTypes.map,\n otherAccounts: ImmutablePropTypes.list,\n onClick: PropTypes.func,\n onReply: PropTypes.func,\n onFavourite: PropTypes.func,\n onReblog: PropTypes.func,\n onDelete: PropTypes.func,\n onDirect: PropTypes.func,\n onMention: PropTypes.func,\n onPin: PropTypes.func,\n onOpenMedia: PropTypes.func,\n onOpenVideo: PropTypes.func,\n onBlock: PropTypes.func,\n onEmbed: PropTypes.func,\n onHeightChange: PropTypes.func,\n onToggleHidden: PropTypes.func,\n muted: PropTypes.bool,\n hidden: PropTypes.bool,\n unread: PropTypes.bool,\n onMoveUp: PropTypes.func,\n onMoveDown: PropTypes.func,\n showThread: PropTypes.bool,\n getScrollPosition: PropTypes.func,\n updateScrollBottom: PropTypes.func,\n cacheMediaWidth: PropTypes.func,\n cachedMediaWidth: PropTypes.number,\n };\n\n // Avoid checking props that are functions (and whose equality will always\n // evaluate to false. See react-immutable-pure-component for usage.\n updateOnProps = [\n 'status',\n 'account',\n 'muted',\n 'hidden',\n ];\n\n state = {\n showMedia: defaultMediaVisibility(this.props.status),\n statusId: undefined,\n };\n\n // Track height changes we know about to compensate scrolling\n componentDidMount () {\n this.didShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');\n }\n\n getSnapshotBeforeUpdate () {\n if (this.props.getScrollPosition) {\n return this.props.getScrollPosition();\n } else {\n return null;\n }\n }\n\n static getDerivedStateFromProps(nextProps, prevState) {\n if (nextProps.status && nextProps.status.get('id') !== prevState.statusId) {\n return {\n showMedia: defaultMediaVisibility(nextProps.status),\n statusId: nextProps.status.get('id'),\n };\n } else {\n return null;\n }\n }\n\n // Compensate height changes\n componentDidUpdate (prevProps, prevState, snapshot) {\n const doShowCard = !this.props.muted && !this.props.hidden && this.props.status && this.props.status.get('card');\n\n if (doShowCard && !this.didShowCard) {\n this.didShowCard = true;\n\n if (snapshot !== null && this.props.updateScrollBottom) {\n if (this.node && this.node.offsetTop < snapshot.top) {\n this.props.updateScrollBottom(snapshot.height - snapshot.top);\n }\n }\n }\n }\n\n componentWillUnmount() {\n if (this.node && this.props.getScrollPosition) {\n const position = this.props.getScrollPosition();\n if (position !== null && this.node.offsetTop < position.top) {\n requestAnimationFrame(() => {\n this.props.updateScrollBottom(position.height - position.top);\n });\n }\n }\n }\n\n handleToggleMediaVisibility = () => {\n this.setState({ showMedia: !this.state.showMedia });\n }\n\n handleClick = () => {\n if (this.props.onClick) {\n this.props.onClick();\n return;\n }\n\n if (!this.context.router) {\n return;\n }\n\n const { status } = this.props;\n this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`);\n }\n\n handleExpandClick = (e) => {\n if (this.props.onClick) {\n this.props.onClick();\n return;\n }\n\n if (e.button === 0) {\n if (!this.context.router) {\n return;\n }\n\n const { status } = this.props;\n this.context.router.history.push(`/statuses/${status.getIn(['reblog', 'id'], status.get('id'))}`);\n }\n }\n\n handleAccountClick = (e) => {\n if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) {\n const id = e.currentTarget.getAttribute('data-id');\n e.preventDefault();\n this.context.router.history.push(`/accounts/${id}`);\n }\n }\n\n handleExpandedToggle = () => {\n this.props.onToggleHidden(this._properStatus());\n };\n\n renderLoadingMediaGallery () {\n return
;\n }\n\n renderLoadingVideoPlayer () {\n return
;\n }\n\n renderLoadingAudioPlayer () {\n return
;\n }\n\n handleOpenVideo = (media, startTime) => {\n this.props.onOpenVideo(media, startTime);\n }\n\n handleHotkeyReply = e => {\n e.preventDefault();\n this.props.onReply(this._properStatus(), this.context.router.history);\n }\n\n handleHotkeyFavourite = () => {\n this.props.onFavourite(this._properStatus());\n }\n\n handleHotkeyBoost = e => {\n this.props.onReblog(this._properStatus(), e);\n }\n\n handleHotkeyMention = e => {\n e.preventDefault();\n this.props.onMention(this._properStatus().get('account'), this.context.router.history);\n }\n\n handleHotkeyOpen = () => {\n this.context.router.history.push(`/statuses/${this._properStatus().get('id')}`);\n }\n\n handleHotkeyOpenProfile = () => {\n this.context.router.history.push(`/accounts/${this._properStatus().getIn(['account', 'id'])}`);\n }\n\n handleHotkeyMoveUp = e => {\n this.props.onMoveUp(this.props.status.get('id'), e.target.getAttribute('data-featured'));\n }\n\n handleHotkeyMoveDown = e => {\n this.props.onMoveDown(this.props.status.get('id'), e.target.getAttribute('data-featured'));\n }\n\n handleHotkeyToggleHidden = () => {\n this.props.onToggleHidden(this._properStatus());\n }\n\n handleHotkeyToggleSensitive = () => {\n this.handleToggleMediaVisibility();\n }\n\n _properStatus () {\n const { status } = this.props;\n\n if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {\n return status.get('reblog');\n } else {\n return status;\n }\n }\n\n handleRef = c => {\n this.node = c;\n }\n\n render () {\n let media = null;\n let statusAvatar, prepend, rebloggedByText;\n\n const { intl, hidden, featured, otherAccounts, unread, showThread } = this.props;\n\n let { status, account, ...other } = this.props;\n\n if (status === null) {\n return null;\n }\n\n const handlers = this.props.muted ? {} : {\n reply: this.handleHotkeyReply,\n favourite: this.handleHotkeyFavourite,\n boost: this.handleHotkeyBoost,\n mention: this.handleHotkeyMention,\n open: this.handleHotkeyOpen,\n openProfile: this.handleHotkeyOpenProfile,\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n toggleHidden: this.handleHotkeyToggleHidden,\n toggleSensitive: this.handleHotkeyToggleSensitive,\n };\n\n if (hidden) {\n return (\n \n \n {status.getIn(['account', 'display_name']) || status.getIn(['account', 'username'])}\n {status.get('content')}\n
\n \n );\n }\n\n if (status.get('filtered') || status.getIn(['reblog', 'filtered'])) {\n const minHandlers = this.props.muted ? {} : {\n moveUp: this.handleHotkeyMoveUp,\n moveDown: this.handleHotkeyMoveDown,\n };\n\n return (\n \n \n \n
\n \n );\n }\n\n if (featured) {\n prepend = (\n \n );\n } else if (status.get('reblog', null) !== null && typeof status.get('reblog') === 'object') {\n const display_name_html = { __html: status.getIn(['account', 'display_name_html']) };\n\n prepend = (\n \n );\n\n rebloggedByText = intl.formatMessage({ id: 'status.reblogged_by', defaultMessage: '{name} boosted' }, { name: status.getIn(['account', 'acct']) });\n\n account = status.get('account');\n status = status.get('reblog');\n }\n\n if (status.get('media_attachments').size > 0) {\n if (this.props.muted) {\n media = (\n \n );\n } else if (status.getIn(['media_attachments', 0, 'type']) === 'audio') {\n const attachment = status.getIn(['media_attachments', 0]);\n\n media = (\n \n {Component => (\n \n )}\n \n );\n } else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {\n const attachment = status.getIn(['media_attachments', 0]);\n\n media = (\n \n {Component => (\n \n )}\n \n );\n } else {\n media = (\n \n {Component => (\n \n )}\n \n );\n }\n } else if (status.get('spoiler_text').length === 0 && status.get('card')) {\n media = (\n \n );\n }\n\n if (otherAccounts && otherAccounts.size > 0) {\n statusAvatar = ;\n } else if (account === undefined || account === null) {\n statusAvatar = ;\n } else {\n statusAvatar = ;\n }\n\n return (\n \n \n {prepend}\n\n
\n
\n
\n\n
\n\n {media}\n\n {showThread && status.get('in_reply_to_id') && status.get('in_reply_to_account_id') === status.getIn(['account', 'id']) && (\n
\n \n \n )}\n\n
\n
\n
\n \n );\n }\n\n}\n","var _extends = Object.assign || 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\nvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) {\n return typeof obj;\n} : function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n};\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nimport React from \"react\";\nimport PropTypes from \"prop-types\";\nimport Route from \"./Route\";\nimport Link from \"./Link\";\n/**\n * A wrapper that knows if it's \"active\" or not.\n */\n\nvar NavLink = function NavLink(_ref) {\n var to = _ref.to,\n exact = _ref.exact,\n strict = _ref.strict,\n location = _ref.location,\n activeClassName = _ref.activeClassName,\n className = _ref.className,\n activeStyle = _ref.activeStyle,\n style = _ref.style,\n getIsActive = _ref.isActive,\n ariaCurrent = _ref[\"aria-current\"],\n rest = _objectWithoutProperties(_ref, [\"to\", \"exact\", \"strict\", \"location\", \"activeClassName\", \"className\", \"activeStyle\", \"style\", \"isActive\", \"aria-current\"]);\n\n var path = (typeof to === \"undefined\" ? \"undefined\" : _typeof(to)) === \"object\" ? to.pathname : to; // Regex taken from: https://github.com/pillarjs/path-to-regexp/blob/master/index.js#L202\n\n var escapedPath = path && path.replace(/([.+*?=^!:${}()[\\]|/\\\\])/g, \"\\\\$1\");\n return React.createElement(Route, {\n path: escapedPath,\n exact: exact,\n strict: strict,\n location: location,\n children: function children(_ref2) {\n var location = _ref2.location,\n match = _ref2.match;\n var isActive = !!(getIsActive ? getIsActive(match, location) : match);\n return React.createElement(Link, _extends({\n to: to,\n className: isActive ? [className, activeClassName].filter(function (i) {\n return i;\n }).join(\" \") : className,\n style: isActive ? _extends({}, style, activeStyle) : style,\n \"aria-current\": isActive && ariaCurrent || null\n }, rest));\n }\n });\n};\n\nNavLink.defaultProps = {\n activeClassName: \"active\",\n \"aria-current\": \"page\"\n};\nexport default NavLink;","import createEmotion from 'create-emotion';\nvar context = typeof global !== 'undefined' ? global : {};\n\nvar _createEmotion = createEmotion(context),\n flush = _createEmotion.flush,\n hydrate = _createEmotion.hydrate,\n cx = _createEmotion.cx,\n merge = _createEmotion.merge,\n getRegisteredStyles = _createEmotion.getRegisteredStyles,\n injectGlobal = _createEmotion.injectGlobal,\n keyframes = _createEmotion.keyframes,\n css = _createEmotion.css,\n sheet = _createEmotion.sheet,\n caches = _createEmotion.caches;\n\nexport { flush, hydrate, cx, merge, getRegisteredStyles, injectGlobal, keyframes, css, sheet, caches };","\n// Get the bounding client rect from an IntersectionObserver entry.\n// This is to work around a bug in Chrome: https://crbug.com/737228\n\nlet hasBoundingRectBug;\n\nfunction getRectFromEntry(entry) {\n if (typeof hasBoundingRectBug !== 'boolean') {\n const boundingRect = entry.target.getBoundingClientRect();\n const observerRect = entry.boundingClientRect;\n hasBoundingRectBug = boundingRect.height !== observerRect.height ||\n boundingRect.top !== observerRect.top ||\n boundingRect.width !== observerRect.width ||\n boundingRect.bottom !== observerRect.bottom ||\n boundingRect.left !== observerRect.left ||\n boundingRect.right !== observerRect.right;\n }\n return hasBoundingRectBug ? entry.target.getBoundingClientRect() : entry.boundingClientRect;\n}\n\nexport default getRectFromEntry;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport scheduleIdleTask from 'flavours/glitch/util/schedule_idle_task';\nimport getRectFromEntry from 'flavours/glitch/util/get_rect_from_entry';\n\n// Diff these props in the \"unrendered\" state\nconst updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];\n\nexport default class IntersectionObserverArticle extends React.Component {\n\n static propTypes = {\n intersectionObserverWrapper: PropTypes.object.isRequired,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n listLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n saveHeightKey: PropTypes.string,\n cachedHeight: PropTypes.number,\n onHeightChange: PropTypes.func,\n children: PropTypes.node,\n };\n\n state = {\n isHidden: false, // set to true in requestIdleCallback to trigger un-render\n }\n\n shouldComponentUpdate (nextProps, nextState) {\n const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight);\n const willBeUnrendered = !nextState.isIntersecting && (nextState.isHidden || nextProps.cachedHeight);\n if (!!isUnrendered !== !!willBeUnrendered) {\n // If we're going from rendered to unrendered (or vice versa) then update\n return true;\n }\n // If we are and remain hidden, diff based on props\n if (isUnrendered) {\n return !updateOnPropsForUnrendered.every(prop => nextProps[prop] === this.props[prop]);\n }\n // Else, assume the children have changed\n return true;\n }\n\n\n componentDidMount () {\n const { intersectionObserverWrapper, id } = this.props;\n\n intersectionObserverWrapper.observe(\n id,\n this.node,\n this.handleIntersection\n );\n\n this.componentMounted = true;\n }\n\n componentWillUnmount () {\n const { intersectionObserverWrapper, id } = this.props;\n intersectionObserverWrapper.unobserve(id, this.node);\n\n this.componentMounted = false;\n }\n\n handleIntersection = (entry) => {\n this.entry = entry;\n\n scheduleIdleTask(this.calculateHeight);\n this.setState(this.updateStateAfterIntersection);\n }\n\n updateStateAfterIntersection = (prevState) => {\n if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {\n scheduleIdleTask(this.hideIfNotIntersecting);\n }\n return {\n isIntersecting: this.entry.isIntersecting,\n isHidden: false,\n };\n }\n\n calculateHeight = () => {\n const { onHeightChange, saveHeightKey, id } = this.props;\n // save the height of the fully-rendered element (this is expensive\n // on Chrome, where we need to fall back to getBoundingClientRect)\n this.height = getRectFromEntry(this.entry).height;\n\n if (onHeightChange && saveHeightKey) {\n onHeightChange(saveHeightKey, id, this.height);\n }\n }\n\n hideIfNotIntersecting = () => {\n if (!this.componentMounted) {\n return;\n }\n\n // When the browser gets a chance, test if we're still not intersecting,\n // and if so, set our isHidden to true to trigger an unrender. The point of\n // this is to save DOM nodes and avoid using up too much memory.\n // See: https://github.com/tootsuite/mastodon/issues/2900\n this.setState((prevState) => ({ isHidden: !prevState.isIntersecting }));\n }\n\n handleRef = (node) => {\n this.node = node;\n }\n\n render () {\n const { children, id, index, listLength, cachedHeight } = this.props;\n const { isIntersecting, isHidden } = this.state;\n\n const style = {};\n\n if (!isIntersecting && (isHidden || cachedHeight)) {\n style.height = `${this.height || cachedHeight || 150}px`;\n style.opacity = 0;\n style.overflow = 'hidden';\n }\n\n return (\n \n {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })}\n \n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport IntersectionObserverArticle from 'flavours/glitch/components/intersection_observer_article';\nimport { setHeight } from 'flavours/glitch/actions/height_cache';\n\nconst makeMapStateToProps = (state, props) => ({\n cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n\n onHeightChange (key, id, height) {\n dispatch(setHeight(key, id, height));\n },\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(IntersectionObserverArticle);\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class LoadPending extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n count: PropTypes.number,\n }\n\n render() {\n const { count } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","// Wrapper for IntersectionObserver in order to make working with it\n// a bit easier. We also follow this performance advice:\n// \"If you need to observe multiple elements, it is both possible and\n// advised to observe multiple elements using the same IntersectionObserver\n// instance by calling observe() multiple times.\"\n// https://developers.google.com/web/updates/2016/04/intersectionobserver\n\nclass IntersectionObserverWrapper {\n\n callbacks = {};\n observerBacklog = [];\n observer = null;\n\n connect (options) {\n const onIntersection = (entries) => {\n entries.forEach(entry => {\n const id = entry.target.getAttribute('data-id');\n if (this.callbacks[id]) {\n this.callbacks[id](entry);\n }\n });\n };\n\n this.observer = new IntersectionObserver(onIntersection, options);\n this.observerBacklog.forEach(([ id, node, callback ]) => {\n this.observe(id, node, callback);\n });\n this.observerBacklog = null;\n }\n\n observe (id, node, callback) {\n if (!this.observer) {\n this.observerBacklog.push([ id, node, callback ]);\n } else {\n this.callbacks[id] = callback;\n this.observer.observe(node);\n }\n }\n\n unobserve (id, node) {\n if (this.observer) {\n delete this.callbacks[id];\n this.observer.unobserve(node);\n }\n }\n\n disconnect () {\n if (this.observer) {\n this.callbacks = {};\n this.observer.disconnect();\n this.observer = null;\n }\n }\n\n}\n\nexport default IntersectionObserverWrapper;\n","import React, { PureComponent } from 'react';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport PropTypes from 'prop-types';\nimport IntersectionObserverArticleContainer from 'flavours/glitch/containers/intersection_observer_article_container';\nimport LoadMore from './load_more';\nimport LoadPending from './load_pending';\nimport IntersectionObserverWrapper from 'flavours/glitch/util/intersection_observer_wrapper';\nimport { throttle } from 'lodash';\nimport { List as ImmutableList } from 'immutable';\nimport classNames from 'classnames';\nimport { attachFullscreenListener, detachFullscreenListener, isFullscreen } from 'flavours/glitch/util/fullscreen';\nimport LoadingIndicator from './loading_indicator';\n\nconst MOUSE_IDLE_DELAY = 300;\n\nexport default class ScrollableList extends PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n onLoadMore: PropTypes.func,\n onLoadPending: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n showLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n numPending: PropTypes.number,\n prepend: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n emptyMessage: PropTypes.node,\n children: PropTypes.node,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n state = {\n fullscreen: null,\n cachedMediaWidth: 300,\n };\n\n intersectionObserverWrapper = new IntersectionObserverWrapper();\n\n handleScroll = throttle(() => {\n if (this.node) {\n const { scrollTop, scrollHeight, clientHeight } = this.node;\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (400 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {\n this.props.onLoadMore();\n }\n\n if (scrollTop < 100 && this.props.onScrollToTop) {\n this.props.onScrollToTop();\n } else if (this.props.onScroll) {\n this.props.onScroll();\n }\n\n if (!this.lastScrollWasSynthetic) {\n // If the last scroll wasn't caused by setScrollTop(), assume it was\n // intentional and cancel any pending scroll reset on mouse idle\n this.scrollToTopOnMouseIdle = false;\n }\n this.lastScrollWasSynthetic = false;\n }\n }, 150, {\n trailing: true,\n });\n\n mouseIdleTimer = null;\n mouseMovedRecently = false;\n lastScrollWasSynthetic = false;\n scrollToTopOnMouseIdle = false;\n\n setScrollTop = newScrollTop => {\n if (this.node.scrollTop !== newScrollTop) {\n this.lastScrollWasSynthetic = true;\n this.node.scrollTop = newScrollTop;\n }\n };\n\n clearMouseIdleTimer = () => {\n if (this.mouseIdleTimer === null) {\n return;\n }\n clearTimeout(this.mouseIdleTimer);\n this.mouseIdleTimer = null;\n };\n\n handleMouseMove = throttle(() => {\n // As long as the mouse keeps moving, clear and restart the idle timer.\n this.clearMouseIdleTimer();\n this.mouseIdleTimer =\n setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);\n\n if (!this.mouseMovedRecently && this.node.scrollTop === 0) {\n // Only set if we just started moving and are scrolled to the top.\n this.scrollToTopOnMouseIdle = true;\n }\n // Save setting this flag for last, so we can do the comparison above.\n this.mouseMovedRecently = true;\n }, MOUSE_IDLE_DELAY / 2);\n\n handleWheel = throttle(() => {\n this.scrollToTopOnMouseIdle = false;\n }, 150, {\n trailing: true,\n });\n\n handleMouseIdle = () => {\n if (this.scrollToTopOnMouseIdle) {\n this.setScrollTop(0);\n }\n this.mouseMovedRecently = false;\n this.scrollToTopOnMouseIdle = false;\n }\n\n componentDidMount () {\n this.attachScrollListener();\n this.attachIntersectionObserver();\n attachFullscreenListener(this.onFullScreenChange);\n\n // Handle initial scroll posiiton\n this.handleScroll();\n }\n\n getScrollPosition = () => {\n if (this.node && (this.node.scrollTop > 0 || this.mouseMovedRecently)) {\n return {height: this.node.scrollHeight, top: this.node.scrollTop};\n } else {\n return null;\n }\n }\n\n updateScrollBottom = (snapshot) => {\n const newScrollTop = this.node.scrollHeight - snapshot;\n\n this.setScrollTop(newScrollTop);\n }\n\n cacheMediaWidth = (width) => {\n if (width && this.state.cachedMediaWidth != width) this.setState({ cachedMediaWidth: width });\n }\n\n getSnapshotBeforeUpdate (prevProps, prevState) {\n const someItemInserted = React.Children.count(prevProps.children) > 0 &&\n React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&\n this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);\n const pendingChanged = (prevProps.numPending > 0) !== (this.props.numPending > 0);\n\n if (pendingChanged || someItemInserted && (this.node.scrollTop > 0 || this.mouseMovedRecently)) {\n return this.node.scrollHeight - this.node.scrollTop;\n } else {\n return null;\n }\n }\n\n componentDidUpdate (prevProps, prevState, snapshot) {\n // Reset the scroll position when a new child comes in in order not to\n // jerk the scrollbar around if you're already scrolled down the page.\n if (snapshot !== null) this.updateScrollBottom(snapshot);\n }\n\n componentWillUnmount () {\n this.clearMouseIdleTimer();\n this.detachScrollListener();\n this.detachIntersectionObserver();\n detachFullscreenListener(this.onFullScreenChange);\n }\n\n onFullScreenChange = () => {\n this.setState({ fullscreen: isFullscreen() });\n }\n\n attachIntersectionObserver () {\n this.intersectionObserverWrapper.connect({\n root: this.node,\n rootMargin: '300% 0px',\n });\n }\n\n detachIntersectionObserver () {\n this.intersectionObserverWrapper.disconnect();\n }\n\n attachScrollListener () {\n this.node.addEventListener('scroll', this.handleScroll);\n this.node.addEventListener('wheel', this.handleWheel);\n }\n\n detachScrollListener () {\n this.node.removeEventListener('scroll', this.handleScroll);\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n\n getFirstChildKey (props) {\n const { children } = props;\n let firstChild = children;\n\n if (children instanceof ImmutableList) {\n firstChild = children.get(0);\n } else if (Array.isArray(children)) {\n firstChild = children[0];\n }\n\n return firstChild && firstChild.key;\n }\n\n setRef = (c) => {\n this.node = c;\n }\n\n handleLoadMore = e => {\n e.preventDefault();\n this.props.onLoadMore();\n }\n\n defaultShouldUpdateScroll = (prevRouterProps, { location }) => {\n if ((((prevRouterProps || {}).location || {}).state || {}).mastodonModalOpen) return false;\n return !(location.state && location.state.mastodonModalOpen);\n }\n\n handleLoadPending = e => {\n e.preventDefault();\n this.props.onLoadPending();\n // Prevent the weird scroll-jumping behavior, as we explicitly don't want to\n // scroll to top, and we know the scroll height is going to change\n this.scrollToTopOnMouseIdle = false;\n this.lastScrollWasSynthetic = false;\n this.clearMouseIdleTimer();\n this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);\n this.mouseMovedRecently = true;\n }\n\n render () {\n const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props;\n const { fullscreen } = this.state;\n const childrenCount = React.Children.count(children);\n\n const loadMore = (hasMore && onLoadMore) ? : null;\n const loadPending = (numPending > 0) ? : null;\n let scrollableArea = null;\n\n if (showLoading) {\n scrollableArea = (\n \n
\n {prepend}\n
\n\n
\n \n
\n
\n );\n } else if (isLoading || childrenCount > 0 || hasMore || !emptyMessage) {\n scrollableArea = (\n \n
\n {prepend}\n\n {loadPending}\n\n {React.Children.map(this.props.children, (child, index) => (\n \n {React.cloneElement(child, {\n getScrollPosition: this.getScrollPosition,\n updateScrollBottom: this.updateScrollBottom,\n cachedMediaWidth: this.state.cachedMediaWidth,\n cacheMediaWidth: this.cacheMediaWidth,\n })}\n \n ))}\n\n {loadMore}\n
\n
\n );\n } else {\n scrollableArea = (\n \n {alwaysPrepend && prepend}\n\n
\n {emptyMessage}\n
\n
\n );\n }\n\n if (trackScroll) {\n return (\n \n {scrollableArea}\n \n );\n } else {\n return scrollableArea;\n }\n }\n\n}\n","\n// Get the bounding client rect from an IntersectionObserver entry.\n// This is to work around a bug in Chrome: https://crbug.com/737228\n\nlet hasBoundingRectBug;\n\nfunction getRectFromEntry(entry) {\n if (typeof hasBoundingRectBug !== 'boolean') {\n const boundingRect = entry.target.getBoundingClientRect();\n const observerRect = entry.boundingClientRect;\n hasBoundingRectBug = boundingRect.height !== observerRect.height ||\n boundingRect.top !== observerRect.top ||\n boundingRect.width !== observerRect.width ||\n boundingRect.bottom !== observerRect.bottom ||\n boundingRect.left !== observerRect.left ||\n boundingRect.right !== observerRect.right;\n }\n return hasBoundingRectBug ? entry.target.getBoundingClientRect() : entry.boundingClientRect;\n}\n\nexport default getRectFromEntry;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport scheduleIdleTask from '../features/ui/util/schedule_idle_task';\nimport getRectFromEntry from '../features/ui/util/get_rect_from_entry';\nimport { is } from 'immutable';\n\n// Diff these props in the \"rendered\" state\nconst updateOnPropsForRendered = ['id', 'index', 'listLength'];\n// Diff these props in the \"unrendered\" state\nconst updateOnPropsForUnrendered = ['id', 'index', 'listLength', 'cachedHeight'];\n\nexport default class IntersectionObserverArticle extends React.Component {\n\n static propTypes = {\n intersectionObserverWrapper: PropTypes.object.isRequired,\n id: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n index: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n listLength: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n saveHeightKey: PropTypes.string,\n cachedHeight: PropTypes.number,\n onHeightChange: PropTypes.func,\n children: PropTypes.node,\n };\n\n state = {\n isHidden: false, // set to true in requestIdleCallback to trigger un-render\n }\n\n shouldComponentUpdate (nextProps, nextState) {\n const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight);\n const willBeUnrendered = !nextState.isIntersecting && (nextState.isHidden || nextProps.cachedHeight);\n if (!!isUnrendered !== !!willBeUnrendered) {\n // If we're going from rendered to unrendered (or vice versa) then update\n return true;\n }\n // Otherwise, diff based on props\n const propsToDiff = isUnrendered ? updateOnPropsForUnrendered : updateOnPropsForRendered;\n return !propsToDiff.every(prop => is(nextProps[prop], this.props[prop]));\n }\n\n componentDidMount () {\n const { intersectionObserverWrapper, id } = this.props;\n\n intersectionObserverWrapper.observe(\n id,\n this.node,\n this.handleIntersection\n );\n\n this.componentMounted = true;\n }\n\n componentWillUnmount () {\n const { intersectionObserverWrapper, id } = this.props;\n intersectionObserverWrapper.unobserve(id, this.node);\n\n this.componentMounted = false;\n }\n\n handleIntersection = (entry) => {\n this.entry = entry;\n\n scheduleIdleTask(this.calculateHeight);\n this.setState(this.updateStateAfterIntersection);\n }\n\n updateStateAfterIntersection = (prevState) => {\n if (prevState.isIntersecting !== false && !this.entry.isIntersecting) {\n scheduleIdleTask(this.hideIfNotIntersecting);\n }\n return {\n isIntersecting: this.entry.isIntersecting,\n isHidden: false,\n };\n }\n\n calculateHeight = () => {\n const { onHeightChange, saveHeightKey, id } = this.props;\n // save the height of the fully-rendered element (this is expensive\n // on Chrome, where we need to fall back to getBoundingClientRect)\n this.height = getRectFromEntry(this.entry).height;\n\n if (onHeightChange && saveHeightKey) {\n onHeightChange(saveHeightKey, id, this.height);\n }\n }\n\n hideIfNotIntersecting = () => {\n if (!this.componentMounted) {\n return;\n }\n\n // When the browser gets a chance, test if we're still not intersecting,\n // and if so, set our isHidden to true to trigger an unrender. The point of\n // this is to save DOM nodes and avoid using up too much memory.\n // See: https://github.com/tootsuite/mastodon/issues/2900\n this.setState((prevState) => ({ isHidden: !prevState.isIntersecting }));\n }\n\n handleRef = (node) => {\n this.node = node;\n }\n\n render () {\n const { children, id, index, listLength, cachedHeight } = this.props;\n const { isIntersecting, isHidden } = this.state;\n\n if (!isIntersecting && (isHidden || cachedHeight)) {\n return (\n \n {children && React.cloneElement(children, { hidden: true })}\n \n );\n }\n\n return (\n \n {children && React.cloneElement(children, { hidden: false })}\n \n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport IntersectionObserverArticle from '../components/intersection_observer_article';\nimport { setHeight } from '../actions/height_cache';\n\nconst makeMapStateToProps = (state, props) => ({\n cachedHeight: state.getIn(['height_cache', props.saveHeightKey, props.id]),\n});\n\nconst mapDispatchToProps = (dispatch) => ({\n\n onHeightChange (key, id, height) {\n dispatch(setHeight(key, id, height));\n },\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(IntersectionObserverArticle);\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class LoadPending extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n count: PropTypes.number,\n }\n\n render() {\n const { count } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","// Wrapper for IntersectionObserver in order to make working with it\n// a bit easier. We also follow this performance advice:\n// \"If you need to observe multiple elements, it is both possible and\n// advised to observe multiple elements using the same IntersectionObserver\n// instance by calling observe() multiple times.\"\n// https://developers.google.com/web/updates/2016/04/intersectionobserver\n\nclass IntersectionObserverWrapper {\n\n callbacks = {};\n observerBacklog = [];\n observer = null;\n\n connect (options) {\n const onIntersection = (entries) => {\n entries.forEach(entry => {\n const id = entry.target.getAttribute('data-id');\n if (this.callbacks[id]) {\n this.callbacks[id](entry);\n }\n });\n };\n\n this.observer = new IntersectionObserver(onIntersection, options);\n this.observerBacklog.forEach(([ id, node, callback ]) => {\n this.observe(id, node, callback);\n });\n this.observerBacklog = null;\n }\n\n observe (id, node, callback) {\n if (!this.observer) {\n this.observerBacklog.push([ id, node, callback ]);\n } else {\n this.callbacks[id] = callback;\n this.observer.observe(node);\n }\n }\n\n unobserve (id, node) {\n if (this.observer) {\n delete this.callbacks[id];\n this.observer.unobserve(node);\n }\n }\n\n disconnect () {\n if (this.observer) {\n this.callbacks = {};\n this.observer.disconnect();\n this.observer = null;\n }\n }\n\n}\n\nexport default IntersectionObserverWrapper;\n","import React, { PureComponent } from 'react';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport PropTypes from 'prop-types';\nimport IntersectionObserverArticleContainer from '../containers/intersection_observer_article_container';\nimport LoadMore from './load_more';\nimport LoadPending from './load_pending';\nimport IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper';\nimport { throttle } from 'lodash';\nimport { List as ImmutableList } from 'immutable';\nimport classNames from 'classnames';\nimport { attachFullscreenListener, detachFullscreenListener, isFullscreen } from '../features/ui/util/fullscreen';\nimport LoadingIndicator from './loading_indicator';\n\nconst MOUSE_IDLE_DELAY = 300;\n\nexport default class ScrollableList extends PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n onLoadMore: PropTypes.func,\n onLoadPending: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n showLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n numPending: PropTypes.number,\n prepend: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n emptyMessage: PropTypes.node,\n children: PropTypes.node,\n bindToDocument: PropTypes.bool,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n state = {\n fullscreen: null,\n cachedMediaWidth: 250, // Default media/card width using default Mastodon theme\n };\n\n intersectionObserverWrapper = new IntersectionObserverWrapper();\n\n handleScroll = throttle(() => {\n if (this.node) {\n const scrollTop = this.getScrollTop();\n const scrollHeight = this.getScrollHeight();\n const clientHeight = this.getClientHeight();\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (400 > offset && this.props.onLoadMore && this.props.hasMore && !this.props.isLoading) {\n this.props.onLoadMore();\n }\n\n if (scrollTop < 100 && this.props.onScrollToTop) {\n this.props.onScrollToTop();\n } else if (this.props.onScroll) {\n this.props.onScroll();\n }\n\n if (!this.lastScrollWasSynthetic) {\n // If the last scroll wasn't caused by setScrollTop(), assume it was\n // intentional and cancel any pending scroll reset on mouse idle\n this.scrollToTopOnMouseIdle = false;\n }\n this.lastScrollWasSynthetic = false;\n }\n }, 150, {\n trailing: true,\n });\n\n mouseIdleTimer = null;\n mouseMovedRecently = false;\n lastScrollWasSynthetic = false;\n scrollToTopOnMouseIdle = false;\n\n setScrollTop = newScrollTop => {\n if (this.getScrollTop() !== newScrollTop) {\n this.lastScrollWasSynthetic = true;\n\n if (this.props.bindToDocument) {\n document.scrollingElement.scrollTop = newScrollTop;\n } else {\n this.node.scrollTop = newScrollTop;\n }\n }\n };\n\n clearMouseIdleTimer = () => {\n if (this.mouseIdleTimer === null) {\n return;\n }\n\n clearTimeout(this.mouseIdleTimer);\n this.mouseIdleTimer = null;\n };\n\n handleMouseMove = throttle(() => {\n // As long as the mouse keeps moving, clear and restart the idle timer.\n this.clearMouseIdleTimer();\n this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);\n\n if (!this.mouseMovedRecently && this.getScrollTop() === 0) {\n // Only set if we just started moving and are scrolled to the top.\n this.scrollToTopOnMouseIdle = true;\n }\n\n // Save setting this flag for last, so we can do the comparison above.\n this.mouseMovedRecently = true;\n }, MOUSE_IDLE_DELAY / 2);\n\n handleWheel = throttle(() => {\n this.scrollToTopOnMouseIdle = false;\n }, 150, {\n trailing: true,\n });\n\n handleMouseIdle = () => {\n if (this.scrollToTopOnMouseIdle) {\n this.setScrollTop(0);\n }\n\n this.mouseMovedRecently = false;\n this.scrollToTopOnMouseIdle = false;\n }\n\n componentDidMount () {\n this.attachScrollListener();\n this.attachIntersectionObserver();\n\n attachFullscreenListener(this.onFullScreenChange);\n\n // Handle initial scroll posiiton\n this.handleScroll();\n }\n\n getScrollPosition = () => {\n if (this.node && (this.getScrollTop() > 0 || this.mouseMovedRecently)) {\n return { height: this.getScrollHeight(), top: this.getScrollTop() };\n } else {\n return null;\n }\n }\n\n getScrollTop = () => {\n return this.props.bindToDocument ? document.scrollingElement.scrollTop : this.node.scrollTop;\n }\n\n getScrollHeight = () => {\n return this.props.bindToDocument ? document.scrollingElement.scrollHeight : this.node.scrollHeight;\n }\n\n getClientHeight = () => {\n return this.props.bindToDocument ? document.scrollingElement.clientHeight : this.node.clientHeight;\n }\n\n updateScrollBottom = (snapshot) => {\n const newScrollTop = this.getScrollHeight() - snapshot;\n\n this.setScrollTop(newScrollTop);\n }\n\n getSnapshotBeforeUpdate (prevProps) {\n const someItemInserted = React.Children.count(prevProps.children) > 0 &&\n React.Children.count(prevProps.children) < React.Children.count(this.props.children) &&\n this.getFirstChildKey(prevProps) !== this.getFirstChildKey(this.props);\n const pendingChanged = (prevProps.numPending > 0) !== (this.props.numPending > 0);\n\n if (pendingChanged || someItemInserted && (this.getScrollTop() > 0 || this.mouseMovedRecently)) {\n return this.getScrollHeight() - this.getScrollTop();\n } else {\n return null;\n }\n }\n\n componentDidUpdate (prevProps, prevState, snapshot) {\n // Reset the scroll position when a new child comes in in order not to\n // jerk the scrollbar around if you're already scrolled down the page.\n if (snapshot !== null) {\n this.setScrollTop(this.getScrollHeight() - snapshot);\n }\n }\n\n cacheMediaWidth = (width) => {\n if (width && this.state.cachedMediaWidth !== width) {\n this.setState({ cachedMediaWidth: width });\n }\n }\n\n componentWillUnmount () {\n this.clearMouseIdleTimer();\n this.detachScrollListener();\n this.detachIntersectionObserver();\n\n detachFullscreenListener(this.onFullScreenChange);\n }\n\n onFullScreenChange = () => {\n this.setState({ fullscreen: isFullscreen() });\n }\n\n attachIntersectionObserver () {\n this.intersectionObserverWrapper.connect({\n root: this.node,\n rootMargin: '300% 0px',\n });\n }\n\n detachIntersectionObserver () {\n this.intersectionObserverWrapper.disconnect();\n }\n\n attachScrollListener () {\n if (this.props.bindToDocument) {\n document.addEventListener('scroll', this.handleScroll);\n document.addEventListener('wheel', this.handleWheel);\n } else {\n this.node.addEventListener('scroll', this.handleScroll);\n this.node.addEventListener('wheel', this.handleWheel);\n }\n }\n\n detachScrollListener () {\n if (this.props.bindToDocument) {\n document.removeEventListener('scroll', this.handleScroll);\n document.removeEventListener('wheel', this.handleWheel);\n } else {\n this.node.removeEventListener('scroll', this.handleScroll);\n this.node.removeEventListener('wheel', this.handleWheel);\n }\n }\n\n getFirstChildKey (props) {\n const { children } = props;\n let firstChild = children;\n\n if (children instanceof ImmutableList) {\n firstChild = children.get(0);\n } else if (Array.isArray(children)) {\n firstChild = children[0];\n }\n\n return firstChild && firstChild.key;\n }\n\n setRef = (c) => {\n this.node = c;\n }\n\n handleLoadMore = e => {\n e.preventDefault();\n this.props.onLoadMore();\n }\n\n handleLoadPending = e => {\n e.preventDefault();\n this.props.onLoadPending();\n // Prevent the weird scroll-jumping behavior, as we explicitly don't want to\n // scroll to top, and we know the scroll height is going to change\n this.scrollToTopOnMouseIdle = false;\n this.lastScrollWasSynthetic = false;\n this.clearMouseIdleTimer();\n this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY);\n this.mouseMovedRecently = true;\n }\n\n render () {\n const { children, scrollKey, trackScroll, shouldUpdateScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, emptyMessage, onLoadMore } = this.props;\n const { fullscreen } = this.state;\n const childrenCount = React.Children.count(children);\n\n const loadMore = (hasMore && onLoadMore) ? : null;\n const loadPending = (numPending > 0) ? : null;\n let scrollableArea = null;\n\n if (showLoading) {\n scrollableArea = (\n \n
\n {prepend}\n
\n\n
\n \n
\n
\n );\n } else if (isLoading || childrenCount > 0 || hasMore || !emptyMessage) {\n scrollableArea = (\n \n
\n {prepend}\n\n {loadPending}\n\n {React.Children.map(this.props.children, (child, index) => (\n \n {React.cloneElement(child, {\n getScrollPosition: this.getScrollPosition,\n updateScrollBottom: this.updateScrollBottom,\n cachedMediaWidth: this.state.cachedMediaWidth,\n cacheMediaWidth: this.cacheMediaWidth,\n })}\n \n ))}\n\n {loadMore}\n
\n
\n );\n } else {\n scrollableArea = (\n \n {alwaysPrepend && prepend}\n\n
\n {emptyMessage}\n
\n
\n );\n }\n\n if (trackScroll) {\n return (\n \n {scrollableArea}\n \n );\n } else {\n return scrollableArea;\n }\n }\n\n}\n","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","import React, { Fragment } from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport Avatar from './avatar';\nimport DisplayName from './display_name';\nimport Permalink from './permalink';\nimport IconButton from './icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { me } from '../initial_state';\n\nconst messages = defineMessages({\n follow: { id: 'account.follow', defaultMessage: 'Follow' },\n unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },\n requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },\n mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' },\n unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' },\n});\n\nexport default @injectIntl\nclass Account extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n onMute: PropTypes.func.isRequired,\n onMuteNotifications: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n hidden: PropTypes.bool,\n actionIcon: PropTypes.string,\n actionTitle: PropTypes.string,\n onActionClick: PropTypes.func,\n };\n\n handleFollow = () => {\n this.props.onFollow(this.props.account);\n }\n\n handleBlock = () => {\n this.props.onBlock(this.props.account);\n }\n\n handleMute = () => {\n this.props.onMute(this.props.account);\n }\n\n handleMuteNotifications = () => {\n this.props.onMuteNotifications(this.props.account, true);\n }\n\n handleUnmuteNotifications = () => {\n this.props.onMuteNotifications(this.props.account, false);\n }\n\n handleAction = () => {\n this.props.onActionClick(this.props.account);\n }\n\n render () {\n const { account, intl, hidden, onActionClick, actionIcon, actionTitle } = this.props;\n\n if (!account) {\n return
;\n }\n\n if (hidden) {\n return (\n \n {account.get('display_name')}\n {account.get('username')}\n \n );\n }\n\n let buttons;\n\n if (onActionClick && actionIcon) {\n buttons = ;\n } else if (account.get('id') !== me && account.get('relationship', null) !== null) {\n const following = account.getIn(['relationship', 'following']);\n const requested = account.getIn(['relationship', 'requested']);\n const blocking = account.getIn(['relationship', 'blocking']);\n const muting = account.getIn(['relationship', 'muting']);\n\n if (requested) {\n buttons = ;\n } else if (blocking) {\n buttons = ;\n } else if (muting) {\n let hidingNotificationsButton;\n if (account.getIn(['relationship', 'muting_notifications'])) {\n hidingNotificationsButton = ;\n } else {\n hidingNotificationsButton = ;\n }\n buttons = (\n \n \n {hidingNotificationsButton}\n \n );\n } else if (!account.get('moved') || following) {\n buttons = ;\n }\n }\n\n return (\n \n
\n
\n \n \n \n\n
\n {buttons}\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { makeGetAccount } from '../selectors';\nimport Account from '../components/account';\nimport {\n followAccount,\n unfollowAccount,\n blockAccount,\n unblockAccount,\n muteAccount,\n unmuteAccount,\n} from '../actions/accounts';\nimport { openModal } from '../actions/modal';\nimport { initMuteModal } from '../actions/mutes';\nimport { unfollowModal } from '../initial_state';\n\nconst messages = defineMessages({\n unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, props) => ({\n account: getAccount(state, props.id),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onFollow (account) {\n if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {\n if (unfollowModal) {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.unfollowConfirm),\n onConfirm: () => dispatch(unfollowAccount(account.get('id'))),\n }));\n } else {\n dispatch(unfollowAccount(account.get('id')));\n }\n } else {\n dispatch(followAccount(account.get('id')));\n }\n },\n\n onBlock (account) {\n if (account.getIn(['relationship', 'blocking'])) {\n dispatch(unblockAccount(account.get('id')));\n } else {\n dispatch(blockAccount(account.get('id')));\n }\n },\n\n onMute (account) {\n if (account.getIn(['relationship', 'muting'])) {\n dispatch(unmuteAccount(account.get('id')));\n } else {\n dispatch(initMuteModal(account));\n }\n },\n\n\n onMuteNotifications (account, notifications) {\n dispatch(muteAccount(account.get('id'), notifications));\n },\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Account));\n","var core = module.exports = {\n version: '2.6.1'\n};\nif (typeof __e == 'number') __e = core; // eslint-disable-line no-undef","var store = require('./_shared')('wks');\n\nvar uid = require('./_uid');\n\nvar Symbol = require('./_global').Symbol;\n\nvar USE_SYMBOL = typeof Symbol == 'function';\n\nvar $exports = module.exports = function (name) {\n return store[name] || (store[name] = USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));\n};\n\n$exports.store = store;","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nconst MissingIndicator = () => (\n \n);\n\nexport default MissingIndicator;\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\n\nconst MissingIndicator = () => (\n \n);\n\nexport default MissingIndicator;\n","import _extends from '../../polyfills/extends';\nimport React from 'react';\nimport data from '../../../data/all.json';\nimport NimbleEmoji from './nimble-emoji';\nimport { EmojiPropTypes, EmojiDefaultProps } from '../../utils/shared-props';\n\nvar Emoji = function Emoji(props) {\n for (var k in Emoji.defaultProps) {\n if (props[k] == undefined && Emoji.defaultProps[k] != undefined) {\n props[k] = Emoji.defaultProps[k];\n }\n }\n\n return NimbleEmoji(_extends({}, props));\n};\n\nEmoji.propTypes = EmojiPropTypes;\nEmoji.defaultProps = _extends({}, EmojiDefaultProps, {\n data: data\n});\nexport default Emoji;","import { connect } from 'react-redux';\nimport StatusList from 'flavours/glitch/components/status_list';\nimport { scrollTopTimeline, loadPending } from 'flavours/glitch/actions/timelines';\nimport { Map as ImmutableMap, List as ImmutableList } from 'immutable';\nimport { createSelector } from 'reselect';\nimport { debounce } from 'lodash';\nimport { me } from 'flavours/glitch/util/initial_state';\n\nconst getRegex = createSelector([\n (state, { type }) => state.getIn(['settings', type, 'regex', 'body']),\n], (rawRegex) => {\n let regex = null;\n\n try {\n regex = rawRegex && new RegExp(rawRegex.trim(), 'i');\n } catch (e) {\n // Bad regex, don't affect filters\n }\n return regex;\n});\n\nconst makeGetStatusIds = () => createSelector([\n (state, { type }) => state.getIn(['settings', type], ImmutableMap()),\n (state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),\n (state) => state.get('statuses'),\n getRegex,\n], (columnSettings, statusIds, statuses, regex) => {\n const rawRegex = columnSettings.getIn(['regex', 'body'], '').trim();\n\n return statusIds.filter(id => {\n if (id === null) return true;\n\n const statusForId = statuses.get(id);\n let showStatus = true;\n\n if (columnSettings.getIn(['shows', 'reblog']) === false) {\n showStatus = showStatus && statusForId.get('reblog') === null;\n }\n\n if (columnSettings.getIn(['shows', 'reply']) === false) {\n showStatus = showStatus && (statusForId.get('in_reply_to_id') === null || statusForId.get('in_reply_to_account_id') === me);\n }\n\n if (columnSettings.getIn(['shows', 'direct']) === false) {\n showStatus = showStatus && statusForId.get('visibility') !== 'direct';\n }\n\n if (showStatus && regex && statusForId.get('account') !== me) {\n const searchIndex = statusForId.get('reblog') ? statuses.getIn([statusForId.get('reblog'), 'search_index']) : statusForId.get('search_index');\n showStatus = !regex.test(searchIndex);\n }\n\n return showStatus;\n });\n});\n\nconst makeMapStateToProps = () => {\n const getStatusIds = makeGetStatusIds();\n\n const mapStateToProps = (state, { timelineId }) => ({\n statusIds: getStatusIds(state, { type: timelineId }),\n isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),\n isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),\n hasMore: state.getIn(['timelines', timelineId, 'hasMore']),\n numPending: state.getIn(['timelines', timelineId, 'pendingItems'], ImmutableList()).size,\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { timelineId }) => ({\n\n onScrollToTop: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, true));\n }, 100),\n\n onScroll: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, false));\n }, 100),\n\n onLoadPending: () => dispatch(loadPending(timelineId)),\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(StatusList);\n","var _Object = Object;\nexport default _Object.assign || 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};","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self // eslint-disable-next-line no-new-func\n: Function('return this')();\nif (typeof __g == 'number') __g = global; // eslint-disable-line no-undef","import { debounce } from 'lodash';\nimport React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport StatusContainer from 'flavours/glitch/containers/status_container';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport LoadGap from './load_gap';\nimport ScrollableList from './scrollable_list';\nimport { FormattedMessage } from 'react-intl';\n\nexport default class StatusList extends ImmutablePureComponent {\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n statusIds: ImmutablePropTypes.list.isRequired,\n featuredStatusIds: ImmutablePropTypes.list,\n onLoadMore: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n isPartial: PropTypes.bool,\n hasMore: PropTypes.bool,\n prepend: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n emptyMessage: PropTypes.node,\n timelineId: PropTypes.string.isRequired,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n getFeaturedStatusCount = () => {\n return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0;\n }\n\n getCurrentStatusIndex = (id, featured) => {\n if (featured) {\n return this.props.featuredStatusIds.indexOf(id);\n } else {\n return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount();\n }\n }\n\n handleMoveUp = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) - 1;\n this._selectChild(elementIndex, true);\n }\n\n handleMoveDown = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) + 1;\n this._selectChild(elementIndex, false);\n }\n\n handleLoadOlder = debounce(() => {\n this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);\n }, 300, { leading: true })\n\n _selectChild (index, align_top) {\n const container = this.node.node;\n const element = container.querySelector(`article:nth-of-type(${index + 1}) .focusable`);\n\n if (element) {\n if (align_top && container.scrollTop > element.offsetTop) {\n element.scrollIntoView(true);\n } else if (!align_top && container.scrollTop + container.clientHeight < element.offsetTop + element.offsetHeight) {\n element.scrollIntoView(false);\n }\n element.focus();\n }\n }\n\n setRef = c => {\n this.node = c;\n }\n\n render () {\n const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props;\n const { isLoading, isPartial } = other;\n\n if (isPartial) {\n return (\n \n );\n }\n\n let scrollableContent = (isLoading || statusIds.size > 0) ? (\n statusIds.map((statusId, index) => statusId === null ? (\n 0 ? statusIds.get(index - 1) : null}\n onClick={onLoadMore}\n />\n ) : (\n \n ))\n ) : null;\n\n if (scrollableContent && featuredStatusIds) {\n scrollableContent = featuredStatusIds.map(statusId => (\n \n )).concat(scrollableContent);\n }\n\n return (\n \n {scrollableContent}\n \n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport StatusList from '../../../components/status_list';\nimport { scrollTopTimeline, loadPending } from '../../../actions/timelines';\nimport { Map as ImmutableMap, List as ImmutableList } from 'immutable';\nimport { createSelector } from 'reselect';\nimport { debounce } from 'lodash';\nimport { me } from '../../../initial_state';\n\nconst makeGetStatusIds = () => createSelector([\n (state, { type }) => state.getIn(['settings', type], ImmutableMap()),\n (state, { type }) => state.getIn(['timelines', type, 'items'], ImmutableList()),\n (state) => state.get('statuses'),\n], (columnSettings, statusIds, statuses) => {\n return statusIds.filter(id => {\n if (id === null) return true;\n\n const statusForId = statuses.get(id);\n let showStatus = true;\n\n if (columnSettings.getIn(['shows', 'reblog']) === false) {\n showStatus = showStatus && statusForId.get('reblog') === null;\n }\n\n if (columnSettings.getIn(['shows', 'reply']) === false) {\n showStatus = showStatus && (statusForId.get('in_reply_to_id') === null || statusForId.get('in_reply_to_account_id') === me);\n }\n\n return showStatus;\n });\n});\n\nconst makeMapStateToProps = () => {\n const getStatusIds = makeGetStatusIds();\n\n const mapStateToProps = (state, { timelineId }) => ({\n statusIds: getStatusIds(state, { type: timelineId }),\n isLoading: state.getIn(['timelines', timelineId, 'isLoading'], true),\n isPartial: state.getIn(['timelines', timelineId, 'isPartial'], false),\n hasMore: state.getIn(['timelines', timelineId, 'hasMore']),\n numPending: state.getIn(['timelines', timelineId, 'pendingItems'], ImmutableList()).size,\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { timelineId }) => ({\n\n onScrollToTop: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, true));\n }, 100),\n\n onScroll: debounce(() => {\n dispatch(scrollTopTimeline(timelineId, false));\n }, 100),\n\n onLoadPending: () => dispatch(loadPending(timelineId)),\n\n});\n\nexport default connect(makeMapStateToProps, mapDispatchToProps)(StatusList);\n","var _String = String;\nexport default _String.fromCodePoint || function stringFromCodePoint() {\n var MAX_SIZE = 0x4000;\n var codeUnits = [];\n var highSurrogate;\n var lowSurrogate;\n var index = -1;\n var length = arguments.length;\n\n if (!length) {\n return '';\n }\n\n var result = '';\n\n while (++index < length) {\n var codePoint = Number(arguments[index]);\n\n if (!isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity`\n codePoint < 0 || // not a valid Unicode code point\n codePoint > 0x10ffff || // not a valid Unicode code point\n Math.floor(codePoint) != codePoint // not an integer\n ) {\n throw RangeError('Invalid code point: ' + codePoint);\n }\n\n if (codePoint <= 0xffff) {\n // BMP code point\n codeUnits.push(codePoint);\n } else {\n // Astral code point; split in surrogate halves\n // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n codePoint -= 0x10000;\n highSurrogate = (codePoint >> 10) + 0xd800;\n lowSurrogate = codePoint % 0x400 + 0xdc00;\n codeUnits.push(highSurrogate, lowSurrogate);\n }\n\n if (index + 1 === length || codeUnits.length > MAX_SIZE) {\n result += String.fromCharCode.apply(null, codeUnits);\n codeUnits.length = 0;\n }\n }\n\n return result;\n};","import _Object$keys from 'babel-runtime/core-js/object/keys';\nimport { buildSearch } from './data';\nimport stringFromCodePoint from '../polyfills/stringFromCodePoint';\nvar _JSON = JSON;\nvar COLONS_REGEX = /^(?:\\:([^\\:]+)\\:)(?:\\:skin-tone-(\\d)\\:)?$/;\nvar SKINS = ['1F3FA', '1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF'];\n\nfunction unifiedToNative(unified) {\n var unicodes = unified.split('-'),\n codePoints = unicodes.map(function (u) {\n return '0x' + u;\n });\n return stringFromCodePoint.apply(null, codePoints);\n}\n\nfunction sanitize(emoji) {\n var name = emoji.name;\n var short_names = emoji.short_names;\n var skin_tone = emoji.skin_tone;\n var skin_variations = emoji.skin_variations;\n var emoticons = emoji.emoticons;\n var unified = emoji.unified;\n var custom = emoji.custom;\n var customCategory = emoji.customCategory;\n var imageUrl = emoji.imageUrl;\n var id = emoji.id || short_names[0];\n var colons = ':' + id + ':';\n\n if (custom) {\n return {\n id: id,\n name: name,\n colons: colons,\n emoticons: emoticons,\n custom: custom,\n customCategory: customCategory,\n imageUrl: imageUrl\n };\n }\n\n if (skin_tone) {\n colons += ':skin-tone-' + skin_tone + ':';\n }\n\n return {\n id: id,\n name: name,\n colons: colons,\n emoticons: emoticons,\n unified: unified.toLowerCase(),\n skin: skin_tone || (skin_variations ? 1 : null),\n native: unifiedToNative(unified)\n };\n}\n\nfunction getSanitizedData() {\n return sanitize(getData.apply(undefined, arguments));\n}\n\nfunction getData(emoji, skin, set, data) {\n var emojiData = {};\n\n if (typeof emoji == 'string') {\n var matches = emoji.match(COLONS_REGEX);\n\n if (matches) {\n emoji = matches[1];\n\n if (matches[2]) {\n skin = parseInt(matches[2], 10);\n }\n }\n\n if (data.aliases.hasOwnProperty(emoji)) {\n emoji = data.aliases[emoji];\n }\n\n if (data.emojis.hasOwnProperty(emoji)) {\n emojiData = data.emojis[emoji];\n } else {\n return null;\n }\n } else if (emoji.id) {\n if (data.aliases.hasOwnProperty(emoji.id)) {\n emoji.id = data.aliases[emoji.id];\n }\n\n if (data.emojis.hasOwnProperty(emoji.id)) {\n emojiData = data.emojis[emoji.id];\n skin || (skin = emoji.skin);\n }\n }\n\n if (!_Object$keys(emojiData).length) {\n emojiData = emoji;\n emojiData.custom = true;\n\n if (!emojiData.search) {\n emojiData.search = buildSearch(emoji);\n }\n }\n\n emojiData.emoticons || (emojiData.emoticons = []);\n emojiData.variations || (emojiData.variations = []);\n\n if (emojiData.skin_variations && skin > 1 && set) {\n emojiData = JSON.parse(_JSON.stringify(emojiData));\n var skinKey = SKINS[skin - 1],\n variationData = emojiData.skin_variations[skinKey];\n\n if (!variationData.variations && emojiData.variations) {\n delete emojiData.variations;\n }\n\n if (variationData['has_img_' + set] == undefined || variationData['has_img_' + set]) {\n emojiData.skin_tone = skin;\n\n for (var k in variationData) {\n var v = variationData[k];\n emojiData[k] = v;\n }\n }\n }\n\n if (emojiData.variations && emojiData.variations.length) {\n emojiData = JSON.parse(_JSON.stringify(emojiData));\n emojiData.unified = emojiData.variations.shift();\n }\n\n return emojiData;\n}\n\nfunction uniq(arr) {\n return arr.reduce(function (acc, item) {\n if (acc.indexOf(item) === -1) {\n acc.push(item);\n }\n\n return acc;\n }, []);\n}\n\nfunction intersect(a, b) {\n var uniqA = uniq(a);\n var uniqB = uniq(b);\n return uniqA.filter(function (item) {\n return uniqB.indexOf(item) >= 0;\n });\n}\n\nfunction deepMerge(a, b) {\n var o = {};\n\n for (var key in a) {\n var originalValue = a[key],\n value = originalValue;\n\n if (b.hasOwnProperty(key)) {\n value = b[key];\n }\n\n if (typeof value === 'object') {\n value = deepMerge(originalValue, value);\n }\n\n o[key] = value;\n }\n\n return o;\n} // https://github.com/sonicdoe/measure-scrollbar\n\n\nfunction measureScrollbar() {\n if (typeof document == 'undefined') return 0;\n var div = document.createElement('div');\n div.style.width = '100px';\n div.style.height = '100px';\n div.style.overflow = 'scroll';\n div.style.position = 'absolute';\n div.style.top = '-9999px';\n document.body.appendChild(div);\n var scrollbarWidth = div.offsetWidth - div.clientWidth;\n document.body.removeChild(div);\n return scrollbarWidth;\n}\n\nexport { getData, getSanitizedData, uniq, intersect, deepMerge, unifiedToNative, measureScrollbar };","var global = require('./_global');\n\nvar core = require('./_core');\n\nvar ctx = require('./_ctx');\n\nvar hide = require('./_hide');\n\nvar has = require('./_has');\n\nvar PROTOTYPE = 'prototype';\n\nvar $export = function $export(type, name, source) {\n var IS_FORCED = type & $export.F;\n var IS_GLOBAL = type & $export.G;\n var IS_STATIC = type & $export.S;\n var IS_PROTO = type & $export.P;\n var IS_BIND = type & $export.B;\n var IS_WRAP = type & $export.W;\n var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});\n var expProto = exports[PROTOTYPE];\n var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];\n var key, own, out;\n if (IS_GLOBAL) source = name;\n\n for (key in source) {\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if (own && has(exports, key)) continue; // export native or passed\n\n out = own ? target[key] : source[key]; // prevent global pollution for namespaces\n\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key] // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global) // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? function (C) {\n var F = function F(a, b, c) {\n if (this instanceof C) {\n switch (arguments.length) {\n case 0:\n return new C();\n\n case 1:\n return new C(a);\n\n case 2:\n return new C(a, b);\n }\n\n return new C(a, b, c);\n }\n\n return C.apply(this, arguments);\n };\n\n F[PROTOTYPE] = C[PROTOTYPE];\n return F; // make static versions for prototype methods\n }(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n\n if (IS_PROTO) {\n (exports.virtual || (exports.virtual = {}))[key] = out; // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n\n if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);\n }\n }\n}; // type bitmap\n\n\n$export.F = 1; // forced\n\n$export.G = 2; // global\n\n$export.S = 4; // static\n\n$export.P = 8; // proto\n\n$export.B = 16; // bind\n\n$export.W = 32; // wrap\n\n$export.U = 64; // safe\n\n$export.R = 128; // real proto method for `library`\n\nmodule.exports = $export;","var dP = require('./_object-dp');\n\nvar createDesc = require('./_property-desc');\n\nmodule.exports = require('./_descriptors') ? function (object, key, value) {\n return dP.f(object, key, createDesc(1, value));\n} : function (object, key, value) {\n object[key] = value;\n return object;\n};","var anObject = require('./_an-object');\n\nvar IE8_DOM_DEFINE = require('./_ie8-dom-define');\n\nvar toPrimitive = require('./_to-primitive');\n\nvar dP = Object.defineProperty;\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes) {\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if (IE8_DOM_DEFINE) try {\n return dP(O, P, Attributes);\n } catch (e) {\n /* empty */\n }\n if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');\n if ('value' in Attributes) O[P] = Attributes.value;\n return O;\n};","var isObject = require('./_is-object');\n\nmodule.exports = function (it) {\n if (!isObject(it)) throw TypeError(it + ' is not an object!');\n return it;\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function () {\n return Object.defineProperty({}, 'a', {\n get: function get() {\n return 7;\n }\n }).a != 7;\n});","var hasOwnProperty = {}.hasOwnProperty;\n\nmodule.exports = function (it, key) {\n return hasOwnProperty.call(it, key);\n};","var mapping = {\n name: 'a',\n unified: 'b',\n non_qualified: 'c',\n has_img_apple: 'd',\n has_img_google: 'e',\n has_img_twitter: 'f',\n has_img_emojione: 'g',\n has_img_facebook: 'h',\n has_img_messenger: 'i',\n keywords: 'j',\n sheet: 'k',\n emoticons: 'l',\n text: 'm',\n short_names: 'n',\n added_in: 'o'\n};\n\nvar buildSearch = function buildSearch(emoji) {\n var search = [];\n\n var addToSearch = function addToSearch(strings, split) {\n if (!strings) {\n return;\n }\n\n ;\n (Array.isArray(strings) ? strings : [strings]).forEach(function (string) {\n ;\n (split ? string.split(/[-|_|\\s]+/) : [string]).forEach(function (s) {\n s = s.toLowerCase();\n\n if (search.indexOf(s) == -1) {\n search.push(s);\n }\n });\n });\n };\n\n addToSearch(emoji.short_names, true);\n addToSearch(emoji.name, true);\n addToSearch(emoji.keywords, false);\n addToSearch(emoji.emoticons, false);\n return search.join(',');\n};\n\nvar compress = function compress(emoji) {\n emoji.short_names = emoji.short_names.filter(function (short_name) {\n return short_name !== emoji.short_name;\n });\n delete emoji.short_name;\n emoji.sheet = [emoji.sheet_x, emoji.sheet_y];\n delete emoji.sheet_x;\n delete emoji.sheet_y;\n emoji.added_in = parseInt(emoji.added_in);\n\n if (emoji.added_in === 6) {\n delete emoji.added_in;\n }\n\n for (var key in mapping) {\n emoji[mapping[key]] = emoji[key];\n delete emoji[key];\n }\n\n for (var _key in emoji) {\n var value = emoji[_key];\n\n if (Array.isArray(value) && !value.length) {\n delete emoji[_key];\n } else if (typeof value === 'string' && !value.length) {\n delete emoji[_key];\n } else if (value === null) {\n delete emoji[_key];\n }\n }\n};\n\nvar uncompress = function uncompress(data) {\n data.compressed = false;\n\n for (var id in data.emojis) {\n var emoji = data.emojis[id];\n\n for (var key in mapping) {\n emoji[key] = emoji[mapping[key]];\n delete emoji[mapping[key]];\n }\n\n if (!emoji.short_names) emoji.short_names = [];\n emoji.short_names.unshift(id);\n emoji.sheet_x = emoji.sheet[0];\n emoji.sheet_y = emoji.sheet[1];\n delete emoji.sheet;\n if (!emoji.text) emoji.text = '';\n if (!emoji.added_in) emoji.added_in = 6;\n emoji.added_in = emoji.added_in.toFixed(1);\n emoji.search = buildSearch(emoji);\n }\n};\n\nmodule.exports = {\n buildSearch: buildSearch,\n compress: compress,\n uncompress: uncompress\n};","import PropTypes from 'prop-types';\nvar EmojiPropTypes = {\n data: PropTypes.object.isRequired,\n onOver: PropTypes.func,\n onLeave: PropTypes.func,\n onClick: PropTypes.func,\n fallback: PropTypes.func,\n backgroundImageFn: PropTypes.func,\n native: PropTypes.bool,\n forceSize: PropTypes.bool,\n tooltip: PropTypes.bool,\n skin: PropTypes.oneOf([1, 2, 3, 4, 5, 6]),\n sheetSize: PropTypes.oneOf([16, 20, 32, 64]),\n set: PropTypes.oneOf(['apple', 'google', 'twitter', 'emojione', 'messenger', 'facebook']),\n size: PropTypes.number.isRequired,\n emoji: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired\n};\nvar EmojiDefaultProps = {\n skin: 1,\n set: 'apple',\n sheetSize: 64,\n native: false,\n forceSize: false,\n tooltip: false,\n backgroundImageFn: function backgroundImageFn(set, sheetSize) {\n return 'https://unpkg.com/emoji-datasource-' + set + '@' + '4.0.4' + '/img/' + set + '/sheets-256/' + sheetSize + '.png';\n },\n onOver: function onOver() {},\n onLeave: function onLeave() {},\n onClick: function onClick() {}\n};\nvar PickerPropTypes = {\n onClick: PropTypes.func,\n onSelect: PropTypes.func,\n onSkinChange: PropTypes.func,\n perLine: PropTypes.number,\n emojiSize: PropTypes.number,\n i18n: PropTypes.object,\n style: PropTypes.object,\n title: PropTypes.string,\n emoji: PropTypes.string,\n color: PropTypes.string,\n set: EmojiPropTypes.set,\n skin: EmojiPropTypes.skin,\n native: PropTypes.bool,\n backgroundImageFn: EmojiPropTypes.backgroundImageFn,\n sheetSize: EmojiPropTypes.sheetSize,\n emojisToShowFilter: PropTypes.func,\n showPreview: PropTypes.bool,\n showSkinTones: PropTypes.bool,\n emojiTooltip: EmojiPropTypes.tooltip,\n include: PropTypes.arrayOf(PropTypes.string),\n exclude: PropTypes.arrayOf(PropTypes.string),\n recent: PropTypes.arrayOf(PropTypes.string),\n autoFocus: PropTypes.bool,\n custom: PropTypes.arrayOf(PropTypes.shape({\n name: PropTypes.string.isRequired,\n short_names: PropTypes.arrayOf(PropTypes.string).isRequired,\n emoticons: PropTypes.arrayOf(PropTypes.string),\n keywords: PropTypes.arrayOf(PropTypes.string),\n imageUrl: PropTypes.string.isRequired\n }))\n};\nvar PickerDefaultProps = {\n onClick: function onClick() {},\n onSelect: function onSelect() {},\n onSkinChange: function onSkinChange() {},\n emojiSize: 24,\n perLine: 9,\n i18n: {},\n style: {},\n title: 'Emoji Mart™',\n emoji: 'department_store',\n color: '#ae65c5',\n set: EmojiDefaultProps.set,\n skin: null,\n defaultSkin: EmojiDefaultProps.skin,\n native: EmojiDefaultProps.native,\n sheetSize: EmojiDefaultProps.sheetSize,\n backgroundImageFn: EmojiDefaultProps.backgroundImageFn,\n emojisToShowFilter: null,\n showPreview: true,\n showSkinTones: true,\n emojiTooltip: EmojiDefaultProps.tooltip,\n autoFocus: false,\n custom: []\n};\nexport { EmojiPropTypes, EmojiDefaultProps, PickerPropTypes, PickerDefaultProps };","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class LoadMore extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n visible: PropTypes.bool,\n }\n\n static defaultProps = {\n visible: true,\n }\n\n render() {\n const { disabled, visible } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ColumnHeader from '../../../components/column_header';\nimport { injectIntl, defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n profile: { id: 'column_header.profile', defaultMessage: 'Profile' },\n});\n\nexport default @injectIntl\nclass ProfileColumnHeader extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n intl: PropTypes.object.isRequired,\n };\n\n render() {\n const { onClick, intl } = this.props;\n\n return (\n \n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport Status from '../components/status';\nimport { makeGetStatus } from '../selectors';\nimport {\n replyCompose,\n mentionCompose,\n directCompose,\n} from '../actions/compose';\nimport {\n reblog,\n favourite,\n unreblog,\n unfavourite,\n pin,\n unpin,\n} from '../actions/interactions';\nimport {\n muteStatus,\n unmuteStatus,\n deleteStatus,\n hideStatus,\n revealStatus,\n} from '../actions/statuses';\nimport { initMuteModal } from '../actions/mutes';\nimport { initBlockModal } from '../actions/blocks';\nimport { initReport } from '../actions/reports';\nimport { openModal } from '../actions/modal';\nimport { defineMessages, injectIntl } from 'react-intl';\nimport { boostModal, deleteModal } from '../initial_state';\nimport { showAlertForError } from '../actions/alerts';\n\nconst messages = defineMessages({\n deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },\n deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },\n redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' },\n redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? Favourites and boosts will be lost, and replies to the original post will be orphaned.' },\n replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },\n replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },\n});\n\nconst makeMapStateToProps = () => {\n const getStatus = makeGetStatus();\n\n const mapStateToProps = (state, props) => ({\n status: getStatus(state, props),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onReply (status, router) {\n dispatch((_, getState) => {\n let state = getState();\n\n if (state.getIn(['compose', 'text']).trim().length !== 0) {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.replyMessage),\n confirm: intl.formatMessage(messages.replyConfirm),\n onConfirm: () => dispatch(replyCompose(status, router)),\n }));\n } else {\n dispatch(replyCompose(status, router));\n }\n });\n },\n\n onModalReblog (status) {\n if (status.get('reblogged')) {\n dispatch(unreblog(status));\n } else {\n dispatch(reblog(status));\n }\n },\n\n onReblog (status, e) {\n if ((e && e.shiftKey) || !boostModal) {\n this.onModalReblog(status);\n } else {\n dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));\n }\n },\n\n onFavourite (status) {\n if (status.get('favourited')) {\n dispatch(unfavourite(status));\n } else {\n dispatch(favourite(status));\n }\n },\n\n onPin (status) {\n if (status.get('pinned')) {\n dispatch(unpin(status));\n } else {\n dispatch(pin(status));\n }\n },\n\n onEmbed (status) {\n dispatch(openModal('EMBED', {\n url: status.get('url'),\n onError: error => dispatch(showAlertForError(error)),\n }));\n },\n\n onDelete (status, history, withRedraft = false) {\n if (!deleteModal) {\n dispatch(deleteStatus(status.get('id'), history, withRedraft));\n } else {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(withRedraft ? messages.redraftMessage : messages.deleteMessage),\n confirm: intl.formatMessage(withRedraft ? messages.redraftConfirm : messages.deleteConfirm),\n onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)),\n }));\n }\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onOpenMedia (media, index) {\n dispatch(openModal('MEDIA', { media, index }));\n },\n\n onOpenVideo (media, time) {\n dispatch(openModal('VIDEO', { media, time }));\n },\n\n onBlock (status) {\n const account = status.get('account');\n dispatch(initBlockModal(account));\n },\n\n onReport (status) {\n dispatch(initReport(status.get('account'), status));\n },\n\n onMute (account) {\n dispatch(initMuteModal(account));\n },\n\n onMuteConversation (status) {\n if (status.get('muted')) {\n dispatch(unmuteStatus(status.get('id')));\n } else {\n dispatch(muteStatus(status.get('id')));\n }\n },\n\n onToggleHidden (status) {\n if (status.get('hidden')) {\n dispatch(revealStatus(status.get('id')));\n } else {\n dispatch(hideStatus(status.get('id')));\n }\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));\n","import React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\n\nexport default class LoadMore extends React.PureComponent {\n\n static propTypes = {\n onClick: PropTypes.func,\n disabled: PropTypes.bool,\n visible: PropTypes.bool,\n }\n\n static defaultProps = {\n visible: true,\n }\n\n render() {\n const { disabled, visible } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import { debounce } from 'lodash';\nimport React from 'react';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport StatusContainer from '../containers/status_container';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport LoadGap from './load_gap';\nimport ScrollableList from './scrollable_list';\n\nexport default class StatusList extends ImmutablePureComponent {\n\n static propTypes = {\n scrollKey: PropTypes.string.isRequired,\n statusIds: ImmutablePropTypes.list.isRequired,\n featuredStatusIds: ImmutablePropTypes.list,\n onLoadMore: PropTypes.func,\n onScrollToTop: PropTypes.func,\n onScroll: PropTypes.func,\n trackScroll: PropTypes.bool,\n shouldUpdateScroll: PropTypes.func,\n isLoading: PropTypes.bool,\n isPartial: PropTypes.bool,\n hasMore: PropTypes.bool,\n prepend: PropTypes.node,\n emptyMessage: PropTypes.node,\n alwaysPrepend: PropTypes.bool,\n timelineId: PropTypes.string,\n };\n\n static defaultProps = {\n trackScroll: true,\n };\n\n getFeaturedStatusCount = () => {\n return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0;\n }\n\n getCurrentStatusIndex = (id, featured) => {\n if (featured) {\n return this.props.featuredStatusIds.indexOf(id);\n } else {\n return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount();\n }\n }\n\n handleMoveUp = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) - 1;\n this._selectChild(elementIndex, true);\n }\n\n handleMoveDown = (id, featured) => {\n const elementIndex = this.getCurrentStatusIndex(id, featured) + 1;\n this._selectChild(elementIndex, false);\n }\n\n handleLoadOlder = debounce(() => {\n this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined);\n }, 300, { leading: true })\n\n _selectChild (index, align_top) {\n const container = this.node.node;\n const element = container.querySelector(`article:nth-of-type(${index + 1}) .focusable`);\n\n if (element) {\n if (align_top && container.scrollTop > element.offsetTop) {\n element.scrollIntoView(true);\n } else if (!align_top && container.scrollTop + container.clientHeight < element.offsetTop + element.offsetHeight) {\n element.scrollIntoView(false);\n }\n element.focus();\n }\n }\n\n setRef = c => {\n this.node = c;\n }\n\n render () {\n const { statusIds, featuredStatusIds, shouldUpdateScroll, onLoadMore, timelineId, ...other } = this.props;\n const { isLoading, isPartial } = other;\n\n if (isPartial) {\n return (\n \n );\n }\n\n let scrollableContent = (isLoading || statusIds.size > 0) ? (\n statusIds.map((statusId, index) => statusId === null ? (\n 0 ? statusIds.get(index - 1) : null}\n onClick={onLoadMore}\n />\n ) : (\n \n ))\n ) : null;\n\n if (scrollableContent && featuredStatusIds) {\n scrollableContent = featuredStatusIds.map(statusId => (\n \n )).concat(scrollableContent);\n }\n\n return (\n \n {scrollableContent}\n \n );\n }\n\n}\n","var _Object = Object;\nexport default _Object.getPrototypeOf || function (O) {\n O = Object(O);\n\n if (typeof O.constructor === 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n }\n\n return O instanceof Object ? Object.prototype : null;\n};","var _Object = Object;\nexport default (function createClass() {\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\n _Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n})();","export default function possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === 'object' || typeof call === 'function') ? call : self;\n}","var _Object = Object;\nexport default function inherits(subClass, superClass) {\n if (typeof superClass !== 'function' && superClass !== null) {\n throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);\n }\n\n subClass.prototype = _Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n\n if (superClass) {\n _Object.setPrototypeOf ? _Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n }\n}","var NAMESPACE = 'emoji-mart';\nvar _JSON = JSON;\nvar isLocalStorageSupported = typeof window !== 'undefined' && 'localStorage' in window;\nvar getter = void 0;\nvar setter = void 0;\n\nfunction setHandlers(handlers) {\n handlers || (handlers = {});\n getter = handlers.getter;\n setter = handlers.setter;\n}\n\nfunction setNamespace(namespace) {\n NAMESPACE = namespace;\n}\n\nfunction update(state) {\n for (var key in state) {\n var value = state[key];\n set(key, value);\n }\n}\n\nfunction set(key, value) {\n if (setter) {\n setter(key, value);\n } else {\n if (!isLocalStorageSupported) return;\n\n try {\n window.localStorage[NAMESPACE + '.' + key] = _JSON.stringify(value);\n } catch (e) {}\n }\n}\n\nfunction get(key) {\n if (getter) {\n return getter(key);\n } else {\n if (!isLocalStorageSupported) return;\n\n try {\n var value = window.localStorage[NAMESPACE + '.' + key];\n } catch (e) {\n return;\n }\n\n if (value) {\n return JSON.parse(value);\n }\n }\n}\n\nexport default {\n update: update,\n set: set,\n get: get,\n setNamespace: setNamespace,\n setHandlers: setHandlers\n};","import store from './store';\nvar DEFAULTS = ['+1', 'grinning', 'kissing_heart', 'heart_eyes', 'laughing', 'stuck_out_tongue_winking_eye', 'sweat_smile', 'joy', 'scream', 'disappointed', 'unamused', 'weary', 'sob', 'sunglasses', 'heart', 'poop'];\nvar frequently = void 0,\n initialized = void 0;\nvar defaults = {};\n\nfunction init() {\n initialized = true;\n frequently = store.get('frequently');\n}\n\nfunction add(emoji) {\n if (!initialized) init();\n var id = emoji.id;\n frequently || (frequently = defaults);\n frequently[id] || (frequently[id] = 0);\n frequently[id] += 1;\n store.set('last', id);\n store.set('frequently', frequently);\n}\n\nfunction get(perLine) {\n if (!initialized) init();\n\n if (!frequently) {\n defaults = {};\n var result = [];\n\n for (var i = 0; i < perLine; i++) {\n defaults[DEFAULTS[i]] = perLine - i;\n result.push(DEFAULTS[i]);\n }\n\n return result;\n }\n\n var quantity = perLine * 4;\n var frequentlyKeys = [];\n\n for (var key in frequently) {\n if (frequently.hasOwnProperty(key)) {\n frequentlyKeys.push(key);\n }\n }\n\n var sorted = frequentlyKeys.sort(function (a, b) {\n return frequently[a] - frequently[b];\n }).reverse();\n var sliced = sorted.slice(0, quantity);\n var last = store.get('last');\n\n if (last && sliced.indexOf(last) == -1) {\n sliced.pop();\n sliced.push(last);\n }\n\n return sliced;\n}\n\nexport default {\n add: add,\n get: get\n};","var SVGs = {\n activity: \" \",\n custom: \" \",\n flags: \" \",\n foods: \" \",\n nature: \" \",\n objects: \" \",\n people: \" \",\n places: \" \",\n recent: \" \",\n symbols: \" \"\n};\nexport default SVGs;","import _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport SVGs from '../svgs';\n\nvar Anchors = function (_React$PureComponent) {\n _inherits(Anchors, _React$PureComponent);\n\n function Anchors(props) {\n _classCallCheck(this, Anchors);\n\n var _this = _possibleConstructorReturn(this, (Anchors.__proto__ || _Object$getPrototypeOf(Anchors)).call(this, props));\n\n var defaultCategory = props.categories.filter(function (category) {\n return category.first;\n })[0];\n _this.state = {\n selected: defaultCategory.name\n };\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Anchors, [{\n key: 'getSVG',\n value: function getSVG(id) {\n this.SVGs || (this.SVGs = {});\n\n if (this.SVGs[id]) {\n return this.SVGs[id];\n } else {\n var svg = '\\n ' + SVGs[id] + '\\n ';\n this.SVGs[id] = svg;\n return svg;\n }\n }\n }, {\n key: 'handleClick',\n value: function handleClick(e) {\n var index = e.currentTarget.getAttribute('data-index');\n var _props = this.props;\n var categories = _props.categories;\n var onAnchorClick = _props.onAnchorClick;\n onAnchorClick(categories[index], index);\n }\n }, {\n key: 'render',\n value: function render() {\n var _this2 = this;\n\n var _props2 = this.props;\n var categories = _props2.categories;\n var onAnchorClick = _props2.onAnchorClick;\n var color = _props2.color;\n var i18n = _props2.i18n;\n var selected = this.state.selected;\n return React.createElement('div', {\n className: 'emoji-mart-anchors'\n }, categories.map(function (category, i) {\n var id = category.id;\n var name = category.name;\n var anchor = category.anchor;\n var isSelected = name == selected;\n\n if (anchor === false) {\n return null;\n }\n\n var iconId = id.startsWith('custom-') ? 'custom' : id;\n return React.createElement('span', {\n key: id,\n title: i18n.categories[id],\n 'data-index': i,\n onClick: _this2.handleClick,\n className: 'emoji-mart-anchor ' + (isSelected ? 'emoji-mart-anchor-selected' : ''),\n style: {\n color: isSelected ? color : null\n }\n }, React.createElement('div', {\n dangerouslySetInnerHTML: {\n __html: _this2.getSVG(iconId)\n }\n }), React.createElement('span', {\n className: 'emoji-mart-anchor-bar',\n style: {\n backgroundColor: color\n }\n }));\n }));\n }\n }]);\n\n return Anchors;\n}(React.PureComponent);\n\nexport default Anchors;\nAnchors.defaultProps = {\n categories: [],\n onAnchorClick: function onAnchorClick() {}\n};","import _extends from '../polyfills/extends';\nimport _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport frequently from '../utils/frequently';\nimport { getData } from '../utils';\nimport { NimbleEmoji } from '.';\n\nvar Category = function (_React$Component) {\n _inherits(Category, _React$Component);\n\n function Category(props) {\n _classCallCheck(this, Category);\n\n var _this = _possibleConstructorReturn(this, (Category.__proto__ || _Object$getPrototypeOf(Category)).call(this, props));\n\n _this.data = props.data;\n _this.setContainerRef = _this.setContainerRef.bind(_this);\n _this.setLabelRef = _this.setLabelRef.bind(_this);\n return _this;\n }\n\n _createClass(Category, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.parent = this.container.parentNode;\n this.margin = 0;\n this.minMargin = 0;\n this.memoizeSize();\n }\n }, {\n key: 'shouldComponentUpdate',\n value: function shouldComponentUpdate(nextProps, nextState) {\n var _props = this.props;\n var name = _props.name;\n var perLine = _props.perLine;\n var native = _props.native;\n var hasStickyPosition = _props.hasStickyPosition;\n var emojis = _props.emojis;\n var emojiProps = _props.emojiProps;\n var skin = emojiProps.skin;\n var size = emojiProps.size;\n var set = emojiProps.set;\n var nextPerLine = nextProps.perLine;\n var nextNative = nextProps.native;\n var nextHasStickyPosition = nextProps.hasStickyPosition;\n var nextEmojis = nextProps.emojis;\n var nextEmojiProps = nextProps.emojiProps;\n var nextSkin = nextEmojiProps.skin;\n var nextSize = nextEmojiProps.size;\n var nextSet = nextEmojiProps.set;\n var shouldUpdate = false;\n\n if (name == 'Recent' && perLine != nextPerLine) {\n shouldUpdate = true;\n }\n\n if (name == 'Search') {\n shouldUpdate = !(emojis == nextEmojis);\n }\n\n if (skin != nextSkin || size != nextSize || native != nextNative || set != nextSet || hasStickyPosition != nextHasStickyPosition) {\n shouldUpdate = true;\n }\n\n return shouldUpdate;\n }\n }, {\n key: 'memoizeSize',\n value: function memoizeSize() {\n var _container$getBoundin = this.container.getBoundingClientRect();\n\n var top = _container$getBoundin.top;\n var height = _container$getBoundin.height;\n\n var _parent$getBoundingCl = this.parent.getBoundingClientRect();\n\n var parentTop = _parent$getBoundingCl.top;\n\n var _label$getBoundingCli = this.label.getBoundingClientRect();\n\n var labelHeight = _label$getBoundingCli.height;\n this.top = top - parentTop + this.parent.scrollTop;\n\n if (height == 0) {\n this.maxMargin = 0;\n } else {\n this.maxMargin = height - labelHeight;\n }\n }\n }, {\n key: 'handleScroll',\n value: function handleScroll(scrollTop) {\n var margin = scrollTop - this.top;\n margin = margin < this.minMargin ? this.minMargin : margin;\n margin = margin > this.maxMargin ? this.maxMargin : margin;\n if (margin == this.margin) return;\n\n if (!this.props.hasStickyPosition) {\n this.label.style.top = margin + 'px';\n }\n\n this.margin = margin;\n return true;\n }\n }, {\n key: 'getEmojis',\n value: function getEmojis() {\n var _this2 = this;\n\n var _props2 = this.props;\n var name = _props2.name;\n var emojis = _props2.emojis;\n var recent = _props2.recent;\n var perLine = _props2.perLine;\n\n if (name == 'Recent') {\n var custom = this.props.custom;\n var frequentlyUsed = recent || frequently.get(perLine);\n\n if (frequentlyUsed.length) {\n emojis = frequentlyUsed.map(function (id) {\n var emoji = custom.filter(function (e) {\n return e.id === id;\n })[0];\n\n if (emoji) {\n return emoji;\n }\n\n return id;\n }).filter(function (id) {\n return !!getData(id, null, null, _this2.data);\n });\n }\n\n if (emojis.length === 0 && frequentlyUsed.length > 0) {\n return null;\n }\n }\n\n if (emojis) {\n emojis = emojis.slice(0);\n }\n\n return emojis;\n }\n }, {\n key: 'updateDisplay',\n value: function updateDisplay(display) {\n var emojis = this.getEmojis();\n\n if (!emojis) {\n return;\n }\n\n this.container.style.display = display;\n }\n }, {\n key: 'setContainerRef',\n value: function setContainerRef(c) {\n this.container = c;\n }\n }, {\n key: 'setLabelRef',\n value: function setLabelRef(c) {\n this.label = c;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this3 = this;\n\n var _props3 = this.props;\n var id = _props3.id;\n var name = _props3.name;\n var hasStickyPosition = _props3.hasStickyPosition;\n var emojiProps = _props3.emojiProps;\n var i18n = _props3.i18n;\n var emojis = this.getEmojis();\n var labelStyles = {};\n var labelSpanStyles = {};\n var containerStyles = {};\n\n if (!emojis) {\n containerStyles = {\n display: 'none'\n };\n }\n\n if (!hasStickyPosition) {\n labelStyles = {\n height: 28\n };\n labelSpanStyles = {\n position: 'absolute'\n };\n }\n\n var label = i18n.categories[id] || name;\n return React.createElement('div', {\n ref: this.setContainerRef,\n className: 'emoji-mart-category ' + (emojis && !emojis.length ? 'emoji-mart-no-results' : ''),\n style: containerStyles\n }, React.createElement('div', {\n style: labelStyles,\n 'data-name': name,\n className: 'emoji-mart-category-label'\n }, React.createElement('span', {\n style: labelSpanStyles,\n ref: this.setLabelRef\n }, label)), emojis && emojis.map(function (emoji) {\n return NimbleEmoji(_extends({\n emoji: emoji,\n data: _this3.data\n }, emojiProps));\n }), emojis && !emojis.length && React.createElement('div', null, React.createElement('div', null, NimbleEmoji(_extends({\n data: this.data\n }, emojiProps, {\n size: 38,\n emoji: 'sleuth_or_spy',\n onOver: null,\n onLeave: null,\n onClick: null\n }))), React.createElement('div', {\n className: 'emoji-mart-no-results-label'\n }, i18n.notfound)));\n }\n }]);\n\n return Category;\n}(React.Component);\n\nexport default Category;\nCategory.defaultProps = {\n emojis: [],\n hasStickyPosition: true\n};","import _extends from '../polyfills/extends';\nimport _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport { getData } from '../utils';\nimport { NimbleEmoji, Skins } from '.';\n\nvar Preview = function (_React$PureComponent) {\n _inherits(Preview, _React$PureComponent);\n\n function Preview(props) {\n _classCallCheck(this, Preview);\n\n var _this = _possibleConstructorReturn(this, (Preview.__proto__ || _Object$getPrototypeOf(Preview)).call(this, props));\n\n _this.data = props.data;\n _this.state = {\n emoji: null\n };\n return _this;\n }\n\n _createClass(Preview, [{\n key: 'render',\n value: function render() {\n var emoji = this.state.emoji;\n var _props = this.props;\n var emojiProps = _props.emojiProps;\n var skinsProps = _props.skinsProps;\n var showSkinTones = _props.showSkinTones;\n var title = _props.title;\n var idleEmoji = _props.emoji;\n\n if (emoji) {\n var emojiData = getData(emoji, null, null, this.data);\n var _emojiData$emoticons = emojiData.emoticons;\n var emoticons = _emojiData$emoticons === undefined ? [] : _emojiData$emoticons;\n var knownEmoticons = [];\n var listedEmoticons = [];\n emoticons.forEach(function (emoticon) {\n if (knownEmoticons.indexOf(emoticon.toLowerCase()) >= 0) {\n return;\n }\n\n knownEmoticons.push(emoticon.toLowerCase());\n listedEmoticons.push(emoticon);\n });\n return React.createElement('div', {\n className: 'emoji-mart-preview'\n }, React.createElement('div', {\n className: 'emoji-mart-preview-emoji'\n }, NimbleEmoji(_extends({\n key: emoji.id,\n emoji: emoji,\n data: this.data\n }, emojiProps))), React.createElement('div', {\n className: 'emoji-mart-preview-data'\n }, React.createElement('div', {\n className: 'emoji-mart-preview-name'\n }, emoji.name), React.createElement('div', {\n className: 'emoji-mart-preview-shortnames'\n }, emojiData.short_names.map(function (short_name) {\n return React.createElement('span', {\n key: short_name,\n className: 'emoji-mart-preview-shortname'\n }, ':', short_name, ':');\n })), React.createElement('div', {\n className: 'emoji-mart-preview-emoticons'\n }, listedEmoticons.map(function (emoticon) {\n return React.createElement('span', {\n key: emoticon,\n className: 'emoji-mart-preview-emoticon'\n }, emoticon);\n }))));\n } else {\n return React.createElement('div', {\n className: 'emoji-mart-preview'\n }, React.createElement('div', {\n className: 'emoji-mart-preview-emoji'\n }, idleEmoji && idleEmoji.length && NimbleEmoji(_extends({\n emoji: idleEmoji,\n data: this.data\n }, emojiProps))), React.createElement('div', {\n className: 'emoji-mart-preview-data'\n }, React.createElement('span', {\n className: 'emoji-mart-title-label'\n }, title)), showSkinTones && React.createElement('div', {\n className: 'emoji-mart-preview-skins'\n }, React.createElement(Skins, skinsProps)));\n }\n }\n }]);\n\n return Preview;\n}(React.PureComponent);\n\nexport default Preview;\nPreview.defaultProps = {\n showSkinTones: true,\n onChange: function onChange() {}\n};","import _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../../polyfills/createClass';\nimport { getData, getSanitizedData, intersect } from '..';\nimport { uncompress } from '../data';\n\nvar NimbleEmojiIndex = function () {\n function NimbleEmojiIndex(data) {\n _classCallCheck(this, NimbleEmojiIndex);\n\n if (data.compressed) {\n uncompress(data);\n }\n\n this.data = data || {};\n this.originalPool = {};\n this.index = {};\n this.emojis = {};\n this.emoticons = {};\n this.customEmojisList = [];\n this.buildIndex();\n }\n\n _createClass(NimbleEmojiIndex, [{\n key: 'buildIndex',\n value: function buildIndex() {\n var _this = this;\n\n var _loop = function _loop(emoji) {\n var emojiData = _this.data.emojis[emoji];\n var short_names = emojiData.short_names;\n var emoticons = emojiData.emoticons;\n var id = short_names[0];\n\n if (emoticons) {\n emoticons.forEach(function (emoticon) {\n if (_this.emoticons[emoticon]) {\n return;\n }\n\n _this.emoticons[emoticon] = id;\n });\n }\n\n _this.emojis[id] = getSanitizedData(id, null, null, _this.data);\n _this.originalPool[id] = emojiData;\n };\n\n for (var emoji in this.data.emojis) {\n _loop(emoji);\n }\n }\n }, {\n key: 'clearCustomEmojis',\n value: function clearCustomEmojis(pool) {\n var _this2 = this;\n\n this.customEmojisList.forEach(function (emoji) {\n var emojiId = emoji.id || emoji.short_names[0];\n delete pool[emojiId];\n delete _this2.emojis[emojiId];\n });\n }\n }, {\n key: 'addCustomToPool',\n value: function addCustomToPool(custom, pool) {\n var _this3 = this;\n\n if (this.customEmojisList.length) this.clearCustomEmojis(pool);\n custom.forEach(function (emoji) {\n var emojiId = emoji.id || emoji.short_names[0];\n\n if (emojiId && !pool[emojiId]) {\n pool[emojiId] = getData(emoji, null, null, _this3.data);\n _this3.emojis[emojiId] = getSanitizedData(emoji, null, null, _this3.data);\n }\n });\n this.customEmojisList = custom;\n this.index = {};\n }\n }, {\n key: 'search',\n value: function search(value) {\n var _this4 = this;\n\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var emojisToShowFilter = _ref.emojisToShowFilter;\n var maxResults = _ref.maxResults;\n var include = _ref.include;\n var exclude = _ref.exclude;\n var _ref$custom = _ref.custom;\n var custom = _ref$custom === undefined ? [] : _ref$custom;\n if (this.customEmojisList != custom) this.addCustomToPool(custom, this.originalPool);\n maxResults || (maxResults = 75);\n include || (include = []);\n exclude || (exclude = []);\n var results = null,\n pool = this.originalPool;\n\n if (value.length) {\n if (value == '-' || value == '-1') {\n return [this.emojis['-1']];\n }\n\n var values = value.toLowerCase().split(/[\\s|,|\\-|_]+/),\n allResults = [];\n\n if (values.length > 2) {\n values = [values[0], values[1]];\n }\n\n if (include.length || exclude.length) {\n pool = {};\n this.data.categories.forEach(function (category) {\n var isIncluded = include && include.length ? include.indexOf(category.id) > -1 : true;\n var isExcluded = exclude && exclude.length ? exclude.indexOf(category.id) > -1 : false;\n\n if (!isIncluded || isExcluded) {\n return;\n }\n\n category.emojis.forEach(function (emojiId) {\n return pool[emojiId] = _this4.data.emojis[emojiId];\n });\n });\n\n if (custom.length) {\n var customIsIncluded = include && include.length ? include.indexOf('custom') > -1 : true;\n var customIsExcluded = exclude && exclude.length ? exclude.indexOf('custom') > -1 : false;\n\n if (customIsIncluded && !customIsExcluded) {\n this.addCustomToPool(custom, pool);\n }\n }\n }\n\n allResults = values.map(function (value) {\n var aPool = pool,\n aIndex = _this4.index,\n length = 0;\n\n for (var charIndex = 0; charIndex < value.length; charIndex++) {\n var char = value[charIndex];\n length++;\n aIndex[char] || (aIndex[char] = {});\n aIndex = aIndex[char];\n\n if (!aIndex.results) {\n (function () {\n var scores = {};\n aIndex.results = [];\n aIndex.pool = {};\n\n for (var _id in aPool) {\n var emoji = aPool[_id];\n var search = emoji.search;\n var sub = value.substr(0, length);\n var subIndex = search.indexOf(sub);\n\n if (subIndex != -1) {\n var score = subIndex + 1;\n if (sub == _id) score = 0;\n aIndex.results.push(_this4.emojis[_id]);\n aIndex.pool[_id] = emoji;\n scores[_id] = score;\n }\n }\n\n aIndex.results.sort(function (a, b) {\n var aScore = scores[a.id],\n bScore = scores[b.id];\n return aScore - bScore;\n });\n })();\n }\n\n aPool = aIndex.pool;\n }\n\n return aIndex.results;\n }).filter(function (a) {\n return a;\n });\n\n if (allResults.length > 1) {\n results = intersect.apply(null, allResults);\n } else if (allResults.length) {\n results = allResults[0];\n } else {\n results = [];\n }\n }\n\n if (results) {\n if (emojisToShowFilter) {\n results = results.filter(function (result) {\n return emojisToShowFilter(pool[result.id]);\n });\n }\n\n if (results && results.length > maxResults) {\n results = results.slice(0, maxResults);\n }\n }\n\n return results;\n }\n }]);\n\n return NimbleEmojiIndex;\n}();\n\nexport default NimbleEmojiIndex;","import _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport NimbleEmojiIndex from '../utils/emoji-index/nimble-emoji-index';\n\nvar Search = function (_React$PureComponent) {\n _inherits(Search, _React$PureComponent);\n\n function Search(props) {\n _classCallCheck(this, Search);\n\n var _this = _possibleConstructorReturn(this, (Search.__proto__ || _Object$getPrototypeOf(Search)).call(this, props));\n\n _this.data = props.data;\n _this.emojiIndex = new NimbleEmojiIndex(_this.data);\n _this.setRef = _this.setRef.bind(_this);\n _this.handleChange = _this.handleChange.bind(_this);\n return _this;\n }\n\n _createClass(Search, [{\n key: 'handleChange',\n value: function handleChange() {\n var value = this.input.value;\n this.props.onSearch(this.emojiIndex.search(value, {\n emojisToShowFilter: this.props.emojisToShowFilter,\n maxResults: this.props.maxResults,\n include: this.props.include,\n exclude: this.props.exclude,\n custom: this.props.custom\n }));\n }\n }, {\n key: 'setRef',\n value: function setRef(c) {\n this.input = c;\n }\n }, {\n key: 'clear',\n value: function clear() {\n this.input.value = '';\n }\n }, {\n key: 'render',\n value: function render() {\n var _props = this.props;\n var i18n = _props.i18n;\n var autoFocus = _props.autoFocus;\n return React.createElement('div', {\n className: 'emoji-mart-search'\n }, React.createElement('input', {\n ref: this.setRef,\n type: 'text',\n onChange: this.handleChange,\n placeholder: i18n.search,\n autoFocus: autoFocus\n }));\n }\n }]);\n\n return Search;\n}(React.PureComponent);\n\nexport default Search;\nSearch.defaultProps = {\n onSearch: function onSearch() {},\n maxResults: 75,\n emojisToShowFilter: null,\n autoFocus: false\n};","import _Object$getPrototypeOf from '../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../polyfills/createClass';\nimport _possibleConstructorReturn from '../polyfills/possibleConstructorReturn';\nimport _inherits from '../polyfills/inherits';\nimport React from 'react';\nimport PropTypes from 'prop-types';\n\nvar Skins = function (_React$PureComponent) {\n _inherits(Skins, _React$PureComponent);\n\n function Skins(props) {\n _classCallCheck(this, Skins);\n\n var _this = _possibleConstructorReturn(this, (Skins.__proto__ || _Object$getPrototypeOf(Skins)).call(this, props));\n\n _this.state = {\n opened: false\n };\n _this.handleClick = _this.handleClick.bind(_this);\n return _this;\n }\n\n _createClass(Skins, [{\n key: 'handleClick',\n value: function handleClick(e) {\n var skin = parseInt(e.currentTarget.getAttribute('data-skin'));\n var onChange = this.props.onChange;\n\n if (!this.state.opened) {\n this.setState({\n opened: true\n });\n } else {\n this.setState({\n opened: false\n });\n\n if (skin != this.props.skin) {\n onChange(skin);\n }\n }\n }\n }, {\n key: 'render',\n value: function render() {\n var skin = this.props.skin;\n var opened = this.state.opened;\n var skinToneNodes = [];\n\n for (var i = 0; i < 6; i++) {\n var skinTone = i + 1;\n var selected = skinTone == skin;\n skinToneNodes.push(React.createElement('span', {\n key: 'skin-tone-' + skinTone,\n className: 'emoji-mart-skin-swatch ' + (selected ? 'emoji-mart-skin-swatch-selected' : '')\n }, React.createElement('span', {\n onClick: this.handleClick,\n 'data-skin': skinTone,\n className: 'emoji-mart-skin emoji-mart-skin-tone-' + skinTone\n })));\n }\n\n return React.createElement('div', null, React.createElement('div', {\n className: 'emoji-mart-skin-swatches ' + (opened ? 'emoji-mart-skin-swatches-opened' : '')\n }, skinToneNodes));\n }\n }]);\n\n return Skins;\n}(React.PureComponent);\n\nexport default Skins;\nSkins.defaultProps = {\n onChange: function onChange() {}\n};","import _Object$values from 'babel-runtime/core-js/object/values';\nimport _toConsumableArray from 'babel-runtime/helpers/toConsumableArray';\nimport _extends from '../../polyfills/extends';\nimport _Object$getPrototypeOf from '../../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../../polyfills/createClass';\nimport _possibleConstructorReturn from '../../polyfills/possibleConstructorReturn';\nimport _inherits from '../../polyfills/inherits';\nimport '../../vendor/raf-polyfill';\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport store from '../../utils/store';\nimport frequently from '../../utils/frequently';\nimport { deepMerge, measureScrollbar } from '../../utils';\nimport { uncompress } from '../../utils/data';\nimport { PickerPropTypes, PickerDefaultProps } from '../../utils/shared-props';\nimport { Anchors, Category, Preview, Search } from '..';\nvar I18N = {\n search: 'Search',\n notfound: 'No Emoji Found',\n categories: {\n search: 'Search Results',\n recent: 'Frequently Used',\n people: 'Smileys & People',\n nature: 'Animals & Nature',\n foods: 'Food & Drink',\n activity: 'Activity',\n places: 'Travel & Places',\n objects: 'Objects',\n symbols: 'Symbols',\n flags: 'Flags',\n custom: 'Custom'\n }\n};\n\nvar NimblePicker = function (_React$PureComponent) {\n _inherits(NimblePicker, _React$PureComponent);\n\n function NimblePicker(props) {\n _classCallCheck(this, NimblePicker);\n\n var _this = _possibleConstructorReturn(this, (NimblePicker.__proto__ || _Object$getPrototypeOf(NimblePicker)).call(this, props));\n\n _this.CUSTOM = [];\n _this.RECENT_CATEGORY = {\n id: 'recent',\n name: 'Recent',\n emojis: null\n };\n _this.SEARCH_CATEGORY = {\n id: 'search',\n name: 'Search',\n emojis: null,\n anchor: false\n };\n\n if (props.data.compressed) {\n uncompress(props.data);\n }\n\n _this.data = props.data;\n _this.i18n = deepMerge(I18N, props.i18n);\n _this.state = {\n skin: props.skin || store.get('skin') || props.defaultSkin,\n firstRender: true\n };\n _this.categories = [];\n var allCategories = [].concat(_this.data.categories);\n\n if (props.custom.length > 0) {\n var customCategories = {};\n var customCategoriesCreated = 0;\n props.custom.forEach(function (emoji) {\n if (!customCategories[emoji.customCategory]) {\n customCategories[emoji.customCategory] = {\n id: emoji.customCategory ? 'custom-' + emoji.customCategory : 'custom',\n name: emoji.customCategory || 'Custom',\n emojis: [],\n anchor: customCategoriesCreated === 0\n };\n customCategoriesCreated++;\n }\n\n var category = customCategories[emoji.customCategory];\n\n var customEmoji = _extends({}, emoji, {\n // ` ` expects emoji to have an `id`.\n id: emoji.short_names[0],\n custom: true\n });\n\n category.emojis.push(customEmoji);\n\n _this.CUSTOM.push(customEmoji);\n });\n allCategories.push.apply(allCategories, _toConsumableArray(_Object$values(customCategories)));\n }\n\n _this.hideRecent = true;\n\n if (props.include != undefined) {\n allCategories.sort(function (a, b) {\n if (props.include.indexOf(a.id) > props.include.indexOf(b.id)) {\n return 1;\n }\n\n return -1;\n });\n }\n\n for (var categoryIndex = 0; categoryIndex < allCategories.length; categoryIndex++) {\n var category = allCategories[categoryIndex];\n var isIncluded = props.include && props.include.length ? props.include.indexOf(category.id) > -1 : true;\n var isExcluded = props.exclude && props.exclude.length ? props.exclude.indexOf(category.id) > -1 : false;\n\n if (!isIncluded || isExcluded) {\n continue;\n }\n\n if (props.emojisToShowFilter) {\n var newEmojis = [];\n var emojis = category.emojis;\n\n for (var emojiIndex = 0; emojiIndex < emojis.length; emojiIndex++) {\n var emoji = emojis[emojiIndex];\n\n if (props.emojisToShowFilter(_this.data.emojis[emoji] || emoji)) {\n newEmojis.push(emoji);\n }\n }\n\n if (newEmojis.length) {\n var newCategory = {\n emojis: newEmojis,\n name: category.name,\n id: category.id\n };\n\n _this.categories.push(newCategory);\n }\n } else {\n _this.categories.push(category);\n }\n }\n\n var includeRecent = props.include && props.include.length ? props.include.indexOf(_this.RECENT_CATEGORY.id) > -1 : true;\n var excludeRecent = props.exclude && props.exclude.length ? props.exclude.indexOf(_this.RECENT_CATEGORY.id) > -1 : false;\n\n if (includeRecent && !excludeRecent) {\n _this.hideRecent = false;\n\n _this.categories.unshift(_this.RECENT_CATEGORY);\n }\n\n if (_this.categories[0]) {\n _this.categories[0].first = true;\n }\n\n _this.categories.unshift(_this.SEARCH_CATEGORY);\n\n _this.setAnchorsRef = _this.setAnchorsRef.bind(_this);\n _this.handleAnchorClick = _this.handleAnchorClick.bind(_this);\n _this.setSearchRef = _this.setSearchRef.bind(_this);\n _this.handleSearch = _this.handleSearch.bind(_this);\n _this.setScrollRef = _this.setScrollRef.bind(_this);\n _this.handleScroll = _this.handleScroll.bind(_this);\n _this.handleScrollPaint = _this.handleScrollPaint.bind(_this);\n _this.handleEmojiOver = _this.handleEmojiOver.bind(_this);\n _this.handleEmojiLeave = _this.handleEmojiLeave.bind(_this);\n _this.handleEmojiClick = _this.handleEmojiClick.bind(_this);\n _this.handleEmojiSelect = _this.handleEmojiSelect.bind(_this);\n _this.setPreviewRef = _this.setPreviewRef.bind(_this);\n _this.handleSkinChange = _this.handleSkinChange.bind(_this);\n _this.handleKeyDown = _this.handleKeyDown.bind(_this);\n return _this;\n }\n\n _createClass(NimblePicker, [{\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(props) {\n if (props.skin) {\n this.setState({\n skin: props.skin\n });\n } else if (props.defaultSkin && !store.get('skin')) {\n this.setState({\n skin: props.defaultSkin\n });\n }\n }\n }, {\n key: 'componentDidMount',\n value: function componentDidMount() {\n var _this2 = this;\n\n if (this.state.firstRender) {\n this.testStickyPosition();\n this.firstRenderTimeout = setTimeout(function () {\n _this2.setState({\n firstRender: false\n });\n }, 60);\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate() {\n this.updateCategoriesSize();\n this.handleScroll();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.SEARCH_CATEGORY.emojis = null;\n clearTimeout(this.leaveTimeout);\n clearTimeout(this.firstRenderTimeout);\n }\n }, {\n key: 'testStickyPosition',\n value: function testStickyPosition() {\n var stickyTestElement = document.createElement('div');\n var prefixes = ['', '-webkit-', '-ms-', '-moz-', '-o-'];\n prefixes.forEach(function (prefix) {\n return stickyTestElement.style.position = prefix + 'sticky';\n });\n this.hasStickyPosition = !!stickyTestElement.style.position.length;\n }\n }, {\n key: 'handleEmojiOver',\n value: function handleEmojiOver(emoji) {\n var preview = this.preview;\n\n if (!preview) {\n return;\n } // Use Array.prototype.find() when it is more widely supported.\n\n\n var emojiData = this.CUSTOM.filter(function (customEmoji) {\n return customEmoji.id === emoji.id;\n })[0];\n\n for (var key in emojiData) {\n if (emojiData.hasOwnProperty(key)) {\n emoji[key] = emojiData[key];\n }\n }\n\n preview.setState({\n emoji: emoji\n });\n clearTimeout(this.leaveTimeout);\n }\n }, {\n key: 'handleEmojiLeave',\n value: function handleEmojiLeave(emoji) {\n var preview = this.preview;\n\n if (!preview) {\n return;\n }\n\n this.leaveTimeout = setTimeout(function () {\n preview.setState({\n emoji: null\n });\n }, 16);\n }\n }, {\n key: 'handleEmojiClick',\n value: function handleEmojiClick(emoji, e) {\n this.props.onClick(emoji, e);\n this.handleEmojiSelect(emoji);\n }\n }, {\n key: 'handleEmojiSelect',\n value: function handleEmojiSelect(emoji) {\n var _this3 = this;\n\n this.props.onSelect(emoji);\n if (!this.hideRecent && !this.props.recent) frequently.add(emoji);\n var component = this.categoryRefs['category-1'];\n\n if (component) {\n var maxMargin = component.maxMargin;\n component.forceUpdate();\n window.requestAnimationFrame(function () {\n if (!_this3.scroll) return;\n component.memoizeSize();\n if (maxMargin == component.maxMargin) return;\n\n _this3.updateCategoriesSize();\n\n _this3.handleScrollPaint();\n\n if (_this3.SEARCH_CATEGORY.emojis) {\n component.updateDisplay('none');\n }\n });\n }\n }\n }, {\n key: 'handleScroll',\n value: function handleScroll() {\n if (!this.waitingForPaint) {\n this.waitingForPaint = true;\n window.requestAnimationFrame(this.handleScrollPaint);\n }\n }\n }, {\n key: 'handleScrollPaint',\n value: function handleScrollPaint() {\n this.waitingForPaint = false;\n\n if (!this.scroll) {\n return;\n }\n\n var activeCategory = null;\n\n if (this.SEARCH_CATEGORY.emojis) {\n activeCategory = this.SEARCH_CATEGORY;\n } else {\n var target = this.scroll,\n scrollTop = target.scrollTop,\n scrollingDown = scrollTop > (this.scrollTop || 0),\n minTop = 0;\n\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var ii = scrollingDown ? this.categories.length - 1 - i : i,\n category = this.categories[ii],\n component = this.categoryRefs['category-' + ii];\n\n if (component) {\n var active = component.handleScroll(scrollTop);\n\n if (!minTop || component.top < minTop) {\n if (component.top > 0) {\n minTop = component.top;\n }\n }\n\n if (active && !activeCategory) {\n activeCategory = category;\n }\n }\n }\n\n if (scrollTop < minTop) {\n activeCategory = this.categories.filter(function (category) {\n return !(category.anchor === false);\n })[0];\n } else if (scrollTop + this.clientHeight >= this.scrollHeight) {\n activeCategory = this.categories[this.categories.length - 1];\n }\n }\n\n if (activeCategory) {\n var anchors = this.anchors;\n var _activeCategory = activeCategory;\n var categoryName = _activeCategory.name;\n\n if (anchors.state.selected != categoryName) {\n anchors.setState({\n selected: categoryName\n });\n }\n }\n\n this.scrollTop = scrollTop;\n }\n }, {\n key: 'handleSearch',\n value: function handleSearch(emojis) {\n this.SEARCH_CATEGORY.emojis = emojis;\n\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var component = this.categoryRefs['category-' + i];\n\n if (component && component.props.name != 'Search') {\n var display = emojis ? 'none' : 'inherit';\n component.updateDisplay(display);\n }\n }\n\n this.forceUpdate();\n this.scroll.scrollTop = 0;\n this.handleScroll();\n }\n }, {\n key: 'handleAnchorClick',\n value: function handleAnchorClick(category, i) {\n var component = this.categoryRefs['category-' + i];\n var scroll = this.scroll;\n var anchors = this.anchors;\n var scrollToComponent = null;\n\n scrollToComponent = function scrollToComponent() {\n if (component) {\n var top = component.top;\n\n if (category.first) {\n top = 0;\n } else {\n top += 1;\n }\n\n scroll.scrollTop = top;\n }\n };\n\n if (this.SEARCH_CATEGORY.emojis) {\n this.handleSearch(null);\n this.search.clear();\n window.requestAnimationFrame(scrollToComponent);\n } else {\n scrollToComponent();\n }\n }\n }, {\n key: 'handleSkinChange',\n value: function handleSkinChange(skin) {\n var newState = {\n skin: skin\n };\n var onSkinChange = this.props.onSkinChange;\n this.setState(newState);\n store.update(newState);\n onSkinChange(skin);\n }\n }, {\n key: 'handleKeyDown',\n value: function handleKeyDown(e) {\n var handled = false;\n\n switch (e.keyCode) {\n case 13:\n var emoji = void 0;\n\n if (this.SEARCH_CATEGORY.emojis && (emoji = this.SEARCH_CATEGORY.emojis[0])) {\n this.handleEmojiSelect(emoji);\n }\n\n handled = true;\n break;\n }\n\n if (handled) {\n e.preventDefault();\n }\n }\n }, {\n key: 'updateCategoriesSize',\n value: function updateCategoriesSize() {\n for (var i = 0, l = this.categories.length; i < l; i++) {\n var component = this.categoryRefs['category-' + i];\n if (component) component.memoizeSize();\n }\n\n if (this.scroll) {\n var target = this.scroll;\n this.scrollHeight = target.scrollHeight;\n this.clientHeight = target.clientHeight;\n }\n }\n }, {\n key: 'getCategories',\n value: function getCategories() {\n return this.state.firstRender ? this.categories.slice(0, 3) : this.categories;\n }\n }, {\n key: 'setAnchorsRef',\n value: function setAnchorsRef(c) {\n this.anchors = c;\n }\n }, {\n key: 'setSearchRef',\n value: function setSearchRef(c) {\n this.search = c;\n }\n }, {\n key: 'setPreviewRef',\n value: function setPreviewRef(c) {\n this.preview = c;\n }\n }, {\n key: 'setScrollRef',\n value: function setScrollRef(c) {\n this.scroll = c;\n }\n }, {\n key: 'setCategoryRef',\n value: function setCategoryRef(name, c) {\n if (!this.categoryRefs) {\n this.categoryRefs = {};\n }\n\n this.categoryRefs[name] = c;\n }\n }, {\n key: 'render',\n value: function render() {\n var _this4 = this;\n\n var _props = this.props;\n var perLine = _props.perLine;\n var emojiSize = _props.emojiSize;\n var set = _props.set;\n var sheetSize = _props.sheetSize;\n var style = _props.style;\n var title = _props.title;\n var emoji = _props.emoji;\n var color = _props.color;\n var native = _props.native;\n var backgroundImageFn = _props.backgroundImageFn;\n var emojisToShowFilter = _props.emojisToShowFilter;\n var showPreview = _props.showPreview;\n var showSkinTones = _props.showSkinTones;\n var emojiTooltip = _props.emojiTooltip;\n var include = _props.include;\n var exclude = _props.exclude;\n var recent = _props.recent;\n var autoFocus = _props.autoFocus;\n var skin = this.state.skin;\n var width = perLine * (emojiSize + 12) + 12 + 2 + measureScrollbar();\n return React.createElement('div', {\n style: _extends({\n width: width\n }, style),\n className: 'emoji-mart',\n onKeyDown: this.handleKeyDown\n }, React.createElement('div', {\n className: 'emoji-mart-bar'\n }, React.createElement(Anchors, {\n ref: this.setAnchorsRef,\n data: this.data,\n i18n: this.i18n,\n color: color,\n categories: this.categories,\n onAnchorClick: this.handleAnchorClick\n })), React.createElement(Search, {\n ref: this.setSearchRef,\n onSearch: this.handleSearch,\n data: this.data,\n i18n: this.i18n,\n emojisToShowFilter: emojisToShowFilter,\n include: include,\n exclude: exclude,\n custom: this.CUSTOM,\n autoFocus: autoFocus\n }), React.createElement('div', {\n ref: this.setScrollRef,\n className: 'emoji-mart-scroll',\n onScroll: this.handleScroll\n }, this.getCategories().map(function (category, i) {\n return React.createElement(Category, {\n ref: _this4.setCategoryRef.bind(_this4, 'category-' + i),\n key: category.name,\n id: category.id,\n name: category.name,\n emojis: category.emojis,\n perLine: perLine,\n native: native,\n hasStickyPosition: _this4.hasStickyPosition,\n data: _this4.data,\n i18n: _this4.i18n,\n recent: category.id == _this4.RECENT_CATEGORY.id ? recent : undefined,\n custom: category.id == _this4.RECENT_CATEGORY.id ? _this4.CUSTOM : undefined,\n emojiProps: {\n native: native,\n skin: skin,\n size: emojiSize,\n set: set,\n sheetSize: sheetSize,\n forceSize: native,\n tooltip: emojiTooltip,\n backgroundImageFn: backgroundImageFn,\n onOver: _this4.handleEmojiOver,\n onLeave: _this4.handleEmojiLeave,\n onClick: _this4.handleEmojiClick\n }\n });\n })), showPreview && React.createElement('div', {\n className: 'emoji-mart-bar'\n }, React.createElement(Preview, {\n ref: this.setPreviewRef,\n data: this.data,\n title: title,\n emoji: emoji,\n showSkinTones: showSkinTones,\n emojiProps: {\n native: native,\n size: 38,\n skin: skin,\n set: set,\n sheetSize: sheetSize,\n backgroundImageFn: backgroundImageFn\n },\n skinsProps: {\n skin: skin,\n onChange: this.handleSkinChange\n }\n })));\n }\n }]);\n\n return NimblePicker;\n}(React.PureComponent);\n\nexport default NimblePicker;\nNimblePicker.defaultProps = _extends({}, PickerDefaultProps);","import _extends from '../../polyfills/extends';\nimport _Object$getPrototypeOf from '../../polyfills/objectGetPrototypeOf';\nimport _classCallCheck from 'babel-runtime/helpers/classCallCheck';\nimport _createClass from '../../polyfills/createClass';\nimport _possibleConstructorReturn from '../../polyfills/possibleConstructorReturn';\nimport _inherits from '../../polyfills/inherits';\nimport React from 'react';\nimport data from '../../../data/all.json';\nimport NimblePicker from './nimble-picker';\nimport { PickerPropTypes, PickerDefaultProps } from '../../utils/shared-props';\n\nvar Picker = function (_React$PureComponent) {\n _inherits(Picker, _React$PureComponent);\n\n function Picker() {\n _classCallCheck(this, Picker);\n\n return _possibleConstructorReturn(this, (Picker.__proto__ || _Object$getPrototypeOf(Picker)).apply(this, arguments));\n }\n\n _createClass(Picker, [{\n key: 'render',\n value: function render() {\n return React.createElement(NimblePicker, _extends({}, this.props, this.state));\n }\n }]);\n\n return Picker;\n}(React.PureComponent);\n\nexport default Picker;\nPicker.defaultProps = _extends({}, PickerDefaultProps, {\n data: data\n});","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { autoPlayGif, me, isStaff } from 'flavours/glitch/util/initial_state';\nimport { preferencesLink, profileLink, accountAdminLink } from 'flavours/glitch/util/backend_links';\nimport classNames from 'classnames';\nimport Icon from 'flavours/glitch/components/icon';\nimport Avatar from 'flavours/glitch/components/avatar';\nimport Button from 'flavours/glitch/components/button';\nimport { shortNumberFormat } from 'flavours/glitch/util/numbers';\nimport { NavLink } from 'react-router-dom';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\n\nconst messages = defineMessages({\n unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },\n follow: { id: 'account.follow', defaultMessage: 'Follow' },\n cancel_follow_request: { id: 'account.cancel_follow_request', defaultMessage: 'Cancel follow request' },\n requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' },\n account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' },\n mention: { id: 'account.mention', defaultMessage: 'Mention @{name}' },\n direct: { id: 'account.direct', defaultMessage: 'Direct message @{name}' },\n unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n report: { id: 'account.report', defaultMessage: 'Report @{name}' },\n share: { id: 'account.share', defaultMessage: 'Share @{name}\\'s profile' },\n media: { id: 'account.media', defaultMessage: 'Media' },\n blockDomain: { id: 'account.block_domain', defaultMessage: 'Hide everything from {domain}' },\n unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },\n hideReblogs: { id: 'account.hide_reblogs', defaultMessage: 'Hide boosts from @{name}' },\n showReblogs: { id: 'account.show_reblogs', defaultMessage: 'Show boosts from @{name}' },\n pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },\n preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },\n follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },\n favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },\n lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },\n blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },\n domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },\n mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },\n endorse: { id: 'account.endorse', defaultMessage: 'Feature on profile' },\n unendorse: { id: 'account.unendorse', defaultMessage: 'Don\\'t feature on profile' },\n add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n});\n\nconst dateFormatOptions = {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n};\n\nexport default @injectIntl\nclass Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_props: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n domain: PropTypes.string.isRequired,\n };\n\n openEditProfile = () => {\n window.open(profileLink, '_blank');\n }\n\n _updateEmojis () {\n const node = this.node;\n\n if (!node || autoPlayGif) {\n return;\n }\n\n const emojis = node.querySelectorAll('.custom-emoji');\n\n for (var i = 0; i < emojis.length; i++) {\n let emoji = emojis[i];\n if (emoji.classList.contains('status-emoji')) {\n continue;\n }\n emoji.classList.add('status-emoji');\n\n emoji.addEventListener('mouseenter', this.handleEmojiMouseEnter, false);\n emoji.addEventListener('mouseleave', this.handleEmojiMouseLeave, false);\n }\n }\n\n componentDidMount () {\n this._updateEmojis();\n }\n\n componentDidUpdate () {\n this._updateEmojis();\n }\n\n handleEmojiMouseEnter = ({ target }) => {\n target.src = target.getAttribute('data-original');\n }\n\n handleEmojiMouseLeave = ({ target }) => {\n target.src = target.getAttribute('data-static');\n }\n\n setRef = (c) => {\n this.node = c;\n }\n\n render () {\n const { account, intl, domain, identity_proofs } = this.props;\n\n if (!account) {\n return null;\n }\n\n let info = [];\n let actionBtn = '';\n let lockedIcon = '';\n let menu = [];\n\n if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) {\n info.push( );\n }\n else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id') && account.getIn(['relationship', 'muting'])) {\n info.push( );\n } else if (me !== account.get('id') && account.getIn(['relationship', 'domain_blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id')) {\n if (!account.get('relationship')) { // Wait until the relationship is loaded\n actionBtn = '';\n } else if (account.getIn(['relationship', 'requested'])) {\n actionBtn = ;\n } else if (!account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n } else if (account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n }\n } else if (profileLink) {\n actionBtn = ;\n }\n\n if (account.get('moved') && !account.getIn(['relationship', 'following'])) {\n actionBtn = '';\n }\n\n if (account.get('locked')) {\n lockedIcon = ;\n }\n\n if (account.get('id') !== me) {\n menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.props.onMention });\n menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.props.onDirect });\n menu.push(null);\n }\n\n if ('share' in navigator) {\n menu.push({ text: intl.formatMessage(messages.share, { name: account.get('username') }), action: this.handleShare });\n menu.push(null);\n }\n\n if (account.get('id') === me) {\n if (profileLink) menu.push({ text: intl.formatMessage(messages.edit_profile), href: profileLink });\n if (preferencesLink) menu.push({ text: intl.formatMessage(messages.preferences), href: preferencesLink });\n menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });\n menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });\n menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' });\n menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });\n menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });\n } else {\n if (account.getIn(['relationship', 'following'])) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n menu.push({ text: intl.formatMessage(messages.hideReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n } else {\n menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n }\n\n menu.push({ text: intl.formatMessage(account.getIn(['relationship', 'endorsed']) ? messages.unendorse : messages.endorse), action: this.props.onEndorseToggle });\n menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });\n menu.push(null);\n }\n\n if (account.getIn(['relationship', 'muting'])) {\n menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.props.onMute });\n } else {\n menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.props.onMute });\n }\n\n if (account.getIn(['relationship', 'blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.props.onBlock });\n } else {\n menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.props.onBlock });\n }\n\n menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.props.onReport });\n }\n\n if (account.get('acct') !== account.get('username')) {\n const domain = account.get('acct').split('@')[1];\n\n menu.push(null);\n\n if (account.getIn(['relationship', 'domain_blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblockDomain, { domain }), action: this.props.onUnblockDomain });\n } else {\n menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.props.onBlockDomain });\n }\n }\n\n if (account.get('id') !== me && isStaff && accountAdminLink) {\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: accountAdminLink(account.get('id')) });\n }\n\n const content = { __html: account.get('note_emojified') };\n const displayNameHtml = { __html: account.get('display_name_html') };\n const fields = account.get('fields');\n const badge = account.get('bot') ? (
) : null;\n const acct = account.get('acct').indexOf('@') === -1 && domain ? `${account.get('acct')}@${domain}` : account.get('acct');\n\n return (\n \n
\n
\n {info}\n
\n\n
\n
\n\n
\n
\n
\n \n \n\n
\n\n
\n {actionBtn}\n\n \n
\n
\n\n
\n
\n {badge}\n @{acct} {lockedIcon} \n \n \n\n
\n
\n { (fields.size > 0 || identity_proofs.size > 0) && (\n
\n {identity_proofs.map((proof, i) => (\n
\n \n\n \n \n \n \n \n \n \n ))}\n {fields.map((pair, i) => (\n
\n \n \n \n {pair.get('verified_at') && } \n \n \n ))}\n
\n )}\n\n {account.get('note').length > 0 && account.get('note') !== '
' &&
}\n
\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport DropdownMenuContainer from 'flavours/glitch/containers/dropdown_menu_container';\nimport { NavLink } from 'react-router-dom';\nimport { injectIntl, FormattedMessage, FormattedNumber } from 'react-intl';\nimport { me, isStaff } from 'flavours/glitch/util/initial_state';\nimport { profileLink, accountAdminLink } from 'flavours/glitch/util/backend_links';\nimport Icon from 'flavours/glitch/components/icon';\n\nexport default @injectIntl\nclass ActionBar extends React.PureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n isStatusesPageActive = (match, location) => {\n if (!match) {\n return false;\n }\n return !location.pathname.match(/\\/(followers|following)\\/?$/);\n }\n\n render () {\n const { account, intl } = this.props;\n\n let extraInfo = '';\n\n if (account.get('acct') !== account.get('username')) {\n extraInfo = (\n \n );\n }\n\n return (\n \n {extraInfo}\n\n
\n
\n \n \n \n \n\n \n \n \n \n\n \n \n { account.get('followers_count') < 0 ? '-' : } \n \n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport AvatarOverlay from '../../../components/avatar_overlay';\nimport DisplayName from '../../../components/display_name';\nimport Icon from 'flavours/glitch/components/icon';\n\nexport default class MovedNote extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n from: ImmutablePropTypes.map.isRequired,\n to: ImmutablePropTypes.map.isRequired,\n };\n\n handleAccountClick = e => {\n if (e.button === 0) {\n e.preventDefault();\n let state = {...this.context.router.history.location.state};\n state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1;\n this.context.router.history.push(`/accounts/${this.props.to.get('id')}`, state);\n }\n\n e.stopPropagation();\n }\n\n render () {\n const { from, to } = this.props;\n const displayNameHtml = { __html: from.get('display_name_html') };\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport InnerHeader from 'flavours/glitch/features/account/components/header';\nimport ActionBar from 'flavours/glitch/features/account/components/action_bar';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { FormattedMessage } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport MovedNote from './moved_note';\n\nexport default class Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_proofs: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n onMention: PropTypes.func.isRequired,\n onDirect: PropTypes.func.isRequired,\n onReblogToggle: PropTypes.func.isRequired,\n onReport: PropTypes.func.isRequired,\n onMute: PropTypes.func.isRequired,\n onBlockDomain: PropTypes.func.isRequired,\n onUnblockDomain: PropTypes.func.isRequired,\n onEndorseToggle: PropTypes.func.isRequired,\n onAddToList: PropTypes.func.isRequired,\n hideTabs: PropTypes.bool,\n domain: PropTypes.string.isRequired,\n };\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleFollow = () => {\n this.props.onFollow(this.props.account);\n }\n\n handleBlock = () => {\n this.props.onBlock(this.props.account);\n }\n\n handleMention = () => {\n this.props.onMention(this.props.account, this.context.router.history);\n }\n\n handleDirect = () => {\n this.props.onDirect(this.props.account, this.context.router.history);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.account);\n }\n\n handleReblogToggle = () => {\n this.props.onReblogToggle(this.props.account);\n }\n\n handleMute = () => {\n this.props.onMute(this.props.account);\n }\n\n handleBlockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onBlockDomain(domain);\n }\n\n handleUnblockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onUnblockDomain(domain);\n }\n\n handleEndorseToggle = () => {\n this.props.onEndorseToggle(this.props.account);\n }\n\n handleAddToList = () => {\n this.props.onAddToList(this.props.account);\n }\n\n render () {\n const { account, hideTabs, identity_proofs } = this.props;\n\n if (account === null) {\n return null;\n }\n\n return (\n \n {account.get('moved') &&
}\n\n
\n\n
\n\n {!hideTabs && (\n
\n \n \n \n
\n )}\n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { makeGetAccount } from 'flavours/glitch/selectors';\nimport Header from '../components/header';\nimport {\n followAccount,\n unfollowAccount,\n unblockAccount,\n unmuteAccount,\n pinAccount,\n unpinAccount,\n} from 'flavours/glitch/actions/accounts';\nimport {\n mentionCompose,\n directCompose\n} from 'flavours/glitch/actions/compose';\nimport { initMuteModal } from 'flavours/glitch/actions/mutes';\nimport { initBlockModal } from 'flavours/glitch/actions/blocks';\nimport { initReport } from 'flavours/glitch/actions/reports';\nimport { openModal } from 'flavours/glitch/actions/modal';\nimport { blockDomain, unblockDomain } from 'flavours/glitch/actions/domain_blocks';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { unfollowModal } from 'flavours/glitch/util/initial_state';\nimport { List as ImmutableList } from 'immutable';\n\nconst messages = defineMessages({\n unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },\n blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, { accountId }) => ({\n account: getAccount(state, accountId),\n domain: state.getIn(['meta', 'domain']),\n identity_proofs: state.getIn(['identity_proofs', accountId], ImmutableList()),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onFollow (account) {\n if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {\n if (unfollowModal) {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.unfollowConfirm),\n onConfirm: () => dispatch(unfollowAccount(account.get('id'))),\n }));\n } else {\n dispatch(unfollowAccount(account.get('id')));\n }\n } else {\n dispatch(followAccount(account.get('id')));\n }\n },\n\n onBlock (account) {\n if (account.getIn(['relationship', 'blocking'])) {\n dispatch(unblockAccount(account.get('id')));\n } else {\n dispatch(initBlockModal(account));\n }\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onReblogToggle (account) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n dispatch(followAccount(account.get('id'), false));\n } else {\n dispatch(followAccount(account.get('id'), true));\n }\n },\n\n onEndorseToggle (account) {\n if (account.getIn(['relationship', 'endorsed'])) {\n dispatch(unpinAccount(account.get('id')));\n } else {\n dispatch(pinAccount(account.get('id')));\n }\n },\n\n onReport (account) {\n dispatch(initReport(account));\n },\n\n onMute (account) {\n if (account.getIn(['relationship', 'muting'])) {\n dispatch(unmuteAccount(account.get('id')));\n } else {\n dispatch(initMuteModal(account));\n }\n },\n\n onBlockDomain (domain) {\n dispatch(openModal('CONFIRM', {\n message: {domain} }} />,\n confirm: intl.formatMessage(messages.blockDomainConfirm),\n onConfirm: () => dispatch(blockDomain(domain)),\n }));\n },\n\n onUnblockDomain (domain) {\n dispatch(unblockDomain(domain));\n },\n\n onAddToList(account){\n dispatch(openModal('LIST_ADDER', {\n accountId: account.get('id'),\n }));\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Header));\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport Button from 'mastodon/components/button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { autoPlayGif, me, isStaff } from 'mastodon/initial_state';\nimport classNames from 'classnames';\nimport Icon from 'mastodon/components/icon';\nimport Avatar from 'mastodon/components/avatar';\nimport { shortNumberFormat } from 'mastodon/utils/numbers';\nimport { NavLink } from 'react-router-dom';\nimport DropdownMenuContainer from 'mastodon/containers/dropdown_menu_container';\n\nconst messages = defineMessages({\n unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },\n follow: { id: 'account.follow', defaultMessage: 'Follow' },\n cancel_follow_request: { id: 'account.cancel_follow_request', defaultMessage: 'Cancel follow request' },\n requested: { id: 'account.requested', defaultMessage: 'Awaiting approval. Click to cancel follow request' },\n unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' },\n edit_profile: { id: 'account.edit_profile', defaultMessage: 'Edit profile' },\n linkVerifiedOn: { id: 'account.link_verified_on', defaultMessage: 'Ownership of this link was checked on {date}' },\n account_locked: { id: 'account.locked_info', defaultMessage: 'This account privacy status is set to locked. The owner manually reviews who can follow them.' },\n mention: { id: 'account.mention', defaultMessage: 'Mention @{name}' },\n direct: { id: 'account.direct', defaultMessage: 'Direct message @{name}' },\n unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' },\n block: { id: 'account.block', defaultMessage: 'Block @{name}' },\n mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' },\n report: { id: 'account.report', defaultMessage: 'Report @{name}' },\n share: { id: 'account.share', defaultMessage: 'Share @{name}\\'s profile' },\n media: { id: 'account.media', defaultMessage: 'Media' },\n blockDomain: { id: 'account.block_domain', defaultMessage: 'Hide everything from {domain}' },\n unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },\n hideReblogs: { id: 'account.hide_reblogs', defaultMessage: 'Hide boosts from @{name}' },\n showReblogs: { id: 'account.show_reblogs', defaultMessage: 'Show boosts from @{name}' },\n pins: { id: 'navigation_bar.pins', defaultMessage: 'Pinned toots' },\n preferences: { id: 'navigation_bar.preferences', defaultMessage: 'Preferences' },\n follow_requests: { id: 'navigation_bar.follow_requests', defaultMessage: 'Follow requests' },\n favourites: { id: 'navigation_bar.favourites', defaultMessage: 'Favourites' },\n lists: { id: 'navigation_bar.lists', defaultMessage: 'Lists' },\n blocks: { id: 'navigation_bar.blocks', defaultMessage: 'Blocked users' },\n domain_blocks: { id: 'navigation_bar.domain_blocks', defaultMessage: 'Hidden domains' },\n mutes: { id: 'navigation_bar.mutes', defaultMessage: 'Muted users' },\n endorse: { id: 'account.endorse', defaultMessage: 'Feature on profile' },\n unendorse: { id: 'account.unendorse', defaultMessage: 'Don\\'t feature on profile' },\n add_or_remove_from_list: { id: 'account.add_or_remove_from_list', defaultMessage: 'Add or Remove from lists' },\n admin_account: { id: 'status.admin_account', defaultMessage: 'Open moderation interface for @{name}' },\n});\n\nconst dateFormatOptions = {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n};\n\nexport default @injectIntl\nclass Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_props: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n domain: PropTypes.string.isRequired,\n };\n\n openEditProfile = () => {\n window.open('/settings/profile', '_blank');\n }\n\n isStatusesPageActive = (match, location) => {\n if (!match) {\n return false;\n }\n\n return !location.pathname.match(/\\/(followers|following)\\/?$/);\n }\n\n _updateEmojis () {\n const node = this.node;\n\n if (!node || autoPlayGif) {\n return;\n }\n\n const emojis = node.querySelectorAll('.custom-emoji');\n\n for (var i = 0; i < emojis.length; i++) {\n let emoji = emojis[i];\n if (emoji.classList.contains('status-emoji')) {\n continue;\n }\n emoji.classList.add('status-emoji');\n\n emoji.addEventListener('mouseenter', this.handleEmojiMouseEnter, false);\n emoji.addEventListener('mouseleave', this.handleEmojiMouseLeave, false);\n }\n }\n\n componentDidMount () {\n this._updateEmojis();\n }\n\n componentDidUpdate () {\n this._updateEmojis();\n }\n\n handleEmojiMouseEnter = ({ target }) => {\n target.src = target.getAttribute('data-original');\n }\n\n handleEmojiMouseLeave = ({ target }) => {\n target.src = target.getAttribute('data-static');\n }\n\n setRef = (c) => {\n this.node = c;\n }\n\n render () {\n const { account, intl, domain, identity_proofs } = this.props;\n\n if (!account) {\n return null;\n }\n\n let info = [];\n let actionBtn = '';\n let lockedIcon = '';\n let menu = [];\n\n if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) {\n info.push( );\n } else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id') && account.getIn(['relationship', 'muting'])) {\n info.push( );\n } else if (me !== account.get('id') && account.getIn(['relationship', 'domain_blocking'])) {\n info.push( );\n }\n\n if (me !== account.get('id')) {\n if (!account.get('relationship')) { // Wait until the relationship is loaded\n actionBtn = '';\n } else if (account.getIn(['relationship', 'requested'])) {\n actionBtn = ;\n } else if (!account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n } else if (account.getIn(['relationship', 'blocking'])) {\n actionBtn = ;\n }\n } else {\n actionBtn = ;\n }\n\n if (account.get('moved') && !account.getIn(['relationship', 'following'])) {\n actionBtn = '';\n }\n\n if (account.get('locked')) {\n lockedIcon = ;\n }\n\n if (account.get('id') !== me) {\n menu.push({ text: intl.formatMessage(messages.mention, { name: account.get('username') }), action: this.props.onMention });\n menu.push({ text: intl.formatMessage(messages.direct, { name: account.get('username') }), action: this.props.onDirect });\n menu.push(null);\n }\n\n if ('share' in navigator) {\n menu.push({ text: intl.formatMessage(messages.share, { name: account.get('username') }), action: this.handleShare });\n menu.push(null);\n }\n\n if (account.get('id') === me) {\n menu.push({ text: intl.formatMessage(messages.edit_profile), href: '/settings/profile' });\n menu.push({ text: intl.formatMessage(messages.preferences), href: '/settings/preferences' });\n menu.push({ text: intl.formatMessage(messages.pins), to: '/pinned' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.follow_requests), to: '/follow_requests' });\n menu.push({ text: intl.formatMessage(messages.favourites), to: '/favourites' });\n menu.push({ text: intl.formatMessage(messages.lists), to: '/lists' });\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.mutes), to: '/mutes' });\n menu.push({ text: intl.formatMessage(messages.blocks), to: '/blocks' });\n menu.push({ text: intl.formatMessage(messages.domain_blocks), to: '/domain_blocks' });\n } else {\n if (account.getIn(['relationship', 'following'])) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n menu.push({ text: intl.formatMessage(messages.hideReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n } else {\n menu.push({ text: intl.formatMessage(messages.showReblogs, { name: account.get('username') }), action: this.props.onReblogToggle });\n }\n\n menu.push({ text: intl.formatMessage(account.getIn(['relationship', 'endorsed']) ? messages.unendorse : messages.endorse), action: this.props.onEndorseToggle });\n menu.push({ text: intl.formatMessage(messages.add_or_remove_from_list), action: this.props.onAddToList });\n menu.push(null);\n }\n\n if (account.getIn(['relationship', 'muting'])) {\n menu.push({ text: intl.formatMessage(messages.unmute, { name: account.get('username') }), action: this.props.onMute });\n } else {\n menu.push({ text: intl.formatMessage(messages.mute, { name: account.get('username') }), action: this.props.onMute });\n }\n\n if (account.getIn(['relationship', 'blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblock, { name: account.get('username') }), action: this.props.onBlock });\n } else {\n menu.push({ text: intl.formatMessage(messages.block, { name: account.get('username') }), action: this.props.onBlock });\n }\n\n menu.push({ text: intl.formatMessage(messages.report, { name: account.get('username') }), action: this.props.onReport });\n }\n\n if (account.get('acct') !== account.get('username')) {\n const domain = account.get('acct').split('@')[1];\n\n menu.push(null);\n\n if (account.getIn(['relationship', 'domain_blocking'])) {\n menu.push({ text: intl.formatMessage(messages.unblockDomain, { domain }), action: this.props.onUnblockDomain });\n } else {\n menu.push({ text: intl.formatMessage(messages.blockDomain, { domain }), action: this.props.onBlockDomain });\n }\n }\n\n if (account.get('id') !== me && isStaff) {\n menu.push(null);\n menu.push({ text: intl.formatMessage(messages.admin_account, { name: account.get('username') }), href: `/admin/accounts/${account.get('id')}` });\n }\n\n const content = { __html: account.get('note_emojified') };\n const displayNameHtml = { __html: account.get('display_name_html') };\n const fields = account.get('fields');\n const badge = account.get('bot') ? (
) : null;\n const acct = account.get('acct').indexOf('@') === -1 && domain ? `${account.get('acct')}@${domain}` : account.get('acct');\n\n return (\n \n
\n
\n {info}\n
\n\n
\n
\n\n
\n
\n
\n \n \n\n
\n\n
\n {actionBtn}\n\n \n
\n
\n\n
\n
\n {badge}\n @{acct} {lockedIcon} \n \n \n\n
\n
\n { (fields.size > 0 || identity_proofs.size > 0) && (\n
\n {identity_proofs.map((proof, i) => (\n
\n \n\n \n \n \n \n \n \n \n ))}\n {fields.map((pair, i) => (\n
\n \n\n \n {pair.get('verified_at') && } \n \n \n ))}\n
\n )}\n\n {account.get('note').length > 0 && account.get('note') !== '
' &&
}\n
\n\n
\n \n {shortNumberFormat(account.get('statuses_count'))} \n \n\n \n {shortNumberFormat(account.get('following_count'))} \n \n\n \n {shortNumberFormat(account.get('followers_count'))} \n \n
\n
\n
\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage } from 'react-intl';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport AvatarOverlay from '../../../components/avatar_overlay';\nimport DisplayName from '../../../components/display_name';\nimport Icon from 'mastodon/components/icon';\n\nexport default class MovedNote extends ImmutablePureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static propTypes = {\n from: ImmutablePropTypes.map.isRequired,\n to: ImmutablePropTypes.map.isRequired,\n };\n\n handleAccountClick = e => {\n if (e.button === 0) {\n e.preventDefault();\n this.context.router.history.push(`/accounts/${this.props.to.get('id')}`);\n }\n\n e.stopPropagation();\n }\n\n render () {\n const { from, to } = this.props;\n const displayNameHtml = { __html: from.get('display_name_html') };\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport InnerHeader from '../../account/components/header';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport MovedNote from './moved_note';\nimport { FormattedMessage } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\n\nexport default class Header extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map,\n identity_proofs: ImmutablePropTypes.list,\n onFollow: PropTypes.func.isRequired,\n onBlock: PropTypes.func.isRequired,\n onMention: PropTypes.func.isRequired,\n onDirect: PropTypes.func.isRequired,\n onReblogToggle: PropTypes.func.isRequired,\n onReport: PropTypes.func.isRequired,\n onMute: PropTypes.func.isRequired,\n onBlockDomain: PropTypes.func.isRequired,\n onUnblockDomain: PropTypes.func.isRequired,\n onEndorseToggle: PropTypes.func.isRequired,\n onAddToList: PropTypes.func.isRequired,\n hideTabs: PropTypes.bool,\n domain: PropTypes.string.isRequired,\n };\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n handleFollow = () => {\n this.props.onFollow(this.props.account);\n }\n\n handleBlock = () => {\n this.props.onBlock(this.props.account);\n }\n\n handleMention = () => {\n this.props.onMention(this.props.account, this.context.router.history);\n }\n\n handleDirect = () => {\n this.props.onDirect(this.props.account, this.context.router.history);\n }\n\n handleReport = () => {\n this.props.onReport(this.props.account);\n }\n\n handleReblogToggle = () => {\n this.props.onReblogToggle(this.props.account);\n }\n\n handleMute = () => {\n this.props.onMute(this.props.account);\n }\n\n handleBlockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onBlockDomain(domain);\n }\n\n handleUnblockDomain = () => {\n const domain = this.props.account.get('acct').split('@')[1];\n\n if (!domain) return;\n\n this.props.onUnblockDomain(domain);\n }\n\n handleEndorseToggle = () => {\n this.props.onEndorseToggle(this.props.account);\n }\n\n handleAddToList = () => {\n this.props.onAddToList(this.props.account);\n }\n\n render () {\n const { account, hideTabs, identity_proofs } = this.props;\n\n if (account === null) {\n return null;\n }\n\n return (\n \n {account.get('moved') &&
}\n\n
\n\n {!hideTabs && (\n
\n \n \n \n
\n )}\n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { makeGetAccount } from '../../../selectors';\nimport Header from '../components/header';\nimport {\n followAccount,\n unfollowAccount,\n unblockAccount,\n unmuteAccount,\n pinAccount,\n unpinAccount,\n} from '../../../actions/accounts';\nimport {\n mentionCompose,\n directCompose,\n} from '../../../actions/compose';\nimport { initMuteModal } from '../../../actions/mutes';\nimport { initBlockModal } from '../../../actions/blocks';\nimport { initReport } from '../../../actions/reports';\nimport { openModal } from '../../../actions/modal';\nimport { blockDomain, unblockDomain } from '../../../actions/domain_blocks';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { unfollowModal } from '../../../initial_state';\nimport { List as ImmutableList } from 'immutable';\n\nconst messages = defineMessages({\n unfollowConfirm: { id: 'confirmations.unfollow.confirm', defaultMessage: 'Unfollow' },\n blockDomainConfirm: { id: 'confirmations.domain_block.confirm', defaultMessage: 'Hide entire domain' },\n});\n\nconst makeMapStateToProps = () => {\n const getAccount = makeGetAccount();\n\n const mapStateToProps = (state, { accountId }) => ({\n account: getAccount(state, accountId),\n domain: state.getIn(['meta', 'domain']),\n identity_proofs: state.getIn(['identity_proofs', accountId], ImmutableList()),\n });\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl }) => ({\n\n onFollow (account) {\n if (account.getIn(['relationship', 'following']) || account.getIn(['relationship', 'requested'])) {\n if (unfollowModal) {\n dispatch(openModal('CONFIRM', {\n message: @{account.get('acct')} }} />,\n confirm: intl.formatMessage(messages.unfollowConfirm),\n onConfirm: () => dispatch(unfollowAccount(account.get('id'))),\n }));\n } else {\n dispatch(unfollowAccount(account.get('id')));\n }\n } else {\n dispatch(followAccount(account.get('id')));\n }\n },\n\n onBlock (account) {\n if (account.getIn(['relationship', 'blocking'])) {\n dispatch(unblockAccount(account.get('id')));\n } else {\n dispatch(initBlockModal(account));\n }\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onReblogToggle (account) {\n if (account.getIn(['relationship', 'showing_reblogs'])) {\n dispatch(followAccount(account.get('id'), false));\n } else {\n dispatch(followAccount(account.get('id'), true));\n }\n },\n\n onEndorseToggle (account) {\n if (account.getIn(['relationship', 'endorsed'])) {\n dispatch(unpinAccount(account.get('id')));\n } else {\n dispatch(pinAccount(account.get('id')));\n }\n },\n\n onReport (account) {\n dispatch(initReport(account));\n },\n\n onMute (account) {\n if (account.getIn(['relationship', 'muting'])) {\n dispatch(unmuteAccount(account.get('id')));\n } else {\n dispatch(initMuteModal(account));\n }\n },\n\n onBlockDomain (domain) {\n dispatch(openModal('CONFIRM', {\n message: {domain} }} />,\n confirm: intl.formatMessage(messages.blockDomainConfirm),\n onConfirm: () => dispatch(blockDomain(domain)),\n }));\n },\n\n onUnblockDomain (domain) {\n dispatch(unblockDomain(domain));\n },\n\n onAddToList(account){\n dispatch(openModal('LIST_ADDER', {\n accountId: account.get('id'),\n }));\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Header));\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { FormattedMessage } from 'react-intl';\n\nexport default\nclass Spoilers extends React.PureComponent {\n static propTypes = {\n spoilerText: PropTypes.string,\n children: PropTypes.node,\n };\n\n state = {\n hidden: true,\n }\n\n handleSpoilerClick = () => {\n this.setState({ hidden: !this.state.hidden });\n }\n\n render () {\n const { spoilerText, children } = this.props;\n const { hidden } = this.state;\n\n const toggleText = hidden ?\n :\n ;\n\n return ([\n \n {spoilerText}\n {' '}\n \n {toggleText}\n \n
,\n \n {children}\n
\n ]);\n }\n}\n\n","import { connect } from 'react-redux';\nimport Status from 'flavours/glitch/components/status';\nimport { List as ImmutableList } from 'immutable';\nimport { makeGetStatus, regexFromFilters, toServerSideType } from 'flavours/glitch/selectors';\nimport {\n replyCompose,\n mentionCompose,\n directCompose,\n} from 'flavours/glitch/actions/compose';\nimport {\n reblog,\n favourite,\n bookmark,\n unreblog,\n unfavourite,\n unbookmark,\n pin,\n unpin,\n} from 'flavours/glitch/actions/interactions';\nimport { muteStatus, unmuteStatus, deleteStatus } from 'flavours/glitch/actions/statuses';\nimport { initMuteModal } from 'flavours/glitch/actions/mutes';\nimport { initBlockModal } from 'flavours/glitch/actions/blocks';\nimport { initReport } from 'flavours/glitch/actions/reports';\nimport { openModal } from 'flavours/glitch/actions/modal';\nimport { changeLocalSetting } from 'flavours/glitch/actions/local_settings';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport { boostModal, favouriteModal, deleteModal } from 'flavours/glitch/util/initial_state';\nimport { filterEditLink } from 'flavours/glitch/util/backend_links';\nimport { showAlertForError } from '../actions/alerts';\nimport AccountContainer from 'flavours/glitch/containers/account_container';\nimport Spoilers from '../components/spoilers';\nimport Icon from 'flavours/glitch/components/icon';\n\nconst messages = defineMessages({\n deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' },\n deleteMessage: { id: 'confirmations.delete.message', defaultMessage: 'Are you sure you want to delete this status?' },\n redraftConfirm: { id: 'confirmations.redraft.confirm', defaultMessage: 'Delete & redraft' },\n redraftMessage: { id: 'confirmations.redraft.message', defaultMessage: 'Are you sure you want to delete this status and re-draft it? You will lose all replies, boosts and favourites to it.' },\n replyConfirm: { id: 'confirmations.reply.confirm', defaultMessage: 'Reply' },\n replyMessage: { id: 'confirmations.reply.message', defaultMessage: 'Replying now will overwrite the message you are currently composing. Are you sure you want to proceed?' },\n unfilterConfirm: { id: 'confirmations.unfilter.confirm', defaultMessage: 'Show' },\n author: { id: 'confirmations.unfilter.author', defaultMessage: 'Author' },\n matchingFilters: { id: 'confirmations.unfilter.filters', defaultMessage: 'Matching {count, plural, one {filter} other {filters}}' },\n editFilter: { id: 'confirmations.unfilter.edit_filter', defaultMessage: 'Edit filter' },\n});\n\nconst makeMapStateToProps = () => {\n const getStatus = makeGetStatus();\n\n const mapStateToProps = (state, props) => {\n\n let status = getStatus(state, props);\n let reblogStatus = status ? status.get('reblog', null) : null;\n let account = undefined;\n let prepend = undefined;\n\n if (props.featured) {\n account = status.get('account');\n prepend = 'featured';\n } else if (reblogStatus !== null && typeof reblogStatus === 'object') {\n account = status.get('account');\n status = reblogStatus;\n prepend = 'reblogged_by';\n }\n\n return {\n containerId : props.containerId || props.id, // Should match reblogStatus's id for reblogs\n status : status,\n account : account || props.account,\n settings : state.get('local_settings'),\n prepend : prepend || props.prepend,\n };\n };\n\n return mapStateToProps;\n};\n\nconst mapDispatchToProps = (dispatch, { intl, contextType }) => ({\n\n onReply (status, router) {\n dispatch((_, getState) => {\n let state = getState();\n\n if (state.getIn(['local_settings', 'confirm_before_clearing_draft']) && state.getIn(['compose', 'text']).trim().length !== 0) {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(messages.replyMessage),\n confirm: intl.formatMessage(messages.replyConfirm),\n onDoNotAsk: () => dispatch(changeLocalSetting(['confirm_before_clearing_draft'], false)),\n onConfirm: () => dispatch(replyCompose(status, router)),\n }));\n } else {\n dispatch(replyCompose(status, router));\n }\n });\n },\n\n onModalReblog (status) {\n if (status.get('reblogged')) {\n dispatch(unreblog(status));\n } else {\n dispatch(reblog(status));\n }\n },\n\n onReblog (status, e) {\n dispatch((_, getState) => {\n let state = getState();\n if (state.getIn(['local_settings', 'confirm_boost_missing_media_description']) && status.get('media_attachments').some(item => !item.get('description')) && !status.get('reblogged')) {\n dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog, missingMediaDescription: true }));\n } else if (e.shiftKey || !boostModal) {\n this.onModalReblog(status);\n } else {\n dispatch(openModal('BOOST', { status, onReblog: this.onModalReblog }));\n }\n });\n },\n\n onBookmark (status) {\n if (status.get('bookmarked')) {\n dispatch(unbookmark(status));\n } else {\n dispatch(bookmark(status));\n }\n },\n\n onModalFavourite (status) {\n dispatch(favourite(status));\n },\n\n onFavourite (status, e) {\n if (status.get('favourited')) {\n dispatch(unfavourite(status));\n } else {\n if (e.shiftKey || !favouriteModal) {\n this.onModalFavourite(status);\n } else {\n dispatch(openModal('FAVOURITE', { status, onFavourite: this.onModalFavourite }));\n }\n }\n },\n\n onPin (status) {\n if (status.get('pinned')) {\n dispatch(unpin(status));\n } else {\n dispatch(pin(status));\n }\n },\n\n onEmbed (status) {\n dispatch(openModal('EMBED', {\n url: status.get('url'),\n onError: error => dispatch(showAlertForError(error)),\n }));\n },\n\n onDelete (status, history, withRedraft = false) {\n if (!deleteModal) {\n dispatch(deleteStatus(status.get('id'), history, withRedraft));\n } else {\n dispatch(openModal('CONFIRM', {\n message: intl.formatMessage(withRedraft ? messages.redraftMessage : messages.deleteMessage),\n confirm: intl.formatMessage(withRedraft ? messages.redraftConfirm : messages.deleteConfirm),\n onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)),\n }));\n }\n },\n\n onDirect (account, router) {\n dispatch(directCompose(account, router));\n },\n\n onMention (account, router) {\n dispatch(mentionCompose(account, router));\n },\n\n onOpenMedia (media, index) {\n dispatch(openModal('MEDIA', { media, index }));\n },\n\n onOpenVideo (media, time) {\n dispatch(openModal('VIDEO', { media, time }));\n },\n\n onBlock (status) {\n const account = status.get('account');\n dispatch(initBlockModal(account));\n },\n\n onUnfilter (status, onConfirm) {\n dispatch((_, getState) => {\n let state = getState();\n const serverSideType = toServerSideType(contextType);\n const enabledFilters = state.get('filters', ImmutableList()).filter(filter => filter.get('context').includes(serverSideType) && (filter.get('expires_at') === null || Date.parse(filter.get('expires_at')) > (new Date()))).toArray();\n const searchIndex = status.get('search_index');\n const matchingFilters = enabledFilters.filter(filter => regexFromFilters([filter]).test(searchIndex));\n dispatch(openModal('CONFIRM', {\n message: [\n ,\n \n
\n \n \n
\n \n {matchingFilters.map(filter => (\n \n {filter.get('phrase')}\n {!!filterEditLink && ' '}\n {!!filterEditLink && (\n \n \n \n )}\n \n ))}\n \n \n
\n ],\n confirm: intl.formatMessage(messages.unfilterConfirm),\n onConfirm: onConfirm,\n }));\n });\n },\n\n onReport (status) {\n dispatch(initReport(status.get('account'), status));\n },\n\n onMute (account) {\n dispatch(initMuteModal(account));\n },\n\n onMuteConversation (status) {\n if (status.get('muted')) {\n dispatch(unmuteStatus(status.get('id')));\n } else {\n dispatch(muteStatus(status.get('id')));\n }\n },\n\n});\n\nexport default injectIntl(connect(makeMapStateToProps, mapDispatchToProps)(Status));\n","module.exports = function (it) {\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","module.exports = function (exec) {\n try {\n return !!exec();\n } catch (e) {\n return true;\n }\n};","module.exports = function (bitmap, value) {\n return {\n enumerable: !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable: !(bitmap & 4),\n value: value\n };\n};","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal');\n\nvar enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O) {\n return $keys(O, enumBugKeys);\n};","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject');\n\nvar defined = require('./_defined');\n\nmodule.exports = function (it) {\n return IObject(defined(it));\n};","// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function (it) {\n if (it == undefined) throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil;\nvar floor = Math.floor;\n\nmodule.exports = function (it) {\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","var shared = require('./_shared')('keys');\n\nvar uid = require('./_uid');\n\nmodule.exports = function (key) {\n return shared[key] || (shared[key] = uid(key));\n};","module.exports = {};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\n\nmodule.exports = function (it) {\n return Object(defined(it));\n};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { getData, getSanitizedData, unifiedToNative } from '../../utils';\nimport { uncompress } from '../../utils/data';\nimport { EmojiPropTypes, EmojiDefaultProps } from '../../utils/shared-props';\nvar SHEET_COLUMNS = 52;\n\nvar _getData = function _getData(props) {\n var emoji = props.emoji;\n var skin = props.skin;\n var set = props.set;\n var data = props.data;\n return getData(emoji, skin, set, data);\n};\n\nvar _getPosition = function _getPosition(props) {\n var _getData2 = _getData(props);\n\n var sheet_x = _getData2.sheet_x;\n var sheet_y = _getData2.sheet_y;\n var multiply = 100 / (SHEET_COLUMNS - 1);\n return multiply * sheet_x + '% ' + multiply * sheet_y + '%';\n};\n\nvar _getSanitizedData = function _getSanitizedData(props) {\n var emoji = props.emoji;\n var skin = props.skin;\n var set = props.set;\n var data = props.data;\n return getSanitizedData(emoji, skin, set, data);\n};\n\nvar _handleClick = function _handleClick(e, props) {\n if (!props.onClick) {\n return;\n }\n\n var onClick = props.onClick;\n\n var emoji = _getSanitizedData(props);\n\n onClick(emoji, e);\n};\n\nvar _handleOver = function _handleOver(e, props) {\n if (!props.onOver) {\n return;\n }\n\n var onOver = props.onOver;\n\n var emoji = _getSanitizedData(props);\n\n onOver(emoji, e);\n};\n\nvar _handleLeave = function _handleLeave(e, props) {\n if (!props.onLeave) {\n return;\n }\n\n var onLeave = props.onLeave;\n\n var emoji = _getSanitizedData(props);\n\n onLeave(emoji, e);\n};\n\nvar _isNumeric = function _isNumeric(value) {\n return !isNaN(value - parseFloat(value));\n};\n\nvar _convertStyleToCSS = function _convertStyleToCSS(style) {\n var div = document.createElement('div');\n\n for (var key in style) {\n var value = style[key];\n\n if (_isNumeric(value)) {\n value += 'px';\n }\n\n div.style[key] = value;\n }\n\n return div.getAttribute('style');\n};\n\nvar NimbleEmoji = function NimbleEmoji(props) {\n if (props.data.compressed) {\n uncompress(props.data);\n }\n\n for (var k in NimbleEmoji.defaultProps) {\n if (props[k] == undefined && NimbleEmoji.defaultProps[k] != undefined) {\n props[k] = NimbleEmoji.defaultProps[k];\n }\n }\n\n var data = _getData(props);\n\n if (!data) {\n return null;\n }\n\n var unified = data.unified;\n var custom = data.custom;\n var short_names = data.short_names;\n var colons = data.colons;\n var imageUrl = data.imageUrl;\n var style = {};\n var children = props.children;\n var className = 'emoji-mart-emoji';\n var title = null;\n\n if (!unified && !custom) {\n return null;\n }\n\n if (props.tooltip) {\n title = short_names ? ':' + short_names[0] + ':' : colons;\n }\n\n if (props.native && unified) {\n className += ' emoji-mart-emoji-native';\n style = {\n fontSize: props.size\n };\n children = unifiedToNative(unified);\n\n if (props.forceSize) {\n style.display = 'inline-block';\n style.width = props.size;\n style.height = props.size;\n }\n } else if (custom) {\n className += ' emoji-mart-emoji-custom';\n style = {\n width: props.size,\n height: props.size,\n display: 'inline-block',\n backgroundImage: 'url(' + imageUrl + ')',\n backgroundSize: 'contain'\n };\n } else {\n var setHasEmoji = data['has_img_' + props.set] == undefined || data['has_img_' + props.set];\n\n if (!setHasEmoji) {\n if (props.fallback) {\n return props.fallback(data);\n } else {\n return null;\n }\n } else {\n style = {\n width: props.size,\n height: props.size,\n display: 'inline-block',\n backgroundImage: 'url(' + props.backgroundImageFn(props.set, props.sheetSize) + ')',\n backgroundSize: 100 * SHEET_COLUMNS + '%',\n backgroundPosition: _getPosition(props)\n };\n }\n }\n\n if (props.html) {\n style = _convertStyleToCSS(style);\n return '' + (children || '') + ' ';\n } else {\n return React.createElement('span', {\n key: props.emoji.id || props.emoji,\n onClick: function onClick(e) {\n return _handleClick(e, props);\n },\n onMouseEnter: function onMouseEnter(e) {\n return _handleOver(e, props);\n },\n onMouseLeave: function onMouseLeave(e) {\n return _handleLeave(e, props);\n },\n title: title,\n className: className\n }, React.createElement('span', {\n style: style\n }, children));\n }\n};\n\nNimbleEmoji.defaultProps = EmojiDefaultProps;\nexport default NimbleEmoji;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Toggle from 'react-toggle';\n\nexport default class SettingToggle extends React.PureComponent {\n\n static propTypes = {\n prefix: PropTypes.string,\n settings: ImmutablePropTypes.map.isRequired,\n settingPath: PropTypes.array.isRequired,\n label: PropTypes.node.isRequired,\n meta: PropTypes.node,\n onChange: PropTypes.func.isRequired,\n defaultValue: PropTypes.bool,\n }\n\n onChange = ({ target }) => {\n this.props.onChange(this.props.settingPath, target.checked);\n }\n\n render () {\n const { prefix, settings, settingPath, label, meta, defaultValue } = this.props;\n const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-');\n\n return (\n \n \n {label} \n {meta && {meta} }\n
\n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\n\nexport default class SettingText extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n settingPath: PropTypes.array.isRequired,\n label: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n };\n\n handleChange = (e) => {\n this.props.onChange(this.props.settingPath, e.target.value);\n }\n\n render () {\n const { settings, settingPath, label } = this.props;\n\n return (\n \n {label} \n \n \n );\n }\n\n}\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getMenuPlacement = getMenuPlacement;\nexports.MenuPortal = exports.menuPortalCSS = exports.LoadingMessage = exports.NoOptionsMessage = exports.loadingMessageCSS = exports.noOptionsMessageCSS = exports.MenuList = exports.menuListCSS = exports.default = exports.MenuPlacer = exports.menuCSS = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nvar _reactDom = require(\"react-dom\");\n\nvar _propTypes = _interopRequireDefault(require(\"prop-types\"));\n\nvar _utils = require(\"../utils\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\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 getMenuPlacement(_ref) {\n var maxHeight = _ref.maxHeight,\n menuEl = _ref.menuEl,\n minHeight = _ref.minHeight,\n placement = _ref.placement,\n shouldScroll = _ref.shouldScroll,\n isFixedPosition = _ref.isFixedPosition,\n theme = _ref.theme;\n var spacing = theme.spacing;\n var scrollParent = (0, _utils.getScrollParent)(menuEl);\n var defaultState = {\n placement: 'bottom',\n maxHeight: maxHeight\n }; // something went wrong, return default state\n\n if (!menuEl || !menuEl.offsetParent) return defaultState; // we can't trust `scrollParent.scrollHeight` --> it may increase when\n // the menu is rendered\n\n var _scrollParent$getBoun = scrollParent.getBoundingClientRect(),\n scrollHeight = _scrollParent$getBoun.height;\n\n var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(),\n menuBottom = _menuEl$getBoundingCl.bottom,\n menuHeight = _menuEl$getBoundingCl.height,\n menuTop = _menuEl$getBoundingCl.top;\n\n var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(),\n containerTop = _menuEl$offsetParent$.top;\n\n var viewHeight = window.innerHeight;\n var scrollTop = (0, _utils.getScrollTop)(scrollParent);\n var marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10);\n var marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10);\n var viewSpaceAbove = containerTop - marginTop;\n var viewSpaceBelow = viewHeight - menuTop;\n var scrollSpaceAbove = viewSpaceAbove + scrollTop;\n var scrollSpaceBelow = scrollHeight - scrollTop - menuTop;\n var scrollDown = menuBottom - viewHeight + scrollTop + marginBottom;\n var scrollUp = scrollTop + menuTop - marginTop;\n var scrollDuration = 160;\n\n switch (placement) {\n case 'auto':\n case 'bottom':\n // 1: the menu will fit, do nothing\n if (viewSpaceBelow >= menuHeight) {\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n } // 2: the menu will fit, if scrolled\n\n\n if (scrollSpaceBelow >= menuHeight && !isFixedPosition) {\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollDown, scrollDuration);\n }\n\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n } // 3: the menu will fit, if constrained\n\n\n if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) {\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollDown, scrollDuration);\n } // we want to provide as much of the menu as possible to the user,\n // so give them whatever is available below rather than the minHeight.\n\n\n var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom : scrollSpaceBelow - marginBottom;\n return {\n placement: 'bottom',\n maxHeight: constrainedHeight\n };\n } // 4. Forked beviour when there isn't enough space below\n // AUTO: flip the menu, render above\n\n\n if (placement === 'auto' || isFixedPosition) {\n // may need to be constrained after flipping\n var _constrainedHeight = maxHeight;\n var spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove;\n\n if (spaceAbove >= minHeight) {\n _constrainedHeight = Math.min(spaceAbove - marginBottom - spacing.controlHeight, maxHeight);\n }\n\n return {\n placement: 'top',\n maxHeight: _constrainedHeight\n };\n } // BOTTOM: allow browser to increase scrollable area and immediately set scroll\n\n\n if (placement === 'bottom') {\n (0, _utils.scrollTo)(scrollParent, scrollDown);\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n }\n\n break;\n\n case 'top':\n // 1: the menu will fit, do nothing\n if (viewSpaceAbove >= menuHeight) {\n return {\n placement: 'top',\n maxHeight: maxHeight\n };\n } // 2: the menu will fit, if scrolled\n\n\n if (scrollSpaceAbove >= menuHeight && !isFixedPosition) {\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollUp, scrollDuration);\n }\n\n return {\n placement: 'top',\n maxHeight: maxHeight\n };\n } // 3: the menu will fit, if constrained\n\n\n if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {\n var _constrainedHeight2 = maxHeight; // we want to provide as much of the menu as possible to the user,\n // so give them whatever is available below rather than the minHeight.\n\n if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {\n _constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop : scrollSpaceAbove - marginTop;\n }\n\n if (shouldScroll) {\n (0, _utils.animatedScrollTo)(scrollParent, scrollUp, scrollDuration);\n }\n\n return {\n placement: 'top',\n maxHeight: _constrainedHeight2\n };\n } // 4. not enough space, the browser WILL NOT increase scrollable area when\n // absolutely positioned element rendered above the viewport (only below).\n // Flip the menu, render below\n\n\n return {\n placement: 'bottom',\n maxHeight: maxHeight\n };\n\n default:\n throw new Error(\"Invalid placement provided \\\"\".concat(placement, \"\\\".\"));\n } // fulfil contract with flow: implicit return value of undefined\n\n\n return defaultState;\n} // Menu Component\n// ------------------------------\n\n\nfunction alignToControl(placement) {\n var placementToCSSProp = {\n bottom: 'top',\n top: 'bottom'\n };\n return placement ? placementToCSSProp[placement] : 'bottom';\n}\n\nvar coercePlacement = function coercePlacement(p) {\n return p === 'auto' ? 'bottom' : p;\n};\n\nvar menuCSS = function menuCSS(_ref2) {\n var _ref3;\n\n var placement = _ref2.placement,\n _ref2$theme = _ref2.theme,\n borderRadius = _ref2$theme.borderRadius,\n spacing = _ref2$theme.spacing,\n colors = _ref2$theme.colors;\n return _ref3 = {\n label: 'menu'\n }, _defineProperty(_ref3, alignToControl(placement), '100%'), _defineProperty(_ref3, \"backgroundColor\", colors.neutral0), _defineProperty(_ref3, \"borderRadius\", borderRadius), _defineProperty(_ref3, \"boxShadow\", '0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)'), _defineProperty(_ref3, \"marginBottom\", spacing.menuGutter), _defineProperty(_ref3, \"marginTop\", spacing.menuGutter), _defineProperty(_ref3, \"position\", 'absolute'), _defineProperty(_ref3, \"width\", '100%'), _defineProperty(_ref3, \"zIndex\", 1), _ref3;\n}; // NOTE: internal only\n\n\nexports.menuCSS = menuCSS;\n\nvar MenuPlacer =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(MenuPlacer, _Component);\n\n function MenuPlacer() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, MenuPlacer);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(MenuPlacer)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"state\", {\n maxHeight: _this.props.maxMenuHeight,\n placement: null\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getPlacement\", function (ref) {\n var _this$props = _this.props,\n minMenuHeight = _this$props.minMenuHeight,\n maxMenuHeight = _this$props.maxMenuHeight,\n menuPlacement = _this$props.menuPlacement,\n menuPosition = _this$props.menuPosition,\n menuShouldScrollIntoView = _this$props.menuShouldScrollIntoView,\n theme = _this$props.theme;\n var getPortalPlacement = _this.context.getPortalPlacement;\n if (!ref) return; // DO NOT scroll if position is fixed\n\n var isFixedPosition = menuPosition === 'fixed';\n var shouldScroll = menuShouldScrollIntoView && !isFixedPosition;\n var state = getMenuPlacement({\n maxHeight: maxMenuHeight,\n menuEl: ref,\n minHeight: minMenuHeight,\n placement: menuPlacement,\n shouldScroll: shouldScroll,\n isFixedPosition: isFixedPosition,\n theme: theme\n });\n if (getPortalPlacement) getPortalPlacement(state);\n\n _this.setState(state);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getUpdatedProps\", function () {\n var menuPlacement = _this.props.menuPlacement;\n var placement = _this.state.placement || coercePlacement(menuPlacement);\n return _objectSpread({}, _this.props, {\n placement: placement,\n maxHeight: _this.state.maxHeight\n });\n });\n\n return _this;\n }\n\n _createClass(MenuPlacer, [{\n key: \"render\",\n value: function render() {\n var children = this.props.children;\n return children({\n ref: this.getPlacement,\n placerProps: this.getUpdatedProps()\n });\n }\n }]);\n\n return MenuPlacer;\n}(_react.Component);\n\nexports.MenuPlacer = MenuPlacer;\n\n_defineProperty(MenuPlacer, \"contextTypes\", {\n getPortalPlacement: _propTypes.default.func\n});\n\nvar Menu = function Menu(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerRef = props.innerRef,\n innerProps = props.innerProps;\n var cn = cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('menu', props)), {\n menu: true\n }, className);\n return _react.default.createElement(\"div\", _extends({\n className: cn\n }, innerProps, {\n ref: innerRef\n }), children);\n};\n\nvar _default = Menu; // ==============================\n// Menu List\n// ==============================\n\nexports.default = _default;\n\nvar menuListCSS = function menuListCSS(_ref4) {\n var maxHeight = _ref4.maxHeight,\n baseUnit = _ref4.theme.spacing.baseUnit;\n return {\n maxHeight: maxHeight,\n overflowY: 'auto',\n paddingBottom: baseUnit,\n paddingTop: baseUnit,\n position: 'relative',\n // required for offset[Height, Top] > keyboard scroll\n WebkitOverflowScrolling: 'touch'\n };\n};\n\nexports.menuListCSS = menuListCSS;\n\nvar MenuList = function MenuList(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n isMulti = props.isMulti,\n innerRef = props.innerRef;\n return _react.default.createElement(\"div\", {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('menuList', props)), {\n 'menu-list': true,\n 'menu-list--is-multi': isMulti\n }, className),\n ref: innerRef\n }, children);\n}; // ==============================\n// Menu Notices\n// ==============================\n\n\nexports.MenuList = MenuList;\n\nvar noticeCSS = function noticeCSS(_ref5) {\n var _ref5$theme = _ref5.theme,\n baseUnit = _ref5$theme.spacing.baseUnit,\n colors = _ref5$theme.colors;\n return {\n color: colors.neutral40,\n padding: \"\".concat(baseUnit * 2, \"px \").concat(baseUnit * 3, \"px\"),\n textAlign: 'center'\n };\n};\n\nvar noOptionsMessageCSS = noticeCSS;\nexports.noOptionsMessageCSS = noOptionsMessageCSS;\nvar loadingMessageCSS = noticeCSS;\nexports.loadingMessageCSS = loadingMessageCSS;\n\nvar NoOptionsMessage = function NoOptionsMessage(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps;\n return _react.default.createElement(\"div\", _extends({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('noOptionsMessage', props)), {\n 'menu-notice': true,\n 'menu-notice--no-options': true\n }, className)\n }, innerProps), children);\n};\n\nexports.NoOptionsMessage = NoOptionsMessage;\nNoOptionsMessage.defaultProps = {\n children: 'No options'\n};\n\nvar LoadingMessage = function LoadingMessage(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps;\n return _react.default.createElement(\"div\", _extends({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('loadingMessage', props)), {\n 'menu-notice': true,\n 'menu-notice--loading': true\n }, className)\n }, innerProps), children);\n};\n\nexports.LoadingMessage = LoadingMessage;\nLoadingMessage.defaultProps = {\n children: 'Loading...'\n}; // ==============================\n// Menu Portal\n// ==============================\n\nvar menuPortalCSS = function menuPortalCSS(_ref6) {\n var rect = _ref6.rect,\n offset = _ref6.offset,\n position = _ref6.position;\n return {\n left: rect.left,\n position: position,\n top: offset,\n width: rect.width,\n zIndex: 1\n };\n};\n\nexports.menuPortalCSS = menuPortalCSS;\n\nvar MenuPortal =\n/*#__PURE__*/\nfunction (_Component2) {\n _inherits(MenuPortal, _Component2);\n\n function MenuPortal() {\n var _getPrototypeOf3;\n\n var _this2;\n\n _classCallCheck(this, MenuPortal);\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this2 = _possibleConstructorReturn(this, (_getPrototypeOf3 = _getPrototypeOf(MenuPortal)).call.apply(_getPrototypeOf3, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"state\", {\n placement: null\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this2)), \"getPortalPlacement\", function (_ref7) {\n var placement = _ref7.placement;\n var initialPlacement = coercePlacement(_this2.props.menuPlacement); // avoid re-renders if the placement has not changed\n\n if (placement !== initialPlacement) {\n _this2.setState({\n placement: placement\n });\n }\n });\n\n return _this2;\n }\n\n _createClass(MenuPortal, [{\n key: \"getChildContext\",\n value: function getChildContext() {\n return {\n getPortalPlacement: this.getPortalPlacement\n };\n } // callback for occassions where the menu must \"flip\"\n\n }, {\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n appendTo = _this$props2.appendTo,\n children = _this$props2.children,\n controlElement = _this$props2.controlElement,\n menuPlacement = _this$props2.menuPlacement,\n position = _this$props2.menuPosition,\n getStyles = _this$props2.getStyles;\n var isFixed = position === 'fixed'; // bail early if required elements aren't present\n\n if (!appendTo && !isFixed || !controlElement) {\n return null;\n }\n\n var placement = this.state.placement || coercePlacement(menuPlacement);\n var rect = (0, _utils.getBoundingClientObj)(controlElement);\n var scrollDistance = isFixed ? 0 : window.pageYOffset;\n var offset = rect[placement] + scrollDistance;\n var state = {\n offset: offset,\n position: position,\n rect: rect\n }; // same wrapper element whether fixed or portalled\n\n var menuWrapper = _react.default.createElement(\"div\", {\n className:\n /*#__PURE__*/\n\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('menuPortal', state))\n }, children);\n\n return appendTo ? (0, _reactDom.createPortal)(menuWrapper, appendTo) : menuWrapper;\n }\n }]);\n\n return MenuPortal;\n}(_react.Component);\n\nexports.MenuPortal = MenuPortal;\n\n_defineProperty(MenuPortal, \"childContextTypes\", {\n getPortalPlacement: _propTypes.default.func\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.classNames = classNames;\nexports.handleInputChange = handleInputChange;\nexports.isDocumentElement = isDocumentElement;\nexports.normalizedHeight = normalizedHeight;\nexports.getScrollTop = getScrollTop;\nexports.scrollTo = scrollTo;\nexports.getScrollParent = getScrollParent;\nexports.animatedScrollTo = animatedScrollTo;\nexports.scrollIntoView = scrollIntoView;\nexports.getBoundingClientObj = getBoundingClientObj;\nexports.toKey = toKey;\nexports.isTouchCapable = isTouchCapable;\nexports.isMobileDevice = isMobileDevice;\nexports.cleanValue = exports.emptyString = exports.noop = void 0;\n\nvar _raf = _interopRequireDefault(require(\"raf\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n} // ==============================\n// NO OP\n// ==============================\n\n\nvar noop = function noop() {};\n\nexports.noop = noop;\n\nvar emptyString = function emptyString() {\n return '';\n}; // ==============================\n// Class Name Prefixer\n// ==============================\n\n/**\n String representation of component state for styling with class names.\n\n Expects an array of strings OR a string/object pair:\n - className(['comp', 'comp-arg', 'comp-arg-2'])\n @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2'\n - className('comp', { some: true, state: false })\n @returns 'react-select__comp react-select__comp--some'\n*/\n\n\nexports.emptyString = emptyString;\n\nfunction applyPrefixToName(prefix, name) {\n if (!name) {\n return prefix;\n } else if (name[0] === '-') {\n return prefix + name;\n } else {\n return prefix + '__' + name;\n }\n}\n\nfunction classNames(prefix, cssKey, state, className) {\n var arr = [cssKey, className];\n\n if (state && prefix) {\n for (var key in state) {\n if (state.hasOwnProperty(key) && state[key]) {\n arr.push(\"\".concat(applyPrefixToName(prefix, key)));\n }\n }\n }\n\n return arr.filter(function (i) {\n return i;\n }).map(function (i) {\n return String(i).trim();\n }).join(' ');\n} // ==============================\n// Clean Value\n// ==============================\n\n\nvar cleanValue = function cleanValue(value) {\n if (Array.isArray(value)) return value.filter(Boolean);\n if (_typeof(value) === 'object' && value !== null) return [value];\n return [];\n}; // ==============================\n// Handle Input Change\n// ==============================\n\n\nexports.cleanValue = cleanValue;\n\nfunction handleInputChange(inputValue, actionMeta, onInputChange) {\n if (onInputChange) {\n var newValue = onInputChange(inputValue, actionMeta);\n if (typeof newValue === 'string') return newValue;\n }\n\n return inputValue;\n} // ==============================\n// Scroll Helpers\n// ==============================\n\n\nfunction isDocumentElement(el) {\n return [document.documentElement, document.body, window].indexOf(el) > -1;\n} // Normalized Scroll Top\n// ------------------------------\n\n\nfunction normalizedHeight(el) {\n if (isDocumentElement(el)) {\n return window.innerHeight;\n }\n\n return el.clientHeight;\n} // Normalized scrollTo & scrollTop\n// ------------------------------\n\n\nfunction getScrollTop(el) {\n if (isDocumentElement(el)) {\n return window.pageYOffset;\n }\n\n return el.scrollTop;\n}\n\nfunction scrollTo(el, top) {\n // with a scroll distance, we perform scroll on the element\n if (isDocumentElement(el)) {\n window.scrollTo(0, top);\n return;\n }\n\n el.scrollTop = top;\n} // Get Scroll Parent\n// ------------------------------\n\n\nfunction getScrollParent(element) {\n var style = getComputedStyle(element);\n var excludeStaticParent = style.position === 'absolute';\n var overflowRx = /(auto|scroll)/;\n var docEl = document.documentElement; // suck it, flow...\n\n if (style.position === 'fixed') return docEl;\n\n for (var parent = element; parent = parent.parentElement;) {\n style = getComputedStyle(parent);\n\n if (excludeStaticParent && style.position === 'static') {\n continue;\n }\n\n if (overflowRx.test(style.overflow + style.overflowY + style.overflowX)) {\n return parent;\n }\n }\n\n return docEl;\n} // Animated Scroll To\n// ------------------------------\n\n/**\n @param t: time (elapsed)\n @param b: initial value\n @param c: amount of change\n @param d: duration\n*/\n\n\nfunction easeOutCubic(t, b, c, d) {\n return c * ((t = t / d - 1) * t * t + 1) + b;\n}\n\nfunction animatedScrollTo(element, to) {\n var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200;\n var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop;\n var start = getScrollTop(element);\n var change = to - start;\n var increment = 10;\n var currentTime = 0;\n\n function animateScroll() {\n currentTime += increment;\n var val = easeOutCubic(currentTime, start, change, duration);\n scrollTo(element, val);\n\n if (currentTime < duration) {\n (0, _raf.default)(animateScroll);\n } else {\n callback(element);\n }\n }\n\n animateScroll();\n} // Scroll Into View\n// ------------------------------\n\n\nfunction scrollIntoView(menuEl, focusedEl) {\n var menuRect = menuEl.getBoundingClientRect();\n var focusedRect = focusedEl.getBoundingClientRect();\n var overScroll = focusedEl.offsetHeight / 3;\n\n if (focusedRect.bottom + overScroll > menuRect.bottom) {\n scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight));\n } else if (focusedRect.top - overScroll < menuRect.top) {\n scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));\n }\n} // ==============================\n// Get bounding client object\n// ==============================\n// cannot get keys using array notation with DOMRect\n\n\nfunction getBoundingClientObj(element) {\n var rect = element.getBoundingClientRect();\n return {\n bottom: rect.bottom,\n height: rect.height,\n left: rect.left,\n right: rect.right,\n top: rect.top,\n width: rect.width\n };\n} // ==============================\n// String to Key (kebabify)\n// ==============================\n\n\nfunction toKey(str) {\n return str.replace(/\\W/g, '-');\n} // ==============================\n// Touch Capability Detector\n// ==============================\n\n\nfunction isTouchCapable() {\n try {\n document.createEvent('TouchEvent');\n return true;\n } catch (e) {\n return false;\n }\n} // ==============================\n// Mobile Device Detector\n// ==============================\n\n\nfunction isMobileDevice() {\n try {\n return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);\n } catch (e) {\n return false;\n }\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = require(\"react\");\n\nvar _reactDom = require(\"react-dom\");\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _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\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nvar NodeResolver =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(NodeResolver, _Component);\n\n function NodeResolver() {\n _classCallCheck(this, NodeResolver);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(NodeResolver).apply(this, arguments));\n }\n\n _createClass(NodeResolver, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.props.innerRef((0, _reactDom.findDOMNode)(this));\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.props.innerRef(null);\n }\n }, {\n key: \"render\",\n value: function render() {\n return this.props.children;\n }\n }]);\n\n return NodeResolver;\n}(_react.Component);\n\nexports.default = NodeResolver;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LoadingIndicator = exports.loadingIndicatorCSS = exports.IndicatorSeparator = exports.indicatorSeparatorCSS = exports.ClearIndicator = exports.clearIndicatorCSS = exports.DropdownIndicator = exports.dropdownIndicatorCSS = exports.DownChevron = exports.CrossIcon = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\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 _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// Dropdown & Clear Icons\n// ==============================\n\n\nvar Svg = function Svg(_ref) {\n var size = _ref.size,\n props = _objectWithoutProperties(_ref, [\"size\"]);\n\n return _react.default.createElement(\"svg\", _extends({\n height: size,\n width: size,\n viewBox: \"0 0 20 20\",\n \"aria-hidden\": \"true\",\n focusable: \"false\",\n className:\n /*#__PURE__*/\n\n /*#__PURE__*/\n (0, _emotion.css)({\n display: 'inline-block',\n fill: 'currentColor',\n lineHeight: 1,\n stroke: 'currentColor',\n strokeWidth: 0\n })\n }, props));\n};\n\nvar CrossIcon = function CrossIcon(props) {\n return _react.default.createElement(Svg, _extends({\n size: 20\n }, props), _react.default.createElement(\"path\", {\n d: \"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z\"\n }));\n};\n\nexports.CrossIcon = CrossIcon;\n\nvar DownChevron = function DownChevron(props) {\n return _react.default.createElement(Svg, _extends({\n size: 20\n }, props), _react.default.createElement(\"path\", {\n d: \"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z\"\n }));\n}; // ==============================\n// Dropdown & Clear Buttons\n// ==============================\n\n\nexports.DownChevron = DownChevron;\n\nvar baseCSS = function baseCSS(_ref2) {\n var isFocused = _ref2.isFocused,\n _ref2$theme = _ref2.theme,\n baseUnit = _ref2$theme.spacing.baseUnit,\n colors = _ref2$theme.colors;\n return {\n label: 'indicatorContainer',\n color: isFocused ? colors.neutral60 : colors.neutral20,\n display: 'flex',\n padding: baseUnit * 2,\n transition: 'color 150ms',\n ':hover': {\n color: isFocused ? colors.neutral80 : colors.neutral40\n }\n };\n};\n\nvar dropdownIndicatorCSS = baseCSS;\nexports.dropdownIndicatorCSS = dropdownIndicatorCSS;\n\nvar DropdownIndicator = function DropdownIndicator(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps;\n return _react.default.createElement(\"div\", _extends({}, innerProps, {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('dropdownIndicator', props)), {\n 'indicator': true,\n 'dropdown-indicator': true\n }, className)\n }), children || _react.default.createElement(DownChevron, null));\n};\n\nexports.DropdownIndicator = DropdownIndicator;\nvar clearIndicatorCSS = baseCSS;\nexports.clearIndicatorCSS = clearIndicatorCSS;\n\nvar ClearIndicator = function ClearIndicator(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps;\n return _react.default.createElement(\"div\", _extends({}, innerProps, {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('clearIndicator', props)), {\n 'indicator': true,\n 'clear-indicator': true\n }, className)\n }), children || _react.default.createElement(CrossIcon, null));\n}; // ==============================\n// Separator\n// ==============================\n\n\nexports.ClearIndicator = ClearIndicator;\n\nvar indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref3) {\n var isDisabled = _ref3.isDisabled,\n _ref3$theme = _ref3.theme,\n baseUnit = _ref3$theme.spacing.baseUnit,\n colors = _ref3$theme.colors;\n return {\n label: 'indicatorSeparator',\n alignSelf: 'stretch',\n backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20,\n marginBottom: baseUnit * 2,\n marginTop: baseUnit * 2,\n width: 1\n };\n};\n\nexports.indicatorSeparatorCSS = indicatorSeparatorCSS;\n\nvar IndicatorSeparator = function IndicatorSeparator(props) {\n var className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps;\n return _react.default.createElement(\"span\", _extends({}, innerProps, {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('indicatorSeparator', props)), {\n 'indicator-separator': true\n }, className)\n }));\n}; // ==============================\n// Loading\n// ==============================\n\n\nexports.IndicatorSeparator = IndicatorSeparator;\nvar keyframesName = 'react-select-loading-indicator';\nvar keyframesInjected = false;\n\nvar loadingIndicatorCSS = function loadingIndicatorCSS(_ref4) {\n var isFocused = _ref4.isFocused,\n size = _ref4.size,\n _ref4$theme = _ref4.theme,\n colors = _ref4$theme.colors,\n baseUnit = _ref4$theme.spacing.baseUnit;\n return {\n label: 'loadingIndicator',\n color: isFocused ? colors.neutral60 : colors.neutral20,\n display: 'flex',\n padding: baseUnit * 2,\n transition: 'color 150ms',\n alignSelf: 'center',\n fontSize: size,\n lineHeight: 1,\n marginRight: size,\n textAlign: 'center',\n verticalAlign: 'middle'\n };\n};\n\nexports.loadingIndicatorCSS = loadingIndicatorCSS;\n\nvar LoadingDot = function LoadingDot(_ref5) {\n var color = _ref5.color,\n delay = _ref5.delay,\n offset = _ref5.offset;\n return _react.default.createElement(\"span\", {\n className:\n /*#__PURE__*/\n\n /*#__PURE__*/\n (0, _emotion.css)({\n animationDuration: '1s',\n animationDelay: \"\".concat(delay, \"ms\"),\n animationIterationCount: 'infinite',\n animationName: keyframesName,\n animationTimingFunction: 'ease-in-out',\n backgroundColor: color,\n borderRadius: '1em',\n display: 'inline-block',\n marginLeft: offset ? '1em' : null,\n height: '1em',\n verticalAlign: 'top',\n width: '1em'\n })\n });\n};\n\nvar LoadingIndicator = function LoadingIndicator(props) {\n var className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n isFocused = props.isFocused,\n isRtl = props.isRtl,\n colors = props.theme.colors;\n var color = isFocused ? colors.neutral80 : colors.neutral20;\n\n if (!keyframesInjected) {\n // eslint-disable-next-line no-unused-expressions\n (0, _emotion.injectGlobal)(\"@keyframes \", keyframesName, \"{0%,80%,100%{opacity:0;}40%{opacity:1;}};\");\n keyframesInjected = true;\n }\n\n return _react.default.createElement(\"div\", _extends({}, innerProps, {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('loadingIndicator', props)), {\n 'indicator': true,\n 'loading-indicator': true\n }, className)\n }), _react.default.createElement(LoadingDot, {\n color: color,\n delay: 0,\n offset: isRtl\n }), _react.default.createElement(LoadingDot, {\n color: color,\n delay: 160,\n offset: true\n }), _react.default.createElement(LoadingDot, {\n color: color,\n delay: 320,\n offset: !isRtl\n }));\n};\n\nexports.LoadingIndicator = LoadingIndicator;\nLoadingIndicator.defaultProps = {\n size: 4\n};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport Icon from 'flavours/glitch/components/icon';\n\nconst ColumnLink = ({ icon, text, to, onClick, href, method, badge }) => {\n const badgeElement = typeof badge !== 'undefined' ? {badge} : null;\n\n if (href) {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n } else if (to) {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n } else {\n const handleOnClick = (e) => {\n e.preventDefault();\n e.stopPropagation();\n return onClick(e);\n }\n return (\n \n \n {text}\n {badgeElement}\n \n );\n }\n};\n\nColumnLink.propTypes = {\n icon: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n to: PropTypes.string,\n onClick: PropTypes.func,\n href: PropTypes.string,\n method: PropTypes.string,\n badge: PropTypes.node,\n};\n\nexport default ColumnLink;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ColumnSubheading = ({ text }) => {\n return (\n \n {text}\n
\n );\n};\n\nColumnSubheading.propTypes = {\n text: PropTypes.string.isRequired,\n};\n\nexport default ColumnSubheading;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Toggle from 'react-toggle';\n\nexport default class SettingToggle extends React.PureComponent {\n\n static propTypes = {\n prefix: PropTypes.string,\n settings: ImmutablePropTypes.map.isRequired,\n settingPath: PropTypes.array.isRequired,\n label: PropTypes.node.isRequired,\n onChange: PropTypes.func.isRequired,\n defaultValue: PropTypes.bool,\n }\n\n onChange = ({ target }) => {\n this.props.onChange(this.props.settingPath, target.checked);\n }\n\n render () {\n const { prefix, settings, settingPath, label, defaultValue } = this.props;\n const id = ['setting-toggle', prefix, ...settingPath].filter(Boolean).join('-');\n\n return (\n \n \n {label} \n
\n );\n }\n\n}\n","// optional / simple context binding\nvar aFunction = require('./_a-function');\n\nmodule.exports = function (fn, that, length) {\n aFunction(fn);\n if (that === undefined) return fn;\n\n switch (length) {\n case 1:\n return function (a) {\n return fn.call(that, a);\n };\n\n case 2:\n return function (a, b) {\n return fn.call(that, a, b);\n };\n\n case 3:\n return function (a, b, c) {\n return fn.call(that, a, b, c);\n };\n }\n\n return function ()\n /* ...args */\n {\n return fn.apply(that, arguments);\n };\n};","var isObject = require('./_is-object');\n\nvar document = require('./_global').document; // typeof document.createElement is 'object' in old IE\n\n\nvar is = isObject(document) && isObject(document.createElement);\n\nmodule.exports = function (it) {\n return is ? document.createElement(it) : {};\n};","var toString = {}.toString;\n\nmodule.exports = function (it) {\n return toString.call(it).slice(8, -1);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer');\n\nvar min = Math.min;\n\nmodule.exports = function (it) {\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","var core = require('./_core');\n\nvar global = require('./_global');\n\nvar SHARED = '__core-js_shared__';\nvar store = global[SHARED] || (global[SHARED] = {});\n(module.exports = function (key, value) {\n return store[key] || (store[key] = value !== undefined ? value : {});\n})('versions', []).push({\n version: core.version,\n mode: require('./_library') ? 'pure' : 'global',\n copyright: '© 2018 Denis Pushkarev (zloirock.ru)'\n});","module.exports = true;","var id = 0;\nvar px = Math.random();\n\nmodule.exports = function (key) {\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","// IE 8- don't enum bug keys\nmodule.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(',');","var def = require('./_object-dp').f;\n\nvar has = require('./_has');\n\nvar TAG = require('./_wks')('toStringTag');\n\nmodule.exports = function (it, tag, stat) {\n if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, {\n configurable: true,\n value: tag\n });\n};","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { injectIntl, defineMessages } from 'react-intl';\nimport Icon from 'flavours/glitch/components/icon';\n\nconst messages = defineMessages({\n load_more: { id: 'status.load_more', defaultMessage: 'Load more' },\n});\n\nexport default @injectIntl\nclass LoadGap extends React.PureComponent {\n\n static propTypes = {\n disabled: PropTypes.bool,\n maxId: PropTypes.string,\n onClick: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleClick = () => {\n this.props.onClick(this.props.maxId);\n }\n\n render () {\n const { disabled, intl } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport SettingText from 'flavours/glitch/components/setting_text';\nimport SettingToggle from 'flavours/glitch/features/notifications/components/setting_toggle';\n\nconst messages = defineMessages({\n filter_regex: { id: 'home.column_settings.filter_regex', defaultMessage: 'Filter out by regular expressions' },\n settings: { id: 'home.settings', defaultMessage: 'Column settings' },\n});\n\nexport default @injectIntl\nclass ColumnSettings extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n onChange: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n columnId: PropTypes.string,\n };\n\n render () {\n const { settings, onChange, intl } = this.props;\n\n return (\n \n
\n } />\n
\n\n
\n\n
\n \n
\n
\n );\n }\n\n}\n","var baseIsEqual = require('./_baseIsEqual');\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\n\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.makeAsyncSelect = exports.defaultProps = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _Select = _interopRequireDefault(require(\"./Select\"));\n\nvar _utils = require(\"./utils\");\n\nvar _stateManager = _interopRequireDefault(require(\"./stateManager\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\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 _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 _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\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\nvar defaultProps = {\n cacheOptions: false,\n defaultOptions: false,\n filterOption: null\n};\nexports.defaultProps = defaultProps;\n\nvar makeAsyncSelect = function makeAsyncSelect(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inherits(Async, _Component);\n\n function Async(props) {\n var _this;\n\n _classCallCheck(this, Async);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Async).call(this));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"select\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"lastRequest\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"mounted\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"optionsCache\", {});\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"handleInputChange\", function (newValue, actionMeta) {\n var _this$props = _this.props,\n cacheOptions = _this$props.cacheOptions,\n onInputChange = _this$props.onInputChange; // TODO\n\n var inputValue = (0, _utils.handleInputChange)(newValue, actionMeta, onInputChange);\n\n if (!inputValue) {\n delete _this.lastRequest;\n\n _this.setState({\n inputValue: '',\n loadedInputValue: '',\n loadedOptions: [],\n isLoading: false,\n passEmptyOptions: false\n });\n\n return;\n }\n\n if (cacheOptions && _this.optionsCache[inputValue]) {\n _this.setState({\n inputValue: inputValue,\n loadedInputValue: inputValue,\n loadedOptions: _this.optionsCache[inputValue],\n isLoading: false,\n passEmptyOptions: false\n });\n } else {\n var request = _this.lastRequest = {};\n\n _this.setState({\n inputValue: inputValue,\n isLoading: true,\n passEmptyOptions: !_this.state.loadedInputValue\n }, function () {\n _this.loadOptions(inputValue, function (options) {\n if (!_this.mounted) return;\n\n if (options) {\n _this.optionsCache[inputValue] = options;\n }\n\n if (request !== _this.lastRequest) return;\n delete _this.lastRequest;\n\n _this.setState({\n isLoading: false,\n loadedInputValue: inputValue,\n loadedOptions: options || [],\n passEmptyOptions: false\n });\n });\n });\n }\n\n return inputValue;\n });\n\n _this.state = {\n defaultOptions: Array.isArray(props.defaultOptions) ? props.defaultOptions : undefined,\n inputValue: typeof props.inputValue !== 'undefined' ? props.inputValue : '',\n isLoading: props.defaultOptions === true ? true : false,\n loadedOptions: [],\n passEmptyOptions: false\n };\n return _this;\n }\n\n _createClass(Async, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n this.mounted = true;\n var defaultOptions = this.props.defaultOptions;\n var inputValue = this.state.inputValue;\n\n if (defaultOptions === true) {\n this.loadOptions(inputValue, function (options) {\n if (!_this2.mounted) return;\n var isLoading = !!_this2.lastRequest;\n\n _this2.setState({\n defaultOptions: options || [],\n isLoading: isLoading\n });\n });\n }\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n // if the cacheOptions prop changes, clear the cache\n if (nextProps.cacheOptions !== this.props.cacheOptions) {\n this.optionsCache = {};\n }\n\n if (nextProps.defaultOptions !== this.props.defaultOptions) {\n this.setState({\n defaultOptions: Array.isArray(nextProps.defaultOptions) ? nextProps.defaultOptions : undefined\n });\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.mounted = false;\n }\n }, {\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.select.blur();\n }\n }, {\n key: \"loadOptions\",\n value: function loadOptions(inputValue, callback) {\n var loadOptions = this.props.loadOptions;\n if (!loadOptions) return callback();\n var loader = loadOptions(inputValue, callback);\n\n if (loader && typeof loader.then === 'function') {\n loader.then(callback, function () {\n return callback();\n });\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n\n var _this$props2 = this.props,\n loadOptions = _this$props2.loadOptions,\n props = _objectWithoutProperties(_this$props2, [\"loadOptions\"]);\n\n var _this$state = this.state,\n defaultOptions = _this$state.defaultOptions,\n inputValue = _this$state.inputValue,\n isLoading = _this$state.isLoading,\n loadedInputValue = _this$state.loadedInputValue,\n loadedOptions = _this$state.loadedOptions,\n passEmptyOptions = _this$state.passEmptyOptions;\n var options = passEmptyOptions ? [] : inputValue && loadedInputValue ? loadedOptions : defaultOptions || [];\n return _react.default.createElement(SelectComponent, _extends({}, props, {\n ref: function ref(_ref) {\n _this3.select = _ref;\n },\n options: options,\n isLoading: isLoading,\n onInputChange: this.handleInputChange\n }));\n }\n }]);\n\n return Async;\n }(_react.Component), _defineProperty(_class, \"defaultProps\", defaultProps), _temp;\n};\n\nexports.makeAsyncSelect = makeAsyncSelect;\nvar SelectState = (0, _stateManager.default)(_Select.default);\n\nvar _default = makeAsyncSelect(SelectState);\n\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.IndicatorsContainer = exports.indicatorsContainerCSS = exports.ValueContainer = exports.valueContainerCSS = exports.SelectContainer = exports.containerCSS = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _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\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\nvar containerCSS = function containerCSS(_ref) {\n var isDisabled = _ref.isDisabled,\n isRtl = _ref.isRtl;\n return {\n label: 'container',\n direction: isRtl ? 'rtl' : null,\n pointerEvents: isDisabled ? 'none' : null,\n // cancel mouse events when disabled\n position: 'relative'\n };\n};\n\nexports.containerCSS = containerCSS;\n\nvar SelectContainer = function SelectContainer(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps,\n isDisabled = props.isDisabled,\n isRtl = props.isRtl;\n return _react.default.createElement(\"div\", _extends({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('container', props)), {\n '--is-disabled': isDisabled,\n '--is-rtl': isRtl\n }, className)\n }, innerProps), children);\n}; // ==============================\n// Value Container\n// ==============================\n\n\nexports.SelectContainer = SelectContainer;\n\nvar valueContainerCSS = function valueContainerCSS(_ref2) {\n var spacing = _ref2.theme.spacing;\n return {\n alignItems: 'center',\n display: 'flex',\n flex: 1,\n flexWrap: 'wrap',\n padding: \"\".concat(spacing.baseUnit / 2, \"px \").concat(spacing.baseUnit * 2, \"px\"),\n WebkitOverflowScrolling: 'touch',\n position: 'relative',\n overflow: 'hidden'\n };\n};\n\nexports.valueContainerCSS = valueContainerCSS;\n\nvar ValueContainer =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ValueContainer, _Component);\n\n function ValueContainer() {\n _classCallCheck(this, ValueContainer);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ValueContainer).apply(this, arguments));\n }\n\n _createClass(ValueContainer, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n className = _this$props.className,\n cx = _this$props.cx,\n isMulti = _this$props.isMulti,\n getStyles = _this$props.getStyles,\n hasValue = _this$props.hasValue;\n return _react.default.createElement(\"div\", {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('valueContainer', this.props)), {\n 'value-container': true,\n 'value-container--is-multi': isMulti,\n 'value-container--has-value': hasValue\n }, className)\n }, children);\n }\n }]);\n\n return ValueContainer;\n}(_react.Component); // ==============================\n// Indicator Container\n// ==============================\n\n\nexports.ValueContainer = ValueContainer;\n\nvar indicatorsContainerCSS = function indicatorsContainerCSS() {\n return {\n alignItems: 'center',\n alignSelf: 'stretch',\n display: 'flex',\n flexShrink: 0\n };\n};\n\nexports.indicatorsContainerCSS = indicatorsContainerCSS;\n\nvar IndicatorsContainer = function IndicatorsContainer(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles;\n return _react.default.createElement(\"div\", {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('indicatorsContainer', props)), {\n 'indicators': true\n }, className)\n }, children);\n};\n\nexports.IndicatorsContainer = IndicatorsContainer;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.css = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\nvar css = function css(_ref) {\n var isDisabled = _ref.isDisabled,\n isFocused = _ref.isFocused,\n _ref$theme = _ref.theme,\n colors = _ref$theme.colors,\n borderRadius = _ref$theme.borderRadius,\n spacing = _ref$theme.spacing;\n return {\n label: 'control',\n alignItems: 'center',\n backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0,\n borderColor: isDisabled ? colors.neutral10 : isFocused ? colors.primary : colors.neutral20,\n borderRadius: borderRadius,\n borderStyle: 'solid',\n borderWidth: 1,\n boxShadow: isFocused ? \"0 0 0 1px \".concat(colors.primary) : null,\n cursor: 'default',\n display: 'flex',\n flexWrap: 'wrap',\n justifyContent: 'space-between',\n minHeight: spacing.controlHeight,\n outline: '0 !important',\n position: 'relative',\n transition: 'all 100ms',\n '&:hover': {\n borderColor: isFocused ? colors.primary : colors.neutral30\n }\n };\n};\n\nexports.css = css;\n\nvar Control = function Control(props) {\n var children = props.children,\n cx = props.cx,\n getStyles = props.getStyles,\n className = props.className,\n isDisabled = props.isDisabled,\n isFocused = props.isFocused,\n innerRef = props.innerRef,\n innerProps = props.innerProps,\n menuIsOpen = props.menuIsOpen;\n return _react.default.createElement(\"div\", _extends({\n ref: innerRef,\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('control', props)), {\n 'control': true,\n 'control--is-disabled': isDisabled,\n 'control--is-focused': isFocused,\n 'control--menu-is-open': menuIsOpen\n }, className)\n }, innerProps), children);\n};\n\nvar _default = Control;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.GroupHeading = exports.groupHeadingCSS = exports.groupCSS = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\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 _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 _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 _extends() {\n _extends = Object.assign || 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\nvar groupCSS = function groupCSS(_ref) {\n var spacing = _ref.theme.spacing;\n return {\n paddingBottom: spacing.baseUnit * 2,\n paddingTop: spacing.baseUnit * 2\n };\n};\n\nexports.groupCSS = groupCSS;\n\nvar Group = function Group(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n Heading = props.Heading,\n headingProps = props.headingProps,\n label = props.label,\n theme = props.theme,\n selectProps = props.selectProps;\n return _react.default.createElement(\"div\", {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('group', props)), {\n 'group': true\n }, className)\n }, _react.default.createElement(Heading, _extends({}, headingProps, {\n selectProps: selectProps,\n theme: theme,\n getStyles: getStyles,\n cx: cx\n }), label), _react.default.createElement(\"div\", null, children));\n};\n\nvar groupHeadingCSS = function groupHeadingCSS(_ref2) {\n var spacing = _ref2.theme.spacing;\n return {\n label: 'group',\n color: '#999',\n cursor: 'default',\n display: 'block',\n fontSize: '75%',\n fontWeight: '500',\n marginBottom: '0.25em',\n paddingLeft: spacing.baseUnit * 3,\n paddingRight: spacing.baseUnit * 3,\n textTransform: 'uppercase'\n };\n};\n\nexports.groupHeadingCSS = groupHeadingCSS;\n\nvar GroupHeading = function GroupHeading(props) {\n var className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n theme = props.theme,\n selectProps = props.selectProps,\n cleanProps = _objectWithoutProperties(props, [\"className\", \"cx\", \"getStyles\", \"theme\", \"selectProps\"]);\n\n return _react.default.createElement(\"div\", _extends({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('groupHeading', _objectSpread({\n theme: theme\n }, cleanProps))), {\n 'group-heading': true\n }, className)\n }, cleanProps));\n};\n\nexports.GroupHeading = GroupHeading;\nvar _default = Group;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.inputCSS = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nvar _reactInputAutosize = _interopRequireDefault(require(\"react-input-autosize\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\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 _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 _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\nvar inputCSS = function inputCSS(_ref) {\n var isDisabled = _ref.isDisabled,\n _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n margin: spacing.baseUnit / 2,\n paddingBottom: spacing.baseUnit / 2,\n paddingTop: spacing.baseUnit / 2,\n visibility: isDisabled ? 'hidden' : 'visible',\n color: colors.neutral80\n };\n};\n\nexports.inputCSS = inputCSS;\n\nvar inputStyle = function inputStyle(isHidden) {\n return {\n label: 'input',\n background: 0,\n border: 0,\n fontSize: 'inherit',\n opacity: isHidden ? 0 : 1,\n outline: 0,\n padding: 0,\n color: 'inherit'\n };\n};\n\nvar Input = function Input(_ref2) {\n var className = _ref2.className,\n cx = _ref2.cx,\n getStyles = _ref2.getStyles,\n innerRef = _ref2.innerRef,\n isHidden = _ref2.isHidden,\n isDisabled = _ref2.isDisabled,\n theme = _ref2.theme,\n selectProps = _ref2.selectProps,\n props = _objectWithoutProperties(_ref2, [\"className\", \"cx\", \"getStyles\", \"innerRef\", \"isHidden\", \"isDisabled\", \"theme\", \"selectProps\"]);\n\n return _react.default.createElement(\"div\", {\n className:\n /*#__PURE__*/\n\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('input', _objectSpread({\n theme: theme\n }, props)))\n }, _react.default.createElement(_reactInputAutosize.default, _extends({\n className: cx(null, {\n 'input': true\n }, className),\n inputRef: innerRef,\n inputStyle: inputStyle(isHidden),\n disabled: isDisabled\n }, props)));\n};\n\nvar _default = Input;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.MultiValueRemove = exports.MultiValueLabel = exports.MultiValueContainer = exports.MultiValueGeneric = exports.multiValueRemoveCSS = exports.multiValueLabelCSS = exports.multiValueCSS = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nvar _indicators = require(\"./indicators\");\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\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 _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _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\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nvar multiValueCSS = function multiValueCSS(_ref) {\n var _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n borderRadius = _ref$theme.borderRadius,\n colors = _ref$theme.colors;\n return {\n label: 'multiValue',\n backgroundColor: colors.neutral10,\n borderRadius: borderRadius / 2,\n display: 'flex',\n margin: spacing.baseUnit / 2,\n minWidth: 0 // resolves flex/text-overflow bug\n\n };\n};\n\nexports.multiValueCSS = multiValueCSS;\n\nvar multiValueLabelCSS = function multiValueLabelCSS(_ref2) {\n var _ref2$theme = _ref2.theme,\n borderRadius = _ref2$theme.borderRadius,\n colors = _ref2$theme.colors,\n cropWithEllipsis = _ref2.cropWithEllipsis;\n return {\n borderRadius: borderRadius / 2,\n color: colors.neutral80,\n fontSize: '85%',\n overflow: 'hidden',\n padding: 3,\n paddingLeft: 6,\n textOverflow: cropWithEllipsis ? 'ellipsis' : null,\n whiteSpace: 'nowrap'\n };\n};\n\nexports.multiValueLabelCSS = multiValueLabelCSS;\n\nvar multiValueRemoveCSS = function multiValueRemoveCSS(_ref3) {\n var _ref3$theme = _ref3.theme,\n spacing = _ref3$theme.spacing,\n borderRadius = _ref3$theme.borderRadius,\n colors = _ref3$theme.colors,\n isFocused = _ref3.isFocused;\n return {\n alignItems: 'center',\n borderRadius: borderRadius / 2,\n backgroundColor: isFocused && colors.dangerLight,\n display: 'flex',\n paddingLeft: spacing.baseUnit,\n paddingRight: spacing.baseUnit,\n ':hover': {\n backgroundColor: colors.dangerLight,\n color: colors.danger\n }\n };\n};\n\nexports.multiValueRemoveCSS = multiValueRemoveCSS;\n\nvar MultiValueGeneric = function MultiValueGeneric(_ref4) {\n var children = _ref4.children,\n innerProps = _ref4.innerProps;\n return _react.default.createElement(\"div\", innerProps, children);\n};\n\nexports.MultiValueGeneric = MultiValueGeneric;\nvar MultiValueContainer = MultiValueGeneric;\nexports.MultiValueContainer = MultiValueContainer;\nvar MultiValueLabel = MultiValueGeneric;\nexports.MultiValueLabel = MultiValueLabel;\n\nvar MultiValueRemove =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(MultiValueRemove, _Component);\n\n function MultiValueRemove() {\n _classCallCheck(this, MultiValueRemove);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MultiValueRemove).apply(this, arguments));\n }\n\n _createClass(MultiValueRemove, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n innerProps = _this$props.innerProps;\n return _react.default.createElement(\"div\", innerProps, children || _react.default.createElement(_indicators.CrossIcon, {\n size: 14\n }));\n }\n }]);\n\n return MultiValueRemove;\n}(_react.Component);\n\nexports.MultiValueRemove = MultiValueRemove;\n\nvar MultiValue =\n/*#__PURE__*/\nfunction (_Component2) {\n _inherits(MultiValue, _Component2);\n\n function MultiValue() {\n _classCallCheck(this, MultiValue);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(MultiValue).apply(this, arguments));\n }\n\n _createClass(MultiValue, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n children = _this$props2.children,\n className = _this$props2.className,\n components = _this$props2.components,\n cx = _this$props2.cx,\n data = _this$props2.data,\n getStyles = _this$props2.getStyles,\n innerProps = _this$props2.innerProps,\n isDisabled = _this$props2.isDisabled,\n removeProps = _this$props2.removeProps,\n selectProps = _this$props2.selectProps;\n var Container = components.Container,\n Label = components.Label,\n Remove = components.Remove;\n\n var containerInnerProps = _objectSpread({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('multiValue', this.props)), {\n 'multi-value': true,\n 'multi-value--is-disabled': isDisabled\n }, className)\n }, innerProps);\n\n var labelInnerProps = {\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('multiValueLabel', this.props)), {\n 'multi-value__label': true\n }, className)\n };\n\n var removeInnerProps = _objectSpread({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('multiValueRemove', this.props)), {\n 'multi-value__remove': true\n }, className)\n }, removeProps);\n\n return _react.default.createElement(Container, {\n data: data,\n innerProps: containerInnerProps,\n selectProps: selectProps\n }, _react.default.createElement(Label, {\n data: data,\n innerProps: labelInnerProps,\n selectProps: selectProps\n }, children), _react.default.createElement(Remove, {\n data: data,\n innerProps: removeInnerProps,\n selectProps: selectProps\n }));\n }\n }]);\n\n return MultiValue;\n}(_react.Component);\n\n_defineProperty(MultiValue, \"defaultProps\", {\n cropWithEllipsis: true\n});\n\nvar _default = MultiValue;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.optionCSS = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\nvar optionCSS = function optionCSS(_ref) {\n var isDisabled = _ref.isDisabled,\n isFocused = _ref.isFocused,\n isSelected = _ref.isSelected,\n _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n label: 'option',\n backgroundColor: isSelected ? colors.primary : isFocused ? colors.primary25 : 'transparent',\n color: isDisabled ? colors.neutral20 : isSelected ? colors.neutral0 : 'inherit',\n cursor: 'default',\n display: 'block',\n fontSize: 'inherit',\n padding: \"\".concat(spacing.baseUnit * 2, \"px \").concat(spacing.baseUnit * 3, \"px\"),\n width: '100%',\n userSelect: 'none',\n WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)',\n // provide some affordance on touch devices\n ':active': {\n backgroundColor: !isDisabled && (isSelected ? colors.primary : colors.primary50)\n }\n };\n};\n\nexports.optionCSS = optionCSS;\n\nvar Option = function Option(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n isDisabled = props.isDisabled,\n isFocused = props.isFocused,\n isSelected = props.isSelected,\n innerRef = props.innerRef,\n innerProps = props.innerProps;\n return _react.default.createElement(\"div\", _extends({\n ref: innerRef,\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('option', props)), {\n 'option': true,\n 'option--is-disabled': isDisabled,\n 'option--is-focused': isFocused,\n 'option--is-selected': isSelected\n }, className)\n }, innerProps), children);\n};\n\nvar _default = Option;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.placeholderCSS = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\nvar placeholderCSS = function placeholderCSS(_ref) {\n var _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n label: 'placeholder',\n color: colors.neutral50,\n marginLeft: spacing.baseUnit / 2,\n marginRight: spacing.baseUnit / 2,\n position: 'absolute',\n top: '50%',\n transform: 'translateY(-50%)'\n };\n};\n\nexports.placeholderCSS = placeholderCSS;\n\nvar Placeholder = function Placeholder(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n innerProps = props.innerProps;\n return _react.default.createElement(\"div\", _extends({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('placeholder', props)), {\n 'placeholder': true\n }, className)\n }, innerProps), children);\n};\n\nvar _default = Placeholder;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.css = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\nvar css = function css(_ref) {\n var isDisabled = _ref.isDisabled,\n _ref$theme = _ref.theme,\n spacing = _ref$theme.spacing,\n colors = _ref$theme.colors;\n return {\n label: 'singleValue',\n color: isDisabled ? colors.neutral40 : colors.neutral80,\n marginLeft: spacing.baseUnit / 2,\n marginRight: spacing.baseUnit / 2,\n maxWidth: \"calc(100% - \".concat(spacing.baseUnit * 2, \"px)\"),\n overflow: 'hidden',\n position: 'absolute',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n top: '50%',\n transform: 'translateY(-50%)'\n };\n};\n\nexports.css = css;\n\nvar SingleValue = function SingleValue(props) {\n var children = props.children,\n className = props.className,\n cx = props.cx,\n getStyles = props.getStyles,\n isDisabled = props.isDisabled,\n innerProps = props.innerProps;\n return _react.default.createElement(\"div\", _extends({\n className: cx(\n /*#__PURE__*/\n (0, _emotion.css)(getStyles('singleValue', props)), {\n 'single-value': true,\n 'single-value--is-disabled': isDisabled\n }, className)\n }, innerProps), children);\n};\n\nvar _default = SingleValue;\nexports.default = _default;","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { changeListEditorTitle, submitListEditor } from 'flavours/glitch/actions/lists';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n label: { id: 'lists.new.title_placeholder', defaultMessage: 'New list title' },\n title: { id: 'lists.new.create', defaultMessage: 'Add list' },\n});\n\nconst mapStateToProps = state => ({\n value: state.getIn(['listEditor', 'title']),\n disabled: state.getIn(['listEditor', 'isSubmitting']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onChange: value => dispatch(changeListEditorTitle(value)),\n onSubmit: () => dispatch(submitListEditor(true)),\n});\n\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass NewListForm extends React.PureComponent {\n\n static propTypes = {\n value: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleSubmit = e => {\n e.preventDefault();\n this.props.onSubmit();\n }\n\n handleClick = () => {\n this.props.onSubmit();\n }\n\n render () {\n const { value, disabled, intl } = this.props;\n\n const label = intl.formatMessage(messages.label);\n const title = intl.formatMessage(messages.title);\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport Avatar from 'flavours/glitch/components/avatar';\nimport DisplayName from 'flavours/glitch/components/display_name';\nimport IconButton from 'flavours/glitch/components/icon_button';\nimport { defineMessages } from 'react-intl';\n\nconst messages = defineMessages({\n remove: { id: 'lists.account.remove', defaultMessage: 'Remove from list' },\n add: { id: 'lists.account.add', defaultMessage: 'Add to list' },\n});\n\nexport default class Account extends ImmutablePureComponent {\n\n static propTypes = {\n account: ImmutablePropTypes.map.isRequired,\n intl: PropTypes.object.isRequired,\n onRemove: PropTypes.func.isRequired,\n onAdd: PropTypes.func.isRequired,\n added: PropTypes.bool,\n };\n\n static defaultProps = {\n added: false,\n };\n\n render () {\n const { account, intl, onRemove, onAdd, added } = this.props;\n\n let button;\n\n if (added) {\n button = ;\n } else {\n button = ;\n }\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { defineMessages } from 'react-intl';\nimport classNames from 'classnames';\nimport Icon from 'flavours/glitch/components/icon';\n\nconst messages = defineMessages({\n search: { id: 'lists.search', defaultMessage: 'Search among people you follow' },\n});\n\nexport default class Search extends React.PureComponent {\n\n static propTypes = {\n intl: PropTypes.object.isRequired,\n value: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n onClear: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleKeyUp = e => {\n if (e.keyCode === 13) {\n this.props.onSubmit(this.props.value);\n }\n }\n\n handleClear = () => {\n this.props.onClear();\n }\n\n render () {\n const { value, intl } = this.props;\n const hasValue = value.length > 0;\n\n return (\n \n
\n {intl.formatMessage(messages.search)} \n\n \n \n\n
\n \n \n
\n
\n );\n }\n\n}\n","/**\n * This method returns `undefined`.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Util\n * @example\n *\n * _.times(2, _.noop);\n * // => [undefined, undefined]\n */\nfunction noop() {// No operation performed.\n}\n\nmodule.exports = noop;","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { injectIntl, defineMessages } from 'react-intl';\nimport Icon from 'mastodon/components/icon';\n\nconst messages = defineMessages({\n load_more: { id: 'status.load_more', defaultMessage: 'Load more' },\n});\n\nexport default @injectIntl\nclass LoadGap extends React.PureComponent {\n\n static propTypes = {\n disabled: PropTypes.bool,\n maxId: PropTypes.string,\n onClick: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n };\n\n handleClick = () => {\n this.props.onClick(this.props.maxId);\n }\n\n render () {\n const { disabled, intl } = this.props;\n\n return (\n \n \n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { injectIntl, FormattedMessage } from 'react-intl';\nimport SettingToggle from '../../notifications/components/setting_toggle';\n\nexport default @injectIntl\nclass ColumnSettings extends React.PureComponent {\n\n static propTypes = {\n settings: ImmutablePropTypes.map.isRequired,\n onChange: PropTypes.func.isRequired,\n intl: PropTypes.object.isRequired,\n columnId: PropTypes.string,\n };\n\n render () {\n const { settings, onChange } = this.props;\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router-dom';\nimport Icon from 'mastodon/components/icon';\n\nconst ColumnLink = ({ icon, text, to, href, method, badge }) => {\n const badgeElement = typeof badge !== 'undefined' ? {badge} : null;\n\n if (href) {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n } else {\n return (\n \n \n {text}\n {badgeElement}\n \n );\n }\n};\n\nColumnLink.propTypes = {\n icon: PropTypes.string.isRequired,\n text: PropTypes.string.isRequired,\n to: PropTypes.string,\n href: PropTypes.string,\n method: PropTypes.string,\n badge: PropTypes.node,\n};\n\nexport default ColumnLink;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst ColumnSubheading = ({ text }) => {\n return (\n \n {text}\n
\n );\n};\n\nColumnSubheading.propTypes = {\n text: PropTypes.string.isRequired,\n};\n\nexport default ColumnSubheading;\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport PropTypes from 'prop-types';\nimport { changeListEditorTitle, submitListEditor } from '../../../actions/lists';\nimport IconButton from '../../../components/icon_button';\nimport { defineMessages, injectIntl } from 'react-intl';\n\nconst messages = defineMessages({\n label: { id: 'lists.new.title_placeholder', defaultMessage: 'New list title' },\n title: { id: 'lists.new.create', defaultMessage: 'Add list' },\n});\n\nconst mapStateToProps = state => ({\n value: state.getIn(['listEditor', 'title']),\n disabled: state.getIn(['listEditor', 'isSubmitting']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n onChange: value => dispatch(changeListEditorTitle(value)),\n onSubmit: () => dispatch(submitListEditor(true)),\n});\n\nexport default @connect(mapStateToProps, mapDispatchToProps)\n@injectIntl\nclass NewListForm extends React.PureComponent {\n\n static propTypes = {\n value: PropTypes.string.isRequired,\n disabled: PropTypes.bool,\n intl: PropTypes.object.isRequired,\n onChange: PropTypes.func.isRequired,\n onSubmit: PropTypes.func.isRequired,\n };\n\n handleChange = e => {\n this.props.onChange(e.target.value);\n }\n\n handleSubmit = e => {\n e.preventDefault();\n this.props.onSubmit();\n }\n\n handleClick = () => {\n this.props.onSubmit();\n }\n\n render () {\n const { value, disabled, intl } = this.props;\n\n const label = intl.formatMessage(messages.label);\n const title = intl.formatMessage(messages.title);\n\n return (\n \n );\n }\n\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage, defineMessages, injectIntl } from 'react-intl';\nimport AccountContainer from 'flavours/glitch/containers/account_container';\nimport StatusContainer from 'flavours/glitch/containers/status_container';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport Hashtag from 'flavours/glitch/components/hashtag';\nimport Icon from 'flavours/glitch/components/icon';\nimport { searchEnabled } from 'flavours/glitch/util/initial_state';\nimport LoadMore from 'flavours/glitch/components/load_more';\n\nconst messages = defineMessages({\n dismissSuggestion: { id: 'suggestions.dismiss', defaultMessage: 'Dismiss suggestion' },\n});\n\nexport default @injectIntl\nclass SearchResults extends ImmutablePureComponent {\n\n static propTypes = {\n results: ImmutablePropTypes.map.isRequired,\n suggestions: ImmutablePropTypes.list.isRequired,\n fetchSuggestions: PropTypes.func.isRequired,\n expandSearch: PropTypes.func.isRequired,\n dismissSuggestion: PropTypes.func.isRequired,\n searchTerm: PropTypes.string,\n intl: PropTypes.object.isRequired,\n };\n\n componentDidMount () {\n if (this.props.searchTerm === '') {\n this.props.fetchSuggestions();\n }\n }\n\n handleLoadMoreAccounts = () => this.props.expandSearch('accounts');\n\n handleLoadMoreStatuses = () => this.props.expandSearch('statuses');\n\n handleLoadMoreHashtags = () => this.props.expandSearch('hashtags');\n\n render () {\n const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props;\n\n if (results.isEmpty() && !suggestions.isEmpty()) {\n return (\n \n
\n
\n \n \n
\n\n {suggestions && suggestions.map(accountId => (\n
\n ))}\n
\n
\n );\n } else if(results.get('statuses') && results.get('statuses').size === 0 && !searchEnabled && !(searchTerm.startsWith('@') || searchTerm.startsWith('#') || searchTerm.includes(' '))) {\n statuses = (\n \n );\n }\n\n let accounts, statuses, hashtags;\n let count = 0;\n\n if (results.get('accounts') && results.get('accounts').size > 0) {\n count += results.get('accounts').size;\n accounts = (\n \n \n\n {results.get('accounts').map(accountId => )}\n\n {results.get('accounts').size >= 5 && }\n \n );\n }\n\n if (results.get('statuses') && results.get('statuses').size > 0) {\n count += results.get('statuses').size;\n statuses = (\n \n \n\n {results.get('statuses').map(statusId => )}\n\n {results.get('statuses').size >= 5 && }\n \n );\n }\n\n if (results.get('hashtags') && results.get('hashtags').size > 0) {\n count += results.get('hashtags').size;\n hashtags = (\n \n \n\n {results.get('hashtags').map(hashtag => )}\n\n {results.get('hashtags').size >= 5 && }\n \n );\n }\n\n // The result.\n return (\n \n \n\n {accounts}\n {statuses}\n {hashtags}\n
\n );\n };\n}\n","import { connect } from 'react-redux';\nimport SearchResults from '../components/search_results';\nimport { fetchSuggestions, dismissSuggestion } from 'flavours/glitch/actions/suggestions';\nimport { expandSearch } from 'flavours/glitch/actions/search';\n\nconst mapStateToProps = state => ({\n results: state.getIn(['search', 'results']),\n suggestions: state.getIn(['suggestions', 'items']),\n searchTerm: state.getIn(['search', 'searchTerm']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n fetchSuggestions: () => dispatch(fetchSuggestions()),\n expandSearch: type => dispatch(expandSearch(type)),\n dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SearchResults);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport { FormattedMessage, defineMessages, injectIntl } from 'react-intl';\nimport AccountContainer from '../../../containers/account_container';\nimport StatusContainer from '../../../containers/status_container';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport Hashtag from '../../../components/hashtag';\nimport Icon from 'mastodon/components/icon';\nimport { searchEnabled } from '../../../initial_state';\nimport LoadMore from 'mastodon/components/load_more';\n\nconst messages = defineMessages({\n dismissSuggestion: { id: 'suggestions.dismiss', defaultMessage: 'Dismiss suggestion' },\n});\n\nexport default @injectIntl\nclass SearchResults extends ImmutablePureComponent {\n\n static propTypes = {\n results: ImmutablePropTypes.map.isRequired,\n suggestions: ImmutablePropTypes.list.isRequired,\n fetchSuggestions: PropTypes.func.isRequired,\n expandSearch: PropTypes.func.isRequired,\n dismissSuggestion: PropTypes.func.isRequired,\n searchTerm: PropTypes.string,\n intl: PropTypes.object.isRequired,\n };\n\n componentDidMount () {\n if (this.props.searchTerm === '') {\n this.props.fetchSuggestions();\n }\n }\n\n handleLoadMoreAccounts = () => this.props.expandSearch('accounts');\n\n handleLoadMoreStatuses = () => this.props.expandSearch('statuses');\n\n handleLoadMoreHashtags = () => this.props.expandSearch('hashtags');\n\n render () {\n const { intl, results, suggestions, dismissSuggestion, searchTerm } = this.props;\n\n if (results.isEmpty() && !suggestions.isEmpty()) {\n return (\n \n
\n
\n \n \n
\n\n {suggestions && suggestions.map(accountId => (\n
\n ))}\n
\n
\n );\n }\n\n let accounts, statuses, hashtags;\n let count = 0;\n\n if (results.get('accounts') && results.get('accounts').size > 0) {\n count += results.get('accounts').size;\n accounts = (\n \n
\n\n {results.get('accounts').map(accountId =>
)}\n\n {results.get('accounts').size >= 5 &&
}\n
\n );\n }\n\n if (results.get('statuses') && results.get('statuses').size > 0) {\n count += results.get('statuses').size;\n statuses = (\n \n
\n\n {results.get('statuses').map(statusId => )}\n\n {results.get('statuses').size >= 5 && }\n \n );\n } else if(results.get('statuses') && results.get('statuses').size === 0 && !searchEnabled && !(searchTerm.startsWith('@') || searchTerm.startsWith('#') || searchTerm.includes(' '))) {\n statuses = (\n \n );\n }\n\n if (results.get('hashtags') && results.get('hashtags').size > 0) {\n count += results.get('hashtags').size;\n hashtags = (\n \n
\n\n {results.get('hashtags').map(hashtag => )}\n\n {results.get('hashtags').size >= 5 && }\n \n );\n }\n\n return (\n \n
\n \n \n
\n\n {accounts}\n {statuses}\n {hashtags}\n
\n );\n }\n\n}\n","import { connect } from 'react-redux';\nimport SearchResults from '../components/search_results';\nimport { fetchSuggestions, dismissSuggestion } from 'mastodon/actions/suggestions';\nimport { expandSearch } from 'mastodon/actions/search';\n\nconst mapStateToProps = state => ({\n results: state.getIn(['search', 'results']),\n suggestions: state.getIn(['suggestions', 'items']),\n searchTerm: state.getIn(['search', 'searchTerm']),\n});\n\nconst mapDispatchToProps = dispatch => ({\n fetchSuggestions: () => dispatch(fetchSuggestions()),\n expandSearch: type => dispatch(expandSearch(type)),\n dismissSuggestion: account => dispatch(dismissSuggestion(account.get('id'))),\n});\n\nexport default connect(mapStateToProps, mapDispatchToProps)(SearchResults);\n","module.exports = {\n \"default\": require(\"core-js/library/fn/object/values\"),\n __esModule: true\n};","require('../../modules/es7.object.values');\n\nmodule.exports = require('../../modules/_core').Object.values;","// https://github.com/tc39/proposal-object-values-entries\nvar $export = require('./_export');\n\nvar $values = require('./_object-to-array')(false);\n\n$export($export.S, 'Object', {\n values: function values(it) {\n return $values(it);\n }\n});","module.exports = function (it) {\n if (typeof it != 'function') throw TypeError(it + ' is not a function!');\n return it;\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function () {\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {\n get: function get() {\n return 7;\n }\n }).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object'); // instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\n\n\nmodule.exports = function (it, S) {\n if (!isObject(it)) return it;\n var fn, val;\n if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;\n if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var getKeys = require('./_object-keys');\n\nvar toIObject = require('./_to-iobject');\n\nvar isEnum = require('./_object-pie').f;\n\nmodule.exports = function (isEntries) {\n return function (it) {\n var O = toIObject(it);\n var keys = getKeys(O);\n var length = keys.length;\n var i = 0;\n var result = [];\n var key;\n\n while (length > i) {\n if (isEnum.call(O, key = keys[i++])) {\n result.push(isEntries ? [key, O[key]] : O[key]);\n }\n }\n\n return result;\n };\n};","var has = require('./_has');\n\nvar toIObject = require('./_to-iobject');\n\nvar arrayIndexOf = require('./_array-includes')(false);\n\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function (object, names) {\n var O = toIObject(object);\n var i = 0;\n var result = [];\n var key;\n\n for (key in O) {\n if (key != IE_PROTO) has(O, key) && result.push(key);\n } // Don't enum bug & hidden keys\n\n\n while (names.length > i) {\n if (has(O, key = names[i++])) {\n ~arrayIndexOf(result, key) || result.push(key);\n }\n }\n\n return result;\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof'); // eslint-disable-next-line no-prototype-builtins\n\n\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject');\n\nvar toLength = require('./_to-length');\n\nvar toAbsoluteIndex = require('./_to-absolute-index');\n\nmodule.exports = function (IS_INCLUDES) {\n return function ($this, el, fromIndex) {\n var O = toIObject($this);\n var length = toLength(O.length);\n var index = toAbsoluteIndex(fromIndex, length);\n var value; // Array#includes uses SameValueZero equality algorithm\n // eslint-disable-next-line no-self-compare\n\n if (IS_INCLUDES && el != el) while (length > index) {\n value = O[index++]; // eslint-disable-next-line no-self-compare\n\n if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not\n } else for (; length > index; index++) {\n if (IS_INCLUDES || index in O) {\n if (O[index] === el) return IS_INCLUDES || index || 0;\n }\n }\n return !IS_INCLUDES && -1;\n };\n};","var toInteger = require('./_to-integer');\n\nvar max = Math.max;\nvar min = Math.min;\n\nmodule.exports = function (index, length) {\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","exports.f = {}.propertyIsEnumerable;","\"use strict\";\n\nexports.__esModule = true;\n\nvar _from = require(\"../core-js/array/from\");\n\nvar _from2 = _interopRequireDefault(_from);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nexports.default = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n } else {\n return (0, _from2.default)(arr);\n }\n};","module.exports = {\n \"default\": require(\"core-js/library/fn/array/from\"),\n __esModule: true\n};","require('../../modules/es6.string.iterator');\n\nrequire('../../modules/es6.array.from');\n\nmodule.exports = require('../../modules/_core').Array.from;","'use strict';\n\nvar $at = require('./_string-at')(true); // 21.1.3.27 String.prototype[@@iterator]()\n\n\nrequire('./_iter-define')(String, 'String', function (iterated) {\n this._t = String(iterated); // target\n\n this._i = 0; // next index\n // 21.1.5.2.1 %StringIteratorPrototype%.next()\n}, function () {\n var O = this._t;\n var index = this._i;\n var point;\n if (index >= O.length) return {\n value: undefined,\n done: true\n };\n point = $at(O, index);\n this._i += point.length;\n return {\n value: point,\n done: false\n };\n});","var toInteger = require('./_to-integer');\n\nvar defined = require('./_defined'); // true -> String#at\n// false -> String#codePointAt\n\n\nmodule.exports = function (TO_STRING) {\n return function (that, pos) {\n var s = String(defined(that));\n var i = toInteger(pos);\n var l = s.length;\n var a, b;\n if (i < 0 || i >= l) return TO_STRING ? '' : undefined;\n a = s.charCodeAt(i);\n return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;\n };\n};","'use strict';\n\nvar LIBRARY = require('./_library');\n\nvar $export = require('./_export');\n\nvar redefine = require('./_redefine');\n\nvar hide = require('./_hide');\n\nvar Iterators = require('./_iterators');\n\nvar $iterCreate = require('./_iter-create');\n\nvar setToStringTag = require('./_set-to-string-tag');\n\nvar getPrototypeOf = require('./_object-gpo');\n\nvar ITERATOR = require('./_wks')('iterator');\n\nvar BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`\n\nvar FF_ITERATOR = '@@iterator';\nvar KEYS = 'keys';\nvar VALUES = 'values';\n\nvar returnThis = function returnThis() {\n return this;\n};\n\nmodule.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {\n $iterCreate(Constructor, NAME, next);\n\n var getMethod = function getMethod(kind) {\n if (!BUGGY && kind in proto) return proto[kind];\n\n switch (kind) {\n case KEYS:\n return function keys() {\n return new Constructor(this, kind);\n };\n\n case VALUES:\n return function values() {\n return new Constructor(this, kind);\n };\n }\n\n return function entries() {\n return new Constructor(this, kind);\n };\n };\n\n var TAG = NAME + ' Iterator';\n var DEF_VALUES = DEFAULT == VALUES;\n var VALUES_BUG = false;\n var proto = Base.prototype;\n var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];\n var $default = $native || getMethod(DEFAULT);\n var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;\n var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;\n var methods, key, IteratorPrototype; // Fix native\n\n if ($anyNative) {\n IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));\n\n if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {\n // Set @@toStringTag to native iterators\n setToStringTag(IteratorPrototype, TAG, true); // fix for some old engines\n\n if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);\n }\n } // fix Array#{values, @@iterator}.name in V8 / FF\n\n\n if (DEF_VALUES && $native && $native.name !== VALUES) {\n VALUES_BUG = true;\n\n $default = function values() {\n return $native.call(this);\n };\n } // Define iterator\n\n\n if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {\n hide(proto, ITERATOR, $default);\n } // Plug for library\n\n\n Iterators[NAME] = $default;\n Iterators[TAG] = returnThis;\n\n if (DEFAULT) {\n methods = {\n values: DEF_VALUES ? $default : getMethod(VALUES),\n keys: IS_SET ? $default : getMethod(KEYS),\n entries: $entries\n };\n if (FORCED) for (key in methods) {\n if (!(key in proto)) redefine(proto, key, methods[key]);\n } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);\n }\n\n return methods;\n};","module.exports = require('./_hide');","'use strict';\n\nvar create = require('./_object-create');\n\nvar descriptor = require('./_property-desc');\n\nvar setToStringTag = require('./_set-to-string-tag');\n\nvar IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()\n\nrequire('./_hide')(IteratorPrototype, require('./_wks')('iterator'), function () {\n return this;\n});\n\nmodule.exports = function (Constructor, NAME, next) {\n Constructor.prototype = create(IteratorPrototype, {\n next: descriptor(1, next)\n });\n setToStringTag(Constructor, NAME + ' Iterator');\n};","// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])\nvar anObject = require('./_an-object');\n\nvar dPs = require('./_object-dps');\n\nvar enumBugKeys = require('./_enum-bug-keys');\n\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nvar Empty = function Empty() {\n /* empty */\n};\n\nvar PROTOTYPE = 'prototype'; // Create object with fake `null` prototype: use iframe Object with cleared prototype\n\nvar _createDict = function createDict() {\n // Thrash, waste and sodomy: IE GC bug\n var iframe = require('./_dom-create')('iframe');\n\n var i = enumBugKeys.length;\n var lt = '<';\n var gt = '>';\n var iframeDocument;\n iframe.style.display = 'none';\n\n require('./_html').appendChild(iframe);\n\n iframe.src = 'javascript:'; // eslint-disable-line no-script-url\n // createDict = iframe.contentWindow.Object;\n // html.removeChild(iframe);\n\n iframeDocument = iframe.contentWindow.document;\n iframeDocument.open();\n iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);\n iframeDocument.close();\n _createDict = iframeDocument.F;\n\n while (i--) {\n delete _createDict[PROTOTYPE][enumBugKeys[i]];\n }\n\n return _createDict();\n};\n\nmodule.exports = Object.create || function create(O, Properties) {\n var result;\n\n if (O !== null) {\n Empty[PROTOTYPE] = anObject(O);\n result = new Empty();\n Empty[PROTOTYPE] = null; // add \"__proto__\" for Object.getPrototypeOf polyfill\n\n result[IE_PROTO] = O;\n } else result = _createDict();\n\n return Properties === undefined ? result : dPs(result, Properties);\n};","var dP = require('./_object-dp');\n\nvar anObject = require('./_an-object');\n\nvar getKeys = require('./_object-keys');\n\nmodule.exports = require('./_descriptors') ? Object.defineProperties : function defineProperties(O, Properties) {\n anObject(O);\n var keys = getKeys(Properties);\n var length = keys.length;\n var i = 0;\n var P;\n\n while (length > i) {\n dP.f(O, P = keys[i++], Properties[P]);\n }\n\n return O;\n};","var document = require('./_global').document;\n\nmodule.exports = document && document.documentElement;","// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)\nvar has = require('./_has');\n\nvar toObject = require('./_to-object');\n\nvar IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nvar ObjectProto = Object.prototype;\n\nmodule.exports = Object.getPrototypeOf || function (O) {\n O = toObject(O);\n if (has(O, IE_PROTO)) return O[IE_PROTO];\n\n if (typeof O.constructor == 'function' && O instanceof O.constructor) {\n return O.constructor.prototype;\n }\n\n return O instanceof Object ? ObjectProto : null;\n};","'use strict';\n\nvar ctx = require('./_ctx');\n\nvar $export = require('./_export');\n\nvar toObject = require('./_to-object');\n\nvar call = require('./_iter-call');\n\nvar isArrayIter = require('./_is-array-iter');\n\nvar toLength = require('./_to-length');\n\nvar createProperty = require('./_create-property');\n\nvar getIterFn = require('./core.get-iterator-method');\n\n$export($export.S + $export.F * !require('./_iter-detect')(function (iter) {\n Array.from(iter);\n}), 'Array', {\n // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)\n from: function from(arrayLike\n /* , mapfn = undefined, thisArg = undefined */\n ) {\n var O = toObject(arrayLike);\n var C = typeof this == 'function' ? this : Array;\n var aLen = arguments.length;\n var mapfn = aLen > 1 ? arguments[1] : undefined;\n var mapping = mapfn !== undefined;\n var index = 0;\n var iterFn = getIterFn(O);\n var length, result, step, iterator;\n if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); // if object isn't iterable or it's array with default iterator - use simple case\n\n if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {\n for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {\n createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);\n }\n } else {\n length = toLength(O.length);\n\n for (result = new C(length); length > index; index++) {\n createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);\n }\n }\n\n result.length = index;\n return result;\n }\n});","// call something on iterator step with safe closing on error\nvar anObject = require('./_an-object');\n\nmodule.exports = function (iterator, fn, value, entries) {\n try {\n return entries ? fn(anObject(value)[0], value[1]) : fn(value); // 7.4.6 IteratorClose(iterator, completion)\n } catch (e) {\n var ret = iterator['return'];\n if (ret !== undefined) anObject(ret.call(iterator));\n throw e;\n }\n};","// check on default Array iterator\nvar Iterators = require('./_iterators');\n\nvar ITERATOR = require('./_wks')('iterator');\n\nvar ArrayProto = Array.prototype;\n\nmodule.exports = function (it) {\n return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);\n};","'use strict';\n\nvar $defineProperty = require('./_object-dp');\n\nvar createDesc = require('./_property-desc');\n\nmodule.exports = function (object, index, value) {\n if (index in object) $defineProperty.f(object, index, createDesc(0, value));else object[index] = value;\n};","var classof = require('./_classof');\n\nvar ITERATOR = require('./_wks')('iterator');\n\nvar Iterators = require('./_iterators');\n\nmodule.exports = require('./_core').getIteratorMethod = function (it) {\n if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)];\n};","// getting tag from 19.1.3.6 Object.prototype.toString()\nvar cof = require('./_cof');\n\nvar TAG = require('./_wks')('toStringTag'); // ES3 wrong here\n\n\nvar ARG = cof(function () {\n return arguments;\n}()) == 'Arguments'; // fallback for IE11 Script Access Denied error\n\nvar tryGet = function tryGet(it, key) {\n try {\n return it[key];\n } catch (e) {\n /* empty */\n }\n};\n\nmodule.exports = function (it) {\n var O, T, B;\n return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case\n : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T // builtinTag case\n : ARG ? cof(O) // ES3 arguments fallback\n : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;\n};","var ITERATOR = require('./_wks')('iterator');\n\nvar SAFE_CLOSING = false;\n\ntry {\n var riter = [7][ITERATOR]();\n\n riter['return'] = function () {\n SAFE_CLOSING = true;\n }; // eslint-disable-next-line no-throw-literal\n\n\n Array.from(riter, function () {\n throw 2;\n });\n} catch (e) {\n /* empty */\n}\n\nmodule.exports = function (exec, skipClosing) {\n if (!skipClosing && !SAFE_CLOSING) return false;\n var safe = false;\n\n try {\n var arr = [7];\n var iter = arr[ITERATOR]();\n\n iter.next = function () {\n return {\n done: safe = true\n };\n };\n\n arr[ITERATOR] = function () {\n return iter;\n };\n\n exec(arr);\n } catch (e) {\n /* empty */\n }\n\n return safe;\n};","// http://paulirish.com/2011/requestanimationframe-for-smart-animating/\n// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating\n// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel\n// MIT license\nvar isWindowAvailable = typeof window !== 'undefined';\nisWindowAvailable && function () {\n var lastTime = 0;\n var vendors = ['ms', 'moz', 'webkit', 'o'];\n\n for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {\n window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];\n window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];\n }\n\n if (!window.requestAnimationFrame) window.requestAnimationFrame = function (callback, element) {\n var currTime = new Date().getTime();\n var timeToCall = Math.max(0, 16 - (currTime - lastTime));\n var id = window.setTimeout(function () {\n callback(currTime + timeToCall);\n }, timeToCall);\n lastTime = currTime + timeToCall;\n return id;\n };\n if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function (id) {\n clearTimeout(id);\n };\n}();","module.exports = {\n \"default\": require(\"core-js/library/fn/object/keys\"),\n __esModule: true\n};","require('../../modules/es6.object.keys');\n\nmodule.exports = require('../../modules/_core').Object.keys;","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object');\n\nvar $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function () {\n return function keys(it) {\n return $keys(toObject(it));\n };\n});","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export');\n\nvar core = require('./_core');\n\nvar fails = require('./_fails');\n\nmodule.exports = function (KEY, exec) {\n var fn = (core.Object || {})[KEY] || Object[KEY];\n var exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function () {\n fn(1);\n }), 'Object', exp);\n};","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.defaultProps = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _memoizeOne = _interopRequireDefault(require(\"memoize-one\"));\n\nvar _Menu = require(\"./components/Menu\");\n\nvar _reactFastCompare = _interopRequireDefault(require(\"./internal/react-fast-compare\"));\n\nvar _filters = require(\"./filters\");\n\nvar _index = require(\"./internal/index\");\n\nvar _index2 = require(\"./accessibility/index\");\n\nvar _utils = require(\"./utils\");\n\nvar _builtins = require(\"./builtins\");\n\nvar _index3 = require(\"./components/index\");\n\nvar _styles = require(\"./styles\");\n\nvar _theme = require(\"./theme\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\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 _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 _extends() {\n _extends = Object.assign || 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\nfunction _toConsumableArray(arr) {\n return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();\n}\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance\");\n}\n\nfunction _iterableToArray(iter) {\n if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter);\n}\n\nfunction _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\n return arr2;\n }\n}\n\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\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\nvar defaultProps = {\n backspaceRemovesValue: true,\n blurInputOnSelect: (0, _utils.isTouchCapable)(),\n captureMenuScroll: !(0, _utils.isTouchCapable)(),\n closeMenuOnSelect: true,\n closeMenuOnScroll: false,\n components: {},\n controlShouldRenderValue: true,\n escapeClearsValue: false,\n filterOption: (0, _filters.createFilter)(),\n formatGroupLabel: _builtins.formatGroupLabel,\n getOptionLabel: _builtins.getOptionLabel,\n getOptionValue: _builtins.getOptionValue,\n isDisabled: false,\n isLoading: false,\n isMulti: false,\n isRtl: false,\n isSearchable: true,\n isOptionDisabled: _builtins.isOptionDisabled,\n loadingMessage: function loadingMessage() {\n return 'Loading...';\n },\n maxMenuHeight: 300,\n minMenuHeight: 140,\n menuIsOpen: false,\n menuPlacement: 'bottom',\n menuPosition: 'absolute',\n menuShouldBlockScroll: false,\n menuShouldScrollIntoView: !(0, _utils.isMobileDevice)(),\n noOptionsMessage: function noOptionsMessage() {\n return 'No options';\n },\n openMenuOnFocus: false,\n openMenuOnClick: true,\n options: [],\n pageSize: 5,\n placeholder: 'Select...',\n screenReaderStatus: function screenReaderStatus(_ref) {\n var count = _ref.count;\n return \"\".concat(count, \" result\").concat(count !== 1 ? 's' : '', \" available\");\n },\n styles: {},\n tabIndex: '0',\n tabSelectsValue: true\n};\nexports.defaultProps = defaultProps;\nvar instanceId = 1;\n\nvar Select =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(Select, _Component); // Misc. Instance Properties\n // ------------------------------\n // TODO\n // Refs\n // ------------------------------\n // Lifecycle\n // ------------------------------\n\n\n function Select(_props) {\n var _this;\n\n _classCallCheck(this, Select);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Select).call(this, _props));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"state\", {\n ariaLiveSelection: '',\n ariaLiveContext: '',\n focusedOption: null,\n focusedValue: null,\n inputIsHidden: false,\n isFocused: false,\n menuOptions: {\n render: [],\n focusable: []\n },\n selectValue: []\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"blockOptionHover\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"isComposing\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"clearFocusValueOnUpdate\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"commonProps\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"components\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"hasGroups\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"initialTouchX\", 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"initialTouchY\", 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"inputIsHiddenAfterUpdate\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"instancePrefix\", '');\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"openAfterFocus\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"scrollToFocusedOptionOnUpdate\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"userIsDragging\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"controlRef\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getControlRef\", function (ref) {\n _this.controlRef = ref;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"focusedOptionRef\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getFocusedOptionRef\", function (ref) {\n _this.focusedOptionRef = ref;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"menuListRef\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getMenuListRef\", function (ref) {\n _this.menuListRef = ref;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"inputRef\", null);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getInputRef\", function (ref) {\n _this.inputRef = ref;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"cacheComponents\", function (components) {\n _this.components = (0, _index3.defaultComponents)({\n components: components\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"focus\", _this.focusInput);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"blur\", _this.blurInput);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onChange\", function (newValue, actionMeta) {\n var _this$props = _this.props,\n onChange = _this$props.onChange,\n name = _this$props.name;\n onChange(newValue, _objectSpread({}, actionMeta, {\n name: name\n }));\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"setValue\", function (newValue) {\n var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'set-value';\n var option = arguments.length > 2 ? arguments[2] : undefined;\n var _this$props2 = _this.props,\n closeMenuOnSelect = _this$props2.closeMenuOnSelect,\n isMulti = _this$props2.isMulti;\n\n _this.onInputChange('', {\n action: 'set-value'\n });\n\n if (closeMenuOnSelect) {\n _this.inputIsHiddenAfterUpdate = !isMulti;\n\n _this.onMenuClose();\n } // when the select value should change, we should reset focusedValue\n\n\n _this.clearFocusValueOnUpdate = true;\n\n _this.onChange(newValue, {\n action: action,\n option: option\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"selectOption\", function (newValue) {\n var _this$props3 = _this.props,\n blurInputOnSelect = _this$props3.blurInputOnSelect,\n isMulti = _this$props3.isMulti;\n var selectValue = _this.state.selectValue;\n\n if (isMulti) {\n if (_this.isOptionSelected(newValue, selectValue)) {\n var candidate = _this.getOptionValue(newValue);\n\n _this.setValue(selectValue.filter(function (i) {\n return _this.getOptionValue(i) !== candidate;\n }), 'deselect-option', newValue);\n\n _this.announceAriaLiveSelection({\n event: 'deselect-option',\n context: {\n value: _this.getOptionLabel(newValue)\n }\n });\n } else {\n if (!_this.isOptionDisabled(newValue, selectValue)) {\n _this.setValue([].concat(_toConsumableArray(selectValue), [newValue]), 'select-option', newValue);\n\n _this.announceAriaLiveSelection({\n event: 'select-option',\n context: {\n value: _this.getOptionLabel(newValue)\n }\n });\n } else {\n // announce that option is disabled\n _this.announceAriaLiveSelection({\n event: 'select-option',\n context: {\n value: _this.getOptionLabel(newValue),\n isDisabled: true\n }\n });\n }\n }\n } else {\n if (!_this.isOptionDisabled(newValue, selectValue)) {\n _this.setValue(newValue, 'select-option');\n\n _this.announceAriaLiveSelection({\n event: 'select-option',\n context: {\n value: _this.getOptionLabel(newValue)\n }\n });\n } else {\n // announce that option is disabled\n _this.announceAriaLiveSelection({\n event: 'select-option',\n context: {\n value: _this.getOptionLabel(newValue),\n isDisabled: true\n }\n });\n }\n }\n\n if (blurInputOnSelect) {\n _this.blurInput();\n }\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"removeValue\", function (removedValue) {\n var selectValue = _this.state.selectValue;\n\n var candidate = _this.getOptionValue(removedValue);\n\n _this.onChange(selectValue.filter(function (i) {\n return _this.getOptionValue(i) !== candidate;\n }), {\n action: 'remove-value',\n removedValue: removedValue\n });\n\n _this.announceAriaLiveSelection({\n event: 'remove-value',\n context: {\n value: removedValue ? _this.getOptionLabel(removedValue) : ''\n }\n });\n\n _this.focusInput();\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"clearValue\", function () {\n var isMulti = _this.props.isMulti;\n\n _this.onChange(isMulti ? [] : null, {\n action: 'clear'\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"popValue\", function () {\n var selectValue = _this.state.selectValue;\n var lastSelectedValue = selectValue[selectValue.length - 1];\n\n _this.announceAriaLiveSelection({\n event: 'pop-value',\n context: {\n value: lastSelectedValue ? _this.getOptionLabel(lastSelectedValue) : ''\n }\n });\n\n _this.onChange(selectValue.slice(0, selectValue.length - 1), {\n action: 'pop-value',\n removedValue: lastSelectedValue\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getOptionLabel\", function (data) {\n return _this.props.getOptionLabel(data);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getOptionValue\", function (data) {\n return _this.props.getOptionValue(data);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getStyles\", function (key, props) {\n var base = _styles.defaultStyles[key](props);\n\n base.boxSizing = 'border-box';\n var custom = _this.props.styles[key];\n return custom ? custom(base, props) : base;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getElementId\", function (element) {\n return \"\".concat(_this.instancePrefix, \"-\").concat(element);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getActiveDescendentId\", function () {\n var menuIsOpen = _this.props.menuIsOpen;\n var _this$state = _this.state,\n menuOptions = _this$state.menuOptions,\n focusedOption = _this$state.focusedOption;\n if (!focusedOption || !menuIsOpen) return undefined;\n var index = menuOptions.focusable.indexOf(focusedOption);\n var option = menuOptions.render[index];\n return option && option.key;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"announceAriaLiveSelection\", function (_ref2) {\n var event = _ref2.event,\n context = _ref2.context;\n\n _this.setState({\n ariaLiveSelection: (0, _index2.valueEventAriaMessage)(event, context)\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"announceAriaLiveContext\", function (_ref3) {\n var event = _ref3.event,\n context = _ref3.context;\n\n _this.setState({\n ariaLiveContext: (0, _index2.instructionsAriaMessage)(event, _objectSpread({}, context, {\n label: _this.props['aria-label']\n }))\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onMenuMouseDown\", function (event) {\n if (event.button !== 0) {\n return;\n }\n\n event.stopPropagation();\n event.preventDefault();\n\n _this.focusInput();\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onMenuMouseMove\", function (event) {\n _this.blockOptionHover = false;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onControlMouseDown\", function (event) {\n var openMenuOnClick = _this.props.openMenuOnClick;\n\n if (!_this.state.isFocused) {\n if (openMenuOnClick) {\n _this.openAfterFocus = true;\n }\n\n _this.focusInput();\n } else if (!_this.props.menuIsOpen) {\n if (openMenuOnClick) {\n _this.openMenu('first');\n }\n } else {\n //$FlowFixMe\n if (event.target.tagName !== 'INPUT') {\n _this.onMenuClose();\n }\n } //$FlowFixMe\n\n\n if (event.target.tagName !== 'INPUT') {\n event.preventDefault();\n }\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onDropdownIndicatorMouseDown\", function (event) {\n // ignore mouse events that weren't triggered by the primary button\n if (event && event.type === 'mousedown' && event.button !== 0) {\n return;\n }\n\n if (_this.props.isDisabled) return;\n var _this$props4 = _this.props,\n isMulti = _this$props4.isMulti,\n menuIsOpen = _this$props4.menuIsOpen;\n\n _this.focusInput();\n\n if (menuIsOpen) {\n _this.inputIsHiddenAfterUpdate = !isMulti;\n\n _this.onMenuClose();\n } else {\n _this.openMenu('first');\n }\n\n event.preventDefault();\n event.stopPropagation();\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onClearIndicatorMouseDown\", function (event) {\n // ignore mouse events that weren't triggered by the primary button\n if (event && event.type === 'mousedown' && event.button !== 0) {\n return;\n }\n\n _this.clearValue();\n\n event.stopPropagation();\n _this.openAfterFocus = false;\n setTimeout(function () {\n return _this.focusInput();\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onScroll\", function (event) {\n if (typeof _this.props.closeMenuOnScroll === 'boolean') {\n if (event.target instanceof HTMLElement && (0, _utils.isDocumentElement)(event.target)) {\n _this.props.onMenuClose();\n }\n } else if (typeof _this.props.closeMenuOnScroll === 'function') {\n if (_this.props.closeMenuOnScroll(event)) {\n _this.props.onMenuClose();\n }\n }\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onCompositionStart\", function () {\n _this.isComposing = true;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onCompositionEnd\", function () {\n _this.isComposing = false;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onTouchStart\", function (_ref4) {\n var touches = _ref4.touches;\n var touch = touches.item(0);\n\n if (!touch) {\n return;\n }\n\n _this.initialTouchX = touch.clientX;\n _this.initialTouchY = touch.clientY;\n _this.userIsDragging = false;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onTouchMove\", function (_ref5) {\n var touches = _ref5.touches;\n var touch = touches.item(0);\n\n if (!touch) {\n return;\n }\n\n var deltaX = Math.abs(touch.clientX - _this.initialTouchX);\n var deltaY = Math.abs(touch.clientY - _this.initialTouchY);\n var moveThreshold = 5;\n _this.userIsDragging = deltaX > moveThreshold || deltaY > moveThreshold;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onTouchEnd\", function (event) {\n if (_this.userIsDragging) return; // close the menu if the user taps outside\n // we're checking on event.target here instead of event.currentTarget, because we want to assert information\n // on events on child elements, not the document (which we've attached this handler to).\n\n if (_this.controlRef && !_this.controlRef.contains(event.target) && _this.menuListRef && !_this.menuListRef.contains(event.target)) {\n _this.blurInput();\n } // reset move vars\n\n\n _this.initialTouchX = 0;\n _this.initialTouchY = 0;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onControlTouchEnd\", function (event) {\n if (_this.userIsDragging) return;\n\n _this.onControlMouseDown(event);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onClearIndicatorTouchEnd\", function (event) {\n if (_this.userIsDragging) return;\n\n _this.onClearIndicatorMouseDown(event);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onDropdownIndicatorTouchEnd\", function (event) {\n if (_this.userIsDragging) return;\n\n _this.onDropdownIndicatorMouseDown(event);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"handleInputChange\", function (event) {\n var inputValue = event.currentTarget.value;\n _this.inputIsHiddenAfterUpdate = false;\n\n _this.onInputChange(inputValue, {\n action: 'input-change'\n });\n\n _this.onMenuOpen();\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onInputFocus\", function (event) {\n var _this$props5 = _this.props,\n isSearchable = _this$props5.isSearchable,\n isMulti = _this$props5.isMulti;\n\n if (_this.props.onFocus) {\n _this.props.onFocus(event);\n }\n\n _this.inputIsHiddenAfterUpdate = false;\n\n _this.announceAriaLiveContext({\n event: 'input',\n context: {\n isSearchable: isSearchable,\n isMulti: isMulti\n }\n });\n\n _this.setState({\n isFocused: true\n });\n\n if (_this.openAfterFocus || _this.props.openMenuOnFocus) {\n _this.openMenu('first');\n }\n\n _this.openAfterFocus = false;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onInputBlur\", function (event) {\n if (_this.menuListRef && _this.menuListRef.contains(document.activeElement)) {\n _this.inputRef.focus();\n\n return;\n }\n\n if (_this.props.onBlur) {\n _this.props.onBlur(event);\n }\n\n _this.onInputChange('', {\n action: 'input-blur'\n });\n\n _this.onMenuClose();\n\n _this.setState({\n focusedValue: null,\n isFocused: false\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onOptionHover\", function (focusedOption) {\n if (_this.blockOptionHover || _this.state.focusedOption === focusedOption) {\n return;\n }\n\n _this.setState({\n focusedOption: focusedOption\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"shouldHideSelectedOptions\", function () {\n var _this$props6 = _this.props,\n hideSelectedOptions = _this$props6.hideSelectedOptions,\n isMulti = _this$props6.isMulti;\n if (hideSelectedOptions === undefined) return isMulti;\n return hideSelectedOptions;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onKeyDown\", function (event) {\n var _this$props7 = _this.props,\n isMulti = _this$props7.isMulti,\n backspaceRemovesValue = _this$props7.backspaceRemovesValue,\n escapeClearsValue = _this$props7.escapeClearsValue,\n inputValue = _this$props7.inputValue,\n isClearable = _this$props7.isClearable,\n isDisabled = _this$props7.isDisabled,\n menuIsOpen = _this$props7.menuIsOpen,\n onKeyDown = _this$props7.onKeyDown,\n tabSelectsValue = _this$props7.tabSelectsValue,\n openMenuOnFocus = _this$props7.openMenuOnFocus;\n var _this$state2 = _this.state,\n focusedOption = _this$state2.focusedOption,\n focusedValue = _this$state2.focusedValue,\n selectValue = _this$state2.selectValue;\n if (isDisabled) return;\n\n if (typeof onKeyDown === 'function') {\n onKeyDown(event);\n\n if (event.defaultPrevented) {\n return;\n }\n } // Block option hover events when the user has just pressed a key\n\n\n _this.blockOptionHover = true;\n\n switch (event.key) {\n case 'ArrowLeft':\n if (!isMulti || inputValue) return;\n\n _this.focusValue('previous');\n\n break;\n\n case 'ArrowRight':\n if (!isMulti || inputValue) return;\n\n _this.focusValue('next');\n\n break;\n\n case 'Delete':\n case 'Backspace':\n if (inputValue) return;\n\n if (focusedValue) {\n _this.removeValue(focusedValue);\n } else {\n if (!backspaceRemovesValue) return;\n\n if (isMulti) {\n _this.popValue();\n } else if (isClearable) {\n _this.clearValue();\n }\n }\n\n break;\n\n case 'Tab':\n if (_this.isComposing) return;\n\n if (event.shiftKey || !menuIsOpen || !tabSelectsValue || !focusedOption || // don't capture the event if the menu opens on focus and the focused\n // option is already selected; it breaks the flow of navigation\n openMenuOnFocus && _this.isOptionSelected(focusedOption, selectValue)) {\n return;\n }\n\n _this.selectOption(focusedOption);\n\n break;\n\n case 'Enter':\n if (event.keyCode === 229) {\n // ignore the keydown event from an Input Method Editor(IME)\n // ref. https://www.w3.org/TR/uievents/#determine-keydown-keyup-keyCode\n break;\n }\n\n if (menuIsOpen) {\n if (!focusedOption) return;\n if (_this.isComposing) return;\n\n _this.selectOption(focusedOption);\n\n break;\n }\n\n return;\n\n case 'Escape':\n if (menuIsOpen) {\n _this.inputIsHiddenAfterUpdate = false;\n\n _this.onInputChange('', {\n action: 'menu-close'\n });\n\n _this.onMenuClose();\n } else if (isClearable && escapeClearsValue) {\n _this.clearValue();\n }\n\n break;\n\n case ' ':\n // space\n if (inputValue) {\n return;\n }\n\n if (!menuIsOpen) {\n _this.openMenu('first');\n\n break;\n }\n\n if (!focusedOption) return;\n\n _this.selectOption(focusedOption);\n\n break;\n\n case 'ArrowUp':\n if (menuIsOpen) {\n _this.focusOption('up');\n } else {\n _this.openMenu('last');\n }\n\n break;\n\n case 'ArrowDown':\n if (menuIsOpen) {\n _this.focusOption('down');\n } else {\n _this.openMenu('first');\n }\n\n break;\n\n case 'PageUp':\n if (!menuIsOpen) return;\n\n _this.focusOption('pageup');\n\n break;\n\n case 'PageDown':\n if (!menuIsOpen) return;\n\n _this.focusOption('pagedown');\n\n break;\n\n case 'Home':\n if (!menuIsOpen) return;\n\n _this.focusOption('first');\n\n break;\n\n case 'End':\n if (!menuIsOpen) return;\n\n _this.focusOption('last');\n\n break;\n\n default:\n return;\n }\n\n event.preventDefault();\n });\n\n var value = _props.value;\n _this.cacheComponents = (0, _memoizeOne.default)(_this.cacheComponents, _reactFastCompare.default).bind(_assertThisInitialized(_assertThisInitialized(_this)));\n\n _this.cacheComponents(_props.components);\n\n _this.instancePrefix = 'react-select-' + (_this.props.instanceId || ++instanceId);\n\n var _selectValue = (0, _utils.cleanValue)(value);\n\n var _menuOptions = _this.buildMenuOptions(_props, _selectValue);\n\n _this.state.menuOptions = _menuOptions;\n _this.state.selectValue = _selectValue;\n return _this;\n }\n\n _createClass(Select, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.startListeningComposition();\n this.startListeningToTouch();\n\n if (this.props.closeMenuOnScroll && document && document.addEventListener) {\n // Listen to all scroll events, and filter them out inside of 'onScroll'\n document.addEventListener('scroll', this.onScroll, true);\n }\n\n if (this.props.autoFocus) {\n this.focusInput();\n }\n }\n }, {\n key: \"componentWillReceiveProps\",\n value: function componentWillReceiveProps(nextProps) {\n var _this$props8 = this.props,\n options = _this$props8.options,\n value = _this$props8.value,\n inputValue = _this$props8.inputValue; // re-cache custom components\n\n this.cacheComponents(nextProps.components); // rebuild the menu options\n\n if (nextProps.value !== value || nextProps.options !== options || nextProps.inputValue !== inputValue) {\n var selectValue = (0, _utils.cleanValue)(nextProps.value);\n var menuOptions = this.buildMenuOptions(nextProps, selectValue);\n var focusedValue = this.getNextFocusedValue(selectValue);\n var focusedOption = this.getNextFocusedOption(menuOptions.focusable);\n this.setState({\n menuOptions: menuOptions,\n selectValue: selectValue,\n focusedOption: focusedOption,\n focusedValue: focusedValue\n });\n } // some updates should toggle the state of the input visibility\n\n\n if (this.inputIsHiddenAfterUpdate != null) {\n this.setState({\n inputIsHidden: this.inputIsHiddenAfterUpdate\n });\n delete this.inputIsHiddenAfterUpdate;\n }\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n var _this$props9 = this.props,\n isDisabled = _this$props9.isDisabled,\n menuIsOpen = _this$props9.menuIsOpen;\n var isFocused = this.state.isFocused;\n\n if ( // ensure focus is restored correctly when the control becomes enabled\n isFocused && !isDisabled && prevProps.isDisabled || // ensure focus is on the Input when the menu opens\n isFocused && menuIsOpen && !prevProps.menuIsOpen) {\n this.focusInput();\n } // scroll the focused option into view if necessary\n\n\n if (this.menuListRef && this.focusedOptionRef && this.scrollToFocusedOptionOnUpdate) {\n (0, _utils.scrollIntoView)(this.menuListRef, this.focusedOptionRef);\n }\n\n this.scrollToFocusedOptionOnUpdate = false;\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.stopListeningComposition();\n this.stopListeningToTouch();\n document.removeEventListener('scroll', this.onScroll, true);\n }\n }, {\n key: \"onMenuOpen\",\n // ==============================\n // Consumer Handlers\n // ==============================\n value: function onMenuOpen() {\n this.props.onMenuOpen();\n }\n }, {\n key: \"onMenuClose\",\n value: function onMenuClose() {\n var _this$props10 = this.props,\n isSearchable = _this$props10.isSearchable,\n isMulti = _this$props10.isMulti;\n this.announceAriaLiveContext({\n event: 'input',\n context: {\n isSearchable: isSearchable,\n isMulti: isMulti\n }\n });\n this.onInputChange('', {\n action: 'menu-close'\n });\n this.props.onMenuClose();\n }\n }, {\n key: \"onInputChange\",\n value: function onInputChange(newValue, actionMeta) {\n this.props.onInputChange(newValue, actionMeta);\n } // ==============================\n // Methods\n // ==============================\n\n }, {\n key: \"focusInput\",\n value: function focusInput() {\n if (!this.inputRef) return;\n this.inputRef.focus();\n }\n }, {\n key: \"blurInput\",\n value: function blurInput() {\n if (!this.inputRef) return;\n this.inputRef.blur();\n } // aliased for consumers\n\n }, {\n key: \"openMenu\",\n value: function openMenu(focusOption) {\n var _this$state3 = this.state,\n menuOptions = _this$state3.menuOptions,\n selectValue = _this$state3.selectValue,\n isFocused = _this$state3.isFocused;\n var isMulti = this.props.isMulti;\n var openAtIndex = focusOption === 'first' ? 0 : menuOptions.focusable.length - 1;\n\n if (!isMulti) {\n var selectedIndex = menuOptions.focusable.indexOf(selectValue[0]);\n\n if (selectedIndex > -1) {\n openAtIndex = selectedIndex;\n }\n } // only scroll if the menu isn't already open\n\n\n this.scrollToFocusedOptionOnUpdate = !(isFocused && this.menuListRef);\n this.inputIsHiddenAfterUpdate = false;\n this.onMenuOpen();\n this.setState({\n focusedValue: null,\n focusedOption: menuOptions.focusable[openAtIndex]\n });\n this.announceAriaLiveContext({\n event: 'menu'\n });\n }\n }, {\n key: \"focusValue\",\n value: function focusValue(direction) {\n var _this$props11 = this.props,\n isMulti = _this$props11.isMulti,\n isSearchable = _this$props11.isSearchable;\n var _this$state4 = this.state,\n selectValue = _this$state4.selectValue,\n focusedValue = _this$state4.focusedValue; // Only multiselects support value focusing\n\n if (!isMulti) return;\n this.setState({\n focusedOption: null\n });\n var focusedIndex = selectValue.indexOf(focusedValue);\n\n if (!focusedValue) {\n focusedIndex = -1;\n this.announceAriaLiveContext({\n event: 'value'\n });\n }\n\n var lastIndex = selectValue.length - 1;\n var nextFocus = -1;\n if (!selectValue.length) return;\n\n switch (direction) {\n case 'previous':\n if (focusedIndex === 0) {\n // don't cycle from the start to the end\n nextFocus = 0;\n } else if (focusedIndex === -1) {\n // if nothing is focused, focus the last value first\n nextFocus = lastIndex;\n } else {\n nextFocus = focusedIndex - 1;\n }\n\n break;\n\n case 'next':\n if (focusedIndex > -1 && focusedIndex < lastIndex) {\n nextFocus = focusedIndex + 1;\n }\n\n break;\n }\n\n if (nextFocus === -1) {\n this.announceAriaLiveContext({\n event: 'input',\n context: {\n isSearchable: isSearchable,\n isMulti: isMulti\n }\n });\n }\n\n this.setState({\n inputIsHidden: nextFocus === -1 ? false : true,\n focusedValue: selectValue[nextFocus]\n });\n }\n }, {\n key: \"focusOption\",\n value: function focusOption() {\n var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first';\n var pageSize = this.props.pageSize;\n var _this$state5 = this.state,\n focusedOption = _this$state5.focusedOption,\n menuOptions = _this$state5.menuOptions;\n var options = menuOptions.focusable;\n if (!options.length) return;\n var nextFocus = 0; // handles 'first'\n\n var focusedIndex = options.indexOf(focusedOption);\n\n if (!focusedOption) {\n focusedIndex = -1;\n this.announceAriaLiveContext({\n event: 'menu'\n });\n }\n\n if (direction === 'up') {\n nextFocus = focusedIndex > 0 ? focusedIndex - 1 : options.length - 1;\n } else if (direction === 'down') {\n nextFocus = (focusedIndex + 1) % options.length;\n } else if (direction === 'pageup') {\n nextFocus = focusedIndex - pageSize;\n if (nextFocus < 0) nextFocus = 0;\n } else if (direction === 'pagedown') {\n nextFocus = focusedIndex + pageSize;\n if (nextFocus > options.length - 1) nextFocus = options.length - 1;\n } else if (direction === 'last') {\n nextFocus = options.length - 1;\n }\n\n this.scrollToFocusedOptionOnUpdate = true;\n this.setState({\n focusedOption: options[nextFocus],\n focusedValue: null\n });\n this.announceAriaLiveContext({\n event: 'menu',\n context: {\n isDisabled: (0, _builtins.isOptionDisabled)(options[nextFocus])\n }\n });\n }\n }, {\n key: \"getTheme\",\n // ==============================\n // Getters\n // ==============================\n value: function getTheme() {\n // Use the default theme if there are no customizations.\n if (!this.props.theme) {\n return _theme.defaultTheme;\n } // If the theme prop is a function, assume the function\n // knows how to merge the passed-in default theme with\n // its own modifications.\n\n\n if (typeof this.props.theme === 'function') {\n return this.props.theme(_theme.defaultTheme);\n } // Otherwise, if a plain theme object was passed in,\n // overlay it with the default theme.\n\n\n return _objectSpread({}, _theme.defaultTheme, this.props.theme);\n }\n }, {\n key: \"getCommonProps\",\n value: function getCommonProps() {\n var clearValue = this.clearValue,\n getStyles = this.getStyles,\n setValue = this.setValue,\n selectOption = this.selectOption,\n props = this.props;\n var classNamePrefix = props.classNamePrefix,\n isMulti = props.isMulti,\n isRtl = props.isRtl,\n options = props.options;\n var selectValue = this.state.selectValue;\n var hasValue = this.hasValue();\n\n var getValue = function getValue() {\n return selectValue;\n };\n\n var cx = _utils.classNames.bind(null, classNamePrefix);\n\n return {\n cx: cx,\n clearValue: clearValue,\n getStyles: getStyles,\n getValue: getValue,\n hasValue: hasValue,\n isMulti: isMulti,\n isRtl: isRtl,\n options: options,\n selectOption: selectOption,\n setValue: setValue,\n selectProps: props,\n theme: this.getTheme()\n };\n }\n }, {\n key: \"getNextFocusedValue\",\n value: function getNextFocusedValue(nextSelectValue) {\n if (this.clearFocusValueOnUpdate) {\n this.clearFocusValueOnUpdate = false;\n return null;\n }\n\n var _this$state6 = this.state,\n focusedValue = _this$state6.focusedValue,\n lastSelectValue = _this$state6.selectValue;\n var lastFocusedIndex = lastSelectValue.indexOf(focusedValue);\n\n if (lastFocusedIndex > -1) {\n var nextFocusedIndex = nextSelectValue.indexOf(focusedValue);\n\n if (nextFocusedIndex > -1) {\n // the focused value is still in the selectValue, return it\n return focusedValue;\n } else if (lastFocusedIndex < nextSelectValue.length) {\n // the focusedValue is not present in the next selectValue array by\n // reference, so return the new value at the same index\n return nextSelectValue[lastFocusedIndex];\n }\n }\n\n return null;\n }\n }, {\n key: \"getNextFocusedOption\",\n value: function getNextFocusedOption(options) {\n var lastFocusedOption = this.state.focusedOption;\n return lastFocusedOption && options.indexOf(lastFocusedOption) > -1 ? lastFocusedOption : options[0];\n }\n }, {\n key: \"hasValue\",\n value: function hasValue() {\n var selectValue = this.state.selectValue;\n return selectValue.length > 0;\n }\n }, {\n key: \"hasOptions\",\n value: function hasOptions() {\n return !!this.state.menuOptions.render.length;\n }\n }, {\n key: \"countOptions\",\n value: function countOptions() {\n return this.state.menuOptions.focusable.length;\n }\n }, {\n key: \"isClearable\",\n value: function isClearable() {\n var _this$props12 = this.props,\n isClearable = _this$props12.isClearable,\n isMulti = _this$props12.isMulti; // single select, by default, IS NOT clearable\n // multi select, by default, IS clearable\n\n if (isClearable === undefined) return isMulti;\n return isClearable;\n }\n }, {\n key: \"isOptionDisabled\",\n value: function isOptionDisabled(option, selectValue) {\n return typeof this.props.isOptionDisabled === 'function' ? this.props.isOptionDisabled(option, selectValue) : false;\n }\n }, {\n key: \"isOptionSelected\",\n value: function isOptionSelected(option, selectValue) {\n var _this2 = this;\n\n if (selectValue.indexOf(option) > -1) return true;\n\n if (typeof this.props.isOptionSelected === 'function') {\n return this.props.isOptionSelected(option, selectValue);\n }\n\n var candidate = this.getOptionValue(option);\n return selectValue.some(function (i) {\n return _this2.getOptionValue(i) === candidate;\n });\n }\n }, {\n key: \"filterOption\",\n value: function filterOption(option, inputValue) {\n return this.props.filterOption ? this.props.filterOption(option, inputValue) : true;\n }\n }, {\n key: \"formatOptionLabel\",\n value: function formatOptionLabel(data, context) {\n if (typeof this.props.formatOptionLabel === 'function') {\n var inputValue = this.props.inputValue;\n var selectValue = this.state.selectValue;\n return this.props.formatOptionLabel(data, {\n context: context,\n inputValue: inputValue,\n selectValue: selectValue\n });\n } else {\n return this.getOptionLabel(data);\n }\n }\n }, {\n key: \"formatGroupLabel\",\n value: function formatGroupLabel(data) {\n return this.props.formatGroupLabel(data);\n } // ==============================\n // Mouse Handlers\n // ==============================\n\n }, {\n key: \"startListeningComposition\",\n // ==============================\n // Composition Handlers\n // ==============================\n value: function startListeningComposition() {\n if (document && document.addEventListener) {\n document.addEventListener('compositionstart', this.onCompositionStart, false);\n document.addEventListener('compositionend', this.onCompositionEnd, false);\n }\n }\n }, {\n key: \"stopListeningComposition\",\n value: function stopListeningComposition() {\n if (document && document.removeEventListener) {\n document.removeEventListener('compositionstart', this.onCompositionStart);\n document.removeEventListener('compositionend', this.onCompositionEnd);\n }\n }\n }, {\n key: \"startListeningToTouch\",\n // ==============================\n // Touch Handlers\n // ==============================\n value: function startListeningToTouch() {\n if (document && document.addEventListener) {\n document.addEventListener('touchstart', this.onTouchStart, false);\n document.addEventListener('touchmove', this.onTouchMove, false);\n document.addEventListener('touchend', this.onTouchEnd, false);\n }\n }\n }, {\n key: \"stopListeningToTouch\",\n value: function stopListeningToTouch() {\n if (document && document.removeEventListener) {\n document.removeEventListener('touchstart', this.onTouchStart);\n document.removeEventListener('touchmove', this.onTouchMove);\n document.removeEventListener('touchend', this.onTouchEnd);\n }\n }\n }, {\n key: \"buildMenuOptions\",\n // ==============================\n // Menu Options\n // ==============================\n value: function buildMenuOptions(props, selectValue) {\n var _this3 = this;\n\n var _props$inputValue = props.inputValue,\n inputValue = _props$inputValue === void 0 ? '' : _props$inputValue,\n options = props.options;\n\n var toOption = function toOption(option, id) {\n var isDisabled = _this3.isOptionDisabled(option, selectValue);\n\n var isSelected = _this3.isOptionSelected(option, selectValue);\n\n var label = _this3.getOptionLabel(option);\n\n var value = _this3.getOptionValue(option);\n\n if (_this3.shouldHideSelectedOptions() && isSelected || !_this3.filterOption({\n label: label,\n value: value,\n data: option\n }, inputValue)) {\n return;\n }\n\n var onHover = isDisabled ? undefined : function () {\n return _this3.onOptionHover(option);\n };\n var onSelect = isDisabled ? undefined : function () {\n return _this3.selectOption(option);\n };\n var optionId = \"\".concat(_this3.getElementId('option'), \"-\").concat(id);\n return {\n innerProps: {\n id: optionId,\n onClick: onSelect,\n onMouseMove: onHover,\n onMouseOver: onHover,\n tabIndex: -1\n },\n data: option,\n isDisabled: isDisabled,\n isSelected: isSelected,\n key: optionId,\n label: label,\n type: 'option',\n value: value\n };\n };\n\n return options.reduce(function (acc, item, itemIndex) {\n if (item.options) {\n // TODO needs a tidier implementation\n if (!_this3.hasGroups) _this3.hasGroups = true;\n var items = item.options;\n var children = items.map(function (child, i) {\n var option = toOption(child, \"\".concat(itemIndex, \"-\").concat(i));\n if (option) acc.focusable.push(child);\n return option;\n }).filter(Boolean);\n\n if (children.length) {\n var groupId = \"\".concat(_this3.getElementId('group'), \"-\").concat(itemIndex);\n acc.render.push({\n type: 'group',\n key: groupId,\n data: item,\n options: children\n });\n }\n } else {\n var option = toOption(item, \"\".concat(itemIndex));\n\n if (option) {\n acc.render.push(option);\n acc.focusable.push(item);\n }\n }\n\n return acc;\n }, {\n render: [],\n focusable: []\n });\n } // ==============================\n // Renderers\n // ==============================\n\n }, {\n key: \"constructAriaLiveMessage\",\n value: function constructAriaLiveMessage() {\n var _this$state7 = this.state,\n ariaLiveContext = _this$state7.ariaLiveContext,\n selectValue = _this$state7.selectValue,\n focusedValue = _this$state7.focusedValue,\n focusedOption = _this$state7.focusedOption;\n var _this$props13 = this.props,\n options = _this$props13.options,\n menuIsOpen = _this$props13.menuIsOpen,\n inputValue = _this$props13.inputValue,\n screenReaderStatus = _this$props13.screenReaderStatus; // An aria live message representing the currently focused value in the select.\n\n var focusedValueMsg = focusedValue ? (0, _index2.valueFocusAriaMessage)({\n focusedValue: focusedValue,\n getOptionLabel: this.getOptionLabel,\n selectValue: selectValue\n }) : ''; // An aria live message representing the currently focused option in the select.\n\n var focusedOptionMsg = focusedOption && menuIsOpen ? (0, _index2.optionFocusAriaMessage)({\n focusedOption: focusedOption,\n getOptionLabel: this.getOptionLabel,\n options: options\n }) : ''; // An aria live message representing the set of focusable results and current searchterm/inputvalue.\n\n var resultsMsg = (0, _index2.resultsAriaMessage)({\n inputValue: inputValue,\n screenReaderMessage: screenReaderStatus({\n count: this.countOptions()\n })\n });\n return \"\".concat(focusedValueMsg, \" \").concat(focusedOptionMsg, \" \").concat(resultsMsg, \" \").concat(ariaLiveContext);\n }\n }, {\n key: \"renderInput\",\n value: function renderInput() {\n var _this$props14 = this.props,\n isDisabled = _this$props14.isDisabled,\n isSearchable = _this$props14.isSearchable,\n inputId = _this$props14.inputId,\n inputValue = _this$props14.inputValue,\n tabIndex = _this$props14.tabIndex;\n var Input = this.components.Input;\n var inputIsHidden = this.state.inputIsHidden;\n var id = inputId || this.getElementId('input');\n\n if (!isSearchable) {\n // use a dummy input to maintain focus/blur functionality\n return _react.default.createElement(_index.DummyInput, {\n id: id,\n innerRef: this.getInputRef,\n onBlur: this.onInputBlur,\n onChange: _utils.noop,\n onFocus: this.onInputFocus,\n readOnly: true,\n disabled: isDisabled,\n tabIndex: tabIndex,\n value: \"\"\n });\n } // aria attributes makes the JSX \"noisy\", separated for clarity\n\n\n var ariaAttributes = {\n 'aria-autocomplete': 'list',\n 'aria-label': this.props['aria-label'],\n 'aria-labelledby': this.props['aria-labelledby']\n };\n var _this$commonProps = this.commonProps,\n cx = _this$commonProps.cx,\n theme = _this$commonProps.theme,\n selectProps = _this$commonProps.selectProps;\n return _react.default.createElement(Input, _extends({\n autoCapitalize: \"none\",\n autoComplete: \"off\",\n autoCorrect: \"off\",\n cx: cx,\n getStyles: this.getStyles,\n id: id,\n innerRef: this.getInputRef,\n isDisabled: isDisabled,\n isHidden: inputIsHidden,\n onBlur: this.onInputBlur,\n onChange: this.handleInputChange,\n onFocus: this.onInputFocus,\n selectProps: selectProps,\n spellCheck: \"false\",\n tabIndex: tabIndex,\n theme: theme,\n type: \"text\",\n value: inputValue\n }, ariaAttributes));\n }\n }, {\n key: \"renderPlaceholderOrValue\",\n value: function renderPlaceholderOrValue() {\n var _this4 = this;\n\n var _this$components = this.components,\n MultiValue = _this$components.MultiValue,\n MultiValueContainer = _this$components.MultiValueContainer,\n MultiValueLabel = _this$components.MultiValueLabel,\n MultiValueRemove = _this$components.MultiValueRemove,\n SingleValue = _this$components.SingleValue,\n Placeholder = _this$components.Placeholder;\n var commonProps = this.commonProps;\n var _this$props15 = this.props,\n controlShouldRenderValue = _this$props15.controlShouldRenderValue,\n isDisabled = _this$props15.isDisabled,\n isMulti = _this$props15.isMulti,\n inputValue = _this$props15.inputValue,\n placeholder = _this$props15.placeholder;\n var _this$state8 = this.state,\n selectValue = _this$state8.selectValue,\n focusedValue = _this$state8.focusedValue,\n isFocused = _this$state8.isFocused;\n\n if (!this.hasValue() || !controlShouldRenderValue) {\n return inputValue ? null : _react.default.createElement(Placeholder, _extends({}, commonProps, {\n key: \"placeholder\",\n isDisabled: isDisabled,\n isFocused: isFocused\n }), placeholder);\n }\n\n if (isMulti) {\n var selectValues = selectValue.map(function (opt) {\n var isOptionFocused = opt === focusedValue;\n return _react.default.createElement(MultiValue, _extends({}, commonProps, {\n components: {\n Container: MultiValueContainer,\n Label: MultiValueLabel,\n Remove: MultiValueRemove\n },\n isFocused: isOptionFocused,\n isDisabled: isDisabled,\n key: _this4.getOptionValue(opt),\n removeProps: {\n onClick: function onClick() {\n return _this4.removeValue(opt);\n },\n onTouchEnd: function onTouchEnd() {\n return _this4.removeValue(opt);\n },\n onMouseDown: function onMouseDown(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n data: opt\n }), _this4.formatOptionLabel(opt, 'value'));\n });\n return selectValues;\n }\n\n if (inputValue) {\n return null;\n }\n\n var singleValue = selectValue[0];\n return _react.default.createElement(SingleValue, _extends({}, commonProps, {\n data: singleValue,\n isDisabled: isDisabled\n }), this.formatOptionLabel(singleValue, 'value'));\n }\n }, {\n key: \"renderClearIndicator\",\n value: function renderClearIndicator() {\n var ClearIndicator = this.components.ClearIndicator;\n var commonProps = this.commonProps;\n var _this$props16 = this.props,\n isDisabled = _this$props16.isDisabled,\n isLoading = _this$props16.isLoading;\n var isFocused = this.state.isFocused;\n\n if (!this.isClearable() || !ClearIndicator || isDisabled || !this.hasValue() || isLoading) {\n return null;\n }\n\n var innerProps = {\n onMouseDown: this.onClearIndicatorMouseDown,\n onTouchEnd: this.onClearIndicatorTouchEnd,\n 'aria-hidden': 'true'\n };\n return _react.default.createElement(ClearIndicator, _extends({}, commonProps, {\n innerProps: innerProps,\n isFocused: isFocused\n }));\n }\n }, {\n key: \"renderLoadingIndicator\",\n value: function renderLoadingIndicator() {\n var LoadingIndicator = this.components.LoadingIndicator;\n var commonProps = this.commonProps;\n var _this$props17 = this.props,\n isDisabled = _this$props17.isDisabled,\n isLoading = _this$props17.isLoading;\n var isFocused = this.state.isFocused;\n if (!LoadingIndicator || !isLoading) return null;\n var innerProps = {\n 'aria-hidden': 'true'\n };\n return _react.default.createElement(LoadingIndicator, _extends({}, commonProps, {\n innerProps: innerProps,\n isDisabled: isDisabled,\n isFocused: isFocused\n }));\n }\n }, {\n key: \"renderIndicatorSeparator\",\n value: function renderIndicatorSeparator() {\n var _this$components2 = this.components,\n DropdownIndicator = _this$components2.DropdownIndicator,\n IndicatorSeparator = _this$components2.IndicatorSeparator; // separator doesn't make sense without the dropdown indicator\n\n if (!DropdownIndicator || !IndicatorSeparator) return null;\n var commonProps = this.commonProps;\n var isDisabled = this.props.isDisabled;\n var isFocused = this.state.isFocused;\n return _react.default.createElement(IndicatorSeparator, _extends({}, commonProps, {\n isDisabled: isDisabled,\n isFocused: isFocused\n }));\n }\n }, {\n key: \"renderDropdownIndicator\",\n value: function renderDropdownIndicator() {\n var DropdownIndicator = this.components.DropdownIndicator;\n if (!DropdownIndicator) return null;\n var commonProps = this.commonProps;\n var isDisabled = this.props.isDisabled;\n var isFocused = this.state.isFocused;\n var innerProps = {\n onMouseDown: this.onDropdownIndicatorMouseDown,\n onTouchEnd: this.onDropdownIndicatorTouchEnd,\n 'aria-hidden': 'true'\n };\n return _react.default.createElement(DropdownIndicator, _extends({}, commonProps, {\n innerProps: innerProps,\n isDisabled: isDisabled,\n isFocused: isFocused\n }));\n }\n }, {\n key: \"renderMenu\",\n value: function renderMenu() {\n var _this5 = this;\n\n var _this$components3 = this.components,\n Group = _this$components3.Group,\n GroupHeading = _this$components3.GroupHeading,\n Menu = _this$components3.Menu,\n MenuList = _this$components3.MenuList,\n MenuPortal = _this$components3.MenuPortal,\n LoadingMessage = _this$components3.LoadingMessage,\n NoOptionsMessage = _this$components3.NoOptionsMessage,\n Option = _this$components3.Option;\n var commonProps = this.commonProps;\n var _this$state9 = this.state,\n focusedOption = _this$state9.focusedOption,\n menuOptions = _this$state9.menuOptions;\n var _this$props18 = this.props,\n captureMenuScroll = _this$props18.captureMenuScroll,\n inputValue = _this$props18.inputValue,\n isLoading = _this$props18.isLoading,\n loadingMessage = _this$props18.loadingMessage,\n minMenuHeight = _this$props18.minMenuHeight,\n maxMenuHeight = _this$props18.maxMenuHeight,\n menuIsOpen = _this$props18.menuIsOpen,\n menuPlacement = _this$props18.menuPlacement,\n menuPosition = _this$props18.menuPosition,\n menuPortalTarget = _this$props18.menuPortalTarget,\n menuShouldBlockScroll = _this$props18.menuShouldBlockScroll,\n menuShouldScrollIntoView = _this$props18.menuShouldScrollIntoView,\n noOptionsMessage = _this$props18.noOptionsMessage,\n onMenuScrollToTop = _this$props18.onMenuScrollToTop,\n onMenuScrollToBottom = _this$props18.onMenuScrollToBottom;\n if (!menuIsOpen) return null; // TODO: Internal Option Type here\n\n var render = function render(props) {\n // for performance, the menu options in state aren't changed when the\n // focused option changes so we calculate additional props based on that\n var isFocused = focusedOption === props.data;\n props.innerRef = isFocused ? _this5.getFocusedOptionRef : undefined;\n return _react.default.createElement(Option, _extends({}, commonProps, props, {\n isFocused: isFocused\n }), _this5.formatOptionLabel(props.data, 'menu'));\n };\n\n var menuUI;\n\n if (this.hasOptions()) {\n menuUI = menuOptions.render.map(function (item) {\n if (item.type === 'group') {\n var type = item.type,\n group = _objectWithoutProperties(item, [\"type\"]);\n\n var headingId = \"\".concat(item.key, \"-heading\");\n return _react.default.createElement(Group, _extends({}, commonProps, group, {\n Heading: GroupHeading,\n headingProps: {\n id: headingId\n },\n label: _this5.formatGroupLabel(item.data)\n }), item.options.map(function (option) {\n return render(option);\n }));\n } else if (item.type === 'option') {\n return render(item);\n }\n });\n } else if (isLoading) {\n var message = loadingMessage({\n inputValue: inputValue\n });\n if (message === null) return null;\n menuUI = _react.default.createElement(LoadingMessage, commonProps, message);\n } else {\n var _message = noOptionsMessage({\n inputValue: inputValue\n });\n\n if (_message === null) return null;\n menuUI = _react.default.createElement(NoOptionsMessage, commonProps, _message);\n }\n\n var menuPlacementProps = {\n minMenuHeight: minMenuHeight,\n maxMenuHeight: maxMenuHeight,\n menuPlacement: menuPlacement,\n menuPosition: menuPosition,\n menuShouldScrollIntoView: menuShouldScrollIntoView\n };\n\n var menuElement = _react.default.createElement(_Menu.MenuPlacer, _extends({}, commonProps, menuPlacementProps), function (_ref6) {\n var ref = _ref6.ref,\n _ref6$placerProps = _ref6.placerProps,\n placement = _ref6$placerProps.placement,\n maxHeight = _ref6$placerProps.maxHeight;\n return _react.default.createElement(Menu, _extends({}, commonProps, menuPlacementProps, {\n innerRef: ref,\n innerProps: {\n onMouseDown: _this5.onMenuMouseDown,\n onMouseMove: _this5.onMenuMouseMove\n },\n isLoading: isLoading,\n placement: placement\n }), _react.default.createElement(_index.ScrollCaptor, {\n isEnabled: captureMenuScroll,\n onTopArrive: onMenuScrollToTop,\n onBottomArrive: onMenuScrollToBottom\n }, _react.default.createElement(_index.ScrollBlock, {\n isEnabled: menuShouldBlockScroll\n }, _react.default.createElement(MenuList, _extends({}, commonProps, {\n innerRef: _this5.getMenuListRef,\n isLoading: isLoading,\n maxHeight: maxHeight\n }), menuUI))));\n }); // positioning behaviour is almost identical for portalled and fixed,\n // so we use the same component. the actual portalling logic is forked\n // within the component based on `menuPosition`\n\n\n return menuPortalTarget || menuPosition === 'fixed' ? _react.default.createElement(MenuPortal, _extends({}, commonProps, {\n appendTo: menuPortalTarget,\n controlElement: this.controlRef,\n menuPlacement: menuPlacement,\n menuPosition: menuPosition\n }), menuElement) : menuElement;\n }\n }, {\n key: \"renderFormField\",\n value: function renderFormField() {\n var _this6 = this;\n\n var _this$props19 = this.props,\n delimiter = _this$props19.delimiter,\n isDisabled = _this$props19.isDisabled,\n isMulti = _this$props19.isMulti,\n name = _this$props19.name;\n var selectValue = this.state.selectValue;\n if (!name || isDisabled) return;\n\n if (isMulti) {\n if (delimiter) {\n var value = selectValue.map(function (opt) {\n return _this6.getOptionValue(opt);\n }).join(delimiter);\n return _react.default.createElement(\"input\", {\n name: name,\n type: \"hidden\",\n value: value\n });\n } else {\n var input = selectValue.length > 0 ? selectValue.map(function (opt, i) {\n return _react.default.createElement(\"input\", {\n key: \"i-\".concat(i),\n name: name,\n type: \"hidden\",\n value: _this6.getOptionValue(opt)\n });\n }) : _react.default.createElement(\"input\", {\n name: name,\n type: \"hidden\"\n });\n return _react.default.createElement(\"div\", null, input);\n }\n } else {\n var _value = selectValue[0] ? this.getOptionValue(selectValue[0]) : '';\n\n return _react.default.createElement(\"input\", {\n name: name,\n type: \"hidden\",\n value: _value\n });\n }\n }\n }, {\n key: \"renderLiveRegion\",\n value: function renderLiveRegion() {\n if (!this.state.isFocused) return null;\n return _react.default.createElement(_index.A11yText, {\n \"aria-live\": \"assertive\"\n }, _react.default.createElement(\"p\", {\n id: \"aria-selection-event\"\n }, \"\\xA0\", this.state.ariaLiveSelection), _react.default.createElement(\"p\", {\n id: \"aria-context\"\n }, \"\\xA0\", this.constructAriaLiveMessage()));\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this$components4 = this.components,\n Control = _this$components4.Control,\n IndicatorsContainer = _this$components4.IndicatorsContainer,\n SelectContainer = _this$components4.SelectContainer,\n ValueContainer = _this$components4.ValueContainer;\n var _this$props20 = this.props,\n className = _this$props20.className,\n id = _this$props20.id,\n isDisabled = _this$props20.isDisabled,\n menuIsOpen = _this$props20.menuIsOpen;\n var isFocused = this.state.isFocused;\n var commonProps = this.commonProps = this.getCommonProps();\n return _react.default.createElement(SelectContainer, _extends({}, commonProps, {\n className: className,\n innerProps: {\n id: id,\n onKeyDown: this.onKeyDown\n },\n isDisabled: isDisabled,\n isFocused: isFocused\n }), this.renderLiveRegion(), _react.default.createElement(Control, _extends({}, commonProps, {\n innerRef: this.getControlRef,\n innerProps: {\n onMouseDown: this.onControlMouseDown,\n onTouchEnd: this.onControlTouchEnd\n },\n isDisabled: isDisabled,\n isFocused: isFocused,\n menuIsOpen: menuIsOpen\n }), _react.default.createElement(ValueContainer, _extends({}, commonProps, {\n isDisabled: isDisabled\n }), this.renderPlaceholderOrValue(), this.renderInput()), _react.default.createElement(IndicatorsContainer, _extends({}, commonProps, {\n isDisabled: isDisabled\n }), this.renderClearIndicator(), this.renderLoadingIndicator(), this.renderIndicatorSeparator(), this.renderDropdownIndicator())), this.renderMenu(), this.renderFormField());\n }\n }]);\n\n return Select;\n}(_react.Component);\n\nexports.default = Select;\n\n_defineProperty(Select, \"defaultProps\", defaultProps);","function areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n\n for (var i = 0; i < newInputs.length; i++) {\n if (newInputs[i] !== lastInputs[i]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction index(resultFn, isEqual) {\n if (isEqual === void 0) {\n isEqual = areInputsEqual;\n }\n\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n\n var result = function result() {\n for (var _len = arguments.length, newArgs = new Array(_len), _key = 0; _key < _len; _key++) {\n newArgs[_key] = arguments[_key];\n }\n\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n };\n\n return result;\n}\n\nexport default index;","(function (factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module['exports'] = factory() : typeof define === 'function' && define['amd'] ? define(factory()) : window['stylisRuleSheet'] = factory();\n})(function () {\n 'use strict';\n\n return function (insertRule) {\n var delimiter = '/*|*/';\n var needle = delimiter + '}';\n\n function toSheet(block) {\n if (block) try {\n insertRule(block + '}');\n } catch (e) {}\n }\n\n return function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) {\n switch (context) {\n // property\n case 1:\n // @import\n if (depth === 0 && content.charCodeAt(0) === 64) return insertRule(content + ';'), '';\n break;\n // selector\n\n case 2:\n if (ns === 0) return content + delimiter;\n break;\n // at-rule\n\n case 3:\n switch (ns) {\n // @font-face, @page\n case 102:\n case 112:\n return insertRule(selectors[0] + content), '';\n\n default:\n return content + (at === 0 ? delimiter : '');\n }\n\n case -2:\n content.split(needle).forEach(toSheet);\n }\n };\n };\n});","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exportedEqual;\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nvar isArray = Array.isArray;\nvar keyList = Object.keys;\nvar hasProp = Object.prototype.hasOwnProperty;\n\nfunction equal(a, b) {\n // fast-deep-equal index.js 2.0.1\n if (a === b) return true;\n\n if (a && b && _typeof(a) == 'object' && _typeof(b) == 'object') {\n var arrA = isArray(a),\n arrB = isArray(b),\n i,\n length,\n key;\n\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length) return false;\n\n for (i = length; i-- !== 0;) {\n if (!equal(a[i], b[i])) return false;\n }\n\n return true;\n }\n\n if (arrA != arrB) return false;\n var dateA = a instanceof Date,\n dateB = b instanceof Date;\n if (dateA != dateB) return false;\n if (dateA && dateB) return a.getTime() == b.getTime();\n var regexpA = a instanceof RegExp,\n regexpB = b instanceof RegExp;\n if (regexpA != regexpB) return false;\n if (regexpA && regexpB) return a.toString() == b.toString();\n var keys = keyList(a);\n length = keys.length;\n\n if (length !== keyList(b).length) {\n return false;\n }\n\n for (i = length; i-- !== 0;) {\n if (!hasProp.call(b, keys[i])) return false;\n } // end fast-deep-equal\n // Custom handling for React\n\n\n for (i = length; i-- !== 0;) {\n key = keys[i];\n\n if (key === '_owner' && a.$$typeof) {\n // React-specific: avoid traversing React elements' _owner.\n // _owner contains circular references\n // and is not needed when comparing the actual elements (and not their owners)\n // .$$typeof and ._store on just reasonable markers of a react element\n continue;\n } else {\n // all other properties should be traversed as usual\n if (!equal(a[key], b[key])) return false;\n }\n } // fast-deep-equal index.js 2.0.1\n\n\n return true;\n }\n\n return a !== a && b !== b;\n} // end fast-deep-equal\n\n\nfunction exportedEqual(a, b) {\n try {\n return equal(a, b);\n } catch (error) {\n if (error.message && error.message.match(/stack|recursion/i)) {\n // warn on circular references, don't crash\n // browsers give this different errors name and messages:\n // chrome/safari: \"RangeError\", \"Maximum call stack size exceeded\"\n // firefox: \"InternalError\", too much recursion\"\n // edge: \"Error\", \"Out of stack space\"\n console.warn('Warning: react-fast-compare does not handle circular references.', error.name, error.message);\n return false;\n } // some other error. we should definitely know about these\n\n\n throw error;\n }\n}\n\n;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.createFilter = void 0;\n\nvar _diacritics = require(\"./diacritics\");\n\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\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\nvar trimString = function trimString(str) {\n return str.replace(/^\\s+|\\s+$/g, '');\n};\n\nvar defaultStringify = function defaultStringify(option) {\n return \"\".concat(option.label, \" \").concat(option.value);\n};\n\nvar createFilter = function createFilter(config) {\n return function (option, rawInput) {\n var _ignoreCase$ignoreAcc = _objectSpread({\n ignoreCase: true,\n ignoreAccents: true,\n stringify: defaultStringify,\n trim: true,\n matchFrom: 'any'\n }, config),\n ignoreCase = _ignoreCase$ignoreAcc.ignoreCase,\n ignoreAccents = _ignoreCase$ignoreAcc.ignoreAccents,\n stringify = _ignoreCase$ignoreAcc.stringify,\n trim = _ignoreCase$ignoreAcc.trim,\n matchFrom = _ignoreCase$ignoreAcc.matchFrom;\n\n var input = trim ? trimString(rawInput) : rawInput;\n var candidate = trim ? trimString(stringify(option)) : stringify(option);\n\n if (ignoreCase) {\n input = input.toLowerCase();\n candidate = candidate.toLowerCase();\n }\n\n if (ignoreAccents) {\n input = (0, _diacritics.stripDiacritics)(input);\n candidate = (0, _diacritics.stripDiacritics)(candidate);\n }\n\n return matchFrom === 'start' ? candidate.substr(0, input.length) === input : candidate.indexOf(input) > -1;\n };\n};\n\nexports.createFilter = createFilter;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.stripDiacritics = void 0;\nvar diacritics = [{\n base: 'A',\n letters: /[\\u0041\\u24B6\\uFF21\\u00C0\\u00C1\\u00C2\\u1EA6\\u1EA4\\u1EAA\\u1EA8\\u00C3\\u0100\\u0102\\u1EB0\\u1EAE\\u1EB4\\u1EB2\\u0226\\u01E0\\u00C4\\u01DE\\u1EA2\\u00C5\\u01FA\\u01CD\\u0200\\u0202\\u1EA0\\u1EAC\\u1EB6\\u1E00\\u0104\\u023A\\u2C6F]/g\n}, {\n base: 'AA',\n letters: /[\\uA732]/g\n}, {\n base: 'AE',\n letters: /[\\u00C6\\u01FC\\u01E2]/g\n}, {\n base: 'AO',\n letters: /[\\uA734]/g\n}, {\n base: 'AU',\n letters: /[\\uA736]/g\n}, {\n base: 'AV',\n letters: /[\\uA738\\uA73A]/g\n}, {\n base: 'AY',\n letters: /[\\uA73C]/g\n}, {\n base: 'B',\n letters: /[\\u0042\\u24B7\\uFF22\\u1E02\\u1E04\\u1E06\\u0243\\u0182\\u0181]/g\n}, {\n base: 'C',\n letters: /[\\u0043\\u24B8\\uFF23\\u0106\\u0108\\u010A\\u010C\\u00C7\\u1E08\\u0187\\u023B\\uA73E]/g\n}, {\n base: 'D',\n letters: /[\\u0044\\u24B9\\uFF24\\u1E0A\\u010E\\u1E0C\\u1E10\\u1E12\\u1E0E\\u0110\\u018B\\u018A\\u0189\\uA779]/g\n}, {\n base: 'DZ',\n letters: /[\\u01F1\\u01C4]/g\n}, {\n base: 'Dz',\n letters: /[\\u01F2\\u01C5]/g\n}, {\n base: 'E',\n letters: /[\\u0045\\u24BA\\uFF25\\u00C8\\u00C9\\u00CA\\u1EC0\\u1EBE\\u1EC4\\u1EC2\\u1EBC\\u0112\\u1E14\\u1E16\\u0114\\u0116\\u00CB\\u1EBA\\u011A\\u0204\\u0206\\u1EB8\\u1EC6\\u0228\\u1E1C\\u0118\\u1E18\\u1E1A\\u0190\\u018E]/g\n}, {\n base: 'F',\n letters: /[\\u0046\\u24BB\\uFF26\\u1E1E\\u0191\\uA77B]/g\n}, {\n base: 'G',\n letters: /[\\u0047\\u24BC\\uFF27\\u01F4\\u011C\\u1E20\\u011E\\u0120\\u01E6\\u0122\\u01E4\\u0193\\uA7A0\\uA77D\\uA77E]/g\n}, {\n base: 'H',\n letters: /[\\u0048\\u24BD\\uFF28\\u0124\\u1E22\\u1E26\\u021E\\u1E24\\u1E28\\u1E2A\\u0126\\u2C67\\u2C75\\uA78D]/g\n}, {\n base: 'I',\n letters: /[\\u0049\\u24BE\\uFF29\\u00CC\\u00CD\\u00CE\\u0128\\u012A\\u012C\\u0130\\u00CF\\u1E2E\\u1EC8\\u01CF\\u0208\\u020A\\u1ECA\\u012E\\u1E2C\\u0197]/g\n}, {\n base: 'J',\n letters: /[\\u004A\\u24BF\\uFF2A\\u0134\\u0248]/g\n}, {\n base: 'K',\n letters: /[\\u004B\\u24C0\\uFF2B\\u1E30\\u01E8\\u1E32\\u0136\\u1E34\\u0198\\u2C69\\uA740\\uA742\\uA744\\uA7A2]/g\n}, {\n base: 'L',\n letters: /[\\u004C\\u24C1\\uFF2C\\u013F\\u0139\\u013D\\u1E36\\u1E38\\u013B\\u1E3C\\u1E3A\\u0141\\u023D\\u2C62\\u2C60\\uA748\\uA746\\uA780]/g\n}, {\n base: 'LJ',\n letters: /[\\u01C7]/g\n}, {\n base: 'Lj',\n letters: /[\\u01C8]/g\n}, {\n base: 'M',\n letters: /[\\u004D\\u24C2\\uFF2D\\u1E3E\\u1E40\\u1E42\\u2C6E\\u019C]/g\n}, {\n base: 'N',\n letters: /[\\u004E\\u24C3\\uFF2E\\u01F8\\u0143\\u00D1\\u1E44\\u0147\\u1E46\\u0145\\u1E4A\\u1E48\\u0220\\u019D\\uA790\\uA7A4]/g\n}, {\n base: 'NJ',\n letters: /[\\u01CA]/g\n}, {\n base: 'Nj',\n letters: /[\\u01CB]/g\n}, {\n base: 'O',\n letters: /[\\u004F\\u24C4\\uFF2F\\u00D2\\u00D3\\u00D4\\u1ED2\\u1ED0\\u1ED6\\u1ED4\\u00D5\\u1E4C\\u022C\\u1E4E\\u014C\\u1E50\\u1E52\\u014E\\u022E\\u0230\\u00D6\\u022A\\u1ECE\\u0150\\u01D1\\u020C\\u020E\\u01A0\\u1EDC\\u1EDA\\u1EE0\\u1EDE\\u1EE2\\u1ECC\\u1ED8\\u01EA\\u01EC\\u00D8\\u01FE\\u0186\\u019F\\uA74A\\uA74C]/g\n}, {\n base: 'OI',\n letters: /[\\u01A2]/g\n}, {\n base: 'OO',\n letters: /[\\uA74E]/g\n}, {\n base: 'OU',\n letters: /[\\u0222]/g\n}, {\n base: 'P',\n letters: /[\\u0050\\u24C5\\uFF30\\u1E54\\u1E56\\u01A4\\u2C63\\uA750\\uA752\\uA754]/g\n}, {\n base: 'Q',\n letters: /[\\u0051\\u24C6\\uFF31\\uA756\\uA758\\u024A]/g\n}, {\n base: 'R',\n letters: /[\\u0052\\u24C7\\uFF32\\u0154\\u1E58\\u0158\\u0210\\u0212\\u1E5A\\u1E5C\\u0156\\u1E5E\\u024C\\u2C64\\uA75A\\uA7A6\\uA782]/g\n}, {\n base: 'S',\n letters: /[\\u0053\\u24C8\\uFF33\\u1E9E\\u015A\\u1E64\\u015C\\u1E60\\u0160\\u1E66\\u1E62\\u1E68\\u0218\\u015E\\u2C7E\\uA7A8\\uA784]/g\n}, {\n base: 'T',\n letters: /[\\u0054\\u24C9\\uFF34\\u1E6A\\u0164\\u1E6C\\u021A\\u0162\\u1E70\\u1E6E\\u0166\\u01AC\\u01AE\\u023E\\uA786]/g\n}, {\n base: 'TZ',\n letters: /[\\uA728]/g\n}, {\n base: 'U',\n letters: /[\\u0055\\u24CA\\uFF35\\u00D9\\u00DA\\u00DB\\u0168\\u1E78\\u016A\\u1E7A\\u016C\\u00DC\\u01DB\\u01D7\\u01D5\\u01D9\\u1EE6\\u016E\\u0170\\u01D3\\u0214\\u0216\\u01AF\\u1EEA\\u1EE8\\u1EEE\\u1EEC\\u1EF0\\u1EE4\\u1E72\\u0172\\u1E76\\u1E74\\u0244]/g\n}, {\n base: 'V',\n letters: /[\\u0056\\u24CB\\uFF36\\u1E7C\\u1E7E\\u01B2\\uA75E\\u0245]/g\n}, {\n base: 'VY',\n letters: /[\\uA760]/g\n}, {\n base: 'W',\n letters: /[\\u0057\\u24CC\\uFF37\\u1E80\\u1E82\\u0174\\u1E86\\u1E84\\u1E88\\u2C72]/g\n}, {\n base: 'X',\n letters: /[\\u0058\\u24CD\\uFF38\\u1E8A\\u1E8C]/g\n}, {\n base: 'Y',\n letters: /[\\u0059\\u24CE\\uFF39\\u1EF2\\u00DD\\u0176\\u1EF8\\u0232\\u1E8E\\u0178\\u1EF6\\u1EF4\\u01B3\\u024E\\u1EFE]/g\n}, {\n base: 'Z',\n letters: /[\\u005A\\u24CF\\uFF3A\\u0179\\u1E90\\u017B\\u017D\\u1E92\\u1E94\\u01B5\\u0224\\u2C7F\\u2C6B\\uA762]/g\n}, {\n base: 'a',\n letters: /[\\u0061\\u24D0\\uFF41\\u1E9A\\u00E0\\u00E1\\u00E2\\u1EA7\\u1EA5\\u1EAB\\u1EA9\\u00E3\\u0101\\u0103\\u1EB1\\u1EAF\\u1EB5\\u1EB3\\u0227\\u01E1\\u00E4\\u01DF\\u1EA3\\u00E5\\u01FB\\u01CE\\u0201\\u0203\\u1EA1\\u1EAD\\u1EB7\\u1E01\\u0105\\u2C65\\u0250]/g\n}, {\n base: 'aa',\n letters: /[\\uA733]/g\n}, {\n base: 'ae',\n letters: /[\\u00E6\\u01FD\\u01E3]/g\n}, {\n base: 'ao',\n letters: /[\\uA735]/g\n}, {\n base: 'au',\n letters: /[\\uA737]/g\n}, {\n base: 'av',\n letters: /[\\uA739\\uA73B]/g\n}, {\n base: 'ay',\n letters: /[\\uA73D]/g\n}, {\n base: 'b',\n letters: /[\\u0062\\u24D1\\uFF42\\u1E03\\u1E05\\u1E07\\u0180\\u0183\\u0253]/g\n}, {\n base: 'c',\n letters: /[\\u0063\\u24D2\\uFF43\\u0107\\u0109\\u010B\\u010D\\u00E7\\u1E09\\u0188\\u023C\\uA73F\\u2184]/g\n}, {\n base: 'd',\n letters: /[\\u0064\\u24D3\\uFF44\\u1E0B\\u010F\\u1E0D\\u1E11\\u1E13\\u1E0F\\u0111\\u018C\\u0256\\u0257\\uA77A]/g\n}, {\n base: 'dz',\n letters: /[\\u01F3\\u01C6]/g\n}, {\n base: 'e',\n letters: /[\\u0065\\u24D4\\uFF45\\u00E8\\u00E9\\u00EA\\u1EC1\\u1EBF\\u1EC5\\u1EC3\\u1EBD\\u0113\\u1E15\\u1E17\\u0115\\u0117\\u00EB\\u1EBB\\u011B\\u0205\\u0207\\u1EB9\\u1EC7\\u0229\\u1E1D\\u0119\\u1E19\\u1E1B\\u0247\\u025B\\u01DD]/g\n}, {\n base: 'f',\n letters: /[\\u0066\\u24D5\\uFF46\\u1E1F\\u0192\\uA77C]/g\n}, {\n base: 'g',\n letters: /[\\u0067\\u24D6\\uFF47\\u01F5\\u011D\\u1E21\\u011F\\u0121\\u01E7\\u0123\\u01E5\\u0260\\uA7A1\\u1D79\\uA77F]/g\n}, {\n base: 'h',\n letters: /[\\u0068\\u24D7\\uFF48\\u0125\\u1E23\\u1E27\\u021F\\u1E25\\u1E29\\u1E2B\\u1E96\\u0127\\u2C68\\u2C76\\u0265]/g\n}, {\n base: 'hv',\n letters: /[\\u0195]/g\n}, {\n base: 'i',\n letters: /[\\u0069\\u24D8\\uFF49\\u00EC\\u00ED\\u00EE\\u0129\\u012B\\u012D\\u00EF\\u1E2F\\u1EC9\\u01D0\\u0209\\u020B\\u1ECB\\u012F\\u1E2D\\u0268\\u0131]/g\n}, {\n base: 'j',\n letters: /[\\u006A\\u24D9\\uFF4A\\u0135\\u01F0\\u0249]/g\n}, {\n base: 'k',\n letters: /[\\u006B\\u24DA\\uFF4B\\u1E31\\u01E9\\u1E33\\u0137\\u1E35\\u0199\\u2C6A\\uA741\\uA743\\uA745\\uA7A3]/g\n}, {\n base: 'l',\n letters: /[\\u006C\\u24DB\\uFF4C\\u0140\\u013A\\u013E\\u1E37\\u1E39\\u013C\\u1E3D\\u1E3B\\u017F\\u0142\\u019A\\u026B\\u2C61\\uA749\\uA781\\uA747]/g\n}, {\n base: 'lj',\n letters: /[\\u01C9]/g\n}, {\n base: 'm',\n letters: /[\\u006D\\u24DC\\uFF4D\\u1E3F\\u1E41\\u1E43\\u0271\\u026F]/g\n}, {\n base: 'n',\n letters: /[\\u006E\\u24DD\\uFF4E\\u01F9\\u0144\\u00F1\\u1E45\\u0148\\u1E47\\u0146\\u1E4B\\u1E49\\u019E\\u0272\\u0149\\uA791\\uA7A5]/g\n}, {\n base: 'nj',\n letters: /[\\u01CC]/g\n}, {\n base: 'o',\n letters: /[\\u006F\\u24DE\\uFF4F\\u00F2\\u00F3\\u00F4\\u1ED3\\u1ED1\\u1ED7\\u1ED5\\u00F5\\u1E4D\\u022D\\u1E4F\\u014D\\u1E51\\u1E53\\u014F\\u022F\\u0231\\u00F6\\u022B\\u1ECF\\u0151\\u01D2\\u020D\\u020F\\u01A1\\u1EDD\\u1EDB\\u1EE1\\u1EDF\\u1EE3\\u1ECD\\u1ED9\\u01EB\\u01ED\\u00F8\\u01FF\\u0254\\uA74B\\uA74D\\u0275]/g\n}, {\n base: 'oi',\n letters: /[\\u01A3]/g\n}, {\n base: 'ou',\n letters: /[\\u0223]/g\n}, {\n base: 'oo',\n letters: /[\\uA74F]/g\n}, {\n base: 'p',\n letters: /[\\u0070\\u24DF\\uFF50\\u1E55\\u1E57\\u01A5\\u1D7D\\uA751\\uA753\\uA755]/g\n}, {\n base: 'q',\n letters: /[\\u0071\\u24E0\\uFF51\\u024B\\uA757\\uA759]/g\n}, {\n base: 'r',\n letters: /[\\u0072\\u24E1\\uFF52\\u0155\\u1E59\\u0159\\u0211\\u0213\\u1E5B\\u1E5D\\u0157\\u1E5F\\u024D\\u027D\\uA75B\\uA7A7\\uA783]/g\n}, {\n base: 's',\n letters: /[\\u0073\\u24E2\\uFF53\\u00DF\\u015B\\u1E65\\u015D\\u1E61\\u0161\\u1E67\\u1E63\\u1E69\\u0219\\u015F\\u023F\\uA7A9\\uA785\\u1E9B]/g\n}, {\n base: 't',\n letters: /[\\u0074\\u24E3\\uFF54\\u1E6B\\u1E97\\u0165\\u1E6D\\u021B\\u0163\\u1E71\\u1E6F\\u0167\\u01AD\\u0288\\u2C66\\uA787]/g\n}, {\n base: 'tz',\n letters: /[\\uA729]/g\n}, {\n base: 'u',\n letters: /[\\u0075\\u24E4\\uFF55\\u00F9\\u00FA\\u00FB\\u0169\\u1E79\\u016B\\u1E7B\\u016D\\u00FC\\u01DC\\u01D8\\u01D6\\u01DA\\u1EE7\\u016F\\u0171\\u01D4\\u0215\\u0217\\u01B0\\u1EEB\\u1EE9\\u1EEF\\u1EED\\u1EF1\\u1EE5\\u1E73\\u0173\\u1E77\\u1E75\\u0289]/g\n}, {\n base: 'v',\n letters: /[\\u0076\\u24E5\\uFF56\\u1E7D\\u1E7F\\u028B\\uA75F\\u028C]/g\n}, {\n base: 'vy',\n letters: /[\\uA761]/g\n}, {\n base: 'w',\n letters: /[\\u0077\\u24E6\\uFF57\\u1E81\\u1E83\\u0175\\u1E87\\u1E85\\u1E98\\u1E89\\u2C73]/g\n}, {\n base: 'x',\n letters: /[\\u0078\\u24E7\\uFF58\\u1E8B\\u1E8D]/g\n}, {\n base: 'y',\n letters: /[\\u0079\\u24E8\\uFF59\\u1EF3\\u00FD\\u0177\\u1EF9\\u0233\\u1E8F\\u00FF\\u1EF7\\u1E99\\u1EF5\\u01B4\\u024F\\u1EFF]/g\n}, {\n base: 'z',\n letters: /[\\u007A\\u24E9\\uFF5A\\u017A\\u1E91\\u017C\\u017E\\u1E93\\u1E95\\u01B6\\u0225\\u0240\\u2C6C\\uA763]/g\n}];\n\nvar stripDiacritics = function stripDiacritics(str) {\n for (var i = 0; i < diacritics.length; i++) {\n str = str.replace(diacritics[i].letters, diacritics[i].base);\n }\n\n return str;\n};\n\nexports.stripDiacritics = stripDiacritics;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"A11yText\", {\n enumerable: true,\n get: function get() {\n return _A11yText.default;\n }\n});\nObject.defineProperty(exports, \"DummyInput\", {\n enumerable: true,\n get: function get() {\n return _DummyInput.default;\n }\n});\nObject.defineProperty(exports, \"NodeResolver\", {\n enumerable: true,\n get: function get() {\n return _NodeResolver.default;\n }\n});\nObject.defineProperty(exports, \"ScrollBlock\", {\n enumerable: true,\n get: function get() {\n return _ScrollBlock.default;\n }\n});\nObject.defineProperty(exports, \"ScrollCaptor\", {\n enumerable: true,\n get: function get() {\n return _ScrollCaptor.default;\n }\n});\n\nvar _A11yText = _interopRequireDefault(require(\"./A11yText\"));\n\nvar _DummyInput = _interopRequireDefault(require(\"./DummyInput\"));\n\nvar _NodeResolver = _interopRequireDefault(require(\"./NodeResolver\"));\n\nvar _ScrollBlock = _interopRequireDefault(require(\"./ScrollBlock\"));\n\nvar _ScrollCaptor = _interopRequireDefault(require(\"./ScrollCaptor\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireDefault(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _extends() {\n _extends = Object.assign || 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} // Assistive text to describe visual elements. Hidden for sighted users.\n\n\nvar A11yText = function A11yText(props) {\n return _react.default.createElement(\"span\", _extends({\n className:\n /*#__PURE__*/\n\n /*#__PURE__*/\n (0, _emotion.css)({\n label: 'a11yText',\n zIndex: 9999,\n border: 0,\n clip: 'rect(1px, 1px, 1px, 1px)',\n height: 1,\n width: 1,\n position: 'absolute',\n overflow: 'hidden',\n padding: 0,\n whiteSpace: 'nowrap',\n backgroundColor: 'red',\n color: 'blue'\n })\n }, props));\n};\n\nvar _default = A11yText;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\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 _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 _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _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\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nvar DummyInput =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(DummyInput, _Component);\n\n function DummyInput() {\n _classCallCheck(this, DummyInput);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(DummyInput).apply(this, arguments));\n }\n\n _createClass(DummyInput, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n inProp = _this$props.in,\n out = _this$props.out,\n onExited = _this$props.onExited,\n appear = _this$props.appear,\n enter = _this$props.enter,\n exit = _this$props.exit,\n innerRef = _this$props.innerRef,\n emotion = _this$props.emotion,\n props = _objectWithoutProperties(_this$props, [\"in\", \"out\", \"onExited\", \"appear\", \"enter\", \"exit\", \"innerRef\", \"emotion\"]);\n\n return _react.default.createElement(\"input\", _extends({\n ref: innerRef\n }, props, {\n className:\n /*#__PURE__*/\n\n /*#__PURE__*/\n (0, _emotion.css)({\n label: 'dummyInput',\n // get rid of any default styles\n background: 0,\n border: 0,\n fontSize: 'inherit',\n outline: 0,\n padding: 0,\n // important! without `width` browsers won't allow focus\n width: 1,\n // remove cursor on desktop\n color: 'transparent',\n // remove cursor on mobile whilst maintaining \"scroll into view\" behaviour\n left: -100,\n opacity: 0,\n position: 'relative',\n transform: 'scale(0)'\n })\n }));\n }\n }]);\n\n return DummyInput;\n}(_react.Component);\n\nexports.default = DummyInput;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _emotion = require(\"emotion\");\n\nvar _NodeResolver = _interopRequireDefault(require(\"./NodeResolver\"));\n\nvar _index = _interopRequireDefault(require(\"./ScrollLock/index\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\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} // NOTE:\n// We shouldn't need this after updating to React v16.3.0, which introduces:\n// - createRef() https://reactjs.org/docs/react-api.html#reactcreateref\n// - forwardRef() https://reactjs.org/docs/react-api.html#reactforwardref\n\n\nvar ScrollBlock =\n/*#__PURE__*/\nfunction (_PureComponent) {\n _inherits(ScrollBlock, _PureComponent);\n\n function ScrollBlock() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, ScrollBlock);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ScrollBlock)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"state\", {\n touchScrollTarget: null\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getScrollTarget\", function (ref) {\n if (ref === _this.state.touchScrollTarget) return;\n\n _this.setState({\n touchScrollTarget: ref\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"blurSelectInput\", function () {\n if (document.activeElement) {\n document.activeElement.blur();\n }\n });\n\n return _this;\n }\n\n _createClass(ScrollBlock, [{\n key: \"render\",\n value: function render() {\n var _this$props = this.props,\n children = _this$props.children,\n isEnabled = _this$props.isEnabled;\n var touchScrollTarget = this.state.touchScrollTarget; // bail early if not enabled\n\n if (!isEnabled) return children;\n /*\n * Div\n * ------------------------------\n * blocks scrolling on non-body elements behind the menu\n * NodeResolver\n * ------------------------------\n * we need a reference to the scrollable element to \"unlock\" scroll on\n * mobile devices\n * ScrollLock\n * ------------------------------\n * actually does the scroll locking\n */\n\n return _react.default.createElement(\"div\", null, _react.default.createElement(\"div\", {\n onClick: this.blurSelectInput,\n className:\n /*#__PURE__*/\n\n /*#__PURE__*/\n (0, _emotion.css)({\n position: 'fixed',\n left: 0,\n bottom: 0,\n right: 0,\n top: 0\n })\n }), _react.default.createElement(_NodeResolver.default, {\n innerRef: this.getScrollTarget\n }, children), touchScrollTarget ? _react.default.createElement(_index.default, {\n touchScrollTarget: touchScrollTarget\n }) : null);\n }\n }]);\n\n return ScrollBlock;\n}(_react.PureComponent);\n\nexports.default = ScrollBlock;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = require(\"react\");\n\nvar _constants = require(\"./constants\");\n\nvar _utils = require(\"./utils\");\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\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\nvar canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);\nvar activeScrollLocks = 0;\n\nvar ScrollLock =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ScrollLock, _Component);\n\n function ScrollLock() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, ScrollLock);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ScrollLock)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"originalStyles\", {});\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"listenerOptions\", {\n capture: false,\n passive: false\n });\n\n return _this;\n }\n\n _createClass(ScrollLock, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n var _this2 = this;\n\n if (!canUseDOM) return;\n var _this$props = this.props,\n accountForScrollbars = _this$props.accountForScrollbars,\n touchScrollTarget = _this$props.touchScrollTarget;\n var target = document.body;\n var targetStyle = target && target.style;\n\n if (accountForScrollbars) {\n // store any styles already applied to the body\n _constants.STYLE_KEYS.forEach(function (key) {\n var val = targetStyle && targetStyle[key];\n _this2.originalStyles[key] = val;\n });\n } // apply the lock styles and padding if this is the first scroll lock\n\n\n if (accountForScrollbars && activeScrollLocks < 1) {\n var currentPadding = parseInt(this.originalStyles.paddingRight, 10) || 0;\n var clientWidth = document.body ? document.body.clientWidth : 0;\n var adjustedPadding = window.innerWidth - clientWidth + currentPadding || 0;\n Object.keys(_constants.LOCK_STYLES).forEach(function (key) {\n var val = _constants.LOCK_STYLES[key];\n\n if (targetStyle) {\n targetStyle[key] = val;\n }\n });\n\n if (targetStyle) {\n targetStyle.paddingRight = \"\".concat(adjustedPadding, \"px\");\n }\n } // account for touch devices\n\n\n if (target && (0, _utils.isTouchDevice)()) {\n // Mobile Safari ignores { overflow: hidden } declaration on the body.\n target.addEventListener('touchmove', _utils.preventTouchMove, this.listenerOptions); // Allow scroll on provided target\n\n if (touchScrollTarget) {\n touchScrollTarget.addEventListener('touchstart', _utils.preventInertiaScroll, this.listenerOptions);\n touchScrollTarget.addEventListener('touchmove', _utils.allowTouchMove, this.listenerOptions);\n }\n } // increment active scroll locks\n\n\n activeScrollLocks += 1;\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n var _this3 = this;\n\n if (!canUseDOM) return;\n var _this$props2 = this.props,\n accountForScrollbars = _this$props2.accountForScrollbars,\n touchScrollTarget = _this$props2.touchScrollTarget;\n var target = document.body;\n var targetStyle = target && target.style; // safely decrement active scroll locks\n\n activeScrollLocks = Math.max(activeScrollLocks - 1, 0); // reapply original body styles, if any\n\n if (accountForScrollbars && activeScrollLocks < 1) {\n _constants.STYLE_KEYS.forEach(function (key) {\n var val = _this3.originalStyles[key];\n\n if (targetStyle) {\n targetStyle[key] = val;\n }\n });\n } // remove touch listeners\n\n\n if (target && (0, _utils.isTouchDevice)()) {\n target.removeEventListener('touchmove', _utils.preventTouchMove, this.listenerOptions);\n\n if (touchScrollTarget) {\n touchScrollTarget.removeEventListener('touchstart', _utils.preventInertiaScroll, this.listenerOptions);\n touchScrollTarget.removeEventListener('touchmove', _utils.allowTouchMove, this.listenerOptions);\n }\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return null;\n }\n }]);\n\n return ScrollLock;\n}(_react.Component);\n\nexports.default = ScrollLock;\n\n_defineProperty(ScrollLock, \"defaultProps\", {\n accountForScrollbars: true\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.LOCK_STYLES = exports.STYLE_KEYS = void 0;\nvar STYLE_KEYS = ['boxSizing', 'height', 'overflow', 'paddingRight', 'position'];\nexports.STYLE_KEYS = STYLE_KEYS;\nvar LOCK_STYLES = {\n boxSizing: 'border-box',\n // account for possible declaration `width: 100%;` on body\n overflow: 'hidden',\n position: 'relative',\n height: '100%'\n};\nexports.LOCK_STYLES = LOCK_STYLES;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.preventTouchMove = preventTouchMove;\nexports.allowTouchMove = allowTouchMove;\nexports.preventInertiaScroll = preventInertiaScroll;\nexports.isTouchDevice = isTouchDevice;\n\nfunction preventTouchMove(e) {\n e.preventDefault();\n}\n\nfunction allowTouchMove(e) {\n e.stopPropagation();\n}\n\nfunction preventInertiaScroll() {\n var top = this.scrollTop;\n var totalScroll = this.scrollHeight;\n var currentScroll = top + this.offsetHeight;\n\n if (top === 0) {\n this.scrollTop = 1;\n } else if (currentScroll === totalScroll) {\n this.scrollTop = top - 1;\n }\n} // `ontouchstart` check works on most browsers\n// `maxTouchPoints` works on IE10/11 and Surface\n\n\nfunction isTouchDevice() {\n return 'ontouchstart' in window || navigator.maxTouchPoints;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nvar _NodeResolver = _interopRequireDefault(require(\"./NodeResolver\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\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 _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 _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\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\nvar ScrollCaptor =\n/*#__PURE__*/\nfunction (_Component) {\n _inherits(ScrollCaptor, _Component);\n\n function ScrollCaptor() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, ScrollCaptor);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ScrollCaptor)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"isBottom\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"isTop\", false);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"scrollTarget\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"touchStart\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"cancelScroll\", function (event) {\n event.preventDefault();\n event.stopPropagation();\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"handleEventDelta\", function (event, delta) {\n var _this$props = _this.props,\n onBottomArrive = _this$props.onBottomArrive,\n onBottomLeave = _this$props.onBottomLeave,\n onTopArrive = _this$props.onTopArrive,\n onTopLeave = _this$props.onTopLeave;\n var _this$scrollTarget = _this.scrollTarget,\n scrollTop = _this$scrollTarget.scrollTop,\n scrollHeight = _this$scrollTarget.scrollHeight,\n clientHeight = _this$scrollTarget.clientHeight;\n var target = _this.scrollTarget;\n var isDeltaPositive = delta > 0;\n var availableScroll = scrollHeight - clientHeight - scrollTop;\n var shouldCancelScroll = false; // reset bottom/top flags\n\n if (availableScroll > delta && _this.isBottom) {\n if (onBottomLeave) onBottomLeave(event);\n _this.isBottom = false;\n }\n\n if (isDeltaPositive && _this.isTop) {\n if (onTopLeave) onTopLeave(event);\n _this.isTop = false;\n } // bottom limit\n\n\n if (isDeltaPositive && delta > availableScroll) {\n if (onBottomArrive && !_this.isBottom) {\n onBottomArrive(event);\n }\n\n target.scrollTop = scrollHeight;\n shouldCancelScroll = true;\n _this.isBottom = true; // top limit\n } else if (!isDeltaPositive && -delta > scrollTop) {\n if (onTopArrive && !_this.isTop) {\n onTopArrive(event);\n }\n\n target.scrollTop = 0;\n shouldCancelScroll = true;\n _this.isTop = true;\n } // cancel scroll\n\n\n if (shouldCancelScroll) {\n _this.cancelScroll(event);\n }\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onWheel\", function (event) {\n _this.handleEventDelta(event, event.deltaY);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onTouchStart\", function (event) {\n // set touch start so we can calculate touchmove delta\n _this.touchStart = event.changedTouches[0].clientY;\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onTouchMove\", function (event) {\n var deltaY = _this.touchStart - event.changedTouches[0].clientY;\n\n _this.handleEventDelta(event, deltaY);\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"getScrollTarget\", function (ref) {\n _this.scrollTarget = ref;\n });\n\n return _this;\n }\n\n _createClass(ScrollCaptor, [{\n key: \"componentDidMount\",\n value: function componentDidMount() {\n this.startListening(this.scrollTarget);\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.stopListening(this.scrollTarget);\n }\n }, {\n key: \"startListening\",\n value: function startListening(el) {\n // bail early if no scroll available\n if (!el) return;\n if (el.scrollHeight <= el.clientHeight) return; // all the if statements are to appease Flow 😢\n\n if (typeof el.addEventListener === 'function') {\n el.addEventListener('wheel', this.onWheel, false);\n }\n\n if (typeof el.addEventListener === 'function') {\n el.addEventListener('touchstart', this.onTouchStart, false);\n }\n\n if (typeof el.addEventListener === 'function') {\n el.addEventListener('touchmove', this.onTouchMove, false);\n }\n }\n }, {\n key: \"stopListening\",\n value: function stopListening(el) {\n // bail early if no scroll available\n if (el.scrollHeight <= el.clientHeight) return; // all the if statements are to appease Flow 😢\n\n if (typeof el.removeEventListener === 'function') {\n el.removeEventListener('wheel', this.onWheel, false);\n }\n\n if (typeof el.removeEventListener === 'function') {\n el.removeEventListener('touchstart', this.onTouchStart, false);\n }\n\n if (typeof el.removeEventListener === 'function') {\n el.removeEventListener('touchmove', this.onTouchMove, false);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n return _react.default.createElement(_NodeResolver.default, {\n innerRef: this.getScrollTarget\n }, this.props.children);\n }\n }]);\n\n return ScrollCaptor;\n}(_react.Component);\n\nvar ScrollCaptorSwitch =\n/*#__PURE__*/\nfunction (_Component2) {\n _inherits(ScrollCaptorSwitch, _Component2);\n\n function ScrollCaptorSwitch() {\n _classCallCheck(this, ScrollCaptorSwitch);\n\n return _possibleConstructorReturn(this, _getPrototypeOf(ScrollCaptorSwitch).apply(this, arguments));\n }\n\n _createClass(ScrollCaptorSwitch, [{\n key: \"render\",\n value: function render() {\n var _this$props2 = this.props,\n isEnabled = _this$props2.isEnabled,\n props = _objectWithoutProperties(_this$props2, [\"isEnabled\"]);\n\n return isEnabled ? _react.default.createElement(ScrollCaptor, props) : this.props.children;\n }\n }]);\n\n return ScrollCaptorSwitch;\n}(_react.Component);\n\nexports.default = ScrollCaptorSwitch;\n\n_defineProperty(ScrollCaptorSwitch, \"defaultProps\", {\n isEnabled: true\n});","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.resultsAriaMessage = exports.optionFocusAriaMessage = exports.valueFocusAriaMessage = exports.valueEventAriaMessage = exports.instructionsAriaMessage = void 0;\n\nvar instructionsAriaMessage = function instructionsAriaMessage(event) {\n var context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var isSearchable = context.isSearchable,\n isMulti = context.isMulti,\n label = context.label,\n isDisabled = context.isDisabled;\n\n switch (event) {\n case 'menu':\n return \"Use Up and Down to choose options\".concat(isDisabled ? '' : ', press Enter to select the currently focused option', \", press Escape to exit the menu, press Tab to select the option and exit the menu.\");\n\n case 'input':\n return \"\".concat(label ? label : 'Select', \" is focused \").concat(isSearchable ? ',type to refine list' : '', \", press Down to open the menu, \").concat(isMulti ? ' press left to focus selected values' : '');\n\n case 'value':\n return 'Use left and right to toggle between focused values, press Backspace to remove the currently focused value';\n }\n};\n\nexports.instructionsAriaMessage = instructionsAriaMessage;\n\nvar valueEventAriaMessage = function valueEventAriaMessage(event, context) {\n var value = context.value,\n isDisabled = context.isDisabled;\n if (!value) return;\n\n switch (event) {\n case 'deselect-option':\n case 'pop-value':\n case 'remove-value':\n return \"option \".concat(value, \", deselected.\");\n\n case 'select-option':\n return isDisabled ? \"option \".concat(value, \" is disabled. Select another option.\") : \"option \".concat(value, \", selected.\");\n }\n};\n\nexports.valueEventAriaMessage = valueEventAriaMessage;\n\nvar valueFocusAriaMessage = function valueFocusAriaMessage(_ref) {\n var focusedValue = _ref.focusedValue,\n getOptionLabel = _ref.getOptionLabel,\n selectValue = _ref.selectValue;\n return \"value \".concat(getOptionLabel(focusedValue), \" focused, \").concat(selectValue.indexOf(focusedValue) + 1, \" of \").concat(selectValue.length, \".\");\n};\n\nexports.valueFocusAriaMessage = valueFocusAriaMessage;\n\nvar optionFocusAriaMessage = function optionFocusAriaMessage(_ref2) {\n var focusedOption = _ref2.focusedOption,\n getOptionLabel = _ref2.getOptionLabel,\n options = _ref2.options;\n return \"option \".concat(getOptionLabel(focusedOption), \" focused\").concat(focusedOption.isDisabled ? ' disabled' : '', \", \").concat(options.indexOf(focusedOption) + 1, \" of \").concat(options.length, \".\");\n};\n\nexports.optionFocusAriaMessage = optionFocusAriaMessage;\n\nvar resultsAriaMessage = function resultsAriaMessage(_ref3) {\n var inputValue = _ref3.inputValue,\n screenReaderMessage = _ref3.screenReaderMessage;\n return \"\".concat(screenReaderMessage).concat(inputValue ? ' for search term ' + inputValue : '', \".\");\n};\n\nexports.resultsAriaMessage = resultsAriaMessage;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.isOptionDisabled = exports.getOptionValue = exports.getOptionLabel = exports.formatGroupLabel = void 0;\n\nvar formatGroupLabel = function formatGroupLabel(group) {\n return group.label;\n};\n\nexports.formatGroupLabel = formatGroupLabel;\n\nvar getOptionLabel = function getOptionLabel(option) {\n return option.label;\n};\n\nexports.getOptionLabel = getOptionLabel;\n\nvar getOptionValue = function getOptionValue(option) {\n return option.value;\n};\n\nexports.getOptionValue = getOptionValue;\n\nvar isOptionDisabled = function isOptionDisabled(option) {\n return !!option.isDisabled;\n};\n\nexports.isOptionDisabled = isOptionDisabled;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultComponents = exports.components = void 0;\n\nvar _containers = require(\"./containers\");\n\nvar _indicators = require(\"./indicators\");\n\nvar _Control = _interopRequireDefault(require(\"./Control\"));\n\nvar _Group = _interopRequireWildcard(require(\"./Group\"));\n\nvar _Input = _interopRequireDefault(require(\"./Input\"));\n\nvar _Menu = _interopRequireWildcard(require(\"./Menu\"));\n\nvar _MultiValue = _interopRequireWildcard(require(\"./MultiValue\"));\n\nvar _Option = _interopRequireDefault(require(\"./Option\"));\n\nvar _Placeholder = _interopRequireDefault(require(\"./Placeholder\"));\n\nvar _SingleValue = _interopRequireDefault(require(\"./SingleValue\"));\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\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\nvar components = {\n ClearIndicator: _indicators.ClearIndicator,\n Control: _Control.default,\n DropdownIndicator: _indicators.DropdownIndicator,\n DownChevron: _indicators.DownChevron,\n CrossIcon: _indicators.CrossIcon,\n Group: _Group.default,\n GroupHeading: _Group.GroupHeading,\n IndicatorsContainer: _containers.IndicatorsContainer,\n IndicatorSeparator: _indicators.IndicatorSeparator,\n Input: _Input.default,\n LoadingIndicator: _indicators.LoadingIndicator,\n Menu: _Menu.default,\n MenuList: _Menu.MenuList,\n MenuPortal: _Menu.MenuPortal,\n LoadingMessage: _Menu.LoadingMessage,\n NoOptionsMessage: _Menu.NoOptionsMessage,\n MultiValue: _MultiValue.default,\n MultiValueContainer: _MultiValue.MultiValueContainer,\n MultiValueLabel: _MultiValue.MultiValueLabel,\n MultiValueRemove: _MultiValue.MultiValueRemove,\n Option: _Option.default,\n Placeholder: _Placeholder.default,\n SelectContainer: _containers.SelectContainer,\n SingleValue: _SingleValue.default,\n ValueContainer: _containers.ValueContainer\n};\nexports.components = components;\n\nvar defaultComponents = function defaultComponents(props) {\n return _objectSpread({}, components, props.components);\n};\n\nexports.defaultComponents = defaultComponents;","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n\nvar _extends = Object.assign || 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\nvar _createClass = function () {\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 return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\n\nvar _react = require('react');\n\nvar _react2 = _interopRequireDefault(_react);\n\nvar _propTypes = require('prop-types');\n\nvar _propTypes2 = _interopRequireDefault(_propTypes);\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction _objectWithoutProperties(obj, keys) {\n var target = {};\n\n for (var i in obj) {\n if (keys.indexOf(i) >= 0) continue;\n if (!Object.prototype.hasOwnProperty.call(obj, i)) continue;\n target[i] = obj[i];\n }\n\n return target;\n}\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (!self) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self;\n}\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass);\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;\n}\n\nvar sizerStyle = {\n position: 'absolute',\n top: 0,\n left: 0,\n visibility: 'hidden',\n height: 0,\n overflow: 'scroll',\n whiteSpace: 'pre'\n};\nvar INPUT_PROPS_BLACKLIST = ['extraWidth', 'injectStyles', 'inputClassName', 'inputRef', 'inputStyle', 'minWidth', 'onAutosize', 'placeholderIsMinWidth'];\n\nvar cleanInputProps = function cleanInputProps(inputProps) {\n INPUT_PROPS_BLACKLIST.forEach(function (field) {\n return delete inputProps[field];\n });\n return inputProps;\n};\n\nvar copyStyles = function copyStyles(styles, node) {\n node.style.fontSize = styles.fontSize;\n node.style.fontFamily = styles.fontFamily;\n node.style.fontWeight = styles.fontWeight;\n node.style.fontStyle = styles.fontStyle;\n node.style.letterSpacing = styles.letterSpacing;\n node.style.textTransform = styles.textTransform;\n};\n\nvar isIE = typeof window !== 'undefined' && window.navigator ? /MSIE |Trident\\/|Edge\\//.test(window.navigator.userAgent) : false;\n\nvar generateId = function generateId() {\n // we only need an auto-generated ID for stylesheet injection, which is only\n // used for IE. so if the browser is not IE, this should return undefined.\n return isIE ? '_' + Math.random().toString(36).substr(2, 12) : undefined;\n};\n\nvar AutosizeInput = function (_Component) {\n _inherits(AutosizeInput, _Component);\n\n function AutosizeInput(props) {\n _classCallCheck(this, AutosizeInput);\n\n var _this = _possibleConstructorReturn(this, (AutosizeInput.__proto__ || Object.getPrototypeOf(AutosizeInput)).call(this, props));\n\n _this.inputRef = function (el) {\n _this.input = el;\n\n if (typeof _this.props.inputRef === 'function') {\n _this.props.inputRef(el);\n }\n };\n\n _this.placeHolderSizerRef = function (el) {\n _this.placeHolderSizer = el;\n };\n\n _this.sizerRef = function (el) {\n _this.sizer = el;\n };\n\n _this.state = {\n inputWidth: props.minWidth,\n inputId: props.id || generateId()\n };\n return _this;\n }\n\n _createClass(AutosizeInput, [{\n key: 'componentDidMount',\n value: function componentDidMount() {\n this.mounted = true;\n this.copyInputStyles();\n this.updateInputWidth();\n }\n }, {\n key: 'componentWillReceiveProps',\n value: function componentWillReceiveProps(nextProps) {\n var id = nextProps.id;\n\n if (id !== this.props.id) {\n this.setState({\n inputId: id || generateId()\n });\n }\n }\n }, {\n key: 'componentDidUpdate',\n value: function componentDidUpdate(prevProps, prevState) {\n if (prevState.inputWidth !== this.state.inputWidth) {\n if (typeof this.props.onAutosize === 'function') {\n this.props.onAutosize(this.state.inputWidth);\n }\n }\n\n this.updateInputWidth();\n }\n }, {\n key: 'componentWillUnmount',\n value: function componentWillUnmount() {\n this.mounted = false;\n }\n }, {\n key: 'copyInputStyles',\n value: function copyInputStyles() {\n if (!this.mounted || !window.getComputedStyle) {\n return;\n }\n\n var inputStyles = this.input && window.getComputedStyle(this.input);\n\n if (!inputStyles) {\n return;\n }\n\n copyStyles(inputStyles, this.sizer);\n\n if (this.placeHolderSizer) {\n copyStyles(inputStyles, this.placeHolderSizer);\n }\n }\n }, {\n key: 'updateInputWidth',\n value: function updateInputWidth() {\n if (!this.mounted || !this.sizer || typeof this.sizer.scrollWidth === 'undefined') {\n return;\n }\n\n var newInputWidth = void 0;\n\n if (this.props.placeholder && (!this.props.value || this.props.value && this.props.placeholderIsMinWidth)) {\n newInputWidth = Math.max(this.sizer.scrollWidth, this.placeHolderSizer.scrollWidth) + 2;\n } else {\n newInputWidth = this.sizer.scrollWidth + 2;\n } // add extraWidth to the detected width. for number types, this defaults to 16 to allow for the stepper UI\n\n\n var extraWidth = this.props.type === 'number' && this.props.extraWidth === undefined ? 16 : parseInt(this.props.extraWidth) || 0;\n newInputWidth += extraWidth;\n\n if (newInputWidth < this.props.minWidth) {\n newInputWidth = this.props.minWidth;\n }\n\n if (newInputWidth !== this.state.inputWidth) {\n this.setState({\n inputWidth: newInputWidth\n });\n }\n }\n }, {\n key: 'getInput',\n value: function getInput() {\n return this.input;\n }\n }, {\n key: 'focus',\n value: function focus() {\n this.input.focus();\n }\n }, {\n key: 'blur',\n value: function blur() {\n this.input.blur();\n }\n }, {\n key: 'select',\n value: function select() {\n this.input.select();\n }\n }, {\n key: 'renderStyles',\n value: function renderStyles() {\n // this method injects styles to hide IE's clear indicator, which messes\n // with input size detection. the stylesheet is only injected when the\n // browser is IE, and can also be disabled by the `injectStyles` prop.\n var injectStyles = this.props.injectStyles;\n return isIE && injectStyles ? _react2.default.createElement('style', {\n dangerouslySetInnerHTML: {\n __html: 'input#' + this.state.inputId + '::-ms-clear {display: none;}'\n }\n }) : null;\n }\n }, {\n key: 'render',\n value: function render() {\n var sizerValue = [this.props.defaultValue, this.props.value, ''].reduce(function (previousValue, currentValue) {\n if (previousValue !== null && previousValue !== undefined) {\n return previousValue;\n }\n\n return currentValue;\n });\n\n var wrapperStyle = _extends({}, this.props.style);\n\n if (!wrapperStyle.display) wrapperStyle.display = 'inline-block';\n\n var inputStyle = _extends({\n boxSizing: 'content-box',\n width: this.state.inputWidth + 'px'\n }, this.props.inputStyle);\n\n var inputProps = _objectWithoutProperties(this.props, []);\n\n cleanInputProps(inputProps);\n inputProps.className = this.props.inputClassName;\n inputProps.id = this.state.inputId;\n inputProps.style = inputStyle;\n return _react2.default.createElement('div', {\n className: this.props.className,\n style: wrapperStyle\n }, this.renderStyles(), _react2.default.createElement('input', _extends({}, inputProps, {\n ref: this.inputRef\n })), _react2.default.createElement('div', {\n ref: this.sizerRef,\n style: sizerStyle\n }, sizerValue), this.props.placeholder ? _react2.default.createElement('div', {\n ref: this.placeHolderSizerRef,\n style: sizerStyle\n }, this.props.placeholder) : null);\n }\n }]);\n\n return AutosizeInput;\n}(_react.Component);\n\nAutosizeInput.propTypes = {\n className: _propTypes2.default.string,\n // className for the outer element\n defaultValue: _propTypes2.default.any,\n // default field value\n extraWidth: _propTypes2.default.oneOfType([// additional width for input element\n _propTypes2.default.number, _propTypes2.default.string]),\n id: _propTypes2.default.string,\n // id to use for the input, can be set for consistent snapshots\n injectStyles: _propTypes2.default.bool,\n // inject the custom stylesheet to hide clear UI, defaults to true\n inputClassName: _propTypes2.default.string,\n // className for the input element\n inputRef: _propTypes2.default.func,\n // ref callback for the input element\n inputStyle: _propTypes2.default.object,\n // css styles for the input element\n minWidth: _propTypes2.default.oneOfType([// minimum width for input element\n _propTypes2.default.number, _propTypes2.default.string]),\n onAutosize: _propTypes2.default.func,\n // onAutosize handler: function(newWidth) {}\n onChange: _propTypes2.default.func,\n // onChange handler: function(event) {}\n placeholder: _propTypes2.default.string,\n // placeholder text\n placeholderIsMinWidth: _propTypes2.default.bool,\n // don't collapse size to less than the placeholder\n style: _propTypes2.default.object,\n // css styles for the outer element\n value: _propTypes2.default.any // field value\n\n};\nAutosizeInput.defaultProps = {\n minWidth: 1,\n injectStyles: true\n};\nexports.default = AutosizeInput;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.mergeStyles = mergeStyles;\nexports.defaultStyles = void 0;\n\nvar _containers = require(\"./components/containers\");\n\nvar _Control = require(\"./components/Control\");\n\nvar _Group = require(\"./components/Group\");\n\nvar _indicators = require(\"./components/indicators\");\n\nvar _Input = require(\"./components/Input\");\n\nvar _Placeholder = require(\"./components/Placeholder\");\n\nvar _Option = require(\"./components/Option\");\n\nvar _Menu = require(\"./components/Menu\");\n\nvar _SingleValue = require(\"./components/SingleValue\");\n\nvar _MultiValue = require(\"./components/MultiValue\");\n\nfunction _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(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n _defineProperty(target, key, source[key]);\n });\n }\n\n return target;\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\nvar defaultStyles = {\n clearIndicator: _indicators.clearIndicatorCSS,\n container: _containers.containerCSS,\n control: _Control.css,\n dropdownIndicator: _indicators.dropdownIndicatorCSS,\n group: _Group.groupCSS,\n groupHeading: _Group.groupHeadingCSS,\n indicatorsContainer: _containers.indicatorsContainerCSS,\n indicatorSeparator: _indicators.indicatorSeparatorCSS,\n input: _Input.inputCSS,\n loadingIndicator: _indicators.loadingIndicatorCSS,\n loadingMessage: _Menu.loadingMessageCSS,\n menu: _Menu.menuCSS,\n menuList: _Menu.menuListCSS,\n menuPortal: _Menu.menuPortalCSS,\n multiValue: _MultiValue.multiValueCSS,\n multiValueLabel: _MultiValue.multiValueLabelCSS,\n multiValueRemove: _MultiValue.multiValueRemoveCSS,\n noOptionsMessage: _Menu.noOptionsMessageCSS,\n option: _Option.optionCSS,\n placeholder: _Placeholder.placeholderCSS,\n singleValue: _SingleValue.css,\n valueContainer: _containers.valueContainerCSS\n}; // Merge Utility\n// Allows consumers to extend a base Select with additional styles\n\nexports.defaultStyles = defaultStyles;\n\nfunction mergeStyles(source) {\n var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // initialize with source styles\n\n var styles = _objectSpread({}, source); // massage in target styles\n\n\n Object.keys(target).forEach(function (key) {\n if (source[key]) {\n styles[key] = function (rsCss, props) {\n return target[key](source[key](rsCss, props), props);\n };\n } else {\n styles[key] = target[key];\n }\n });\n return styles;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.defaultTheme = exports.spacing = exports.colors = void 0;\nvar colors = {\n primary: '#2684FF',\n primary75: '#4C9AFF',\n primary50: '#B2D4FF',\n primary25: '#DEEBFF',\n danger: '#DE350B',\n dangerLight: '#FFBDAD',\n neutral0: 'hsl(0, 0%, 100%)',\n neutral5: 'hsl(0, 0%, 95%)',\n neutral10: 'hsl(0, 0%, 90%)',\n neutral20: 'hsl(0, 0%, 80%)',\n neutral30: 'hsl(0, 0%, 70%)',\n neutral40: 'hsl(0, 0%, 60%)',\n neutral50: 'hsl(0, 0%, 50%)',\n neutral60: 'hsl(0, 0%, 40%)',\n neutral70: 'hsl(0, 0%, 30%)',\n neutral80: 'hsl(0, 0%, 20%)',\n neutral90: 'hsl(0, 0%, 10%)'\n};\nexports.colors = colors;\nvar borderRadius = 4;\nvar baseUnit = 4;\n/* Used to calculate consistent margin/padding on elements */\n\nvar controlHeight = 38;\n/* The minimum height of the control */\n\nvar menuGutter = baseUnit * 2;\n/* The amount of space between the control and menu */\n\nvar spacing = {\n baseUnit: baseUnit,\n controlHeight: controlHeight,\n menuGutter: menuGutter\n};\nexports.spacing = spacing;\nvar defaultTheme = {\n borderRadius: borderRadius,\n colors: colors,\n spacing: spacing\n};\nexports.defaultTheme = defaultTheme;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.defaultProps = void 0;\n\nvar _react = _interopRequireWildcard(require(\"react\"));\n\nfunction _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 = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};\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\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}\n\nfunction _extends() {\n _extends = Object.assign || 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\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 _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 _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nfunction _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\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n}\n\nfunction _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}\n\nfunction _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\nfunction _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}\n\nfunction _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\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\nvar defaultProps = {\n defaultInputValue: '',\n defaultMenuIsOpen: false,\n defaultValue: null\n};\nexports.defaultProps = defaultProps;\n\nvar manageState = function manageState(SelectComponent) {\n var _class, _temp;\n\n return _temp = _class =\n /*#__PURE__*/\n function (_Component) {\n _inherits(StateManager, _Component);\n\n function StateManager() {\n var _getPrototypeOf2;\n\n var _this;\n\n _classCallCheck(this, StateManager);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(StateManager)).call.apply(_getPrototypeOf2, [this].concat(args)));\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"select\", void 0);\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"state\", {\n inputValue: _this.props.inputValue !== undefined ? _this.props.inputValue : _this.props.defaultInputValue,\n menuIsOpen: _this.props.menuIsOpen !== undefined ? _this.props.menuIsOpen : _this.props.defaultMenuIsOpen,\n value: _this.props.value !== undefined ? _this.props.value : _this.props.defaultValue\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onChange\", function (value, actionMeta) {\n _this.callProp('onChange', value, actionMeta);\n\n _this.setState({\n value: value\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onInputChange\", function (value, actionMeta) {\n // TODO: for backwards compatibility, we allow the prop to return a new\n // value, but now inputValue is a controllable prop we probably shouldn't\n var newValue = _this.callProp('onInputChange', value, actionMeta);\n\n _this.setState({\n inputValue: newValue !== undefined ? newValue : value\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onMenuOpen\", function () {\n _this.callProp('onMenuOpen');\n\n _this.setState({\n menuIsOpen: true\n });\n });\n\n _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), \"onMenuClose\", function () {\n _this.callProp('onMenuClose');\n\n _this.setState({\n menuIsOpen: false\n });\n });\n\n return _this;\n }\n\n _createClass(StateManager, [{\n key: \"focus\",\n value: function focus() {\n this.select.focus();\n }\n }, {\n key: \"blur\",\n value: function blur() {\n this.select.blur();\n } // FIXME: untyped flow code, return any\n\n }, {\n key: \"getProp\",\n value: function getProp(key) {\n return this.props[key] !== undefined ? this.props[key] : this.state[key];\n } // FIXME: untyped flow code, return any\n\n }, {\n key: \"callProp\",\n value: function callProp(name) {\n if (typeof this.props[name] === 'function') {\n var _this$props;\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 return (_this$props = this.props)[name].apply(_this$props, args);\n }\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this2 = this;\n\n var _this$props2 = this.props,\n defaultInputValue = _this$props2.defaultInputValue,\n defaultMenuIsOpen = _this$props2.defaultMenuIsOpen,\n defaultValue = _this$props2.defaultValue,\n props = _objectWithoutProperties(_this$props2, [\"defaultInputValue\", \"defaultMenuIsOpen\", \"defaultValue\"]);\n\n return _react.default.createElement(SelectComponent, _extends({}, props, {\n ref: function ref(_ref) {\n _this2.select = _ref;\n },\n inputValue: this.getProp('inputValue'),\n menuIsOpen: this.getProp('menuIsOpen'),\n onChange: this.onChange,\n onInputChange: this.onInputChange,\n onMenuClose: this.onMenuClose,\n onMenuOpen: this.onMenuOpen,\n value: this.getProp('value')\n }));\n }\n }]);\n\n return StateManager;\n }(_react.Component), _defineProperty(_class, \"defaultProps\", defaultProps), _temp;\n};\n\nvar _default = manageState;\nexports.default = _default;","function memoize(fn) {\n var cache = {};\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\nexport default unitlessKeys;","/* eslint-disable */\n// murmurhash2 via https://github.com/garycourt/murmurhash-js/blob/master/murmurhash2_gc.js\nfunction murmurhash2_32_gc(str) {\n var l = str.length,\n h = l ^ l,\n i = 0,\n k;\n\n while (l >= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n k ^= k >>> 24;\n k = (k & 0xffff) * 0x5bd1e995 + (((k >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16) ^ k;\n l -= 4;\n ++i;\n }\n\n switch (l) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n }\n\n h ^= h >>> 13;\n h = (h & 0xffff) * 0x5bd1e995 + (((h >>> 16) * 0x5bd1e995 & 0xffff) << 16);\n h ^= h >>> 15;\n return (h >>> 0).toString(36);\n}\n\nexport default murmurhash2_32_gc;","function stylis_min(W) {\n function M(d, c, e, h, a) {\n for (var m = 0, b = 0, v = 0, n = 0, q, g, x = 0, K = 0, k, u = k = q = 0, l = 0, r = 0, I = 0, t = 0, B = e.length, J = B - 1, y, f = '', p = '', F = '', G = '', C; l < B;) {\n g = e.charCodeAt(l);\n l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++);\n\n if (0 === b + n + v + m) {\n if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) {\n switch (g) {\n case 32:\n case 9:\n case 59:\n case 13:\n case 10:\n break;\n\n default:\n f += e.charAt(l);\n }\n\n g = 59;\n }\n\n switch (g) {\n case 123:\n f = f.trim();\n q = f.charCodeAt(0);\n k = 1;\n\n for (t = ++l; l < B;) {\n switch (g = e.charCodeAt(l)) {\n case 123:\n k++;\n break;\n\n case 125:\n k--;\n break;\n\n case 47:\n switch (g = e.charCodeAt(l + 1)) {\n case 42:\n case 47:\n a: {\n for (u = l + 1; u < J; ++u) {\n switch (e.charCodeAt(u)) {\n case 47:\n if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) {\n l = u + 1;\n break a;\n }\n\n break;\n\n case 10:\n if (47 === g) {\n l = u + 1;\n break a;\n }\n\n }\n }\n\n l = u;\n }\n\n }\n\n break;\n\n case 91:\n g++;\n\n case 40:\n g++;\n\n case 34:\n case 39:\n for (; l++ < J && e.charCodeAt(l) !== g;) {}\n\n }\n\n if (0 === k) break;\n l++;\n }\n\n k = e.substring(t, l);\n 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0));\n\n switch (q) {\n case 64:\n 0 < r && (f = f.replace(N, ''));\n g = f.charCodeAt(1);\n\n switch (g) {\n case 100:\n case 109:\n case 115:\n case 45:\n r = c;\n break;\n\n default:\n r = O;\n }\n\n k = M(c, r, k, g, a + 1);\n t = k.length;\n 0 < A && (r = X(O, f, I), C = H(3, k, r, c, D, z, t, g, a, h), f = r.join(''), void 0 !== C && 0 === (t = (k = C.trim()).length) && (g = 0, k = ''));\n if (0 < t) switch (g) {\n case 115:\n f = f.replace(da, ea);\n\n case 100:\n case 109:\n case 45:\n k = f + '{' + k + '}';\n break;\n\n case 107:\n f = f.replace(fa, '$1 $2');\n k = f + '{' + k + '}';\n k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k;\n break;\n\n default:\n k = f + k, 112 === h && (k = (p += k, ''));\n } else k = '';\n break;\n\n default:\n k = M(c, X(c, f, I), k, h, a + 1);\n }\n\n F += k;\n k = I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n break;\n\n case 125:\n case 59:\n f = (0 < r ? f.replace(N, '') : f).trim();\n if (1 < (t = f.length)) switch (0 === u && (q = f.charCodeAt(0), 45 === q || 96 < q && 123 > q) && (t = (f = f.replace(' ', ':')).length), 0 < A && void 0 !== (C = H(1, f, c, d, D, z, p.length, h, a, h)) && 0 === (t = (f = C.trim()).length) && (f = '\\x00\\x00'), q = f.charCodeAt(0), g = f.charCodeAt(1), q) {\n case 0:\n break;\n\n case 64:\n if (105 === g || 99 === g) {\n G += f + e.charAt(l);\n break;\n }\n\n default:\n 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2)));\n }\n I = r = u = q = 0;\n f = '';\n g = e.charCodeAt(++l);\n }\n }\n\n switch (g) {\n case 13:\n case 10:\n 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\\x00');\n 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h);\n z = 1;\n D++;\n break;\n\n case 59:\n case 125:\n if (0 === b + n + v + m) {\n z++;\n break;\n }\n\n default:\n z++;\n y = e.charAt(l);\n\n switch (g) {\n case 9:\n case 32:\n if (0 === n + m + b) switch (x) {\n case 44:\n case 58:\n case 9:\n case 32:\n y = '';\n break;\n\n default:\n 32 !== g && (y = ' ');\n }\n break;\n\n case 0:\n y = '\\\\0';\n break;\n\n case 12:\n y = '\\\\f';\n break;\n\n case 11:\n y = '\\\\v';\n break;\n\n case 38:\n 0 === n + b + m && (r = I = 1, y = '\\f' + y);\n break;\n\n case 108:\n if (0 === n + b + m + E && 0 < u) switch (l - u) {\n case 2:\n 112 === x && 58 === e.charCodeAt(l - 3) && (E = x);\n\n case 8:\n 111 === K && (E = K);\n }\n break;\n\n case 58:\n 0 === n + b + m && (u = l);\n break;\n\n case 44:\n 0 === b + v + n + m && (r = 1, y += '\\r');\n break;\n\n case 34:\n case 39:\n 0 === b && (n = n === g ? 0 : 0 === n ? g : n);\n break;\n\n case 91:\n 0 === n + b + v && m++;\n break;\n\n case 93:\n 0 === n + b + v && m--;\n break;\n\n case 41:\n 0 === n + b + m && v--;\n break;\n\n case 40:\n if (0 === n + b + m) {\n if (0 === q) switch (2 * x + 3 * K) {\n case 533:\n break;\n\n default:\n q = 1;\n }\n v++;\n }\n\n break;\n\n case 64:\n 0 === b + v + n + m + u + k && (k = 1);\n break;\n\n case 42:\n case 47:\n if (!(0 < n + m + v)) switch (b) {\n case 0:\n switch (2 * g + 3 * e.charCodeAt(l + 1)) {\n case 235:\n b = 47;\n break;\n\n case 220:\n t = l, b = 42;\n }\n\n break;\n\n case 42:\n 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0);\n }\n }\n\n 0 === b && (f += y);\n }\n\n K = x;\n x = g;\n l++;\n }\n\n t = p.length;\n\n if (0 < t) {\n r = c;\n if (0 < A && (C = H(2, p, r, d, D, z, t, h, a, h), void 0 !== C && 0 === (p = C).length)) return G + p + F;\n p = r.join(',') + '{' + p + '}';\n\n if (0 !== w * E) {\n 2 !== w || L(p, 2) || (E = 0);\n\n switch (E) {\n case 111:\n p = p.replace(ha, ':-moz-$1') + p;\n break;\n\n case 112:\n p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p;\n }\n\n E = 0;\n }\n }\n\n return G + p + F;\n }\n\n function X(d, c, e) {\n var h = c.trim().split(ia);\n c = h;\n var a = h.length,\n m = d.length;\n\n switch (m) {\n case 0:\n case 1:\n var b = 0;\n\n for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) {\n c[b] = Z(d, c[b], e, m).trim();\n }\n\n break;\n\n default:\n var v = b = 0;\n\n for (c = []; b < a; ++b) {\n for (var n = 0; n < m; ++n) {\n c[v++] = Z(d[n] + ' ', h[b], e, m).trim();\n }\n }\n\n }\n\n return c;\n }\n\n function Z(d, c, e) {\n var h = c.charCodeAt(0);\n 33 > h && (h = (c = c.trim()).charCodeAt(0));\n\n switch (h) {\n case 38:\n return c.replace(F, '$1' + d.trim());\n\n case 58:\n return d.trim() + c.replace(F, '$1' + d.trim());\n\n default:\n if (0 < 1 * e && 0 < c.indexOf('\\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim());\n }\n\n return d + c;\n }\n\n function P(d, c, e, h) {\n var a = d + ';',\n m = 2 * c + 3 * e + 4 * h;\n\n if (944 === m) {\n d = a.indexOf(':', 9) + 1;\n var b = a.substring(d, a.length - 1).trim();\n b = a.substring(0, d).trim() + b + ';';\n return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b;\n }\n\n if (0 === w || 2 === w && !L(a, 1)) return a;\n\n switch (m) {\n case 1015:\n return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a;\n\n case 951:\n return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a;\n\n case 963:\n return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a;\n\n case 1009:\n if (100 !== a.charCodeAt(4)) break;\n\n case 969:\n case 942:\n return '-webkit-' + a + a;\n\n case 978:\n return '-webkit-' + a + '-moz-' + a + a;\n\n case 1019:\n case 983:\n return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a;\n\n case 883:\n if (45 === a.charCodeAt(8)) return '-webkit-' + a + a;\n if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a;\n break;\n\n case 932:\n if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) {\n case 103:\n return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a;\n\n case 115:\n return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a;\n\n case 98:\n return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a;\n }\n return '-webkit-' + a + '-ms-' + a + a;\n\n case 964:\n return '-webkit-' + a + '-ms-flex-' + a + a;\n\n case 1023:\n if (99 !== a.charCodeAt(8)) break;\n b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify');\n return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a;\n\n case 1005:\n return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a;\n\n case 1e3:\n b = a.substring(13).trim();\n c = b.indexOf('-') + 1;\n\n switch (b.charCodeAt(0) + b.charCodeAt(c)) {\n case 226:\n b = a.replace(G, 'tb');\n break;\n\n case 232:\n b = a.replace(G, 'tb-rl');\n break;\n\n case 220:\n b = a.replace(G, 'lr');\n break;\n\n default:\n return a;\n }\n\n return '-webkit-' + a + '-ms-' + b + a;\n\n case 1017:\n if (-1 === a.indexOf('sticky', 9)) break;\n\n case 975:\n c = (a = d).length - 10;\n b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim();\n\n switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) {\n case 203:\n if (111 > b.charCodeAt(8)) break;\n\n case 115:\n a = a.replace(b, '-webkit-' + b) + ';' + a;\n break;\n\n case 207:\n case 102:\n a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a;\n }\n\n return a + ';';\n\n case 938:\n if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) {\n case 105:\n return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a;\n\n case 115:\n return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a;\n\n default:\n return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a;\n }\n break;\n\n case 973:\n case 989:\n if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break;\n\n case 931:\n case 953:\n if (!0 === la.test(d)) return 115 === (b = d.substring(d.indexOf(':') + 1)).charCodeAt(0) ? P(d.replace('stretch', 'fill-available'), c, e, h).replace(':fill-available', ':stretch') : a.replace(b, '-webkit-' + b) + a.replace(b, '-moz-' + b.replace('fill-', '')) + a;\n break;\n\n case 962:\n if (a = '-webkit-' + a + (102 === a.charCodeAt(5) ? '-ms-' + a : '') + a, 211 === e + h && 105 === a.charCodeAt(13) && 0 < a.indexOf('transform', 10)) return a.substring(0, a.indexOf(';', 27) + 1).replace(ma, '$1-webkit-$2') + a;\n }\n\n return a;\n }\n\n function L(d, c) {\n var e = d.indexOf(1 === c ? ':' : '{'),\n h = d.substring(0, 3 !== c ? e : 10);\n e = d.substring(e + 1, d.length - 1);\n return R(2 !== c ? h : h.replace(na, '$1'), e, c);\n }\n\n function ea(d, c) {\n var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2));\n return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')';\n }\n\n function H(d, c, e, h, a, m, b, v, n, q) {\n for (var g = 0, x = c, w; g < A; ++g) {\n switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) {\n case void 0:\n case !1:\n case !0:\n case null:\n break;\n\n default:\n x = w;\n }\n }\n\n if (x !== c) return x;\n }\n\n function T(d) {\n switch (d) {\n case void 0:\n case null:\n A = S.length = 0;\n break;\n\n default:\n switch (d.constructor) {\n case Array:\n for (var c = 0, e = d.length; c < e; ++c) {\n T(d[c]);\n }\n\n break;\n\n case Function:\n S[A++] = d;\n break;\n\n case Boolean:\n Y = !!d | 0;\n }\n\n }\n\n return T;\n }\n\n function U(d) {\n d = d.prefix;\n void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0);\n return U;\n }\n\n function B(d, c) {\n var e = d;\n 33 > e.charCodeAt(0) && (e = e.trim());\n V = e;\n e = [V];\n\n if (0 < A) {\n var h = H(-1, c, e, e, D, z, 0, 0, 0, 0);\n void 0 !== h && 'string' === typeof h && (c = h);\n }\n\n var a = M(O, e, c, 0, 0);\n 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h));\n V = '';\n E = 0;\n z = D = 1;\n return a;\n }\n\n var ca = /^\\0+/g,\n N = /[\\0\\r\\f]/g,\n aa = /: */g,\n ka = /zoo|gra/,\n ma = /([,: ])(transform)/g,\n ia = /,\\r+?/g,\n F = /([\\t\\r\\n ])*\\f?&/g,\n fa = /@(k\\w+)\\s*(\\S*)\\s*/,\n Q = /::(place)/g,\n ha = /:(read-only)/g,\n G = /[svh]\\w+-[tblr]{2}/,\n da = /\\(\\s*(.*)\\s*\\)/g,\n oa = /([\\s\\S]*?);/g,\n ba = /-self|flex-/g,\n na = /[^]*?(:[rp][el]a[\\w-]+)[^]*/,\n la = /stretch|:\\s*\\w+\\-(?:conte|avail)/,\n ja = /([^-])(image-set\\()/,\n z = 1,\n D = 1,\n E = 0,\n w = 1,\n O = [],\n S = [],\n A = 0,\n R = null,\n Y = 0,\n V = '';\n B.use = T;\n B.set = U;\n void 0 !== W && U(W);\n return B;\n}\n\nexport default stylis_min;","import memoize from '@emotion/memoize';\nimport unitless from '@emotion/unitless';\nimport hashString from '@emotion/hash';\nimport Stylis from '@emotion/stylis';\nimport stylisRuleSheet from 'stylis-rule-sheet';\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar processStyleName = memoize(function (styleName) {\n return styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n if (value == null || typeof value === 'boolean') {\n return '';\n }\n\n if (unitless[key] !== 1 && key.charCodeAt(1) !== 45 && // custom properties\n !isNaN(value) && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(attr|calc|counters?|url)\\(/;\n var contentValues = ['normal', 'none', 'counter', 'open-quote', 'close-quote', 'no-open-quote', 'no-close-quote', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n console.error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n return oldProcessStyleValue(key, value);\n };\n}\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'function':\n if (process.env.NODE_ENV !== 'production') {\n console.error('Passing functions to cx is deprecated and will be removed in the next major version of Emotion.\\n' + 'Please call the function before passing it to cx.');\n }\n\n toAdd = classnames([arg()]);\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nvar isBrowser = typeof document !== 'undefined';\n/*\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n- 'polyfills' on server side\n\n// usage\n\nimport StyleSheet from 'glamor/lib/sheet'\nlet styleSheet = new StyleSheet()\n\nstyleSheet.inject()\n- 'injects' the stylesheet into the page (or into memory if on server)\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\n\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction makeStyleTag(opts) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', opts.key || '');\n\n if (opts.nonce !== undefined) {\n tag.setAttribute('nonce', opts.nonce);\n }\n\n tag.appendChild(document.createTextNode('')) // $FlowFixMe\n ;\n (opts.container !== undefined ? opts.container : document.head).appendChild(tag);\n return tag;\n}\n\nvar StyleSheet =\n/*#__PURE__*/\nfunction () {\n function StyleSheet(options) {\n this.isSpeedy = process.env.NODE_ENV === 'production'; // the big drawback here is that the css won't be editable in devtools\n\n this.tags = [];\n this.ctr = 0;\n this.opts = options;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.inject = function inject() {\n if (this.injected) {\n throw new Error('already injected!');\n }\n\n this.tags[0] = makeStyleTag(this.opts);\n this.injected = true;\n };\n\n _proto.speedy = function speedy(bool) {\n if (this.ctr !== 0) {\n // cannot change speedy mode after inserting any rule to sheet. Either call speedy(${bool}) earlier in your app, or call flush() before speedy(${bool})\n throw new Error(\"cannot change speedy now\");\n }\n\n this.isSpeedy = !!bool;\n };\n\n _proto.insert = function insert(rule, sourceMap) {\n // this is the ultrafast version, works across browsers\n if (this.isSpeedy) {\n var tag = this.tags[this.tags.length - 1];\n var sheet = sheetForTag(tag);\n\n try {\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production') {\n console.warn('illegal rule', rule); // eslint-disable-line no-console\n }\n }\n } else {\n var _tag = makeStyleTag(this.opts);\n\n this.tags.push(_tag);\n\n _tag.appendChild(document.createTextNode(rule + (sourceMap || '')));\n }\n\n this.ctr++;\n\n if (this.ctr % 65000 === 0) {\n this.tags.push(makeStyleTag(this.opts));\n }\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0; // todo - look for remnants in document.styleSheets\n\n this.injected = false;\n };\n\n return StyleSheet;\n}();\n\nfunction createEmotion(context, options) {\n if (context.__SECRET_EMOTION__ !== undefined) {\n return context.__SECRET_EMOTION__;\n }\n\n if (options === undefined) options = {};\n var key = options.key || 'css';\n\n if (process.env.NODE_ENV !== 'production') {\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var current;\n\n function insertRule(rule) {\n current += rule;\n\n if (isBrowser) {\n sheet.insert(rule, currentSourceMap);\n }\n }\n\n var insertionPlugin = stylisRuleSheet(insertRule);\n var stylisOptions;\n\n if (options.prefix !== undefined) {\n stylisOptions = {\n prefix: options.prefix\n };\n }\n\n var caches = {\n registered: {},\n inserted: {},\n nonce: options.nonce,\n key: key\n };\n var sheet = new StyleSheet(options);\n\n if (isBrowser) {\n // 🚀\n sheet.inject();\n }\n\n var stylis = new Stylis(stylisOptions);\n stylis.use(options.stylisPlugins)(insertionPlugin);\n var currentSourceMap = '';\n\n function handleInterpolation(interpolation, couldBeSelectorInterpolation) {\n if (interpolation == null) {\n return '';\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n return '';\n\n case 'function':\n if (interpolation.__emotion_styles !== undefined) {\n var selector = interpolation.toString();\n\n if (selector === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n return selector;\n }\n\n if (this === undefined && process.env.NODE_ENV !== 'production') {\n console.error('Interpolating functions in css calls is deprecated and will be removed in the next major version of Emotion.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n return handleInterpolation.call(this, this === undefined ? interpolation() : // $FlowFixMe\n interpolation(this.mergedProps, this.context), couldBeSelectorInterpolation);\n\n case 'object':\n return createStringFromObject.call(this, interpolation);\n\n default:\n var cached = caches.registered[interpolation];\n return couldBeSelectorInterpolation === false && cached !== undefined ? cached : interpolation;\n }\n }\n\n var objectToStringCache = new WeakMap();\n\n function createStringFromObject(obj) {\n if (objectToStringCache.has(obj)) {\n // $FlowFixMe\n return objectToStringCache.get(obj);\n }\n\n var string = '';\n\n if (Array.isArray(obj)) {\n obj.forEach(function (interpolation) {\n string += handleInterpolation.call(this, interpolation, false);\n }, this);\n } else {\n Object.keys(obj).forEach(function (key) {\n if (typeof obj[key] !== 'object') {\n if (caches.registered[obj[key]] !== undefined) {\n string += key + \"{\" + caches.registered[obj[key]] + \"}\";\n } else {\n string += processStyleName(key) + \":\" + processStyleValue(key, obj[key]) + \";\";\n }\n } else {\n if (key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.');\n }\n\n if (Array.isArray(obj[key]) && typeof obj[key][0] === 'string' && caches.registered[obj[key][0]] === undefined) {\n obj[key].forEach(function (value) {\n string += processStyleName(key) + \":\" + processStyleValue(key, value) + \";\";\n });\n } else {\n string += key + \"{\" + handleInterpolation.call(this, obj[key], false) + \"}\";\n }\n }\n }, this);\n }\n\n objectToStringCache.set(obj, string);\n return string;\n }\n\n var name;\n var stylesWithLabel;\n var labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*;/g;\n\n var createClassName = function createClassName(styles, identifierName) {\n return hashString(styles + identifierName) + identifierName;\n };\n\n if (process.env.NODE_ENV !== 'production') {\n var oldCreateClassName = createClassName;\n var sourceMappingUrlPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n\n createClassName = function createClassName(styles, identifierName) {\n return oldCreateClassName(styles.replace(sourceMappingUrlPattern, function (sourceMap) {\n currentSourceMap = sourceMap;\n return '';\n }), identifierName);\n };\n }\n\n var createStyles = function createStyles(strings) {\n var stringMode = true;\n var styles = '';\n var identifierName = '';\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation.call(this, strings, false);\n } else {\n styles += strings[0];\n }\n\n for (var _len = arguments.length, interpolations = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n interpolations[_key - 1] = arguments[_key];\n }\n\n interpolations.forEach(function (interpolation, i) {\n styles += handleInterpolation.call(this, interpolation, styles.charCodeAt(styles.length - 1) === 46 // .\n );\n\n if (stringMode === true && strings[i + 1] !== undefined) {\n styles += strings[i + 1];\n }\n }, this);\n stylesWithLabel = styles;\n styles = styles.replace(labelPattern, function (match, p1) {\n identifierName += \"-\" + p1;\n return '';\n });\n name = createClassName(styles, identifierName);\n return styles;\n };\n\n if (process.env.NODE_ENV !== 'production') {\n var oldStylis = stylis;\n\n stylis = function stylis(selector, styles) {\n oldStylis(selector, styles);\n currentSourceMap = '';\n };\n }\n\n function insert(scope, styles) {\n if (caches.inserted[name] === undefined) {\n current = '';\n stylis(scope, styles);\n caches.inserted[name] = current;\n }\n }\n\n var css = function css() {\n var styles = createStyles.apply(this, arguments);\n var selector = key + \"-\" + name;\n\n if (caches.registered[selector] === undefined) {\n caches.registered[selector] = stylesWithLabel;\n }\n\n insert(\".\" + selector, styles);\n return selector;\n };\n\n var keyframes = function keyframes() {\n var styles = createStyles.apply(this, arguments);\n var animation = \"animation-\" + name;\n insert('', \"@keyframes \" + animation + \"{\" + styles + \"}\");\n return animation;\n };\n\n var injectGlobal = function injectGlobal() {\n var styles = createStyles.apply(this, arguments);\n insert('', styles);\n };\n\n function getRegisteredStyles(registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (caches.registered[className] !== undefined) {\n registeredStyles.push(className);\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n }\n\n function merge(className, sourceMap) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles, sourceMap);\n }\n\n function cx() {\n for (var _len2 = arguments.length, classNames = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n classNames[_key2] = arguments[_key2];\n }\n\n return merge(classnames(classNames));\n }\n\n function hydrateSingleId(id) {\n caches.inserted[id] = true;\n }\n\n function hydrate(ids) {\n ids.forEach(hydrateSingleId);\n }\n\n function flush() {\n if (isBrowser) {\n sheet.flush();\n sheet.inject();\n }\n\n caches.inserted = {};\n caches.registered = {};\n }\n\n if (isBrowser) {\n var chunks = document.querySelectorAll(\"[data-emotion-\" + key + \"]\");\n Array.prototype.forEach.call(chunks, function (node) {\n // $FlowFixMe\n sheet.tags[0].parentNode.insertBefore(node, sheet.tags[0]); // $FlowFixMe\n\n node.getAttribute(\"data-emotion-\" + key).split(' ').forEach(hydrateSingleId);\n });\n }\n\n var emotion = {\n flush: flush,\n hydrate: hydrate,\n cx: cx,\n merge: merge,\n getRegisteredStyles: getRegisteredStyles,\n injectGlobal: injectGlobal,\n keyframes: keyframes,\n css: css,\n sheet: sheet,\n caches: caches\n };\n context.__SECRET_EMOTION__ = emotion;\n return emotion;\n}\n\nexport default createEmotion;"],"sourceRoot":""}