this["wp"] = this["wp"] || {}; this["wp"]["components"] = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 273); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["element"]; }()); /***/ }), /* 1 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["i18n"]; }()); /***/ }), /* 2 */ /***/ (function(module, exports) { (function() { module.exports = this["lodash"]; }()); /***/ }), /* 3 */, /* 4 */, /* 5 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /***/ }), /* 6 */, /* 7 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["primitives"]; }()); /***/ }), /* 8 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! Copyright (c) 2017 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */ /* global define */ (function () { 'use strict'; var hasOwn = {}.hasOwnProperty; function classNames () { var classes = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!arg) continue; var argType = typeof arg; if (argType === 'string' || argType === 'number') { classes.push(arg); } else if (Array.isArray(arg) && arg.length) { var inner = classNames.apply(null, arg); if (inner) { classes.push(inner); } } else if (argType === 'object') { for (var key in arg) { if (hasOwn.call(arg, key) && arg[key]) { classes.push(key); } } } } return classes.join(' '); } if ( true && module.exports) { classNames.default = classNames; module.exports = classNames; } else if (true) { // register as 'classnames', consistent with npm package name !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { return classNames; }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else {} }()); /***/ }), /* 10 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["compose"]; }()); /***/ }), /* 11 */, /* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js var arrayWithHoles = __webpack_require__(38); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js var unsupportedIterableToArray = __webpack_require__(31); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js var nonIterableRest = __webpack_require__(39); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js function _slicedToArray(arr, i) { return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); } /***/ }), /* 13 */ /***/ (function(module, exports) { (function() { module.exports = this["React"]; }()); /***/ }), /* 14 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; }); /* harmony import */ var _objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(43); function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = Object(_objectWithoutPropertiesLoose__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } /***/ }), /* 15 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); } /***/ }), /* 16 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; }); function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } /***/ }), /* 17 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js var arrayLikeToArray = __webpack_require__(27); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js var iterableToArray = __webpack_require__(37); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js var unsupportedIterableToArray = __webpack_require__(31); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); } /***/ }), /* 18 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["keycodes"]; }()); /***/ }), /* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; }); function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /***/ }), /* 20 */ /***/ (function(module, exports) { (function() { module.exports = this["regeneratorRuntime"]; }()); /***/ }), /* 21 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; }); function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } /***/ }), /* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; }); function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } /***/ }), /* 23 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _inherits; }); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } /***/ }), /* 24 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; }); /* harmony import */ var _helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(40); /* harmony import */ var _assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); function _possibleConstructorReturn(self, call) { if (call && (Object(_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(call) === "object" || typeof call === "function")) { return call; } return Object(_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self); } /***/ }), /* 25 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["richText"]; }()); /***/ }), /* 26 */, /* 27 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /***/ }), /* 28 */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ if (false) { var throwOnDirectAccess, ReactIs; } else { // By explicitly using `prop-types` you are opting into new production behavior. // http://fb.me/prop-types-in-prod module.exports = __webpack_require__(142)(); } /***/ }), /* 29 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["dom"]; }()); /***/ }), /* 30 */, /* 31 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); /* harmony import */ var _arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(27); function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); } /***/ }), /* 32 */, /* 33 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["hooks"]; }()); /***/ }), /* 34 */, /* 35 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export Button */ /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(36); /* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(84); /* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(85); function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var disabledEventsOnDisabledButton = ['onMouseDown', 'onClick']; function Button(props, ref) { var href = props.href, target = props.target, isPrimary = props.isPrimary, isSmall = props.isSmall, isTertiary = props.isTertiary, isPressed = props.isPressed, isBusy = props.isBusy, isDefault = props.isDefault, isSecondary = props.isSecondary, isLink = props.isLink, isDestructive = props.isDestructive, className = props.className, disabled = props.disabled, icon = props.icon, iconSize = props.iconSize, showTooltip = props.showTooltip, tooltipPosition = props.tooltipPosition, shortcut = props.shortcut, label = props.label, children = props.children, isFocusable = props.__experimentalIsFocusable, additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(props, ["href", "target", "isPrimary", "isSmall", "isTertiary", "isPressed", "isBusy", "isDefault", "isSecondary", "isLink", "isDestructive", "className", "disabled", "icon", "iconSize", "showTooltip", "tooltipPosition", "shortcut", "label", "children", "__experimentalIsFocusable"]); if (isDefault) { _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5___default()('Button isDefault prop', { alternative: 'isSecondary' }); } var classes = classnames__WEBPACK_IMPORTED_MODULE_3___default()('components-button', className, { 'is-secondary': isDefault || isSecondary, 'is-primary': isPrimary, 'is-small': isSmall, 'is-tertiary': isTertiary, 'is-pressed': isPressed, 'is-busy': isBusy, 'is-link': isLink, 'is-destructive': isDestructive, 'has-text': !!icon && !!children, 'has-icon': !!icon }); var trulyDisabled = disabled && !isFocusable; var Tag = href !== undefined && !trulyDisabled ? 'a' : 'button'; var tagProps = Tag === 'a' ? { href: href, target: target } : { type: 'button', disabled: trulyDisabled, 'aria-pressed': isPressed }; if (disabled && isFocusable) { // In this case, the button will be disabled, but still focusable and // perceivable by screen reader users. tagProps['aria-disabled'] = true; var _iterator = _createForOfIteratorHelper(disabledEventsOnDisabledButton), _step; try { for (_iterator.s(); !(_step = _iterator.n()).done;) { var disabledEvent = _step.value; additionalProps[disabledEvent] = function (event) { event.stopPropagation(); event.preventDefault(); }; } } catch (err) { _iterator.e(err); } finally { _iterator.f(); } } // Should show the tooltip if... var shouldShowTooltip = !trulyDisabled && ( // an explicit tooltip is passed or... showTooltip && label || // there's a shortcut or... shortcut || // there's a label and... !!label && ( // the children are empty and... !children || Object(lodash__WEBPACK_IMPORTED_MODULE_4__["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled. false !== showTooltip); var element = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(Tag, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, tagProps, additionalProps, { className: classes, "aria-label": additionalProps['aria-label'] || label, ref: ref }), icon && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_icon__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], { icon: icon, size: iconSize }), children); if (!shouldShowTooltip) { return element; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])(_tooltip__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { text: label, shortcut: shortcut, position: tooltipPosition }, element); } /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(Button)); /***/ }), /* 36 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["deprecated"]; }()); /***/ }), /* 37 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } /***/ }), /* 38 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } /***/ }), /* 39 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } /***/ }), /* 40 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /***/ }), /* 41 */, /* 42 */, /* 43 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /***/ }), /* 44 */ /***/ (function(module, exports) { (function() { module.exports = this["moment"]; }()); /***/ }), /* 45 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; }); function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } /***/ }), /* 46 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["a11y"]; }()); /***/ }), /* 47 */, /* 48 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useLiveRef; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(59); /** * A `React.Ref` that keeps track of the passed `value`. */ function useLiveRef(value) { var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value); Object(_useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__[/* useIsomorphicEffect */ "a"])(function () { ref.current = value; }); return ref; } /***/ }), /* 49 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; }); /** * Returns `element.ownerDocument || window.document`. */ function getDocument(element) { return element ? element.ownerDocument || element : window.document; } /***/ }), /* 50 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createHook; }); // EXTERNAL MODULE: external {"this":"React"} var external_this_React_ = __webpack_require__(13); // EXTERNAL MODULE: ./node_modules/reakit-system/es/SystemContext.js var SystemContext = __webpack_require__(76); // CONCATENATED MODULE: ./node_modules/reakit-system/es/useToken.js /** * React custom hook that returns the value of any token defined in the * SystemContext. It's mainly used internally in [`useOptions`](#useoptions) * and [`useProps`](#useprops). * * @example * import { SystemProvider, useToken } from "reakit-system"; * * const system = { * token: "value", * }; * * function Component(props) { * const token = useToken("token", "default value"); * return
{token}
; * } * * function App() { * return ( * * * * ); * } */ function useToken(token, defaultValue) { Object(external_this_React_["useDebugValue"])(token); var context = Object(external_this_React_["useContext"])(SystemContext["a" /* SystemContext */]); return context[token] != null ? context[token] : defaultValue; } // CONCATENATED MODULE: ./node_modules/reakit-system/es/useProps.js /** * React custom hook that returns the props returned by a given * `use${name}Props` in the SystemContext. * * @example * import { SystemProvider, useProps } from "reakit-system"; * * const system = { * useAProps(options, htmlProps) { * return { * ...htmlProps, * href: options.url, * }; * }, * }; * * function A({ url, ...htmlProps }) { * const props = useProps("A", { url }, htmlProps); * return ; * } * * function App() { * return ( * * It will convert url into href in useAProps * * ); * } */ function useProps(name, options, htmlProps) { if (options === void 0) { options = {}; } if (htmlProps === void 0) { htmlProps = {}; } var hookName = "use" + name + "Props"; Object(external_this_React_["useDebugValue"])(hookName); var useHook = useToken(hookName); if (useHook) { return useHook(options, htmlProps); } return htmlProps; } // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__(55); // CONCATENATED MODULE: ./node_modules/reakit-system/es/useOptions.js /** * React custom hook that returns the options returned by a given * `use${name}Options` in the SystemContext. * * @example * import React from "react"; * import { SystemProvider, useOptions } from "reakit-system"; * * const system = { * useAOptions(options, htmlProps) { * return { * ...options, * url: htmlProps.href, * }; * }, * }; * * function A({ url, ...htmlProps }) { * const options = useOptions("A", { url }, htmlProps); * return ; * } * * function App() { * return ( * * * It will convert href into url in useAOptions and then url into href in A * * * ); * } */ function useOptions(name, options, htmlProps) { if (options === void 0) { options = {}; } if (htmlProps === void 0) { htmlProps = {}; } var hookName = "use" + name + "Options"; Object(external_this_React_["useDebugValue"])(hookName); var useHook = useToken(hookName); if (useHook) { return Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, options), useHook(options, htmlProps)); } return options; } // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js var shallowEqual = __webpack_require__(56); // CONCATENATED MODULE: ./node_modules/reakit-utils/es/toArray.js /** * Transforms `arg` into an array if it's not already. * * @example * import { toArray } from "reakit-utils"; * * toArray("a"); // ["a"] * toArray(["a"]); // ["a"] */ function toArray(arg) { if (Array.isArray(arg)) { return arg; } return typeof arg !== "undefined" ? [arg] : []; } // CONCATENATED MODULE: ./node_modules/reakit-system/es/createHook.js /** * Creates a React custom hook that will return component props. * * @example * import { createHook } from "reakit-system"; * * const useA = createHook({ * name: "A", * keys: ["url"], // custom props/options keys * useProps(options, htmlProps) { * return { * ...htmlProps, * href: options.url, * }; * }, * }); * * function A({ url, ...htmlProps }) { * const props = useA({ url }, htmlProps); * return ; * } * * @param options */ function createHook(options) { var _options$useState, _composedHooks$; var composedHooks = toArray(options.compose); var __useOptions = function __useOptions(hookOptions, htmlProps) { // Call the current hook's useOptions first if (options.useOptions) { hookOptions = options.useOptions(hookOptions, htmlProps); } // If there's name, call useOptions from the system context if (options.name) { hookOptions = useOptions(options.name, hookOptions, htmlProps); } // Run composed hooks useOptions if (options.compose) { for (var _iterator = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step; !(_step = _iterator()).done;) { var hook = _step.value; hookOptions = hook.__useOptions(hookOptions, htmlProps); } } return hookOptions; }; var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) { if (hookOptions === void 0) { hookOptions = {}; } if (htmlProps === void 0) { htmlProps = {}; } if (unstable_ignoreUseOptions === void 0) { unstable_ignoreUseOptions = false; } // This won't execute when useHook was called from within another useHook if (!unstable_ignoreUseOptions) { hookOptions = __useOptions(hookOptions, htmlProps); } // Call the current hook's useProps if (options.useProps) { htmlProps = options.useProps(hookOptions, htmlProps); } // If there's name, call useProps from the system context if (options.name) { htmlProps = useProps(options.name, hookOptions, htmlProps); } if (options.compose) { if (options.useComposeOptions) { hookOptions = options.useComposeOptions(hookOptions, htmlProps); } if (options.useComposeProps) { htmlProps = options.useComposeProps(hookOptions, htmlProps); } else { for (var _iterator2 = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step2; !(_step2 = _iterator2()).done;) { var hook = _step2.value; htmlProps = hook(hookOptions, htmlProps, true); } } } // Remove undefined values from htmlProps var finalHTMLProps = {}; var definedHTMLProps = htmlProps || {}; for (var prop in definedHTMLProps) { if (definedHTMLProps[prop] !== undefined) { finalHTMLProps[prop] = definedHTMLProps[prop]; } } return finalHTMLProps; }; useHook.__useOptions = __useOptions; var composedKeys = composedHooks.reduce(function (keys, hook) { keys.push.apply(keys, hook.__keys || []); return keys; }, []); // It's used by createComponent to split option props (keys) and html props useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []); useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual["a" /* shallowEqual */]; if (false) {} return useHook; } /***/ }), /* 51 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createComponent; }); // EXTERNAL MODULE: external {"this":"React"} var external_this_React_ = __webpack_require__(13); // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__(55); // EXTERNAL MODULE: ./node_modules/reakit-system/es/useCreateElement.js var useCreateElement = __webpack_require__(79); // CONCATENATED MODULE: ./node_modules/reakit-utils/es/splitProps.js /** * Splits an object (`props`) into a tuple where the first item is an object * with the passed `keys`, and the second item is an object with these keys * omitted. * * @example * import { splitProps } from "reakit-utils"; * * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] */ function splitProps(props, keys) { var propsKeys = Object.keys(props); var picked = {}; var omitted = {}; for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) { var key = _propsKeys[_i]; if (keys.indexOf(key) >= 0) { picked[key] = props[key]; } else { omitted[key] = props[key]; } } return [picked, omitted]; } // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js var shallowEqual = __webpack_require__(56); // CONCATENATED MODULE: ./node_modules/reakit-system/es/createComponent.js function forwardRef(component) { return /*#__PURE__*/Object(external_this_React_["forwardRef"])(component); } function memo(component, propsAreEqual) { return /*#__PURE__*/Object(external_this_React_["memo"])(component, propsAreEqual); } /** * Creates a React component. * * @example * import { createComponent } from "reakit-system"; * * const A = createComponent({ as: "a" }); * * @param options */ function createComponent(_ref) { var type = _ref.as, useHook = _ref.useHook, shouldMemo = _ref.memo, _ref$propsAreEqual = _ref.propsAreEqual, propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual, _ref$keys = _ref.keys, keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys, _ref$useCreateElement = _ref.useCreateElement, useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement["a" /* useCreateElement */] : _ref$useCreateElement; var Comp = function Comp(_ref2, ref) { var _ref2$as = _ref2.as, as = _ref2$as === void 0 ? type : _ref2$as, props = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_ref2, ["as"]); if (useHook) { var _as$render; var _splitProps = splitProps(props, keys), _options = _splitProps[0], htmlProps = _splitProps[1]; var _useHook = useHook(_options, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({ ref: ref }, htmlProps)), wrapElement = _useHook.wrapElement, elementProps = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_useHook, ["wrapElement"]); // @ts-ignore var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys; var asOptions = asKeys && splitProps(props, asKeys)[0]; var allProps = asOptions ? Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, elementProps), asOptions) : elementProps; var _element = useCreateElement$1(as, allProps); if (wrapElement) { return wrapElement(_element); } return _element; } return useCreateElement$1(as, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({ ref: ref }, props)); }; if (false) {} Comp = forwardRef(Comp); if (shouldMemo) { Comp = memo(Comp, propsAreEqual); } Comp.__keys = keys; Comp.unstable_propsAreEqual = propsAreEqual || shallowEqual["a" /* shallowEqual */]; return Comp; } /***/ }), /* 52 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return findFirstEnabledItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return flatten; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return groupItems; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return findEnabledItemById; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return getCurrentId; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return reverse; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return useCompositeState; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(59); /* harmony import */ var reakit_utils_useSealedState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(62); /* harmony import */ var reakit_utils_applyState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(61); /* harmony import */ var _Id_IdState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65); function reverse(array) { return array.slice().reverse(); } function isElementPreceding(element1, element2) { return Boolean(element2.compareDocumentPosition(element1) & Node.DOCUMENT_POSITION_PRECEDING); } function findDOMIndex(items, item) { return items.findIndex(function (currentItem) { if (!currentItem.ref.current || !item.ref.current) { return false; } return isElementPreceding(item.ref.current, currentItem.ref.current); }); } function findFirstEnabledItem(items, excludeId) { if (excludeId) { return items.find(function (item) { return !item.disabled && item.id !== excludeId; }); } return items.find(function (item) { return !item.disabled; }); } function findEnabledItemById(items, id) { if (!id) return undefined; return items === null || items === void 0 ? void 0 : items.find(function (item) { return item.id === id && !item.disabled; }); } function groupItems(items) { var groups = [[]]; var _loop = function _loop() { var item = _step.value; var group = groups.find(function (g) { return !g[0] || g[0].groupId === item.groupId; }); if (group) { group.push(item); } else { groups.push([item]); } }; for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(items), _step; !(_step = _iterator()).done;) { _loop(); } return groups; } function getMaxLength(rows) { var maxLength = 0; for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(rows), _step; !(_step = _iterator()).done;) { var length = _step.value.length; if (length > maxLength) { maxLength = length; } } return maxLength; } /** * Turns [row1, row1, row2, row2] into [row1, row2, row1, row2] */ function verticalizeItems(items) { var groups = groupItems(items); var maxLength = getMaxLength(groups); var verticalized = []; for (var i = 0; i < maxLength; i += 1) { for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(groups), _step; !(_step = _iterator()).done;) { var group = _step.value; if (group[i]) { verticalized.push(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, group[i]), {}, { // If there's no groupId, it means that it's not a grid composite, // but a single row instead. So, instead of verticalizing it, that // is, assigning a different groupId based on the column index, we // keep it undefined so they will be part of the same group. // It's useful when using up/down on one-dimensional composites. groupId: group[i].groupId ? "" + i : undefined })); } } } return verticalized; } function flatten(grid) { var flattened = []; for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(grid), _step; !(_step = _iterator()).done;) { var row = _step.value; flattened.push.apply(flattened, row); } return flattened; } /** * Turns [[row1, row1], [row2]] into [[row1, row1], [row2, row2]] */ function fillGroups(groups) { var maxLength = getMaxLength(groups); for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(groups), _step; !(_step = _iterator()).done;) { var group = _step.value; if (group.length < maxLength) { for (var i = 0; i < maxLength; i += 1) { if (!group[i]) { group[i] = { id: "__EMPTY_ITEM__", disabled: true, ref: { current: null }, groupId: group[i - 1].groupId }; } } } } return groups; } function getCurrentId(options, passedId) { var _findFirstEnabledItem; if (passedId || passedId === null) { return passedId; } if (options.currentId || options.currentId === null) { return options.currentId; } return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id; } var nullItem = { id: null, ref: { current: null } }; function placeItemsAfter(items, id, shouldInsertNullItem) { var index = items.findIndex(function (item) { return item.id === id; }); return [].concat(items.slice(index + 1), shouldInsertNullItem ? [nullItem] : [], items.slice(0, index)); } function getItemsInGroup(items, groupId) { return items.filter(function (item) { return item.groupId === groupId; }); } var map = { horizontal: "vertical", vertical: "horizontal" }; function getOppositeOrientation(orientation) { return orientation && map[orientation]; } function addItemAtIndex(array, item, index) { if (!(index in array)) { return [].concat(array, [item]); } return [].concat(array.slice(0, index), [item], array.slice(index)); } function sortBasedOnDOMPosition(items) { var copy = items.slice(); var isOrderDifferent = false; copy.sort(function (a, b) { var elementA = a.ref.current; var elementB = b.ref.current; if (elementA && elementB && isElementPreceding(elementA, elementB)) { isOrderDifferent = true; return -1; } return 0; }); if (isOrderDifferent) { return copy; } return items; } function reducer(state, action) { var virtual = state.unstable_virtual, rtl = state.rtl, orientation = state.orientation, items = state.items, groups = state.groups, currentId = state.currentId, loop = state.loop, wrap = state.wrap, pastIds = state.pastIds, moves = state.unstable_moves, initialVirtual = state.initialVirtual, initialRTL = state.initialRTL, initialOrientation = state.initialOrientation, initialCurrentId = state.initialCurrentId, initialLoop = state.initialLoop, initialWrap = state.initialWrap, hasSetCurrentId = state.hasSetCurrentId; switch (action.type) { case "registerGroup": { var _group = action.group; // If there are no groups yet, just add it as the first one if (groups.length === 0) { return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { groups: [_group] }); } // Finds the group index based on DOM position var index = findDOMIndex(groups, _group); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { groups: addItemAtIndex(groups, _group, index) }); } case "unregisterGroup": { var _id = action.id; var nextGroups = groups.filter(function (group) { return group.id !== _id; }); // The group isn't registered, so do nothing if (nextGroups.length === groups.length) { return state; } return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { groups: nextGroups }); } case "registerItem": { var _item = action.item; // Finds the item group based on the DOM hierarchy var _group2 = groups.find(function (r) { var _r$ref$current; return (_r$ref$current = r.ref.current) === null || _r$ref$current === void 0 ? void 0 : _r$ref$current.contains(_item.ref.current); }); // Group will be null if it's a one-dimensional composite var nextItem = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ groupId: _group2 === null || _group2 === void 0 ? void 0 : _group2.id }, _item); var _index = findDOMIndex(items, nextItem); var nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { items: addItemAtIndex(items, nextItem, _index) }); if (!hasSetCurrentId && !moves && initialCurrentId === undefined) { var _findFirstEnabledItem; // Sets currentId to the first enabled item. This runs whenever an item // is registered because the first enabled item may be registered // asynchronously. return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, nextState), {}, { currentId: (_findFirstEnabledItem = findFirstEnabledItem(nextState.items)) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id }); } return nextState; } case "unregisterItem": { var _id2 = action.id; var nextItems = items.filter(function (item) { return item.id !== _id2; }); // The item isn't registered, so do nothing if (nextItems.length === items.length) { return state; } // Filters out the item that is being removed from the pastIds list var nextPastIds = pastIds.filter(function (pastId) { return pastId !== _id2; }); var _nextState = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { pastIds: nextPastIds, items: nextItems }); // If the current item is the item that is being removed, focus pastId if (currentId && currentId === _id2) { var nextId = getCurrentId(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState), {}, { currentId: nextPastIds[0] })); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState), {}, { currentId: nextId }); } return _nextState; } case "move": { var _id3 = action.id; // move() does nothing if (_id3 === undefined) { return state; } // Removes the current item and the item that is receiving focus from the // pastIds list var filteredPastIds = pastIds.filter(function (pastId) { return pastId !== currentId && pastId !== _id3; }); // If there's a currentId, add it to the pastIds list so it can be focused // if the new item gets removed or disabled var _nextPastIds = currentId ? [currentId].concat(filteredPastIds) : filteredPastIds; var _nextState2 = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { pastIds: _nextPastIds }); // move(null) will focus the composite element itself, not an item if (_id3 === null) { return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState2), {}, { unstable_moves: moves + 1, currentId: getCurrentId(_nextState2, _id3) }); } var _item2 = findEnabledItemById(items, _id3); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState2), {}, { unstable_moves: _item2 ? moves + 1 : moves, currentId: getCurrentId(_nextState2, _item2 === null || _item2 === void 0 ? void 0 : _item2.id) }); } case "next": { // If there's no item focused, we just move the first one if (currentId == null) { return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "first" })); } // RTL doesn't make sense on vertical navigation var isHorizontal = orientation !== "vertical"; var isRTL = rtl && isHorizontal; var allItems = isRTL ? reverse(items) : items; var currentItem = allItems.find(function (item) { return item.id === currentId; }); // If there's no item focused, we just move the first one if (!currentItem) { return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "first" })); } var isGrid = !!currentItem.groupId; var currentIndex = allItems.indexOf(currentItem); var _nextItems = allItems.slice(currentIndex + 1); var nextItemsInGroup = getItemsInGroup(_nextItems, currentItem.groupId); // Home, End if (action.allTheWay) { // We reverse so we can get the last enabled item in the group. If it's // RTL, nextItems and nextItemsInGroup are already reversed and don't // have the items before the current one anymore. So we have to get // items in group again with allItems. var _nextItem2 = findFirstEnabledItem(isRTL ? getItemsInGroup(allItems, currentItem.groupId) : reverse(nextItemsInGroup)); return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "move", id: _nextItem2 === null || _nextItem2 === void 0 ? void 0 : _nextItem2.id })); } var oppositeOrientation = getOppositeOrientation( // If it's a grid and orientation is not set, it's a next/previous // call, which is inherently horizontal. up/down will call next with // orientation set to vertical by default (see below on up/down cases). isGrid ? orientation || "horizontal" : orientation); var canLoop = loop && loop !== oppositeOrientation; var canWrap = isGrid && wrap && wrap !== oppositeOrientation; var hasNullItem = // `previous` and `up` will set action.hasNullItem, but when calling // next directly, hasNullItem will only be true if it's not a grid and // loop is set to true, which means that pressing right or down keys on // grids will never focus the composite element. On one-dimensional // composites that don't loop, pressing right or down keys also doesn't // focus the composite element. action.hasNullItem || !isGrid && canLoop && initialCurrentId === null; if (canLoop) { var loopItems = canWrap && !hasNullItem ? allItems : getItemsInGroup(allItems, currentItem.groupId); // Turns [0, 1, current, 3, 4] into [3, 4, 0, 1] var sortedItems = placeItemsAfter(loopItems, currentId, hasNullItem); var _nextItem3 = findFirstEnabledItem(sortedItems, currentId); return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "move", id: _nextItem3 === null || _nextItem3 === void 0 ? void 0 : _nextItem3.id })); } if (canWrap) { var _nextItem4 = findFirstEnabledItem( // We can use nextItems, which contains all the next items, including // items from other groups, to wrap between groups. However, if there // is a null item (the composite element), we'll only use the next // items in the group. So moving next from the last item will focus // the composite element (null). On grid composites, horizontal // navigation never focuses the composite element, only vertical. hasNullItem ? nextItemsInGroup : _nextItems, currentId); var _nextId = hasNullItem ? (_nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id) || null : _nextItem4 === null || _nextItem4 === void 0 ? void 0 : _nextItem4.id; return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "move", id: _nextId })); } var _nextItem = findFirstEnabledItem(nextItemsInGroup, currentId); if (!_nextItem && hasNullItem) { return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "move", id: null })); } return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "move", id: _nextItem === null || _nextItem === void 0 ? void 0 : _nextItem.id })); } case "previous": { // If currentId is initially set to null, the composite element will be // focusable while navigating with arrow keys. But, if it's a grid, we // don't want to focus the composite element with horizontal navigation. var _isGrid = !!groups.length; var _hasNullItem = !_isGrid && initialCurrentId === null; var _nextState3 = reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { items: reverse(items) }), Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "next", hasNullItem: _hasNullItem })); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState3), {}, { items: items }); } case "down": { // First, we make sure groups have the same number of items by filling it // with disabled fake items. Then, we reorganize the items list so // [1-1, 1-2, 2-1, 2-2] becomes [1-1, 2-1, 1-2, 2-2]. var verticalItems = verticalizeItems(flatten(fillGroups(groupItems(items)))); var _canLoop = loop && loop !== "horizontal"; // Pressing down arrow key will only focus the composite element if loop // is true or vertical. var _hasNullItem2 = _canLoop && initialCurrentId === null; var _nextState4 = reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { orientation: "vertical", items: verticalItems }), Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "next", hasNullItem: _hasNullItem2 })); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState4), {}, { orientation: orientation, items: items }); } case "up": { var _verticalItems = verticalizeItems(reverse(flatten(fillGroups(groupItems(items))))); // If currentId is initially set to null, we'll always focus the // composite element when the up arrow key is pressed in the first row. var _hasNullItem3 = initialCurrentId === null; var _nextState5 = reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { orientation: "vertical", items: _verticalItems }), Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "next", hasNullItem: _hasNullItem3 })); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState5), {}, { orientation: orientation, items: items }); } case "first": { var firstItem = findFirstEnabledItem(items); return reducer(state, Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "move", id: firstItem === null || firstItem === void 0 ? void 0 : firstItem.id })); } case "last": { var _nextState6 = reducer(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { items: reverse(items) }), Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, action), {}, { type: "first" })); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, _nextState6), {}, { items: items }); } case "sort": { return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { items: sortBasedOnDOMPosition(items), groups: sortBasedOnDOMPosition(groups) }); } case "setVirtual": return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { unstable_virtual: Object(reakit_utils_applyState__WEBPACK_IMPORTED_MODULE_4__[/* applyState */ "a"])(action.virtual, virtual) }); case "setRTL": return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { rtl: Object(reakit_utils_applyState__WEBPACK_IMPORTED_MODULE_4__[/* applyState */ "a"])(action.rtl, rtl) }); case "setOrientation": return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { orientation: Object(reakit_utils_applyState__WEBPACK_IMPORTED_MODULE_4__[/* applyState */ "a"])(action.orientation, orientation) }); case "setCurrentId": { var nextCurrentId = getCurrentId(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { currentId: Object(reakit_utils_applyState__WEBPACK_IMPORTED_MODULE_4__[/* applyState */ "a"])(action.currentId, currentId) })); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { currentId: nextCurrentId, hasSetCurrentId: true }); } case "setLoop": return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { loop: Object(reakit_utils_applyState__WEBPACK_IMPORTED_MODULE_4__[/* applyState */ "a"])(action.loop, loop) }); case "setWrap": return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { wrap: Object(reakit_utils_applyState__WEBPACK_IMPORTED_MODULE_4__[/* applyState */ "a"])(action.wrap, wrap) }); case "reset": return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { unstable_virtual: initialVirtual, rtl: initialRTL, orientation: initialOrientation, currentId: getCurrentId(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, state), {}, { currentId: initialCurrentId })), loop: initialLoop, wrap: initialWrap, unstable_moves: 0, pastIds: [] }); default: throw new Error(); } } function useAction(fn) { return Object(react__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(fn, []); } function useIsUnmountedRef() { var isUnmountedRef = Object(react__WEBPACK_IMPORTED_MODULE_1__["useRef"])(false); Object(reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_2__[/* useIsomorphicEffect */ "a"])(function () { return function () { isUnmountedRef.current = true; }; }, []); return isUnmountedRef; } function useCompositeState(initialState) { if (initialState === void 0) { initialState = {}; } var _useSealedState = Object(reakit_utils_useSealedState__WEBPACK_IMPORTED_MODULE_3__[/* useSealedState */ "a"])(initialState), _useSealedState$unsta = _useSealedState.unstable_virtual, virtual = _useSealedState$unsta === void 0 ? false : _useSealedState$unsta, _useSealedState$rtl = _useSealedState.rtl, rtl = _useSealedState$rtl === void 0 ? false : _useSealedState$rtl, orientation = _useSealedState.orientation, currentId = _useSealedState.currentId, _useSealedState$loop = _useSealedState.loop, loop = _useSealedState$loop === void 0 ? false : _useSealedState$loop, _useSealedState$wrap = _useSealedState.wrap, wrap = _useSealedState$wrap === void 0 ? false : _useSealedState$wrap, sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_useSealedState, ["unstable_virtual", "rtl", "orientation", "currentId", "loop", "wrap"]); var _React$useReducer = Object(react__WEBPACK_IMPORTED_MODULE_1__["useReducer"])(reducer, { unstable_virtual: virtual, rtl: rtl, orientation: orientation, items: [], groups: [], currentId: currentId, loop: loop, wrap: wrap, unstable_moves: 0, pastIds: [], initialVirtual: virtual, initialRTL: rtl, initialOrientation: orientation, initialCurrentId: currentId, initialLoop: loop, initialWrap: wrap }), _React$useReducer$ = _React$useReducer[0], pastIds = _React$useReducer$.pastIds, initialVirtual = _React$useReducer$.initialVirtual, initialRTL = _React$useReducer$.initialRTL, initialOrientation = _React$useReducer$.initialOrientation, initialCurrentId = _React$useReducer$.initialCurrentId, initialLoop = _React$useReducer$.initialLoop, initialWrap = _React$useReducer$.initialWrap, hasSetCurrentId = _React$useReducer$.hasSetCurrentId, state = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_React$useReducer$, ["pastIds", "initialVirtual", "initialRTL", "initialOrientation", "initialCurrentId", "initialLoop", "initialWrap", "hasSetCurrentId"]), dispatch = _React$useReducer[1]; var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_1__["useState"])(false), hasActiveWidget = _React$useState[0], setHasActiveWidget = _React$useState[1]; var idState = Object(_Id_IdState_js__WEBPACK_IMPORTED_MODULE_5__[/* unstable_useIdState */ "a"])(sealed); // register/unregister may be called when this component is unmounted. We // store the unmounted state here so we don't update the state if it's true. // This only happens in a very specific situation. // See https://github.com/reakit/reakit/issues/650 var isUnmountedRef = useIsUnmountedRef(); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, idState), state), {}, { unstable_hasActiveWidget: hasActiveWidget, unstable_setHasActiveWidget: setHasActiveWidget, registerItem: useAction(function (item) { if (isUnmountedRef.current) return; dispatch({ type: "registerItem", item: item }); }), unregisterItem: useAction(function (id) { if (isUnmountedRef.current) return; dispatch({ type: "unregisterItem", id: id }); }), registerGroup: useAction(function (group) { if (isUnmountedRef.current) return; dispatch({ type: "registerGroup", group: group }); }), unregisterGroup: useAction(function (id) { if (isUnmountedRef.current) return; dispatch({ type: "unregisterGroup", id: id }); }), move: useAction(function (id) { return dispatch({ type: "move", id: id }); }), next: useAction(function (allTheWay) { return dispatch({ type: "next", allTheWay: allTheWay }); }), previous: useAction(function (allTheWay) { return dispatch({ type: "previous", allTheWay: allTheWay }); }), up: useAction(function (allTheWay) { return dispatch({ type: "up", allTheWay: allTheWay }); }), down: useAction(function (allTheWay) { return dispatch({ type: "down", allTheWay: allTheWay }); }), first: useAction(function () { return dispatch({ type: "first" }); }), last: useAction(function () { return dispatch({ type: "last" }); }), unstable_sort: useAction(function () { return dispatch({ type: "sort" }); }), unstable_setVirtual: useAction(function (value) { return dispatch({ type: "setVirtual", virtual: value }); }), setRTL: useAction(function (value) { return dispatch({ type: "setRTL", rtl: value }); }), setOrientation: useAction(function (value) { return dispatch({ type: "setOrientation", orientation: value }); }), setCurrentId: useAction(function (value) { return dispatch({ type: "setCurrentId", currentId: value }); }), setLoop: useAction(function (value) { return dispatch({ type: "setLoop", loop: value }); }), setWrap: useAction(function (value) { return dispatch({ type: "setWrap", wrap: value }); }), reset: useAction(function () { return dispatch({ type: "reset" }); }) }); } var keys = [].concat(_Id_IdState_js__WEBPACK_IMPORTED_MODULE_5__[/* unstable_useIdState */ "a"].__keys, ["unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "unstable_moves", "unstable_hasActiveWidget", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "unstable_sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "reset", "unstable_setHasActiveWidget"]); useCompositeState.__keys = keys; /***/ }), /* 53 */, /* 54 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isSelfTarget; }); /** * Returns `true` if `event.target` and `event.currentTarget` are the same. */ function isSelfTarget(event) { return event.target === event.currentTarget; } /***/ }), /* 55 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread2; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectWithoutPropertiesLoose; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; }); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _createForOfIteratorHelperLoose(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } it = o[Symbol.iterator](); return it.next.bind(it); } /***/ }), /* 56 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return shallowEqual; }); /** * Compares two objects. * * @example * import { shallowEqual } from "reakit-utils"; * * shallowEqual({ a: "a" }, {}); // false * shallowEqual({ a: "a" }, { b: "b" }); // false * shallowEqual({ a: "a" }, { a: "a" }); // true * shallowEqual({ a: "a" }, { a: "a", b: "b" }); // false */ function shallowEqual(objA, objB) { if (objA === objB) return true; if (!objA) return false; if (!objB) return false; if (typeof objA !== "object") return false; if (typeof objB !== "object") return false; var aKeys = Object.keys(objA); var bKeys = Object.keys(objB); var length = aKeys.length; if (bKeys.length !== length) return false; for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) { var key = _aKeys[_i]; if (objA[key] !== objB[key]) { return false; } } return true; } /***/ }), /* 57 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getActiveElement; }); /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49); /** * Returns `element.ownerDocument.activeElement`. */ function getActiveElement(element) { return Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element).activeElement; } /***/ }), /* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* globals Atomics, SharedArrayBuffer, */ var undefined; var $TypeError = TypeError; var $gOPD = Object.getOwnPropertyDescriptor; if ($gOPD) { try { $gOPD({}, ''); } catch (e) { $gOPD = null; // this is IE 8, which has a broken gOPD } } var throwTypeError = function () { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function () { try { // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties arguments.callee; // IE 8 does not throw here return throwTypeError; } catch (calleeThrows) { try { // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') return $gOPD(arguments, 'callee').get; } catch (gOPDthrows) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = __webpack_require__(220)(); var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var generator; // = function * () {}; var generatorFunction = generator ? getProto(generator) : undefined; var asyncFn; // async function() {}; var asyncFunction = asyncFn ? asyncFn.constructor : undefined; var asyncGen; // async function * () {}; var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; var asyncGenIterator = asyncGen ? asyncGen() : undefined; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%ArrayPrototype%': Array.prototype, '%ArrayProto_entries%': Array.prototype.entries, '%ArrayProto_forEach%': Array.prototype.forEach, '%ArrayProto_keys%': Array.prototype.keys, '%ArrayProto_values%': Array.prototype.values, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': asyncFunction, '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, '%AsyncGeneratorFunction%': asyncGenFunction, '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%Boolean%': Boolean, '%BooleanPrototype%': Boolean.prototype, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, '%Date%': Date, '%DatePrototype%': Date.prototype, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%ErrorPrototype%': Error.prototype, '%eval%': eval, // eslint-disable-line no-eval '%EvalError%': EvalError, '%EvalErrorPrototype%': EvalError.prototype, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, '%Function%': Function, '%FunctionPrototype%': Function.prototype, '%Generator%': generator ? getProto(generator()) : undefined, '%GeneratorFunction%': generatorFunction, '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, '%Math%': Math, '%Number%': Number, '%NumberPrototype%': Number.prototype, '%Object%': Object, '%ObjectPrototype%': Object.prototype, '%ObjProto_toString%': Object.prototype.toString, '%ObjProto_valueOf%': Object.prototype.valueOf, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%RangeErrorPrototype%': RangeError.prototype, '%ReferenceError%': ReferenceError, '%ReferenceErrorPrototype%': ReferenceError.prototype, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%RegExpPrototype%': RegExp.prototype, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%StringPrototype%': String.prototype, '%Symbol%': hasSymbols ? Symbol : undefined, '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, '%SyntaxError%': SyntaxError, '%SyntaxErrorPrototype%': SyntaxError.prototype, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, '%TypeError%': $TypeError, '%TypeErrorPrototype%': $TypeError.prototype, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, '%URIError%': URIError, '%URIErrorPrototype%': URIError.prototype, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype }; var bind = __webpack_require__(120); var $replace = bind.call(Function.call, String.prototype.replace); /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ var stringToPath = function stringToPath(string) { var result = []; $replace(string, rePropName, function (match, number, quote, subString) { result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match); }); return result; }; /* end adaptation */ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { if (!(name in INTRINSICS)) { throw new SyntaxError('intrinsic ' + name + ' does not exist!'); } // istanbul ignore if // hopefully this is impossible to test :-) if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) { throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return INTRINSICS[name]; }; module.exports = function GetIntrinsic(name, allowMissing) { if (typeof name !== 'string' || name.length === 0) { throw new TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new TypeError('"allowMissing" argument must be a boolean'); } var parts = stringToPath(name); var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing); for (var i = 1; i < parts.length; i += 1) { if (value != null) { if ($gOPD && (i + 1) >= parts.length) { var desc = $gOPD(value, parts[i]); if (!allowMissing && !(parts[i] in value)) { throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); } // By convention, when a data property is converted to an accessor // property to emulate a data property that does not suffer from // the override mistake, that accessor's getter is marked with // an `originalValue` property. Here, when we detect this, we // uphold the illusion by pretending to see that original data // property, i.e., returning the value rather than the getter // itself. value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]]; } else { value = value[parts[i]]; } } } return value; }; /***/ }), /* 59 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsomorphicEffect; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /** * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side * rendering. */ var useIsomorphicEffect = typeof window === "undefined" ? react__WEBPACK_IMPORTED_MODULE_0__["useEffect"] : react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"]; /***/ }), /* 60 */, /* 61 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return applyState; }); function isUpdater(argument) { return typeof argument === "function"; } /** * Receives a `setState` argument and calls it with `currentValue` if it's a * function. Otherwise return the argument as the new value. * * @example * import { applyState } from "reakit-utils"; * * applyState((value) => value + 1, 1); // 2 * applyState(2, 1); // 2 */ function applyState(argument, currentValue) { if (isUpdater(argument)) { return argument(currentValue); } return argument; } /***/ }), /* 62 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSealedState; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /** * React custom hook that returns the very first value passed to `initialState`, * even if it changes between re-renders. */ function useSealedState(initialState) { var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(initialState), sealed = _React$useState[0]; return sealed; } /***/ }), /* 63 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useForkRef; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); // https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js function setRef(ref, value) { if (value === void 0) { value = null; } if (!ref) return; if (typeof ref === "function") { ref(value); } else { ref.current = value; } } /** * Merges up to two React Refs into a single memoized function React Ref so you * can pass it to an element. * * @example * import React from "react"; * import { useForkRef } from "reakit-utils"; * * const Component = React.forwardRef((props, ref) => { * const internalRef = React.useRef(); * return
; * }); */ function useForkRef(refA, refB) { return Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () { if (refA == null && refB == null) { return null; } return function (value) { setRef(refA, value); setRef(refB, value); }; }, [refA, refB]); } /***/ }), /* 64 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["isShallowEqual"]; }()); /***/ }), /* 65 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_useIdState; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var reakit_utils_useSealedState__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62); /* harmony import */ var _IdProvider_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(68); function unstable_useIdState(initialState) { if (initialState === void 0) { initialState = {}; } var _useSealedState = Object(reakit_utils_useSealedState__WEBPACK_IMPORTED_MODULE_1__[/* useSealedState */ "a"])(initialState), initialBaseId = _useSealedState.baseId; var generateId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_IdProvider_js__WEBPACK_IMPORTED_MODULE_2__[/* unstable_IdContext */ "a"]); var idCountRef = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(0); var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_0__["useState"])(function () { return initialBaseId || generateId(); }), baseId = _React$useState[0], setBaseId = _React$useState[1]; return { baseId: baseId, unstable_setBaseId: setBaseId, unstable_idCountRef: idCountRef }; } var keys = ["baseId", "unstable_setBaseId", "unstable_idCountRef"]; unstable_useIdState.__keys = keys; /***/ }), /* 66 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2 // https://github.com/bgrins/TinyColor // Brian Grinstead, MIT License (function(Math) { var trimLeft = /^\s+/, trimRight = /\s+$/, tinyCounter = 0, mathRound = Math.round, mathMin = Math.min, mathMax = Math.max, mathRandom = Math.random; function tinycolor (color, opts) { color = (color) ? color : ''; opts = opts || { }; // If input is already a tinycolor, return itself if (color instanceof tinycolor) { return color; } // If we are called as a function, call using new instead if (!(this instanceof tinycolor)) { return new tinycolor(color, opts); } var rgb = inputToRGB(color); this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = mathRound(100*this._a) / 100, this._format = opts.format || rgb.format; this._gradientType = opts.gradientType; // Don't let the range of [0,255] come back in [0,1]. // Potentially lose a little bit of precision here, but will fix issues where // .5 gets interpreted as half of the total, instead of half of 1 // If it was supposed to be 128, this was already taken care of by `inputToRgb` if (this._r < 1) { this._r = mathRound(this._r); } if (this._g < 1) { this._g = mathRound(this._g); } if (this._b < 1) { this._b = mathRound(this._b); } this._ok = rgb.ok; this._tc_id = tinyCounter++; } tinycolor.prototype = { isDark: function() { return this.getBrightness() < 128; }, isLight: function() { return !this.isDark(); }, isValid: function() { return this._ok; }, getOriginalInput: function() { return this._originalInput; }, getFormat: function() { return this._format; }, getAlpha: function() { return this._a; }, getBrightness: function() { //http://www.w3.org/TR/AERT#color-contrast var rgb = this.toRgb(); return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; }, getLuminance: function() { //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef var rgb = this.toRgb(); var RsRGB, GsRGB, BsRGB, R, G, B; RsRGB = rgb.r/255; GsRGB = rgb.g/255; BsRGB = rgb.b/255; if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);} if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);} if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);} return (0.2126 * R) + (0.7152 * G) + (0.0722 * B); }, setAlpha: function(value) { this._a = boundAlpha(value); this._roundA = mathRound(100*this._a) / 100; return this; }, toHsv: function() { var hsv = rgbToHsv(this._r, this._g, this._b); return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; }, toHsvString: function() { var hsv = rgbToHsv(this._r, this._g, this._b); var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); return (this._a == 1) ? "hsv(" + h + ", " + s + "%, " + v + "%)" : "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; }, toHsl: function() { var hsl = rgbToHsl(this._r, this._g, this._b); return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; }, toHslString: function() { var hsl = rgbToHsl(this._r, this._g, this._b); var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); return (this._a == 1) ? "hsl(" + h + ", " + s + "%, " + l + "%)" : "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; }, toHex: function(allow3Char) { return rgbToHex(this._r, this._g, this._b, allow3Char); }, toHexString: function(allow3Char) { return '#' + this.toHex(allow3Char); }, toHex8: function(allow4Char) { return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); }, toHex8String: function(allow4Char) { return '#' + this.toHex8(allow4Char); }, toRgb: function() { return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; }, toRgbString: function() { return (this._a == 1) ? "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; }, toPercentageRgb: function() { return { r: mathRound(bound01(this._r, 255) * 100) + "%", g: mathRound(bound01(this._g, 255) * 100) + "%", b: mathRound(bound01(this._b, 255) * 100) + "%", a: this._a }; }, toPercentageRgbString: function() { return (this._a == 1) ? "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; }, toName: function() { if (this._a === 0) { return "transparent"; } if (this._a < 1) { return false; } return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; }, toFilter: function(secondColor) { var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a); var secondHex8String = hex8String; var gradientType = this._gradientType ? "GradientType = 1, " : ""; if (secondColor) { var s = tinycolor(secondColor); secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a); } return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; }, toString: function(format) { var formatSet = !!format; format = format || this._format; var formattedString = false; var hasAlpha = this._a < 1 && this._a >= 0; var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name"); if (needsAlphaFormat) { // Special case for "transparent", all other non-alpha formats // will return rgba when there is transparency. if (format === "name" && this._a === 0) { return this.toName(); } return this.toRgbString(); } if (format === "rgb") { formattedString = this.toRgbString(); } if (format === "prgb") { formattedString = this.toPercentageRgbString(); } if (format === "hex" || format === "hex6") { formattedString = this.toHexString(); } if (format === "hex3") { formattedString = this.toHexString(true); } if (format === "hex4") { formattedString = this.toHex8String(true); } if (format === "hex8") { formattedString = this.toHex8String(); } if (format === "name") { formattedString = this.toName(); } if (format === "hsl") { formattedString = this.toHslString(); } if (format === "hsv") { formattedString = this.toHsvString(); } return formattedString || this.toHexString(); }, clone: function() { return tinycolor(this.toString()); }, _applyModification: function(fn, args) { var color = fn.apply(null, [this].concat([].slice.call(args))); this._r = color._r; this._g = color._g; this._b = color._b; this.setAlpha(color._a); return this; }, lighten: function() { return this._applyModification(lighten, arguments); }, brighten: function() { return this._applyModification(brighten, arguments); }, darken: function() { return this._applyModification(darken, arguments); }, desaturate: function() { return this._applyModification(desaturate, arguments); }, saturate: function() { return this._applyModification(saturate, arguments); }, greyscale: function() { return this._applyModification(greyscale, arguments); }, spin: function() { return this._applyModification(spin, arguments); }, _applyCombination: function(fn, args) { return fn.apply(null, [this].concat([].slice.call(args))); }, analogous: function() { return this._applyCombination(analogous, arguments); }, complement: function() { return this._applyCombination(complement, arguments); }, monochromatic: function() { return this._applyCombination(monochromatic, arguments); }, splitcomplement: function() { return this._applyCombination(splitcomplement, arguments); }, triad: function() { return this._applyCombination(triad, arguments); }, tetrad: function() { return this._applyCombination(tetrad, arguments); } }; // If input is an object, force 1 into "1.0" to handle ratios properly // String input requires "1.0" as input, so 1 will be treated as 1 tinycolor.fromRatio = function(color, opts) { if (typeof color == "object") { var newColor = {}; for (var i in color) { if (color.hasOwnProperty(i)) { if (i === "a") { newColor[i] = color[i]; } else { newColor[i] = convertToPercentage(color[i]); } } } color = newColor; } return tinycolor(color, opts); }; // Given a string or object, convert that input to RGB // Possible string inputs: // // "red" // "#f00" or "f00" // "#ff0000" or "ff0000" // "#ff000000" or "ff000000" // "rgb 255 0 0" or "rgb (255, 0, 0)" // "rgb 1.0 0 0" or "rgb (1, 0, 0)" // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" // function inputToRGB(color) { var rgb = { r: 0, g: 0, b: 0 }; var a = 1; var s = null; var v = null; var l = null; var ok = false; var format = false; if (typeof color == "string") { color = stringInputToObject(color); } if (typeof color == "object") { if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { rgb = rgbToRgb(color.r, color.g, color.b); ok = true; format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { s = convertToPercentage(color.s); v = convertToPercentage(color.v); rgb = hsvToRgb(color.h, s, v); ok = true; format = "hsv"; } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { s = convertToPercentage(color.s); l = convertToPercentage(color.l); rgb = hslToRgb(color.h, s, l); ok = true; format = "hsl"; } if (color.hasOwnProperty("a")) { a = color.a; } } a = boundAlpha(a); return { ok: ok, format: color.format || format, r: mathMin(255, mathMax(rgb.r, 0)), g: mathMin(255, mathMax(rgb.g, 0)), b: mathMin(255, mathMax(rgb.b, 0)), a: a }; } // Conversion Functions // -------------------- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: // // `rgbToRgb` // Handle bounds / percentage checking to conform to CSS color spec // // *Assumes:* r, g, b in [0, 255] or [0, 1] // *Returns:* { r, g, b } in [0, 255] function rgbToRgb(r, g, b){ return { r: bound01(r, 255) * 255, g: bound01(g, 255) * 255, b: bound01(b, 255) * 255 }; } // `rgbToHsl` // Converts an RGB color value to HSL. // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] // *Returns:* { h, s, l } in [0,1] function rgbToHsl(r, g, b) { r = bound01(r, 255); g = bound01(g, 255); b = bound01(b, 255); var max = mathMax(r, g, b), min = mathMin(r, g, b); var h, s, l = (max + min) / 2; if(max == min) { h = s = 0; // achromatic } else { var d = max - min; s = l > 0.5 ? d / (2 - max - min) : d / (max + min); switch(max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return { h: h, s: s, l: l }; } // `hslToRgb` // Converts an HSL color value to RGB. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] // *Returns:* { r, g, b } in the set [0, 255] function hslToRgb(h, s, l) { var r, g, b; h = bound01(h, 360); s = bound01(s, 100); l = bound01(l, 100); function hue2rgb(p, q, t) { if(t < 0) t += 1; if(t > 1) t -= 1; if(t < 1/6) return p + (q - p) * 6 * t; if(t < 1/2) return q; if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; return p; } if(s === 0) { r = g = b = l; // achromatic } else { var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; r = hue2rgb(p, q, h + 1/3); g = hue2rgb(p, q, h); b = hue2rgb(p, q, h - 1/3); } return { r: r * 255, g: g * 255, b: b * 255 }; } // `rgbToHsv` // Converts an RGB color value to HSV // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] // *Returns:* { h, s, v } in [0,1] function rgbToHsv(r, g, b) { r = bound01(r, 255); g = bound01(g, 255); b = bound01(b, 255); var max = mathMax(r, g, b), min = mathMin(r, g, b); var h, s, v = max; var d = max - min; s = max === 0 ? 0 : d / max; if(max == min) { h = 0; // achromatic } else { switch(max) { case r: h = (g - b) / d + (g < b ? 6 : 0); break; case g: h = (b - r) / d + 2; break; case b: h = (r - g) / d + 4; break; } h /= 6; } return { h: h, s: s, v: v }; } // `hsvToRgb` // Converts an HSV color value to RGB. // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] // *Returns:* { r, g, b } in the set [0, 255] function hsvToRgb(h, s, v) { h = bound01(h, 360) * 6; s = bound01(s, 100); v = bound01(v, 100); var i = Math.floor(h), f = h - i, p = v * (1 - s), q = v * (1 - f * s), t = v * (1 - (1 - f) * s), mod = i % 6, r = [v, q, p, p, t, v][mod], g = [t, v, v, q, p, p][mod], b = [p, p, t, v, v, q][mod]; return { r: r * 255, g: g * 255, b: b * 255 }; } // `rgbToHex` // Converts an RGB color to hex // Assumes r, g, and b are contained in the set [0, 255] // Returns a 3 or 6 character hex function rgbToHex(r, g, b, allow3Char) { var hex = [ pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16)) ]; // Return a 3 character hex if possible if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) { return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); } return hex.join(""); } // `rgbaToHex` // Converts an RGBA color plus alpha transparency to hex // Assumes r, g, b are contained in the set [0, 255] and // a in [0, 1]. Returns a 4 or 8 character rgba hex function rgbaToHex(r, g, b, a, allow4Char) { var hex = [ pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16)), pad2(convertDecimalToHex(a)) ]; // Return a 4 character hex if possible if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) { return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); } return hex.join(""); } // `rgbaToArgbHex` // Converts an RGBA color to an ARGB Hex8 string // Rarely used, but required for "toFilter()" function rgbaToArgbHex(r, g, b, a) { var hex = [ pad2(convertDecimalToHex(a)), pad2(mathRound(r).toString(16)), pad2(mathRound(g).toString(16)), pad2(mathRound(b).toString(16)) ]; return hex.join(""); } // `equals` // Can be called with any tinycolor input tinycolor.equals = function (color1, color2) { if (!color1 || !color2) { return false; } return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); }; tinycolor.random = function() { return tinycolor.fromRatio({ r: mathRandom(), g: mathRandom(), b: mathRandom() }); }; // Modification Functions // ---------------------- // Thanks to less.js for some of the basics here // function desaturate(color, amount) { amount = (amount === 0) ? 0 : (amount || 10); var hsl = tinycolor(color).toHsl(); hsl.s -= amount / 100; hsl.s = clamp01(hsl.s); return tinycolor(hsl); } function saturate(color, amount) { amount = (amount === 0) ? 0 : (amount || 10); var hsl = tinycolor(color).toHsl(); hsl.s += amount / 100; hsl.s = clamp01(hsl.s); return tinycolor(hsl); } function greyscale(color) { return tinycolor(color).desaturate(100); } function lighten (color, amount) { amount = (amount === 0) ? 0 : (amount || 10); var hsl = tinycolor(color).toHsl(); hsl.l += amount / 100; hsl.l = clamp01(hsl.l); return tinycolor(hsl); } function brighten(color, amount) { amount = (amount === 0) ? 0 : (amount || 10); var rgb = tinycolor(color).toRgb(); rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); return tinycolor(rgb); } function darken (color, amount) { amount = (amount === 0) ? 0 : (amount || 10); var hsl = tinycolor(color).toHsl(); hsl.l -= amount / 100; hsl.l = clamp01(hsl.l); return tinycolor(hsl); } // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. // Values outside of this range will be wrapped into this range. function spin(color, amount) { var hsl = tinycolor(color).toHsl(); var hue = (hsl.h + amount) % 360; hsl.h = hue < 0 ? 360 + hue : hue; return tinycolor(hsl); } // Combination Functions // --------------------- // Thanks to jQuery xColor for some of the ideas behind these // function complement(color) { var hsl = tinycolor(color).toHsl(); hsl.h = (hsl.h + 180) % 360; return tinycolor(hsl); } function triad(color) { var hsl = tinycolor(color).toHsl(); var h = hsl.h; return [ tinycolor(color), tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) ]; } function tetrad(color) { var hsl = tinycolor(color).toHsl(); var h = hsl.h; return [ tinycolor(color), tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) ]; } function splitcomplement(color) { var hsl = tinycolor(color).toHsl(); var h = hsl.h; return [ tinycolor(color), tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) ]; } function analogous(color, results, slices) { results = results || 6; slices = slices || 30; var hsl = tinycolor(color).toHsl(); var part = 360 / slices; var ret = [tinycolor(color)]; for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { hsl.h = (hsl.h + part) % 360; ret.push(tinycolor(hsl)); } return ret; } function monochromatic(color, results) { results = results || 6; var hsv = tinycolor(color).toHsv(); var h = hsv.h, s = hsv.s, v = hsv.v; var ret = []; var modification = 1 / results; while (results--) { ret.push(tinycolor({ h: h, s: s, v: v})); v = (v + modification) % 1; } return ret; } // Utility Functions // --------------------- tinycolor.mix = function(color1, color2, amount) { amount = (amount === 0) ? 0 : (amount || 50); var rgb1 = tinycolor(color1).toRgb(); var rgb2 = tinycolor(color2).toRgb(); var p = amount / 100; var rgba = { r: ((rgb2.r - rgb1.r) * p) + rgb1.r, g: ((rgb2.g - rgb1.g) * p) + rgb1.g, b: ((rgb2.b - rgb1.b) * p) + rgb1.b, a: ((rgb2.a - rgb1.a) * p) + rgb1.a }; return tinycolor(rgba); }; // Readability Functions // --------------------- // false // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false tinycolor.isReadable = function(color1, color2, wcag2) { var readability = tinycolor.readability(color1, color2); var wcag2Parms, out; out = false; wcag2Parms = validateWCAG2Parms(wcag2); switch (wcag2Parms.level + wcag2Parms.size) { case "AAsmall": case "AAAlarge": out = readability >= 4.5; break; case "AAlarge": out = readability >= 3; break; case "AAAsmall": out = readability >= 7; break; } return out; }; // `mostReadable` // Given a base color and a list of possible foreground or background // colors for that base, returns the most readable color. // Optionally returns Black or White if the most readable color is unreadable. // *Example* // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255" // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff" // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3" // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff" tinycolor.mostReadable = function(baseColor, colorList, args) { var bestColor = null; var bestScore = 0; var readability; var includeFallbackColors, level, size ; args = args || {}; includeFallbackColors = args.includeFallbackColors ; level = args.level; size = args.size; for (var i= 0; i < colorList.length ; i++) { readability = tinycolor.readability(baseColor, colorList[i]); if (readability > bestScore) { bestScore = readability; bestColor = tinycolor(colorList[i]); } } if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) { return bestColor; } else { args.includeFallbackColors=false; return tinycolor.mostReadable(baseColor,["#fff", "#000"],args); } }; // Big List of Colors // ------------------ // var names = tinycolor.names = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "0ff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000", blanchedalmond: "ffebcd", blue: "00f", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", burntsienna: "ea7e5d", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "0ff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkgrey: "a9a9a9", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkslategrey: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dimgrey: "696969", dodgerblue: "1e90ff", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "f0f", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", grey: "808080", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgray: "d3d3d3", lightgreen: "90ee90", lightgrey: "d3d3d3", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslategray: "789", lightslategrey: "789", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "0f0", limegreen: "32cd32", linen: "faf0e6", magenta: "f0f", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370db", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "db7093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", rebeccapurple: "663399", red: "f00", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", slategrey: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", wheat: "f5deb3", white: "fff", whitesmoke: "f5f5f5", yellow: "ff0", yellowgreen: "9acd32" }; // Make it easy to access colors via `hexNames[hex]` var hexNames = tinycolor.hexNames = flip(names); // Utilities // --------- // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` function flip(o) { var flipped = { }; for (var i in o) { if (o.hasOwnProperty(i)) { flipped[o[i]] = i; } } return flipped; } // Return a valid alpha value [0,1] with all invalid values being set to 1 function boundAlpha(a) { a = parseFloat(a); if (isNaN(a) || a < 0 || a > 1) { a = 1; } return a; } // Take input from [0, n] and return it as [0, 1] function bound01(n, max) { if (isOnePointZero(n)) { n = "100%"; } var processPercent = isPercentage(n); n = mathMin(max, mathMax(0, parseFloat(n))); // Automatically convert percentage into number if (processPercent) { n = parseInt(n * max, 10) / 100; } // Handle floating point rounding errors if ((Math.abs(n - max) < 0.000001)) { return 1; } // Convert into [0, 1] range if it isn't already return (n % max) / parseFloat(max); } // Force a number between 0 and 1 function clamp01(val) { return mathMin(1, mathMax(0, val)); } // Parse a base-16 hex value into a base-10 integer function parseIntFromHex(val) { return parseInt(val, 16); } // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 // function isOnePointZero(n) { return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; } // Check to see if string passed in is a percentage function isPercentage(n) { return typeof n === "string" && n.indexOf('%') != -1; } // Force a hex value to have 2 characters function pad2(c) { return c.length == 1 ? '0' + c : '' + c; } // Replace a decimal with it's percentage value function convertToPercentage(n) { if (n <= 1) { n = (n * 100) + "%"; } return n; } // Converts a decimal to a hex value function convertDecimalToHex(d) { return Math.round(parseFloat(d) * 255).toString(16); } // Converts a hex value to a decimal function convertHexToDecimal(h) { return (parseIntFromHex(h) / 255); } var matchers = (function() { // var CSS_INTEGER = "[-\\+]?\\d+%?"; // var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; // Actual matching. // Parentheses and commas are optional, but not required. // Whitespace can take the place of commas or opening paren var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; return { CSS_UNIT: new RegExp(CSS_UNIT), rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ }; })(); // `isValidCSSUnit` // Take in a single string / number and check to see if it looks like a CSS unit // (see `matchers` above for definition). function isValidCSSUnit(color) { return !!matchers.CSS_UNIT.exec(color); } // `stringInputToObject` // Permissive string parsing. Take in a number of formats, and output an object // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` function stringInputToObject(color) { color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase(); var named = false; if (names[color]) { color = names[color]; named = true; } else if (color == 'transparent') { return { r: 0, g: 0, b: 0, a: 0, format: "name" }; } // Try to match string input using regular expressions. // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] // Just return an object and let the conversion functions handle that. // This way the result will be the same whether the tinycolor is initialized with string or object. var match; if ((match = matchers.rgb.exec(color))) { return { r: match[1], g: match[2], b: match[3] }; } if ((match = matchers.rgba.exec(color))) { return { r: match[1], g: match[2], b: match[3], a: match[4] }; } if ((match = matchers.hsl.exec(color))) { return { h: match[1], s: match[2], l: match[3] }; } if ((match = matchers.hsla.exec(color))) { return { h: match[1], s: match[2], l: match[3], a: match[4] }; } if ((match = matchers.hsv.exec(color))) { return { h: match[1], s: match[2], v: match[3] }; } if ((match = matchers.hsva.exec(color))) { return { h: match[1], s: match[2], v: match[3], a: match[4] }; } if ((match = matchers.hex8.exec(color))) { return { r: parseIntFromHex(match[1]), g: parseIntFromHex(match[2]), b: parseIntFromHex(match[3]), a: convertHexToDecimal(match[4]), format: named ? "name" : "hex8" }; } if ((match = matchers.hex6.exec(color))) { return { r: parseIntFromHex(match[1]), g: parseIntFromHex(match[2]), b: parseIntFromHex(match[3]), format: named ? "name" : "hex" }; } if ((match = matchers.hex4.exec(color))) { return { r: parseIntFromHex(match[1] + '' + match[1]), g: parseIntFromHex(match[2] + '' + match[2]), b: parseIntFromHex(match[3] + '' + match[3]), a: convertHexToDecimal(match[4] + '' + match[4]), format: named ? "name" : "hex8" }; } if ((match = matchers.hex3.exec(color))) { return { r: parseIntFromHex(match[1] + '' + match[1]), g: parseIntFromHex(match[2] + '' + match[2]), b: parseIntFromHex(match[3] + '' + match[3]), format: named ? "name" : "hex" }; } return false; } function validateWCAG2Parms(parms) { // return valid WCAG2 parms for isReadable. // If input parms are invalid, return {"level":"AA", "size":"small"} var level, size; parms = parms || {"level":"AA", "size":"small"}; level = (parms.level || "AA").toUpperCase(); size = (parms.size || "small").toLowerCase(); if (level !== "AA" && level !== "AAA") { level = "AA"; } if (size !== "small" && size !== "large") { size = "small"; } return {"level":level, "size":size}; } // Node: Export function if ( true && module.exports) { module.exports = tinycolor; } // AMD/requirejs: Define the module else if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } // Browser: Expose to window else {} })(Math); /***/ }), /* 67 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export Box */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useBox; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(56); var useBox = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ name: "Box", keys: ["unstable_system"], propsAreEqual: function propsAreEqual(prev, next) { var prevSystem = prev.unstable_system, prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(prev, ["unstable_system"]); var nextSystem = next.unstable_system, nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(next, ["unstable_system"]); if (prevSystem !== nextSystem && !Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevSystem, nextSystem)) { return false; } return Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevProps, nextProps); } }); var Box = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ as: "div", useHook: useBox }); /***/ }), /* 68 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_IdContext; }); /* unused harmony export unstable_IdProvider */ /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); var defaultPrefix = "id"; function generateRandomString(prefix) { if (prefix === void 0) { prefix = defaultPrefix; } return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6); } var unstable_IdContext = Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])(generateRandomString); function unstable_IdProvider(_ref) { var children = _ref.children, _ref$prefix = _ref.prefix, prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix; var count = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(0); var generateId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(function (localPrefix) { if (localPrefix === void 0) { localPrefix = prefix; } return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current; }, [prefix]); return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(unstable_IdContext.Provider, { value: generateId }, children); } /***/ }), /* 69 */, /* 70 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasFocusWithin; }); /* harmony import */ var _getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(57); /** * Checks if `element` has focus. * * @example * import { hasFocusWithin } from "reakit-utils"; * * hasFocusWithin(document.getElementById("id")); */ function hasFocusWithin(element) { var activeElement = Object(_getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__[/* getActiveElement */ "a"])(element); if (!activeElement) return false; if (element.contains(activeElement)) return true; var activeDescendant = activeElement.getAttribute("aria-activedescendant"); if (!activeDescendant) return false; return activeDescendant === element.id || !!element.querySelector("#" + activeDescendant); } /***/ }), /* 71 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isButton; }); var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"]; /** * Checks whether `element` is a native HTML button element or not. * * @example * import { isButton } from "reakit-utils"; * * isButton(document.querySelector("button")); // true * isButton(document.querySelector("input[type='button']")); // true * isButton(document.querySelector("div")); // false * isButton(document.querySelector("input[type='text']")); // false * * @returns {boolean} */ function isButton(element) { if (element.tagName === "BUTTON") return true; if (element.tagName === "INPUT") { var input = element; return buttonInputTypes.indexOf(input.type) !== -1; } return false; } /***/ }), /* 72 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ ensureFocus; }); __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ getClosestFocusable; }); // UNUSED EXPORTS: getAllFocusableIn, getAllTabbableIn, getFirstFocusableIn, getFirstTabbableIn, getLastTabbableIn, getNextTabbableIn, getPreviousTabbableIn, isFocusable, isTabbable // CONCATENATED MODULE: ./node_modules/reakit-utils/es/matches.js /** * Ponyfill for `Element.prototype.matches` * * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches */ function matches(element, selectors) { if ("matches" in element) return element.matches(selectors); if ("msMatchesSelector" in element) return element.msMatchesSelector(selectors); return element.webkitMatchesSelector(selectors); } // CONCATENATED MODULE: ./node_modules/reakit-utils/es/closest.js /** * Ponyfill for `Element.prototype.closest` * * @example * import { closest } from "reakit-utils"; * * closest(document.getElementById("id"), "div"); * // same as * document.getElementById("id").closest("div"); */ function closest(element, selectors) { if ("closest" in element) return element.closest(selectors); do { if (matches(element, selectors)) return element; element = element.parentElement || element.parentNode; } while (element !== null && element.nodeType === 1); return null; } // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js var getActiveElement = __webpack_require__(57); // CONCATENATED MODULE: ./node_modules/reakit-utils/es/tabbable.js /** @module tabbable */ var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), " + "textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], " + "iframe, object, embed, area[href], audio[controls], video[controls], " + "[contenteditable]:not([contenteditable='false'])"; function isVisible(element) { return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0; } function hasNegativeTabIndex(element) { var tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); return tabIndex < 0; } /** * Checks whether `element` is focusable or not. * * @memberof tabbable * * @example * import { isFocusable } from "reakit-utils"; * * isFocusable(document.querySelector("input")); // true * isFocusable(document.querySelector("input[tabindex='-1']")); // true * isFocusable(document.querySelector("input[hidden]")); // false * isFocusable(document.querySelector("input:disabled")); // false */ function isFocusable(element) { return matches(element, selector) && isVisible(element); } /** * Checks whether `element` is tabbable or not. * * @memberof tabbable * * @example * import { isTabbable } from "reakit-utils"; * * isTabbable(document.querySelector("input")); // true * isTabbable(document.querySelector("input[tabindex='-1']")); // false * isTabbable(document.querySelector("input[hidden]")); // false * isTabbable(document.querySelector("input:disabled")); // false */ function isTabbable(element) { return isFocusable(element) && !hasNegativeTabIndex(element); } /** * Returns all the focusable elements in `container`. * * @memberof tabbable * * @param {Element} container * * @returns {Element[]} */ function getAllFocusableIn(container) { var allFocusable = Array.from(container.querySelectorAll(selector)); allFocusable.unshift(container); return allFocusable.filter(isFocusable); } /** * Returns the first focusable element in `container`. * * @memberof tabbable * * @param {Element} container * * @returns {Element|null} */ function getFirstFocusableIn(container) { var allFocusable = getAllFocusableIn(container); return allFocusable.length ? allFocusable[0] : null; } /** * Returns all the tabbable elements in `container`, including the container * itself. * * @memberof tabbable * * @param {Element} container * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones. * * @returns {Element[]} */ function getAllTabbableIn(container, fallbackToFocusable) { var allFocusable = Array.from(container.querySelectorAll(selector)); var allTabbable = allFocusable.filter(isTabbable); if (isTabbable(container)) { allTabbable.unshift(container); } if (!allTabbable.length && fallbackToFocusable) { return allFocusable; } return allTabbable; } /** * Returns the first tabbable element in `container`, including the container * itself if it's tabbable. * * @memberof tabbable * * @param {Element} container * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones. * * @returns {Element|null} */ function getFirstTabbableIn(container, fallbackToFocusable) { var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable), first = _getAllTabbableIn[0]; return first || null; } /** * Returns the last tabbable element in `container`, including the container * itself if it's tabbable. * * @memberof tabbable * * @param {Element} container * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones. * * @returns {Element|null} */ function getLastTabbableIn(container, fallbackToFocusable) { var allTabbable = getAllTabbableIn(container, fallbackToFocusable); return allTabbable[allTabbable.length - 1] || null; } /** * Returns the next tabbable element in `container`. * * @memberof tabbable * * @param {Element} container * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones. * * @returns {Element|null} */ function getNextTabbableIn(container, fallbackToFocusable) { var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container); var allFocusable = getAllFocusableIn(container); var index = allFocusable.indexOf(activeElement); var slice = allFocusable.slice(index + 1); return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); } /** * Returns the previous tabbable element in `container`. * * @memberof tabbable * * @param {Element} container * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones. * * @returns {Element|null} */ function getPreviousTabbableIn(container, fallbackToFocusable) { var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container); var allFocusable = getAllFocusableIn(container).reverse(); var index = allFocusable.indexOf(activeElement); var slice = allFocusable.slice(index + 1); return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); } /** * Returns the closest focusable element. * * @memberof tabbable * * @param {Element} container * * @returns {Element|null} */ function getClosestFocusable(element) { while (element && !isFocusable(element)) { element = closest(element, selector); } return element; } function defaultIsActive(element) { return Object(getActiveElement["a" /* getActiveElement */])(element) === element; } /** * Ensures `element` will receive focus if it's not already. * * @memberof tabbable * * @example * import { ensureFocus } from "reakit-utils"; * * ensureFocus(document.activeElement); // does nothing * * const element = document.querySelector("input"); * * ensureFocus(element); // focuses element * ensureFocus(element, { preventScroll: true }); // focuses element preventing scroll jump * * function isActive(el) { * return el.dataset.active === "true"; * } * * ensureFocus(document.querySelector("[data-active='true']"), { isActive }); // does nothing * * @returns {number} `requestAnimationFrame` call ID so it can be passed to `cancelAnimationFrame` if needed. */ function ensureFocus(element, _temp) { var _ref = _temp === void 0 ? {} : _temp, _ref$isActive = _ref.isActive, isActive = _ref$isActive === void 0 ? defaultIsActive : _ref$isActive, preventScroll = _ref.preventScroll; if (isActive(element)) return -1; element.focus({ preventScroll: preventScroll }); if (isActive(element)) return -1; return requestAnimationFrame(function () { element.focus({ preventScroll: preventScroll }); }); } /***/ }), /* 73 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ isPortalEvent; }); // CONCATENATED MODULE: ./node_modules/reakit-utils/es/contains.js /** * Similar to `Element.prototype.contains`. */ function contains(parent, child) { return parent === child || parent.contains(child); } // CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPortalEvent.js /** * Returns `true` if `event` has been fired within a React Portal element. */ function isPortalEvent(event) { return !contains(event.currentTarget, event.target); } /***/ }), /* 74 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export Tabbable */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useTabbable; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var _Box_Box_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63); /* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(71); /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81); /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(48); /* harmony import */ var reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(59); /* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(70); /* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(73); /* harmony import */ var reakit_utils_getActiveElement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(57); /* harmony import */ var reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(72); function isUA(string) { if (typeof window === "undefined") return false; return window.navigator.userAgent.indexOf(string) !== -1; } var isSafariOrFirefoxOnMac = isUA("Mac") && !isUA("Chrome") && (isUA("Safari") || isUA("Firefox")); function focusIfNeeded(element) { if (!Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_10__[/* hasFocusWithin */ "a"])(element)) { element.focus(); } } // Safari and Firefox on MacOS don't focus on buttons on mouse down like other // browsers/platforms. Instead, they focus on the closest focusable ancestor // element, which is ultimately the body element. So we make sure to give focus // to the tabbable element on mouse down so it works consistently across // browsers. // istanbul ignore next function useFocusOnMouseDown() { if (!isSafariOrFirefoxOnMac) return undefined; var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_4__["useState"])(null), tabbable = _React$useState[0], scheduleFocus = _React$useState[1]; Object(react__WEBPACK_IMPORTED_MODULE_4__["useEffect"])(function () { if (!tabbable) return; focusIfNeeded(tabbable); scheduleFocus(null); }, [tabbable]); var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_4__["useCallback"])(function (event) { var element = event.currentTarget; if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_11__[/* isPortalEvent */ "a"])(event)) return; if (!Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_6__[/* isButton */ "a"])(element)) return; var activeElement = Object(reakit_utils_getActiveElement__WEBPACK_IMPORTED_MODULE_12__[/* getActiveElement */ "a"])(element); if (!activeElement) return; var activeElementIsBody = activeElement.tagName === "BODY"; var focusableAncestor = Object(reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_13__[/* getClosestFocusable */ "b"])(element.parentElement); if (activeElement === focusableAncestor || activeElementIsBody && !focusableAncestor) { // When the active element is the focusable ancestor, it'll not emit // focus/blur events. After all, it's already focused. So we can't // listen to those events to focus this tabbable element. // When the active element is body and there's no focusable ancestor, // we also don't have any other event to listen to since body never // emits focus/blur events on itself. // In both of these cases, we have to schedule focus on this tabbable // element. scheduleFocus(element); } else if (focusableAncestor) { // Clicking (mouse down) on the tabbable element on Safari and Firefox // on MacOS will fire focus on the focusable ancestor element if // there's any and if it's not the current active element. So we wait // for this event to happen before moving focus to this element. // Instead of moving focus right away, we have to schedule it, // otherwise it's gonna prevent drag events from happening. var onFocus = function onFocus() { return scheduleFocus(element); }; focusableAncestor.addEventListener("focusin", onFocus, { once: true }); } else { // Finally, if there's no focsuable ancestor and there's another // element with focus, we wait for that element to get blurred before // focusing this one. var onBlur = function onBlur() { return focusIfNeeded(element); }; activeElement.addEventListener("blur", onBlur, { once: true }); } }, []); return onMouseDown; } function isNativeTabbable(element) { return element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "SELECT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "AUDIO" || element.tagName === "VIDEO"; } var useTabbable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ name: "Tabbable", compose: _Box_Box_js__WEBPACK_IMPORTED_MODULE_3__[/* useBox */ "a"], keys: ["disabled", "focusable"], useOptions: function useOptions(options, _ref) { var disabled = _ref.disabled; return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ disabled: disabled }, options); }, useProps: function useProps(options, _ref2) { var htmlRef = _ref2.ref, htmlTabIndex = _ref2.tabIndex, htmlOnClick = _ref2.onClick, htmlOnMouseDown = _ref2.onMouseDown, htmlStyle = _ref2.style, htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["ref", "tabIndex", "onClick", "onMouseDown", "style"]); var ref = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])(null); var onClickRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_8__[/* useLiveRef */ "a"])(htmlOnClick); var onMouseDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_8__[/* useLiveRef */ "a"])(htmlOnMouseDown); var trulyDisabled = options.disabled && !options.focusable; var _React$useState2 = Object(react__WEBPACK_IMPORTED_MODULE_4__["useState"])(true), nativeTabbable = _React$useState2[0], setNativeTabbable = _React$useState2[1]; var tabIndex = nativeTabbable ? htmlTabIndex : htmlTabIndex || 0; var style = options.disabled ? Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ pointerEvents: "none" }, htmlStyle) : htmlStyle; var focusOnMouseDown = useFocusOnMouseDown(); Object(reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_9__[/* useIsomorphicEffect */ "a"])(function () { var tabbable = ref.current; if (!tabbable) { false ? undefined : void 0; return; } if (!isNativeTabbable(tabbable)) { setNativeTabbable(false); } }, []); var onClick = Object(react__WEBPACK_IMPORTED_MODULE_4__["useCallback"])(function (event) { var _onClickRef$current; if (options.disabled) { event.stopPropagation(); event.preventDefault(); return; } (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event); }, [options.disabled]); var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_4__["useCallback"])(function (event) { var _onMouseDownRef$curre; if (options.disabled) { event.stopPropagation(); event.preventDefault(); return; } (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); if (event.defaultPrevented) return; focusOnMouseDown === null || focusOnMouseDown === void 0 ? void 0 : focusOnMouseDown(event); }, [options.disabled, focusOnMouseDown]); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_5__[/* useForkRef */ "a"])(ref, htmlRef), style: style, tabIndex: !trulyDisabled ? tabIndex : undefined, disabled: trulyDisabled && nativeTabbable ? true : undefined, "aria-disabled": options.disabled ? true : undefined, onClick: onClick, onMouseDown: onMouseDown }, htmlProps); } }); var Tabbable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ as: "div", useHook: useTabbable }); /***/ }), /* 75 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["date"]; }()); /***/ }), /* 76 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SystemContext; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); var SystemContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])({}); /***/ }), /* 77 */, /* 78 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L'; var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD'; var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM'; var START_DATE = exports.START_DATE = 'startDate'; var END_DATE = exports.END_DATE = 'endDate'; var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal'; var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical'; var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable'; var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before'; var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after'; var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top'; var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom'; var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before'; var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after'; var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left'; var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right'; var OPEN_DOWN = exports.OPEN_DOWN = 'down'; var OPEN_UP = exports.OPEN_UP = 'up'; var DAY_SIZE = exports.DAY_SIZE = 39; var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked'; var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6]; var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20; var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10; var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22; var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']); /***/ }), /* 79 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useCreateElement; }); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _SystemContext_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76); /* harmony import */ var _rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(55); function isRenderProp(children) { return typeof children === "function"; } /** * Custom hook that will call `children` if it's a function. If * `useCreateElement` has been passed to the context, it'll be used instead. * * @example * import React from "react"; * import { SystemProvider, useCreateElement } from "reakit-system"; * * const system = { * useCreateElement(type, props, children = props.children) { * // very similar to what `useCreateElement` does already * if (typeof children === "function") { * const { children: _, ...rest } = props; * return children(rest); * } * return React.createElement(type, props, children); * }, * }; * * function Component(props) { * return useCreateElement("div", props); * } * * function App() { * return ( * * {({ url }) => link} * * ); * } */ var useCreateElement = function useCreateElement(type, props, children) { if (children === void 0) { children = props.children; } var context = Object(react__WEBPACK_IMPORTED_MODULE_0__["useContext"])(_SystemContext_js__WEBPACK_IMPORTED_MODULE_1__[/* SystemContext */ "a"]); if (context.useCreateElement) { return context.useCreateElement(type, props, children); } if (typeof type === "string" && isRenderProp(children)) { var _ = props.children, rest = Object(_rollupPluginBabelHelpers_0c84a174_js__WEBPACK_IMPORTED_MODULE_2__[/* a */ "b"])(props, ["children"]); return children(rest); } return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(type, props, children); }; /***/ }), /* 80 */, /* 81 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // UNUSED EXPORTS: warning, useWarning // EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js var warning = __webpack_require__(109); // EXTERNAL MODULE: external {"this":"React"} var external_this_React_ = __webpack_require__(13); // CONCATENATED MODULE: ./node_modules/reakit-utils/es/isObject.js /** * Checks whether `arg` is an object or not. * * @returns {boolean} */ function isObject(arg) { return typeof arg === "object" && arg != null; } // CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js function isRefObject(ref) { return isObject(ref) && "current" in ref; } /** * Logs `messages` to the console using `console.warn` based on a `condition`. * This should be used inside components. */ function useWarning(condition) { for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { messages[_key - 1] = arguments[_key]; } if (false) {} } // CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js /***/ }), /* 82 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createOnKeyDown; }); /** * Returns an `onKeyDown` handler to be passed to a component. * * @param options */ function createOnKeyDown(_temp) { var _ref = _temp === void 0 ? {} : _temp, keyMap = _ref.keyMap, onKey = _ref.onKey, stopPropagation = _ref.stopPropagation, onKeyDown = _ref.onKeyDown, _ref$shouldKeyDown = _ref.shouldKeyDown, shouldKeyDown = _ref$shouldKeyDown === void 0 ? function () { return true; } : _ref$shouldKeyDown, _ref$preventDefault = _ref.preventDefault, preventDefault = _ref$preventDefault === void 0 ? true : _ref$preventDefault; return function (event) { if (!keyMap) return; var finalKeyMap = typeof keyMap === "function" ? keyMap(event) : keyMap; var shouldPreventDefault = typeof preventDefault === "function" ? preventDefault(event) : preventDefault; var shouldStopPropagation = typeof stopPropagation === "function" ? stopPropagation(event) : stopPropagation; if (event.key in finalKeyMap) { var action = finalKeyMap[event.key]; if (typeof action === "function" && shouldKeyDown(event)) { if (shouldPreventDefault) event.preventDefault(); if (shouldStopPropagation) event.stopPropagation(); if (onKey) onKey(event); action(event); // Prevent onKeyDown from being called twice for the same keys return; } } if (onKeyDown && "current" in onKeyDown) { var _onKeyDown$current; (_onKeyDown$current = onKeyDown.current) === null || _onKeyDown$current === void 0 ? void 0 : _onKeyDown$current.call(onKeyDown, event); } else { onKeyDown === null || onKeyDown === void 0 ? void 0 : onKeyDown(event); } }; } /***/ }), /* 83 */, /* 84 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _popover__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(114); /* harmony import */ var _shortcut__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(172); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Time over children to wait before showing tooltip * * @type {number} */ var TOOLTIP_DELAY = 700; var Tooltip = /*#__PURE__*/function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(Tooltip, _Component); var _super = _createSuper(Tooltip); function Tooltip() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, Tooltip); _this = _super.apply(this, arguments); _this.delayedSetIsOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["debounce"])(function (isOver) { return _this.setState({ isOver: isOver }); }, TOOLTIP_DELAY); /** * Prebound `isInMouseDown` handler, created as a constant reference to * assure ability to remove in component unmount. * * @type {Function} */ _this.cancelIsMouseDown = _this.createSetIsMouseDown(false); /** * Whether a the mouse is currently pressed, used in determining whether * to handle a focus event as displaying the tooltip immediately. * * @type {boolean} */ _this.isInMouseDown = false; _this.state = { isOver: false }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(Tooltip, [{ key: "componentWillUnmount", value: function componentWillUnmount() { this.delayedSetIsOver.cancel(); document.removeEventListener('mouseup', this.cancelIsMouseDown); } }, { key: "emitToChild", value: function emitToChild(eventName, event) { var children = this.props.children; if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) { return; } var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children); if (typeof child.props[eventName] === 'function') { child.props[eventName](event); } } }, { key: "createToggleIsOver", value: function createToggleIsOver(eventName, isDelayed) { var _this2 = this; return function (event) { // Preserve original child callback behavior _this2.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements, // firing on mouseenter but not mouseleave. Further, the default // behavior for disabled elements in some browsers is to ignore // mouse events. Don't bother trying to to handle them. // // See: https://github.com/facebook/react/issues/4251 if (event.currentTarget.disabled) { return; } // A focus event will occur as a result of a mouse click, but it // should be disambiguated between interacting with the button and // using an explicit focus shift as a cue to display the tooltip. if ('focus' === event.type && _this2.isInMouseDown) { return; } // Needed in case unsetting is over while delayed set pending, i.e. // quickly blur/mouseleave before delayedSetIsOver is called _this2.delayedSetIsOver.cancel(); var isOver = Object(lodash__WEBPACK_IMPORTED_MODULE_6__["includes"])(['focus', 'mouseenter'], event.type); if (isOver === _this2.state.isOver) { return; } if (isDelayed) { _this2.delayedSetIsOver(isOver); } else { _this2.setState({ isOver: isOver }); } }; } /** * Creates an event callback to handle assignment of the `isInMouseDown` * instance property in response to a `mousedown` or `mouseup` event. * * @param {boolean} isMouseDown Whether handler is to be created for the * `mousedown` event, as opposed to `mouseup`. * * @return {Function} Event callback handler. */ }, { key: "createSetIsMouseDown", value: function createSetIsMouseDown(isMouseDown) { var _this3 = this; return function (event) { // Preserve original child callback behavior _this3.emitToChild(isMouseDown ? 'onMouseDown' : 'onMouseUp', event); // On mouse down, the next `mouseup` should revert the value of the // instance property and remove its own event handler. The bind is // made on the document since the `mouseup` might not occur within // the bounds of the element. document[isMouseDown ? 'addEventListener' : 'removeEventListener']('mouseup', _this3.cancelIsMouseDown); _this3.isInMouseDown = isMouseDown; }; } }, { key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, position = _this$props.position, text = _this$props.text, shortcut = _this$props.shortcut; if (_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].count(children) !== 1) { if (false) {} return children; } var child = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Children"].only(children); var isOver = this.state.isOver; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["cloneElement"])(child, { onMouseEnter: this.createToggleIsOver('onMouseEnter', true), onMouseLeave: this.createToggleIsOver('onMouseLeave'), onClick: this.createToggleIsOver('onClick'), onFocus: this.createToggleIsOver('onFocus'), onBlur: this.createToggleIsOver('onBlur'), onMouseDown: this.createSetIsMouseDown(true), children: Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["concatChildren"])(child.props.children, isOver && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_popover__WEBPACK_IMPORTED_MODULE_7__[/* default */ "a"], { focusOnMount: false, position: position, className: "components-tooltip", "aria-hidden": "true", animate: false, noArrow: true }, text, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["createElement"])(_shortcut__WEBPACK_IMPORTED_MODULE_8__[/* default */ "a"], { className: "components-tooltip__shortcut", shortcut: shortcut }))) }); } }]); return Tooltip; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); /* harmony default export */ __webpack_exports__["a"] = (Tooltip); /***/ }), /* 85 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(150); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * WordPress dependencies */ /** * Internal dependencies */ function Icon(_ref) { var _ref$icon = _ref.icon, icon = _ref$icon === void 0 ? null : _ref$icon, size = _ref.size, additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_ref, ["icon", "size"]); if ('string' === typeof icon) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])({ icon: icon }, additionalProps)); } if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"] === icon.type) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({}, additionalProps)); } // Icons should be 24x24 by default. var iconSize = size || 24; if ('function' === typeof icon) { if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Component"]) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(icon, _objectSpread({ size: iconSize }, additionalProps)); } return icon(_objectSpread({ size: iconSize }, additionalProps)); } if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__["SVG"])) { var appliedProps = _objectSpread(_objectSpread({ width: iconSize, height: iconSize }, icon.props), additionalProps); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__["SVG"], appliedProps); } if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["isValidElement"])(icon)) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({ size: iconSize }, additionalProps)); } return icon; } /* harmony default export */ __webpack_exports__["a"] = (Icon); /***/ }), /* 86 */, /* 87 */, /* 88 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export Clickable */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useClickable; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(71); /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81); /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48); /* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54); /* harmony import */ var _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(74); function isNativeClick(event) { var element = event.currentTarget; if (!event.isTrusted) return false; // istanbul ignore next: can't test trusted events yet return Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_4__[/* isButton */ "a"])(element) || element.tagName === "INPUT" || element.tagName === "TEXTAREA" || element.tagName === "A" || element.tagName === "SELECT"; } var useClickable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ name: "Clickable", compose: _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_8__[/* useTabbable */ "a"], keys: ["unstable_clickOnEnter", "unstable_clickOnSpace"], useOptions: function useOptions(_ref) { var _ref$unstable_clickOn = _ref.unstable_clickOnEnter, unstable_clickOnEnter = _ref$unstable_clickOn === void 0 ? true : _ref$unstable_clickOn, _ref$unstable_clickOn2 = _ref.unstable_clickOnSpace, unstable_clickOnSpace = _ref$unstable_clickOn2 === void 0 ? true : _ref$unstable_clickOn2, options = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["unstable_clickOnEnter", "unstable_clickOnSpace"]); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ unstable_clickOnEnter: unstable_clickOnEnter, unstable_clickOnSpace: unstable_clickOnSpace }, options); }, useProps: function useProps(options, _ref2) { var htmlOnKeyDown = _ref2.onKeyDown, htmlOnKeyUp = _ref2.onKeyUp, htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["onKeyDown", "onKeyUp"]); var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(false), active = _React$useState[0], setActive = _React$useState[1]; var onKeyDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyDown); var onKeyUpRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyUp); var onKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { var _onKeyDownRef$current; (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); if (event.defaultPrevented) return; if (options.disabled) return; if (event.metaKey) return; if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return; var isEnter = options.unstable_clickOnEnter && event.key === "Enter"; var isSpace = options.unstable_clickOnSpace && event.key === " "; if (isEnter || isSpace) { if (isNativeClick(event)) return; event.preventDefault(); if (isEnter) { event.currentTarget.click(); } else if (isSpace) { setActive(true); } } }, [options.disabled, options.unstable_clickOnEnter, options.unstable_clickOnSpace]); var onKeyUp = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { var _onKeyUpRef$current; (_onKeyUpRef$current = onKeyUpRef.current) === null || _onKeyUpRef$current === void 0 ? void 0 : _onKeyUpRef$current.call(onKeyUpRef, event); if (event.defaultPrevented) return; if (options.disabled) return; if (event.metaKey) return; var isSpace = options.unstable_clickOnSpace && event.key === " "; if (active && isSpace) { setActive(false); event.currentTarget.click(); } }, [options.disabled, options.unstable_clickOnSpace, active]); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ "data-active": active || undefined, onKeyDown: onKeyDown, onKeyUp: onKeyUp }, htmlProps); } }); var Clickable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ as: "button", memo: true, useHook: useClickable }); /***/ }), /* 89 */ /***/ (function(module, exports, __webpack_require__) { module.exports = true ? __webpack_require__(379) : undefined; /***/ }), /* 90 */ /***/ (function(module, exports) { (function() { module.exports = this["wp"]["warning"]; }()); /***/ }), /* 91 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /** * WordPress dependencies */ var ToolbarContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(); /* harmony default export */ __webpack_exports__["a"] = (ToolbarContext); /***/ }), /* 92 */, /* 93 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ES5Type = __webpack_require__(340); // https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values module.exports = function Type(x) { if (typeof x === 'symbol') { return 'Symbol'; } return ES5Type(x); }; /***/ }), /* 94 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__(120); module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); /***/ }), /* 95 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var defineProperties = __webpack_require__(104); var implementation = __webpack_require__(239); var getPolyfill = __webpack_require__(240); var shim = __webpack_require__(376); var polyfill = getPolyfill(); defineProperties(polyfill, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = polyfill; /***/ }), /* 96 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export unstable_Id */ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_useId; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _IdProvider_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68); /* harmony import */ var _IdState_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65); var unstable_useId = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ useState: _IdState_js__WEBPACK_IMPORTED_MODULE_5__[/* unstable_useIdState */ "a"], keys: ["id"], useOptions: function useOptions(options, htmlProps) { var generateId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_IdProvider_js__WEBPACK_IMPORTED_MODULE_4__[/* unstable_IdContext */ "a"]); var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(function () { // This comes from useIdState if (options.unstable_idCountRef) { options.unstable_idCountRef.current += 1; return "-" + options.unstable_idCountRef.current; } // If there's no useIdState, we check if `baseId` was passed (as a prop, // not from useIdState). if (options.baseId) { return "-" + generateId(""); } return ""; }), suffix = _React$useState[0]; // `baseId` will be the prop passed directly as a prop or via useIdState. // If there's neither, then it'll fallback to Context's generateId. // This generateId can result in a sequential ID (if there's a Provider) // or a random string (without Provider). var baseId = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () { return options.baseId || generateId(); }, [options.baseId, generateId]); var id = htmlProps.id || options.id || "" + baseId + suffix; return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, { id: id }); }, useProps: function useProps(options, htmlProps) { return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ id: options.id }, htmlProps); } }); var unstable_Id = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ as: "div", useHook: unstable_useId }); /***/ }), /* 97 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return fireEvent; }); /* harmony import */ var _createEvent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(126); /** * Creates and dispatches `Event` in a way that also works on IE 11. * * @example * import { fireEvent } from "reakit-utils"; * * fireEvent(document.getElementById("id"), "blur", { * bubbles: true, * cancelable: true, * }); */ function fireEvent(element, type, eventInit) { return element.dispatchEvent(Object(_createEvent_js__WEBPACK_IMPORTED_MODULE_0__[/* createEvent */ "a"])(element, type, eventInit)); } /***/ }), /* 98 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isTextField; }); /** * Check whether the given element is a text field, where text field is defined * by the ability to select within the input, or that it is contenteditable. */ function isTextField(element) { try { var isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null; var isTextArea = element.tagName === "TEXTAREA"; var isContentEditable = element.contentEditable === "true"; return isTextInput || isTextArea || isContentEditable || false; } catch (error) { // Safari throws an exception when trying to get `selectionStart` // on non-text elements (which, understandably, don't // have the text selection API). We catch this via a try/catch // block, as opposed to a more explicit check of the element's // input types, because of Safari's non-standard behavior. This // also means we don't have to worry about the list of input // types that support `selectionStart` changing as the HTML spec // evolves over time. return false; } } /***/ }), /* 99 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return setTextFieldValue; }); function setTextFieldValue(element, value) { element.value = value; } /***/ }), /* 100 */, /* 101 */, /* 102 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(10); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WordPress dependencies */ /** * Input types which are classified as button types, for use in considering * whether element is a (focus-normalized) button. * * @type {string[]} */ var INPUT_BUTTON_TYPES = ['button', 'submit']; /** * Returns true if the given element is a button element subject to focus * normalization, or false otherwise. * * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus * * @param {Element} element Element to test. * * @return {boolean} Whether element is a button. */ function isFocusNormalizedButton(element) { switch (element.nodeName) { case 'A': case 'BUTTON': return true; case 'INPUT': return Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(INPUT_BUTTON_TYPES, element.type); } return false; } /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_9__["createHigherOrderComponent"])(function (WrappedComponent) { return /*#__PURE__*/function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(_class, _Component); var _super = _createSuper(_class); function _class() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(this, _class); _this = _super.apply(this, arguments); _this.bindNode = _this.bindNode.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this)); _this.cancelBlurCheck = _this.cancelBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this)); _this.queueBlurCheck = _this.queueBlurCheck.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this)); _this.normalizeButtonFocus = _this.normalizeButtonFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this)); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_class, [{ key: "componentWillUnmount", value: function componentWillUnmount() { this.cancelBlurCheck(); } }, { key: "bindNode", value: function bindNode(node) { if (node) { this.node = node; } else { delete this.node; this.cancelBlurCheck(); } } }, { key: "queueBlurCheck", value: function queueBlurCheck(event) { var _this2 = this; // React does not allow using an event reference asynchronously // due to recycling behavior, except when explicitly persisted. event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`. if (this.preventBlurCheck) { return; } this.blurCheckTimeout = setTimeout(function () { // If document is not focused then focus should remain // inside the wrapped component and therefore we cancel // this blur event thereby leaving focus in place. // https://developer.mozilla.org/en-US/docs/Web/API/Document/hasFocus. if (!document.hasFocus()) { event.preventDefault(); return; } if ('function' === typeof _this2.node.handleFocusOutside) { _this2.node.handleFocusOutside(event); } }, 0); } }, { key: "cancelBlurCheck", value: function cancelBlurCheck() { clearTimeout(this.blurCheckTimeout); } /** * Handles a mousedown or mouseup event to respectively assign and * unassign a flag for preventing blur check on button elements. Some * browsers, namely Firefox and Safari, do not emit a focus event on * button elements when clicked, while others do. The logic here * intends to normalize this as treating click on buttons as focus. * * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus * * @param {MouseEvent} event Event for mousedown or mouseup. */ }, { key: "normalizeButtonFocus", value: function normalizeButtonFocus(event) { var type = event.type, target = event.target; var isInteractionEnd = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["includes"])(['mouseup', 'touchend'], type); if (isInteractionEnd) { this.preventBlurCheck = false; } else if (isFocusNormalizedButton(target)) { this.preventBlurCheck = true; } } }, { key: "render", value: function render() { // Disable reason: See `normalizeButtonFocus` for browser-specific // focus event normalization. /* eslint-disable jsx-a11y/no-static-element-interactions */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { onFocus: this.cancelBlurCheck, onMouseDown: this.normalizeButtonFocus, onMouseUp: this.normalizeButtonFocus, onTouchStart: this.normalizeButtonFocus, onTouchEnd: this.normalizeButtonFocus, onBlur: this.queueBlurCheck }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(WrappedComponent, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ ref: this.bindNode }, this.props))); /* eslint-enable jsx-a11y/no-static-element-interactions */ } }]); return _class; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); }, 'withFocusOutside')); /***/ }), /* 103 */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /* 104 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var keys = __webpack_require__(187); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var origDefineProperty = Object.defineProperty; var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var arePropertyDescriptorsSupported = function () { var obj = {}; try { origDefineProperty(obj, 'x', { enumerable: false, value: obj }); // eslint-disable-next-line no-unused-vars, no-restricted-syntax for (var _ in obj) { // jscs:ignore disallowUnusedVariables return false; } return obj.x === obj; } catch (e) { /* this is IE 8. */ return false; } }; var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); var defineProperty = function (object, name, value, predicate) { if (name in object && (!isFunction(predicate) || !predicate())) { return; } if (supportsDescriptors) { origDefineProperty(object, name, { configurable: true, enumerable: false, value: value, writable: true }); } else { object[name] = value; } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }), /* 105 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ fireKeyboardEvent; }); // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getDocument.js var getDocument = __webpack_require__(49); // CONCATENATED MODULE: ./node_modules/reakit-utils/es/getDefaultView.js /** * Returns `element.ownerDocument.defaultView || window`. */ function getDefaultView(element) { return Object(getDocument["a" /* getDocument */])(element).defaultView || window; } // CONCATENATED MODULE: ./node_modules/reakit-utils/es/createKeyboardEvent.js /** * Creates a `KeyboardEvent` in a way that also works on IE 11. * * @example * import { createKeyboardEvent } from "reakit-utils"; * * const el = document.getElementById("id"); * el.dispatchEvent(createKeyboardEvent(el, "keydown", { key: "ArrowDown" })); */ function createKeyboardEvent(element, type, eventInit) { if (eventInit === void 0) { eventInit = {}; } if (typeof KeyboardEvent === "function") { return new KeyboardEvent(type, eventInit); } // IE 11 doesn't support Event constructors var event = Object(getDocument["a" /* getDocument */])(element).createEvent("KeyboardEvent"); event.initKeyboardEvent(type, eventInit.bubbles, eventInit.cancelable, getDefaultView(element), eventInit.key, eventInit.location, eventInit.ctrlKey, eventInit.altKey, eventInit.shiftKey, eventInit.metaKey); return event; } // CONCATENATED MODULE: ./node_modules/reakit-utils/es/fireKeyboardEvent.js /** * Creates and dispatches `KeyboardEvent` in a way that also works on IE 11. * * @example * import { fireKeyboardEvent } from "reakit-utils"; * * fireKeyboardEvent(document.getElementById("id"), "keydown", { * key: "ArrowDown", * shiftKey: true, * }); */ function fireKeyboardEvent(element, type, eventInit) { return element.dispatchEvent(createKeyboardEvent(element, type, eventInit)); } /***/ }), /* 106 */, /* 107 */, /* 108 */, /* 109 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export warning */ /** * Logs `messages` to the console using `console.warn` based on a `condition`. * * @example * import { warning } from "reakit-warning"; * * warning(true, "a", "b"); // console.warn("a", "\n", "b") * warning(false, "a", "b"); // does nothing */ function warning(condition) { if (false) { var warns, _len, messages, _key, _console; } } /***/ }), /* 110 */, /* 111 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var calendarLabel = 'Calendar'; var closeDatePicker = 'Close'; var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.'; var clearDate = 'Clear Date'; var clearDates = 'Clear Dates'; var jumpToPrevMonth = 'Move backward to switch to the previous month.'; var jumpToNextMonth = 'Move forward to switch to the next month.'; var keyboardShortcuts = 'Keyboard Shortcuts'; var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.'; var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.'; var openThisPanel = 'Open this panel.'; var enterKey = 'Enter key'; var leftArrowRightArrow = 'Right and left arrow keys'; var upArrowDownArrow = 'up and down arrow keys'; var pageUpPageDown = 'page up and page down keys'; var homeEnd = 'Home and end keys'; var escape = 'Escape key'; var questionMark = 'Question mark'; var selectFocusedDate = 'Select the date in focus.'; var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.'; var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.'; var moveFocusByOneMonth = 'Switch months.'; var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.'; var returnFocusToInput = 'Return to the date input field.'; var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.'; var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) { var date = _ref.date; return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.'; }; var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) { var date = _ref2.date; return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.'; }; var chooseAvailableDate = function chooseAvailableDate(_ref3) { var date = _ref3.date; return date; }; var dateIsUnavailable = function dateIsUnavailable(_ref4) { var date = _ref4.date; return 'Not available. ' + String(date); }; var dateIsSelected = function dateIsSelected(_ref5) { var date = _ref5.date; return 'Selected. ' + String(date); }; exports['default'] = { calendarLabel: calendarLabel, closeDatePicker: closeDatePicker, focusStartDate: focusStartDate, clearDate: clearDate, clearDates: clearDates, jumpToPrevMonth: jumpToPrevMonth, jumpToNextMonth: jumpToNextMonth, keyboardShortcuts: keyboardShortcuts, showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, openThisPanel: openThisPanel, enterKey: enterKey, leftArrowRightArrow: leftArrowRightArrow, upArrowDownArrow: upArrowDownArrow, pageUpPageDown: pageUpPageDown, homeEnd: homeEnd, escape: escape, questionMark: questionMark, selectFocusedDate: selectFocusedDate, moveFocusByOneDay: moveFocusByOneDay, moveFocusByOneWeek: moveFocusByOneWeek, moveFocusByOneMonth: moveFocusByOneMonth, moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, returnFocusToInput: returnFocusToInput, keyboardNavigationInstructions: keyboardNavigationInstructions, chooseAvailableStartDate: chooseAvailableStartDate, chooseAvailableEndDate: chooseAvailableEndDate, dateIsUnavailable: dateIsUnavailable, dateIsSelected: dateIsSelected }; var DateRangePickerPhrases = exports.DateRangePickerPhrases = { calendarLabel: calendarLabel, closeDatePicker: closeDatePicker, clearDates: clearDates, focusStartDate: focusStartDate, jumpToPrevMonth: jumpToPrevMonth, jumpToNextMonth: jumpToNextMonth, keyboardShortcuts: keyboardShortcuts, showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, openThisPanel: openThisPanel, enterKey: enterKey, leftArrowRightArrow: leftArrowRightArrow, upArrowDownArrow: upArrowDownArrow, pageUpPageDown: pageUpPageDown, homeEnd: homeEnd, escape: escape, questionMark: questionMark, selectFocusedDate: selectFocusedDate, moveFocusByOneDay: moveFocusByOneDay, moveFocusByOneWeek: moveFocusByOneWeek, moveFocusByOneMonth: moveFocusByOneMonth, moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, returnFocusToInput: returnFocusToInput, keyboardNavigationInstructions: keyboardNavigationInstructions, chooseAvailableStartDate: chooseAvailableStartDate, chooseAvailableEndDate: chooseAvailableEndDate, dateIsUnavailable: dateIsUnavailable, dateIsSelected: dateIsSelected }; var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = { focusStartDate: focusStartDate, clearDates: clearDates, keyboardNavigationInstructions: keyboardNavigationInstructions }; var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = { calendarLabel: calendarLabel, closeDatePicker: closeDatePicker, clearDate: clearDate, jumpToPrevMonth: jumpToPrevMonth, jumpToNextMonth: jumpToNextMonth, keyboardShortcuts: keyboardShortcuts, showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, openThisPanel: openThisPanel, enterKey: enterKey, leftArrowRightArrow: leftArrowRightArrow, upArrowDownArrow: upArrowDownArrow, pageUpPageDown: pageUpPageDown, homeEnd: homeEnd, escape: escape, questionMark: questionMark, selectFocusedDate: selectFocusedDate, moveFocusByOneDay: moveFocusByOneDay, moveFocusByOneWeek: moveFocusByOneWeek, moveFocusByOneMonth: moveFocusByOneMonth, moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, returnFocusToInput: returnFocusToInput, keyboardNavigationInstructions: keyboardNavigationInstructions, chooseAvailableDate: chooseAvailableDate, dateIsUnavailable: dateIsUnavailable, dateIsSelected: dateIsSelected }; var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = { clearDate: clearDate, keyboardNavigationInstructions: keyboardNavigationInstructions }; var DayPickerPhrases = exports.DayPickerPhrases = { calendarLabel: calendarLabel, jumpToPrevMonth: jumpToPrevMonth, jumpToNextMonth: jumpToNextMonth, keyboardShortcuts: keyboardShortcuts, showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, openThisPanel: openThisPanel, enterKey: enterKey, leftArrowRightArrow: leftArrowRightArrow, upArrowDownArrow: upArrowDownArrow, pageUpPageDown: pageUpPageDown, homeEnd: homeEnd, escape: escape, questionMark: questionMark, selectFocusedDate: selectFocusedDate, moveFocusByOneDay: moveFocusByOneDay, moveFocusByOneWeek: moveFocusByOneWeek, moveFocusByOneMonth: moveFocusByOneMonth, moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, returnFocusToInput: returnFocusToInput, chooseAvailableStartDate: chooseAvailableStartDate, chooseAvailableEndDate: chooseAvailableEndDate, chooseAvailableDate: chooseAvailableDate, dateIsUnavailable: dateIsUnavailable, dateIsSelected: dateIsSelected }; var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = { keyboardShortcuts: keyboardShortcuts, showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, openThisPanel: openThisPanel, enterKey: enterKey, leftArrowRightArrow: leftArrowRightArrow, upArrowDownArrow: upArrowDownArrow, pageUpPageDown: pageUpPageDown, homeEnd: homeEnd, escape: escape, questionMark: questionMark, selectFocusedDate: selectFocusedDate, moveFocusByOneDay: moveFocusByOneDay, moveFocusByOneWeek: moveFocusByOneWeek, moveFocusByOneMonth: moveFocusByOneMonth, moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, returnFocusToInput: returnFocusToInput }; var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = { jumpToPrevMonth: jumpToPrevMonth, jumpToNextMonth: jumpToNextMonth }; var CalendarDayPhrases = exports.CalendarDayPhrases = { chooseAvailableDate: chooseAvailableDate, dateIsUnavailable: dateIsUnavailable, dateIsSelected: dateIsSelected }; /***/ }), /* 112 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = getPhrasePropTypes; var _object = __webpack_require__(95); var _object2 = _interopRequireDefault(_object); var _propTypes = __webpack_require__(28); var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function getPhrasePropTypes(defaultPhrases) { return Object.keys(defaultPhrases).reduce(function (phrases, key) { return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node]))); }, {}); } /***/ }), /* 113 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.withStylesPropTypes = exports.css = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); exports.withStyles = withStyles; var _object = __webpack_require__(95); var _object2 = _interopRequireDefault(_object); var _react = __webpack_require__(13); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(28); var _propTypes2 = _interopRequireDefault(_propTypes); var _hoistNonReactStatics = __webpack_require__(393); var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics); var _constants = __webpack_require__(396); var _brcast = __webpack_require__(397); var _brcast2 = _interopRequireDefault(_brcast); var _ThemedStyleSheet = __webpack_require__(237); var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* eslint react/forbid-foreign-prop-types: off */ // Add some named exports to assist in upgrading and for convenience var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR; var withStylesPropTypes = exports.withStylesPropTypes = { styles: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types theme: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types css: _propTypes2['default'].func.isRequired }; var EMPTY_STYLES = {}; var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() { return EMPTY_STYLES; }; var START_MARK = 'react-with-styles.createStyles.start'; var END_MARK = 'react-with-styles.createStyles.end'; function baseClass(pureComponent) { if (pureComponent) { if (!_react2['default'].PureComponent) { throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later'); } return _react2['default'].PureComponent; } return _react2['default'].Component; } var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']); var defaultDirection = _constants.DIRECTIONS.LTR; function withStyles(styleFn) { var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, _ref$stylesPropName = _ref.stylesPropName, stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName, _ref$themePropName = _ref.themePropName, themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName, _ref$cssPropName = _ref.cssPropName, cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName, _ref$flushBefore = _ref.flushBefore, flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore, _ref$pureComponent = _ref.pureComponent, pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent; var styleDefLTR = void 0; var styleDefRTL = void 0; var currentThemeLTR = void 0; var currentThemeRTL = void 0; var BaseClass = baseClass(pureComponent); function getResolveMethod(direction) { return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL; } function getCurrentTheme(direction) { return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL; } function getStyleDef(direction, wrappedComponentName) { var currentTheme = getCurrentTheme(direction); var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL; var registeredTheme = _ThemedStyleSheet2['default'].get(); // Return the existing styles if they've already been defined // and if the theme used to create them corresponds to the theme // registered with ThemedStyleSheet if (styleDef && currentTheme === registeredTheme) { return styleDef; } if (false) {} var isRTL = direction === _constants.DIRECTIONS.RTL; if (isRTL) { styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN; currentThemeRTL = registeredTheme; styleDef = styleDefRTL; } else { styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN; currentThemeLTR = registeredTheme; styleDef = styleDefLTR; } if (false) { var measureName; } return styleDef; } function getState(direction, wrappedComponentName) { return { resolveMethod: getResolveMethod(direction), styleDef: getStyleDef(direction, wrappedComponentName) }; } return function () { function withStylesHOC(WrappedComponent) { var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; // NOTE: Use a class here so components are ref-able if need be: // eslint-disable-next-line react/prefer-stateless-function var WithStyles = function (_BaseClass) { _inherits(WithStyles, _BaseClass); function WithStyles(props, context) { _classCallCheck(this, WithStyles); var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context)); var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection; _this.state = getState(direction, wrappedComponentName); return _this; } _createClass(WithStyles, [{ key: 'componentDidMount', value: function () { function componentDidMount() { var _this2 = this; if (this.context[_constants.CHANNEL]) { // subscribe to future direction changes this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) { _this2.setState(getState(direction, wrappedComponentName)); }); } } return componentDidMount; }() }, { key: 'componentWillUnmount', value: function () { function componentWillUnmount() { if (this.channelUnsubscribe) { this.channelUnsubscribe(); } } return componentWillUnmount; }() }, { key: 'render', value: function () { function render() { var _ref2; // As some components will depend on previous styles in // the component tree, we provide the option of flushing the // buffered styles (i.e. to a style tag) **before** the rendering // cycle begins. // // The interfaces provide the optional "flush" method which // is run in turn by ThemedStyleSheet.flush. if (flushBefore) { _ThemedStyleSheet2['default'].flush(); } var _state = this.state, resolveMethod = _state.resolveMethod, styleDef = _state.styleDef; return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2))); } return render; }() }]); return WithStyles; }(BaseClass); WithStyles.WrappedComponent = WrappedComponent; WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')'; WithStyles.contextTypes = contextTypes; if (WrappedComponent.propTypes) { WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes); delete WithStyles.propTypes[stylesPropName]; delete WithStyles.propTypes[themePropName]; delete WithStyles.propTypes[cssPropName]; } if (WrappedComponent.defaultProps) { WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps); } return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent); } return withStylesHOC; }(); } /***/ }), /* 114 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(8); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules var slicedToArray = __webpack_require__(12); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(14); // EXTERNAL MODULE: external {"this":["wp","element"]} var external_this_wp_element_ = __webpack_require__(0); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__(9); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: external {"this":["wp","dom"]} var external_this_wp_dom_ = __webpack_require__(29); // EXTERNAL MODULE: external {"this":["wp","keycodes"]} var external_this_wp_keycodes_ = __webpack_require__(18); // EXTERNAL MODULE: external {"this":["wp","deprecated"]} var external_this_wp_deprecated_ = __webpack_require__(36); var external_this_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_deprecated_); // EXTERNAL MODULE: external {"this":["wp","compose"]} var external_this_wp_compose_ = __webpack_require__(10); // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js var library_close = __webpack_require__(160); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__(5); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * WordPress dependencies */ /** * Module constants */ var HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space /** * Utility used to compute the popover position over the xAxis * * @param {Object} anchorRect Anchor Rect. * @param {Object} contentSize Content Size. * @param {string} xAxis Desired xAxis. * @param {string} corner Desired corner. * @param {boolean} sticky Whether or not to stick the popover to the * scroll container edge when part of the anchor * leaves view. * @param {string} chosenYAxis yAxis to be used. * @param {Element} boundaryElement Boundary element. * * @return {Object} Popover xAxis position and constraints. */ function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sticky, chosenYAxis, boundaryElement) { var width = contentSize.width; var isRTL = document.documentElement.dir === 'rtl'; // Correct xAxis for RTL support if (xAxis === 'left' && isRTL) { xAxis = 'right'; } else if (xAxis === 'right' && isRTL) { xAxis = 'left'; } if (corner === 'left' && isRTL) { corner = 'right'; } else if (corner === 'right' && isRTL) { corner = 'left'; } // x axis alignment choices var anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2); var centerAlignment = { popoverLeft: anchorMidPoint, contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2) }; var leftAlignmentX = anchorRect.left; if (corner === 'right') { leftAlignmentX = anchorRect.right; } else if (chosenYAxis !== 'middle') { leftAlignmentX = anchorMidPoint; } var rightAlignmentX = anchorRect.right; if (corner === 'left') { rightAlignmentX = anchorRect.left; } else if (chosenYAxis !== 'middle') { rightAlignmentX = anchorMidPoint; } var leftAlignment = { popoverLeft: leftAlignmentX, contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX }; var rightAlignment = { popoverLeft: rightAlignmentX, contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width }; // Choosing the x axis var chosenXAxis = xAxis; var contentWidth = null; if (!sticky) { if (xAxis === 'center' && centerAlignment.contentWidth === width) { chosenXAxis = 'center'; } else if (xAxis === 'left' && leftAlignment.contentWidth === width) { chosenXAxis = 'left'; } else if (xAxis === 'right' && rightAlignment.contentWidth === width) { chosenXAxis = 'right'; } else { chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right'; var chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; contentWidth = chosenWidth !== width ? chosenWidth : null; } } var popoverLeft; if (chosenXAxis === 'center') { popoverLeft = centerAlignment.popoverLeft; } else if (chosenXAxis === 'left') { popoverLeft = leftAlignment.popoverLeft; } else { popoverLeft = rightAlignment.popoverLeft; } if (boundaryElement) { var boundaryRect = boundaryElement.getBoundingClientRect(); popoverLeft = Math.min(popoverLeft, boundaryRect.right - width); } return { xAxis: chosenXAxis, popoverLeft: popoverLeft, contentWidth: contentWidth }; } /** * Utility used to compute the popover position over the yAxis * * @param {Object} anchorRect Anchor Rect. * @param {Object} contentSize Content Size. * @param {string} yAxis Desired yAxis. * @param {string} corner Desired corner. * @param {boolean} sticky Whether or not to stick the popover to the * scroll container edge when part of the * anchor leaves view. * @param {Element} anchorRef The anchor element. * @param {Element} relativeOffsetTop If applicable, top offset of the relative * positioned parent container. * * @return {Object} Popover xAxis position and constraints. */ function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sticky, anchorRef, relativeOffsetTop) { var height = contentSize.height; if (sticky) { var scrollContainerEl = Object(external_this_wp_dom_["getScrollContainer"])(anchorRef) || document.body; var scrollRect = scrollContainerEl.getBoundingClientRect(); var stickyPosition = scrollRect.top + height - relativeOffsetTop; if (anchorRect.top <= stickyPosition) { return { yAxis: yAxis, popoverTop: Math.min(anchorRect.bottom, stickyPosition) }; } } // y axis alignment choices var anchorMidPoint = anchorRect.top + anchorRect.height / 2; if (corner === 'bottom') { anchorMidPoint = anchorRect.bottom; } else if (corner === 'top') { anchorMidPoint = anchorRect.top; } var middleAlignment = { popoverTop: anchorMidPoint, contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2) }; var topAlignment = { popoverTop: anchorRect.top, contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET }; var bottomAlignment = { popoverTop: anchorRect.bottom, contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height }; // Choosing the y axis var chosenYAxis = yAxis; var contentHeight = null; if (!sticky) { if (yAxis === 'middle' && middleAlignment.contentHeight === height) { chosenYAxis = 'middle'; } else if (yAxis === 'top' && topAlignment.contentHeight === height) { chosenYAxis = 'top'; } else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) { chosenYAxis = 'bottom'; } else { chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom'; var chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight; contentHeight = chosenHeight !== height ? chosenHeight : null; } } var popoverTop; if (chosenYAxis === 'middle') { popoverTop = middleAlignment.popoverTop; } else if (chosenYAxis === 'top') { popoverTop = topAlignment.popoverTop; } else { popoverTop = bottomAlignment.popoverTop; } return { yAxis: chosenYAxis, popoverTop: popoverTop, contentHeight: contentHeight }; } /** * Utility used to compute the popover position and the content max width/height * for a popover given its anchor rect and its content size. * * @param {Object} anchorRect Anchor Rect. * @param {Object} contentSize Content Size. * @param {string} position Position. * @param {boolean} sticky Whether or not to stick the popover to the * scroll container edge when part of the * anchor leaves view. * @param {Element} anchorRef The anchor element. * @param {number} relativeOffsetTop If applicable, top offset of the relative * positioned parent container. * @param {Element} boundaryElement Boundary element. * * @return {Object} Popover position and constraints. */ function computePopoverPosition(anchorRect, contentSize) { var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top'; var sticky = arguments.length > 3 ? arguments[3] : undefined; var anchorRef = arguments.length > 4 ? arguments[4] : undefined; var relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined; var boundaryElement = arguments.length > 6 ? arguments[6] : undefined; var _position$split = position.split(' '), _position$split2 = Object(slicedToArray["a" /* default */])(_position$split, 3), yAxis = _position$split2[0], _position$split2$ = _position$split2[1], xAxis = _position$split2$ === void 0 ? 'center' : _position$split2$, corner = _position$split2[2]; var yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, sticky, anchorRef, relativeOffsetTop); var xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, sticky, yAxisPosition.yAxis, boundaryElement); return _objectSpread(_objectSpread({}, xAxisPosition), yAxisPosition); } // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-return/index.js var with_focus_return = __webpack_require__(135); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-constrained-tabbing/index.js var with_constrained_tabbing = __webpack_require__(134); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js var classCallCheck = __webpack_require__(21); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js var createClass = __webpack_require__(22); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules var inherits = __webpack_require__(23); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js var possibleConstructorReturn = __webpack_require__(24); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js var getPrototypeOf = __webpack_require__(19); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-focus-outside/index.js var with_focus_outside = __webpack_require__(102); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/detect-outside.js function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * WordPress dependencies */ /** * Internal dependencies */ var detect_outside_PopoverDetectOutside = /*#__PURE__*/function (_Component) { Object(inherits["a" /* default */])(PopoverDetectOutside, _Component); var _super = _createSuper(PopoverDetectOutside); function PopoverDetectOutside() { Object(classCallCheck["a" /* default */])(this, PopoverDetectOutside); return _super.apply(this, arguments); } Object(createClass["a" /* default */])(PopoverDetectOutside, [{ key: "handleFocusOutside", value: function handleFocusOutside(event) { this.props.onFocusOutside(event); } }, { key: "render", value: function render() { return this.props.children; } }]); return PopoverDetectOutside; }(external_this_wp_element_["Component"]); /* harmony default export */ var detect_outside = (Object(with_focus_outside["a" /* default */])(detect_outside_PopoverDetectOutside)); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js var build_module_button = __webpack_require__(35); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js var scroll_lock = __webpack_require__(166); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/isolated-event-container/index.js var isolated_event_container = __webpack_require__(136); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js var use_slot = __webpack_require__(165); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 6 modules var slot_fill = __webpack_require__(125); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js var build_module_animate = __webpack_require__(124); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var FocusManaged = Object(with_constrained_tabbing["a" /* default */])(Object(with_focus_return["a" /* default */])(function (_ref) { var children = _ref.children; return children; })); /** * Name of slot in which popover should fill. * * @type {string} */ var SLOT_NAME = 'Popover'; function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) { var anchorRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; var shouldAnchorIncludePadding = arguments.length > 4 ? arguments[4] : undefined; if (anchorRect) { return anchorRect; } if (getAnchorRect) { if (!anchorRefFallback.current) { return; } return getAnchorRect(anchorRefFallback.current); } if (anchorRef !== false) { if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) { return; } if (anchorRef instanceof window.Range) { return Object(external_this_wp_dom_["getRectangleFromRange"])(anchorRef); } if (anchorRef instanceof window.Element) { var _rect2 = anchorRef.getBoundingClientRect(); if (shouldAnchorIncludePadding) { return _rect2; } return withoutPadding(_rect2, anchorRef); } var top = anchorRef.top, bottom = anchorRef.bottom; var topRect = top.getBoundingClientRect(); var bottomRect = bottom.getBoundingClientRect(); var _rect = new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top); if (shouldAnchorIncludePadding) { return _rect; } return withoutPadding(_rect, anchorRef); } if (!anchorRefFallback.current) { return; } var parentNode = anchorRefFallback.current.parentNode; var rect = parentNode.getBoundingClientRect(); if (shouldAnchorIncludePadding) { return rect; } return withoutPadding(rect, parentNode); } function getComputedStyle(node) { return node.ownerDocument.defaultView.getComputedStyle(node); } function withoutPadding(rect, element) { var _getComputedStyle = getComputedStyle(element), paddingTop = _getComputedStyle.paddingTop, paddingBottom = _getComputedStyle.paddingBottom, paddingLeft = _getComputedStyle.paddingLeft, paddingRight = _getComputedStyle.paddingRight; var top = paddingTop ? parseInt(paddingTop, 10) : 0; var bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0; var left = paddingLeft ? parseInt(paddingLeft, 10) : 0; var right = paddingRight ? parseInt(paddingRight, 10) : 0; return { x: rect.left + left, y: rect.top + top, width: rect.width - left - right, height: rect.height - top - bottom, left: rect.left + left, right: rect.right - right, top: rect.top + top, bottom: rect.bottom - bottom }; } /** * Hook used to focus the first tabbable element on mount. * * @param {boolean|string} focusOnMount Focus on mount mode. * @param {Object} contentRef Reference to the popover content element. */ function useFocusContentOnMount(focusOnMount, contentRef) { // Focus handling Object(external_this_wp_element_["useEffect"])(function () { /* * Without the setTimeout, the dom node is not being focused. Related: * https://stackoverflow.com/questions/35522220/react-ref-with-focus-doesnt-work-without-settimeout-my-example * * TODO: Treat the cause, not the symptom. */ var focusTimeout = setTimeout(function () { if (!focusOnMount || !contentRef.current) { return; } if (focusOnMount === 'firstElement') { // Find first tabbable node within content and shift focus, falling // back to the popover panel itself. var firstTabbable = external_this_wp_dom_["focus"].tabbable.find(contentRef.current)[0]; if (firstTabbable) { firstTabbable.focus(); } else { contentRef.current.focus(); } return; } if (focusOnMount === 'container') { // Focus the popover panel itself so items in the popover are easily // accessed via keyboard navigation. contentRef.current.focus(); } }, 0); return function () { return clearTimeout(focusTimeout); }; }, []); } /** * Sets or removes an element attribute. * * @param {Element} element The element to modify. * @param {string} name The attribute name to set or remove. * @param {?string} value The value to set. A falsy value will remove the * attribute. */ function setAttribute(element, name, value) { if (!value) { if (element.hasAttribute(name)) { element.removeAttribute(name); } } else if (element.getAttribute(name) !== value) { element.setAttribute(name, value); } } /** * Sets or removes an element style property. * * @param {Element} element The element to modify. * @param {string} property The property to set or remove. * @param {?string} value The value to set. A falsy value will remove the * property. */ function setStyle(element, property) { var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; if (element.style[property] !== value) { element.style[property] = value; } } /** * Sets or removes an element class. * * @param {Element} element The element to modify. * @param {string} name The class to set or remove. * @param {boolean} toggle True to set the class, false to remove. */ function setClass(element, name, toggle) { if (toggle) { if (!element.classList.contains(name)) { element.classList.add(name); } } else if (element.classList.contains(name)) { element.classList.remove(name); } } var popover_Popover = function Popover(_ref2) { var headerTitle = _ref2.headerTitle, onClose = _ref2.onClose, onKeyDown = _ref2.onKeyDown, children = _ref2.children, className = _ref2.className, _ref2$noArrow = _ref2.noArrow, noArrow = _ref2$noArrow === void 0 ? true : _ref2$noArrow, isAlternate = _ref2.isAlternate, _ref2$position = _ref2.position, position = _ref2$position === void 0 ? 'bottom right' : _ref2$position, range = _ref2.range, _ref2$focusOnMount = _ref2.focusOnMount, focusOnMount = _ref2$focusOnMount === void 0 ? 'firstElement' : _ref2$focusOnMount, anchorRef = _ref2.anchorRef, shouldAnchorIncludePadding = _ref2.shouldAnchorIncludePadding, anchorRect = _ref2.anchorRect, getAnchorRect = _ref2.getAnchorRect, expandOnMobile = _ref2.expandOnMobile, _ref2$animate = _ref2.animate, animate = _ref2$animate === void 0 ? true : _ref2$animate, onClickOutside = _ref2.onClickOutside, onFocusOutside = _ref2.onFocusOutside, __unstableSticky = _ref2.__unstableSticky, _ref2$__unstableSlotN = _ref2.__unstableSlotName, __unstableSlotName = _ref2$__unstableSlotN === void 0 ? SLOT_NAME : _ref2$__unstableSlotN, __unstableObserveElement = _ref2.__unstableObserveElement, __unstableBoundaryParent = _ref2.__unstableBoundaryParent, contentProps = Object(objectWithoutProperties["a" /* default */])(_ref2, ["headerTitle", "onClose", "onKeyDown", "children", "className", "noArrow", "isAlternate", "position", "range", "focusOnMount", "anchorRef", "shouldAnchorIncludePadding", "anchorRect", "getAnchorRect", "expandOnMobile", "animate", "onClickOutside", "onFocusOutside", "__unstableSticky", "__unstableSlotName", "__unstableObserveElement", "__unstableBoundaryParent"]); var anchorRefFallback = Object(external_this_wp_element_["useRef"])(null); var contentRef = Object(external_this_wp_element_["useRef"])(null); var containerRef = Object(external_this_wp_element_["useRef"])(); var isMobileViewport = Object(external_this_wp_compose_["useViewportMatch"])('medium', '<'); var _useState = Object(external_this_wp_element_["useState"])(), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), animateOrigin = _useState2[0], setAnimateOrigin = _useState2[1]; var slot = Object(use_slot["a" /* default */])(__unstableSlotName); var isExpanded = expandOnMobile && isMobileViewport; var _useResizeObserver = Object(external_this_wp_compose_["useResizeObserver"])(), _useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2), containerResizeListener = _useResizeObserver2[0], contentSize = _useResizeObserver2[1]; noArrow = isExpanded || noArrow; Object(external_this_wp_element_["useLayoutEffect"])(function () { if (isExpanded) { setClass(containerRef.current, 'is-without-arrow', noArrow); setClass(containerRef.current, 'is-alternate', isAlternate); setAttribute(containerRef.current, 'data-x-axis'); setAttribute(containerRef.current, 'data-y-axis'); setStyle(containerRef.current, 'top'); setStyle(containerRef.current, 'left'); setStyle(contentRef.current, 'maxHeight'); setStyle(contentRef.current, 'maxWidth'); return; } var refresh = function refresh() { if (!containerRef.current || !contentRef.current) { return; } var anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding); if (!anchor) { return; } var _containerRef$current = containerRef.current, offsetParent = _containerRef$current.offsetParent, ownerDocument = _containerRef$current.ownerDocument; var relativeOffsetTop = 0; // If there is a positioned ancestor element that is not the body, // subtract the position from the anchor rect. If the position of // the popover is fixed, the offset parent is null or the body // element, in which case the position is relative to the viewport. // See https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/offsetParent if (offsetParent && offsetParent !== ownerDocument.body) { var offsetParentRect = offsetParent.getBoundingClientRect(); relativeOffsetTop = offsetParentRect.top; anchor = new window.DOMRect(anchor.left - offsetParentRect.left, anchor.top - offsetParentRect.top, anchor.width, anchor.height); } var boundaryElement; if (__unstableBoundaryParent) { var _containerRef$current2; boundaryElement = (_containerRef$current2 = containerRef.current.closest('.popover-slot')) === null || _containerRef$current2 === void 0 ? void 0 : _containerRef$current2.parentNode; } var usedContentSize = !contentSize.height ? contentRef.current.getBoundingClientRect() : contentSize; var _computePopoverPositi = computePopoverPosition(anchor, usedContentSize, position, __unstableSticky, containerRef.current, relativeOffsetTop, boundaryElement), popoverTop = _computePopoverPositi.popoverTop, popoverLeft = _computePopoverPositi.popoverLeft, xAxis = _computePopoverPositi.xAxis, yAxis = _computePopoverPositi.yAxis, contentHeight = _computePopoverPositi.contentHeight, contentWidth = _computePopoverPositi.contentWidth; if (typeof popoverTop === 'number' && typeof popoverLeft === 'number') { setStyle(containerRef.current, 'top', popoverTop + 'px'); setStyle(containerRef.current, 'left', popoverLeft + 'px'); } setClass(containerRef.current, 'is-without-arrow', noArrow || xAxis === 'center' && yAxis === 'middle'); setClass(containerRef.current, 'is-alternate', isAlternate); setAttribute(containerRef.current, 'data-x-axis', xAxis); setAttribute(containerRef.current, 'data-y-axis', yAxis); setStyle(contentRef.current, 'maxHeight', typeof contentHeight === 'number' ? contentHeight + 'px' : ''); setStyle(contentRef.current, 'maxWidth', typeof contentWidth === 'number' ? contentWidth + 'px' : ''); // Compute the animation position var yAxisMapping = { top: 'bottom', bottom: 'top' }; var xAxisMapping = { left: 'right', right: 'left' }; var animateYAxis = yAxisMapping[yAxis] || 'middle'; var animateXAxis = xAxisMapping[xAxis] || 'center'; setAnimateOrigin(animateXAxis + ' ' + animateYAxis); }; refresh(); /* * There are sometimes we need to reposition or resize the popover that * are not handled by the resize/scroll window events (i.e. CSS changes * in the layout that changes the position of the anchor). * * For these situations, we refresh the popover every 0.5s */ var intervalHandle = window.setInterval(refresh, 500); var rafId; var refreshOnAnimationFrame = function refreshOnAnimationFrame() { window.cancelAnimationFrame(rafId); rafId = window.requestAnimationFrame(refresh); }; // Sometimes a click trigger a layout change that affects the popover // position. This is an opportunity to immediately refresh rather than // at the interval. window.addEventListener('click', refreshOnAnimationFrame); window.addEventListener('resize', refresh); window.addEventListener('scroll', refresh, true); var observer; if (__unstableObserveElement) { observer = new window.MutationObserver(refresh); observer.observe(__unstableObserveElement, { attributes: true }); } return function () { window.clearInterval(intervalHandle); window.removeEventListener('resize', refresh); window.removeEventListener('scroll', refresh, true); window.removeEventListener('click', refreshOnAnimationFrame); window.cancelAnimationFrame(rafId); if (observer) { observer.disconnect(); } }; }, [isExpanded, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding, position, contentSize, __unstableSticky, __unstableObserveElement, __unstableBoundaryParent]); useFocusContentOnMount(focusOnMount, contentRef); // Event handlers var maybeClose = function maybeClose(event) { // Close on escape if (event.keyCode === external_this_wp_keycodes_["ESCAPE"] && onClose) { event.stopPropagation(); onClose(); } // Preserve original content prop behavior if (onKeyDown) { onKeyDown(event); } }; /** * Shims an onFocusOutside callback to be compatible with a deprecated * onClickOutside prop function, if provided. * * @param {FocusEvent} event Focus event from onFocusOutside. */ function handleOnFocusOutside(event) { // Defer to given `onFocusOutside` if specified. Call `onClose` only if // both `onFocusOutside` and `onClickOutside` are unspecified. Doing so // assures backwards-compatibility for prior `onClickOutside` default. if (onFocusOutside) { onFocusOutside(event); return; } else if (!onClickOutside) { if (onClose) { onClose(); } return; } // Simulate MouseEvent using FocusEvent#relatedTarget as emulated click // target. MouseEvent constructor is unsupported in Internet Explorer. var clickEvent; try { clickEvent = new window.MouseEvent('click'); } catch (error) { clickEvent = document.createEvent('MouseEvent'); clickEvent.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); } Object.defineProperty(clickEvent, 'target', { get: function get() { return event.relatedTarget; } }); external_this_wp_deprecated_default()('Popover onClickOutside prop', { alternative: 'onFocusOutside' }); onClickOutside(clickEvent); } // Disable reason: We care to capture the _bubbled_ events from inputs // within popover as inferring close intent. var content = Object(external_this_wp_element_["createElement"])(detect_outside, { onFocusOutside: handleOnFocusOutside }, Object(external_this_wp_element_["createElement"])(build_module_animate["a" /* default */], { type: animate && animateOrigin ? 'appear' : null, options: { origin: animateOrigin } }, function (_ref3) { var animateClassName = _ref3.className; return Object(external_this_wp_element_["createElement"])(isolated_event_container["a" /* default */], Object(esm_extends["a" /* default */])({ className: classnames_default()('components-popover', className, animateClassName, { 'is-expanded': isExpanded, 'is-without-arrow': noArrow, 'is-alternate': isAlternate }) }, contentProps, { onKeyDown: maybeClose, ref: containerRef }), isExpanded && Object(external_this_wp_element_["createElement"])(scroll_lock["a" /* default */], null), isExpanded && Object(external_this_wp_element_["createElement"])("div", { className: "components-popover__header" }, Object(external_this_wp_element_["createElement"])("span", { className: "components-popover__header-title" }, headerTitle), Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { className: "components-popover__close", icon: library_close["a" /* default */], onClick: onClose })), Object(external_this_wp_element_["createElement"])("div", { ref: contentRef, className: "components-popover__content", tabIndex: "-1" }, Object(external_this_wp_element_["createElement"])("div", { style: { position: 'relative' } }, containerResizeListener, children))); })); // Apply focus to element as long as focusOnMount is truthy; false is // the only "disabled" value. if (focusOnMount) { content = Object(external_this_wp_element_["createElement"])(FocusManaged, null, content); } if (slot.ref) { content = Object(external_this_wp_element_["createElement"])(slot_fill["a" /* Fill */], { name: __unstableSlotName }, content); } if (anchorRef || anchorRect) { return content; } return Object(external_this_wp_element_["createElement"])("span", { ref: anchorRefFallback }, content); }; var PopoverContainer = popover_Popover; PopoverContainer.Slot = function (_ref4) { var _ref4$name = _ref4.name, name = _ref4$name === void 0 ? SLOT_NAME : _ref4$name; return Object(external_this_wp_element_["createElement"])(slot_fill["b" /* Slot */], { bubblesVirtually: true, name: name, className: "popover-slot" }); }; /* harmony default export */ var popover = __webpack_exports__["a"] = (PopoverContainer); /***/ }), /* 115 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, '__esModule', { value: true }); function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } var _extends = _interopDefault(__webpack_require__(177)); var _objectWithoutPropertiesLoose = _interopDefault(__webpack_require__(178)); var React = __webpack_require__(13); var React__default = _interopDefault(React); var _inheritsLoose = _interopDefault(__webpack_require__(158)); var _assertThisInitialized = _interopDefault(__webpack_require__(179)); var is = { arr: Array.isArray, obj: function obj(a) { return Object.prototype.toString.call(a) === '[object Object]'; }, fun: function fun(a) { return typeof a === 'function'; }, str: function str(a) { return typeof a === 'string'; }, num: function num(a) { return typeof a === 'number'; }, und: function und(a) { return a === void 0; }, nul: function nul(a) { return a === null; }, set: function set(a) { return a instanceof Set; }, map: function map(a) { return a instanceof Map; }, equ: function equ(a, b) { if (typeof a !== typeof b) return false; if (is.str(a) || is.num(a)) return a === b; if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true; var i; for (i in a) { if (!(i in b)) return false; } for (i in b) { if (a[i] !== b[i]) return false; } return is.und(i) ? a === b : true; } }; function merge(target, lowercase) { if (lowercase === void 0) { lowercase = true; } return function (object) { return (is.arr(object) ? object : Object.keys(object)).reduce(function (acc, element) { var key = lowercase ? element[0].toLowerCase() + element.substring(1) : element; acc[key] = target(key); return acc; }, target); }; } function useForceUpdate() { var _useState = React.useState(false), f = _useState[1]; var forceUpdate = React.useCallback(function () { return f(function (v) { return !v; }); }, []); return forceUpdate; } function withDefault(value, defaultValue) { return is.und(value) || is.nul(value) ? defaultValue : value; } function toArray(a) { return !is.und(a) ? is.arr(a) ? a : [a] : []; } function callProp(obj) { for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { args[_key - 1] = arguments[_key]; } return is.fun(obj) ? obj.apply(void 0, args) : obj; } function getForwardProps(props) { var to = props.to, from = props.from, config = props.config, onStart = props.onStart, onRest = props.onRest, onFrame = props.onFrame, children = props.children, reset = props.reset, reverse = props.reverse, force = props.force, immediate = props.immediate, delay = props.delay, attach = props.attach, destroyed = props.destroyed, interpolateTo = props.interpolateTo, ref = props.ref, lazy = props.lazy, forward = _objectWithoutPropertiesLoose(props, ["to", "from", "config", "onStart", "onRest", "onFrame", "children", "reset", "reverse", "force", "immediate", "delay", "attach", "destroyed", "interpolateTo", "ref", "lazy"]); return forward; } function interpolateTo(props) { var forward = getForwardProps(props); if (is.und(forward)) return _extends({ to: forward }, props); var rest = Object.keys(props).reduce(function (a, k) { var _extends2; return !is.und(forward[k]) ? a : _extends({}, a, (_extends2 = {}, _extends2[k] = props[k], _extends2)); }, {}); return _extends({ to: forward }, rest); } function handleRef(ref, forward) { if (forward) { // If it's a function, assume it's a ref callback if (is.fun(forward)) forward(ref);else if (is.obj(forward)) { forward.current = ref; } } return ref; } var Animated = /*#__PURE__*/ function () { function Animated() { this.payload = void 0; this.children = []; } var _proto = Animated.prototype; _proto.getAnimatedValue = function getAnimatedValue() { return this.getValue(); }; _proto.getPayload = function getPayload() { return this.payload || this; }; _proto.attach = function attach() {}; _proto.detach = function detach() {}; _proto.getChildren = function getChildren() { return this.children; }; _proto.addChild = function addChild(child) { if (this.children.length === 0) this.attach(); this.children.push(child); }; _proto.removeChild = function removeChild(child) { var index = this.children.indexOf(child); this.children.splice(index, 1); if (this.children.length === 0) this.detach(); }; return Animated; }(); var AnimatedArray = /*#__PURE__*/ function (_Animated) { _inheritsLoose(AnimatedArray, _Animated); function AnimatedArray() { var _this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } _this = _Animated.call.apply(_Animated, [this].concat(args)) || this; _this.payload = []; _this.attach = function () { return _this.payload.forEach(function (p) { return p instanceof Animated && p.addChild(_assertThisInitialized(_this)); }); }; _this.detach = function () { return _this.payload.forEach(function (p) { return p instanceof Animated && p.removeChild(_assertThisInitialized(_this)); }); }; return _this; } return AnimatedArray; }(Animated); var AnimatedObject = /*#__PURE__*/ function (_Animated2) { _inheritsLoose(AnimatedObject, _Animated2); function AnimatedObject() { var _this2; for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { args[_key3] = arguments[_key3]; } _this2 = _Animated2.call.apply(_Animated2, [this].concat(args)) || this; _this2.payload = {}; _this2.attach = function () { return Object.values(_this2.payload).forEach(function (s) { return s instanceof Animated && s.addChild(_assertThisInitialized(_this2)); }); }; _this2.detach = function () { return Object.values(_this2.payload).forEach(function (s) { return s instanceof Animated && s.removeChild(_assertThisInitialized(_this2)); }); }; return _this2; } var _proto2 = AnimatedObject.prototype; _proto2.getValue = function getValue(animated) { if (animated === void 0) { animated = false; } var payload = {}; for (var _key4 in this.payload) { var value = this.payload[_key4]; if (animated && !(value instanceof Animated)) continue; payload[_key4] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value; } return payload; }; _proto2.getAnimatedValue = function getAnimatedValue() { return this.getValue(true); }; return AnimatedObject; }(Animated); var applyAnimatedValues; function injectApplyAnimatedValues(fn, transform) { applyAnimatedValues = { fn: fn, transform: transform }; } var colorNames; function injectColorNames(names) { colorNames = names; } var requestFrame = function requestFrame(cb) { return typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1; }; var cancelFrame = function cancelFrame(id) { typeof window !== 'undefined' && window.cancelAnimationFrame(id); }; function injectFrame(raf, caf) { requestFrame = raf; cancelFrame = caf; } var interpolation; function injectStringInterpolator(fn) { interpolation = fn; } var now = function now() { return Date.now(); }; function injectNow(nowFn) { now = nowFn; } var defaultElement; function injectDefaultElement(el) { defaultElement = el; } var animatedApi = function animatedApi(node) { return node.current; }; function injectAnimatedApi(fn) { animatedApi = fn; } var createAnimatedStyle; function injectCreateAnimatedStyle(factory) { createAnimatedStyle = factory; } var manualFrameloop; function injectManualFrameloop(callback) { manualFrameloop = callback; } var Globals = /*#__PURE__*/Object.freeze({ get applyAnimatedValues () { return applyAnimatedValues; }, injectApplyAnimatedValues: injectApplyAnimatedValues, get colorNames () { return colorNames; }, injectColorNames: injectColorNames, get requestFrame () { return requestFrame; }, get cancelFrame () { return cancelFrame; }, injectFrame: injectFrame, get interpolation () { return interpolation; }, injectStringInterpolator: injectStringInterpolator, get now () { return now; }, injectNow: injectNow, get defaultElement () { return defaultElement; }, injectDefaultElement: injectDefaultElement, get animatedApi () { return animatedApi; }, injectAnimatedApi: injectAnimatedApi, get createAnimatedStyle () { return createAnimatedStyle; }, injectCreateAnimatedStyle: injectCreateAnimatedStyle, get manualFrameloop () { return manualFrameloop; }, injectManualFrameloop: injectManualFrameloop }); /** * Wraps the `style` property with `AnimatedStyle`. */ var AnimatedProps = /*#__PURE__*/ function (_AnimatedObject) { _inheritsLoose(AnimatedProps, _AnimatedObject); function AnimatedProps(props, callback) { var _this; _this = _AnimatedObject.call(this) || this; _this.update = void 0; _this.payload = !props.style ? props : _extends({}, props, { style: createAnimatedStyle(props.style) }); _this.update = callback; _this.attach(); return _this; } return AnimatedProps; }(AnimatedObject); var isFunctionComponent = function isFunctionComponent(val) { return is.fun(val) && !(val.prototype instanceof React__default.Component); }; var createAnimatedComponent = function createAnimatedComponent(Component) { var AnimatedComponent = React.forwardRef(function (props, ref) { var forceUpdate = useForceUpdate(); var mounted = React.useRef(true); var propsAnimated = React.useRef(null); var node = React.useRef(null); var attachProps = React.useCallback(function (props) { var oldPropsAnimated = propsAnimated.current; var callback = function callback() { var didUpdate = false; if (node.current) { didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue()); } if (!node.current || didUpdate === false) { // If no referenced node has been found, or the update target didn't have a // native-responder, then forceUpdate the animation ... forceUpdate(); } }; propsAnimated.current = new AnimatedProps(props, callback); oldPropsAnimated && oldPropsAnimated.detach(); }, []); React.useEffect(function () { return function () { mounted.current = false; propsAnimated.current && propsAnimated.current.detach(); }; }, []); React.useImperativeHandle(ref, function () { return animatedApi(node, mounted, forceUpdate); }); attachProps(props); var _getValue = propsAnimated.current.getValue(), scrollTop = _getValue.scrollTop, scrollLeft = _getValue.scrollLeft, animatedProps = _objectWithoutPropertiesLoose(_getValue, ["scrollTop", "scrollLeft"]); // Functions cannot have refs, see: // See: https://github.com/react-spring/react-spring/issues/569 var refFn = isFunctionComponent(Component) ? undefined : function (childRef) { return node.current = handleRef(childRef, ref); }; return React__default.createElement(Component, _extends({}, animatedProps, { ref: refFn })); }); return AnimatedComponent; }; var active = false; var controllers = new Set(); var update = function update() { if (!active) return false; var time = now(); for (var _iterator = controllers, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; if (_isArray) { if (_i >= _iterator.length) break; _ref = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; _ref = _i.value; } var controller = _ref; var isActive = false; for (var configIdx = 0; configIdx < controller.configs.length; configIdx++) { var config = controller.configs[configIdx]; var endOfAnimation = void 0, lastTime = void 0; for (var valIdx = 0; valIdx < config.animatedValues.length; valIdx++) { var animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude if (animation.done) continue; var from = config.fromValues[valIdx]; var to = config.toValues[valIdx]; var position = animation.lastPosition; var isAnimated = to instanceof Animated; var velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity; if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state if (config.immediate) { animation.setValue(to); animation.done = true; continue; } // Break animation when string values are involved if (typeof from === 'string' || typeof to === 'string') { animation.setValue(to); animation.done = true; continue; } if (config.duration !== void 0) { /** Duration easing */ position = from + config.easing((time - animation.startTime) / config.duration) * (to - from); endOfAnimation = time >= animation.startTime + config.duration; } else if (config.decay) { /** Decay easing */ position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime))); endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1; if (endOfAnimation) to = position; } else { /** Spring easing */ lastTime = animation.lastTime !== void 0 ? animation.lastTime : time; velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end. if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/ var numSteps = Math.floor(time - lastTime); for (var i = 0; i < numSteps; ++i) { var force = -config.tension * (position - to); var damping = -config.friction * velocity; var acceleration = (force + damping) / config.mass; velocity = velocity + acceleration * 1 / 1000; position = position + velocity * 1 / 1000; } // Conditions for stopping the spring animation var isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false; var isVelocity = Math.abs(velocity) <= config.precision; var isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true; endOfAnimation = isOvershooting || isVelocity && isDisplacement; animation.lastVelocity = velocity; animation.lastTime = time; } // Trails aren't done until their parents conclude if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false; if (endOfAnimation) { // Ensure that we end up with a round value if (animation.value !== to) position = to; animation.done = true; } else isActive = true; animation.setValue(position); animation.lastPosition = position; } // Keep track of updated values only when necessary if (controller.props.onFrame) controller.values[config.name] = config.interpolation.getValue(); } // Update callbacks in the end of the frame if (controller.props.onFrame) controller.props.onFrame(controller.values); // Either call onEnd or next frame if (!isActive) { controllers.delete(controller); controller.stop(true); } } // Loop over as long as there are controllers ... if (controllers.size) { if (manualFrameloop) manualFrameloop();else requestFrame(update); } else { active = false; } return active; }; var start = function start(controller) { if (!controllers.has(controller)) controllers.add(controller); if (!active) { active = true; if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update); } }; var stop = function stop(controller) { if (controllers.has(controller)) controllers.delete(controller); }; function createInterpolator(range, output, extrapolate) { if (typeof range === 'function') { return range; } if (Array.isArray(range)) { return createInterpolator({ range: range, output: output, extrapolate: extrapolate }); } if (interpolation && typeof range.output[0] === 'string') { return interpolation(range); } var config = range; var outputRange = config.output; var inputRange = config.range || [0, 1]; var extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend'; var extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend'; var easing = config.easing || function (t) { return t; }; return function (input) { var range = findRange(input, inputRange); return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map); }; } function interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) { var result = map ? map(input) : input; // Extrapolate if (result < inputMin) { if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin; } if (result > inputMax) { if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax; } if (outputMin === outputMax) return outputMin; if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing result = easing(result); // Output Range if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin; return result; } function findRange(input, inputRange) { for (var i = 1; i < inputRange.length - 1; ++i) { if (inputRange[i] >= input) break; } return i - 1; } var AnimatedInterpolation = /*#__PURE__*/ function (_AnimatedArray) { _inheritsLoose(AnimatedInterpolation, _AnimatedArray); function AnimatedInterpolation(parents, range, output, extrapolate) { var _this; _this = _AnimatedArray.call(this) || this; _this.calc = void 0; _this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents]; _this.calc = createInterpolator(range, output, extrapolate); return _this; } var _proto = AnimatedInterpolation.prototype; _proto.getValue = function getValue() { return this.calc.apply(this, this.payload.map(function (value) { return value.getValue(); })); }; _proto.updateConfig = function updateConfig(range, output, extrapolate) { this.calc = createInterpolator(range, output, extrapolate); }; _proto.interpolate = function interpolate(range, output, extrapolate) { return new AnimatedInterpolation(this, range, output, extrapolate); }; return AnimatedInterpolation; }(AnimatedArray); var interpolate$1 = function interpolate(parents, range, output) { return parents && new AnimatedInterpolation(parents, range, output); }; var config = { default: { tension: 170, friction: 26 }, gentle: { tension: 120, friction: 14 }, wobbly: { tension: 180, friction: 12 }, stiff: { tension: 210, friction: 20 }, slow: { tension: 280, friction: 60 }, molasses: { tension: 280, friction: 120 } }; /** API * useChain(references, timeSteps, timeFrame) */ function useChain(refs, timeSteps, timeFrame) { if (timeFrame === void 0) { timeFrame = 1000; } var previous = React.useRef(); React.useEffect(function () { if (is.equ(refs, previous.current)) refs.forEach(function (_ref) { var current = _ref.current; return current && current.start(); });else if (timeSteps) { refs.forEach(function (_ref2, index) { var current = _ref2.current; if (current) { var ctrls = current.controllers; if (ctrls.length) { var t = timeFrame * timeSteps[index]; ctrls.forEach(function (ctrl) { ctrl.queue = ctrl.queue.map(function (e) { return _extends({}, e, { delay: e.delay + t }); }); ctrl.start(); }); } } }); } else refs.reduce(function (q, _ref3, rI) { var current = _ref3.current; return q = q.then(function () { return current.start(); }); }, Promise.resolve()); previous.current = refs; }); } /** * Animated works by building a directed acyclic graph of dependencies * transparently when you render your Animated components. * * new Animated.Value(0) * .interpolate() .interpolate() new Animated.Value(1) * opacity translateY scale * style transform * View#234 style * View#123 * * A) Top Down phase * When an AnimatedValue is updated, we recursively go down through this * graph in order to find leaf nodes: the views that we flag as needing * an update. * * B) Bottom Up phase * When a view is flagged as needing an update, we recursively go back up * in order to build the new value that it needs. The reason why we need * this two-phases process is to deal with composite props such as * transform which can receive values from multiple parents. */ function addAnimatedStyles(node, styles) { if ('update' in node) { styles.add(node); } else { node.getChildren().forEach(function (child) { return addAnimatedStyles(child, styles); }); } } var AnimatedValue = /*#__PURE__*/ function (_Animated) { _inheritsLoose(AnimatedValue, _Animated); function AnimatedValue(_value) { var _this; _this = _Animated.call(this) || this; _this.animatedStyles = new Set(); _this.value = void 0; _this.startPosition = void 0; _this.lastPosition = void 0; _this.lastVelocity = void 0; _this.startTime = void 0; _this.lastTime = void 0; _this.done = false; _this.setValue = function (value, flush) { if (flush === void 0) { flush = true; } _this.value = value; if (flush) _this.flush(); }; _this.value = _value; _this.startPosition = _value; _this.lastPosition = _value; return _this; } var _proto = AnimatedValue.prototype; _proto.flush = function flush() { if (this.animatedStyles.size === 0) { addAnimatedStyles(this, this.animatedStyles); } this.animatedStyles.forEach(function (animatedStyle) { return animatedStyle.update(); }); }; _proto.clearStyles = function clearStyles() { this.animatedStyles.clear(); }; _proto.getValue = function getValue() { return this.value; }; _proto.interpolate = function interpolate(range, output, extrapolate) { return new AnimatedInterpolation(this, range, output, extrapolate); }; return AnimatedValue; }(Animated); var AnimatedValueArray = /*#__PURE__*/ function (_AnimatedArray) { _inheritsLoose(AnimatedValueArray, _AnimatedArray); function AnimatedValueArray(values) { var _this; _this = _AnimatedArray.call(this) || this; _this.payload = values.map(function (n) { return new AnimatedValue(n); }); return _this; } var _proto = AnimatedValueArray.prototype; _proto.setValue = function setValue(value, flush) { var _this2 = this; if (flush === void 0) { flush = true; } if (Array.isArray(value)) { if (value.length === this.payload.length) { value.forEach(function (v, i) { return _this2.payload[i].setValue(v, flush); }); } } else { this.payload.forEach(function (p) { return p.setValue(value, flush); }); } }; _proto.getValue = function getValue() { return this.payload.map(function (v) { return v.getValue(); }); }; _proto.interpolate = function interpolate(range, output) { return new AnimatedInterpolation(this, range, output); }; return AnimatedValueArray; }(AnimatedArray); var G = 0; var Controller = /*#__PURE__*/ function () { function Controller() { var _this = this; this.id = void 0; this.idle = true; this.hasChanged = false; this.guid = 0; this.local = 0; this.props = {}; this.merged = {}; this.animations = {}; this.interpolations = {}; this.values = {}; this.configs = []; this.listeners = []; this.queue = []; this.localQueue = void 0; this.getValues = function () { return _this.interpolations; }; this.id = G++; } /** update(props) * This function filters input props and creates an array of tasks which are executed in .start() * Each task is allowed to carry a delay, which means it can execute asnychroneously */ var _proto = Controller.prototype; _proto.update = function update$$1(args) { //this._id = n + this.id if (!args) return this; // Extract delay and the to-prop from props var _ref = interpolateTo(args), _ref$delay = _ref.delay, delay = _ref$delay === void 0 ? 0 : _ref$delay, to = _ref.to, props = _objectWithoutPropertiesLoose(_ref, ["delay", "to"]); if (is.arr(to) || is.fun(to)) { // If config is either a function or an array queue it up as is this.queue.push(_extends({}, props, { delay: delay, to: to })); } else if (to) { // Otherwise go through each key since it could be delayed individually var ops = {}; Object.entries(to).forEach(function (_ref2) { var _to; var k = _ref2[0], v = _ref2[1]; // Fetch delay and create an entry, consisting of the to-props, the delay, and basic props var entry = _extends({ to: (_to = {}, _to[k] = v, _to), delay: callProp(delay, k) }, props); var previous = ops[entry.delay] && ops[entry.delay].to; ops[entry.delay] = _extends({}, ops[entry.delay], entry, { to: _extends({}, previous, entry.to) }); }); this.queue = Object.values(ops); } // Sort queue, so that async calls go last this.queue = this.queue.sort(function (a, b) { return a.delay - b.delay; }); // Diff the reduced props immediately (they'll contain the from-prop and some config) this.diff(props); return this; } /** start(onEnd) * This function either executes a queue, if present, or starts the frameloop, which animates */ ; _proto.start = function start$$1(onEnd) { var _this2 = this; // If a queue is present we must excecute it if (this.queue.length) { this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values if (this.localQueue) { this.localQueue.forEach(function (_ref3) { var _ref3$from = _ref3.from, from = _ref3$from === void 0 ? {} : _ref3$from, _ref3$to = _ref3.to, to = _ref3$to === void 0 ? {} : _ref3$to; if (is.obj(from)) _this2.merged = _extends({}, from, _this2.merged); if (is.obj(to)) _this2.merged = _extends({}, _this2.merged, to); }); } // The guid helps us tracking frames, a new queue over an old one means an override // We discard async calls in that caseÍ var local = this.local = ++this.guid; var queue = this.localQueue = this.queue; this.queue = []; // Go through each entry and execute it queue.forEach(function (_ref4, index) { var delay = _ref4.delay, props = _objectWithoutPropertiesLoose(_ref4, ["delay"]); var cb = function cb(finished) { if (index === queue.length - 1 && local === _this2.guid && finished) { _this2.idle = true; if (_this2.props.onRest) _this2.props.onRest(_this2.merged); } if (onEnd) onEnd(); }; // Entries can be delayed, ansyc or immediate var async = is.arr(props.to) || is.fun(props.to); if (delay) { setTimeout(function () { if (local === _this2.guid) { if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb); } }, delay); } else if (async) _this2.runAsync(props, cb);else _this2.diff(props).start(cb); }); } // Otherwise we kick of the frameloop else { if (is.fun(onEnd)) this.listeners.push(onEnd); if (this.props.onStart) this.props.onStart(); start(this); } return this; }; _proto.stop = function stop$$1(finished) { this.listeners.forEach(function (onEnd) { return onEnd(finished); }); this.listeners = []; return this; } /** Pause sets onEnd listeners free, but also removes the controller from the frameloop */ ; _proto.pause = function pause(finished) { this.stop(true); if (finished) stop(this); return this; }; _proto.runAsync = function runAsync(_ref5, onEnd) { var _this3 = this; var delay = _ref5.delay, props = _objectWithoutPropertiesLoose(_ref5, ["delay"]); var local = this.local; // If "to" is either a function or an array it will be processed async, therefor "to" should be empty right now // If the view relies on certain values "from" has to be present var queue = Promise.resolve(undefined); if (is.arr(props.to)) { var _loop = function _loop(i) { var index = i; var fresh = _extends({}, props, interpolateTo(props.to[index])); if (is.arr(fresh.config)) fresh.config = fresh.config[index]; queue = queue.then(function () { //this.stop() if (local === _this3.guid) return new Promise(function (r) { return _this3.diff(fresh).start(r); }); }); }; for (var i = 0; i < props.to.length; i++) { _loop(i); } } else if (is.fun(props.to)) { var index = 0; var last; queue = queue.then(function () { return props.to( // next(props) function (p) { var fresh = _extends({}, props, interpolateTo(p)); if (is.arr(fresh.config)) fresh.config = fresh.config[index]; index++; //this.stop() if (local === _this3.guid) return last = new Promise(function (r) { return _this3.diff(fresh).start(r); }); return; }, // cancel() function (finished) { if (finished === void 0) { finished = true; } return _this3.stop(finished); }).then(function () { return last; }); }); } queue.then(onEnd); }; _proto.diff = function diff(props) { var _this4 = this; this.props = _extends({}, this.props, props); var _this$props = this.props, _this$props$from = _this$props.from, from = _this$props$from === void 0 ? {} : _this$props$from, _this$props$to = _this$props.to, to = _this$props$to === void 0 ? {} : _this$props$to, _this$props$config = _this$props.config, config = _this$props$config === void 0 ? {} : _this$props$config, reverse = _this$props.reverse, attach = _this$props.attach, reset = _this$props.reset, immediate = _this$props.immediate; // Reverse values when requested if (reverse) { var _ref6 = [to, from]; from = _ref6[0]; to = _ref6[1]; } // This will collect all props that were ever set, reset merged props when necessary this.merged = _extends({}, from, this.merged, to); this.hasChanged = false; // Attachment handling, trailed springs can "attach" themselves to a previous spring var target = attach && attach(this); // Reduces input { name: value } pairs into animated values this.animations = Object.entries(this.merged).reduce(function (acc, _ref7) { var name = _ref7[0], value = _ref7[1]; // Issue cached entries, except on reset var entry = acc[name] || {}; // Figure out what the value is supposed to be var isNumber = is.num(value); var isString = is.str(value) && !value.startsWith('#') && !/\d/.test(value) && !colorNames[value]; var isArray = is.arr(value); var isInterpolation = !isNumber && !isArray && !isString; var fromValue = !is.und(from[name]) ? from[name] : value; var toValue = isNumber || isArray ? value : isString ? value : 1; var toConfig = callProp(config, name); if (target) toValue = target.animations[name].parent; var parent = entry.parent, interpolation$$1 = entry.interpolation, toValues = toArray(target ? toValue.getPayload() : toValue), animatedValues; var newValue = value; if (isInterpolation) newValue = interpolation({ range: [0, 1], output: [value, value] })(1); var currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags var isFirst = is.und(parent); var isActive = !isFirst && entry.animatedValues.some(function (v) { return !v.done; }); var currentValueDiffersFromGoal = !is.equ(newValue, currentValue); var hasNewGoal = !is.equ(newValue, entry.previous); var hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one) // and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?) if (reset || hasNewGoal && currentValueDiffersFromGoal || hasNewConfig) { var _extends2; // Convert regular values into animated values, ALWAYS re-use if possible if (isNumber || isString) parent = interpolation$$1 = entry.parent || new AnimatedValue(fromValue);else if (isArray) parent = interpolation$$1 = entry.parent || new AnimatedValueArray(fromValue);else if (isInterpolation) { var prev = entry.interpolation && entry.interpolation.calc(entry.parent.value); prev = prev !== void 0 && !reset ? prev : fromValue; if (entry.parent) { parent = entry.parent; parent.setValue(0, false); } else parent = new AnimatedValue(0); var range = { output: [prev, value] }; if (entry.interpolation) { interpolation$$1 = entry.interpolation; entry.interpolation.updateConfig(range); } else interpolation$$1 = parent.interpolate(range); } toValues = toArray(target ? toValue.getPayload() : toValue); animatedValues = toArray(parent.getPayload()); if (reset && !isInterpolation) parent.setValue(fromValue, false); _this4.hasChanged = true; // Reset animated values animatedValues.forEach(function (value) { value.startPosition = value.value; value.lastPosition = value.value; value.lastVelocity = isActive ? value.lastVelocity : undefined; value.lastTime = isActive ? value.lastTime : undefined; value.startTime = now(); value.done = false; value.animatedStyles.clear(); }); // Set immediate values if (callProp(immediate, name)) { parent.setValue(isInterpolation ? toValue : value, false); } return _extends({}, acc, (_extends2 = {}, _extends2[name] = _extends({}, entry, { name: name, parent: parent, interpolation: interpolation$$1, animatedValues: animatedValues, toValues: toValues, previous: newValue, config: toConfig, fromValues: toArray(parent.getValue()), immediate: callProp(immediate, name), initialVelocity: withDefault(toConfig.velocity, 0), clamp: withDefault(toConfig.clamp, false), precision: withDefault(toConfig.precision, 0.01), tension: withDefault(toConfig.tension, 170), friction: withDefault(toConfig.friction, 26), mass: withDefault(toConfig.mass, 1), duration: toConfig.duration, easing: withDefault(toConfig.easing, function (t) { return t; }), decay: toConfig.decay }), _extends2)); } else { if (!currentValueDiffersFromGoal) { var _extends3; // So ... the current target value (newValue) appears to be different from the previous value, // which normally constitutes an update, but the actual value (currentValue) matches the target! // In order to resolve this without causing an animation update we silently flag the animation as done, // which it technically is. Interpolations also needs a config update with their target set to 1. if (isInterpolation) { parent.setValue(1, false); interpolation$$1.updateConfig({ output: [newValue, newValue] }); } parent.done = true; _this4.hasChanged = true; return _extends({}, acc, (_extends3 = {}, _extends3[name] = _extends({}, acc[name], { previous: newValue }), _extends3)); } return acc; } }, this.animations); if (this.hasChanged) { // Make animations available to frameloop this.configs = Object.values(this.animations); this.values = {}; this.interpolations = {}; for (var key in this.animations) { this.interpolations[key] = this.animations[key].interpolation; this.values[key] = this.animations[key].interpolation.getValue(); } } return this; }; _proto.destroy = function destroy() { this.stop(); this.props = {}; this.merged = {}; this.animations = {}; this.interpolations = {}; this.values = {}; this.configs = []; this.local = 0; }; return Controller; }(); /** API * const props = useSprings(number, [{ ... }, { ... }, ...]) * const [props, set] = useSprings(number, (i, controller) => ({ ... })) */ var useSprings = function useSprings(length, props) { var mounted = React.useRef(false); var ctrl = React.useRef(); var isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations var _useMemo = React.useMemo(function () { // Remove old controllers if (ctrl.current) { ctrl.current.map(function (c) { return c.destroy(); }); ctrl.current = undefined; } var ref; return [new Array(length).fill().map(function (_, i) { var ctrl = new Controller(); var newProps = isFn ? callProp(props, i, ctrl) : props[i]; if (i === 0) ref = newProps.ref; ctrl.update(newProps); if (!ref) ctrl.start(); return ctrl; }), ref]; }, [length]), controllers = _useMemo[0], ref = _useMemo[1]; ctrl.current = controllers; // The hooks reference api gets defined here ... var api = React.useImperativeHandle(ref, function () { return { start: function start() { return Promise.all(ctrl.current.map(function (c) { return new Promise(function (r) { return c.start(r); }); })); }, stop: function stop(finished) { return ctrl.current.forEach(function (c) { return c.stop(finished); }); }, get controllers() { return ctrl.current; } }; }); // This function updates the controllers var updateCtrl = React.useMemo(function () { return function (updateProps) { return ctrl.current.map(function (c, i) { c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]); if (!ref) c.start(); }); }; }, [length]); // Update controller if props aren't functional React.useEffect(function () { if (mounted.current) { if (!isFn) updateCtrl(props); } else if (!ref) ctrl.current.forEach(function (c) { return c.start(); }); }); // Update mounted flag and destroy controller on unmount React.useEffect(function () { return mounted.current = true, function () { return ctrl.current.forEach(function (c) { return c.destroy(); }); }; }, []); // Return animated props, or, anim-props + the update-setter above var propValues = ctrl.current.map(function (c) { return c.getValues(); }); return isFn ? [propValues, updateCtrl, function (finished) { return ctrl.current.forEach(function (c) { return c.pause(finished); }); }] : propValues; }; /** API * const props = useSpring({ ... }) * const [props, set] = useSpring(() => ({ ... })) */ var useSpring = function useSpring(props) { var isFn = is.fun(props); var _useSprings = useSprings(1, isFn ? props : [props]), result = _useSprings[0], set = _useSprings[1], pause = _useSprings[2]; return isFn ? [result[0], set, pause] : result; }; /** API * const trails = useTrail(number, { ... }) * const [trails, set] = useTrail(number, () => ({ ... })) */ var useTrail = function useTrail(length, props) { var mounted = React.useRef(false); var isFn = is.fun(props); var updateProps = callProp(props); var instances = React.useRef(); var _useSprings = useSprings(length, function (i, ctrl) { if (i === 0) instances.current = []; instances.current.push(ctrl); return _extends({}, updateProps, { config: callProp(updateProps.config, i), attach: i > 0 && function () { return instances.current[i - 1]; } }); }), result = _useSprings[0], set = _useSprings[1], pause = _useSprings[2]; // Set up function to update controller var updateCtrl = React.useMemo(function () { return function (props) { return set(function (i, ctrl) { var last = props.reverse ? i === 0 : length - 1 === i; var attachIdx = props.reverse ? i + 1 : i - 1; var attachController = instances.current[attachIdx]; return _extends({}, props, { config: callProp(props.config || updateProps.config, i), attach: attachController && function () { return attachController; } }); }); }; }, [length, updateProps.reverse]); // Update controller if props aren't functional React.useEffect(function () { return void (mounted.current && !isFn && updateCtrl(props)); }); // Update mounted flag and destroy controller on unmount React.useEffect(function () { return void (mounted.current = true); }, []); return isFn ? [result, updateCtrl, pause] : result; }; /** API * const transitions = useTransition(items, itemKeys, { ... }) * const [transitions, update] = useTransition(items, itemKeys, () => ({ ... })) */ var guid = 0; var ENTER = 'enter'; var LEAVE = 'leave'; var UPDATE = 'update'; var mapKeys = function mapKeys(items, keys) { return (typeof keys === 'function' ? items.map(keys) : toArray(keys)).map(String); }; var get = function get(props) { var items = props.items, _props$keys = props.keys, keys = _props$keys === void 0 ? function (item) { return item; } : _props$keys, rest = _objectWithoutPropertiesLoose(props, ["items", "keys"]); items = toArray(items !== void 0 ? items : null); return _extends({ items: items, keys: mapKeys(items, keys) }, rest); }; function useTransition(input, keyTransform, config) { var props = _extends({ items: input, keys: keyTransform || function (i) { return i; } }, config); var _get = get(props), _get$lazy = _get.lazy, lazy = _get$lazy === void 0 ? false : _get$lazy, _get$unique = _get.unique, _get$reset = _get.reset, reset = _get$reset === void 0 ? false : _get$reset, enter = _get.enter, leave = _get.leave, update = _get.update, onDestroyed = _get.onDestroyed, keys = _get.keys, items = _get.items, onFrame = _get.onFrame, _onRest = _get.onRest, onStart = _get.onStart, ref = _get.ref, extra = _objectWithoutPropertiesLoose(_get, ["lazy", "unique", "reset", "enter", "leave", "update", "onDestroyed", "keys", "items", "onFrame", "onRest", "onStart", "ref"]); var forceUpdate = useForceUpdate(); var mounted = React.useRef(false); var state = React.useRef({ mounted: false, first: true, deleted: [], current: {}, transitions: [], prevProps: {}, paused: !!props.ref, instances: !mounted.current && new Map(), forceUpdate: forceUpdate }); React.useImperativeHandle(props.ref, function () { return { start: function start() { return Promise.all(Array.from(state.current.instances).map(function (_ref) { var c = _ref[1]; return new Promise(function (r) { return c.start(r); }); })); }, stop: function stop(finished) { return Array.from(state.current.instances).forEach(function (_ref2) { var c = _ref2[1]; return c.stop(finished); }); }, get controllers() { return Array.from(state.current.instances).map(function (_ref3) { var c = _ref3[1]; return c; }); } }; }); // Update state state.current = diffItems(state.current, props); if (state.current.changed) { // Update state state.current.transitions.forEach(function (transition) { var slot = transition.slot, from = transition.from, to = transition.to, config = transition.config, trail = transition.trail, key = transition.key, item = transition.item; if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object var ctrl = state.current.instances.get(key); var newProps = _extends({}, extra, { to: to, from: from, config: config, ref: ref, onRest: function onRest(values) { if (state.current.mounted) { if (transition.destroyed) { // If no ref is given delete destroyed items immediately if (!ref && !lazy) cleanUp(state, key); if (onDestroyed) onDestroyed(item); } // A transition comes to rest once all its springs conclude var curInstances = Array.from(state.current.instances); var active = curInstances.some(function (_ref4) { var c = _ref4[1]; return !c.idle; }); if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state); if (_onRest) _onRest(item, slot, values); } }, onStart: onStart && function () { return onStart(item, slot); }, onFrame: onFrame && function (values) { return onFrame(item, slot, values); }, delay: trail, reset: reset && slot === ENTER // Update controller }); ctrl.update(newProps); if (!state.current.paused) ctrl.start(); }); } React.useEffect(function () { state.current.mounted = mounted.current = true; return function () { state.current.mounted = mounted.current = false; Array.from(state.current.instances).map(function (_ref5) { var c = _ref5[1]; return c.destroy(); }); state.current.instances.clear(); }; }, []); return state.current.transitions.map(function (_ref6) { var item = _ref6.item, slot = _ref6.slot, key = _ref6.key; return { item: item, key: key, state: slot, props: state.current.instances.get(key).getValues() }; }); } function cleanUp(state, filterKey) { var deleted = state.current.deleted; var _loop = function _loop() { if (_isArray) { if (_i >= _iterator.length) return "break"; _ref8 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) return "break"; _ref8 = _i.value; } var _ref7 = _ref8; var key = _ref7.key; var filter = function filter(t) { return t.key !== key; }; if (is.und(filterKey) || filterKey === key) { state.current.instances.delete(key); state.current.transitions = state.current.transitions.filter(filter); state.current.deleted = state.current.deleted.filter(filter); } }; for (var _iterator = deleted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref8; var _ret = _loop(); if (_ret === "break") break; } state.current.forceUpdate(); } function diffItems(_ref9, props) { var first = _ref9.first, prevProps = _ref9.prevProps, state = _objectWithoutPropertiesLoose(_ref9, ["first", "prevProps"]); var _get2 = get(props), items = _get2.items, keys = _get2.keys, initial = _get2.initial, from = _get2.from, enter = _get2.enter, leave = _get2.leave, update = _get2.update, _get2$trail = _get2.trail, trail = _get2$trail === void 0 ? 0 : _get2$trail, unique = _get2.unique, config = _get2.config, _get2$order = _get2.order, order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order; var _get3 = get(prevProps), _keys = _get3.keys, _items = _get3.items; var current = _extends({}, state.current); var deleted = [].concat(state.deleted); // Compare next keys with current keys var currentKeys = Object.keys(current); var currentSet = new Set(currentKeys); var nextSet = new Set(keys); var added = keys.filter(function (item) { return !currentSet.has(item); }); var removed = state.transitions.filter(function (item) { return !item.destroyed && !nextSet.has(item.originalKey); }).map(function (i) { return i.originalKey; }); var updated = keys.filter(function (item) { return currentSet.has(item); }); var delay = -trail; while (order.length) { var changeType = order.shift(); switch (changeType) { case ENTER: { added.forEach(function (key, index) { // In unique mode, remove fading out transitions if their key comes in again if (unique && deleted.find(function (d) { return d.originalKey === key; })) deleted = deleted.filter(function (t) { return t.originalKey !== key; }); var keyIndex = keys.indexOf(key); var item = items[keyIndex]; var slot = first && initial !== void 0 ? 'initial' : ENTER; current[key] = { slot: slot, originalKey: key, key: unique ? String(key) : guid++, item: item, trail: delay = delay + trail, config: callProp(config, item, slot), from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item), to: callProp(enter, item) }; }); break; } case LEAVE: { removed.forEach(function (key) { var keyIndex = _keys.indexOf(key); var item = _items[keyIndex]; var slot = LEAVE; deleted.unshift(_extends({}, current[key], { slot: slot, destroyed: true, left: _keys[Math.max(0, keyIndex - 1)], right: _keys[Math.min(_keys.length, keyIndex + 1)], trail: delay = delay + trail, config: callProp(config, item, slot), to: callProp(leave, item) })); delete current[key]; }); break; } case UPDATE: { updated.forEach(function (key) { var keyIndex = keys.indexOf(key); var item = items[keyIndex]; var slot = UPDATE; current[key] = _extends({}, current[key], { item: item, slot: slot, trail: delay = delay + trail, config: callProp(config, item, slot), to: callProp(update, item) }); }); break; } } } var out = keys.map(function (key) { return current[key]; }); // This tries to restore order for deleted items by finding their last known siblings // only using the left sibling to keep order placement consistent for all deleted items deleted.forEach(function (_ref10) { var left = _ref10.left, right = _ref10.right, item = _objectWithoutPropertiesLoose(_ref10, ["left", "right"]); var pos; // Was it the element on the left, if yes, move there ... if ((pos = out.findIndex(function (t) { return t.originalKey === left; })) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\_(ツ)_/¯ pos = Math.max(0, pos); out = [].concat(out.slice(0, pos), [item], out.slice(pos)); }); return _extends({}, state, { changed: added.length || removed.length || updated.length, first: first && added.length === 0, transitions: out, current: current, deleted: deleted, prevProps: props }); } var AnimatedStyle = /*#__PURE__*/ function (_AnimatedObject) { _inheritsLoose(AnimatedStyle, _AnimatedObject); function AnimatedStyle(style) { var _this; if (style === void 0) { style = {}; } _this = _AnimatedObject.call(this) || this; if (style.transform && !(style.transform instanceof Animated)) { style = applyAnimatedValues.transform(style); } _this.payload = style; return _this; } return AnimatedStyle; }(AnimatedObject); // http://www.w3.org/TR/css3-color/#svg-color var colors = { transparent: 0x00000000, aliceblue: 0xf0f8ffff, antiquewhite: 0xfaebd7ff, aqua: 0x00ffffff, aquamarine: 0x7fffd4ff, azure: 0xf0ffffff, beige: 0xf5f5dcff, bisque: 0xffe4c4ff, black: 0x000000ff, blanchedalmond: 0xffebcdff, blue: 0x0000ffff, blueviolet: 0x8a2be2ff, brown: 0xa52a2aff, burlywood: 0xdeb887ff, burntsienna: 0xea7e5dff, cadetblue: 0x5f9ea0ff, chartreuse: 0x7fff00ff, chocolate: 0xd2691eff, coral: 0xff7f50ff, cornflowerblue: 0x6495edff, cornsilk: 0xfff8dcff, crimson: 0xdc143cff, cyan: 0x00ffffff, darkblue: 0x00008bff, darkcyan: 0x008b8bff, darkgoldenrod: 0xb8860bff, darkgray: 0xa9a9a9ff, darkgreen: 0x006400ff, darkgrey: 0xa9a9a9ff, darkkhaki: 0xbdb76bff, darkmagenta: 0x8b008bff, darkolivegreen: 0x556b2fff, darkorange: 0xff8c00ff, darkorchid: 0x9932ccff, darkred: 0x8b0000ff, darksalmon: 0xe9967aff, darkseagreen: 0x8fbc8fff, darkslateblue: 0x483d8bff, darkslategray: 0x2f4f4fff, darkslategrey: 0x2f4f4fff, darkturquoise: 0x00ced1ff, darkviolet: 0x9400d3ff, deeppink: 0xff1493ff, deepskyblue: 0x00bfffff, dimgray: 0x696969ff, dimgrey: 0x696969ff, dodgerblue: 0x1e90ffff, firebrick: 0xb22222ff, floralwhite: 0xfffaf0ff, forestgreen: 0x228b22ff, fuchsia: 0xff00ffff, gainsboro: 0xdcdcdcff, ghostwhite: 0xf8f8ffff, gold: 0xffd700ff, goldenrod: 0xdaa520ff, gray: 0x808080ff, green: 0x008000ff, greenyellow: 0xadff2fff, grey: 0x808080ff, honeydew: 0xf0fff0ff, hotpink: 0xff69b4ff, indianred: 0xcd5c5cff, indigo: 0x4b0082ff, ivory: 0xfffff0ff, khaki: 0xf0e68cff, lavender: 0xe6e6faff, lavenderblush: 0xfff0f5ff, lawngreen: 0x7cfc00ff, lemonchiffon: 0xfffacdff, lightblue: 0xadd8e6ff, lightcoral: 0xf08080ff, lightcyan: 0xe0ffffff, lightgoldenrodyellow: 0xfafad2ff, lightgray: 0xd3d3d3ff, lightgreen: 0x90ee90ff, lightgrey: 0xd3d3d3ff, lightpink: 0xffb6c1ff, lightsalmon: 0xffa07aff, lightseagreen: 0x20b2aaff, lightskyblue: 0x87cefaff, lightslategray: 0x778899ff, lightslategrey: 0x778899ff, lightsteelblue: 0xb0c4deff, lightyellow: 0xffffe0ff, lime: 0x00ff00ff, limegreen: 0x32cd32ff, linen: 0xfaf0e6ff, magenta: 0xff00ffff, maroon: 0x800000ff, mediumaquamarine: 0x66cdaaff, mediumblue: 0x0000cdff, mediumorchid: 0xba55d3ff, mediumpurple: 0x9370dbff, mediumseagreen: 0x3cb371ff, mediumslateblue: 0x7b68eeff, mediumspringgreen: 0x00fa9aff, mediumturquoise: 0x48d1ccff, mediumvioletred: 0xc71585ff, midnightblue: 0x191970ff, mintcream: 0xf5fffaff, mistyrose: 0xffe4e1ff, moccasin: 0xffe4b5ff, navajowhite: 0xffdeadff, navy: 0x000080ff, oldlace: 0xfdf5e6ff, olive: 0x808000ff, olivedrab: 0x6b8e23ff, orange: 0xffa500ff, orangered: 0xff4500ff, orchid: 0xda70d6ff, palegoldenrod: 0xeee8aaff, palegreen: 0x98fb98ff, paleturquoise: 0xafeeeeff, palevioletred: 0xdb7093ff, papayawhip: 0xffefd5ff, peachpuff: 0xffdab9ff, peru: 0xcd853fff, pink: 0xffc0cbff, plum: 0xdda0ddff, powderblue: 0xb0e0e6ff, purple: 0x800080ff, rebeccapurple: 0x663399ff, red: 0xff0000ff, rosybrown: 0xbc8f8fff, royalblue: 0x4169e1ff, saddlebrown: 0x8b4513ff, salmon: 0xfa8072ff, sandybrown: 0xf4a460ff, seagreen: 0x2e8b57ff, seashell: 0xfff5eeff, sienna: 0xa0522dff, silver: 0xc0c0c0ff, skyblue: 0x87ceebff, slateblue: 0x6a5acdff, slategray: 0x708090ff, slategrey: 0x708090ff, snow: 0xfffafaff, springgreen: 0x00ff7fff, steelblue: 0x4682b4ff, tan: 0xd2b48cff, teal: 0x008080ff, thistle: 0xd8bfd8ff, tomato: 0xff6347ff, turquoise: 0x40e0d0ff, violet: 0xee82eeff, wheat: 0xf5deb3ff, white: 0xffffffff, whitesmoke: 0xf5f5f5ff, yellow: 0xffff00ff, yellowgreen: 0x9acd32ff }; // const INTEGER = '[-+]?\\d+'; var NUMBER = '[-+]?\\d*\\.?\\d+'; var PERCENTAGE = NUMBER + '%'; function call() { for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) { parts[_key] = arguments[_key]; } return '\\(\\s*(' + parts.join(')\\s*,\\s*(') + ')\\s*\\)'; } var rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)); var rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)); var hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)); var hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)); var hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/; var hex6 = /^#([0-9a-fA-F]{6})$/; var hex8 = /^#([0-9a-fA-F]{8})$/; /* https://github.com/react-community/normalize-css-color BSD 3-Clause License Copyright (c) 2016, React Community All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ function normalizeColor(color) { var match; if (typeof color === 'number') { return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null; } // Ordered based on occurrences on Facebook codebase if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0; if (colors.hasOwnProperty(color)) return colors[color]; if (match = rgb.exec(color)) { return (parse255(match[1]) << 24 | // r parse255(match[2]) << 16 | // g parse255(match[3]) << 8 | // b 0x000000ff) >>> // a 0; } if (match = rgba.exec(color)) { return (parse255(match[1]) << 24 | // r parse255(match[2]) << 16 | // g parse255(match[3]) << 8 | // b parse1(match[4])) >>> // a 0; } if (match = hex3.exec(color)) { return parseInt(match[1] + match[1] + // r match[2] + match[2] + // g match[3] + match[3] + // b 'ff', // a 16) >>> 0; } // https://drafts.csswg.org/css-color-4/#hex-notation if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0; if (match = hex4.exec(color)) { return parseInt(match[1] + match[1] + // r match[2] + match[2] + // g match[3] + match[3] + // b match[4] + match[4], // a 16) >>> 0; } if (match = hsl.exec(color)) { return (hslToRgb(parse360(match[1]), // h parsePercentage(match[2]), // s parsePercentage(match[3]) // l ) | 0x000000ff) >>> // a 0; } if (match = hsla.exec(color)) { return (hslToRgb(parse360(match[1]), // h parsePercentage(match[2]), // s parsePercentage(match[3]) // l ) | parse1(match[4])) >>> // a 0; } return null; } function hue2rgb(p, q, t) { if (t < 0) t += 1; if (t > 1) t -= 1; if (t < 1 / 6) return p + (q - p) * 6 * t; if (t < 1 / 2) return q; if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6; return p; } function hslToRgb(h, s, l) { var q = l < 0.5 ? l * (1 + s) : l + s - l * s; var p = 2 * l - q; var r = hue2rgb(p, q, h + 1 / 3); var g = hue2rgb(p, q, h); var b = hue2rgb(p, q, h - 1 / 3); return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8; } function parse255(str) { var int = parseInt(str, 10); if (int < 0) return 0; if (int > 255) return 255; return int; } function parse360(str) { var int = parseFloat(str); return (int % 360 + 360) % 360 / 360; } function parse1(str) { var num = parseFloat(str); if (num < 0) return 0; if (num > 1) return 255; return Math.round(num * 255); } function parsePercentage(str) { // parseFloat conveniently ignores the final % var int = parseFloat(str); if (int < 0) return 0; if (int > 100) return 1; return int / 100; } function colorToRgba(input) { var int32Color = normalizeColor(input); if (int32Color === null) return input; int32Color = int32Color || 0; var r = (int32Color & 0xff000000) >>> 24; var g = (int32Color & 0x00ff0000) >>> 16; var b = (int32Color & 0x0000ff00) >>> 8; var a = (int32Color & 0x000000ff) / 255; return "rgba(" + r + ", " + g + ", " + b + ", " + a + ")"; } // Problem: https://github.com/animatedjs/animated/pull/102 // Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662 var stringShapeRegex = /[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g; // Covers rgb, rgba, hsl, hsla // Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e var colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi; // Covers color names (transparent, blue, etc.) var colorNamesRegex = new RegExp("(" + Object.keys(colors).join('|') + ")", 'g'); /** * Supports string shapes by extracting numbers so new values can be computed, * and recombines those values into new strings of the same shape. Supports * things like: * * rgba(123, 42, 99, 0.36) // colors * -45deg // values with units * 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows */ var createStringInterpolator = function createStringInterpolator(config) { // Replace colors with rgba var outputRange = config.output.map(function (rangeValue) { return rangeValue.replace(colorRegex, colorToRgba); }).map(function (rangeValue) { return rangeValue.replace(colorNamesRegex, colorToRgba); }); var outputRanges = outputRange[0].match(stringShapeRegex).map(function () { return []; }); outputRange.forEach(function (value) { value.match(stringShapeRegex).forEach(function (number, i) { return outputRanges[i].push(+number); }); }); var interpolations = outputRange[0].match(stringShapeRegex).map(function (_value, i) { return createInterpolator(_extends({}, config, { output: outputRanges[i] })); }); return function (input) { var i = 0; return outputRange[0] // 'rgba(0, 100, 200, 0)' // -> // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...' .replace(stringShapeRegex, function () { return interpolations[i++](input); }) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to // round the opacity (4th column). .replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi, function (_, p1, p2, p3, p4) { return "rgba(" + Math.round(p1) + ", " + Math.round(p2) + ", " + Math.round(p3) + ", " + p4 + ")"; }); }; }; var isUnitlessNumber = { animationIterationCount: true, borderImageOutset: true, borderImageSlice: true, borderImageWidth: true, boxFlex: true, boxFlexGroup: true, boxOrdinalGroup: true, columnCount: true, columns: true, flex: true, flexGrow: true, flexPositive: true, flexShrink: true, flexNegative: true, flexOrder: true, gridRow: true, gridRowEnd: true, gridRowSpan: true, gridRowStart: true, gridColumn: true, gridColumnEnd: true, gridColumnSpan: true, gridColumnStart: true, fontWeight: true, lineClamp: true, lineHeight: true, opacity: true, order: true, orphans: true, tabSize: true, widows: true, zIndex: true, zoom: true, // SVG-related properties fillOpacity: true, floodOpacity: true, stopOpacity: true, strokeDasharray: true, strokeDashoffset: true, strokeMiterlimit: true, strokeOpacity: true, strokeWidth: true }; var prefixKey = function prefixKey(prefix, key) { return prefix + key.charAt(0).toUpperCase() + key.substring(1); }; var prefixes = ['Webkit', 'Ms', 'Moz', 'O']; isUnitlessNumber = Object.keys(isUnitlessNumber).reduce(function (acc, prop) { prefixes.forEach(function (prefix) { return acc[prefixKey(prefix, prop)] = acc[prop]; }); return acc; }, isUnitlessNumber); function dangerousStyleValue(name, value, isCustomProperty) { if (value == null || typeof value === 'boolean' || value === '') return ''; if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers return ('' + value).trim(); } var attributeCache = {}; injectCreateAnimatedStyle(function (style) { return new AnimatedStyle(style); }); injectDefaultElement('div'); injectStringInterpolator(createStringInterpolator); injectColorNames(colors); injectApplyAnimatedValues(function (instance, props) { if (instance.nodeType && instance.setAttribute !== undefined) { var style = props.style, children = props.children, scrollTop = props.scrollTop, scrollLeft = props.scrollLeft, attributes = _objectWithoutPropertiesLoose(props, ["style", "children", "scrollTop", "scrollLeft"]); var filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter'; if (scrollTop !== void 0) instance.scrollTop = scrollTop; if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value if (children !== void 0) instance.textContent = children; // Set styles ... for (var styleName in style) { if (!style.hasOwnProperty(styleName)) continue; var isCustomProperty = styleName.indexOf('--') === 0; var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty); if (styleName === 'float') styleName = 'cssFloat'; if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue; } // Set attributes ... for (var name in attributes) { // Attributes are written in dash case var dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, function (n) { return '-' + n.toLowerCase(); })); if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]); } return; } else return false; }, function (style) { return style; }); var domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan']; // Extend animated with all the available THREE elements var apply = merge(createAnimatedComponent, false); var extendedAnimated = apply(domElements); exports.apply = apply; exports.config = config; exports.update = update; exports.animated = extendedAnimated; exports.a = extendedAnimated; exports.interpolate = interpolate$1; exports.Globals = Globals; exports.useSpring = useSpring; exports.useTrail = useTrail; exports.useTransition = useTransition; exports.useChain = useChain; exports.useSprings = useSprings; /***/ }), /* 116 */, /* 117 */, /* 118 */, /* 119 */ /***/ (function(module, exports) { // // Main // function memoize (fn, options) { var cache = options && options.cache ? options.cache : cacheDefault var serializer = options && options.serializer ? options.serializer : serializerDefault var strategy = options && options.strategy ? options.strategy : strategyDefault return strategy(fn, { cache: cache, serializer: serializer }) } // // Strategy // function isPrimitive (value) { return value == null || typeof value === 'number' || typeof value === 'boolean' // || typeof value === "string" 'unsafe' primitive for our needs } function monadic (fn, cache, serializer, arg) { var cacheKey = isPrimitive(arg) ? arg : serializer(arg) var computedValue = cache.get(cacheKey) if (typeof computedValue === 'undefined') { computedValue = fn.call(this, arg) cache.set(cacheKey, computedValue) } return computedValue } function variadic (fn, cache, serializer) { var args = Array.prototype.slice.call(arguments, 3) var cacheKey = serializer(args) var computedValue = cache.get(cacheKey) if (typeof computedValue === 'undefined') { computedValue = fn.apply(this, args) cache.set(cacheKey, computedValue) } return computedValue } function assemble (fn, context, strategy, cache, serialize) { return strategy.bind( context, fn, cache, serialize ) } function strategyDefault (fn, options) { var strategy = fn.length === 1 ? monadic : variadic return assemble( fn, this, strategy, options.cache.create(), options.serializer ) } function strategyVariadic (fn, options) { var strategy = variadic return assemble( fn, this, strategy, options.cache.create(), options.serializer ) } function strategyMonadic (fn, options) { var strategy = monadic return assemble( fn, this, strategy, options.cache.create(), options.serializer ) } // // Serializer // function serializerDefault () { return JSON.stringify(arguments) } // // Cache // function ObjectWithoutPrototypeCache () { this.cache = Object.create(null) } ObjectWithoutPrototypeCache.prototype.has = function (key) { return (key in this.cache) } ObjectWithoutPrototypeCache.prototype.get = function (key) { return this.cache[key] } ObjectWithoutPrototypeCache.prototype.set = function (key, value) { this.cache[key] = value } var cacheDefault = { create: function create () { return new ObjectWithoutPrototypeCache() } } // // API // module.exports = memoize module.exports.strategies = { variadic: strategyVariadic, monadic: strategyMonadic } /***/ }), /* 120 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(335); module.exports = Function.prototype.bind || implementation; /***/ }), /* 121 */, /* 122 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Composite; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useComposite; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var _Box_Box_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(67); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(63); /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(81); /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(48); /* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(54); /* harmony import */ var reakit_utils_getActiveElement__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(57); /* harmony import */ var _Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(74); /* harmony import */ var reakit_system_useCreateElement__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(79); /* harmony import */ var reakit_utils_createOnKeyDown__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(82); /* harmony import */ var reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49); /* harmony import */ var reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(97); /* harmony import */ var reakit_utils_fireKeyboardEvent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(105); /* harmony import */ var _CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(52); var isIE11 = typeof window !== "undefined" && "msCrypto" in window; function getNextActiveElementOnBlur(event) { // IE 11 doesn't support event.relatedTarget on blur. // document.activeElement points the the next active element. // On modern browsers, document.activeElement points to the current target. if (isIE11) { var activeElement = Object(reakit_utils_getActiveElement__WEBPACK_IMPORTED_MODULE_9__[/* getActiveElement */ "a"])(event.target); return activeElement; } return event.relatedTarget; } var validCompositeRoles = ["combobox", "grid", "tablist", "listbox", "menu", "menubar", "toolbar", "radiogroup", "tree", "treegrid"]; var isIE11$1 = typeof window !== "undefined" && "msCrypto" in window; function canProxyKeyboardEvent(event) { if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_8__[/* isSelfTarget */ "a"])(event)) return false; if (event.metaKey) return false; if (event.key === "Tab") return false; return true; } function useKeyboardEventProxy(virtual, currentItem, htmlEventHandler) { var eventHandlerRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlEventHandler); return Object(react__WEBPACK_IMPORTED_MODULE_4__["useCallback"])(function (event) { var _eventHandlerRef$curr; if (virtual && canProxyKeyboardEvent(event)) { var currentElement = currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current; if (currentElement) { Object(reakit_utils_fireKeyboardEvent__WEBPACK_IMPORTED_MODULE_15__[/* fireKeyboardEvent */ "a"])(currentElement, event.type, event); // The event will be triggered on the composite item and then // propagated up to this composite element again, so we can pretend // that it wasn't called on this component in the first place. if (event.currentTarget.contains(currentElement)) { event.stopPropagation(); event.preventDefault(); return; } } } (_eventHandlerRef$curr = eventHandlerRef.current) === null || _eventHandlerRef$curr === void 0 ? void 0 : _eventHandlerRef$curr.call(eventHandlerRef, event); }, [virtual, currentItem]); } // istanbul ignore next function useActiveElementRef(elementRef) { var activeElementRef = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])(null); Object(react__WEBPACK_IMPORTED_MODULE_4__["useEffect"])(function () { var document = Object(reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_13__[/* getDocument */ "a"])(elementRef.current); var onFocus = function onFocus(event) { var target = event.target; activeElementRef.current = target; }; document.addEventListener("focus", onFocus, true); return function () { document.removeEventListener("focus", onFocus, true); }; }, []); return activeElementRef; } function findFirstEnabledItemInTheLastRow(items) { return Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__["a"])(Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__["b"])(Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__[/* r */ "f"])(Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__["c"])(items)))); } function isItem(items, element) { return items === null || items === void 0 ? void 0 : items.some(function (item) { return !!element && item.ref.current === element; }); } var useComposite = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ name: "Composite", compose: [_Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_10__[/* useTabbable */ "a"]], useState: _CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__[/* u */ "g"], useOptions: function useOptions(options) { return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, { currentId: Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__[/* g */ "e"])(options) }); }, useProps: function useProps(options, _ref) { var htmlRef = _ref.ref, htmlOnFocus = _ref.onFocus, htmlOnBlur = _ref.onBlur, htmlOnKeyDown = _ref.onKeyDown, htmlOnKeyUp = _ref.onKeyUp, htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["ref", "onFocus", "onBlur", "onKeyDown", "onKeyUp"]); var ref = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])(null); var currentItem = Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_16__[/* f */ "d"])(options.items, options.currentId); var previousItem = Object(react__WEBPACK_IMPORTED_MODULE_4__["useRef"])(undefined); var onFocusRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnFocus); var onBlurRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnBlur); // IE 11 doesn't support event.relatedTarget, so we use the active element // ref instead. var activeElementRef = isIE11$1 ? useActiveElementRef(ref) : undefined; Object(react__WEBPACK_IMPORTED_MODULE_4__["useEffect"])(function () { var element = ref.current; if (!element) { false ? undefined : void 0; return; } if (options.unstable_moves && !currentItem) { // If composite.move(null) has been called, the composite container // will receive focus. element.focus(); } }, [options.unstable_moves, currentItem]); var onKeyDown = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyDown); var onKeyUp = useKeyboardEventProxy(options.unstable_virtual, currentItem, htmlOnKeyUp); var onFocus = Object(react__WEBPACK_IMPORTED_MODULE_4__["useCallback"])(function (event) { var _onFocusRef$current2; if (options.unstable_virtual) { // IE11 doesn't support event.relatedTarget, so we use the active // element ref instead. var previousActiveElement = (activeElementRef === null || activeElementRef === void 0 ? void 0 : activeElementRef.current) || event.relatedTarget; var previousActiveElementWasItem = isItem(options.items, previousActiveElement); if (Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_8__[/* isSelfTarget */ "a"])(event) && !previousActiveElementWasItem) { var _onFocusRef$current, _currentItem$ref$curr; // This means that the composite element has been focused while the // composite item has not. For example, by clicking on the // composite element without touching any item, or by tabbing into // the composite element. In this case, we want to trigger focus on // the item, just like it would happen with roving tabindex. // When it receives focus, the composite item will put focus back // on the composite element, in which case hasItemWithFocus will be // true. (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); currentItem === null || currentItem === void 0 ? void 0 : (_currentItem$ref$curr = currentItem.ref.current) === null || _currentItem$ref$curr === void 0 ? void 0 : _currentItem$ref$curr.focus(); return; } if (previousActiveElementWasItem) { // Composite has been focused as a result of an item receiving // focus. The composite item will move focus back to the composite // container. In this case, we don't want to propagate this // additional event nor call the onFocus handler passed to // (htmlOnFocus). Unless users add DOM // event handlers to the composite element directly, this will be // like this event has never existed. event.stopPropagation(); return; } } else if (Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_8__[/* isSelfTarget */ "a"])(event)) { var _options$setCurrentId; // When the roving tabindex composite gets intentionally focused (for // example, by clicking directly on it, and not on an item), we make // sure to set the current id to null (which means the composite // itself is focused). (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, null); } (_onFocusRef$current2 = onFocusRef.current) === null || _onFocusRef$current2 === void 0 ? void 0 : _onFocusRef$current2.call(onFocusRef, event); }, [options.unstable_virtual, options.items, currentItem, options.setCurrentId]); var onBlur = Object(react__WEBPACK_IMPORTED_MODULE_4__["useCallback"])(function (event) { var _onBlurRef$current; // When virtual is set to true, we move focus from the composite // container (this component) to the composite item that is being // selected. Then we move focus back to the composite container. This // is so we can provide the same API as the roving tabindex method, // which means people can attach onFocus/onBlur handlers on the // CompositeItem component regardless of whether it's virtual or not. // This sequence of blurring and focusing items and composite may be // confusing, so we ignore intermediate focus and blurs by stopping its // propagation and not calling the passed onBlur handler (htmlOnBlur). if (options.unstable_virtual) { var targetIsItem = isItem(options.items, event.target); var nextActiveElement = getNextActiveElementOnBlur(event); var nextActiveElementIsItem = isItem(options.items, nextActiveElement); if (Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_8__[/* isSelfTarget */ "a"])(event) && nextActiveElementIsItem) { var _previousItem$current; // This is an intermediate blur event: blurring the composite // container to focus an item (nextActiveElement). We ignore this // event. if ((_previousItem$current = previousItem.current) === null || _previousItem$current === void 0 ? void 0 : _previousItem$current.ref.current) { // If there's a previous active item we fire a blur event on it // so it will work just like if it had DOM focus before (like when // using roving tabindex). Object(reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_14__[/* fireEvent */ "a"])(previousItem.current.ref.current, "blur", event); } previousItem.current = currentItem; event.stopPropagation(); return; } if (!targetIsItem) { // If target is another thing (probably something outside of the // composite container), we don't ignore the event, but we should // reset the previousItem reference. if (currentItem === null || currentItem === void 0 ? void 0 : currentItem.ref.current) { Object(reakit_utils_fireEvent__WEBPACK_IMPORTED_MODULE_14__[/* fireEvent */ "a"])(currentItem.ref.current, "blur", event); } previousItem.current = undefined; } else { previousItem.current = currentItem; } } (_onBlurRef$current = onBlurRef.current) === null || _onBlurRef$current === void 0 ? void 0 : _onBlurRef$current.call(onBlurRef, event); }, [options.unstable_virtual, options.items, currentItem]); var onMove = Object(react__WEBPACK_IMPORTED_MODULE_4__["useMemo"])(function () { return Object(reakit_utils_createOnKeyDown__WEBPACK_IMPORTED_MODULE_12__[/* createOnKeyDown */ "a"])({ onKeyDown: onKeyDown, stopPropagation: true, shouldKeyDown: function shouldKeyDown(event) { return Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_8__[/* isSelfTarget */ "a"])(event) && options.currentId === null; }, keyMap: function keyMap() { var _options$groups; var isVertical = options.orientation !== "horizontal"; var isHorizontal = options.orientation !== "vertical"; var isGrid = !!((_options$groups = options.groups) === null || _options$groups === void 0 ? void 0 : _options$groups.length); var up = function up() { if (isGrid) { var item = findFirstEnabledItemInTheLastRow(options.items); if (item === null || item === void 0 ? void 0 : item.id) { var _options$move; (_options$move = options.move) === null || _options$move === void 0 ? void 0 : _options$move.call(options, item.id); } } else { var _options$last; (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); } }; var first = options.first && function () { return options.first(); }; var last = options.last && function () { return options.last(); }; return { ArrowUp: (isGrid || isVertical) && up, ArrowRight: (isGrid || isHorizontal) && first, ArrowDown: (isGrid || isVertical) && first, ArrowLeft: (isGrid || isHorizontal) && last, Home: first, End: last, PageUp: first, PageDown: last }; } }); }, [onKeyDown, options.currentId, options.orientation, options.groups, options.items, options.move, options.last, options.first]); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_5__[/* useForkRef */ "a"])(ref, htmlRef), id: options.baseId, onFocus: onFocus, onBlur: onBlur, onKeyDown: onMove, onKeyUp: onKeyUp, "aria-activedescendant": options.unstable_virtual ? (currentItem === null || currentItem === void 0 ? void 0 : currentItem.id) || undefined : undefined }, htmlProps); }, useComposeProps: function useComposeProps(options, htmlProps) { htmlProps = Object(_Box_Box_js__WEBPACK_IMPORTED_MODULE_3__[/* useBox */ "a"])(options, htmlProps, true); var tabbableHTMLProps = Object(_Tabbable_Tabbable_js__WEBPACK_IMPORTED_MODULE_10__[/* useTabbable */ "a"])(options, htmlProps, true); if (options.unstable_virtual || options.currentId === null) { // Composite will only be tabbable by default if the focus is managed // using aria-activedescendant, which requires DOM focus on the container // element (the composite) return tabbableHTMLProps; } return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, htmlProps), {}, { ref: tabbableHTMLProps.ref }); } }); var Composite = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ as: "div", useHook: useComposite, useCreateElement: function useCreateElement$1(type, props, children) { false ? undefined : void 0; false ? undefined : void 0; return Object(reakit_system_useCreateElement__WEBPACK_IMPORTED_MODULE_11__[/* useCreateElement */ "a"])(type, props, children); } }); /***/ }), /* 123 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return CompositeItem; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useCompositeItem; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(51); /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(50); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(63); /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81); /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(48); /* harmony import */ var reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(54); /* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(70); /* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73); /* harmony import */ var reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(72); /* harmony import */ var _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(88); /* harmony import */ var reakit_utils_createOnKeyDown__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(82); /* harmony import */ var reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(49); /* harmony import */ var _CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(52); /* harmony import */ var _Id_Id_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(96); /* harmony import */ var reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(98); /* harmony import */ var _setTextFieldValue_78ab5d56_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(99); function getWidget(itemElement) { return itemElement.querySelector("[data-composite-item-widget]"); } function useItem(options) { return Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () { var _options$items; return (_options$items = options.items) === null || _options$items === void 0 ? void 0 : _options$items.find(function (item) { return options.id && item.id === options.id; }); }, [options.items, options.id]); } function targetIsAnotherItem(event, items) { if (Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return false; for (var _iterator = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* b */ "c"])(items), _step; !(_step = _iterator()).done;) { var item = _step.value; if (item.ref.current === event.target) { return true; } } return false; } var useCompositeItem = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ name: "CompositeItem", compose: [_Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_11__[/* useClickable */ "a"], _Id_Id_js__WEBPACK_IMPORTED_MODULE_15__[/* unstable_useId */ "a"]], useState: _CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_14__[/* u */ "g"], propsAreEqual: function propsAreEqual(prev, next) { if (!next.id || prev.id !== next.id) { return _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_11__[/* useClickable */ "a"].unstable_propsAreEqual(prev, next); } var prevCurrentId = prev.currentId, prevMoves = prev.unstable_moves, prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(prev, ["currentId", "unstable_moves"]); var nextCurrentId = next.currentId, nextMoves = next.unstable_moves, nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(next, ["currentId", "unstable_moves"]); if (nextCurrentId !== prevCurrentId) { if (next.id === nextCurrentId || next.id === prevCurrentId) { return false; } } else if (prevMoves !== nextMoves) { return false; } return _Clickable_Clickable_js__WEBPACK_IMPORTED_MODULE_11__[/* useClickable */ "a"].unstable_propsAreEqual(prevProps, nextProps); }, useOptions: function useOptions(options) { return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({}, options), {}, { id: options.id, currentId: Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_14__[/* g */ "e"])(options), unstable_clickOnSpace: options.unstable_hasActiveWidget ? false : options.unstable_clickOnSpace }); }, useProps: function useProps(options, _ref) { var _options$items2; var htmlRef = _ref.ref, _ref$tabIndex = _ref.tabIndex, htmlTabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex, htmlOnFocus = _ref.onFocus, htmlOnBlur = _ref.onBlur, htmlOnKeyDown = _ref.onKeyDown, htmlOnClick = _ref.onClick, htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref, ["ref", "tabIndex", "onFocus", "onBlur", "onKeyDown", "onClick"]); var ref = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null); var id = options.id; var trulyDisabled = options.disabled && !options.focusable; var isCurrentItem = options.currentId === id; var isCurrentItemRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(isCurrentItem); var hasFocusedComposite = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(false); var item = useItem(options); var onFocusRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnFocus); var onBlurRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnBlur); var onKeyDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnKeyDown); var onClickRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_6__[/* useLiveRef */ "a"])(htmlOnClick); var shouldTabIndex = !options.unstable_virtual && !options.unstable_hasActiveWidget && isCurrentItem || // We don't want to set tabIndex="-1" when using CompositeItem as a // standalone component, without state props. !((_options$items2 = options.items) === null || _options$items2 === void 0 ? void 0 : _options$items2.length); Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () { var _options$registerItem; if (!id) return undefined; (_options$registerItem = options.registerItem) === null || _options$registerItem === void 0 ? void 0 : _options$registerItem.call(options, { id: id, ref: ref, disabled: !!trulyDisabled }); return function () { var _options$unregisterIt; (_options$unregisterIt = options.unregisterItem) === null || _options$unregisterIt === void 0 ? void 0 : _options$unregisterIt.call(options, id); }; }, [id, trulyDisabled, options.registerItem, options.unregisterItem]); Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () { var element = ref.current; if (!element) { false ? undefined : void 0; return; } // `moves` will be incremented whenever next, previous, up, down, first, // last or move have been called. This means that the composite item will // be focused whenever some of these functions are called. We're using // isCurrentItemRef instead of isCurrentItem because we don't want to // focus the item if isCurrentItem changes (and options.moves doesn't). if (options.unstable_moves && isCurrentItemRef.current) { element.focus(); } }, [options.unstable_moves]); var onFocus = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { var _onFocusRef$current, _options$setCurrentId; (_onFocusRef$current = onFocusRef.current) === null || _onFocusRef$current === void 0 ? void 0 : _onFocusRef$current.call(onFocusRef, event); if (event.defaultPrevented) return; if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_9__[/* isPortalEvent */ "a"])(event)) return; if (!id) return; if (targetIsAnotherItem(event, options.items)) return; (_options$setCurrentId = options.setCurrentId) === null || _options$setCurrentId === void 0 ? void 0 : _options$setCurrentId.call(options, id); // When using aria-activedescendant, we want to make sure that the // composite container receives focus, not the composite item. // But we don't want to do this if the target is another focusable // element inside the composite item, such as CompositeItemWidget. if (options.unstable_virtual && options.baseId && Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) { var target = event.target; var composite = Object(reakit_utils_getDocument__WEBPACK_IMPORTED_MODULE_13__[/* getDocument */ "a"])(target).getElementById(options.baseId); if (composite) { hasFocusedComposite.current = true; Object(reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_10__[/* ensureFocus */ "a"])(composite); } } }, [id, options.items, options.setCurrentId, options.unstable_virtual, options.baseId]); var onBlur = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { var _onBlurRef$current; if (options.unstable_virtual) { if (hasFocusedComposite.current) { // When hasFocusedComposite is true, composite has been focused // right after focusing this item. This is an intermediate blur // event, so we ignore it. hasFocusedComposite.current = false; event.preventDefault(); event.stopPropagation(); return; } } (_onBlurRef$current = onBlurRef.current) === null || _onBlurRef$current === void 0 ? void 0 : _onBlurRef$current.call(onBlurRef, event); }, [options.unstable_virtual]); var onCharacterKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { var _onKeyDownRef$current; (_onKeyDownRef$current = onKeyDownRef.current) === null || _onKeyDownRef$current === void 0 ? void 0 : _onKeyDownRef$current.call(onKeyDownRef, event); if (!Object(reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"])(event)) return; if (event.key.length === 1 && event.key !== " ") { var widget = getWidget(event.currentTarget); if (widget && Object(reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_16__[/* isTextField */ "a"])(widget)) { widget.focus(); var key = event.key; // Using RAF here because otherwise the key will be added twice // to the input when using roving tabindex window.requestAnimationFrame(function () { Object(_setTextFieldValue_78ab5d56_js__WEBPACK_IMPORTED_MODULE_17__[/* s */ "a"])(widget, key); }); } } }, []); var onKeyDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useMemo"])(function () { return Object(reakit_utils_createOnKeyDown__WEBPACK_IMPORTED_MODULE_12__[/* createOnKeyDown */ "a"])({ onKeyDown: onCharacterKeyDown, stopPropagation: true, // We don't want to listen to focusable elements inside the composite // item, such as a CompositeItemWidget. shouldKeyDown: reakit_utils_isSelfTarget__WEBPACK_IMPORTED_MODULE_7__[/* isSelfTarget */ "a"], keyMap: function keyMap() { // `options.orientation` can also be undefined, which means that // both `isVertical` and `isHorizontal` will be `true`. var isVertical = options.orientation !== "horizontal"; var isHorizontal = options.orientation !== "vertical"; var isGrid = !!(item === null || item === void 0 ? void 0 : item.groupId); var Delete = function Delete(event) { var widget = getWidget(event.currentTarget); if (widget && Object(reakit_utils_isTextField__WEBPACK_IMPORTED_MODULE_16__[/* isTextField */ "a"])(widget)) { Object(_setTextFieldValue_78ab5d56_js__WEBPACK_IMPORTED_MODULE_17__[/* s */ "a"])(widget, ""); } }; var up = options.up && function () { return options.up(); }; var next = options.next && function () { return options.next(); }; var down = options.down && function () { return options.down(); }; var previous = options.previous && function () { return options.previous(); }; return { Delete: Delete, Backspace: Delete, ArrowUp: (isGrid || isVertical) && up, ArrowRight: (isGrid || isHorizontal) && next, ArrowDown: (isGrid || isVertical) && down, ArrowLeft: (isGrid || isHorizontal) && previous, Home: function Home(event) { if (!isGrid || event.ctrlKey) { var _options$first; (_options$first = options.first) === null || _options$first === void 0 ? void 0 : _options$first.call(options); } else { var _options$previous; (_options$previous = options.previous) === null || _options$previous === void 0 ? void 0 : _options$previous.call(options, true); } }, End: function End(event) { if (!isGrid || event.ctrlKey) { var _options$last; (_options$last = options.last) === null || _options$last === void 0 ? void 0 : _options$last.call(options); } else { var _options$next; (_options$next = options.next) === null || _options$next === void 0 ? void 0 : _options$next.call(options, true); } }, PageUp: function PageUp() { if (isGrid) { var _options$up; (_options$up = options.up) === null || _options$up === void 0 ? void 0 : _options$up.call(options, true); } else { var _options$first2; (_options$first2 = options.first) === null || _options$first2 === void 0 ? void 0 : _options$first2.call(options); } }, PageDown: function PageDown() { if (isGrid) { var _options$down; (_options$down = options.down) === null || _options$down === void 0 ? void 0 : _options$down.call(options, true); } else { var _options$last2; (_options$last2 = options.last) === null || _options$last2 === void 0 ? void 0 : _options$last2.call(options); } } }; } }); }, [onCharacterKeyDown, options.orientation, item, options.up, options.next, options.down, options.previous, options.first, options.last]); var onClick = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { var _onClickRef$current; (_onClickRef$current = onClickRef.current) === null || _onClickRef$current === void 0 ? void 0 : _onClickRef$current.call(onClickRef, event); if (event.defaultPrevented) return; var element = event.currentTarget; var widget = getWidget(element); if (widget && !Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_8__[/* hasFocusWithin */ "a"])(widget)) { // If there's a widget inside the composite item, we make sure it's // focused when pressing enter, space or clicking on the composite item. widget.focus(); } }, []); return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__[/* useForkRef */ "a"])(ref, htmlRef), id: id, tabIndex: shouldTabIndex ? htmlTabIndex : -1, "aria-selected": options.unstable_virtual && isCurrentItem ? true : undefined, onFocus: onFocus, onBlur: onBlur, onKeyDown: onKeyDown, onClick: onClick }, htmlProps); } }); var CompositeItem = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ as: "button", memo: true, useHook: useCompositeItem }); /***/ }), /* 124 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return useAnimate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Animate; }); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * External dependencies */ function getDefaultOrigin(type) { return type === 'appear' ? 'top' : 'left'; } function useAnimate(_ref) { var type = _ref.type, _ref$origin = _ref.origin, origin = _ref$origin === void 0 ? getDefaultOrigin(type) : _ref$origin; if (type === 'appear') { var _classnames; var _origin$split = origin.split(' '), _origin$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_origin$split, 2), yAxis = _origin$split2[0], _origin$split2$ = _origin$split2[1], xAxis = _origin$split2$ === void 0 ? 'center' : _origin$split2$; return classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__appear', (_classnames = {}, Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_classnames, 'is-from-' + xAxis, xAxis !== 'center'), Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(_classnames, 'is-from-' + yAxis, yAxis !== 'middle'), _classnames)); } if (type === 'slide-in') { return classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__slide-in', 'is-from-' + origin); } if (type === 'loading') { return classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__loading'); } } function Animate(_ref2) { var type = _ref2.type, _ref2$options = _ref2.options, options = _ref2$options === void 0 ? {} : _ref2$options, children = _ref2.children; return children({ className: useAnimate(_objectSpread({ type: type }, options)) }); } /***/ }), /* 125 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ slot_fill_Slot; }); __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ slot_fill_Fill; }); __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ createSlotFill; }); // UNUSED EXPORTS: useSlot, Provider // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(8); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(14); // EXTERNAL MODULE: external {"this":["wp","element"]} var external_this_wp_element_ = __webpack_require__(0); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js var classCallCheck = __webpack_require__(21); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js var createClass = __webpack_require__(22); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js var assertThisInitialized = __webpack_require__(16); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js var getPrototypeOf = __webpack_require__(19); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/superPropBase.js function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = Object(getPrototypeOf["a" /* default */])(object); if (object === null) break; } return object; } // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/get.js function get_get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { get_get = Reflect.get; } else { get_get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return get_get(target, property, receiver || target); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules var inherits = __webpack_require__(23); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js var possibleConstructorReturn = __webpack_require__(24); // EXTERNAL MODULE: external {"this":"lodash"} var external_this_lodash_ = __webpack_require__(2); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js + 1 modules var context = __webpack_require__(129); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var slot_SlotComponent = /*#__PURE__*/function (_Component) { Object(inherits["a" /* default */])(SlotComponent, _Component); var _super = _createSuper(SlotComponent); function SlotComponent() { var _this; Object(classCallCheck["a" /* default */])(this, SlotComponent); _this = _super.apply(this, arguments); _this.isUnmounted = false; _this.bindNode = _this.bindNode.bind(Object(assertThisInitialized["a" /* default */])(_this)); return _this; } Object(createClass["a" /* default */])(SlotComponent, [{ key: "componentDidMount", value: function componentDidMount() { var registerSlot = this.props.registerSlot; registerSlot(this.props.name, this); } }, { key: "componentWillUnmount", value: function componentWillUnmount() { var unregisterSlot = this.props.unregisterSlot; this.isUnmounted = true; unregisterSlot(this.props.name, this); } }, { key: "componentDidUpdate", value: function componentDidUpdate(prevProps) { var _this$props = this.props, name = _this$props.name, unregisterSlot = _this$props.unregisterSlot, registerSlot = _this$props.registerSlot; if (prevProps.name !== name) { unregisterSlot(prevProps.name); registerSlot(name, this); } } }, { key: "bindNode", value: function bindNode(node) { this.node = node; } }, { key: "forceUpdate", value: function forceUpdate() { if (this.isUnmounted) { return; } get_get(Object(getPrototypeOf["a" /* default */])(SlotComponent.prototype), "forceUpdate", this).call(this); } }, { key: "render", value: function render() { var _this$props2 = this.props, children = _this$props2.children, name = _this$props2.name, _this$props2$fillProp = _this$props2.fillProps, fillProps = _this$props2$fillProp === void 0 ? {} : _this$props2$fillProp, getFills = _this$props2.getFills; var fills = Object(external_this_lodash_["map"])(getFills(name, this), function (fill) { var fillKey = fill.occurrence; var fillChildren = Object(external_this_lodash_["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children; return external_this_wp_element_["Children"].map(fillChildren, function (child, childIndex) { if (!child || Object(external_this_lodash_["isString"])(child)) { return child; } var childKey = "".concat(fillKey, "---").concat(child.key || childIndex); return Object(external_this_wp_element_["cloneElement"])(child, { key: childKey }); }); }).filter( // In some cases fills are rendered only when some conditions apply. // This ensures that we only use non-empty fills when rendering, i.e., // it allows us to render wrappers only when the fills are actually present. Object(external_this_lodash_["negate"])(external_this_wp_element_["isEmptyElement"])); return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_lodash_["isFunction"])(children) ? children(fills) : fills); } }]); return SlotComponent; }(external_this_wp_element_["Component"]); var slot_Slot = function Slot(props) { return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref) { var registerSlot = _ref.registerSlot, unregisterSlot = _ref.unregisterSlot, getFills = _ref.getFills; return Object(external_this_wp_element_["createElement"])(slot_SlotComponent, Object(esm_extends["a" /* default */])({}, props, { registerSlot: registerSlot, unregisterSlot: unregisterSlot, getFills: getFills })); }); }; /* harmony default export */ var slot_fill_slot = (slot_Slot); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var occurrences = 0; function fill_FillComponent(_ref) { var name = _ref.name, children = _ref.children, registerFill = _ref.registerFill, unregisterFill = _ref.unregisterFill; var slot = Object(context["c" /* useSlot */])(name); var ref = Object(external_this_wp_element_["useRef"])({ name: name, children: children }); if (!ref.current.occurrence) { ref.current.occurrence = ++occurrences; } Object(external_this_wp_element_["useLayoutEffect"])(function () { registerFill(name, ref.current); return function () { return unregisterFill(name, ref.current); }; }, []); Object(external_this_wp_element_["useLayoutEffect"])(function () { ref.current.children = children; if (slot) { slot.forceUpdate(); } }, [children]); Object(external_this_wp_element_["useLayoutEffect"])(function () { if (name === ref.current.name) { // ignore initial effect return; } unregisterFill(ref.current.name, ref.current); ref.current.name = name; registerFill(name, ref.current); }, [name]); if (!slot || !slot.node) { return null; } // If a function is passed as a child, provide it with the fillProps. if (Object(external_this_lodash_["isFunction"])(children)) { children = children(slot.props.fillProps); } return Object(external_this_wp_element_["createPortal"])(children, slot.node); } var fill_Fill = function Fill(props) { return Object(external_this_wp_element_["createElement"])(context["a" /* Consumer */], null, function (_ref2) { var registerFill = _ref2.registerFill, unregisterFill = _ref2.unregisterFill; return Object(external_this_wp_element_["createElement"])(fill_FillComponent, Object(esm_extends["a" /* default */])({}, props, { registerFill: registerFill, unregisterFill: unregisterFill })); }); }; /* harmony default export */ var slot_fill_fill = (fill_Fill); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js var slot_fill_context = __webpack_require__(138); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js /** * WordPress dependencies */ /** * Internal dependencies */ function bubbles_virtually_slot_Slot(_ref) { var name = _ref.name, _ref$fillProps = _ref.fillProps, fillProps = _ref$fillProps === void 0 ? {} : _ref$fillProps, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'div' : _ref$as, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["name", "fillProps", "as"]); var registry = Object(external_this_wp_element_["useContext"])(slot_fill_context["a" /* default */]); var ref = Object(external_this_wp_element_["useRef"])(); Object(external_this_wp_element_["useLayoutEffect"])(function () { registry.registerSlot(name, ref, fillProps); return function () { registry.unregisterSlot(name, ref); }; // We are not including fillProps in the deps because we don't want to // unregister and register the slot whenever fillProps change, which would // cause the fill to be re-mounted. We are only considering the initial value // of fillProps. }, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we // useLayoutEffect Object(external_this_wp_element_["useLayoutEffect"])(function () { registry.updateSlot(name, fillProps); }); return Object(external_this_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({ ref: ref }, props)); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules var slicedToArray = __webpack_require__(12); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js var use_slot = __webpack_require__(165); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js /** * WordPress dependencies */ /** * Internal dependencies */ function useForceUpdate() { var _useState = Object(external_this_wp_element_["useState"])({}), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), setState = _useState2[1]; return function () { return setState({}); }; } function bubbles_virtually_fill_Fill(_ref) { var name = _ref.name, children = _ref.children; var slot = Object(use_slot["a" /* default */])(name); var ref = Object(external_this_wp_element_["useRef"])({ rerender: useForceUpdate() }); Object(external_this_wp_element_["useEffect"])(function () { // We register fills so we can keep track of their existance. // Some Slot implementations need to know if there're already fills // registered so they can choose to render themselves or not. slot.registerFill(ref); return function () { slot.unregisterFill(ref); }; }, [slot.registerFill, slot.unregisterFill]); if (!slot.ref || !slot.ref.current) { return null; } if (typeof children === 'function') { children = children(slot.fillProps); } return Object(external_this_wp_element_["createPortal"])(children, slot.ref.current); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js /** * Internal dependencies */ function slot_fill_Slot(_ref) { var bubblesVirtually = _ref.bubblesVirtually, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["bubblesVirtually"]); if (bubblesVirtually) { return Object(external_this_wp_element_["createElement"])(bubbles_virtually_slot_Slot, props); } return Object(external_this_wp_element_["createElement"])(slot_fill_slot, props); } function slot_fill_Fill(props) { // We're adding both Fills here so they can register themselves before // their respective slot has been registered. Only the Fill that has a slot // will render. The other one will return null. return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(slot_fill_fill, props), Object(external_this_wp_element_["createElement"])(bubbles_virtually_fill_Fill, props)); } function createSlotFill(name) { var FillComponent = function FillComponent(props) { return Object(external_this_wp_element_["createElement"])(slot_fill_Fill, Object(esm_extends["a" /* default */])({ name: name }, props)); }; FillComponent.displayName = name + 'Fill'; var SlotComponent = function SlotComponent(props) { return Object(external_this_wp_element_["createElement"])(slot_fill_Slot, Object(esm_extends["a" /* default */])({ name: name }, props)); }; SlotComponent.displayName = name + 'Slot'; return { Fill: FillComponent, Slot: SlotComponent }; } /***/ }), /* 126 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createEvent; }); /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49); /** * Creates an `Event` in a way that also works on IE 11. * * @example * import { createEvent } from "reakit-utils"; * * const el = document.getElementById("id"); * el.dispatchEvent(createEvent(el, "blur", { bubbles: false })); */ function createEvent(element, type, eventInit) { var _eventInit, _eventInit2; if (eventInit === void 0) { eventInit = {}; } if (typeof Event === "function") { return new Event(type, eventInit); } // IE 11 doesn't support Event constructors var event = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element).createEvent("Event"); event.initEvent(type, (_eventInit = eventInit) === null || _eventInit === void 0 ? void 0 : _eventInit.bubbles, (_eventInit2 = eventInit) === null || _eventInit2 === void 0 ? void 0 : _eventInit2.cancelable); return event; } /***/ }), /* 127 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = __webpack_require__(184); /***/ }), /* 128 */, /* 129 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ context_useSlot; }); __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ Consumer; }); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules var slicedToArray = __webpack_require__(12); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules var toConsumableArray = __webpack_require__(17); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js var classCallCheck = __webpack_require__(21); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js var createClass = __webpack_require__(22); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js var assertThisInitialized = __webpack_require__(16); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js + 1 modules var inherits = __webpack_require__(23); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js var possibleConstructorReturn = __webpack_require__(24); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js var getPrototypeOf = __webpack_require__(19); // EXTERNAL MODULE: external {"this":["wp","element"]} var external_this_wp_element_ = __webpack_require__(0); // EXTERNAL MODULE: external {"this":"lodash"} var external_this_lodash_ = __webpack_require__(2); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js var esm_typeof = __webpack_require__(40); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(14); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__(5); // EXTERNAL MODULE: external {"this":["wp","isShallowEqual"]} var external_this_wp_isShallowEqual_ = __webpack_require__(64); var external_this_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_this_wp_isShallowEqual_); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js var slot_fill_context = __webpack_require__(138); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return Object(esm_typeof["a" /* default */])(key) === "symbol" ? key : String(key); } function _toPrimitive(input, hint) { if (Object(esm_typeof["a" /* default */])(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (Object(esm_typeof["a" /* default */])(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * WordPress dependencies */ /** * Internal dependencies */ function useSlotRegistry() { var _useState = Object(external_this_wp_element_["useState"])({}), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), slots = _useState2[0], setSlots = _useState2[1]; var _useState3 = Object(external_this_wp_element_["useState"])({}), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), fills = _useState4[0], setFills = _useState4[1]; var registerSlot = Object(external_this_wp_element_["useCallback"])(function (name, ref, fillProps) { setSlots(function (prevSlots) { var slot = prevSlots[name] || {}; return _objectSpread(_objectSpread({}, prevSlots), {}, Object(defineProperty["a" /* default */])({}, name, _objectSpread(_objectSpread({}, slot), {}, { ref: ref || slot.ref, fillProps: fillProps || slot.fillProps || {} }))); }); }, []); var unregisterSlot = Object(external_this_wp_element_["useCallback"])(function (name, ref) { setSlots(function (prevSlots) { var slot = prevSlots[name], nextSlots = Object(objectWithoutProperties["a" /* default */])(prevSlots, [name].map(_toPropertyKey)); // Make sure we're not unregistering a slot registered by another element // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412 if ((slot === null || slot === void 0 ? void 0 : slot.ref) === ref) { return nextSlots; } return prevSlots; }); }, []); var updateSlot = Object(external_this_wp_element_["useCallback"])(function (name, fillProps) { var slot = slots[name]; if (!slot) { return; } if (!external_this_wp_isShallowEqual_default()(slot.fillProps, fillProps)) { slot.fillProps = fillProps; var slotFills = fills[name]; if (slotFills) { // Force update fills slotFills.map(function (fill) { return fill.current.rerender(); }); } } }, [slots, fills]); var registerFill = Object(external_this_wp_element_["useCallback"])(function (name, ref) { setFills(function (prevFills) { return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, [].concat(Object(toConsumableArray["a" /* default */])(prevFills[name] || []), [ref]))); }); }, []); var unregisterFill = Object(external_this_wp_element_["useCallback"])(function (name, ref) { setFills(function (prevFills) { if (prevFills[name]) { return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, prevFills[name].filter(function (fillRef) { return fillRef !== ref; }))); } return prevFills; }); }, []); // Memoizing the return value so it can be directly passed to Provider value var registry = Object(external_this_wp_element_["useMemo"])(function () { return { slots: slots, fills: fills, registerSlot: registerSlot, updateSlot: updateSlot, unregisterSlot: unregisterSlot, registerFill: registerFill, unregisterFill: unregisterFill }; }, [slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill]); return registry; } function slot_fill_provider_SlotFillProvider(_ref) { var children = _ref.children; var registry = useSlotRegistry(); return Object(external_this_wp_element_["createElement"])(slot_fill_context["a" /* default */].Provider, { value: registry }, children); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(getPrototypeOf["a" /* default */])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(getPrototypeOf["a" /* default */])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(possibleConstructorReturn["a" /* default */])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var SlotFillContext = Object(external_this_wp_element_["createContext"])({ registerSlot: function registerSlot() {}, unregisterSlot: function unregisterSlot() {}, registerFill: function registerFill() {}, unregisterFill: function unregisterFill() {}, getSlot: function getSlot() {}, getFills: function getFills() {}, subscribe: function subscribe() {} }); var Provider = SlotFillContext.Provider, Consumer = SlotFillContext.Consumer; var context_SlotFillProvider = /*#__PURE__*/function (_Component) { Object(inherits["a" /* default */])(SlotFillProvider, _Component); var _super = _createSuper(SlotFillProvider); function SlotFillProvider() { var _this; Object(classCallCheck["a" /* default */])(this, SlotFillProvider); _this = _super.apply(this, arguments); _this.registerSlot = _this.registerSlot.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.registerFill = _this.registerFill.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.unregisterSlot = _this.unregisterSlot.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.unregisterFill = _this.unregisterFill.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.getSlot = _this.getSlot.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.getFills = _this.getFills.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.hasFills = _this.hasFills.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.subscribe = _this.subscribe.bind(Object(assertThisInitialized["a" /* default */])(_this)); _this.slots = {}; _this.fills = {}; _this.listeners = []; _this.contextValue = { registerSlot: _this.registerSlot, unregisterSlot: _this.unregisterSlot, registerFill: _this.registerFill, unregisterFill: _this.unregisterFill, getSlot: _this.getSlot, getFills: _this.getFills, hasFills: _this.hasFills, subscribe: _this.subscribe }; return _this; } Object(createClass["a" /* default */])(SlotFillProvider, [{ key: "registerSlot", value: function registerSlot(name, slot) { var previousSlot = this.slots[name]; this.slots[name] = slot; this.triggerListeners(); // Sometimes the fills are registered after the initial render of slot // But before the registerSlot call, we need to rerender the slot this.forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the // same name exists, force its update _after_ the new slot has been // assigned into the instance, such that its own rendering of children // will be empty (the new Slot will subsume all fills for this name). if (previousSlot) { previousSlot.forceUpdate(); } } }, { key: "registerFill", value: function registerFill(name, instance) { this.fills[name] = [].concat(Object(toConsumableArray["a" /* default */])(this.fills[name] || []), [instance]); this.forceUpdateSlot(name); } }, { key: "unregisterSlot", value: function unregisterSlot(name, instance) { // If a previous instance of a Slot by this name unmounts, do nothing, // as the slot and its fills should only be removed for the current // known instance. if (this.slots[name] !== instance) { return; } delete this.slots[name]; this.triggerListeners(); } }, { key: "unregisterFill", value: function unregisterFill(name, instance) { this.fills[name] = Object(external_this_lodash_["without"])(this.fills[name], instance); this.resetFillOccurrence(name); this.forceUpdateSlot(name); } }, { key: "getSlot", value: function getSlot(name) { return this.slots[name]; } }, { key: "getFills", value: function getFills(name, slotInstance) { // Fills should only be returned for the current instance of the slot // in which they occupy. if (this.slots[name] !== slotInstance) { return []; } return Object(external_this_lodash_["sortBy"])(this.fills[name], 'occurrence'); } }, { key: "hasFills", value: function hasFills(name) { return this.fills[name] && !!this.fills[name].length; } }, { key: "resetFillOccurrence", value: function resetFillOccurrence(name) { Object(external_this_lodash_["forEach"])(this.fills[name], function (instance) { instance.occurrence = undefined; }); } }, { key: "forceUpdateSlot", value: function forceUpdateSlot(name) { var slot = this.getSlot(name); if (slot) { slot.forceUpdate(); } } }, { key: "triggerListeners", value: function triggerListeners() { this.listeners.forEach(function (listener) { return listener(); }); } }, { key: "subscribe", value: function subscribe(listener) { var _this2 = this; this.listeners.push(listener); return function () { _this2.listeners = Object(external_this_lodash_["without"])(_this2.listeners, listener); }; } }, { key: "render", value: function render() { return Object(external_this_wp_element_["createElement"])(Provider, { value: this.contextValue }, Object(external_this_wp_element_["createElement"])(slot_fill_provider_SlotFillProvider, null, this.props.children)); } }]); return SlotFillProvider; }(external_this_wp_element_["Component"]); /** * React hook returning the active slot given a name. * * @param {string} name Slot name. * @return {Object} Slot object. */ var context_useSlot = function useSlot(name) { var _useContext = Object(external_this_wp_element_["useContext"])(SlotFillContext), getSlot = _useContext.getSlot, subscribe = _useContext.subscribe; var _useState = Object(external_this_wp_element_["useState"])(getSlot(name)), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), slot = _useState2[0], setSlot = _useState2[1]; Object(external_this_wp_element_["useEffect"])(function () { setSlot(getSlot(name)); var unsubscribe = subscribe(function () { setSlot(getSlot(name)); }); return unsubscribe; }, [name]); return slot; }; /* harmony default export */ var context = __webpack_exports__["b"] = (context_SlotFillProvider); /***/ }), /* 130 */, /* 131 */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || new Function("return this")(); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 132 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey module.exports = function IsPropertyKey(argument) { return typeof argument === 'string' || typeof argument === 'symbol'; }; /***/ }), /* 133 */, /* 134 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(19); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(10); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(18); /* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(29); /* harmony import */ var _wordpress_dom__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_wordpress_dom__WEBPACK_IMPORTED_MODULE_9__); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * WordPress dependencies */ var withConstrainedTabbing = Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_7__["createHigherOrderComponent"])(function (WrappedComponent) { return /*#__PURE__*/function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_class, _Component); var _super = _createSuper(_class); function _class() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, _class); _this = _super.apply(this, arguments); _this.focusContainRef = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createRef"])(); _this.handleTabBehaviour = _this.handleTabBehaviour.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_this)); return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_class, [{ key: "handleTabBehaviour", value: function handleTabBehaviour(event) { if (event.keyCode !== _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_8__["TAB"]) { return; } var tabbables = _wordpress_dom__WEBPACK_IMPORTED_MODULE_9__["focus"].tabbable.find(this.focusContainRef.current); if (!tabbables.length) { return; } var firstTabbable = tabbables[0]; var lastTabbable = tabbables[tabbables.length - 1]; if (event.shiftKey && event.target === firstTabbable) { event.preventDefault(); lastTabbable.focus(); } else if (!event.shiftKey && event.target === lastTabbable) { event.preventDefault(); firstTabbable.focus(); /* * When pressing Tab and none of the tabbables has focus, the keydown * event happens on the wrapper div: move focus on the first tabbable. */ } else if (!tabbables.includes(event.target)) { event.preventDefault(); firstTabbable.focus(); } } }, { key: "render", value: function render() { // Disable reason: this component is non-interactive, but must capture // events from the wrapped component to determine when the Tab key is used. /* eslint-disable jsx-a11y/no-static-element-interactions */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { onKeyDown: this.handleTabBehaviour, ref: this.focusContainRef, tabIndex: "-1" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(WrappedComponent, this.props)); /* eslint-enable jsx-a11y/no-static-element-interactions */ } }]); return _class; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); }, 'withConstrainedTabbing'); /* harmony default export */ __webpack_exports__["a"] = (withConstrainedTabbing); /***/ }), /* 135 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(23); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(19); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(10); /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__); /* harmony import */ var _context__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(199); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * Returns true if the given object is component-like. An object is component- * like if it is an instance of wp.element.Component, or is a function. * * @param {*} object Object to test. * * @return {boolean} Whether object is component-like. */ function isComponentLike(object) { return object instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"] || typeof object === 'function'; } /** * Higher Order Component used to be used to wrap disposable elements like * sidebars, modals, dropdowns. When mounting the wrapped component, we track a * reference to the current active element so we know where to restore focus * when the component is unmounted. * * @param {(WPComponent|Object)} options The component to be enhanced with * focus return behavior, or an object * describing the component and the * focus return characteristics. * * @return {WPComponent} Component with the focus restauration behaviour. */ function withFocusReturn(options) { // Normalize as overloaded form `withFocusReturn( options )( Component )` // or as `withFocusReturn( Component )`. if (isComponentLike(options)) { var WrappedComponent = options; return withFocusReturn({})(WrappedComponent); } var _options$onFocusRetur = options.onFocusReturn, onFocusReturn = _options$onFocusRetur === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_7__["stubTrue"] : _options$onFocusRetur; return function (WrappedComponent) { var FocusReturn = /*#__PURE__*/function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(FocusReturn, _Component); var _super = _createSuper(FocusReturn); function FocusReturn() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(this, FocusReturn); _this = _super.apply(this, arguments); _this.ownFocusedElements = new Set(); _this.activeElementOnMount = document.activeElement; _this.setIsFocusedFalse = function () { return _this.isFocused = false; }; _this.setIsFocusedTrue = function (event) { _this.ownFocusedElements.add(event.target); _this.isFocused = true; }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(FocusReturn, [{ key: "componentWillUnmount", value: function componentWillUnmount() { var activeElementOnMount = this.activeElementOnMount, isFocused = this.isFocused, ownFocusedElements = this.ownFocusedElements; if (!isFocused) { return; } // Defer to the component's own explicit focus return behavior, // if specified. The function should return `false` to prevent // the default behavior otherwise occurring here. This allows // for support that the `onFocusReturn` decides to allow the // default behavior to occur under some conditions. if (onFocusReturn() === false) { return; } var stack = [].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(lodash__WEBPACK_IMPORTED_MODULE_7__["without"].apply(void 0, [this.props.focus.focusHistory].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(ownFocusedElements)))), [activeElementOnMount]); var candidate; while (candidate = stack.pop()) { if (document.body.contains(candidate)) { candidate.focus(); return; } } } }, { key: "render", value: function render() { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])("div", { onFocus: this.setIsFocusedTrue, onBlur: this.setIsFocusedFalse }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(WrappedComponent, this.props.childProps)); } }]); return FocusReturn; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["Component"]); return function (props) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(_context__WEBPACK_IMPORTED_MODULE_9__[/* Consumer */ "a"], null, function (context) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["createElement"])(FocusReturn, { childProps: props, focus: context }); }); }; }; } /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_compose__WEBPACK_IMPORTED_MODULE_8__["createHigherOrderComponent"])(withFocusReturn, 'withFocusReturn')); /***/ }), /* 136 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /** * WordPress dependencies */ function stopPropagation(event) { event.stopPropagation(); } /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["forwardRef"])(function (_ref, ref) { var children = _ref.children, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["children"]); // Disable reason: this stops certain events from propagating outside of the component. // - onMouseDown is disabled as this can cause interactions with other DOM elements /* eslint-disable jsx-a11y/no-static-element-interactions */ return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("div", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, props, { ref: ref, onMouseDown: stopPropagation }), children); /* eslint-enable jsx-a11y/no-static-element-interactions */ })); /***/ }), /* 137 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(14); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var reakit_Toolbar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(493); /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(90); /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var _toolbar_context__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(91); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function ToolbarItem(_ref, ref) { var children = _ref.children, Component = _ref.as, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_ref, ["children", "as"]); var accessibleToolbarState = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["useContext"])(_toolbar_context__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"]); if (typeof children !== 'function' && !Component) { typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('`ToolbarItem` is a generic headless component. You must pass either a `children` prop as a function or an `as` prop as a component. ' + 'See https://developer.wordpress.org/block-editor/components/toolbar-item/') : void 0; return null; } var allProps = _objectSpread(_objectSpread({}, props), {}, { ref: ref, 'data-toolbar-item': true }); if (!accessibleToolbarState) { if (Component) { return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(Component, allProps, children); } return children(allProps); } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(reakit_Toolbar__WEBPACK_IMPORTED_MODULE_4__[/* ToolbarItem */ "a"], Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({}, accessibleToolbarState, allProps, { as: Component }), children); } /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["forwardRef"])(ToolbarItem)); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(103))) /***/ }), /* 138 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(90); /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var SlotFillContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])({ slots: {}, fills: {}, registerSlot: function registerSlot() { typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_1___default()('Components must be wrapped within `SlotFillProvider`. ' + 'See https://developer.wordpress.org/block-editor/components/slot-fill/') : void 0; }, updateSlot: function updateSlot() {}, unregisterSlot: function unregisterSlot() {}, registerFill: function registerFill() {}, unregisterFill: function unregisterFill() {} }); /* harmony default export */ __webpack_exports__["a"] = (SlotFillContext); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(103))) /***/ }), /* 139 */, /* 140 */, /* 141 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * WordPress dependencies */ /** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */ /** * Return an SVG icon. * * @param {IconProps} props icon is the SVG component to render * size is a number specifiying the icon size in pixels * Other props will be passed to wrapped SVG component * * @return {JSX.Element} Icon component */ function Icon(_ref) { var icon = _ref.icon, _ref$size = _ref.size, size = _ref$size === void 0 ? 24 : _ref$size, props = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "size"]); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["cloneElement"])(icon, _objectSpread({ width: size, height: size }, props)); } /* harmony default export */ __webpack_exports__["a"] = (Icon); /***/ }), /* 142 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = __webpack_require__(143); function emptyFunction() {} function emptyFunctionWithReset() {} emptyFunctionWithReset.resetWarningCache = emptyFunction; module.exports = function() { function shim(props, propName, componentName, location, propFullName, secret) { if (secret === ReactPropTypesSecret) { // It is still safe when called from React. return; } var err = new Error( 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types' ); err.name = 'Invariant Violation'; throw err; }; shim.isRequired = shim; function getShim() { return shim; }; // Important! // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`. var ReactPropTypes = { array: shim, bool: shim, func: shim, number: shim, object: shim, string: shim, symbol: shim, any: shim, arrayOf: getShim, element: shim, elementType: shim, instanceOf: getShim, node: shim, objectOf: getShim, oneOf: getShim, oneOfType: getShim, shape: getShim, exact: getShim, checkPropTypes: emptyFunctionWithReset, resetWarningCache: emptyFunction }; ReactPropTypes.PropTypes = ReactPropTypes; return ReactPropTypes; }; /***/ }), /* 143 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; module.exports = ReactPropTypesSecret; /***/ }), /* 144 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(58); var callBind = __webpack_require__(188); var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf')); module.exports = function callBoundIntrinsic(name, allowMissing) { var intrinsic = GetIntrinsic(name, !!allowMissing); if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) { return callBind(intrinsic); } return intrinsic; }; /***/ }), /* 145 */ /***/ (function(module, exports, __webpack_require__) { var moment = __webpack_require__(44); var momentValidationWrapper = __webpack_require__(377); var core = __webpack_require__(378); module.exports = { momentObj : core.createMomentChecker( 'object', function(obj) { return typeof obj === 'object'; }, function isValid(value) { return momentValidationWrapper.isValidMoment(value); }, 'Moment' ), momentString : core.createMomentChecker( 'string', function(str) { return typeof str === 'string'; }, function isValid(value) { return momentValidationWrapper.isValidMoment(moment(value)); }, 'Moment' ), momentDurationObj : core.createMomentChecker( 'object', function(obj) { return typeof obj === 'object'; }, function isValid(value) { return moment.isDuration(value); }, 'Duration' ), }; /***/ }), /* 146 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(28); var _propTypes2 = _interopRequireDefault(_propTypes); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]); /***/ }), /* 147 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /** * Copyright (c) 2013-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * * @providesModule shallowCompare */ var shallowEqual = __webpack_require__(392); /** * Does a shallow comparison for props and state. * See ReactComponentWithPureRenderMixin * See also https://facebook.github.io/react/docs/shallow-compare.html */ function shallowCompare(instance, nextProps, nextState) { return ( !shallowEqual(instance.props, nextProps) || !shallowEqual(instance.state, nextState) ); } module.exports = shallowCompare; /***/ }), /* 148 */, /* 149 */, /* 150 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8); /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); /** * @typedef OwnProps * * @property {string} icon Icon name * @property {string} [className] Class name */ /** @typedef {import('react').ComponentPropsWithoutRef<'span'> & OwnProps} Props */ /** * @param {Props} props * @return {JSX.Element} Element */ function Dashicon(_ref) { var icon = _ref.icon, className = _ref.className, extraProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_ref, ["icon", "className"]); var iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' '); return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["createElement"])("span", Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])({ className: iconClass }, extraProps)); } /* harmony default export */ __webpack_exports__["a"] = (Dashicon); /***/ }), /* 151 */ /***/ (function(module, exports, __webpack_require__) { var e=__webpack_require__(13),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]}; /***/ }), /* 152 */, /* 153 */, /* 154 */, /* 155 */, /* 156 */, /* 157 */, /* 158 */ /***/ (function(module, exports) { function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } module.exports = _inheritsLoose; /***/ }), /* 159 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var closeSmall = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M13 11.9l3.3-3.4-1.1-1-3.2 3.3-3.2-3.3-1.1 1 3.3 3.4-3.5 3.6 1 1L12 13l3.5 3.5 1-1z" })); /* harmony default export */ __webpack_exports__["a"] = (closeSmall); /***/ }), /* 160 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var close = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z" })); /* harmony default export */ __webpack_exports__["a"] = (close); /***/ }), /* 161 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var check = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M18.3 5.6L9.9 16.9l-4.6-3.4-.9 1.2 5.8 4.3 9.3-12.6z" })); /* harmony default export */ __webpack_exports__["a"] = (check); /***/ }), /* 162 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(28); var _propTypes2 = _interopRequireDefault(_propTypes); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS); /***/ }), /* 163 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(28); var _propTypes2 = _interopRequireDefault(_propTypes); var _airbnbPropTypes = __webpack_require__(89); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } } exports['default'] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () { function modifiers(props, propName) { for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { rest[_key - 2] = arguments[_key]; } var propValue = props[propName]; var firstError = void 0; [].concat(_toConsumableArray(propValue)).some(function (v, i) { var _PropTypes$string; var fakePropName = String(propName) + ': index ' + String(i); firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest)); return firstError != null; }); return firstError == null ? null : firstError; } return modifiers; }()], 'Modifiers (Set of Strings)'); /***/ }), /* 164 */, /* 165 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useSlot; }); /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var _slot_fill_context__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(138); function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * WordPress dependencies */ /** * Internal dependencies */ function useSlot(name) { var registry = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useContext"])(_slot_fill_context__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"]); var slot = registry.slots[name] || {}; var slotFills = registry.fills[name]; var fills = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useMemo"])(function () { return slotFills || []; }, [slotFills]); var updateSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (fillProps) { registry.updateSlot(name, fillProps); }, [name, registry.updateSlot]); var unregisterSlot = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (slotRef) { registry.unregisterSlot(name, slotRef); }, [name, registry.unregisterSlot]); var registerFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (fillRef) { registry.registerFill(name, fillRef); }, [name, registry.registerFill]); var unregisterFill = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["useCallback"])(function (fillRef) { registry.unregisterFill(name, fillRef); }, [name, registry.unregisterFill]); return _objectSpread(_objectSpread({}, slot), {}, { updateSlot: updateSlot, unregisterSlot: unregisterSlot, fills: fills, registerFill: registerFill, unregisterFill: unregisterFill }); } /***/ }), /* 166 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* unused harmony export createScrollLockComponent */ /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(23); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(24); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * WordPress dependencies */ /** * Creates a ScrollLock component bound to the specified document. * * This function creates a ScrollLock component for the specified document * and is exposed so we can create an isolated component for unit testing. * * @param {Object} args Keyword args. * @param {HTMLDocument} args.htmlDocument The document to lock the scroll for. * @param {string} args.className The name of the class used to lock scrolling. * @return {WPComponent} The bound ScrollLock component. */ function createScrollLockComponent() { var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, _ref$htmlDocument = _ref.htmlDocument, htmlDocument = _ref$htmlDocument === void 0 ? document : _ref$htmlDocument, _ref$className = _ref.className, className = _ref$className === void 0 ? 'lockscroll' : _ref$className; var lockCounter = 0; /* * Setting `overflow: hidden` on html and body elements resets body scroll in iOS. * Save scroll top so we can restore it after locking scroll. * * NOTE: It would be cleaner and possibly safer to find a localized solution such * as preventing default on certain touchmove events. */ var previousScrollTop = 0; /** * Locks and unlocks scroll depending on the boolean argument. * * @param {boolean} locked Whether or not scroll should be locked. */ function setLocked(locked) { var scrollingElement = htmlDocument.scrollingElement || htmlDocument.body; if (locked) { previousScrollTop = scrollingElement.scrollTop; } var methodName = locked ? 'add' : 'remove'; scrollingElement.classList[methodName](className); // Adding the class to the document element seems to be necessary in iOS. htmlDocument.documentElement.classList[methodName](className); if (!locked) { scrollingElement.scrollTop = previousScrollTop; } } /** * Requests scroll lock. * * This function tracks requests for scroll lock. It locks scroll on the first * request and counts each request so `releaseLock` can unlock scroll when * all requests have been released. */ function requestLock() { if (lockCounter === 0) { setLocked(true); } ++lockCounter; } /** * Releases a request for scroll lock. * * This function tracks released requests for scroll lock. When all requests * have been released, it unlocks scroll. */ function releaseLock() { if (lockCounter === 1) { setLocked(false); } --lockCounter; } return /*#__PURE__*/function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(ScrollLock, _Component); var _super = _createSuper(ScrollLock); function ScrollLock() { Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(this, ScrollLock); return _super.apply(this, arguments); } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(ScrollLock, [{ key: "componentDidMount", /** * Requests scroll lock on mount. */ value: function componentDidMount() { requestLock(); } /** * Releases scroll lock before unmount. */ }, { key: "componentWillUnmount", value: function componentWillUnmount() { releaseLock(); } /** * Render nothing as this component is merely a way to declare scroll lock. * * @return {null} Render nothing by returning `null`. */ }, { key: "render", value: function render() { return null; } }]); return ScrollLock; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["Component"]); } /* harmony default export */ __webpack_exports__["a"] = (createScrollLockComponent()); /***/ }), /* 167 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9); /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(46); /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(90); /* harmony import */ var _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_warning__WEBPACK_IMPORTED_MODULE_5__); /* harmony import */ var ___WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(35); /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ var NOTICE_TIMEOUT = 10000; /** @typedef {import('@wordpress/element').WPElement} WPElement */ /** * Custom hook which announces the message with the given politeness, if a * valid message is provided. * * @param {string|WPElement} [message] Message to announce. * @param {'polite'|'assertive'} politeness Politeness to announce. */ function useSpokenMessage(message, politeness) { var spokenMessage = typeof message === 'string' ? message : Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["renderToString"])(message); Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () { if (spokenMessage) { Object(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_3__["speak"])(spokenMessage, politeness); } }, [spokenMessage, politeness]); } function Snackbar(_ref, ref) { var className = _ref.className, children = _ref.children, _ref$spokenMessage = _ref.spokenMessage, spokenMessage = _ref$spokenMessage === void 0 ? children : _ref$spokenMessage, _ref$politeness = _ref.politeness, politeness = _ref$politeness === void 0 ? 'polite' : _ref$politeness, _ref$actions = _ref.actions, actions = _ref$actions === void 0 ? [] : _ref$actions, _ref$onRemove = _ref.onRemove, onRemove = _ref$onRemove === void 0 ? lodash__WEBPACK_IMPORTED_MODULE_1__["noop"] : _ref$onRemove; useSpokenMessage(spokenMessage, politeness); Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["useEffect"])(function () { var timeoutHandle = setTimeout(function () { onRemove(); }, NOTICE_TIMEOUT); return function () { return clearTimeout(timeoutHandle); }; }, []); var classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()(className, 'components-snackbar'); if (actions && actions.length > 1) { // we need to inform developers that snackbar only accepts 1 action typeof process !== "undefined" && process.env && "production" !== "production" ? _wordpress_warning__WEBPACK_IMPORTED_MODULE_5___default()('Snackbar can only have 1 action, use Notice if your message require many messages') : void 0; // return first element only while keeping it inside an array actions = [actions[0]]; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { ref: ref, className: classes, onClick: onRemove, tabIndex: "0", role: "button", onKeyPress: onRemove, "aria-label": Object(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__["__"])('Dismiss this notice') }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("div", { className: "components-snackbar__content" }, children, actions.map(function (_ref2, index) { var label = _ref2.label, _onClick = _ref2.onClick, url = _ref2.url; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(___WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"], { key: index, href: url, isTertiary: true, onClick: function onClick(event) { event.stopPropagation(); if (_onClick) { _onClick(event); } }, className: "components-snackbar__action" }, label); }))); } /* harmony default export */ __webpack_exports__["a"] = (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["forwardRef"])(Snackbar)); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(103))) /***/ }), /* 168 */, /* 169 */, /* 170 */, /* 171 */, /* 172 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__); /** * External dependencies */ function Shortcut(_ref) { var shortcut = _ref.shortcut, className = _ref.className; if (!shortcut) { return null; } var displayText; var ariaLabel; if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isString"])(shortcut)) { displayText = shortcut; } if (Object(lodash__WEBPACK_IMPORTED_MODULE_1__["isObject"])(shortcut)) { displayText = shortcut.display; ariaLabel = shortcut.ariaLabel; } return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])("span", { className: className, "aria-label": ariaLabel }, displayText); } /* harmony default export */ __webpack_exports__["a"] = (Shortcut); /***/ }), /* 173 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useToolbarState; }); /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(15); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var reakit_utils_useSealedState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(62); /* harmony import */ var _CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52); function useToolbarState(initialState) { if (initialState === void 0) { initialState = {}; } var _useSealedState = Object(reakit_utils_useSealedState__WEBPACK_IMPORTED_MODULE_2__[/* useSealedState */ "a"])(initialState), _useSealedState$orien = _useSealedState.orientation, orientation = _useSealedState$orien === void 0 ? "horizontal" : _useSealedState$orien, sealed = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_useSealedState, ["orientation"]); return Object(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_3__[/* u */ "g"])(Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ orientation: orientation }, sealed)); } var keys = [].concat(_CompositeState_3a25dcee_js__WEBPACK_IMPORTED_MODULE_3__[/* u */ "g"].__keys); useToolbarState.__keys = keys; /***/ }), /* 174 */, /* 175 */, /* 176 */, /* 177 */ /***/ (function(module, exports) { function _extends() { module.exports = _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } module.exports = _extends; /***/ }), /* 178 */ /***/ (function(module, exports) { function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } module.exports = _objectWithoutPropertiesLoose; /***/ }), /* 179 */ /***/ (function(module, exports) { function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } module.exports = _assertThisInitialized; /***/ }), /* 180 */, /* 181 */, /* 182 */, /* 183 */, /* 184 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(185); function scrollIntoView(elem, container, config) { config = config || {}; // document 归一化到 window if (container.nodeType === 9) { container = util.getWindow(container); } var allowHorizontalScroll = config.allowHorizontalScroll; var onlyScrollIfNeeded = config.onlyScrollIfNeeded; var alignWithTop = config.alignWithTop; var alignWithLeft = config.alignWithLeft; var offsetTop = config.offsetTop || 0; var offsetLeft = config.offsetLeft || 0; var offsetBottom = config.offsetBottom || 0; var offsetRight = config.offsetRight || 0; allowHorizontalScroll = allowHorizontalScroll === undefined ? true : allowHorizontalScroll; var isWin = util.isWindow(container); var elemOffset = util.offset(elem); var eh = util.outerHeight(elem); var ew = util.outerWidth(elem); var containerOffset = undefined; var ch = undefined; var cw = undefined; var containerScroll = undefined; var diffTop = undefined; var diffBottom = undefined; var win = undefined; var winScroll = undefined; var ww = undefined; var wh = undefined; if (isWin) { win = container; wh = util.height(win); ww = util.width(win); winScroll = { left: util.scrollLeft(win), top: util.scrollTop(win) }; // elem 相对 container 可视视窗的距离 diffTop = { left: elemOffset.left - winScroll.left - offsetLeft, top: elemOffset.top - winScroll.top - offsetTop }; diffBottom = { left: elemOffset.left + ew - (winScroll.left + ww) + offsetRight, top: elemOffset.top + eh - (winScroll.top + wh) + offsetBottom }; containerScroll = winScroll; } else { containerOffset = util.offset(container); ch = container.clientHeight; cw = container.clientWidth; containerScroll = { left: container.scrollLeft, top: container.scrollTop }; // elem 相对 container 可视视窗的距离 // 注意边框, offset 是边框到根节点 diffTop = { left: elemOffset.left - (containerOffset.left + (parseFloat(util.css(container, 'borderLeftWidth')) || 0)) - offsetLeft, top: elemOffset.top - (containerOffset.top + (parseFloat(util.css(container, 'borderTopWidth')) || 0)) - offsetTop }; diffBottom = { left: elemOffset.left + ew - (containerOffset.left + cw + (parseFloat(util.css(container, 'borderRightWidth')) || 0)) + offsetRight, top: elemOffset.top + eh - (containerOffset.top + ch + (parseFloat(util.css(container, 'borderBottomWidth')) || 0)) + offsetBottom }; } if (diffTop.top < 0 || diffBottom.top > 0) { // 强制向上 if (alignWithTop === true) { util.scrollTop(container, containerScroll.top + diffTop.top); } else if (alignWithTop === false) { util.scrollTop(container, containerScroll.top + diffBottom.top); } else { // 自动调整 if (diffTop.top < 0) { util.scrollTop(container, containerScroll.top + diffTop.top); } else { util.scrollTop(container, containerScroll.top + diffBottom.top); } } } else { if (!onlyScrollIfNeeded) { alignWithTop = alignWithTop === undefined ? true : !!alignWithTop; if (alignWithTop) { util.scrollTop(container, containerScroll.top + diffTop.top); } else { util.scrollTop(container, containerScroll.top + diffBottom.top); } } } if (allowHorizontalScroll) { if (diffTop.left < 0 || diffBottom.left > 0) { // 强制向上 if (alignWithLeft === true) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else if (alignWithLeft === false) { util.scrollLeft(container, containerScroll.left + diffBottom.left); } else { // 自动调整 if (diffTop.left < 0) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else { util.scrollLeft(container, containerScroll.left + diffBottom.left); } } } else { if (!onlyScrollIfNeeded) { alignWithLeft = alignWithLeft === undefined ? true : !!alignWithLeft; if (alignWithLeft) { util.scrollLeft(container, containerScroll.left + diffTop.left); } else { util.scrollLeft(container, containerScroll.left + diffBottom.left); } } } } } module.exports = scrollIntoView; /***/ }), /* 185 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; var RE_NUM = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source; function getClientPosition(elem) { var box = undefined; var x = undefined; var y = undefined; var doc = elem.ownerDocument; var body = doc.body; var docElem = doc && doc.documentElement; // 根据 GBS 最新数据,A-Grade Browsers 都已支持 getBoundingClientRect 方法,不用再考虑传统的实现方式 box = elem.getBoundingClientRect(); // 注:jQuery 还考虑减去 docElem.clientLeft/clientTop // 但测试发现,这样反而会导致当 html 和 body 有边距/边框样式时,获取的值不正确 // 此外,ie6 会忽略 html 的 margin 值,幸运地是没有谁会去设置 html 的 margin x = box.left; y = box.top; // In IE, most of the time, 2 extra pixels are added to the top and left // due to the implicit 2-pixel inset border. In IE6/7 quirks mode and // IE6 standards mode, this border can be overridden by setting the // document element's border to zero -- thus, we cannot rely on the // offset always being 2 pixels. // In quirks mode, the offset can be determined by querying the body's // clientLeft/clientTop, but in standards mode, it is found by querying // the document element's clientLeft/clientTop. Since we already called // getClientBoundingRect we have already forced a reflow, so it is not // too expensive just to query them all. // ie 下应该减去窗口的边框吧,毕竟默认 absolute 都是相对窗口定位的 // 窗口边框标准是设 documentElement ,quirks 时设置 body // 最好禁止在 body 和 html 上边框 ,但 ie < 9 html 默认有 2px ,减去 // 但是非 ie 不可能设置窗口边框,body html 也不是窗口 ,ie 可以通过 html,body 设置 // 标准 ie 下 docElem.clientTop 就是 border-top // ie7 html 即窗口边框改变不了。永远为 2 // 但标准 firefox/chrome/ie9 下 docElem.clientTop 是窗口边框,即使设了 border-top 也为 0 x -= docElem.clientLeft || body.clientLeft || 0; y -= docElem.clientTop || body.clientTop || 0; return { left: x, top: y }; } function getScroll(w, top) { var ret = w['page' + (top ? 'Y' : 'X') + 'Offset']; var method = 'scroll' + (top ? 'Top' : 'Left'); if (typeof ret !== 'number') { var d = w.document; // ie6,7,8 standard mode ret = d.documentElement[method]; if (typeof ret !== 'number') { // quirks mode ret = d.body[method]; } } return ret; } function getScrollLeft(w) { return getScroll(w); } function getScrollTop(w) { return getScroll(w, true); } function getOffset(el) { var pos = getClientPosition(el); var doc = el.ownerDocument; var w = doc.defaultView || doc.parentWindow; pos.left += getScrollLeft(w); pos.top += getScrollTop(w); return pos; } function _getComputedStyle(elem, name, computedStyle_) { var val = ''; var d = elem.ownerDocument; var computedStyle = computedStyle_ || d.defaultView.getComputedStyle(elem, null); // https://github.com/kissyteam/kissy/issues/61 if (computedStyle) { val = computedStyle.getPropertyValue(name) || computedStyle[name]; } return val; } var _RE_NUM_NO_PX = new RegExp('^(' + RE_NUM + ')(?!px)[a-z%]+$', 'i'); var RE_POS = /^(top|right|bottom|left)$/; var CURRENT_STYLE = 'currentStyle'; var RUNTIME_STYLE = 'runtimeStyle'; var LEFT = 'left'; var PX = 'px'; function _getComputedStyleIE(elem, name) { // currentStyle maybe null // http://msdn.microsoft.com/en-us/library/ms535231.aspx var ret = elem[CURRENT_STYLE] && elem[CURRENT_STYLE][name]; // 当 width/height 设置为百分比时,通过 pixelLeft 方式转换的 width/height 值 // 一开始就处理了! CUSTOM_STYLE.height,CUSTOM_STYLE.width ,cssHook 解决@2011-08-19 // 在 ie 下不对,需要直接用 offset 方式 // borderWidth 等值也有问题,但考虑到 borderWidth 设为百分比的概率很小,这里就不考虑了 // From the awesome hack by Dean Edwards // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 // If we're not dealing with a regular pixel number // but a number that has a weird ending, we need to convert it to pixels // exclude left right for relativity if (_RE_NUM_NO_PX.test(ret) && !RE_POS.test(name)) { // Remember the original values var style = elem.style; var left = style[LEFT]; var rsLeft = elem[RUNTIME_STYLE][LEFT]; // prevent flashing of content elem[RUNTIME_STYLE][LEFT] = elem[CURRENT_STYLE][LEFT]; // Put in the new values to get a computed value out style[LEFT] = name === 'fontSize' ? '1em' : ret || 0; ret = style.pixelLeft + PX; // Revert the changed values style[LEFT] = left; elem[RUNTIME_STYLE][LEFT] = rsLeft; } return ret === '' ? 'auto' : ret; } var getComputedStyleX = undefined; if (typeof window !== 'undefined') { getComputedStyleX = window.getComputedStyle ? _getComputedStyle : _getComputedStyleIE; } function each(arr, fn) { for (var i = 0; i < arr.length; i++) { fn(arr[i]); } } function isBorderBoxFn(elem) { return getComputedStyleX(elem, 'boxSizing') === 'border-box'; } var BOX_MODELS = ['margin', 'border', 'padding']; var CONTENT_INDEX = -1; var PADDING_INDEX = 2; var BORDER_INDEX = 1; var MARGIN_INDEX = 0; function swap(elem, options, callback) { var old = {}; var style = elem.style; var name = undefined; // Remember the old values, and insert the new ones for (name in options) { if (options.hasOwnProperty(name)) { old[name] = style[name]; style[name] = options[name]; } } callback.call(elem); // Revert the old values for (name in options) { if (options.hasOwnProperty(name)) { style[name] = old[name]; } } } function getPBMWidth(elem, props, which) { var value = 0; var prop = undefined; var j = undefined; var i = undefined; for (j = 0; j < props.length; j++) { prop = props[j]; if (prop) { for (i = 0; i < which.length; i++) { var cssProp = undefined; if (prop === 'border') { cssProp = prop + which[i] + 'Width'; } else { cssProp = prop + which[i]; } value += parseFloat(getComputedStyleX(elem, cssProp)) || 0; } } } return value; } /** * A crude way of determining if an object is a window * @member util */ function isWindow(obj) { // must use == for ie8 /* eslint eqeqeq:0 */ return obj != null && obj == obj.window; } var domUtils = {}; each(['Width', 'Height'], function (name) { domUtils['doc' + name] = function (refWin) { var d = refWin.document; return Math.max( // firefox chrome documentElement.scrollHeight< body.scrollHeight // ie standard mode : documentElement.scrollHeight> body.scrollHeight d.documentElement['scroll' + name], // quirks : documentElement.scrollHeight 最大等于可视窗口多一点? d.body['scroll' + name], domUtils['viewport' + name](d)); }; domUtils['viewport' + name] = function (win) { // pc browser includes scrollbar in window.innerWidth var prop = 'client' + name; var doc = win.document; var body = doc.body; var documentElement = doc.documentElement; var documentElementProp = documentElement[prop]; // 标准模式取 documentElement // backcompat 取 body return doc.compatMode === 'CSS1Compat' && documentElementProp || body && body[prop] || documentElementProp; }; }); /* 得到元素的大小信息 @param elem @param name @param {String} [extra] 'padding' : (css width) + padding 'border' : (css width) + padding + border 'margin' : (css width) + padding + border + margin */ function getWH(elem, name, extra) { if (isWindow(elem)) { return name === 'width' ? domUtils.viewportWidth(elem) : domUtils.viewportHeight(elem); } else if (elem.nodeType === 9) { return name === 'width' ? domUtils.docWidth(elem) : domUtils.docHeight(elem); } var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; var borderBoxValue = name === 'width' ? elem.offsetWidth : elem.offsetHeight; var computedStyle = getComputedStyleX(elem); var isBorderBox = isBorderBoxFn(elem, computedStyle); var cssBoxValue = 0; if (borderBoxValue == null || borderBoxValue <= 0) { borderBoxValue = undefined; // Fall back to computed then un computed css if necessary cssBoxValue = getComputedStyleX(elem, name); if (cssBoxValue == null || Number(cssBoxValue) < 0) { cssBoxValue = elem.style[name] || 0; } // Normalize '', auto, and prepare for extra cssBoxValue = parseFloat(cssBoxValue) || 0; } if (extra === undefined) { extra = isBorderBox ? BORDER_INDEX : CONTENT_INDEX; } var borderBoxValueOrIsBorderBox = borderBoxValue !== undefined || isBorderBox; var val = borderBoxValue || cssBoxValue; if (extra === CONTENT_INDEX) { if (borderBoxValueOrIsBorderBox) { return val - getPBMWidth(elem, ['border', 'padding'], which, computedStyle); } return cssBoxValue; } if (borderBoxValueOrIsBorderBox) { var padding = extra === PADDING_INDEX ? -getPBMWidth(elem, ['border'], which, computedStyle) : getPBMWidth(elem, ['margin'], which, computedStyle); return val + (extra === BORDER_INDEX ? 0 : padding); } return cssBoxValue + getPBMWidth(elem, BOX_MODELS.slice(extra), which, computedStyle); } var cssShow = { position: 'absolute', visibility: 'hidden', display: 'block' }; // fix #119 : https://github.com/kissyteam/kissy/issues/119 function getWHIgnoreDisplay(elem) { var val = undefined; var args = arguments; // in case elem is window // elem.offsetWidth === undefined if (elem.offsetWidth !== 0) { val = getWH.apply(undefined, args); } else { swap(elem, cssShow, function () { val = getWH.apply(undefined, args); }); } return val; } function css(el, name, v) { var value = v; if ((typeof name === 'undefined' ? 'undefined' : _typeof(name)) === 'object') { for (var i in name) { if (name.hasOwnProperty(i)) { css(el, i, name[i]); } } return undefined; } if (typeof value !== 'undefined') { if (typeof value === 'number') { value += 'px'; } el.style[name] = value; return undefined; } return getComputedStyleX(el, name); } each(['width', 'height'], function (name) { var first = name.charAt(0).toUpperCase() + name.slice(1); domUtils['outer' + first] = function (el, includeMargin) { return el && getWHIgnoreDisplay(el, name, includeMargin ? MARGIN_INDEX : BORDER_INDEX); }; var which = name === 'width' ? ['Left', 'Right'] : ['Top', 'Bottom']; domUtils[name] = function (elem, val) { if (val !== undefined) { if (elem) { var computedStyle = getComputedStyleX(elem); var isBorderBox = isBorderBoxFn(elem); if (isBorderBox) { val += getPBMWidth(elem, ['padding', 'border'], which, computedStyle); } return css(elem, name, val); } return undefined; } return elem && getWHIgnoreDisplay(elem, name, CONTENT_INDEX); }; }); // 设置 elem 相对 elem.ownerDocument 的坐标 function setOffset(elem, offset) { // set position first, in-case top/left are set even on static elem if (css(elem, 'position') === 'static') { elem.style.position = 'relative'; } var old = getOffset(elem); var ret = {}; var current = undefined; var key = undefined; for (key in offset) { if (offset.hasOwnProperty(key)) { current = parseFloat(css(elem, key)) || 0; ret[key] = current + offset[key] - old[key]; } } css(elem, ret); } module.exports = _extends({ getWindow: function getWindow(node) { var doc = node.ownerDocument || node; return doc.defaultView || doc.parentWindow; }, offset: function offset(el, value) { if (typeof value !== 'undefined') { setOffset(el, value); } else { return getOffset(el); } }, isWindow: isWindow, each: each, css: css, clone: function clone(obj) { var ret = {}; for (var i in obj) { if (obj.hasOwnProperty(i)) { ret[i] = obj[i]; } } var overflow = obj.overflow; if (overflow) { for (var i in obj) { if (obj.hasOwnProperty(i)) { ret.overflow[i] = obj.overflow[i]; } } } return ret; }, scrollLeft: function scrollLeft(w, v) { if (isWindow(w)) { if (v === undefined) { return getScrollLeft(w); } window.scrollTo(v, getScrollTop(w)); } else { if (v === undefined) { return w.scrollLeft; } w.scrollLeft = v; } }, scrollTop: function scrollTop(w, v) { if (isWindow(w)) { if (v === undefined) { return getScrollTop(w); } window.scrollTo(getScrollLeft(w), v); } else { if (v === undefined) { return w.scrollTop; } w.scrollTop = v; } }, viewportWidth: 0, viewportHeight: 0 }, domUtils); /***/ }), /* 186 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var link = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z" })); /* harmony default export */ __webpack_exports__["a"] = (link); /***/ }), /* 187 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var slice = Array.prototype.slice; var isArgs = __webpack_require__(219); var origKeys = Object.keys; var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(334); var originalKeys = Object.keys; keysShim.shim = function shimObjectKeys() { if (Object.keys) { var keysWorksWithArguments = (function () { // Safari 5.0 bug var args = Object.keys(arguments); return args && args.length === arguments.length; }(1, 2)); if (!keysWorksWithArguments) { Object.keys = function keys(object) { // eslint-disable-line func-name-matching if (isArgs(object)) { return originalKeys(slice.call(object)); } return originalKeys(object); }; } } else { Object.keys = keysShim; } return Object.keys || keysShim; }; module.exports = keysShim; /***/ }), /* 188 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var bind = __webpack_require__(120); var GetIntrinsic = __webpack_require__(58); var $apply = GetIntrinsic('%Function.prototype.apply%'); var $call = GetIntrinsic('%Function.prototype.call%'); var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = null; } } module.exports = function callBind() { return $reflectApply(bind, $call, arguments); }; var applyBind = function applyBind() { return $reflectApply(bind, $apply, arguments); }; if ($defineProperty) { $defineProperty(module.exports, 'apply', { value: applyBind }); } else { module.exports.apply = applyBind; } /***/ }), /* 189 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(58); var $TypeError = GetIntrinsic('%TypeError%'); var inspect = __webpack_require__(338); var IsPropertyKey = __webpack_require__(132); var Type = __webpack_require__(93); /** * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p * 1. Assert: Type(O) is Object. * 2. Assert: IsPropertyKey(P) is true. * 3. Return O.[[Get]](P, O). */ module.exports = function Get(O, P) { // 7.3.1.1 if (Type(O) !== 'Object') { throw new $TypeError('Assertion failed: Type(O) is not Object'); } // 7.3.1.2 if (!IsPropertyKey(P)) { throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P)); } // 7.3.1.3 return O[P]; }; /***/ }), /* 190 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(58); var $Array = GetIntrinsic('%Array%'); // eslint-disable-next-line global-require var toStr = !$Array.isArray && __webpack_require__(144)('Object.prototype.toString'); // https://www.ecma-international.org/ecma-262/6.0/#sec-isarray module.exports = $Array.isArray || function IsArray(argument) { return toStr(argument) === '[object Array]'; }; /***/ }), /* 191 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(58); var $TypeError = GetIntrinsic('%TypeError%'); var $SyntaxError = GetIntrinsic('%SyntaxError%'); var has = __webpack_require__(94); var predicates = { // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type 'Property Descriptor': function isPropertyDescriptor(Type, Desc) { if (Type(Desc) !== 'Object') { return false; } var allowed = { '[[Configurable]]': true, '[[Enumerable]]': true, '[[Get]]': true, '[[Set]]': true, '[[Value]]': true, '[[Writable]]': true }; for (var key in Desc) { // eslint-disable-line if (has(Desc, key) && !allowed[key]) { return false; } } var isData = has(Desc, '[[Value]]'); var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); if (isData && IsAccessor) { throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); } return true; } }; module.exports = function assertRecord(Type, recordType, argumentName, value) { var predicate = predicates[recordType]; if (typeof predicate !== 'function') { throw new $SyntaxError('unknown record type: ' + recordType); } if (!predicate(Type, value)) { throw new $TypeError(argumentName + ' must be a ' + recordType); } }; /***/ }), /* 192 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = Number.isNaN || function isNaN(a) { return a !== a; }; /***/ }), /* 193 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toStr = Object.prototype.toString; var hasSymbols = __webpack_require__(365)(); if (hasSymbols) { var symToStr = Symbol.prototype.toString; var symStringRegex = /^Symbol\(.*\)$/; var isSymbolObject = function isRealSymbolObject(value) { if (typeof value.valueOf() !== 'symbol') { return false; } return symStringRegex.test(symToStr.call(value)); }; module.exports = function isSymbol(value) { if (typeof value === 'symbol') { return true; } if (toStr.call(value) !== '[object Symbol]') { return false; } try { return isSymbolObject(value); } catch (e) { return false; } }; } else { module.exports = function isSymbol(value) { // this environment does not support Symbols. return false && false; }; } /***/ }), /* 194 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fnToStr = Function.prototype.toString; var constructorRegex = /^\s*class\b/; var isES6ClassFn = function isES6ClassFunction(value) { try { var fnStr = fnToStr.call(value); return constructorRegex.test(fnStr); } catch (e) { return false; // not a function } }; var tryFunctionObject = function tryFunctionToStr(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var fnClass = '[object Function]'; var genClass = '[object GeneratorFunction]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (typeof value === 'function' && !value.prototype) { return true; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = toStr.call(value); return strClass === fnClass || strClass === genClass; }; /***/ }), /* 195 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* globals Set, Map, WeakSet, WeakMap, Promise, Symbol, Proxy, Atomics, SharedArrayBuffer, ArrayBuffer, DataView, Uint8Array, Float32Array, Float64Array, Int8Array, Int16Array, Int32Array, Uint8ClampedArray, Uint16Array, Uint32Array, */ var undefined; // eslint-disable-line no-shadow-restricted-names var ThrowTypeError = Object.getOwnPropertyDescriptor ? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }()) : function () { throw new TypeError(); }; var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol'; var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto var generator; // = function * () {}; var generatorFunction = generator ? getProto(generator) : undefined; var asyncFn; // async function() {}; var asyncFunction = asyncFn ? asyncFn.constructor : undefined; var asyncGen; // async function * () {}; var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined; var asyncGenIterator = asyncGen ? asyncGen() : undefined; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '$ %Array%': Array, '$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype, '$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '$ %ArrayPrototype%': Array.prototype, '$ %ArrayProto_entries%': Array.prototype.entries, '$ %ArrayProto_forEach%': Array.prototype.forEach, '$ %ArrayProto_keys%': Array.prototype.keys, '$ %ArrayProto_values%': Array.prototype.values, '$ %AsyncFromSyncIteratorPrototype%': undefined, '$ %AsyncFunction%': asyncFunction, '$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined, '$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined, '$ %AsyncGeneratorFunction%': asyncGenFunction, '$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined, '$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined, '$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '$ %Boolean%': Boolean, '$ %BooleanPrototype%': Boolean.prototype, '$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView, '$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype, '$ %Date%': Date, '$ %DatePrototype%': Date.prototype, '$ %decodeURI%': decodeURI, '$ %decodeURIComponent%': decodeURIComponent, '$ %encodeURI%': encodeURI, '$ %encodeURIComponent%': encodeURIComponent, '$ %Error%': Error, '$ %ErrorPrototype%': Error.prototype, '$ %eval%': eval, // eslint-disable-line no-eval '$ %EvalError%': EvalError, '$ %EvalErrorPrototype%': EvalError.prototype, '$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype, '$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype, '$ %Function%': Function, '$ %FunctionPrototype%': Function.prototype, '$ %Generator%': generator ? getProto(generator()) : undefined, '$ %GeneratorFunction%': generatorFunction, '$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined, '$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype, '$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype, '$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype, '$ %isFinite%': isFinite, '$ %isNaN%': isNaN, '$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '$ %JSON%': JSON, '$ %JSONParse%': JSON.parse, '$ %Map%': typeof Map === 'undefined' ? undefined : Map, '$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype, '$ %Math%': Math, '$ %Number%': Number, '$ %NumberPrototype%': Number.prototype, '$ %Object%': Object, '$ %ObjectPrototype%': Object.prototype, '$ %ObjProto_toString%': Object.prototype.toString, '$ %ObjProto_valueOf%': Object.prototype.valueOf, '$ %parseFloat%': parseFloat, '$ %parseInt%': parseInt, '$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise, '$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype, '$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then, '$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all, '$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject, '$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve, '$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '$ %RangeError%': RangeError, '$ %RangeErrorPrototype%': RangeError.prototype, '$ %ReferenceError%': ReferenceError, '$ %ReferenceErrorPrototype%': ReferenceError.prototype, '$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '$ %RegExp%': RegExp, '$ %RegExpPrototype%': RegExp.prototype, '$ %Set%': typeof Set === 'undefined' ? undefined : Set, '$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype, '$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype, '$ %String%': String, '$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '$ %StringPrototype%': String.prototype, '$ %Symbol%': hasSymbols ? Symbol : undefined, '$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined, '$ %SyntaxError%': SyntaxError, '$ %SyntaxErrorPrototype%': SyntaxError.prototype, '$ %ThrowTypeError%': ThrowTypeError, '$ %TypedArray%': TypedArray, '$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined, '$ %TypeError%': TypeError, '$ %TypeErrorPrototype%': TypeError.prototype, '$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype, '$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype, '$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype, '$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype, '$ %URIError%': URIError, '$ %URIErrorPrototype%': URIError.prototype, '$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype, '$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet, '$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype }; module.exports = function GetIntrinsic(name, allowMissing) { if (arguments.length > 1 && typeof allowMissing !== 'boolean') { throw new TypeError('"allowMissing" argument must be a boolean'); } var key = '$ ' + name; if (!(key in INTRINSICS)) { throw new SyntaxError('intrinsic ' + name + ' does not exist!'); } // istanbul ignore if // hopefully this is impossible to test :-) if (typeof INTRINSICS[key] === 'undefined' && !allowMissing) { throw new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); } return INTRINSICS[key]; }; /***/ }), /* 196 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = isSameDay; var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function isSameDay(a, b) { if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; // Compare least significant, most likely to change units first // Moment's isSame clones moment inputs and is a tad slow return a.date() === b.date() && a.month() === b.month() && a.year() === b.year(); } /***/ }), /* 197 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = toISOMonthString; var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); var _toMomentObject = __webpack_require__(254); var _toMomentObject2 = _interopRequireDefault(_toMomentObject); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function toISOMonthString(date, currentFormat) { var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat); if (!dateObj) return null; return dateObj.format(_constants.ISO_MONTH_FORMAT); } /***/ }), /* 198 */ /***/ (function(module, exports) { /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return value != null && (type == 'object' || type == 'function'); } module.exports = isObject; /***/ }), /* 199 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Consumer; }); /* harmony import */ var _babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(17); /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(21); /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22); /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(16); /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23); /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(24); /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(19); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(2); /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_8__); function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = Object(_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__[/* default */ "a"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return Object(_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"])(this, result); }; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } /** * External dependencies */ /** * WordPress dependencies */ var _createContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createContext"])({ focusHistory: [] }), Provider = _createContext.Provider, Consumer = _createContext.Consumer; Provider.displayName = 'FocusReturnProvider'; Consumer.displayName = 'FocusReturnConsumer'; /** * The maximum history length to capture for the focus stack. When exceeded, * items should be shifted from the stack for each consecutive push. * * @type {number} */ var MAX_STACK_LENGTH = 100; var FocusReturnProvider = /*#__PURE__*/function (_Component) { Object(_babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__[/* default */ "a"])(FocusReturnProvider, _Component); var _super = _createSuper(FocusReturnProvider); function FocusReturnProvider() { var _this; Object(_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(this, FocusReturnProvider); _this = _super.apply(this, arguments); _this.onFocus = _this.onFocus.bind(Object(_babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__[/* default */ "a"])(_this)); _this.state = { focusHistory: [] }; return _this; } Object(_babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(FocusReturnProvider, [{ key: "onFocus", value: function onFocus(event) { var focusHistory = this.state.focusHistory; // Push the focused element to the history stack, keeping only unique // members but preferring the _last_ occurrence of any duplicates. // Lodash's `uniq` behavior favors the first occurrence, so the array // is temporarily reversed prior to it being called upon. Uniqueness // helps avoid situations where, such as in a constrained tabbing area, // the user changes focus enough within a transient element that the // stack may otherwise only consist of members pending destruction, at // which point focus might have been lost. var nextFocusHistory = Object(lodash__WEBPACK_IMPORTED_MODULE_8__["uniq"])([].concat(Object(_babel_runtime_helpers_esm_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(focusHistory), [event.target]).slice(-1 * MAX_STACK_LENGTH).reverse()).reverse(); this.setState({ focusHistory: nextFocusHistory }); } }, { key: "render", value: function render() { var _this$props = this.props, children = _this$props.children, className = _this$props.className; return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])(Provider, { value: this.state }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["createElement"])("div", { onFocus: this.onFocus, className: className }, children)); } }]); return FocusReturnProvider; }(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["Component"]); /* harmony default export */ __webpack_exports__["b"] = (FocusReturnProvider); /***/ }), /* 200 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; if (true) { module.exports = __webpack_require__(327); } else {} /***/ }), /* 201 */ /***/ (function(module, exports) { // Copyright (c) 2014 Rafael Caricio. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. var GradientParser = {}; GradientParser.parse = (function() { var tokens = { linearGradient: /^(\-(webkit|o|ms|moz)\-)?(linear\-gradient)/i, repeatingLinearGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-linear\-gradient)/i, radialGradient: /^(\-(webkit|o|ms|moz)\-)?(radial\-gradient)/i, repeatingRadialGradient: /^(\-(webkit|o|ms|moz)\-)?(repeating\-radial\-gradient)/i, sideOrCorner: /^to (left (top|bottom)|right (top|bottom)|left|right|top|bottom)/i, extentKeywords: /^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/, positionKeywords: /^(left|center|right|top|bottom)/i, pixelValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/, percentageValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/, emValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/, angleValue: /^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/, startCall: /^\(/, endCall: /^\)/, comma: /^,/, hexColor: /^\#([0-9a-fA-F]+)/, literalColor: /^([a-zA-Z]+)/, rgbColor: /^rgb/i, rgbaColor: /^rgba/i, number: /^(([0-9]*\.[0-9]+)|([0-9]+\.?))/ }; var input = ''; function error(msg) { var err = new Error(input + ': ' + msg); err.source = input; throw err; } function getAST() { var ast = matchListDefinitions(); if (input.length > 0) { error('Invalid input not EOF'); } return ast; } function matchListDefinitions() { return matchListing(matchDefinition); } function matchDefinition() { return matchGradient( 'linear-gradient', tokens.linearGradient, matchLinearOrientation) || matchGradient( 'repeating-linear-gradient', tokens.repeatingLinearGradient, matchLinearOrientation) || matchGradient( 'radial-gradient', tokens.radialGradient, matchListRadialOrientations) || matchGradient( 'repeating-radial-gradient', tokens.repeatingRadialGradient, matchListRadialOrientations); } function matchGradient(gradientType, pattern, orientationMatcher) { return matchCall(pattern, function(captures) { var orientation = orientationMatcher(); if (orientation) { if (!scan(tokens.comma)) { error('Missing comma before color stops'); } } return { type: gradientType, orientation: orientation, colorStops: matchListing(matchColorStop) }; }); } function matchCall(pattern, callback) { var captures = scan(pattern); if (captures) { if (!scan(tokens.startCall)) { error('Missing ('); } result = callback(captures); if (!scan(tokens.endCall)) { error('Missing )'); } return result; } } function matchLinearOrientation() { return matchSideOrCorner() || matchAngle(); } function matchSideOrCorner() { return match('directional', tokens.sideOrCorner, 1); } function matchAngle() { return match('angular', tokens.angleValue, 1); } function matchListRadialOrientations() { var radialOrientations, radialOrientation = matchRadialOrientation(), lookaheadCache; if (radialOrientation) { radialOrientations = []; radialOrientations.push(radialOrientation); lookaheadCache = input; if (scan(tokens.comma)) { radialOrientation = matchRadialOrientation(); if (radialOrientation) { radialOrientations.push(radialOrientation); } else { input = lookaheadCache; } } } return radialOrientations; } function matchRadialOrientation() { var radialType = matchCircle() || matchEllipse(); if (radialType) { radialType.at = matchAtPosition(); } else { var defaultPosition = matchPositioning(); if (defaultPosition) { radialType = { type: 'default-radial', at: defaultPosition }; } } return radialType; } function matchCircle() { var circle = match('shape', /^(circle)/i, 0); if (circle) { circle.style = matchLength() || matchExtentKeyword(); } return circle; } function matchEllipse() { var ellipse = match('shape', /^(ellipse)/i, 0); if (ellipse) { ellipse.style = matchDistance() || matchExtentKeyword(); } return ellipse; } function matchExtentKeyword() { return match('extent-keyword', tokens.extentKeywords, 1); } function matchAtPosition() { if (match('position', /^at/, 0)) { var positioning = matchPositioning(); if (!positioning) { error('Missing positioning value'); } return positioning; } } function matchPositioning() { var location = matchCoordinates(); if (location.x || location.y) { return { type: 'position', value: location }; } } function matchCoordinates() { return { x: matchDistance(), y: matchDistance() }; } function matchListing(matcher) { var captures = matcher(), result = []; if (captures) { result.push(captures); while (scan(tokens.comma)) { captures = matcher(); if (captures) { result.push(captures); } else { error('One extra comma'); } } } return result; } function matchColorStop() { var color = matchColor(); if (!color) { error('Expected color definition'); } color.length = matchDistance(); return color; } function matchColor() { return matchHexColor() || matchRGBAColor() || matchRGBColor() || matchLiteralColor(); } function matchLiteralColor() { return match('literal', tokens.literalColor, 0); } function matchHexColor() { return match('hex', tokens.hexColor, 1); } function matchRGBColor() { return matchCall(tokens.rgbColor, function() { return { type: 'rgb', value: matchListing(matchNumber) }; }); } function matchRGBAColor() { return matchCall(tokens.rgbaColor, function() { return { type: 'rgba', value: matchListing(matchNumber) }; }); } function matchNumber() { return scan(tokens.number)[1]; } function matchDistance() { return match('%', tokens.percentageValue, 1) || matchPositionKeyword() || matchLength(); } function matchPositionKeyword() { return match('position-keyword', tokens.positionKeywords, 1); } function matchLength() { return match('px', tokens.pixelValue, 1) || match('em', tokens.emValue, 1); } function match(type, pattern, captureIndex) { var captures = scan(pattern); if (captures) { return { type: type, value: captures[captureIndex] }; } } function scan(regexp) { var captures, blankCaptures; blankCaptures = /^[\n\r\t\s]+/.exec(input); if (blankCaptures) { consume(blankCaptures[0].length); } captures = regexp.exec(input); if (captures) { consume(captures[0].length); } return captures; } function consume(size) { input = input.substr(size); } return function(code) { input = code.toString(); return getAST(); }; })(); exports.parse = (GradientParser || {}).parse; /***/ }), /* 202 */, /* 203 */, /* 204 */, /* 205 */, /* 206 */, /* 207 */, /* 208 */, /* 209 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var plus = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z" })); /* harmony default export */ __webpack_exports__["a"] = (plus); /***/ }), /* 210 */, /* 211 */, /* 212 */, /* 213 */, /* 214 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var chevronRight = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" })); /* harmony default export */ __webpack_exports__["a"] = (chevronRight); /***/ }), /* 215 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var chevronLeft = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" })); /* harmony default export */ __webpack_exports__["a"] = (chevronLeft); /***/ }), /* 216 */, /* 217 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var upload = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" })); /* harmony default export */ __webpack_exports__["a"] = (upload); /***/ }), /* 218 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__); /** * WordPress dependencies */ var linkOff = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["SVG"], { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }, Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_1__["Path"], { d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z" })); /* harmony default export */ __webpack_exports__["a"] = (linkOff); /***/ }), /* 219 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var toStr = Object.prototype.toString; module.exports = function isArguments(value) { var str = toStr.call(value); var isArgs = str === '[object Arguments]'; if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]'; } return isArgs; }; /***/ }), /* 220 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global) { var origSymbol = global.Symbol; var hasSymbolSham = __webpack_require__(336); module.exports = function hasNativeSymbols() { if (typeof origSymbol !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } if (typeof origSymbol('foo') !== 'symbol') { return false; } if (typeof Symbol('bar') !== 'symbol') { return false; } return hasSymbolSham(); }; /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(131))) /***/ }), /* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ArraySpeciesCreate = __webpack_require__(337); var FlattenIntoArray = __webpack_require__(347); var Get = __webpack_require__(189); var ToInteger = __webpack_require__(233); var ToLength = __webpack_require__(232); var ToObject = __webpack_require__(367); module.exports = function flat() { var O = ToObject(this); var sourceLen = ToLength(Get(O, 'length')); var depthNum = 1; if (arguments.length > 0 && typeof arguments[0] !== 'undefined') { depthNum = ToInteger(arguments[0]); } var A = ArraySpeciesCreate(O, 0); FlattenIntoArray(A, O, sourceLen, 0, depthNum); return A; }; /***/ }), /* 222 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(58); var $defineProperty = GetIntrinsic('%Object.defineProperty%', true); if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = null; } } var callBound = __webpack_require__(144); var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable'); // eslint-disable-next-line max-params module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) { if (!$defineProperty) { if (!IsDataDescriptor(desc)) { // ES3 does not support getters/setters return false; } if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) { return false; } // fallback for ES3 if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) { // a non-enumerable existing property return false; } // property does not exist at all, or exists but is enumerable var V = desc['[[Value]]']; // eslint-disable-next-line no-param-reassign O[P] = V; // will use [[Define]] return SameValue(O[P], V); } $defineProperty(O, P, FromPropertyDescriptor(desc)); return true; }; /***/ }), /* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var assertRecord = __webpack_require__(191); var Type = __webpack_require__(93); // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor module.exports = function FromPropertyDescriptor(Desc) { if (typeof Desc === 'undefined') { return Desc; } assertRecord(Type, 'Property Descriptor', 'Desc', Desc); var obj = {}; if ('[[Value]]' in Desc) { obj.value = Desc['[[Value]]']; } if ('[[Writable]]' in Desc) { obj.writable = Desc['[[Writable]]']; } if ('[[Get]]' in Desc) { obj.get = Desc['[[Get]]']; } if ('[[Set]]' in Desc) { obj.set = Desc['[[Set]]']; } if ('[[Enumerable]]' in Desc) { obj.enumerable = Desc['[[Enumerable]]']; } if ('[[Configurable]]' in Desc) { obj.configurable = Desc['[[Configurable]]']; } return obj; }; /***/ }), /* 224 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__(94); var assertRecord = __webpack_require__(191); var Type = __webpack_require__(93); // https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor module.exports = function IsDataDescriptor(Desc) { if (typeof Desc === 'undefined') { return false; } assertRecord(Type, 'Property Descriptor', 'Desc', Desc); if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) { return false; } return true; }; /***/ }), /* 225 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $isNaN = __webpack_require__(192); // http://www.ecma-international.org/ecma-262/5.1/#sec-9.12 module.exports = function SameValue(x, y) { if (x === y) { // 0 === -0, but they are not identical. if (x === 0) { return 1 / x === 1 / y; } return true; } return $isNaN(x) && $isNaN(y); }; /***/ }), /* 226 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var has = __webpack_require__(94); var GetIntrinsic = __webpack_require__(58); var $TypeError = GetIntrinsic('%TypeError%'); var Type = __webpack_require__(93); var ToBoolean = __webpack_require__(227); var IsCallable = __webpack_require__(345); // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5 module.exports = function ToPropertyDescriptor(Obj) { if (Type(Obj) !== 'Object') { throw new $TypeError('ToPropertyDescriptor requires an object'); } var desc = {}; if (has(Obj, 'enumerable')) { desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable); } if (has(Obj, 'configurable')) { desc['[[Configurable]]'] = ToBoolean(Obj.configurable); } if (has(Obj, 'value')) { desc['[[Value]]'] = Obj.value; } if (has(Obj, 'writable')) { desc['[[Writable]]'] = ToBoolean(Obj.writable); } if (has(Obj, 'get')) { var getter = Obj.get; if (typeof getter !== 'undefined' && !IsCallable(getter)) { throw new $TypeError('getter must be a function'); } desc['[[Get]]'] = getter; } if (has(Obj, 'set')) { var setter = Obj.set; if (typeof setter !== 'undefined' && !IsCallable(setter)) { throw new $TypeError('setter must be a function'); } desc['[[Set]]'] = setter; } if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) { throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute'); } return desc; }; /***/ }), /* 227 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // http://www.ecma-international.org/ecma-262/5.1/#sec-9.2 module.exports = function ToBoolean(value) { return !!value; }; /***/ }), /* 228 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var fnToStr = Function.prototype.toString; var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; var badArrayLike; var isCallableMarker; if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') { try { badArrayLike = Object.defineProperty({}, 'length', { get: function () { throw isCallableMarker; } }); isCallableMarker = {}; // eslint-disable-next-line no-throw-literal reflectApply(function () { throw 42; }, null, badArrayLike); } catch (_) { if (_ !== isCallableMarker) { reflectApply = null; } } } else { reflectApply = null; } var constructorRegex = /^\s*class\b/; var isES6ClassFn = function isES6ClassFunction(value) { try { var fnStr = fnToStr.call(value); return constructorRegex.test(fnStr); } catch (e) { return false; // not a function } }; var tryFunctionObject = function tryFunctionToStr(value) { try { if (isES6ClassFn(value)) { return false; } fnToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var fnClass = '[object Function]'; var genClass = '[object GeneratorFunction]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = reflectApply ? function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (typeof value === 'function' && !value.prototype) { return true; } try { reflectApply(value, null, badArrayLike); } catch (e) { if (e !== isCallableMarker) { return false; } } return !isES6ClassFn(value); } : function isCallable(value) { if (!value) { return false; } if (typeof value !== 'function' && typeof value !== 'object') { return false; } if (typeof value === 'function' && !value.prototype) { return true; } if (hasToStringTag) { return tryFunctionObject(value); } if (isES6ClassFn(value)) { return false; } var strClass = toStr.call(value); return strClass === fnClass || strClass === genClass; }; /***/ }), /* 229 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var $isNaN = Number.isNaN || function (a) { return a !== a; }; module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; /***/ }), /* 230 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(58); var $Math = GetIntrinsic('%Math%'); var $Number = GetIntrinsic('%Number%'); module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1; /***/ }), /* 231 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function isPrimitive(value) { return value === null || (typeof value !== 'function' && typeof value !== 'object'); }; /***/ }), /* 232 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var MAX_SAFE_INTEGER = __webpack_require__(230); var ToInteger = __webpack_require__(233); module.exports = function ToLength(argument) { var len = ToInteger(argument); if (len <= 0) { return 0; } // includes converting -0 to +0 if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; } return len; }; /***/ }), /* 233 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ES5ToInteger = __webpack_require__(357); var ToNumber = __webpack_require__(360); // https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger module.exports = function ToInteger(value) { var number = ToNumber(value); return ES5ToInteger(number); }; /***/ }), /* 234 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var getDay = Date.prototype.getDay; var tryDateObject = function tryDateObject(value) { try { getDay.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var dateClass = '[object Date]'; var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol'; module.exports = function isDateObject(value) { if (typeof value !== 'object' || value === null) { return false; } return hasToStringTag ? tryDateObject(value) : toStr.call(value) === dateClass; }; /***/ }), /* 235 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* eslint complexity: [2, 17], max-statements: [2, 33] */ module.exports = function hasSymbols() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } var obj = {}; var sym = Symbol('test'); var symObj = Object(sym); if (typeof sym === 'string') { return false; } if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; } // temp disabled per https://github.com/ljharb/object.assign/issues/17 // if (sym instanceof Symbol) { return false; } // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4 // if (!(symObj instanceof Symbol)) { return false; } // if (typeof Symbol.prototype.toString !== 'function') { return false; } // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; } var symVal = 42; obj[sym] = symVal; for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; } var syms = Object.getOwnPropertySymbols(obj); if (syms.length !== 1 || syms[0] !== sym) { return false; } if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { var descriptor = Object.getOwnPropertyDescriptor(obj, sym); if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; } } return true; }; /***/ }), /* 236 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(221); module.exports = function getPolyfill() { return Array.prototype.flat || implementation; }; /***/ }), /* 237 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var styleInterface = void 0; var styleTheme = void 0; var START_MARK = 'react-with-styles.resolve.start'; var END_MARK = 'react-with-styles.resolve.end'; var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]'; function registerTheme(theme) { styleTheme = theme; } function registerInterface(interfaceToRegister) { styleInterface = interfaceToRegister; } function create(makeFromTheme, createWithDirection) { var styles = createWithDirection(makeFromTheme(styleTheme)); return function () { return styles; }; } function createLTR(makeFromTheme) { return create(makeFromTheme, styleInterface.createLTR || styleInterface.create); } function createRTL(makeFromTheme) { return create(makeFromTheme, styleInterface.createRTL || styleInterface.create); } function get() { return styleTheme; } function resolve() { if (false) {} for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) { styles[_key] = arguments[_key]; } var result = styleInterface.resolve(styles); if (false) {} return result; } function resolveLTR() { for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { styles[_key2] = arguments[_key2]; } if (styleInterface.resolveLTR) { return styleInterface.resolveLTR(styles); } return resolve(styles); } function resolveRTL() { for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { styles[_key3] = arguments[_key3]; } if (styleInterface.resolveRTL) { return styleInterface.resolveRTL(styles); } return resolve(styles); } function flush() { if (styleInterface.flush) { styleInterface.flush(); } } exports['default'] = { registerTheme: registerTheme, registerInterface: registerInterface, create: createLTR, createLTR: createLTR, createRTL: createRTL, get: get, resolve: resolveLTR, resolveLTR: resolveLTR, resolveRTL: resolveRTL, flush: flush }; /***/ }), /* 238 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var core = { white: '#fff', gray: '#484848', grayLight: '#82888a', grayLighter: '#cacccd', grayLightest: '#f2f2f2', borderMedium: '#c4c4c4', border: '#dbdbdb', borderLight: '#e4e7e7', borderLighter: '#eceeee', borderBright: '#f4f5f5', primary: '#00a699', primaryShade_1: '#33dacd', primaryShade_2: '#66e2da', primaryShade_3: '#80e8e0', primaryShade_4: '#b2f1ec', primary_dark: '#008489', secondary: '#007a87', yellow: '#ffe8bc', yellow_dark: '#ffce71' }; exports['default'] = { reactDates: { zIndex: 0, border: { input: { border: 0, borderTop: 0, borderRight: 0, borderBottom: '2px solid transparent', borderLeft: 0, outlineFocused: 0, borderFocused: 0, borderTopFocused: 0, borderLeftFocused: 0, borderBottomFocused: '2px solid ' + String(core.primary_dark), borderRightFocused: 0, borderRadius: 0 }, pickerInput: { borderWidth: 1, borderStyle: 'solid', borderRadius: 2 } }, color: { core: core, disabled: core.grayLightest, background: core.white, backgroundDark: '#f2f2f2', backgroundFocused: core.white, border: 'rgb(219, 219, 219)', text: core.gray, textDisabled: core.border, textFocused: '#007a87', placeholderText: '#757575', outside: { backgroundColor: core.white, backgroundColor_active: core.white, backgroundColor_hover: core.white, color: core.gray, color_active: core.gray, color_hover: core.gray }, highlighted: { backgroundColor: core.yellow, backgroundColor_active: core.yellow_dark, backgroundColor_hover: core.yellow_dark, color: core.gray, color_active: core.gray, color_hover: core.gray }, minimumNights: { backgroundColor: core.white, backgroundColor_active: core.white, backgroundColor_hover: core.white, borderColor: core.borderLighter, color: core.grayLighter, color_active: core.grayLighter, color_hover: core.grayLighter }, hoveredSpan: { backgroundColor: core.primaryShade_4, backgroundColor_active: core.primaryShade_3, backgroundColor_hover: core.primaryShade_4, borderColor: core.primaryShade_3, borderColor_active: core.primaryShade_3, borderColor_hover: core.primaryShade_3, color: core.secondary, color_active: core.secondary, color_hover: core.secondary }, selectedSpan: { backgroundColor: core.primaryShade_2, backgroundColor_active: core.primaryShade_1, backgroundColor_hover: core.primaryShade_1, borderColor: core.primaryShade_1, borderColor_active: core.primary, borderColor_hover: core.primary, color: core.white, color_active: core.white, color_hover: core.white }, selected: { backgroundColor: core.primary, backgroundColor_active: core.primary, backgroundColor_hover: core.primary, borderColor: core.primary, borderColor_active: core.primary, borderColor_hover: core.primary, color: core.white, color_active: core.white, color_hover: core.white }, blocked_calendar: { backgroundColor: core.grayLighter, backgroundColor_active: core.grayLighter, backgroundColor_hover: core.grayLighter, borderColor: core.grayLighter, borderColor_active: core.grayLighter, borderColor_hover: core.grayLighter, color: core.grayLight, color_active: core.grayLight, color_hover: core.grayLight }, blocked_out_of_range: { backgroundColor: core.white, backgroundColor_active: core.white, backgroundColor_hover: core.white, borderColor: core.borderLight, borderColor_active: core.borderLight, borderColor_hover: core.borderLight, color: core.grayLighter, color_active: core.grayLighter, color_hover: core.grayLighter } }, spacing: { dayPickerHorizontalPadding: 9, captionPaddingTop: 22, captionPaddingBottom: 37, inputPadding: 0, displayTextPaddingVertical: undefined, displayTextPaddingTop: 11, displayTextPaddingBottom: 9, displayTextPaddingHorizontal: undefined, displayTextPaddingLeft: 11, displayTextPaddingRight: 11, displayTextPaddingVertical_small: undefined, displayTextPaddingTop_small: 7, displayTextPaddingBottom_small: 5, displayTextPaddingHorizontal_small: undefined, displayTextPaddingLeft_small: 7, displayTextPaddingRight_small: 7 }, sizing: { inputWidth: 130, inputWidth_small: 97, arrowWidth: 24 }, noScrollBarOnVerticalScrollable: false, font: { size: 14, captionSize: 18, input: { size: 19, lineHeight: '24px', size_small: 15, lineHeight_small: '18px', letterSpacing_small: '0.2px', styleDisabled: 'italic' } } } }; /***/ }), /* 239 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // modified from https://github.com/es-shims/es6-shim var keys = __webpack_require__(187); var bind = __webpack_require__(120); var canBeObject = function (obj) { return typeof obj !== 'undefined' && obj !== null; }; var hasSymbols = __webpack_require__(235)(); var toObject = Object; var push = bind.call(Function.call, Array.prototype.push); var propIsEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null; module.exports = function assign(target, source1) { if (!canBeObject(target)) { throw new TypeError('target must be an object'); } var objTarget = toObject(target); var s, source, i, props, syms, value, key; for (s = 1; s < arguments.length; ++s) { source = toObject(arguments[s]); props = keys(source); var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols); if (getSymbols) { syms = getSymbols(source); for (i = 0; i < syms.length; ++i) { key = syms[i]; if (propIsEnumerable(source, key)) { push(props, key); } } } for (i = 0; i < props.length; ++i) { key = props[i]; value = source[key]; if (propIsEnumerable(source, key)) { objTarget[key] = value; } } } return objTarget; }; /***/ }), /* 240 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(239); var lacksProperEnumerationOrder = function () { if (!Object.assign) { return false; } // v8, specifically in node 4.x, has a bug with incorrect property enumeration order // note: this does not detect the bug unless there's 20 characters var str = 'abcdefghijklmnopqrst'; var letters = str.split(''); var map = {}; for (var i = 0; i < letters.length; ++i) { map[letters[i]] = letters[i]; } var obj = Object.assign({}, map); var actual = ''; for (var k in obj) { actual += k; } return str !== actual; }; var assignHasPendingExceptions = function () { if (!Object.assign || !Object.preventExtensions) { return false; } // Firefox 37 still has "pending exception" logic in its Object.assign implementation, // which is 72% slower than our shim, and Firefox 40's native implementation. var thrower = Object.preventExtensions({ 1: 2 }); try { Object.assign(thrower, 'xy'); } catch (e) { return thrower[1] === 'y'; } return false; }; module.exports = function getPolyfill() { if (!Object.assign) { return implementation; } if (lacksProperEnumerationOrder()) { return implementation; } if (assignHasPendingExceptions()) { return implementation; } return Object.assign; }; /***/ }), /* 241 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var define = __webpack_require__(104); var implementation = __webpack_require__(242); var getPolyfill = __webpack_require__(250); var shim = __webpack_require__(389); var polyfill = getPolyfill(); define(polyfill, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = polyfill; /***/ }), /* 242 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var ES = __webpack_require__(380); var has = __webpack_require__(94); var bind = __webpack_require__(120); var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); module.exports = function values(O) { var obj = ES.RequireObjectCoercible(O); var vals = []; for (var key in obj) { if (has(obj, key) && isEnumerable(obj, key)) { vals.push(obj[key]); } } return vals; }; /***/ }), /* 243 */ /***/ (function(module, exports) { module.exports = function isPrimitive(value) { return value === null || (typeof value !== 'function' && typeof value !== 'object'); }; /***/ }), /* 244 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var GetIntrinsic = __webpack_require__(195); var $TypeError = GetIntrinsic('%TypeError%'); var $SyntaxError = GetIntrinsic('%SyntaxError%'); var has = __webpack_require__(94); var predicates = { // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type 'Property Descriptor': function isPropertyDescriptor(ES, Desc) { if (ES.Type(Desc) !== 'Object') { return false; } var allowed = { '[[Configurable]]': true, '[[Enumerable]]': true, '[[Get]]': true, '[[Set]]': true, '[[Value]]': true, '[[Writable]]': true }; for (var key in Desc) { // eslint-disable-line if (has(Desc, key) && !allowed[key]) { return false; } } var isData = has(Desc, '[[Value]]'); var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]'); if (isData && IsAccessor) { throw new $TypeError('Property Descriptors may not be both accessor and data descriptors'); } return true; } }; module.exports = function assertRecord(ES, recordType, argumentName, value) { var predicate = predicates[recordType]; if (typeof predicate !== 'function') { throw new $SyntaxError('unknown record type: ' + recordType); } if (!predicate(ES, value)) { throw new $TypeError(argumentName + ' must be a ' + recordType); } console.log(predicate(ES, value), value); }; /***/ }), /* 245 */ /***/ (function(module, exports) { module.exports = Number.isNaN || function isNaN(a) { return a !== a; }; /***/ }), /* 246 */ /***/ (function(module, exports) { var $isNaN = Number.isNaN || function (a) { return a !== a; }; module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; }; /***/ }), /* 247 */ /***/ (function(module, exports, __webpack_require__) { var bind = __webpack_require__(120); var has = bind.call(Function.call, Object.prototype.hasOwnProperty); var $assign = Object.assign; module.exports = function assign(target, source) { if ($assign) { return $assign(target, source); } for (var key in source) { if (has(source, key)) { target[key] = source[key]; } } return target; }; /***/ }), /* 248 */ /***/ (function(module, exports) { module.exports = function sign(number) { return number >= 0 ? 1 : -1; }; /***/ }), /* 249 */ /***/ (function(module, exports) { module.exports = function mod(number, modulo) { var remain = number % modulo; return Math.floor(remain >= 0 ? remain : remain + modulo); }; /***/ }), /* 250 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(242); module.exports = function getPolyfill() { return typeof Object.values === 'function' ? Object.values : implementation; }; /***/ }), /* 251 */ /***/ (function(module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = isTouchDevice; function isTouchDevice() { return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints)); } module.exports = exports['default']; /***/ }), /* 252 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = isAfterDay; var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); var _isBeforeDay = __webpack_require__(253); var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay); var _isSameDay = __webpack_require__(196); var _isSameDay2 = _interopRequireDefault(_isSameDay); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function isAfterDay(a, b) { if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b); } /***/ }), /* 253 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = isBeforeDay; var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function isBeforeDay(a, b) { if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; var aYear = a.year(); var aMonth = a.month(); var bYear = b.year(); var bMonth = b.month(); var isSameYear = aYear === bYear; var isSameMonth = aMonth === bMonth; if (isSameYear && isSameMonth) return a.date() < b.date(); if (isSameYear) return aMonth < bMonth; return aYear < bYear; } /***/ }), /* 254 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = toMomentObject; var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function toMomentObject(dateString, customFormat) { var dateFormats = customFormat ? [customFormat, _constants.DISPLAY_FORMAT, _constants.ISO_FORMAT] : [_constants.DISPLAY_FORMAT, _constants.ISO_FORMAT]; var date = (0, _moment2['default'])(dateString, dateFormats, true); return date.isValid() ? date.hour(12) : null; } /***/ }), /* 255 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = isDayVisible; var _isBeforeDay = __webpack_require__(253); var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay); var _isAfterDay = __webpack_require__(252); var _isAfterDay2 = _interopRequireDefault(_isAfterDay); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function isDayVisible(day, month, numberOfMonths, enableOutsideDays) { var firstDayOfFirstMonth = month.clone().startOf('month'); if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week'); if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false; var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month'); if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week'); return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth); } /***/ }), /* 256 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = toISODateString; var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); var _toMomentObject = __webpack_require__(254); var _toMomentObject2 = _interopRequireDefault(_toMomentObject); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function toISODateString(date, currentFormat) { var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat); if (!dateObj) return null; return dateObj.format(_constants.ISO_FORMAT); } /***/ }), /* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var _propTypes = __webpack_require__(28); var _propTypes2 = _interopRequireDefault(_propTypes); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } exports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]); /***/ }), /* 258 */ /***/ (function(module, exports, __webpack_require__) { var freeGlobal = __webpack_require__(401); /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); module.exports = root; /***/ }), /* 259 */ /***/ (function(module, exports, __webpack_require__) { var root = __webpack_require__(258); /** Built-in value references. */ var Symbol = root.Symbol; module.exports = Symbol; /***/ }), /* 260 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEventListener", function() { return addEventListener; }); var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); // Adapted from Modernizr // https://github.com/Modernizr/Modernizr/blob/acb3f0d9/feature-detects/dom/passiveeventlisteners.js#L26-L37 function testPassiveEventListeners() { if (!CAN_USE_DOM) { return false; } if (!window.addEventListener || !window.removeEventListener || !Object.defineProperty) { return false; } var supportsPassiveOption = false; try { var opts = Object.defineProperty({}, 'passive', { // eslint-disable-next-line getter-return get: function () { function get() { supportsPassiveOption = true; } return get; }() }); var noop = function noop() {}; window.addEventListener('testPassiveEventSupport', noop, opts); window.removeEventListener('testPassiveEventSupport', noop, opts); } catch (e) { // do nothing } return supportsPassiveOption; } var memoized = void 0; function canUsePassiveEventListeners() { if (memoized === undefined) { memoized = testPassiveEventListeners(); } return memoized; } function normalizeEventOptions(eventOptions) { if (!eventOptions) { return undefined; } if (!canUsePassiveEventListeners()) { // If the browser does not support the passive option, then it is expecting // a boolean for the options argument to specify whether it should use // capture or not. In more modern browsers, this is passed via the `capture` // option, so let's just hoist that value up. return !!eventOptions.capture; } return eventOptions; } /* eslint-disable no-bitwise */ /** * Generate a unique key for any set of event options */ function eventOptionsKey(normalizedEventOptions) { if (!normalizedEventOptions) { return 0; } // If the browser does not support passive event listeners, the normalized // event options will be a boolean. if (normalizedEventOptions === true) { return 100; } // At this point, the browser supports passive event listeners, so we expect // the event options to be an object with possible properties of capture, // passive, and once. // // We want to consistently return the same value, regardless of the order of // these properties, so let's use binary maths to assign each property to a // bit, and then add those together (with an offset to account for the // booleans at the beginning of this function). var capture = normalizedEventOptions.capture << 0; var passive = normalizedEventOptions.passive << 1; var once = normalizedEventOptions.once << 2; return capture + passive + once; } function ensureCanMutateNextEventHandlers(eventHandlers) { if (eventHandlers.handlers === eventHandlers.nextHandlers) { // eslint-disable-next-line no-param-reassign eventHandlers.nextHandlers = eventHandlers.handlers.slice(); } } function TargetEventHandlers(target) { this.target = target; this.events = {}; } TargetEventHandlers.prototype.getEventHandlers = function () { function getEventHandlers(eventName, options) { var key = String(eventName) + ' ' + String(eventOptionsKey(options)); if (!this.events[key]) { this.events[key] = { handlers: [], handleEvent: undefined }; this.events[key].nextHandlers = this.events[key].handlers; } return this.events[key]; } return getEventHandlers; }(); TargetEventHandlers.prototype.handleEvent = function () { function handleEvent(eventName, options, event) { var eventHandlers = this.getEventHandlers(eventName, options); eventHandlers.handlers = eventHandlers.nextHandlers; eventHandlers.handlers.forEach(function (handler) { if (handler) { // We need to check for presence here because a handler function may // cause later handlers to get removed. This can happen if you for // instance have a waypoint that unmounts another waypoint as part of an // onEnter/onLeave handler. handler(event); } }); } return handleEvent; }(); TargetEventHandlers.prototype.add = function () { function add(eventName, listener, options) { var _this = this; // options has already been normalized at this point. var eventHandlers = this.getEventHandlers(eventName, options); ensureCanMutateNextEventHandlers(eventHandlers); if (eventHandlers.nextHandlers.length === 0) { eventHandlers.handleEvent = this.handleEvent.bind(this, eventName, options); this.target.addEventListener(eventName, eventHandlers.handleEvent, options); } eventHandlers.nextHandlers.push(listener); var isSubscribed = true; var unsubscribe = function () { function unsubscribe() { if (!isSubscribed) { return; } isSubscribed = false; ensureCanMutateNextEventHandlers(eventHandlers); var index = eventHandlers.nextHandlers.indexOf(listener); eventHandlers.nextHandlers.splice(index, 1); if (eventHandlers.nextHandlers.length === 0) { // All event handlers have been removed, so we want to remove the event // listener from the target node. if (_this.target) { // There can be a race condition where the target may no longer exist // when this function is called, e.g. when a React component is // unmounting. Guarding against this prevents the following error: // // Cannot read property 'removeEventListener' of undefined _this.target.removeEventListener(eventName, eventHandlers.handleEvent, options); } eventHandlers.handleEvent = undefined; } } return unsubscribe; }(); return unsubscribe; } return add; }(); var EVENT_HANDLERS_KEY = '__consolidated_events_handlers__'; // eslint-disable-next-line import/prefer-default-export function addEventListener(target, eventName, listener, options) { if (!target[EVENT_HANDLERS_KEY]) { // eslint-disable-next-line no-param-reassign target[EVENT_HANDLERS_KEY] = new TargetEventHandlers(target); } var normalizedEventOptions = normalizeEventOptions(options); return target[EVENT_HANDLERS_KEY].add(eventName, listener, normalizedEventOptions); } /***/ }), /* 261 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; module.exports = function contains(other) { if (arguments.length < 1) { throw new TypeError('1 argument is required'); } if (typeof other !== 'object') { throw new TypeError('Argument 1 (”other“) to Node.contains must be an instance of Node'); } var node = other; do { if (this === node) { return true; } if (node) { node = node.parentNode; } } while (node); return false; }; /***/ }), /* 262 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(261); module.exports = function getPolyfill() { if (typeof document !== 'undefined') { if (document.contains) { return document.contains; } if (document.body && document.body.contains) { try { if (typeof document.body.contains.call(document, '') === 'boolean') { return document.body.contains; } } catch (e) { /**/ } } } return implementation; }; /***/ }), /* 263 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PureCalendarDay = undefined; var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); var _object = __webpack_require__(95); var _object2 = _interopRequireDefault(_object); var _react = __webpack_require__(13); var _react2 = _interopRequireDefault(_react); var _propTypes = __webpack_require__(28); var _propTypes2 = _interopRequireDefault(_propTypes); var _reactAddonsShallowCompare = __webpack_require__(147); var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare); var _reactMomentProptypes = __webpack_require__(145); var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes); var _airbnbPropTypes = __webpack_require__(89); var _reactWithStyles = __webpack_require__(113); var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); var _defaultPhrases = __webpack_require__(111); var _getPhrasePropTypes = __webpack_require__(112); var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes); var _getCalendarDaySettings = __webpack_require__(264); var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings); var _ModifiersShape = __webpack_require__(163); var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, { day: _reactMomentProptypes2['default'].momentObj, daySize: _airbnbPropTypes.nonNegativeInteger, isOutsideDay: _propTypes2['default'].bool, modifiers: _ModifiersShape2['default'], isFocused: _propTypes2['default'].bool, tabIndex: _propTypes2['default'].oneOf([0, -1]), onDayClick: _propTypes2['default'].func, onDayMouseEnter: _propTypes2['default'].func, onDayMouseLeave: _propTypes2['default'].func, renderDayContents: _propTypes2['default'].func, ariaLabelFormat: _propTypes2['default'].string, // internationalization phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases)) })); var defaultProps = { day: (0, _moment2['default'])(), daySize: _constants.DAY_SIZE, isOutsideDay: false, modifiers: new Set(), isFocused: false, tabIndex: -1, onDayClick: function () { function onDayClick() {} return onDayClick; }(), onDayMouseEnter: function () { function onDayMouseEnter() {} return onDayMouseEnter; }(), onDayMouseLeave: function () { function onDayMouseLeave() {} return onDayMouseLeave; }(), renderDayContents: null, ariaLabelFormat: 'dddd, LL', // internationalization phrases: _defaultPhrases.CalendarDayPhrases }; var CalendarDay = function (_React$Component) { _inherits(CalendarDay, _React$Component); function CalendarDay() { var _ref; _classCallCheck(this, CalendarDay); for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args))); _this.setButtonRef = _this.setButtonRef.bind(_this); return _this; } _createClass(CalendarDay, [{ key: 'shouldComponentUpdate', value: function () { function shouldComponentUpdate(nextProps, nextState) { return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState); } return shouldComponentUpdate; }() }, { key: 'componentDidUpdate', value: function () { function componentDidUpdate(prevProps) { var _props = this.props, isFocused = _props.isFocused, tabIndex = _props.tabIndex; if (tabIndex === 0) { if (isFocused || tabIndex !== prevProps.tabIndex) { this.buttonRef.focus(); } } } return componentDidUpdate; }() }, { key: 'onDayClick', value: function () { function onDayClick(day, e) { var onDayClick = this.props.onDayClick; onDayClick(day, e); } return onDayClick; }() }, { key: 'onDayMouseEnter', value: function () { function onDayMouseEnter(day, e) { var onDayMouseEnter = this.props.onDayMouseEnter; onDayMouseEnter(day, e); } return onDayMouseEnter; }() }, { key: 'onDayMouseLeave', value: function () { function onDayMouseLeave(day, e) { var onDayMouseLeave = this.props.onDayMouseLeave; onDayMouseLeave(day, e); } return onDayMouseLeave; }() }, { key: 'onKeyDown', value: function () { function onKeyDown(day, e) { var onDayClick = this.props.onDayClick; var key = e.key; if (key === 'Enter' || key === ' ') { onDayClick(day, e); } } return onKeyDown; }() }, { key: 'setButtonRef', value: function () { function setButtonRef(ref) { this.buttonRef = ref; } return setButtonRef; }() }, { key: 'render', value: function () { function render() { var _this2 = this; var _props2 = this.props, day = _props2.day, ariaLabelFormat = _props2.ariaLabelFormat, daySize = _props2.daySize, isOutsideDay = _props2.isOutsideDay, modifiers = _props2.modifiers, renderDayContents = _props2.renderDayContents, tabIndex = _props2.tabIndex, styles = _props2.styles, phrases = _props2.phrases; if (!day) return _react2['default'].createElement('td', null); var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases), daySizeStyles = _getCalendarDaySettin.daySizeStyles, useDefaultCursor = _getCalendarDaySettin.useDefaultCursor, selected = _getCalendarDaySettin.selected, hoveredSpan = _getCalendarDaySettin.hoveredSpan, isOutsideRange = _getCalendarDaySettin.isOutsideRange, ariaLabel = _getCalendarDaySettin.ariaLabel; return _react2['default'].createElement( 'td', _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), { role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role , ref: this.setButtonRef, 'aria-label': ariaLabel, onMouseEnter: function () { function onMouseEnter(e) { _this2.onDayMouseEnter(day, e); } return onMouseEnter; }(), onMouseLeave: function () { function onMouseLeave(e) { _this2.onDayMouseLeave(day, e); } return onMouseLeave; }(), onMouseUp: function () { function onMouseUp(e) { e.currentTarget.blur(); } return onMouseUp; }(), onClick: function () { function onClick(e) { _this2.onDayClick(day, e); } return onClick; }(), onKeyDown: function () { function onKeyDown(e) { _this2.onKeyDown(day, e); } return onKeyDown; }(), tabIndex: tabIndex }), renderDayContents ? renderDayContents(day, modifiers) : day.format('D') ); } return render; }() }]); return CalendarDay; }(_react2['default'].Component); CalendarDay.propTypes = propTypes; CalendarDay.defaultProps = defaultProps; exports.PureCalendarDay = CalendarDay; exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) { var _ref2$reactDates = _ref2.reactDates, color = _ref2$reactDates.color, font = _ref2$reactDates.font; return { CalendarDay: { boxSizing: 'border-box', cursor: 'pointer', fontSize: font.size, textAlign: 'center', ':active': { outline: 0 } }, CalendarDay__defaultCursor: { cursor: 'default' }, CalendarDay__default: { border: '1px solid ' + String(color.core.borderLight), color: color.text, background: color.background, ':hover': { background: color.core.borderLight, border: '1px double ' + String(color.core.borderLight), color: 'inherit' } }, CalendarDay__hovered_offset: { background: color.core.borderBright, border: '1px double ' + String(color.core.borderLight), color: 'inherit' }, CalendarDay__outside: { border: 0, background: color.outside.backgroundColor, color: color.outside.color, ':hover': { border: 0 } }, CalendarDay__blocked_minimum_nights: { background: color.minimumNights.backgroundColor, border: '1px solid ' + String(color.minimumNights.borderColor), color: color.minimumNights.color, ':hover': { background: color.minimumNights.backgroundColor_hover, color: color.minimumNights.color_active }, ':active': { background: color.minimumNights.backgroundColor_active, color: color.minimumNights.color_active } }, CalendarDay__highlighted_calendar: { background: color.highlighted.backgroundColor, color: color.highlighted.color, ':hover': { background: color.highlighted.backgroundColor_hover, color: color.highlighted.color_active }, ':active': { background: color.highlighted.backgroundColor_active, color: color.highlighted.color_active } }, CalendarDay__selected_span: { background: color.selectedSpan.backgroundColor, border: '1px solid ' + String(color.selectedSpan.borderColor), color: color.selectedSpan.color, ':hover': { background: color.selectedSpan.backgroundColor_hover, border: '1px solid ' + String(color.selectedSpan.borderColor), color: color.selectedSpan.color_active }, ':active': { background: color.selectedSpan.backgroundColor_active, border: '1px solid ' + String(color.selectedSpan.borderColor), color: color.selectedSpan.color_active } }, CalendarDay__last_in_range: { borderRight: color.core.primary }, CalendarDay__selected: { background: color.selected.backgroundColor, border: '1px solid ' + String(color.selected.borderColor), color: color.selected.color, ':hover': { background: color.selected.backgroundColor_hover, border: '1px solid ' + String(color.selected.borderColor), color: color.selected.color_active }, ':active': { background: color.selected.backgroundColor_active, border: '1px solid ' + String(color.selected.borderColor), color: color.selected.color_active } }, CalendarDay__hovered_span: { background: color.hoveredSpan.backgroundColor, border: '1px solid ' + String(color.hoveredSpan.borderColor), color: color.hoveredSpan.color, ':hover': { background: color.hoveredSpan.backgroundColor_hover, border: '1px solid ' + String(color.hoveredSpan.borderColor), color: color.hoveredSpan.color_active }, ':active': { background: color.hoveredSpan.backgroundColor_active, border: '1px solid ' + String(color.hoveredSpan.borderColor), color: color.hoveredSpan.color_active } }, CalendarDay__blocked_calendar: { background: color.blocked_calendar.backgroundColor, border: '1px solid ' + String(color.blocked_calendar.borderColor), color: color.blocked_calendar.color, ':hover': { background: color.blocked_calendar.backgroundColor_hover, border: '1px solid ' + String(color.blocked_calendar.borderColor), color: color.blocked_calendar.color_active }, ':active': { background: color.blocked_calendar.backgroundColor_active, border: '1px solid ' + String(color.blocked_calendar.borderColor), color: color.blocked_calendar.color_active } }, CalendarDay__blocked_out_of_range: { background: color.blocked_out_of_range.backgroundColor, border: '1px solid ' + String(color.blocked_out_of_range.borderColor), color: color.blocked_out_of_range.color, ':hover': { background: color.blocked_out_of_range.backgroundColor_hover, border: '1px solid ' + String(color.blocked_out_of_range.borderColor), color: color.blocked_out_of_range.color_active }, ':active': { background: color.blocked_out_of_range.backgroundColor_active, border: '1px solid ' + String(color.blocked_out_of_range.borderColor), color: color.blocked_out_of_range.color_active } }, CalendarDay__selected_start: {}, CalendarDay__selected_end: {}, CalendarDay__today: {}, CalendarDay__firstDayOfWeek: {}, CalendarDay__lastDayOfWeek: {} }; })(CalendarDay); /***/ }), /* 264 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = getCalendarDaySettings; var _getPhrase = __webpack_require__(415); var _getPhrase2 = _interopRequireDefault(_getPhrase); var _constants = __webpack_require__(78); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function getCalendarDaySettings(day, ariaLabelFormat, daySize, modifiers, phrases) { var chooseAvailableDate = phrases.chooseAvailableDate, dateIsUnavailable = phrases.dateIsUnavailable, dateIsSelected = phrases.dateIsSelected; var daySizeStyles = { width: daySize, height: daySize - 1 }; var useDefaultCursor = modifiers.has('blocked-minimum-nights') || modifiers.has('blocked-calendar') || modifiers.has('blocked-out-of-range'); var selected = modifiers.has('selected') || modifiers.has('selected-start') || modifiers.has('selected-end'); var hoveredSpan = !selected && (modifiers.has('hovered-span') || modifiers.has('after-hovered-start')); var isOutsideRange = modifiers.has('blocked-out-of-range'); var formattedDate = { date: day.format(ariaLabelFormat) }; var ariaLabel = (0, _getPhrase2['default'])(chooseAvailableDate, formattedDate); if (modifiers.has(_constants.BLOCKED_MODIFIER)) { ariaLabel = (0, _getPhrase2['default'])(dateIsUnavailable, formattedDate); } else if (selected) { ariaLabel = (0, _getPhrase2['default'])(dateIsSelected, formattedDate); } return { daySizeStyles: daySizeStyles, useDefaultCursor: useDefaultCursor, selected: selected, hoveredSpan: hoveredSpan, isOutsideRange: isOutsideRange, ariaLabel: ariaLabel }; } /***/ }), /* 265 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = calculateDimension; function calculateDimension(el, axis) { var borderBox = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var withMargin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; if (!el) { return 0; } var axisStart = axis === 'width' ? 'Left' : 'Top'; var axisEnd = axis === 'width' ? 'Right' : 'Bottom'; // Only read styles if we need to var style = !borderBox || withMargin ? window.getComputedStyle(el) : null; // Offset includes border and padding var offsetWidth = el.offsetWidth, offsetHeight = el.offsetHeight; var size = axis === 'width' ? offsetWidth : offsetHeight; // Get the inner size if (!borderBox) { size -= parseFloat(style['padding' + axisStart]) + parseFloat(style['padding' + axisEnd]) + parseFloat(style['border' + axisStart + 'Width']) + parseFloat(style['border' + axisEnd + 'Width']); } // Apply margin if (withMargin) { size += parseFloat(style['margin' + axisStart]) + parseFloat(style['margin' + axisEnd]); } return size; } /***/ }), /* 266 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports["default"] = getCalendarMonthWidth; function getCalendarMonthWidth(daySize, calendarMonthPadding) { return 7 * daySize + 2 * calendarMonthPadding + 1; } /***/ }), /* 267 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports['default'] = isSameMonth; var _moment = __webpack_require__(44); var _moment2 = _interopRequireDefault(_moment); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } function isSameMonth(a, b) { if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false; // Compare least significant, most likely to change units first // Moment's isSame clones moment inputs and is a tad slow return a.month() === b.month() && a.year() === b.year(); } /***/ }), /* 268 */, /* 269 */, /* 270 */, /* 271 */, /* 272 */, /* 273 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, "SVG", function() { return /* reexport */ external_this_wp_primitives_["SVG"]; }); __webpack_require__.d(__webpack_exports__, "Path", function() { return /* reexport */ external_this_wp_primitives_["Path"]; }); __webpack_require__.d(__webpack_exports__, "Circle", function() { return /* reexport */ external_this_wp_primitives_["Circle"]; }); __webpack_require__.d(__webpack_exports__, "Polygon", function() { return /* reexport */ external_this_wp_primitives_["Polygon"]; }); __webpack_require__.d(__webpack_exports__, "Rect", function() { return /* reexport */ external_this_wp_primitives_["Rect"]; }); __webpack_require__.d(__webpack_exports__, "G", function() { return /* reexport */ external_this_wp_primitives_["G"]; }); __webpack_require__.d(__webpack_exports__, "HorizontalRule", function() { return /* reexport */ external_this_wp_primitives_["HorizontalRule"]; }); __webpack_require__.d(__webpack_exports__, "BlockQuotation", function() { return /* reexport */ external_this_wp_primitives_["BlockQuotation"]; }); __webpack_require__.d(__webpack_exports__, "__experimentalAlignmentMatrixControl", function() { return /* reexport */ AlignmentMatrixControl; }); __webpack_require__.d(__webpack_exports__, "Animate", function() { return /* reexport */ animate["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "__unstableUseAnimate", function() { return /* reexport */ animate["b" /* useAnimate */]; }); __webpack_require__.d(__webpack_exports__, "AnglePickerControl", function() { return /* reexport */ AnglePickerControl; }); __webpack_require__.d(__webpack_exports__, "Autocomplete", function() { return /* reexport */ autocomplete; }); __webpack_require__.d(__webpack_exports__, "BaseControl", function() { return /* reexport */ base_control; }); __webpack_require__.d(__webpack_exports__, "__experimentalBoxControl", function() { return /* reexport */ BoxControl; }); __webpack_require__.d(__webpack_exports__, "Button", function() { return /* reexport */ build_module_button["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "ButtonGroup", function() { return /* reexport */ button_group; }); __webpack_require__.d(__webpack_exports__, "Card", function() { return /* reexport */ card; }); __webpack_require__.d(__webpack_exports__, "CardBody", function() { return /* reexport */ card_body; }); __webpack_require__.d(__webpack_exports__, "CardDivider", function() { return /* reexport */ divider; }); __webpack_require__.d(__webpack_exports__, "CardFooter", function() { return /* reexport */ footer; }); __webpack_require__.d(__webpack_exports__, "CardHeader", function() { return /* reexport */ card_header; }); __webpack_require__.d(__webpack_exports__, "CardMedia", function() { return /* reexport */ media; }); __webpack_require__.d(__webpack_exports__, "CheckboxControl", function() { return /* reexport */ CheckboxControl; }); __webpack_require__.d(__webpack_exports__, "ClipboardButton", function() { return /* reexport */ ClipboardButton; }); __webpack_require__.d(__webpack_exports__, "__experimentalColorEdit", function() { return /* reexport */ ColorEdit; }); __webpack_require__.d(__webpack_exports__, "ColorIndicator", function() { return /* reexport */ color_indicator; }); __webpack_require__.d(__webpack_exports__, "ColorPalette", function() { return /* reexport */ ColorPalette; }); __webpack_require__.d(__webpack_exports__, "ColorPicker", function() { return /* reexport */ color_picker_ColorPicker; }); __webpack_require__.d(__webpack_exports__, "ComboboxControl", function() { return /* reexport */ combobox_control; }); __webpack_require__.d(__webpack_exports__, "CustomSelectControl", function() { return /* reexport */ CustomSelectControl; }); __webpack_require__.d(__webpack_exports__, "Dashicon", function() { return /* reexport */ dashicon["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "DateTimePicker", function() { return /* reexport */ date_time_DateTimePicker; }); __webpack_require__.d(__webpack_exports__, "DatePicker", function() { return /* reexport */ date_time_date; }); __webpack_require__.d(__webpack_exports__, "TimePicker", function() { return /* reexport */ time; }); __webpack_require__.d(__webpack_exports__, "__experimentalDimensionControl", function() { return /* reexport */ dimension_control; }); __webpack_require__.d(__webpack_exports__, "Disabled", function() { return /* reexport */ build_module_disabled; }); __webpack_require__.d(__webpack_exports__, "Draggable", function() { return /* reexport */ draggable; }); __webpack_require__.d(__webpack_exports__, "DropZone", function() { return /* reexport */ drop_zone; }); __webpack_require__.d(__webpack_exports__, "__unstableUseDropZone", function() { return /* reexport */ useDropZone; }); __webpack_require__.d(__webpack_exports__, "DropZoneProvider", function() { return /* reexport */ provider; }); __webpack_require__.d(__webpack_exports__, "Dropdown", function() { return /* reexport */ Dropdown; }); __webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return /* reexport */ dropdown_menu; }); __webpack_require__.d(__webpack_exports__, "ExternalLink", function() { return /* reexport */ external_link; }); __webpack_require__.d(__webpack_exports__, "Flex", function() { return /* reexport */ flex; }); __webpack_require__.d(__webpack_exports__, "FlexBlock", function() { return /* reexport */ block; }); __webpack_require__.d(__webpack_exports__, "FlexItem", function() { return /* reexport */ flex_item; }); __webpack_require__.d(__webpack_exports__, "FocalPointPicker", function() { return /* reexport */ focal_point_picker; }); __webpack_require__.d(__webpack_exports__, "FocusableIframe", function() { return /* reexport */ focusable_iframe; }); __webpack_require__.d(__webpack_exports__, "FontSizePicker", function() { return /* reexport */ FontSizePicker; }); __webpack_require__.d(__webpack_exports__, "FormFileUpload", function() { return /* reexport */ form_file_upload; }); __webpack_require__.d(__webpack_exports__, "FormToggle", function() { return /* reexport */ form_toggle; }); __webpack_require__.d(__webpack_exports__, "FormTokenField", function() { return /* reexport */ form_token_field; }); __webpack_require__.d(__webpack_exports__, "__experimentalGradientPicker", function() { return /* reexport */ GradientPicker; }); __webpack_require__.d(__webpack_exports__, "__experimentalCustomGradientPicker", function() { return /* reexport */ CustomGradientPicker; }); __webpack_require__.d(__webpack_exports__, "Guide", function() { return /* reexport */ Guide; }); __webpack_require__.d(__webpack_exports__, "GuidePage", function() { return /* reexport */ GuidePage; }); __webpack_require__.d(__webpack_exports__, "Icon", function() { return /* reexport */ components_build_module_icon["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "IconButton", function() { return /* reexport */ deprecated; }); __webpack_require__.d(__webpack_exports__, "__experimentalInputControl", function() { return /* reexport */ input_control; }); __webpack_require__.d(__webpack_exports__, "KeyboardShortcuts", function() { return /* reexport */ keyboard_shortcuts; }); __webpack_require__.d(__webpack_exports__, "MenuGroup", function() { return /* reexport */ menu_group; }); __webpack_require__.d(__webpack_exports__, "MenuItem", function() { return /* reexport */ menu_item; }); __webpack_require__.d(__webpack_exports__, "MenuItemsChoice", function() { return /* reexport */ MenuItemsChoice; }); __webpack_require__.d(__webpack_exports__, "Modal", function() { return /* reexport */ modal; }); __webpack_require__.d(__webpack_exports__, "ScrollLock", function() { return /* reexport */ scroll_lock["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "NavigableMenu", function() { return /* reexport */ navigable_container_menu; }); __webpack_require__.d(__webpack_exports__, "TabbableContainer", function() { return /* reexport */ tabbable; }); __webpack_require__.d(__webpack_exports__, "__experimentalNavigation", function() { return /* reexport */ Navigation; }); __webpack_require__.d(__webpack_exports__, "__experimentalNavigationBackButton", function() { return /* reexport */ back_button; }); __webpack_require__.d(__webpack_exports__, "__experimentalNavigationGroup", function() { return /* reexport */ NavigationGroup; }); __webpack_require__.d(__webpack_exports__, "__experimentalNavigationItem", function() { return /* reexport */ NavigationItem; }); __webpack_require__.d(__webpack_exports__, "__experimentalNavigationMenu", function() { return /* reexport */ NavigationMenu; }); __webpack_require__.d(__webpack_exports__, "Notice", function() { return /* reexport */ build_module_notice; }); __webpack_require__.d(__webpack_exports__, "__experimentalNumberControl", function() { return /* reexport */ number_control; }); __webpack_require__.d(__webpack_exports__, "NoticeList", function() { return /* reexport */ list; }); __webpack_require__.d(__webpack_exports__, "Panel", function() { return /* reexport */ panel; }); __webpack_require__.d(__webpack_exports__, "PanelBody", function() { return /* reexport */ panel_body; }); __webpack_require__.d(__webpack_exports__, "PanelHeader", function() { return /* reexport */ panel_header; }); __webpack_require__.d(__webpack_exports__, "PanelRow", function() { return /* reexport */ row; }); __webpack_require__.d(__webpack_exports__, "Placeholder", function() { return /* reexport */ placeholder; }); __webpack_require__.d(__webpack_exports__, "Popover", function() { return /* reexport */ popover["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "QueryControls", function() { return /* reexport */ QueryControls; }); __webpack_require__.d(__webpack_exports__, "__experimentalRadio", function() { return /* reexport */ build_module_radio; }); __webpack_require__.d(__webpack_exports__, "__experimentalRadioGroup", function() { return /* reexport */ radio_group; }); __webpack_require__.d(__webpack_exports__, "RadioControl", function() { return /* reexport */ RadioControl; }); __webpack_require__.d(__webpack_exports__, "RangeControl", function() { return /* reexport */ range_control; }); __webpack_require__.d(__webpack_exports__, "ResizableBox", function() { return /* reexport */ resizable_box; }); __webpack_require__.d(__webpack_exports__, "ResponsiveWrapper", function() { return /* reexport */ responsive_wrapper; }); __webpack_require__.d(__webpack_exports__, "SandBox", function() { return /* reexport */ sandbox; }); __webpack_require__.d(__webpack_exports__, "SelectControl", function() { return /* reexport */ select_control; }); __webpack_require__.d(__webpack_exports__, "Snackbar", function() { return /* reexport */ snackbar["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "SnackbarList", function() { return /* reexport */ snackbar_list; }); __webpack_require__.d(__webpack_exports__, "Spinner", function() { return /* reexport */ Spinner; }); __webpack_require__.d(__webpack_exports__, "TabPanel", function() { return /* reexport */ TabPanel; }); __webpack_require__.d(__webpack_exports__, "__experimentalText", function() { return /* reexport */ build_module_text; }); __webpack_require__.d(__webpack_exports__, "TextControl", function() { return /* reexport */ TextControl; }); __webpack_require__.d(__webpack_exports__, "TextareaControl", function() { return /* reexport */ TextareaControl; }); __webpack_require__.d(__webpack_exports__, "TextHighlight", function() { return /* reexport */ text_highlight; }); __webpack_require__.d(__webpack_exports__, "Tip", function() { return /* reexport */ tip; }); __webpack_require__.d(__webpack_exports__, "ToggleControl", function() { return /* reexport */ ToggleControl; }); __webpack_require__.d(__webpack_exports__, "Toolbar", function() { return /* reexport */ toolbar; }); __webpack_require__.d(__webpack_exports__, "ToolbarButton", function() { return /* reexport */ toolbar_button; }); __webpack_require__.d(__webpack_exports__, "__experimentalToolbarContext", function() { return /* reexport */ toolbar_context["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "ToolbarGroup", function() { return /* reexport */ toolbar_group; }); __webpack_require__.d(__webpack_exports__, "ToolbarItem", function() { return /* reexport */ toolbar_item["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "Tooltip", function() { return /* reexport */ build_module_tooltip["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "__experimentalTreeGrid", function() { return /* reexport */ tree_grid; }); __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridRow", function() { return /* reexport */ tree_grid_row; }); __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridCell", function() { return /* reexport */ tree_grid_cell; }); __webpack_require__.d(__webpack_exports__, "__experimentalTreeGridItem", function() { return /* reexport */ tree_grid_item; }); __webpack_require__.d(__webpack_exports__, "TreeSelect", function() { return /* reexport */ TreeSelect; }); __webpack_require__.d(__webpack_exports__, "__experimentalUnitControl", function() { return /* reexport */ unit_control; }); __webpack_require__.d(__webpack_exports__, "VisuallyHidden", function() { return /* reexport */ visually_hidden; }); __webpack_require__.d(__webpack_exports__, "IsolatedEventContainer", function() { return /* reexport */ isolated_event_container["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "createSlotFill", function() { return /* reexport */ slot_fill["c" /* createSlotFill */]; }); __webpack_require__.d(__webpack_exports__, "Slot", function() { return /* reexport */ slot_fill["b" /* Slot */]; }); __webpack_require__.d(__webpack_exports__, "Fill", function() { return /* reexport */ slot_fill["a" /* Fill */]; }); __webpack_require__.d(__webpack_exports__, "SlotFillProvider", function() { return /* reexport */ slot_fill_context["b" /* default */]; }); __webpack_require__.d(__webpack_exports__, "__experimentalUseSlot", function() { return /* reexport */ use_slot["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "navigateRegions", function() { return /* reexport */ navigate_regions; }); __webpack_require__.d(__webpack_exports__, "withConstrainedTabbing", function() { return /* reexport */ with_constrained_tabbing["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "withFallbackStyles", function() { return /* reexport */ with_fallback_styles; }); __webpack_require__.d(__webpack_exports__, "withFilters", function() { return /* reexport */ withFilters; }); __webpack_require__.d(__webpack_exports__, "withFocusOutside", function() { return /* reexport */ with_focus_outside["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "withFocusReturn", function() { return /* reexport */ with_focus_return["a" /* default */]; }); __webpack_require__.d(__webpack_exports__, "FocusReturnProvider", function() { return /* reexport */ with_focus_return_context["b" /* default */]; }); __webpack_require__.d(__webpack_exports__, "withNotices", function() { return /* reexport */ with_notices; }); __webpack_require__.d(__webpack_exports__, "withSpokenMessages", function() { return /* reexport */ with_spoken_messages; }); // EXTERNAL MODULE: external {"this":["wp","primitives"]} var external_this_wp_primitives_ = __webpack_require__(7); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js var esm_extends = __webpack_require__(8); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules var slicedToArray = __webpack_require__(12); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js var objectWithoutProperties = __webpack_require__(14); // EXTERNAL MODULE: external {"this":["wp","element"]} var external_this_wp_element_ = __webpack_require__(0); // EXTERNAL MODULE: external {"this":"lodash"} var external_this_lodash_ = __webpack_require__(2); // EXTERNAL MODULE: ./node_modules/classnames/index.js var classnames = __webpack_require__(9); var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); // EXTERNAL MODULE: ./node_modules/reakit/es/CompositeState-3a25dcee.js var CompositeState_3a25dcee = __webpack_require__(52); // EXTERNAL MODULE: ./node_modules/reakit/es/Composite/Composite.js var Composite = __webpack_require__(122); // EXTERNAL MODULE: ./node_modules/reakit/es/_rollupPluginBabelHelpers-1f0bf8c2.js var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__(15); // EXTERNAL MODULE: ./node_modules/reakit-system/es/createComponent.js + 1 modules var createComponent = __webpack_require__(51); // EXTERNAL MODULE: ./node_modules/reakit-system/es/createHook.js + 4 modules var createHook = __webpack_require__(50); // EXTERNAL MODULE: external {"this":"React"} var external_this_React_ = __webpack_require__(13); var external_this_React_default = /*#__PURE__*/__webpack_require__.n(external_this_React_); // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useForkRef.js var useForkRef = __webpack_require__(63); // EXTERNAL MODULE: ./node_modules/reakit-utils/es/useIsomorphicEffect.js var useIsomorphicEffect = __webpack_require__(59); // EXTERNAL MODULE: ./node_modules/reakit/es/Box/Box.js var Box = __webpack_require__(67); // CONCATENATED MODULE: ./node_modules/reakit/es/Group/Group.js var useGroup = Object(createHook["a" /* createHook */])({ name: "Group", compose: Box["a" /* useBox */], useProps: function useProps(_, htmlProps) { return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ role: "group" }, htmlProps); } }); var Group = Object(createComponent["a" /* createComponent */])({ as: "div", useHook: useGroup }); // EXTERNAL MODULE: ./node_modules/reakit/es/Id/Id.js var Id = __webpack_require__(96); // CONCATENATED MODULE: ./node_modules/reakit/es/Composite/CompositeGroup.js var useCompositeGroup = Object(createHook["a" /* createHook */])({ name: "CompositeGroup", compose: [useGroup, Id["a" /* unstable_useId */]], useState: CompositeState_3a25dcee["g" /* u */], propsAreEqual: function propsAreEqual(prev, next) { if (!next.id || prev.id !== next.id) { return useGroup.unstable_propsAreEqual(prev, next); } var prevCurrentId = prev.currentId, prevMoves = prev.unstable_moves, prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(prev, ["currentId", "unstable_moves"]); var nextCurrentId = next.currentId, nextMoves = next.unstable_moves, nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(next, ["currentId", "unstable_moves"]); if (prev.items && next.items) { var prevCurrentItem = Object(CompositeState_3a25dcee["d" /* f */])(prev.items, prevCurrentId); var nextCurrentItem = Object(CompositeState_3a25dcee["d" /* f */])(next.items, nextCurrentId); var prevGroupId = prevCurrentItem === null || prevCurrentItem === void 0 ? void 0 : prevCurrentItem.groupId; var nextGroupId = nextCurrentItem === null || nextCurrentItem === void 0 ? void 0 : nextCurrentItem.groupId; if (next.id === nextGroupId || next.id === prevGroupId) { return false; } } return useGroup.unstable_propsAreEqual(prevProps, nextProps); }, useProps: function useProps(options, _ref) { var htmlRef = _ref.ref, htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(_ref, ["ref"]); var ref = Object(external_this_React_["useRef"])(null); var id = options.id; // We need this to be called before CompositeItems' register Object(useIsomorphicEffect["a" /* useIsomorphicEffect */])(function () { var _options$registerGrou; if (!id) return undefined; (_options$registerGrou = options.registerGroup) === null || _options$registerGrou === void 0 ? void 0 : _options$registerGrou.call(options, { id: id, ref: ref }); return function () { var _options$unregisterGr; (_options$unregisterGr = options.unregisterGroup) === null || _options$unregisterGr === void 0 ? void 0 : _options$unregisterGr.call(options, id); }; }, [id, options.registerGroup, options.unregisterGroup]); return Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({ ref: Object(useForkRef["a" /* useForkRef */])(ref, htmlRef) }, htmlProps); } }); var CompositeGroup = Object(createComponent["a" /* createComponent */])({ as: "div", useHook: useCompositeGroup }); // EXTERNAL MODULE: external {"this":["wp","i18n"]} var external_this_wp_i18n_ = __webpack_require__(1); // EXTERNAL MODULE: external {"this":["wp","compose"]} var external_this_wp_compose_ = __webpack_require__(10); // EXTERNAL MODULE: ./node_modules/reakit/es/Composite/CompositeItem.js var CompositeItem = __webpack_require__(123); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js var build_module_tooltip = __webpack_require__(84); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js var defineProperty = __webpack_require__(5); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/utils.js /** * Utility Functions */ /** * renderAsRenderProps is used to wrap a component and convert * the passed property "as" either a string or component, to the * rendered tag if a string, or component. * * See VisuallyHidden hidden for example. * * @param {string|WPComponent} as A tag or component to render. * @return {WPComponent} The rendered component. */ function renderAsRenderProps(_ref) { var _ref$as = _ref.as, Component = _ref$as === void 0 ? 'div' : _ref$as, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["as"]); if (typeof props.children === 'function') { return props.children(props); } return Object(external_this_wp_element_["createElement"])(Component, props); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * External dependencies */ /** * Internal dependencies */ /** * VisuallyHidden component to render text out non-visually * for use in devices such as a screen reader. * * @param {Object} props Component props. * @param {string|WPComponent} [props.as="div"] A tag or component to render. * @param {string} [props.className] Class to set on the container. */ function VisuallyHidden(_ref) { var _ref$as = _ref.as, as = _ref$as === void 0 ? 'div' : _ref$as, className = _ref.className, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["as", "className"]); return renderAsRenderProps(_objectSpread({ as: as, className: classnames_default()('components-visually-hidden', className) }, props)); } /* harmony default export */ var visually_hidden = (VisuallyHidden); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js /** * External dependencies */ /** * WordPress dependencies */ var GRID = [['top left', 'top center', 'top right'], ['center left', 'center center', 'center right'], ['bottom left', 'bottom center', 'bottom right']]; // Stored as map as i18n __() only accepts strings (not variables) var ALIGNMENT_LABEL = { 'top left': Object(external_this_wp_i18n_["__"])('Top Left'), 'top center': Object(external_this_wp_i18n_["__"])('Top Center'), 'top right': Object(external_this_wp_i18n_["__"])('Top Right'), 'center left': Object(external_this_wp_i18n_["__"])('Center Left'), 'center center': Object(external_this_wp_i18n_["__"])('Center Center'), 'center right': Object(external_this_wp_i18n_["__"])('Center Right'), 'bottom left': Object(external_this_wp_i18n_["__"])('Bottom Left'), 'bottom center': Object(external_this_wp_i18n_["__"])('Bottom Center'), 'bottom right': Object(external_this_wp_i18n_["__"])('Bottom Right') }; // Transforms GRID into a flat Array of values var ALIGNMENTS = Object(external_this_lodash_["flattenDeep"])(GRID); /** * Parses and transforms an incoming value to better match the alignment values * * @param {string} value An alignment value to parse. * * @return {string} The parsed value. */ function transformValue(value) { var nextValue = value === 'center' ? 'center center' : value; return nextValue.replace('-', ' '); } /** * Creates an item ID based on a prefix ID and an alignment value. * * @param {string} prefixId An ID to prefix. * @param {string} value An alignment value. * * @return {string} The item id. */ function getItemId(prefixId, value) { var valueId = transformValue(value).replace(' ', '-'); return "".concat(prefixId, "-").concat(valueId); } /** * Retrieves the alignment index from a value. * * @param {string} alignment Value to check. * * @return {number} The index of a matching alignment. */ function getAlignmentIndex() { var alignment = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'center'; var item = transformValue(alignment).replace('-', ' '); var index = ALIGNMENTS.indexOf(item); return index > -1 ? index : undefined; } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js var helpers_defineProperty = __webpack_require__(286); var defineProperty_default = /*#__PURE__*/__webpack_require__.n(helpers_defineProperty); // CONCATENATED MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js function memoize(fn) { var cache = {}; return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } /* harmony default export */ var memoize_browser_esm = (memoize); // CONCATENATED MODULE: ./node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 var is_prop_valid_browser_esm_index = memoize_browser_esm(function (prop) { return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 /* o */ && prop.charCodeAt(1) === 110 /* n */ && prop.charCodeAt(2) < 91; } /* Z+1 */ ); /* harmony default export */ var is_prop_valid_browser_esm = (is_prop_valid_browser_esm_index); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } // CONCATENATED MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js /* Based off glamor's StyleSheet, thanks Sunil ❤️ high performance StyleSheet for css-in-js systems - uses multiple style tags behind the scenes for millions of rules - uses `insertRule` for appending in production for *much* faster performance // usage import { StyleSheet } from '@emotion/sheet' let styleSheet = new StyleSheet({ key: '', container: document.head }) styleSheet.insert('#box { border: 1px solid red; }') - appends a css rule into the stylesheet styleSheet.flush() - empties the stylesheet of all its contents */ // $FlowFixMe function sheetForTag(tag) { if (tag.sheet) { // $FlowFixMe return tag.sheet; } // this weirdness brought to you by firefox /* istanbul ignore next */ for (var i = 0; i < document.styleSheets.length; i++) { if (document.styleSheets[i].ownerNode === tag) { // $FlowFixMe return document.styleSheets[i]; } } } function createStyleElement(options) { var tag = document.createElement('style'); tag.setAttribute('data-emotion', options.key); if (options.nonce !== undefined) { tag.setAttribute('nonce', options.nonce); } tag.appendChild(document.createTextNode('')); return tag; } var StyleSheet = /*#__PURE__*/ function () { function StyleSheet(options) { this.isSpeedy = options.speedy === undefined ? "production" === 'production' : options.speedy; this.tags = []; this.ctr = 0; this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets this.key = options.key; this.container = options.container; this.before = null; } var _proto = StyleSheet.prototype; _proto.insert = function insert(rule) { // the max length is how many rules we have per style tag, it's 65000 in speedy mode // it's 1 in dev because we insert source maps that map a single rule to a location // and you can only have one source map per style tag if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) { var _tag = createStyleElement(this); var before; if (this.tags.length === 0) { before = this.before; } else { before = this.tags[this.tags.length - 1].nextSibling; } this.container.insertBefore(_tag, before); this.tags.push(_tag); } var tag = this.tags[this.tags.length - 1]; if (this.isSpeedy) { var sheet = sheetForTag(tag); try { // this is a really hot path // we check the second character first because having "i" // as the second character will happen less often than // having "@" as the first character var isImportRule = rule.charCodeAt(1) === 105 && rule.charCodeAt(0) === 64; // this is the ultrafast version, works across browsers // the big drawback is that the css won't be editable in devtools sheet.insertRule(rule, // we need to insert @import rules before anything else // otherwise there will be an error // technically this means that the @import rules will // _usually_(not always since there could be multiple style tags) // be the first ones in prod and generally later in dev // this shouldn't really matter in the real world though // @import is generally only used for font faces from google fonts and etc. // so while this could be technically correct then it would be slower and larger // for a tiny bit of correctness that won't matter in the real world isImportRule ? 0 : sheet.cssRules.length); } catch (e) { if (false) {} } } else { tag.appendChild(document.createTextNode(rule)); } this.ctr++; }; _proto.flush = function flush() { // $FlowFixMe this.tags.forEach(function (tag) { return tag.parentNode.removeChild(tag); }); this.tags = []; this.ctr = 0; }; return StyleSheet; }(); // CONCATENATED MODULE: ./node_modules/@emotion/stylis/dist/stylis.browser.esm.js function stylis_min (W) { function M(d, c, e, h, a) { 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;) { g = e.charCodeAt(l); l === J && 0 !== b + n + v + m && (0 !== b && (g = 47 === b ? 10 : 47), n = v = m = 0, B++, J++); if (0 === b + n + v + m) { if (l === J && (0 < r && (f = f.replace(N, '')), 0 < f.trim().length)) { switch (g) { case 32: case 9: case 59: case 13: case 10: break; default: f += e.charAt(l); } g = 59; } switch (g) { case 123: f = f.trim(); q = f.charCodeAt(0); k = 1; for (t = ++l; l < B;) { switch (g = e.charCodeAt(l)) { case 123: k++; break; case 125: k--; break; case 47: switch (g = e.charCodeAt(l + 1)) { case 42: case 47: a: { for (u = l + 1; u < J; ++u) { switch (e.charCodeAt(u)) { case 47: if (42 === g && 42 === e.charCodeAt(u - 1) && l + 2 !== u) { l = u + 1; break a; } break; case 10: if (47 === g) { l = u + 1; break a; } } } l = u; } } break; case 91: g++; case 40: g++; case 34: case 39: for (; l++ < J && e.charCodeAt(l) !== g;) { } } if (0 === k) break; l++; } k = e.substring(t, l); 0 === q && (q = (f = f.replace(ca, '').trim()).charCodeAt(0)); switch (q) { case 64: 0 < r && (f = f.replace(N, '')); g = f.charCodeAt(1); switch (g) { case 100: case 109: case 115: case 45: r = c; break; default: r = O; } k = M(c, r, k, g, a + 1); t = k.length; 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 = '')); if (0 < t) switch (g) { case 115: f = f.replace(da, ea); case 100: case 109: case 45: k = f + '{' + k + '}'; break; case 107: f = f.replace(fa, '$1 $2'); k = f + '{' + k + '}'; k = 1 === w || 2 === w && L('@' + k, 3) ? '@-webkit-' + k + '@' + k : '@' + k; break; default: k = f + k, 112 === h && (k = (p += k, '')); } else k = ''; break; default: k = M(c, X(c, f, I), k, h, a + 1); } F += k; k = I = r = u = q = 0; f = ''; g = e.charCodeAt(++l); break; case 125: case 59: f = (0 < r ? f.replace(N, '') : f).trim(); 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) { case 0: break; case 64: if (105 === g || 99 === g) { G += f + e.charAt(l); break; } default: 58 !== f.charCodeAt(t - 1) && (p += P(f, q, g, f.charCodeAt(2))); } I = r = u = q = 0; f = ''; g = e.charCodeAt(++l); } } switch (g) { case 13: case 10: 47 === b ? b = 0 : 0 === 1 + q && 107 !== h && 0 < f.length && (r = 1, f += '\x00'); 0 < A * Y && H(0, f, c, d, D, z, p.length, h, a, h); z = 1; D++; break; case 59: case 125: if (0 === b + n + v + m) { z++; break; } default: z++; y = e.charAt(l); switch (g) { case 9: case 32: if (0 === n + m + b) switch (x) { case 44: case 58: case 9: case 32: y = ''; break; default: 32 !== g && (y = ' '); } break; case 0: y = '\\0'; break; case 12: y = '\\f'; break; case 11: y = '\\v'; break; case 38: 0 === n + b + m && (r = I = 1, y = '\f' + y); break; case 108: if (0 === n + b + m + E && 0 < u) switch (l - u) { case 2: 112 === x && 58 === e.charCodeAt(l - 3) && (E = x); case 8: 111 === K && (E = K); } break; case 58: 0 === n + b + m && (u = l); break; case 44: 0 === b + v + n + m && (r = 1, y += '\r'); break; case 34: case 39: 0 === b && (n = n === g ? 0 : 0 === n ? g : n); break; case 91: 0 === n + b + v && m++; break; case 93: 0 === n + b + v && m--; break; case 41: 0 === n + b + m && v--; break; case 40: if (0 === n + b + m) { if (0 === q) switch (2 * x + 3 * K) { case 533: break; default: q = 1; } v++; } break; case 64: 0 === b + v + n + m + u + k && (k = 1); break; case 42: case 47: if (!(0 < n + m + v)) switch (b) { case 0: switch (2 * g + 3 * e.charCodeAt(l + 1)) { case 235: b = 47; break; case 220: t = l, b = 42; } break; case 42: 47 === g && 42 === x && t + 2 !== l && (33 === e.charCodeAt(t + 2) && (p += e.substring(t, l + 1)), y = '', b = 0); } } 0 === b && (f += y); } K = x; x = g; l++; } t = p.length; if (0 < t) { r = c; 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; p = r.join(',') + '{' + p + '}'; if (0 !== w * E) { 2 !== w || L(p, 2) || (E = 0); switch (E) { case 111: p = p.replace(ha, ':-moz-$1') + p; break; case 112: p = p.replace(Q, '::-webkit-input-$1') + p.replace(Q, '::-moz-$1') + p.replace(Q, ':-ms-input-$1') + p; } E = 0; } } return G + p + F; } function X(d, c, e) { var h = c.trim().split(ia); c = h; var a = h.length, m = d.length; switch (m) { case 0: case 1: var b = 0; for (d = 0 === m ? '' : d[0] + ' '; b < a; ++b) { c[b] = Z(d, c[b], e).trim(); } break; default: var v = b = 0; for (c = []; b < a; ++b) { for (var n = 0; n < m; ++n) { c[v++] = Z(d[n] + ' ', h[b], e).trim(); } } } return c; } function Z(d, c, e) { var h = c.charCodeAt(0); 33 > h && (h = (c = c.trim()).charCodeAt(0)); switch (h) { case 38: return c.replace(F, '$1' + d.trim()); case 58: return d.trim() + c.replace(F, '$1' + d.trim()); default: if (0 < 1 * e && 0 < c.indexOf('\f')) return c.replace(F, (58 === d.charCodeAt(0) ? '' : '$1') + d.trim()); } return d + c; } function P(d, c, e, h) { var a = d + ';', m = 2 * c + 3 * e + 4 * h; if (944 === m) { d = a.indexOf(':', 9) + 1; var b = a.substring(d, a.length - 1).trim(); b = a.substring(0, d).trim() + b + ';'; return 1 === w || 2 === w && L(b, 1) ? '-webkit-' + b + b : b; } if (0 === w || 2 === w && !L(a, 1)) return a; switch (m) { case 1015: return 97 === a.charCodeAt(10) ? '-webkit-' + a + a : a; case 951: return 116 === a.charCodeAt(3) ? '-webkit-' + a + a : a; case 963: return 110 === a.charCodeAt(5) ? '-webkit-' + a + a : a; case 1009: if (100 !== a.charCodeAt(4)) break; case 969: case 942: return '-webkit-' + a + a; case 978: return '-webkit-' + a + '-moz-' + a + a; case 1019: case 983: return '-webkit-' + a + '-moz-' + a + '-ms-' + a + a; case 883: if (45 === a.charCodeAt(8)) return '-webkit-' + a + a; if (0 < a.indexOf('image-set(', 11)) return a.replace(ja, '$1-webkit-$2') + a; break; case 932: if (45 === a.charCodeAt(4)) switch (a.charCodeAt(5)) { case 103: return '-webkit-box-' + a.replace('-grow', '') + '-webkit-' + a + '-ms-' + a.replace('grow', 'positive') + a; case 115: return '-webkit-' + a + '-ms-' + a.replace('shrink', 'negative') + a; case 98: return '-webkit-' + a + '-ms-' + a.replace('basis', 'preferred-size') + a; } return '-webkit-' + a + '-ms-' + a + a; case 964: return '-webkit-' + a + '-ms-flex-' + a + a; case 1023: if (99 !== a.charCodeAt(8)) break; b = a.substring(a.indexOf(':', 15)).replace('flex-', '').replace('space-between', 'justify'); return '-webkit-box-pack' + b + '-webkit-' + a + '-ms-flex-pack' + b + a; case 1005: return ka.test(a) ? a.replace(aa, ':-webkit-') + a.replace(aa, ':-moz-') + a : a; case 1e3: b = a.substring(13).trim(); c = b.indexOf('-') + 1; switch (b.charCodeAt(0) + b.charCodeAt(c)) { case 226: b = a.replace(G, 'tb'); break; case 232: b = a.replace(G, 'tb-rl'); break; case 220: b = a.replace(G, 'lr'); break; default: return a; } return '-webkit-' + a + '-ms-' + b + a; case 1017: if (-1 === a.indexOf('sticky', 9)) break; case 975: c = (a = d).length - 10; b = (33 === a.charCodeAt(c) ? a.substring(0, c) : a).substring(d.indexOf(':', 7) + 1).trim(); switch (m = b.charCodeAt(0) + (b.charCodeAt(7) | 0)) { case 203: if (111 > b.charCodeAt(8)) break; case 115: a = a.replace(b, '-webkit-' + b) + ';' + a; break; case 207: case 102: a = a.replace(b, '-webkit-' + (102 < m ? 'inline-' : '') + 'box') + ';' + a.replace(b, '-webkit-' + b) + ';' + a.replace(b, '-ms-' + b + 'box') + ';' + a; } return a + ';'; case 938: if (45 === a.charCodeAt(5)) switch (a.charCodeAt(6)) { case 105: return b = a.replace('-items', ''), '-webkit-' + a + '-webkit-box-' + b + '-ms-flex-' + b + a; case 115: return '-webkit-' + a + '-ms-flex-item-' + a.replace(ba, '') + a; default: return '-webkit-' + a + '-ms-flex-line-pack' + a.replace('align-content', '').replace(ba, '') + a; } break; case 973: case 989: if (45 !== a.charCodeAt(3) || 122 === a.charCodeAt(4)) break; case 931: case 953: 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; break; case 962: 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; } return a; } function L(d, c) { var e = d.indexOf(1 === c ? ':' : '{'), h = d.substring(0, 3 !== c ? e : 10); e = d.substring(e + 1, d.length - 1); return R(2 !== c ? h : h.replace(na, '$1'), e, c); } function ea(d, c) { var e = P(c, c.charCodeAt(0), c.charCodeAt(1), c.charCodeAt(2)); return e !== c + ';' ? e.replace(oa, ' or ($1)').substring(4) : '(' + c + ')'; } function H(d, c, e, h, a, m, b, v, n, q) { for (var g = 0, x = c, w; g < A; ++g) { switch (w = S[g].call(B, d, x, e, h, a, m, b, v, n, q)) { case void 0: case !1: case !0: case null: break; default: x = w; } } if (x !== c) return x; } function T(d) { switch (d) { case void 0: case null: A = S.length = 0; break; default: if ('function' === typeof d) S[A++] = d;else if ('object' === typeof d) for (var c = 0, e = d.length; c < e; ++c) { T(d[c]); } else Y = !!d | 0; } return T; } function U(d) { d = d.prefix; void 0 !== d && (R = null, d ? 'function' !== typeof d ? w = 1 : (w = 2, R = d) : w = 0); return U; } function B(d, c) { var e = d; 33 > e.charCodeAt(0) && (e = e.trim()); V = e; e = [V]; if (0 < A) { var h = H(-1, c, e, e, D, z, 0, 0, 0, 0); void 0 !== h && 'string' === typeof h && (c = h); } var a = M(O, e, c, 0, 0); 0 < A && (h = H(-2, a, e, e, D, z, a.length, 0, 0, 0), void 0 !== h && (a = h)); V = ''; E = 0; z = D = 1; return a; } var ca = /^\0+/g, N = /[\0\r\f]/g, aa = /: */g, ka = /zoo|gra/, ma = /([,: ])(transform)/g, ia = /,\r+?/g, F = /([\t\r\n ])*\f?&/g, fa = /@(k\w+)\s*(\S*)\s*/, Q = /::(place)/g, ha = /:(read-only)/g, G = /[svh]\w+-[tblr]{2}/, da = /\(\s*(.*)\s*\)/g, oa = /([\s\S]*?);/g, ba = /-self|flex-/g, na = /[^]*?(:[rp][el]a[\w-]+)[^]*/, la = /stretch|:\s*\w+\-(?:conte|avail)/, ja = /([^-])(image-set\()/, z = 1, D = 1, E = 0, w = 1, O = [], S = [], A = 0, R = null, Y = 0, V = ''; B.use = T; B.set = U; void 0 !== W && U(W); return B; } /* harmony default export */ var stylis_browser_esm = (stylis_min); // CONCATENATED MODULE: ./node_modules/@emotion/weak-memoize/dist/weak-memoize.browser.esm.js var weakMemoize = function weakMemoize(func) { // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps var cache = new WeakMap(); return function (arg) { if (cache.has(arg)) { // $FlowFixMe return cache.get(arg); } var ret = func(arg); cache.set(arg, ret); return ret; }; }; /* harmony default export */ var weak_memoize_browser_esm = (weakMemoize); // CONCATENATED MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js // https://github.com/thysultan/stylis.js/tree/master/plugins/rule-sheet // inlined to avoid umd wrapper and peerDep warnings/installing stylis // since we use stylis after closure compiler var delimiter = '/*|*/'; var needle = delimiter + '}'; function toSheet(block) { if (block) { Sheet.current.insert(block + '}'); } } var Sheet = { current: null }; var ruleSheet = function ruleSheet(context, content, selectors, parents, line, column, length, ns, depth, at) { switch (context) { // property case 1: { switch (content.charCodeAt(0)) { case 64: { // @import Sheet.current.insert(content + ';'); return ''; } // charcode for l case 108: { // charcode for b // this ignores label if (content.charCodeAt(2) === 98) { return ''; } } } break; } // selector case 2: { if (ns === 0) return content + delimiter; break; } // at-rule case 3: { switch (ns) { // @font-face, @page case 102: case 112: { Sheet.current.insert(selectors[0] + content); return ''; } default: { return content + (at === 0 ? delimiter : ''); } } } case -2: { content.split(needle).forEach(toSheet); } } }; var cache_browser_esm_createCache = function createCache(options) { if (options === undefined) options = {}; var key = options.key || 'css'; var stylisOptions; if (options.prefix !== undefined) { stylisOptions = { prefix: options.prefix }; } var stylis = new stylis_browser_esm(stylisOptions); if (false) {} var inserted = {}; // $FlowFixMe var container; { container = options.container || document.head; var nodes = document.querySelectorAll("style[data-emotion-" + key + "]"); Array.prototype.forEach.call(nodes, function (node) { var attrib = node.getAttribute("data-emotion-" + key); // $FlowFixMe attrib.split(' ').forEach(function (id) { inserted[id] = true; }); if (node.parentNode !== container) { container.appendChild(node); } }); } var _insert; { stylis.use(options.stylisPlugins)(ruleSheet); _insert = function insert(selector, serialized, sheet, shouldCache) { var name = serialized.name; Sheet.current = sheet; if (false) { var map; } stylis(selector, serialized.styles); if (shouldCache) { cache.inserted[name] = true; } }; } if (false) { var commentEnd, commentStart; } var cache = { key: key, sheet: new StyleSheet({ key: key, container: container, nonce: options.nonce, speedy: options.speedy }), nonce: options.nonce, inserted: inserted, registered: {}, insert: _insert }; return cache; }; /* harmony default export */ var cache_browser_esm = (cache_browser_esm_createCache); // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inheritsLoose.js var inheritsLoose = __webpack_require__(158); // CONCATENATED MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js var isBrowser = "object" !== 'undefined'; function getRegisteredStyles(registered, registeredStyles, classNames) { var rawClassName = ''; classNames.split(' ').forEach(function (className) { if (registered[className] !== undefined) { registeredStyles.push(registered[className]); } else { rawClassName += className + " "; } }); return rawClassName; } var insertStyles = function insertStyles(cache, serialized, isStringTag) { var className = cache.key + "-" + serialized.name; if ( // we only need to add the styles to the registered cache if the // class name could be used further down // the tree but if it's a string tag, we know it won't // so we don't have to add it to registered cache. // this improves memory usage since we can avoid storing the whole style string (isStringTag === false || // we need to always store it if we're in compat mode and // in node since emotion-server relies on whether a style is in // the registered cache to know whether a style is global or not // also, note that this check will be dead code eliminated in the browser isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) { cache.registered[className] = serialized.styles; } if (cache.inserted[serialized.name] === undefined) { var current = serialized; do { var maybeStyles = cache.insert("." + className, current, cache.sheet, true); current = current.next; } while (current !== undefined); } }; // CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js /* eslint-disable */ // Inspired by https://github.com/garycourt/murmurhash-js // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 function murmur2(str) { // 'm' and 'r' are mixing constants generated offline. // They're not really 'magic', they just happen to work well. // const m = 0x5bd1e995; // const r = 24; // Initialize the hash var h = 0; // Mix 4 bytes at a time into the hash var k, i = 0, len = str.length; for (; len >= 4; ++i, len -= 4) { k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; k = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); k ^= /* k >>> r: */ k >>> 24; h = /* Math.imul(k, m): */ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Handle the last few bytes of the input array switch (len) { case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; case 1: h ^= str.charCodeAt(i) & 0xff; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); } // Do a few final mixes of the hash to ensure the last few // bytes are well-incorporated. h ^= h >>> 13; h = /* Math.imul(h, m): */ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); return ((h ^ h >>> 15) >>> 0).toString(36); } /* harmony default export */ var hash_browser_esm = (murmur2); // CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js var unitlessKeys = { animationIterationCount: 1, borderImageOutset: 1, borderImageSlice: 1, borderImageWidth: 1, boxFlex: 1, boxFlexGroup: 1, boxOrdinalGroup: 1, columnCount: 1, columns: 1, flex: 1, flexGrow: 1, flexPositive: 1, flexShrink: 1, flexNegative: 1, flexOrder: 1, gridRow: 1, gridRowEnd: 1, gridRowSpan: 1, gridRowStart: 1, gridColumn: 1, gridColumnEnd: 1, gridColumnSpan: 1, gridColumnStart: 1, msGridRow: 1, msGridRowSpan: 1, msGridColumn: 1, msGridColumnSpan: 1, fontWeight: 1, lineHeight: 1, opacity: 1, order: 1, orphans: 1, tabSize: 1, widows: 1, zIndex: 1, zoom: 1, WebkitLineClamp: 1, // SVG-related properties fillOpacity: 1, floodOpacity: 1, stopOpacity: 1, strokeDasharray: 1, strokeDashoffset: 1, strokeMiterlimit: 1, strokeOpacity: 1, strokeWidth: 1 }; /* harmony default export */ var unitless_browser_esm = (unitlessKeys); // CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key)."; var hyphenateRegex = /[A-Z]|^ms/g; var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; var isCustomProperty = function isCustomProperty(property) { return property.charCodeAt(1) === 45; }; var isProcessableValue = function isProcessableValue(value) { return value != null && typeof value !== 'boolean'; }; var processStyleName = memoize_browser_esm(function (styleName) { return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); }); var serialize_browser_esm_processStyleValue = function processStyleValue(key, value) { switch (key) { case 'animation': case 'animationName': { if (typeof value === 'string') { return value.replace(animationRegex, function (match, p1, p2) { cursor = { name: p1, styles: p2, next: cursor }; return p1; }); } } } if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { return value + 'px'; } return value; }; if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; } var shouldWarnAboutInterpolatingClassNameFromCss = true; function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) { if (interpolation == null) { return ''; } if (interpolation.__emotion_styles !== undefined) { if (false) {} return interpolation; } switch (typeof interpolation) { case 'boolean': { return ''; } case 'object': { if (interpolation.anim === 1) { cursor = { name: interpolation.name, styles: interpolation.styles, next: cursor }; return interpolation.name; } if (interpolation.styles !== undefined) { var next = interpolation.next; if (next !== undefined) { // not the most efficient thing ever but this is a pretty rare case // and there will be very few iterations of this generally while (next !== undefined) { cursor = { name: next.name, styles: next.styles, next: cursor }; next = next.next; } } var styles = interpolation.styles + ";"; if (false) {} return styles; } return createStringFromObject(mergedProps, registered, interpolation); } case 'function': { if (mergedProps !== undefined) { var previousCursor = cursor; var result = interpolation(mergedProps); cursor = previousCursor; return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation); } else if (false) {} break; } case 'string': if (false) { var replaced, matched; } break; } // finalize string values (regular strings and functions interpolated into css calls) if (registered == null) { return interpolation; } var cached = registered[interpolation]; if (false) {} return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation; } function createStringFromObject(mergedProps, registered, obj) { var string = ''; if (Array.isArray(obj)) { for (var i = 0; i < obj.length; i++) { string += handleInterpolation(mergedProps, registered, obj[i], false); } } else { for (var _key in obj) { var value = obj[_key]; if (typeof value !== 'object') { if (registered != null && registered[value] !== undefined) { string += _key + "{" + registered[value] + "}"; } else if (isProcessableValue(value)) { string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value) + ";"; } } else { if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') { throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.'); } if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { for (var _i = 0; _i < value.length; _i++) { if (isProcessableValue(value[_i])) { string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value[_i]) + ";"; } } } else { var interpolated = handleInterpolation(mergedProps, registered, value, false); switch (_key) { case 'animation': case 'animationName': { string += processStyleName(_key) + ":" + interpolated + ";"; break; } default: { if (false) {} string += _key + "{" + interpolated + "}"; } } } } } } return string; } var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g; var sourceMapPattern; if (false) {} // this is the cursor for keyframes // keyframes are stored on the SerializedStyles object as a linked list var cursor; var serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) { if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { return args[0]; } var stringMode = true; var styles = ''; cursor = undefined; var strings = args[0]; if (strings == null || strings.raw === undefined) { stringMode = false; styles += handleInterpolation(mergedProps, registered, strings, false); } else { if (false) {} styles += strings[0]; } // we start at 1 since we've already handled the first arg for (var i = 1; i < args.length; i++) { styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46); if (stringMode) { if (false) {} styles += strings[i]; } } var sourceMap; if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time labelPattern.lastIndex = 0; var identifierName = ''; var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 while ((match = labelPattern.exec(styles)) !== null) { identifierName += '-' + // $FlowFixMe we know it's not null match[1]; } var name = hash_browser_esm(styles) + identifierName; if (false) {} return { name: name, styles: styles, next: cursor }; }; // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js var emotion_element_57a3a7a3_browser_esm_hasOwnProperty = Object.prototype.hasOwnProperty; var EmotionCacheContext = /*#__PURE__*/Object(external_this_React_["createContext"])( // we're doing this to avoid preconstruct's dead code elimination in this one case // because this module is primarily intended for the browser and node // but it's also required in react native and similar environments sometimes // and we could have a special build just for that // but this is much easier and the native packages // might use a different theme context in the future anyway typeof HTMLElement !== 'undefined' ? cache_browser_esm() : null); var ThemeContext = /*#__PURE__*/Object(external_this_React_["createContext"])({}); var CacheProvider = EmotionCacheContext.Provider; var emotion_element_57a3a7a3_browser_esm_withEmotionCache = function withEmotionCache(func) { var render = function render(props, ref) { return /*#__PURE__*/Object(external_this_React_["createElement"])(EmotionCacheContext.Consumer, null, function (cache) { return func(props, cache, ref); }); }; // $FlowFixMe return /*#__PURE__*/Object(external_this_React_["forwardRef"])(render); }; // thus we only need to replace what is a valid character for JS, but not for CSS var sanitizeIdentifier = function sanitizeIdentifier(identifier) { return identifier.replace(/\$/g, '-'); }; var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; var createEmotionProps = function createEmotionProps(type, props) { if (false) {} var newProps = {}; for (var key in props) { if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key)) { newProps[key] = props[key]; } } newProps[typePropName] = type; // TODO: check if this still works with all of those different JSX functions if (false) { var match, error; } return newProps; }; var emotion_element_57a3a7a3_browser_esm_render = function render(cache, props, theme, ref) { var cssProp = theme === null ? props.css : props.css(theme); // so that using `css` from `emotion` and passing the result to the css prop works // not passing the registered cache to serializeStyles because it would // make certain babel optimisations not possible if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { cssProp = cache.registered[cssProp]; } var type = props[typePropName]; var registeredStyles = [cssProp]; var className = ''; if (typeof props.className === 'string') { className = getRegisteredStyles(cache.registered, registeredStyles, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = serialize_browser_esm_serializeStyles(registeredStyles); if (false) { var labelFromStack; } var rules = insertStyles(cache, serialized, typeof type === 'string'); className += cache.key + "-" + serialized.name; var newProps = {}; for (var key in props) { if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || false)) { newProps[key] = props[key]; } } newProps.ref = ref; newProps.className = className; var ele = /*#__PURE__*/Object(external_this_React_["createElement"])(type, newProps); return ele; }; // eslint-disable-next-line no-undef var Emotion = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache, ref) { if (typeof props.css === 'function') { return /*#__PURE__*/Object(external_this_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { return emotion_element_57a3a7a3_browser_esm_render(cache, props, theme, ref); }); } return emotion_element_57a3a7a3_browser_esm_render(cache, props, null, ref); }); if (false) {} // CONCATENATED MODULE: ./node_modules/@emotion/css/dist/css.browser.esm.js function css_browser_esm_css() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return serialize_browser_esm_serializeStyles(args); } /* harmony default export */ var css_browser_esm = (css_browser_esm_css); // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js var core_browser_esm_jsx = function jsx(type, props) { var args = arguments; if (props == null || !emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, 'css')) { // $FlowFixMe return external_this_React_["createElement"].apply(undefined, args); } var argsLength = args.length; var createElementArgArray = new Array(argsLength); createElementArgArray[0] = Emotion; createElementArgArray[1] = createEmotionProps(type, props); for (var i = 2; i < argsLength; i++) { createElementArgArray[i] = args[i]; } // $FlowFixMe return external_this_React_["createElement"].apply(null, createElementArgArray); }; var warnedAboutCssPropForGlobal = false; var Global = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache) { if (false) {} var styles = props.styles; if (typeof styles === 'function') { return /*#__PURE__*/Object(external_this_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { var serialized = serialize_browser_esm_serializeStyles([styles(theme)]); return /*#__PURE__*/Object(external_this_React_["createElement"])(core_browser_esm_InnerGlobal, { serialized: serialized, cache: cache }); }); } var serialized = serialize_browser_esm_serializeStyles([styles]); return /*#__PURE__*/Object(external_this_React_["createElement"])(core_browser_esm_InnerGlobal, { serialized: serialized, cache: cache }); }); // maintain place over rerenders. // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild // initial client-side render from SSR, use place of hydrating tag var core_browser_esm_InnerGlobal = /*#__PURE__*/function (_React$Component) { _inheritsLoose(InnerGlobal, _React$Component); function InnerGlobal(props, context, updater) { return _React$Component.call(this, props, context, updater) || this; } var _proto = InnerGlobal.prototype; _proto.componentDidMount = function componentDidMount() { this.sheet = new StyleSheet({ key: this.props.cache.key + "-global", nonce: this.props.cache.sheet.nonce, container: this.props.cache.sheet.container }); // $FlowFixMe var node = document.querySelector("style[data-emotion-" + this.props.cache.key + "=\"" + this.props.serialized.name + "\"]"); if (node !== null) { this.sheet.tags.push(node); } if (this.props.cache.sheet.tags.length) { this.sheet.before = this.props.cache.sheet.tags[0]; } this.insertStyles(); }; _proto.componentDidUpdate = function componentDidUpdate(prevProps) { if (prevProps.serialized.name !== this.props.serialized.name) { this.insertStyles(); } }; _proto.insertStyles = function insertStyles$1() { if (this.props.serialized.next !== undefined) { // insert keyframes insertStyles(this.props.cache, this.props.serialized.next, true); } if (this.sheet.tags.length) { // if this doesn't exist then it will be null so the style element will be appended var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling; this.sheet.before = element; this.sheet.flush(); } this.props.cache.insert("", this.props.serialized, this.sheet, false); }; _proto.componentWillUnmount = function componentWillUnmount() { this.sheet.flush(); }; _proto.render = function render() { return null; }; return InnerGlobal; }(external_this_React_["Component"]); var core_browser_esm_keyframes = function keyframes() { var insertable = css_browser_esm.apply(void 0, arguments); var name = "animation-" + insertable.name; // $FlowFixMe return { name: name, styles: "@keyframes " + name + "{" + insertable.styles + "}", anim: 1, toString: function toString() { return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; } }; }; var core_browser_esm_classnames = function classnames(args) { var len = args.length; var i = 0; var cls = ''; for (; i < len; i++) { var arg = args[i]; if (arg == null) continue; var toAdd = void 0; switch (typeof arg) { case 'boolean': break; case 'object': { if (Array.isArray(arg)) { toAdd = classnames(arg); } else { toAdd = ''; for (var k in arg) { if (arg[k] && k) { toAdd && (toAdd += ' '); toAdd += k; } } } break; } default: { toAdd = arg; } } if (toAdd) { cls && (cls += ' '); cls += toAdd; } } return cls; }; function merge(registered, css, className) { var registeredStyles = []; var rawClassName = getRegisteredStyles(registered, registeredStyles, className); if (registeredStyles.length < 2) { return className; } return rawClassName + css(registeredStyles); } var ClassNames = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context) { return /*#__PURE__*/Object(external_this_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { var hasRendered = false; var css = function css() { if (hasRendered && "production" !== 'production') { throw new Error('css can only be used during render'); } for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } var serialized = serialize_browser_esm_serializeStyles(args, context.registered); { insertStyles(context, serialized, false); } return context.key + "-" + serialized.name; }; var cx = function cx() { if (hasRendered && "production" !== 'production') { throw new Error('cx can only be used during render'); } for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return merge(context.registered, css, core_browser_esm_classnames(args)); }; var content = { css: css, cx: cx, theme: theme }; var ele = props.children(content); hasRendered = true; return ele; }); }); // CONCATENATED MODULE: ./node_modules/@emotion/styled-base/dist/styled-base.browser.esm.js var testOmitPropsOnStringTag = is_prop_valid_browser_esm; var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) { return key !== 'theme' && key !== 'innerRef'; }; var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) { return typeof tag === 'string' && // 96 is one less than the char code // for "a" so this is checking that // it's a lowercase character tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent; }; function styled_base_browser_esm_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function styled_base_browser_esm_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { styled_base_browser_esm_ownKeys(source, true).forEach(function (key) { defineProperty_default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { styled_base_browser_esm_ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } var styled_base_browser_esm_ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; var styled_base_browser_esm_createStyled = function createStyled(tag, options) { if (false) {} var identifierName; var shouldForwardProp; var targetClassName; if (options !== undefined) { identifierName = options.label; targetClassName = options.target; shouldForwardProp = tag.__emotion_forwardProp && options.shouldForwardProp ? function (propName) { return tag.__emotion_forwardProp(propName) && // $FlowFixMe options.shouldForwardProp(propName); } : options.shouldForwardProp; } var isReal = tag.__emotion_real === tag; var baseTag = isReal && tag.__emotion_base || tag; if (typeof shouldForwardProp !== 'function' && isReal) { shouldForwardProp = tag.__emotion_forwardProp; } var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag); var shouldUseAs = !defaultShouldForwardProp('as'); return function () { var args = arguments; var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : []; if (identifierName !== undefined) { styles.push("label:" + identifierName + ";"); } if (args[0] == null || args[0].raw === undefined) { styles.push.apply(styles, args); } else { if (false) {} styles.push(args[0][0]); var len = args.length; var i = 1; for (; i < len; i++) { if (false) {} styles.push(args[i], args[0][i]); } } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class var Styled = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context, ref) { return Object(external_this_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { var finalTag = shouldUseAs && props.as || baseTag; var className = ''; var classInterpolations = []; var mergedProps = props; if (props.theme == null) { mergedProps = {}; for (var key in props) { mergedProps[key] = props[key]; } mergedProps.theme = theme; } if (typeof props.className === 'string') { className = getRegisteredStyles(context.registered, classInterpolations, props.className); } else if (props.className != null) { className = props.className + " "; } var serialized = serialize_browser_esm_serializeStyles(styles.concat(classInterpolations), context.registered, mergedProps); var rules = insertStyles(context, serialized, typeof finalTag === 'string'); className += context.key + "-" + serialized.name; if (targetClassName !== undefined) { className += " " + targetClassName; } var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(finalTag) : defaultShouldForwardProp; var newProps = {}; for (var _key in props) { if (shouldUseAs && _key === 'as') continue; if ( // $FlowFixMe finalShouldForwardProp(_key)) { newProps[_key] = props[_key]; } } newProps.className = className; newProps.ref = ref || props.innerRef; if (false) {} var ele = Object(external_this_React_["createElement"])(finalTag, newProps); return ele; }); }); Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")"; Styled.defaultProps = tag.defaultProps; Styled.__emotion_real = Styled; Styled.__emotion_base = baseTag; Styled.__emotion_styles = styles; Styled.__emotion_forwardProp = shouldForwardProp; Object.defineProperty(Styled, 'toString', { value: function value() { if (targetClassName === undefined && "production" !== 'production') { return 'NO_COMPONENT_SELECTOR'; } // $FlowFixMe: coerce undefined to string return "." + targetClassName; } }); Styled.withComponent = function (nextTag, nextOptions) { return createStyled(nextTag, nextOptions !== undefined ? styled_base_browser_esm_objectSpread({}, options || {}, {}, nextOptions) : options).apply(void 0, styles); }; return Styled; }; }; /* harmony default export */ var styled_base_browser_esm = (styled_base_browser_esm_createStyled); // EXTERNAL MODULE: ./node_modules/tinycolor2/tinycolor.js var tinycolor = __webpack_require__(66); var tinycolor_default = /*#__PURE__*/__webpack_require__.n(tinycolor); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors-values.js function colors_values_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function colors_values_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { colors_values_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { colors_values_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * External dependencies */ /** * Internal dependencies */ var BASE = { black: '#000', white: '#fff' }; /** * TODO: Continue to update values as "G2" design evolves. * * "G2" refers to the movement to advance the interface of the block editor. * https://github.com/WordPress/gutenberg/issues/18667 */ var G2 = { blue: { medium: { focus: '#007cba', focusDark: '#fff' } }, gray: { 900: '#1e1e1e', 700: '#757575', // Meets 4.6:1 text contrast against white. 600: '#949494', // Meets 3:1 UI or large text contrast against white. 400: '#ccc', 200: '#ddd', // Used for most borders. 100: '#f0f0f0' }, darkGray: { primary: '#1e1e1e' }, mediumGray: { text: '#757575' }, lightGray: { ui: '#949494', secondary: '#ccc', tertiary: '#e7e8e9' } }; var DARK_GRAY = { 900: '#191e23', 800: '#23282d', 700: '#32373c', 600: '#40464d', 500: '#555d66', // Use this most of the time for dark items. 400: '#606a73', 300: '#6c7781', // Lightest gray that can be used for AA text contrast. 200: '#7e8993', 150: '#8d96a0', // Lightest gray that can be used for AA non-text contrast. 100: '#8f98a1', placeholder: rgba(G2.gray[900], 0.62) }; var DARK_OPACITY = { 900: rgba('#000510', 0.9), 800: rgba('#00000a', 0.85), 700: rgba('#06060b', 0.8), 600: rgba('#000913', 0.75), 500: rgba('#0a1829', 0.7), 400: rgba('#0a1829', 0.65), 300: rgba('#0e1c2e', 0.62), 200: rgba('#162435', 0.55), 100: rgba('#223443', 0.5), backgroundFill: rgba(DARK_GRAY[700], 0.7) }; var DARK_OPACITY_LIGHT = { 900: rgba('#304455', 0.45), 800: rgba('#425863', 0.4), 700: rgba('#667886', 0.35), 600: rgba('#7b86a2', 0.3), 500: rgba('#9197a2', 0.25), 400: rgba('#95959c', 0.2), 300: rgba('#829493', 0.15), 200: rgba('#8b8b96', 0.1), 100: rgba('#747474', 0.05) }; var LIGHT_GRAY = { 900: '#a2aab2', 800: '#b5bcc2', 700: '#ccd0d4', 600: '#d7dade', 500: '#e2e4e7', // Good for "grayed" items and borders. 400: '#e8eaeb', // Good for "readonly" input fields and special text selection. 300: '#edeff0', 200: '#f3f4f5', 100: '#f8f9f9', placeholder: rgba(BASE.white, 0.65) }; var LIGHT_OPACITY_LIGHT = { 900: rgba(BASE.white, 0.5), 800: rgba(BASE.white, 0.45), 700: rgba(BASE.white, 0.4), 600: rgba(BASE.white, 0.35), 500: rgba(BASE.white, 0.3), 400: rgba(BASE.white, 0.25), 300: rgba(BASE.white, 0.2), 200: rgba(BASE.white, 0.15), 100: rgba(BASE.white, 0.1), backgroundFill: rgba(LIGHT_GRAY[300], 0.8) }; // Additional colors. // Some are from https://make.wordpress.org/design/handbook/foundations/colors/. var BLUE = { wordpress: { 700: '#00669b' }, dark: { 900: '#0071a1' }, medium: { 900: '#006589', 800: '#00739c', 700: '#007fac', 600: '#008dbe', 500: '#00a0d2', 400: '#33b3db', 300: '#66c6e4', 200: '#bfe7f3', 100: '#e5f5fa', highlight: '#b3e7fe', focus: '#007cba' } }; var ALERT = { yellow: '#f0b849', red: '#d94f4f', green: '#4ab866' }; var ADMIN = { theme: "var( --wp-admin-theme-color, ".concat(BLUE.wordpress[700], ")"), themeDark10: "var( --wp-admin-theme-color-darker-10, ".concat(BLUE.medium.focus, ")") }; // Namespaced values for raw colors hex codes var UI = { theme: ADMIN.theme, background: BASE.white, backgroundDisabled: LIGHT_GRAY[200], border: G2.gray[700], borderFocus: ADMIN.themeDark10, borderDisabled: G2.gray[400], borderLight: G2.gray[200], label: DARK_GRAY[500], textDisabled: DARK_GRAY[150], textDark: BASE.white, textLight: BASE.black }; var COLORS = colors_values_objectSpread(colors_values_objectSpread({}, BASE), {}, { darkGray: Object(external_this_lodash_["merge"])({}, DARK_GRAY, G2.darkGray), darkOpacity: DARK_OPACITY, darkOpacityLight: DARK_OPACITY_LIGHT, mediumGray: G2.mediumGray, lightGray: Object(external_this_lodash_["merge"])({}, LIGHT_GRAY, G2.lightGray), lightGrayLight: LIGHT_OPACITY_LIGHT, blue: Object(external_this_lodash_["merge"])({}, BLUE, G2.blue), alert: ALERT, admin: ADMIN, ui: UI }); /* harmony default export */ var colors_values = (COLORS); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/colors.js /** * External dependencies */ /** * Internal dependencies */ /** * Generating a CSS complient rgba() color value. * * @param {string} hexValue The hex value to convert to rgba(). * @param {number} alpha The alpha value for opacity. * @return {string} The converted rgba() color value. * * @example * rgba( '#000000', 0.5 ) * // rgba(0, 0, 0, 0.5) */ function rgba() { var hexValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; var _tinycolor$toRgb = tinycolor_default()(hexValue).toRgb(), r = _tinycolor$toRgb.r, g = _tinycolor$toRgb.g, b = _tinycolor$toRgb.b; return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(alpha, ")"); } /** * Retrieves a color from the color palette. * * @param {string} value The value to retrieve. * @return {string} The color (or fallback, if not found). * * @example * color( 'blue.wordpress.700' ) * // #00669b */ function colors_color(value) { var fallbackColor = '#000'; return Object(external_this_lodash_["get"])(COLORS, value, fallbackColor); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/reduce-motion.js /** * Allows users to opt-out of animations via OS-level preferences. * * @param {'transition' | 'animation' | string} [prop='transition'] CSS Property name * @return {string} Generated CSS code for the reduced style */ function reduceMotion() { var prop = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transition'; var style; switch (prop) { case 'transition': style = 'transition-duration: 0ms;'; break; case 'animation': style = 'animation-duration: 1ms;'; break; default: style = "\n\t\t\t\tanimation-duration: 1ms;\n\t\t\t\ttransition-duration: 0ms;\n\t\t\t"; } return "\n\t\t@media ( prefers-reduced-motion: reduce ) {\n\t\t\t".concat(style, ";\n\t\t}\n\t"); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-styles.js function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * Internal dependencies */ var alignment_matrix_control_styles_ref = true ? { name: "1xiracb", styles: "border-radius:2px;box-sizing:border-box;display:grid;grid-template-columns:repeat( 3,1fr );outline:none;" } : undefined; var rootBase = function rootBase() { return alignment_matrix_control_styles_ref; }; var alignment_matrix_control_styles_rootSize = function rootSize(_ref2) { var _ref2$size = _ref2.size, size = _ref2$size === void 0 ? 92 : _ref2$size; return /*#__PURE__*/css_browser_esm("grid-template-rows:repeat( 3,calc( ", size, "px / 3 ) );width:", size, "px;" + ( true ? "" : undefined)); }; var Root = styled_base_browser_esm("div", { target: "e1od1u4s0", label: "Root" })(rootBase, ";border:1px solid transparent;cursor:pointer;grid-template-columns:auto;", alignment_matrix_control_styles_rootSize, ";" + ( true ? "" : undefined)); var Row = styled_base_browser_esm("div", { target: "e1od1u4s1", label: "Row" })( true ? { name: "1177s8r", styles: "box-sizing:border-box;display:grid;grid-template-columns:repeat( 3,1fr );" } : undefined); var alignment_matrix_control_styles_pointActive = function pointActive(_ref3) { var isActive = _ref3.isActive; var boxShadow = isActive ? "0 0 0 2px ".concat(colors_color('black')) : null; var pointColor = isActive ? colors_color('black') : colors_color('lightGray.800'); var pointColorHover = isActive ? colors_color('black') : colors_color('blue.medium.focus'); return /*#__PURE__*/css_browser_esm("box-shadow:", boxShadow, ";color:", pointColor, ";*:hover > &{color:", pointColorHover, ";}" + ( true ? "" : undefined)); }; var alignment_matrix_control_styles_pointBase = function pointBase(props) { return /*#__PURE__*/css_browser_esm("background:currentColor;box-sizing:border-box;display:grid;margin:auto;transition:all 120ms linear;", reduceMotion('transition'), " ", alignment_matrix_control_styles_pointActive(props), true ? "" : undefined); }; var Point = styled_base_browser_esm("span", { target: "e1od1u4s2", label: "Point" })("height:6px;width:6px;", alignment_matrix_control_styles_pointBase, true ? "" : undefined); var Cell = styled_base_browser_esm("span", { target: "e1od1u4s3", label: "Cell" })( true ? { name: "10ro24i", styles: "appearance:none;border:none;box-sizing:border-box;margin:0;display:flex;position:relative;outline:none;align-items:center;justify-content:center;padding:0;" } : undefined); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/cell.js /** * External dependencies */ /** * Internal dependencies */ /** * Internal dependencies */ function cell_Cell(_ref) { var _ref$isActive = _ref.isActive, isActive = _ref$isActive === void 0 ? false : _ref$isActive, value = _ref.value, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["isActive", "value"]); var tooltipText = ALIGNMENT_LABEL[value]; return Object(external_this_wp_element_["createElement"])(build_module_tooltip["a" /* default */], { text: tooltipText }, Object(external_this_wp_element_["createElement"])(CompositeItem["a" /* CompositeItem */], Object(esm_extends["a" /* default */])({ as: Cell, role: "gridcell" }, props), Object(external_this_wp_element_["createElement"])(visually_hidden, null, value), Object(external_this_wp_element_["createElement"])(Point, { isActive: isActive, role: "presentation" }))); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/rtl.js /** * External dependencies */ var LOWER_LEFT_REGEXP = new RegExp(/-left/g); var LOWER_RIGHT_REGEXP = new RegExp(/-right/g); var UPPER_LEFT_REGEXP = new RegExp(/Left/g); var UPPER_RIGHT_REGEXP = new RegExp(/Right/g); /** * Checks to see whether the document is set to rtl. * * @return {boolean} Whether document is RTL. */ function getRTL() { return !!(document && document.documentElement.dir === 'rtl'); } /** * Simple hook to retrieve RTL direction value * * @return {boolean} Whether document is RTL. */ function useRTL() { return getRTL(); } /** * Flips a CSS property from left <-> right. * * @param {string} key The CSS property name. * * @return {string} The flipped CSS property name, if applicable. */ function getConvertedKey(key) { if (key === 'left') { return 'right'; } if (key === 'right') { return 'left'; } if (LOWER_LEFT_REGEXP.test(key)) { return key.replace(LOWER_LEFT_REGEXP, '-right'); } if (LOWER_RIGHT_REGEXP.test(key)) { return key.replace(LOWER_RIGHT_REGEXP, '-left'); } if (UPPER_LEFT_REGEXP.test(key)) { return key.replace(UPPER_LEFT_REGEXP, 'Right'); } if (UPPER_RIGHT_REGEXP.test(key)) { return key.replace(UPPER_RIGHT_REGEXP, 'Left'); } return key; } /** * An incredibly basic ltr -> rtl converter for style properties * * @param {Object} ltrStyles * * @return {Object} Converted ltr -> rtl styles */ var rtl_convertLTRToRTL = function convertLTRToRTL() { var ltrStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; return Object(external_this_lodash_["mapKeys"])(ltrStyles, function (_value, key) { return getConvertedKey(key); }); }; /** * A higher-order function that create an incredibly basic ltr -> rtl style converter for CSS objects. * * @param {Object} ltrStyles Ltr styles. Converts and renders from ltr -> rtl styles, if applicable. * @param {null|Object} rtlStyles Rtl styles. Renders if provided. * * @return {Function} A function to output CSS styles for Emotion's renderer */ function rtl() { var ltrStyles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; var rtlStyles = arguments.length > 1 ? arguments[1] : undefined; return function () { var isRTL = getRTL(); if (rtlStyles) { return isRTL ? /*#__PURE__*/css_browser_esm(rtlStyles, true ? "" : undefined) : /*#__PURE__*/css_browser_esm(ltrStyles, true ? "" : undefined); } return isRTL ? /*#__PURE__*/css_browser_esm(rtl_convertLTRToRTL(ltrStyles), true ? "" : undefined) : /*#__PURE__*/css_browser_esm(ltrStyles, true ? "" : undefined); }; } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/styles/alignment-matrix-control-icon-styles.js function alignment_matrix_control_icon_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * Internal dependencies */ var alignment_matrix_control_icon_styles_rootSize = function rootSize() { var padding = 1.5; var size = 24; return /*#__PURE__*/css_browser_esm({ gridTemplateRows: "repeat( 3, calc( ".concat(size - padding * 2, "px / 3))"), padding: padding, maxHeight: size, maxWidth: size }, true ? "" : undefined); }; var alignment_matrix_control_icon_styles_rootPointerEvents = function rootPointerEvents(_ref) { var disablePointerEvents = _ref.disablePointerEvents; return /*#__PURE__*/css_browser_esm({ pointerEvents: disablePointerEvents ? 'none' : null }, true ? "" : undefined); }; var alignment_matrix_control_icon_styles_Wrapper = styled_base_browser_esm("div", { target: "elqsdmc0", label: "Wrapper" })( true ? { name: "co61ta", styles: "box-sizing:border-box;padding:2px;" } : undefined); var alignment_matrix_control_icon_styles_Root = styled_base_browser_esm("div", { target: "elqsdmc1", label: "Root" })("transform-origin:top left;height:100%;width:100%;", rootBase, ";", alignment_matrix_control_icon_styles_rootSize, ";", alignment_matrix_control_icon_styles_rootPointerEvents, ";" + ( true ? "" : undefined)); var alignment_matrix_control_icon_styles_pointActive = function pointActive(_ref2) { var isActive = _ref2.isActive; var boxShadow = isActive ? "0 0 0 1px currentColor" : null; return /*#__PURE__*/css_browser_esm("box-shadow:", boxShadow, ";color:currentColor;*:hover > &{color:currentColor;}" + ( true ? "" : undefined)); }; var alignment_matrix_control_icon_styles_Point = styled_base_browser_esm("span", { target: "elqsdmc2", label: "Point" })("height:2px;width:2px;", alignment_matrix_control_styles_pointBase, ";", alignment_matrix_control_icon_styles_pointActive, ";" + ( true ? "" : undefined)); var alignment_matrix_control_icon_styles_Cell = Cell; // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/icon.js function icon_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function icon_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { icon_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { icon_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * External dependencies */ /** * Internal dependencies */ var BASE_SIZE = 24; function AlignmentMatrixControlIcon(_ref) { var className = _ref.className, _ref$disablePointerEv = _ref.disablePointerEvents, disablePointerEvents = _ref$disablePointerEv === void 0 ? true : _ref$disablePointerEv, _ref$size = _ref.size, size = _ref$size === void 0 ? BASE_SIZE : _ref$size, _ref$style = _ref.style, style = _ref$style === void 0 ? {} : _ref$style, _ref$value = _ref.value, value = _ref$value === void 0 ? 'center' : _ref$value, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "disablePointerEvents", "size", "style", "value"]); var alignIndex = getAlignmentIndex(value); var scale = (size / BASE_SIZE).toFixed(2); var classes = classnames_default()('component-alignment-matrix-control-icon', className); var styles = icon_objectSpread(icon_objectSpread({}, style), {}, { transform: "scale(".concat(scale, ")") }); return Object(external_this_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Root, Object(esm_extends["a" /* default */])({}, props, { className: classes, disablePointerEvents: disablePointerEvents, role: "presentation", size: size, style: styles }), ALIGNMENTS.map(function (align, index) { var isActive = alignIndex === index; return Object(external_this_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Cell, { key: align }, Object(external_this_wp_element_["createElement"])(alignment_matrix_control_icon_styles_Point, { isActive: isActive })); })); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function useBaseId(id) { var instanceId = Object(external_this_wp_compose_["useInstanceId"])(AlignmentMatrixControl, 'alignment-matrix-control'); return id || instanceId; } function AlignmentMatrixControl(_ref) { var className = _ref.className, id = _ref.id, _ref$label = _ref.label, label = _ref$label === void 0 ? Object(external_this_wp_i18n_["__"])('Alignment Matrix Control') : _ref$label, _ref$defaultValue = _ref.defaultValue, defaultValue = _ref$defaultValue === void 0 ? 'center center' : _ref$defaultValue, value = _ref.value, _ref$onChange = _ref.onChange, onChange = _ref$onChange === void 0 ? external_this_lodash_["noop"] : _ref$onChange, _ref$width = _ref.width, width = _ref$width === void 0 ? 92 : _ref$width, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "id", "label", "defaultValue", "value", "onChange", "width"]); var _useState = Object(external_this_wp_element_["useState"])(value !== null && value !== void 0 ? value : defaultValue), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 1), immutableDefaultValue = _useState2[0]; var isRTL = useRTL(); var baseId = useBaseId(id); var initialCurrentId = getItemId(baseId, immutableDefaultValue); var composite = Object(CompositeState_3a25dcee["g" /* u */])({ baseId: baseId, currentId: initialCurrentId, rtl: isRTL }); var handleOnChange = function handleOnChange(nextValue) { onChange(nextValue); }; Object(external_this_wp_element_["useEffect"])(function () { if (typeof value !== 'undefined') { composite.setCurrentId(getItemId(baseId, value)); } }, [value, composite.setCurrentId]); var classes = classnames_default()('component-alignment-matrix-control', className); return Object(external_this_wp_element_["createElement"])(Composite["a" /* Composite */], Object(esm_extends["a" /* default */])({}, props, composite, { "aria-label": label, as: Root, className: classes, role: "grid", width: width }), GRID.map(function (cells, index) { return Object(external_this_wp_element_["createElement"])(CompositeGroup, Object(esm_extends["a" /* default */])({}, composite, { as: Row, role: "row", key: index }), cells.map(function (cell) { var cellId = getItemId(baseId, cell); var isActive = composite.currentId === cellId; return Object(external_this_wp_element_["createElement"])(cell_Cell, Object(esm_extends["a" /* default */])({}, composite, { id: cellId, isActive: isActive, key: cell, value: cell, onFocus: function onFocus() { return handleOnChange(cell); } })); })); })); } AlignmentMatrixControl.Icon = AlignmentMatrixControlIcon; // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js var animate = __webpack_require__(124); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font-values.js /* harmony default export */ var font_values = ({ 'default.fontFamily': "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif", 'default.fontSize': '13px', 'helpText.fontSize': '12px', mobileTextMinFontSize: '16px' }); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/font.js /** * External dependencies */ /** * Internal dependencies */ /** * * @param {keyof FONT} value Path of value from `FONT` * @return {string} Font rule value */ function font(value) { return Object(external_this_lodash_["get"])(font_values, value, ''); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/space.js var SPACE_GRID_BASE = 8; /** * Creates a spacing CSS value (px) based on grid system values. * * @param {number} value Multiplier against the grid base value (8) * @return {string} The spacing value (px). */ function space() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; if (isNaN(value)) return "".concat(SPACE_GRID_BASE, "px"); return "".concat(SPACE_GRID_BASE * value, "px"); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/styles/base-control-styles.js /** * Internal dependencies */ var base_control_styles_Wrapper = styled_base_browser_esm("div", { target: "e1puf3u0", label: "Wrapper" })("font-family:", font('default.fontFamily'), ";font-size:", font('default.fontSize'), ";" + ( true ? "" : undefined)); var StyledField = styled_base_browser_esm("div", { target: "e1puf3u1", label: "StyledField" })("margin-bottom:", space(1), ";.components-panel__row &{margin-bottom:inherit;}" + ( true ? "" : undefined)); var StyledLabel = styled_base_browser_esm("label", { target: "e1puf3u2", label: "StyledLabel" })("display:inline-block;margin-bottom:", space(1), ";" + ( true ? "" : undefined)); var StyledHelp = styled_base_browser_esm("p", { target: "e1puf3u3", label: "StyledHelp" })("margin-top:-", space(1), ";font-size:", font('helpText.fontSize'), ";font-style:normal;color:", colors_color('mediumGray.text'), ";" + ( true ? "" : undefined)); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/base-control/index.js /** * External dependencies */ /** * Internal dependencies */ function BaseControl(_ref) { var id = _ref.id, label = _ref.label, hideLabelFromVision = _ref.hideLabelFromVision, help = _ref.help, className = _ref.className, children = _ref.children; return Object(external_this_wp_element_["createElement"])(base_control_styles_Wrapper, { className: classnames_default()('components-base-control', className) }, Object(external_this_wp_element_["createElement"])(StyledField, { className: "components-base-control__field" }, label && id && (hideLabelFromVision ? Object(external_this_wp_element_["createElement"])(visually_hidden, { as: "label", htmlFor: id }, label) : Object(external_this_wp_element_["createElement"])(StyledLabel, { className: "components-base-control__label", htmlFor: id }, label)), label && !id && (hideLabelFromVision ? Object(external_this_wp_element_["createElement"])(visually_hidden, { as: "label" }, label) : Object(external_this_wp_element_["createElement"])(BaseControl.VisualLabel, null, label)), children), !!help && Object(external_this_wp_element_["createElement"])(StyledHelp, { id: id + '__help', className: "components-base-control__help" }, help)); } BaseControl.VisualLabel = function (_ref2) { var className = _ref2.className, children = _ref2.children; className = classnames_default()('components-base-control__label', className); return Object(external_this_wp_element_["createElement"])("span", { className: className }, children); }; /* harmony default export */ var base_control = (BaseControl); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/styles/flex-styles.js function flex_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ var flex_styles_alignStyle = function alignStyle(_ref2) { var align = _ref2.align; var aligns = { top: 'flex-start', bottom: 'flex-end' }; var value = aligns[align] || align; return /*#__PURE__*/css_browser_esm({ alignItems: value }, true ? "" : undefined); }; var flex_styles_justifyStyle = function justifyStyle(_ref3) { var justify = _ref3.justify, isReversed = _ref3.isReversed; var justifies = { left: 'flex-start', right: 'flex-end' }; var value = justifies[justify] || justify; if (isReversed && justifies[justify]) { value = justify === 'left' ? justifies.right : justifies.left; } return /*#__PURE__*/css_browser_esm({ justifyContent: value }, true ? "" : undefined); }; var flex_styles_gapStyle = function gapStyle(_ref4) { var gap = _ref4.gap, isReversed = _ref4.isReversed; var base = 4; var value = typeof gap === 'number' ? base * gap : base; var dir = isReversed ? 'left' : 'right'; var margin = "margin-".concat(dir); return /*#__PURE__*/css_browser_esm("> *{", margin, ":", value, "px;&:last-child{", margin, ":0;}}" + ( true ? "" : undefined)); }; var flex_styles_ref = true ? { name: "8kj89b", styles: "flex-direction:row-reverse;" } : undefined; var reversedStyles = function reversedStyles(_ref5) { var isReversed = _ref5.isReversed; if (!isReversed) return ''; return flex_styles_ref; }; var Flex = styled_base_browser_esm("div", { target: "eboqfv50", label: "Flex" })("box-sizing:border-box;display:flex;width:100%;", flex_styles_alignStyle, " ", flex_styles_justifyStyle, " ", flex_styles_gapStyle, " ", reversedStyles, true ? "" : undefined); var Item = styled_base_browser_esm("div", { target: "eboqfv51", label: "Item" })( true ? { name: "13luw5d", styles: "box-sizing:border-box;min-width:0;max-width:100%;" } : undefined); var Block = /*#__PURE__*/styled_base_browser_esm(Item, { target: "eboqfv52", label: "Block" })( true ? { name: "1rr4qq7", styles: "flex:1;" } : undefined); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/block.js /** * External dependencies */ /** * Internal dependencies */ /** * WordPress dependencies */ function FlexBlock(_ref, ref) { var className = _ref.className, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className"]); var classes = classnames_default()('components-flex__block', className); return Object(external_this_wp_element_["createElement"])(Block, Object(esm_extends["a" /* default */])({}, props, { className: classes, ref: ref })); } /* harmony default export */ var block = (Object(external_this_wp_element_["forwardRef"])(FlexBlock)); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function FlexComponent(_ref, ref) { var _ref$align = _ref.align, align = _ref$align === void 0 ? 'center' : _ref$align, className = _ref.className, _ref$gap = _ref.gap, gap = _ref$gap === void 0 ? 2 : _ref$gap, _ref$justify = _ref.justify, justify = _ref$justify === void 0 ? 'space-between' : _ref$justify, _ref$isReversed = _ref.isReversed, isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["align", "className", "gap", "justify", "isReversed"]); var classes = classnames_default()('components-flex', className); return Object(external_this_wp_element_["createElement"])(Flex, Object(esm_extends["a" /* default */])({}, props, { align: align, className: classes, ref: ref, gap: gap, justify: justify, isReversed: isReversed })); } var flex_Flex = Object(external_this_wp_element_["forwardRef"])(FlexComponent); /* harmony default export */ var flex = (flex_Flex); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/flex/item.js /** * External dependencies */ /** * Internal dependencies */ /** * WordPress dependencies */ function FlexItem(_ref, ref) { var className = _ref.className, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className"]); var classes = classnames_default()('components-flex__item', className); return Object(external_this_wp_element_["createElement"])(Item, Object(esm_extends["a" /* default */])({}, props, { className: classes, ref: ref })); } /* harmony default export */ var flex_item = (Object(external_this_wp_element_["forwardRef"])(FlexItem)); // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/font-family.js var fontFamily = "font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto,\nOxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;"; // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/emotion-css.js /** * External dependencies */ /* harmony default export */ var emotion_css = (css_browser_esm); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/styles/text-mixins.js function _templateObject9() { var data = _taggedTemplateLiteral(["\n\t", "\n\t", "\n"]); _templateObject9 = function _templateObject9() { return data; }; return data; } function _templateObject8() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]); _templateObject8 = function _templateObject8() { return data; }; return data; } function _templateObject7() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]); _templateObject7 = function _templateObject7() { return data; }; return data; } function _templateObject6() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t"]); _templateObject6 = function _templateObject6() { return data; }; return data; } function _templateObject5() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]); _templateObject5 = function _templateObject5() { return data; }; return data; } function _templateObject4() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]); _templateObject4 = function _templateObject4() { return data; }; return data; } function _templateObject3() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]); _templateObject3 = function _templateObject3() { return data; }; return data; } function _templateObject2() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]); _templateObject2 = function _templateObject2() { return data; }; return data; } function _templateObject() { var data = _taggedTemplateLiteral(["\n\t\t\t\t", "\n\t\t\t\t", "\n\t\t\t"]); _templateObject = function _templateObject() { return data; }; return data; } /** * Internal dependencies */ var fontWeightNormal = "font-weight: 400;"; var fontWeightMedium = "font-weight: 500;"; var fontWeightSemibold = "font-weight: 600;"; var text_mixins_title = "\n ".concat(fontWeightNormal, "\n"); var titleLarge = "\n\tfont-size: 32px;\n\tline-height: 40px;\n"; var titleMedium = "\n\tfont-size: 24px;\n\tline-height: 32px;\n"; var titleSmall = "\n\tfont-size: 20px;\n\tline-height: 28px;\n"; var subtitle = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 14px;\n\tline-height: 20px;\n"); var subtitleLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n"; var subtitleSmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n"; var text_mixins_body = "\n\t".concat(fontWeightNormal, "\n"); var bodyLarge = "\n\tfont-size: 16px;\n\tline-height: 24px;\n"; var bodySmall = "\n\tfont-size: 14px;\n\tline-height: 20px;\n"; var text_mixins_button = "\n ".concat(fontWeightSemibold, "\n font-size: 14px;\n line-height: 20px;\n"); var caption = "\n\t".concat(fontWeightNormal, "\n\tfont-size: 12px;\n\tline-height: 16px;\n"); var text_mixins_label = "\n\t".concat(fontWeightSemibold, "\n\tfont-size: 12px;\n\tline-height: 16px;\n"); var sectionHeading = "\n\t".concat(fontWeightMedium, "\n\tfont-size: 11px;\n\tline-height: 1.4;\n\ttext-transform: uppercase;\n\tcolor: ").concat(G2.gray[700], "\n"); /** * @typedef {'title.large'|'title.medium'|'title.small'|'subtitle'|'subtitle.small'|'body'|'body.large'|'body.small'|'button'|'caption'|'label'|'sectionheading'} TextVariant */ /** * @param {TextVariant} variantName */ var text_mixins_variant = function variant() { var variantName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'body'; switch (variantName) { case 'title.large': return emotion_css(_templateObject(), text_mixins_title, titleLarge); case 'title.medium': return emotion_css(_templateObject2(), text_mixins_title, titleMedium); case 'title.small': return emotion_css(_templateObject3(), text_mixins_title, titleSmall); case 'subtitle': return emotion_css(_templateObject4(), subtitle, subtitleLarge); case 'subtitle.small': return emotion_css(_templateObject5(), subtitle, subtitleSmall); case 'body': return emotion_css(_templateObject6(), text_mixins_body); case 'body.large': return emotion_css(_templateObject7(), text_mixins_body, bodyLarge); case 'body.small': return emotion_css(_templateObject8(), text_mixins_body, bodySmall); case 'button': return text_mixins_button; case 'caption': return caption; case 'label': return text_mixins_label; case 'sectionheading': return sectionHeading; } }; /** * @typedef {Object} TextProps * @property {TextVariant} variant one of TextVariant to be used */ /** * @param {TextProps} props */ var text_mixins_text = function text(props) { return emotion_css(_templateObject9(), fontFamily, text_mixins_variant(props.variant)); }; // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/text/index.js /** * Internal dependencies */ var Text = styled_base_browser_esm("p", { target: "e15wbhsk0", label: "Text" })("\n\tbox-sizing: border-box;\n\tmargin: 0;\n", text_mixins_text, true ? "" : undefined); /* harmony default export */ var build_module_text = (Text); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/styles/input-control-styles.js function input_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ var input_control_styles_ref = true ? { name: "1dacand", styles: "padding-top:0;" } : undefined; var rootFloatLabelStyles = function rootFloatLabelStyles() { return input_control_styles_ref; }; var input_control_styles_ref2 = true ? { name: "r6z5ec", styles: "z-index:1;" } : undefined; var rootFocusedStyles = function rootFocusedStyles(_ref9) { var isFocused = _ref9.isFocused; if (!isFocused) return ''; return input_control_styles_ref2; }; var input_control_styles_ref3 = true ? { name: "uz6002", styles: "align-items:flex-start;flex-direction:column;" } : undefined; var input_control_styles_ref4 = true ? { name: "53hdd7", styles: "align-items:flex-start;flex-direction:column-reverse;" } : undefined; var input_control_styles_ref5 = true ? { name: "x4dmss", styles: "justify-content:space-between;" } : undefined; var rootLabelPositionStyles = function rootLabelPositionStyles(_ref10) { var labelPosition = _ref10.labelPosition; switch (labelPosition) { case 'top': return input_control_styles_ref3; case 'bottom': return input_control_styles_ref4; case 'edge': return input_control_styles_ref5; default: return ''; } }; var input_control_styles_Root = /*#__PURE__*/styled_base_browser_esm(flex, { target: "e1cr7zh10", label: "Root" })("position:relative;border-radius:2px;", rootFloatLabelStyles, " ", rootFocusedStyles, " ", rootLabelPositionStyles, true ? "" : undefined); var input_control_styles_containerDisabledStyles = function containerDisabledStyles(_ref11) { var disabled = _ref11.disabled; var backgroundColor = disabled ? colors_color('ui.backgroundDisabled') : colors_color('ui.background'); return /*#__PURE__*/css_browser_esm({ backgroundColor: backgroundColor }, true ? "" : undefined); }; var input_control_styles_ref6 = true ? { name: "8atqhb", styles: "width:100%;" } : undefined; var input_control_styles_containerWidthStyles = function containerWidthStyles(_ref12) { var __unstableInputWidth = _ref12.__unstableInputWidth, labelPosition = _ref12.labelPosition; if (!__unstableInputWidth) return input_control_styles_ref6; if (labelPosition === 'side') return ''; if (labelPosition === 'edge') { return /*#__PURE__*/css_browser_esm({ flex: "0 0 ".concat(__unstableInputWidth) }, true ? "" : undefined); } return /*#__PURE__*/css_browser_esm({ width: __unstableInputWidth }, true ? "" : undefined); }; var Container = styled_base_browser_esm("div", { target: "e1cr7zh11", label: "Container" })("align-items:center;box-sizing:border-box;border-radius:inherit;display:flex;flex:1;position:relative;", input_control_styles_containerDisabledStyles, " ", input_control_styles_containerWidthStyles, true ? "" : undefined); var input_control_styles_disabledStyles = function disabledStyles(_ref13) { var disabled = _ref13.disabled; if (!disabled) return ''; return /*#__PURE__*/css_browser_esm({ color: colors_color('ui.textDisabled') }, true ? "" : undefined); }; var input_control_styles_fontSizeStyles = function fontSizeStyles(_ref14) { var size = _ref14.size; var sizes = { default: '13px', small: '11px' }; var fontSize = sizes[size]; var fontSizeMobile = '16px'; if (!fontSize) return ''; return /*#__PURE__*/css_browser_esm("font-size:", fontSizeMobile, ";@media ( min-width:600px ){font-size:", fontSize, ";}" + ( true ? "" : undefined)); }; var input_control_styles_sizeStyles = function sizeStyles(_ref15) { var size = _ref15.size; var sizes = { default: { height: 30, lineHeight: 1, minHeight: 30 }, small: { height: 24, lineHeight: 1, minHeight: 24 } }; var style = sizes[size] || sizes.default; return /*#__PURE__*/css_browser_esm(style, true ? "" : undefined); }; var input_control_styles_ref7 = true ? { name: "103r1kr", styles: "&::-webkit-input-placeholder{line-height:normal;}" } : undefined; var placeholderStyles = function placeholderStyles() { return input_control_styles_ref7; }; var input_control_styles_dragStyles = function dragStyles(_ref16) { var isDragging = _ref16.isDragging, dragCursor = _ref16.dragCursor; var defaultArrowStyles = ''; var activeDragCursorStyles = ''; if (isDragging) { defaultArrowStyles = /*#__PURE__*/css_browser_esm("cursor:", dragCursor, ";user-select:none;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}" + ( true ? "" : undefined)); } if (isDragging && dragCursor) { activeDragCursorStyles = /*#__PURE__*/css_browser_esm("&:active{cursor:", dragCursor, ";}" + ( true ? "" : undefined)); } return /*#__PURE__*/css_browser_esm(defaultArrowStyles, " ", activeDragCursorStyles, true ? "" : undefined); }; // TODO: Resolve need to use &&& to increase specificity // https://github.com/WordPress/gutenberg/issues/18483 var input_control_styles_Input = styled_base_browser_esm("input", { target: "e1cr7zh12", label: "Input" })("&&&{background-color:transparent;box-sizing:border-box;border:none;box-shadow:none !important;color:", colors_color('black'), ";display:block;margin:0;outline:none;padding-left:8px;padding-right:8px;width:100%;", input_control_styles_dragStyles, " ", input_control_styles_disabledStyles, " ", input_control_styles_fontSizeStyles, " ", input_control_styles_sizeStyles, " ", placeholderStyles, "}" + ( true ? "" : undefined)); var input_control_styles_ref8 = true ? { name: "8uhtka", styles: "overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" } : undefined; var labelTruncation = function labelTruncation() { return input_control_styles_ref8; }; var input_control_styles_labelPadding = function labelPadding(_ref17) { var labelPosition = _ref17.labelPosition; var paddingBottom = 4; if (labelPosition === 'edge' || labelPosition === 'side') { paddingBottom = 0; } return /*#__PURE__*/css_browser_esm({ paddingTop: 0, paddingBottom: paddingBottom }, true ? "" : undefined); }; var BaseLabel = /*#__PURE__*/styled_base_browser_esm(build_module_text, { target: "e1cr7zh13", label: "BaseLabel" })("&&&{box-sizing:border-box;color:currentColor;display:block;margin:0;max-width:100%;z-index:1;", input_control_styles_labelPadding, " ", labelTruncation, "}" + ( true ? "" : undefined)); var input_control_styles_Label = function Label(props) { return Object(external_this_wp_element_["createElement"])(BaseLabel, Object(esm_extends["a" /* default */])({}, props, { as: "label" })); }; var LabelWrapper = /*#__PURE__*/styled_base_browser_esm(flex_item, { target: "e1cr7zh14", label: "LabelWrapper" })( true ? { name: "120o8im", styles: "max-width:calc( 100% - 10px );" } : undefined); var input_control_styles_backdropFocusedStyles = function backdropFocusedStyles(_ref18) { var disabled = _ref18.disabled, isFocused = _ref18.isFocused; var borderColor = isFocused ? colors_color('ui.borderFocus') : colors_color('ui.border'); var boxShadow = null; if (isFocused) { boxShadow = "0 0 0 1px ".concat(colors_color('ui.borderFocus'), " inset"); } if (disabled) { borderColor = colors_color('ui.borderDisabled'); } return /*#__PURE__*/css_browser_esm({ boxShadow: boxShadow, borderColor: borderColor, borderStyle: 'solid', borderWidth: 1 }, true ? "" : undefined); }; var BackdropUI = styled_base_browser_esm("div", { target: "e1cr7zh15", label: "BackdropUI" })("&&&{box-sizing:border-box;border-radius:inherit;bottom:0;left:0;margin:0;padding:0;pointer-events:none;position:absolute;right:0;top:0;", input_control_styles_backdropFocusedStyles, " ", rtl({ paddingLeft: 2 }), "}" + ( true ? "" : undefined)); var Prefix = styled_base_browser_esm("span", { target: "e1cr7zh16", label: "Prefix" })( true ? { name: "1pxuk39", styles: "box-sizing:border-box;display:block;" } : undefined); var Suffix = styled_base_browser_esm("span", { target: "e1cr7zh17", label: "Suffix" })( true ? { name: "1pxuk39", styles: "box-sizing:border-box;display:block;" } : undefined); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/backdrop.js /** * WordPress dependencies */ /** * Internal dependencies */ function Backdrop(_ref) { var _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$isFocused = _ref.isFocused, isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused; return Object(external_this_wp_element_["createElement"])(BackdropUI, { "aria-hidden": "true", className: "components-input-control__backdrop", disabled: disabled, isFocused: isFocused }); } var MemoizedBackdrop = Object(external_this_wp_element_["memo"])(Backdrop); /* harmony default export */ var backdrop = (MemoizedBackdrop); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/label.js /** * Internal dependencies */ function label_Label(_ref) { var children = _ref.children, hideLabelFromVision = _ref.hideLabelFromVision, htmlFor = _ref.htmlFor, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["children", "hideLabelFromVision", "htmlFor"]); if (!children) return null; if (hideLabelFromVision) { return Object(external_this_wp_element_["createElement"])(visually_hidden, { as: "label", htmlFor: htmlFor }, children); } return Object(external_this_wp_element_["createElement"])(input_control_styles_Label, Object(esm_extends["a" /* default */])({ htmlFor: htmlFor }, props), children); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-base.js /** * WordPress dependencies */ /** * Internal dependencies */ function useUniqueId(idProp) { var instanceId = Object(external_this_wp_compose_["useInstanceId"])(InputBase); var id = "input-base-control-".concat(instanceId); return idProp || id; } function InputBase(_ref, ref) { var __unstableInputWidth = _ref.__unstableInputWidth, children = _ref.children, className = _ref.className, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$hideLabelFromVis = _ref.hideLabelFromVision, hideLabelFromVision = _ref$hideLabelFromVis === void 0 ? false : _ref$hideLabelFromVis, labelPosition = _ref.labelPosition, idProp = _ref.id, _ref$isFocused = _ref.isFocused, isFocused = _ref$isFocused === void 0 ? false : _ref$isFocused, label = _ref.label, prefix = _ref.prefix, _ref$size = _ref.size, size = _ref$size === void 0 ? 'default' : _ref$size, suffix = _ref.suffix, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["__unstableInputWidth", "children", "className", "disabled", "hideLabelFromVision", "labelPosition", "id", "isFocused", "label", "prefix", "size", "suffix"]); var id = useUniqueId(idProp); return Object(external_this_wp_element_["createElement"])(input_control_styles_Root, Object(esm_extends["a" /* default */])({}, props, { className: className, isFocused: isFocused, labelPosition: labelPosition, ref: ref }), Object(external_this_wp_element_["createElement"])(LabelWrapper, null, Object(external_this_wp_element_["createElement"])(label_Label, { className: "components-input-control__label", hideLabelFromVision: hideLabelFromVision, labelPosition: labelPosition, htmlFor: id, size: size }, label)), Object(external_this_wp_element_["createElement"])(Container, { __unstableInputWidth: __unstableInputWidth, className: "components-input-control__container", disabled: disabled, isFocused: isFocused, labelPosition: labelPosition }, prefix && Object(external_this_wp_element_["createElement"])(Prefix, { className: "components-input-control__prefix" }, prefix), children, suffix && Object(external_this_wp_element_["createElement"])(Suffix, { className: "components-input-control__suffix" }, suffix), Object(external_this_wp_element_["createElement"])(backdrop, { "aria-hidden": "true", disabled: disabled, isFocused: isFocused, label: label, size: size }))); } /* harmony default export */ var input_base = (Object(external_this_wp_element_["forwardRef"])(InputBase)); // CONCATENATED MODULE: ./node_modules/react-use-gesture/dist/react-use-gesture.esm.js // vector add function addV(v1, v2) { return v1.map(function (v, i) { return v + v2[i]; }); } // vector substract function subV(v1, v2) { return v1.map(function (v, i) { return v - v2[i]; }); } /** * Calculates velocity * @param delta the difference between current and previous vectors * @param delta_t the time offset * @param len the length of the delta vector * @returns velocity */ function calculateVelocity(delta, delta_t, len) { len = len || Math.hypot.apply(Math, delta); return delta_t ? len / delta_t : 0; } /** * Calculates velocities vector * @template T the expected vector type * @param delta the difference between current and previous vectors * @param delta_t the time offset * @returns velocities vector */ function calculateVelocities(delta, delta_t) { return delta_t ? delta.map(function (v) { return v / delta_t; }) : Array(delta.length).fill(0); } /** * Calculates distance * @param movement the difference between current and initial vectors * @returns distance */ function calculateDistance(movement) { return Math.hypot.apply(Math, movement); } /** * Calculates direction * @template T the expected vector type * @param delta * @param len * @returns direction */ function calculateDirection(delta, len) { len = len || Math.hypot.apply(Math, delta) || 1; return delta.map(function (v) { return v / len; }); } /** * Calculates all kinematics * @template T the expected vector type * @param movement the difference between current and initial vectors * @param delta the difference between current and previous vectors * @param delta_t the time difference between current and previous timestamps * @returns all kinematics */ function calculateAllKinematics(movement, delta, delta_t) { var len = Math.hypot.apply(Math, delta); return { velocities: calculateVelocities(delta, delta_t), velocity: calculateVelocity(delta, delta_t, len), distance: calculateDistance(movement), direction: calculateDirection(delta, len) }; } /** * Because IE doesn't support `Math.sign` function, so we use the polyfill version of the function. * This polyfill function is suggested by Mozilla * :https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/sign#Polyfill * @param x target number */ function sign(x) { if (Math.sign) return Math.sign(x); return Number(x > 0) - Number(x < 0) || +x; } function getIntentionalDisplacement(movement, threshold) { var abs = Math.abs(movement); return abs >= threshold ? sign(movement) * threshold : false; } function minMax(value, min, max) { return Math.max(min, Math.min(value, max)); } // Based on @aholachek ;) // https://twitter.com/chpwn/status/285540192096497664 // iOS constant = 0.55 // https://medium.com/@nathangitter/building-fluid-interfaces-ios-swift-9732bb934bf5 function rubberband2(distance, constant) { // default constant from the article is 0.7 return Math.pow(distance, constant * 5); } function rubberband(distance, dimension, constant) { if (dimension === 0 || Math.abs(dimension) === Infinity) return rubberband2(distance, constant); return distance * dimension * constant / (dimension + constant * distance); } function rubberbandIfOutOfBounds(position, min, max, constant) { if (constant === void 0) { constant = 0.15; } if (constant === 0) return minMax(position, min, max); if (position < min) { return -rubberband(min - position, max - min, constant) + min; } if (position > max) { return rubberband(position - max, max - min, constant) + max; } return position; } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } function react_use_gesture_esm_inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _createForOfIteratorHelperLoose(o) { var i = 0; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) return function () { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }; throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } i = o[Symbol.iterator](); return i.next.bind(i); } // blank function function noop() {} // returns a function that chains all functions given as parameters var chainFns = function chainFns() { for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { fns[_key] = arguments[_key]; } return function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return fns.forEach(function (fn) { return fn.apply(void 0, args); }); }; }; var def = { array: function array(value) { return Array.isArray(value) ? value : [value, value]; }, withDefault: function withDefault(value, defaultIfUndefined) { return value !== void 0 ? value : defaultIfUndefined; } }; function matchKeysFromObject(obj, matchingObject) { var o = {}; Object.entries(obj).forEach(function (_ref) { var key = _ref[0], value = _ref[1]; return (value !== void 0 || key in matchingObject) && (o[key] = value); }); return o; } function valueFn(v) { return typeof v === 'function' ? v() : v; } function getInitialState() { // common initial state for all gestures var initialCommon = { _active: false, _blocked: false, _intentional: [false, false], _movement: [0, 0], _initial: [0, 0], _lastEventType: undefined, event: undefined, // currentTarget: undefined, // pointerId: undefined, values: [0, 0], velocities: [0, 0], delta: [0, 0], movement: [0, 0], offset: [0, 0], lastOffset: [0, 0], direction: [0, 0], initial: [0, 0], previous: [0, 0], first: false, last: false, active: false, timeStamp: 0, startTime: 0, elapsedTime: 0, cancel: noop, canceled: false, memo: undefined, args: undefined }; // initial state for coordinates-based gestures var initialCoordinates = { axis: undefined, xy: [0, 0], vxvy: [0, 0], velocity: 0, distance: 0 }; // initial state for distance and angle-based gestures (pinch) var initialDistanceAngle = { da: [0, 0], vdva: [0, 0], origin: undefined, turns: 0 }; // initial state object (used by the gesture controller) return { shared: { hovering: false, scrolling: false, wheeling: false, dragging: false, moving: false, pinching: false, touches: 0, buttons: 0, down: false, shiftKey: false, altKey: false, metaKey: false, ctrlKey: false }, drag: _extends(_extends(_extends({}, initialCommon), initialCoordinates), {}, { _isTap: true, _delayedEvent: false, tap: false, swipe: [0, 0] }), pinch: _extends(_extends({}, initialCommon), initialDistanceAngle), wheel: _extends(_extends({}, initialCommon), initialCoordinates), move: _extends(_extends({}, initialCommon), initialCoordinates), scroll: _extends(_extends({}, initialCommon), initialCoordinates) }; } var setListeners = function setListeners(add) { return function (el, listeners, options) { var action = add ? 'addEventListener' : 'removeEventListener'; listeners.forEach(function (_ref) { var eventName = _ref[0], fn = _ref[1]; return el[action](eventName, fn, options); }); }; }; /** * Whether the browser supports GestureEvent (ie Safari) * @returns true if the browser supports gesture event */ function supportsGestureEvents() { try { // TODO [TS] possibly find GestureEvent definitions? // @ts-ignore: no type definitions for webkit GestureEvents return 'constructor' in GestureEvent; } catch (e) { return false; } } var addListeners = /*#__PURE__*/setListeners(true); var removeListeners = /*#__PURE__*/setListeners(false); /** * Gets modifier keys from event * @param event * @returns modifier keys */ function getModifierKeys(event) { var shiftKey = event.shiftKey, altKey = event.altKey, metaKey = event.metaKey, ctrlKey = event.ctrlKey; return { shiftKey: shiftKey, altKey: altKey, metaKey: metaKey, ctrlKey: ctrlKey }; } function getTouchEvents(event) { if ('touches' in event) { var touches = event.touches, changedTouches = event.changedTouches; return touches.length > 0 ? touches : changedTouches; } return null; } function getGenericEventData(event) { var buttons = 'buttons' in event ? event.buttons : 0; var touchEvents = getTouchEvents(event); var touches = touchEvents && touchEvents.length || 0; var down = touches > 0 || buttons > 0; return _extends({ touches: touches, down: down, buttons: buttons }, getModifierKeys(event)); } /** * Gets scroll event values * @param event * @returns scroll event values */ function getScrollEventValues(event) { // If the currentTarget is the window then we return the scrollX/Y position. // If not (ie the currentTarget is a DOM element), then we return scrollLeft/Top var _event$currentTarget = event.currentTarget, scrollX = _event$currentTarget.scrollX, scrollY = _event$currentTarget.scrollY, scrollLeft = _event$currentTarget.scrollLeft, scrollTop = _event$currentTarget.scrollTop; return { values: [scrollX || scrollLeft || 0, scrollY || scrollTop || 0] }; } /** * Gets wheel event values. * @param event * @returns wheel event values */ function getWheelEventValues(event) { var deltaX = event.deltaX, deltaY = event.deltaY; //TODO implement polyfill ? // https://developer.mozilla.org/en-US/docs/Web/Events/wheel#Polyfill return { values: [deltaX, deltaY] }; } /** * Gets pointer event values. * @param event * @returns pointer event values */ function getPointerEventValues(event) { var touchEvents = getTouchEvents(event); var _ref2 = touchEvents ? touchEvents[0] : event, clientX = _ref2.clientX, clientY = _ref2.clientY; return { values: [clientX, clientY] }; } var WEBKIT_DISTANCE_SCALE_FACTOR = 260; /** * Gets webkit gesture event values. * @param event * @returns webkit gesture event values */ function getWebkitGestureEventValues(event) { return { values: [event.scale * WEBKIT_DISTANCE_SCALE_FACTOR, event.rotation] }; } /** * Gets two touches event data * @param event * @returns two touches event data */ function getTwoTouchesEventData(event) { var touches = event.touches; var dx = touches[1].clientX - touches[0].clientX; var dy = touches[1].clientY - touches[0].clientY; var values = [Math.hypot(dx, dy), -(Math.atan2(dx, dy) * 180) / Math.PI]; var origin = [(touches[1].clientX + touches[0].clientX) / 2, (touches[1].clientY + touches[0].clientY) / 2]; return { values: values, origin: origin }; } /** * The controller will keep track of the state for all gestures and also keep * track of timeouts, and window listeners. * * @template BinderType the type the bind function should return */ var Controller = function Controller() { var _this = this; this.state = getInitialState(); // state for all gestures this.timeouts = {}; // keeping track of timeouts for debounced gestures (such as move, scroll, wheel) this.domListeners = []; // when config.domTarget is set, we attach events directly to the dom this.windowListeners = {}; // keeps track of window listeners added by gestures (drag only at the moment) this.bindings = {}; // an object holding the handlers associated to the gestures /** * Function ran on component unmount: cleans timeouts and removes dom listeners set by the bind function. */ this.clean = function () { _this.resetBindings(); Object.values(_this.timeouts).forEach(clearTimeout); Object.keys(_this.windowListeners).forEach(function (stateKey) { return _this.removeWindowListeners(stateKey); }); }; /** * Function run every time the bind function is run (ie on every render). * Resets the binding object and remove dom listeners attached to config.domTarget */ this.resetBindings = function () { _this.bindings = {}; var domTarget = _this.getDomTarget(); if (domTarget) { removeListeners(domTarget, _this.domListeners, _this.config.eventOptions); _this.domListeners = []; } }; /** * Returns the domTarget element and parses a ref if needed. */ this.getDomTarget = function () { var domTarget = _this.config.domTarget; return domTarget && 'current' in domTarget ? domTarget.current : domTarget; }; /** * Commodity function to let recognizers simply add listeners to config.window. */ this.addWindowListeners = function (stateKey, listeners) { if (!_this.config.window) return; // we use this.windowListeners to keep track of the listeners we add _this.windowListeners[stateKey] = listeners; addListeners(_this.config.window, listeners, _this.config.eventOptions); }; /** * Commodity function to let recognizers simply remove listeners to config.window. */ this.removeWindowListeners = function (stateKey) { if (!_this.config.window) return; var listeners = _this.windowListeners[stateKey]; if (listeners) { removeListeners(_this.config.window, listeners, _this.config.eventOptions); delete _this.windowListeners[stateKey]; } }; /** * When config.domTarget is set, this function will add dom listeners to it */ this.addDomTargetListeners = function (target) { /** We iterate on the entries of this.binding for each event, then we chain * the array of functions mapped to it and push them to this.domListeners */ Object.entries(_this.bindings).forEach(function (_ref) { var event = _ref[0], fns = _ref[1]; _this.domListeners.push([event.substr(2).toLowerCase(), chainFns.apply(void 0, fns)]); }); addListeners(target, _this.domListeners, _this.config.eventOptions); }; /** * this.bindings is an object which keys match ReactEventHandlerKeys. * Since a recognizer might want to bind a handler function to an event key already used by a previously * added recognizer, we need to make sure that each event key is an array of all the functions mapped for * that key. */ this.addBindings = function (eventNames, fn) { var eventNamesArray = !Array.isArray(eventNames) ? [eventNames] : eventNames; eventNamesArray.forEach(function (eventName) { if (_this.bindings[eventName]) _this.bindings[eventName].push(fn);else _this.bindings[eventName] = [fn]; }); }; /** * getBindings will return an object that will be bound by users * to the react component they want to interact with. */ this.getBindings = function () { var bindings = {}; var captureString = _this.config.captureString; Object.entries(_this.bindings).forEach(function (_ref2) { var event = _ref2[0], fns = _ref2[1]; var fnsArray = Array.isArray(fns) ? fns : [fns]; var key = event + captureString; bindings[key] = chainFns.apply(void 0, fnsArray); }); return bindings; }; this.getBind = function () { // If config.domTarget is set we add event listeners to it and return the clean function. if (_this.config.domTarget) { var domTarget = _this.getDomTarget(); domTarget && _this.addDomTargetListeners(domTarget); return _this.clean; } // If not, we return an object that contains gesture handlers mapped to react handler event keys. return _this.getBindings(); }; }; /** * @private * * Utility hook called by all gesture hooks and that will be responsible for the internals. * * @param {Partial} handlers * @param {RecognizerClasses} classes * @param {InternalConfig} config * @param {NativeHandlersPartial} nativeHandlers - native handlers such as onClick, onMouseDown, etc. * @returns {(...args: any[]) => HookReturnType} */ function useRecognizers(handlers, classes, config, nativeHandlers) { // The gesture controller keeping track of all gesture states var controller = external_this_React_default.a.useMemo(function () { var current = new Controller(); /** * The bind function will create gesture recognizers and return the right * bind object depending on whether `domTarget` was specified in the config object. */ var bind = function bind() { current.resetBindings(); for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } for (var _iterator = _createForOfIteratorHelperLoose(classes), _step; !(_step = _iterator()).done;) { var RecognizerClass = _step.value; new RecognizerClass(current, args).addBindings(); } // we also add event bindings for native handlers if (controller.nativeRefs) { for (var eventName in controller.nativeRefs) { current.addBindings(eventName, // @ts-ignore we're cheating when it comes to event type :( controller.nativeRefs[eventName]); } } return current.getBind(); }; return { nativeRefs: nativeHandlers, current: current, bind: bind }; }, []); // We reassign the config and handlers to the controller on every render. controller.current.config = config; controller.current.handlers = handlers; // We assign nativeHandlers, otherwise they won't be refreshed on the next render. controller.nativeRefs = nativeHandlers; // Run controller clean functions on unmount. external_this_React_default.a.useEffect(function () { return controller.current.clean; }, []); return controller.bind; } /** * @private * Recognizer abstract class. * * @protected * @abstract * @type {StateKey} whether the Recognizer should deal with coordinates or distance / angle */ var Recognizer = /*#__PURE__*/function () { /** * Creates an instance of a gesture recognizer. * @param stateKey drag, move, pinch, etc. * @param controller the controller attached to the gesture * @param [args] the args that should be passed to the gesture handler */ function Recognizer(stateKey, controller, args) { var _this = this; if (args === void 0) { args = []; } this.stateKey = stateKey; this.controller = controller; this.args = args; this.debounced = true; // Convenience method to set a timeout for a given gesture this.setTimeout = function (callback, ms) { var _window; if (ms === void 0) { ms = 140; } for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { args[_key - 2] = arguments[_key]; } _this.controller.timeouts[_this.stateKey] = (_window = window).setTimeout.apply(_window, [callback, ms].concat(args)); }; // Convenience method to clear a timeout for a given gesture this.clearTimeout = function () { clearTimeout(_this.controller.timeouts[_this.stateKey]); }; // Convenience method to add window listeners for a given gesture this.addWindowListeners = function (listeners) { _this.controller.addWindowListeners(_this.stateKey, listeners); }; // Convenience method to remove window listeners for a given gesture this.removeWindowListeners = function () { _this.controller.removeWindowListeners(_this.stateKey); }; /** * Returns the reinitialized start state for the gesture. * Should be common to all gestures. * * @param {Vector2} values * @param {UseGestureEvent} event * @returns - the start state for the gesture */ this.getStartGestureState = function (values, event) { return _extends(_extends({}, getInitialState()[_this.stateKey]), {}, { _active: true, values: values, initial: values, offset: _this.state.offset, lastOffset: _this.state.offset, startTime: event.timeStamp }); }; // Runs rubberband on a vector this.rubberband = function (vector, rubberband) { var bounds = _this.config.bounds; /** * [x, y]: [rubberband(x, min, max), rubberband(y, min, max)] */ return vector.map(function (v, i) { return rubberbandIfOutOfBounds(v, bounds[i][0], bounds[i][1], rubberband[i]); }); }; /** * Fires the gesture handler * * @param {boolean} [forceFlag] - if true, then the handler will fire even if the gesture is not intentional */ this.fireGestureHandler = function (forceFlag) { /** * If the gesture has been blocked (this can happen when the gesture has started in an unwanted direction), * clean everything and don't do anything. */ if (_this.state._blocked) { // we need debounced gestures to end by themselves if (!_this.debounced) { _this.state._active = false; _this.clean(); } return null; } // If the gesture has no intentional dimension, don't do fire the handler. var _this$state$_intentio = _this.state._intentional, intentionalX = _this$state$_intentio[0], intentionalY = _this$state$_intentio[1]; if (!forceFlag && intentionalX === false && intentionalY === false) return null; var _this$state = _this.state, _active = _this$state._active, active = _this$state.active; _this.state.active = _active; _this.state.first = _active && !active; // `first` is true when the gesture becomes active _this.state.last = active && !_active; // `last` is true when the gesture becomes inactive _this.controller.state.shared[_this.ingKey] = _active; // Sets dragging, pinching, etc. to the gesture active state var state = _extends(_extends(_extends({}, _this.controller.state.shared), _this.state), _this.mapStateValues(_this.state)); // @ts-ignore var newMemo = _this.handler(state); // Sets memo to the returned value of the handler (unless it's not undefined) _this.state.memo = newMemo !== void 0 ? newMemo : _this.state.memo; // Cleans the gesture when the gesture is no longer active. if (!_active) _this.clean(); return state; }; } // Returns the gesture config var _proto = Recognizer.prototype; // Conveninence method to update the shared state _proto.updateSharedState = function updateSharedState(sharedState) { Object.assign(this.controller.state.shared, sharedState); } // Conveninence method to update the gesture state ; _proto.updateGestureState = function updateGestureState(gestureState) { Object.assign(this.state, gestureState); } /** * Returns a generic, common payload for all gestures from an event. * * @param {UseGestureEvent} event * @param {boolean} [isStartEvent] * @returns - the generic gesture payload */ ; _proto.getGenericPayload = function getGenericPayload(event, isStartEvent) { var timeStamp = event.timeStamp, type = event.type; var _this$state2 = this.state, values = _this$state2.values, startTime = _this$state2.startTime; return { _lastEventType: type, event: event, timeStamp: timeStamp, elapsedTime: isStartEvent ? 0 : timeStamp - startTime, args: this.args, previous: values }; } /** * Returns state properties depending on the movement and state. * * Should be overriden for custom behavior, doesn't do anything in the implementation * below. */ ; _proto.checkIntentionality = function checkIntentionality(_intentional, _movement, _state) { return { _intentional: _intentional, _blocked: false }; } /** * Returns basic movement properties for the gesture based on the next values and current state. */ ; _proto.getMovement = function getMovement(values, state) { if (state === void 0) { state = this.state; } var _this$config = this.config, initial = _this$config.initial, threshold = _this$config.threshold, rubberband = _this$config.rubberband; var t0 = threshold[0], t1 = threshold[1]; var _state2 = state, _initial = _state2._initial, _active = _state2._active, intentional = _state2._intentional, lastOffset = _state2.lastOffset, prevMovement = _state2.movement; var i0 = intentional[0], i1 = intentional[1]; var _this$getInternalMove = this.getInternalMovement(values, state), _m0 = _this$getInternalMove[0], _m1 = _this$getInternalMove[1]; /** * For both dimensions of the gesture, check its intentionality on each frame. */ if (i0 === false) { i0 = getIntentionalDisplacement(_m0, t0); } if (i1 === false) { i1 = getIntentionalDisplacement(_m1, t1); } // Get gesture specific state properties based on intentionality and movement. var intentionalityCheck = this.checkIntentionality([i0, i1], [_m0, _m1], state); var _intentional = intentionalityCheck._intentional, _blocked = intentionalityCheck._blocked; var _i0 = _intentional[0], _i1 = _intentional[1]; var _movement = [_m0, _m1]; if (_i0 !== false && intentional[0] === false) _initial[0] = valueFn(initial)[0]; if (_i1 !== false && intentional[1] === false) _initial[1] = valueFn(initial)[1]; /** * If the gesture has been blocked (from gesture specific checkIntentionality), * stop right there. */ if (_blocked) return _extends(_extends({}, intentionalityCheck), {}, { _movement: _movement, delta: [0, 0] }); /** * The movement sent to the handler has 0 in its dimensions when intentionality is false. * It is calculated from the actual movement minus the threshold. */ var movement = [_i0 !== false ? _m0 - _i0 : valueFn(initial)[0], _i1 !== false ? _m1 - _i1 : valueFn(initial)[1]]; var offset = addV(movement, lastOffset); /** * Rubberband should be 0 when the gesture is no longer active, so that movement * and offset can return within their bounds. */ var _rubberband = _active ? rubberband : [0, 0]; movement = this.rubberband(addV(movement, _initial), _rubberband); // rubberbanded movement return _extends(_extends({}, intentionalityCheck), {}, { _initial: _initial, _movement: _movement, movement: movement, offset: this.rubberband(offset, _rubberband), delta: subV(movement, prevMovement) }); } // Cleans the gesture. Can be overriden by gestures. ; _proto.clean = function clean() { this.clearTimeout(); this.removeWindowListeners(); }; _createClass(Recognizer, [{ key: "config", get: function get() { return this.controller.config[this.stateKey]; } // Is the gesture enabled }, { key: "enabled", get: function get() { return this.controller.config.enabled && this.config.enabled; } // Returns the controller state for a given gesture }, { key: "state", get: function get() { return this.controller.state[this.stateKey]; } // Returns the gesture handler }, { key: "handler", get: function get() { return this.controller.handlers[this.stateKey]; } }]); return Recognizer; }(); /** * @private * Abstract class for coordinates-based gesture recongizers * @abstract * @class CoordinatesRecognizer * @extends {Recognizer} * @template T */ var CoordinatesRecognizer = /*#__PURE__*/function (_Recognizer) { react_use_gesture_esm_inheritsLoose(CoordinatesRecognizer, _Recognizer); function CoordinatesRecognizer() { return _Recognizer.apply(this, arguments) || this; } var _proto = CoordinatesRecognizer.prototype; /** * Returns the real movement (without taking intentionality into acount) */ _proto.getInternalMovement = function getInternalMovement(values, state) { return subV(values, state.initial); } /** * In coordinates-based gesture, this function will detect the first intentional axis, * lock the gesture axis if lockDirection is specified in the config, block the gesture * if the first intentional axis doesn't match the specified axis in config. * * @param {[FalseOrNumber, FalseOrNumber]} _intentional * @param {Vector2} _movement * @param {PartialGestureState} state */ ; _proto.checkIntentionality = function checkIntentionality(_intentional, _movement, state) { var _intentional2 = _intentional, _ix = _intentional2[0], _iy = _intentional2[1]; var intentionalMovement = _ix !== false || _iy !== false; var axis = state.axis; var _blocked = false; // If the movement is intentional, we can compute axis. if (intentionalMovement) { var _movement$map = _movement.map(Math.abs), absX = _movement$map[0], absY = _movement$map[1]; var _this$config = this.config, configAxis = _this$config.axis, lockDirection = _this$config.lockDirection; // We make sure we only set axis value if it hadn't been detected before. axis = axis || (absX > absY ? 'x' : absX < absY ? 'y' : undefined); if (!!configAxis || lockDirection) { if (!!axis) { // If the detected axis doesn't match the config axis we block the gesture if (!!configAxis && axis !== configAxis) _blocked = true;else { // Otherwise we prevent the gesture from updating the unwanted axis. var lockedIndex = axis === 'x' ? 1 : 0; _intentional[lockedIndex] = false; } } else { // Until we've detected the axis, we prevent the hnadler from updating. _intentional = [false, false]; } } } return { _intentional: _intentional, _blocked: _blocked, axis: axis }; }; _proto.getKinematics = function getKinematics(values, event) { var timeStamp = this.state.timeStamp; var movementDetection = this.getMovement(values, this.state); var _blocked = movementDetection._blocked, delta = movementDetection.delta, movement = movementDetection.movement; if (_blocked) return movementDetection; var delta_t = event.timeStamp - timeStamp; var kinematics = calculateAllKinematics(movement, delta, delta_t); return _extends(_extends({ values: values, delta: delta }, movementDetection), kinematics); }; _proto.mapStateValues = function mapStateValues(state) { return { xy: state.values, vxvy: state.velocities }; }; return CoordinatesRecognizer; }(Recognizer); var TAP_DISTANCE_THRESHOLD = 3; var SWIPE_MAX_ELAPSED_TIME = 220; var FILTER_REPEATED_EVENTS_DELAY = 200; var DragRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { react_use_gesture_esm_inheritsLoose(DragRecognizer, _CoordinatesRecognize); function DragRecognizer(controller, args) { var _this; _this = _CoordinatesRecognize.call(this, 'drag', controller, args) || this; _this.ingKey = 'dragging'; _this.wasTouch = false; _this.isEventTypeTouch = function (type) { return !!type && type.indexOf('touch') === 0; }; _this.dragShouldStart = function (event) { var _getGenericEventData = getGenericEventData(event), touches = _getGenericEventData.touches; var _lastEventType = _this.state._lastEventType; /** * This tries to filter out mouse events triggered by touch screens * */ // If the previous gesture was touch-based, and the current one is mouse based, // this means that we might be dealing with mouse simulated events if they're close to // each other. We're only doing this check when we're not using pointer events. if (!_this.controller.config.pointer && _this.isEventTypeTouch(_lastEventType) && !_this.isEventTypeTouch(event.type)) { var delay = Math.abs(event.timeStamp - _this.state.startTime); if (delay < FILTER_REPEATED_EVENTS_DELAY) return false; } return _this.enabled && touches < 2; }; _this.setPointers = function (event) { var currentTarget = event.currentTarget, pointerId = event.pointerId; if (currentTarget) currentTarget.setPointerCapture(pointerId); _this.updateGestureState({ currentTarget: currentTarget, pointerId: pointerId }); }; _this.removePointers = function () { var _this$state = _this.state, currentTarget = _this$state.currentTarget, pointerId = _this$state.pointerId; if (currentTarget && pointerId) currentTarget.releasePointerCapture(pointerId); }; _this.setListeners = function (isTouch) { _this.removeWindowListeners(); var dragListeners = isTouch ? [['touchmove', _this.onDragChange], ['touchend', _this.onDragEnd], ['touchcancel', _this.onDragEnd]] : [['mousemove', _this.onDragChange], ['mouseup', _this.onDragEnd]]; _this.addWindowListeners(dragListeners); }; _this.onDragStart = function (event) { if (!_this.dragShouldStart(event)) return; // if pointers events if (_this.controller.config.pointer) _this.setPointers(event);else _this.setListeners(_this.isEventTypeTouch(event.type)); if (_this.config.delay > 0) { _this.state._delayedEvent = true; if (typeof event.persist === 'function') event.persist(); _this.setTimeout(function () { return _this.startDrag(event); }, _this.config.delay); } else { _this.startDrag(event); } }; _this.onDragChange = function (event) { var canceled = _this.state.canceled; if (canceled) return; if (!_this.state._active) { if (_this.state._delayedEvent) { _this.clearTimeout(); _this.startDrag(event); } return; } var genericEventData = getGenericEventData(event); if (!genericEventData.down) { _this.onDragEnd(event); return; } _this.updateSharedState(genericEventData); var _getPointerEventValue = getPointerEventValues(event), values = _getPointerEventValue.values; var kinematics = _this.getKinematics(values, event); var _isTap = _this.state._isTap; if (_isTap && calculateDistance(kinematics._movement) >= TAP_DISTANCE_THRESHOLD) _isTap = false; _this.updateGestureState(_extends(_extends(_extends({}, _this.getGenericPayload(event)), kinematics), {}, { _isTap: _isTap, cancel: function cancel() { return _this.onCancel(); } })); _this.fireGestureHandler(); }; _this.onDragEnd = function (event) { _this.state._active = false; _this.updateSharedState({ down: false, buttons: 0, touches: 0 }); var _this$state2 = _this.state, _isTap = _this$state2._isTap, values = _this$state2.values, _this$state2$velociti = _this$state2.velocities, vx = _this$state2$velociti[0], vy = _this$state2$velociti[1], _this$state2$movement = _this$state2.movement, mx = _this$state2$movement[0], my = _this$state2$movement[1], _this$state2$_intenti = _this$state2._intentional, ix = _this$state2$_intenti[0], iy = _this$state2$_intenti[1]; var endState = _extends(_extends({}, _this.getGenericPayload(event)), _this.getMovement(values)); var elapsedTime = endState.elapsedTime; var _this$config = _this.config, _this$config$swipeVel = _this$config.swipeVelocity, svx = _this$config$swipeVel[0], svy = _this$config$swipeVel[1], _this$config$swipeDis = _this$config.swipeDistance, sx = _this$config$swipeDis[0], sy = _this$config$swipeDis[1]; var swipe = [0, 0]; if (elapsedTime < SWIPE_MAX_ELAPSED_TIME) { if (ix !== false && Math.abs(vx) > svx && Math.abs(mx) > sx) swipe[0] = sign(vx); if (iy !== false && Math.abs(vy) > svy && Math.abs(my) > sy) swipe[1] = sign(vy); } _this.updateGestureState(_extends(_extends({ event: event }, endState), {}, { tap: _isTap, swipe: swipe })); _this.fireGestureHandler(_this.config.filterTaps && _this.state._isTap); }; _this.clean = function () { _CoordinatesRecognize.prototype.clean.call(_assertThisInitialized(_this)); _this.state._delayedEvent = false; if (_this.controller.config.pointer) _this.removePointers(); }; _this.onCancel = function () { _this.updateGestureState({ canceled: true, cancel: noop }); _this.state._active = false; _this.updateSharedState({ down: false, buttons: 0, touches: 0 }); requestAnimationFrame(function () { return _this.fireGestureHandler(); }); }; return _this; } var _proto = DragRecognizer.prototype; _proto.startDrag = function startDrag(event) { var _this2 = this; var _getPointerEventValue2 = getPointerEventValues(event), values = _getPointerEventValue2.values; this.updateSharedState(getGenericEventData(event)); var startState = _extends(_extends({}, this.getStartGestureState(values, event)), this.getGenericPayload(event, true)); this.updateGestureState(_extends(_extends(_extends({}, startState), this.getMovement(values, startState)), {}, { cancel: function cancel() { return _this2.onCancel(); } })); this.fireGestureHandler(); }; _proto.addBindings = function addBindings() { if (this.controller.config.pointer) { this.controller.addBindings('onPointerDown', this.onDragStart); this.controller.addBindings('onPointerMove', this.onDragChange); this.controller.addBindings(['onPointerUp', 'onPointerCancel'], this.onDragEnd); } else { this.controller.addBindings(['onTouchStart', 'onMouseDown'], this.onDragStart); } }; return DragRecognizer; }(CoordinatesRecognizer); var DEFAULT_DRAG_DELAY = 180; var DEFAULT_RUBBERBAND = 0.15; var DEFAULT_SWIPE_VELOCITY = 0.5; var DEFAULT_SWIPE_DISTANCE = 60; var defaultWindow = typeof window !== 'undefined' ? window : undefined; var defaultCoordinatesOptions = { lockDirection: false, axis: undefined, bounds: undefined }; /** * @private * * Returns the internal generic option object. * * @param {Partial} [config={}] * @returns {InternalGenericOptions} */ function getInternalGenericOptions(config) { if (config === void 0) { config = {}; } var _config = config, _config$eventOptions = _config.eventOptions; _config$eventOptions = _config$eventOptions === void 0 ? {} : _config$eventOptions; var _config$eventOptions$ = _config$eventOptions.passive, passive = _config$eventOptions$ === void 0 ? true : _config$eventOptions$, _config$eventOptions$2 = _config$eventOptions.capture, capture = _config$eventOptions$2 === void 0 ? false : _config$eventOptions$2, _config$eventOptions$3 = _config$eventOptions.pointer, pointer = _config$eventOptions$3 === void 0 ? false : _config$eventOptions$3, _config$window = _config.window, window = _config$window === void 0 ? defaultWindow : _config$window, _config$domTarget = _config.domTarget, domTarget = _config$domTarget === void 0 ? undefined : _config$domTarget, _config$enabled = _config.enabled, enabled = _config$enabled === void 0 ? true : _config$enabled, restConfig = _objectWithoutPropertiesLoose(_config, ["eventOptions", "window", "domTarget", "enabled"]); return _extends(_extends({}, restConfig), {}, { enabled: enabled, domTarget: domTarget, window: window, // passive is always true if there's no domTarget eventOptions: { passive: !domTarget || !!passive, capture: !!capture }, captureString: capture ? 'Capture' : '', pointer: !!pointer }); } function getInternalGestureOptions(gestureConfig) { var _gestureConfig$thresh = gestureConfig.threshold, threshold = _gestureConfig$thresh === void 0 ? undefined : _gestureConfig$thresh, _gestureConfig$rubber = gestureConfig.rubberband, rubberband = _gestureConfig$rubber === void 0 ? 0 : _gestureConfig$rubber, _gestureConfig$enable = gestureConfig.enabled, enabled = _gestureConfig$enable === void 0 ? true : _gestureConfig$enable, _gestureConfig$initia = gestureConfig.initial, initial = _gestureConfig$initia === void 0 ? [0, 0] : _gestureConfig$initia; if (typeof rubberband === 'boolean') rubberband = rubberband ? DEFAULT_RUBBERBAND : 0; if (threshold === void 0) threshold = 0; return { enabled: enabled, initial: initial, threshold: def.array(threshold), rubberband: def.array(rubberband) }; } function getInternalCoordinatesOptions(coordinatesConfig) { if (coordinatesConfig === void 0) { coordinatesConfig = {}; } var _coordinatesConfig = coordinatesConfig, axis = _coordinatesConfig.axis, lockDirection = _coordinatesConfig.lockDirection, _coordinatesConfig$bo = _coordinatesConfig.bounds, bounds = _coordinatesConfig$bo === void 0 ? {} : _coordinatesConfig$bo, internalOptions = _objectWithoutPropertiesLoose(_coordinatesConfig, ["axis", "lockDirection", "bounds"]); var boundsArray = [[def.withDefault(bounds.left, -Infinity), def.withDefault(bounds.right, Infinity)], [def.withDefault(bounds.top, -Infinity), def.withDefault(bounds.bottom, Infinity)]]; return _extends(_extends(_extends(_extends({}, getInternalGestureOptions(internalOptions)), defaultCoordinatesOptions), matchKeysFromObject({ axis: axis, lockDirection: lockDirection }, coordinatesConfig)), {}, { bounds: boundsArray }); } function getInternalDistanceAngleOptions(distanceAngleConfig) { if (distanceAngleConfig === void 0) { distanceAngleConfig = {}; } var _distanceAngleConfig = distanceAngleConfig, _distanceAngleConfig$ = _distanceAngleConfig.distanceBounds, distanceBounds = _distanceAngleConfig$ === void 0 ? {} : _distanceAngleConfig$, _distanceAngleConfig$2 = _distanceAngleConfig.angleBounds, angleBounds = _distanceAngleConfig$2 === void 0 ? {} : _distanceAngleConfig$2, internalOptions = _objectWithoutPropertiesLoose(_distanceAngleConfig, ["distanceBounds", "angleBounds"]); var boundsArray = [[def.withDefault(distanceBounds.min, -Infinity), def.withDefault(distanceBounds.max, Infinity)], [def.withDefault(angleBounds.min, -Infinity), def.withDefault(angleBounds.max, Infinity)]]; return _extends(_extends({}, getInternalGestureOptions(internalOptions)), {}, { bounds: boundsArray }); } function getInternalDragOptions(dragConfig) { if (dragConfig === void 0) { dragConfig = {}; } var _dragConfig = dragConfig, enabled = _dragConfig.enabled, threshold = _dragConfig.threshold, bounds = _dragConfig.bounds, rubberband = _dragConfig.rubberband, initial = _dragConfig.initial, dragOptions = _objectWithoutPropertiesLoose(_dragConfig, ["enabled", "threshold", "bounds", "rubberband", "initial"]); var _dragOptions$swipeVel = dragOptions.swipeVelocity, swipeVelocity = _dragOptions$swipeVel === void 0 ? DEFAULT_SWIPE_VELOCITY : _dragOptions$swipeVel, _dragOptions$swipeDis = dragOptions.swipeDistance, swipeDistance = _dragOptions$swipeDis === void 0 ? DEFAULT_SWIPE_DISTANCE : _dragOptions$swipeDis, _dragOptions$delay = dragOptions.delay, delay = _dragOptions$delay === void 0 ? false : _dragOptions$delay, _dragOptions$filterTa = dragOptions.filterTaps, filterTaps = _dragOptions$filterTa === void 0 ? false : _dragOptions$filterTa, axis = dragOptions.axis, lockDirection = dragOptions.lockDirection; if (threshold === void 0) { threshold = Math.max(0, filterTaps ? 3 : 0, lockDirection || axis ? 1 : 0); } else { filterTaps = true; } var internalCoordinatesOptions = getInternalCoordinatesOptions(matchKeysFromObject({ enabled: enabled, threshold: threshold, bounds: bounds, rubberband: rubberband, axis: axis, lockDirection: lockDirection, initial: initial }, dragConfig)); return _extends(_extends({}, internalCoordinatesOptions), {}, { filterTaps: filterTaps || internalCoordinatesOptions.threshold[0] + internalCoordinatesOptions.threshold[1] > 0, swipeVelocity: def.array(swipeVelocity), swipeDistance: def.array(swipeDistance), delay: typeof delay === 'number' ? delay : delay ? DEFAULT_DRAG_DELAY : 0 }); } /** * @public * * Drag hook. * * @param {Handler<'drag'>} handler - the function fired every time the drag gesture updates * @param {(Config | {})} [config={}] - the config object including generic options and drag options * @returns {(...args: any[]) => HookReturnType} */ function useDrag(handler, config) { if (config === void 0) { config = {}; } var _config = config, domTarget = _config.domTarget, eventOptions = _config.eventOptions, window = _config.window, drag = _objectWithoutPropertiesLoose(_config, ["domTarget", "eventOptions", "window"]); /** * TODO: at the moment we recompute the config object at every render * this could probably be optimized */ var mergedConfig = _extends(_extends({}, getInternalGenericOptions({ domTarget: domTarget, eventOptions: eventOptions, window: window })), {}, { drag: getInternalDragOptions(drag) }); return useRecognizers({ drag: handler }, [DragRecognizer], mergedConfig); } /** * @private * Abstract class for distance/angle-based gesture recongizers * @abstract * @class DistanceAngleRecognizer * @extends {Recognizer} * @template T */ var DistanceAngleRecognizer = /*#__PURE__*/function (_Recognizer) { react_use_gesture_esm_inheritsLoose(DistanceAngleRecognizer, _Recognizer); function DistanceAngleRecognizer() { return _Recognizer.apply(this, arguments) || this; } var _proto = DistanceAngleRecognizer.prototype; /** * Returns the real movement (without taking intentionality into acount) */ _proto.getInternalMovement = function getInternalMovement(_ref, state) { var d = _ref[0], a = _ref[1]; var da = state.values, turns = state.turns, initial = state.initial; // angle might not be defined when ctrl wheel is used for zoom only // in that case we set it to the previous angle value a = a !== void 0 ? a : da[1]; var delta_a = a - da[1]; /** * The angle value might jump from 179deg to -179deg when we actually want to * read 181deg to ensure continuity. To make that happen, we detect when the jump * is supsiciously high (ie > 270deg) and increase the `turns` value */ var newTurns = Math.abs(delta_a) > 270 ? turns + sign(delta_a) : turns; // we update the angle difference to its corrected value var movement_d = d - initial[0]; var movement_a = a - 360 * newTurns - initial[1]; return [movement_d, movement_a]; }; _proto.getKinematics = function getKinematics(values, event) { var _this$state = this.state, timeStamp = _this$state.timeStamp, initial = _this$state.initial; var movementDetection = this.getMovement(values, this.state); var delta = movementDetection.delta, movement = movementDetection.movement; var turns = (values[1] - movement[1] - initial[1]) / 360; var delta_t = event.timeStamp - timeStamp; var kinematics = calculateAllKinematics(movement, delta, delta_t); return _extends(_extends({ values: values, delta: delta, turns: turns }, movementDetection), kinematics); }; _proto.mapStateValues = function mapStateValues(state) { return { da: state.values, vdva: state.velocities }; }; return DistanceAngleRecognizer; }(Recognizer); var PinchRecognizer = /*#__PURE__*/function (_DistanceAngleRecogni) { react_use_gesture_esm_inheritsLoose(PinchRecognizer, _DistanceAngleRecogni); function PinchRecognizer(controller, args) { var _this; _this = _DistanceAngleRecogni.call(this, 'pinch', controller, args) || this; _this.ingKey = 'pinching'; _this.pinchShouldStart = function (event) { var _getGenericEventData = getGenericEventData(event), touches = _getGenericEventData.touches; return _this.enabled && touches === 2; }; _this.onPinchStart = function (event) { if (!_this.pinchShouldStart(event)) return; var _getTwoTouchesEventDa = getTwoTouchesEventData(event), values = _getTwoTouchesEventDa.values, origin = _getTwoTouchesEventDa.origin; _this.updateSharedState(getGenericEventData(event)); var startState = _extends(_extends({}, _this.getStartGestureState(values, event)), _this.getGenericPayload(event, true)); _this.updateGestureState(_extends(_extends(_extends({}, startState), _this.getMovement(values, startState)), {}, { origin: origin, cancel: function cancel() { return _this.onCancel(); } })); _this.fireGestureHandler(); }; _this.onPinchChange = function (event) { var _this$state = _this.state, canceled = _this$state.canceled, timeStamp = _this$state.timeStamp, _active = _this$state._active; if (canceled || !_active) return; var genericEventData = getGenericEventData(event); if (genericEventData.touches !== 2 || event.timeStamp === timeStamp) return; _this.updateSharedState(genericEventData); var _getTwoTouchesEventDa2 = getTwoTouchesEventData(event), values = _getTwoTouchesEventDa2.values, origin = _getTwoTouchesEventDa2.origin; var kinematics = _this.getKinematics(values, event); _this.updateGestureState(_extends(_extends(_extends({}, _this.getGenericPayload(event)), kinematics), {}, { origin: origin, cancel: function cancel() { return _this.onCancel(); } })); _this.fireGestureHandler(); }; _this.onPinchEnd = function (event) { if (!_this.state.active) return; _this.state._active = false; _this.updateSharedState({ down: false, touches: 0 }); _this.updateGestureState(_extends(_extends({ event: event }, _this.getGenericPayload(event)), _this.getMovement(_this.state.values))); _this.fireGestureHandler(); }; _this.onCancel = function () { _this.state._active = false; _this.updateGestureState({ canceled: true, cancel: noop }); _this.updateSharedState({ down: false, touches: 0 }); requestAnimationFrame(function () { return _this.fireGestureHandler(); }); }; /** * PINCH WITH WEBKIT GESTURES */ _this.onGestureStart = function (event) { if (!_this.enabled) return; event.preventDefault(); var _getWebkitGestureEven = getWebkitGestureEventValues(event), values = _getWebkitGestureEven.values; _this.updateSharedState(getGenericEventData(event)); var startState = _extends(_extends({}, _this.getStartGestureState(values, event)), _this.getGenericPayload(event, true)); _this.updateGestureState(_extends(_extends(_extends({}, startState), _this.getMovement(values, startState)), {}, { cancel: function cancel() { return _this.onCancel(); } })); _this.fireGestureHandler(); }; _this.onGestureChange = function (event) { var _this$state2 = _this.state, canceled = _this$state2.canceled, _active = _this$state2._active; if (canceled || !_active) return; event.preventDefault(); var genericEventData = getGenericEventData(event); _this.updateSharedState(genericEventData); var _getWebkitGestureEven2 = getWebkitGestureEventValues(event), values = _getWebkitGestureEven2.values; var kinematics = _this.getKinematics(values, event); _this.updateGestureState(_extends(_extends(_extends({}, _this.getGenericPayload(event)), kinematics), {}, { cancel: function cancel() { return _this.onCancel(); } })); _this.fireGestureHandler(); }; _this.onGestureEnd = function (event) { event.preventDefault(); if (!_this.state.active) return; _this.state._active = false; _this.updateSharedState({ down: false, touches: 0 }); _this.updateGestureState(_extends(_extends({ event: event }, _this.getGenericPayload(event)), _this.getMovement(_this.state.values))); _this.fireGestureHandler(); }; _this.updateTouchData = function (event) { if (!_this.enabled || event.touches.length !== 2 || !_this.state._active) return; var _getTwoTouchesEventDa3 = getTwoTouchesEventData(event), origin = _getTwoTouchesEventDa3.origin; _this.state.origin = origin; }; /** * PINCH WITH WHEEL */ _this.wheelShouldRun = function (event) { return _this.enabled && event.ctrlKey; }; _this.getWheelValuesFromEvent = function (event) { var _getWheelEventValues = getWheelEventValues(event), _getWheelEventValues$ = _getWheelEventValues.values, delta_d = _getWheelEventValues$[1]; var _this$state$values = _this.state.values, prev_d = _this$state$values[0], prev_a = _this$state$values[1]; var d = prev_d - delta_d; var a = prev_a !== void 0 ? prev_a : 0; return { values: [d, a], origin: [event.clientX, event.clientY], delta: [0, delta_d] }; }; _this.onWheel = function (event) { if (!_this.wheelShouldRun(event)) return; _this.clearTimeout(); _this.setTimeout(_this.onWheelEnd); if (!_this.state._active) _this.onWheelStart(event);else _this.onWheelChange(event); }; _this.onWheelStart = function (event) { var _this$getWheelValuesF = _this.getWheelValuesFromEvent(event), values = _this$getWheelValuesF.values, delta = _this$getWheelValuesF.delta, origin = _this$getWheelValuesF.origin; if (!_this.controller.config.eventOptions.passive) { event.preventDefault(); } else if (false) {} _this.updateSharedState(getGenericEventData(event)); var startState = _extends(_extends(_extends({}, _this.getStartGestureState(values, event)), _this.getGenericPayload(event, true)), {}, { initial: _this.state.values }); _this.updateGestureState(_extends(_extends(_extends({}, startState), _this.getMovement(values, startState)), {}, { offset: values, delta: delta, origin: origin })); _this.fireGestureHandler(); }; _this.onWheelChange = function (event) { var genericEventData = getGenericEventData(event); _this.updateSharedState(genericEventData); var _this$getWheelValuesF2 = _this.getWheelValuesFromEvent(event), values = _this$getWheelValuesF2.values, origin = _this$getWheelValuesF2.origin, delta = _this$getWheelValuesF2.delta; var kinematics = _this.getKinematics(values, event); _this.updateGestureState(_extends(_extends(_extends({}, _this.getGenericPayload(event)), kinematics), {}, { origin: origin, delta: delta })); _this.fireGestureHandler(); }; _this.onWheelEnd = function () { _this.state._active = false; _this.updateGestureState(_this.getMovement(_this.state.values)); _this.fireGestureHandler(); }; return _this; } var _proto = PinchRecognizer.prototype; _proto.addBindings = function addBindings() { // Only try to use gesture events when they are supported and domTarget is set // as React doesn't support gesture handlers. if (this.controller.config.domTarget && supportsGestureEvents()) { this.controller.addBindings('onGestureStart', this.onGestureStart); this.controller.addBindings('onGestureChange', this.onGestureChange); this.controller.addBindings(['onGestureEnd', 'onTouchCancel'], this.onGestureEnd); this.controller.addBindings(['onTouchStart', 'onTouchMove'], this.updateTouchData); } else { this.controller.addBindings('onTouchStart', this.onPinchStart); this.controller.addBindings('onTouchMove', this.onPinchChange); this.controller.addBindings(['onTouchEnd', 'onTouchCancel'], this.onPinchEnd); this.controller.addBindings('onWheel', this.onWheel); } }; return PinchRecognizer; }(DistanceAngleRecognizer); /** * @public * * Pinch hook. * * @param {Handler<'pinch'>} handler - the function fired every time the pinch gesture updates * @param {(Config | {})} [config={}] - the config object including generic options and pinch options * @returns {(...args: any[]) => HookReturnType} */ function usePinch(handler, config) { if (config === void 0) { config = {}; } var _config = config, domTarget = _config.domTarget, eventOptions = _config.eventOptions, window = _config.window, pinch = _objectWithoutPropertiesLoose(_config, ["domTarget", "eventOptions", "window"]); /** * TODO: at the moment we recompute the config object at every render * this could probably be optimized */ var mergedConfig = _extends(_extends({}, getInternalGenericOptions({ domTarget: domTarget, eventOptions: eventOptions, window: window })), {}, { pinch: getInternalDistanceAngleOptions(pinch) }); return useRecognizers({ pinch: handler }, [PinchRecognizer], mergedConfig); } var WheelRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { react_use_gesture_esm_inheritsLoose(WheelRecognizer, _CoordinatesRecognize); function WheelRecognizer(controller, args) { var _this; _this = _CoordinatesRecognize.call(this, 'wheel', controller, args) || this; _this.ingKey = 'wheeling'; _this.debounced = true; _this.wheelShouldRun = function (event) { if (event.ctrlKey && 'pinch' in _this.controller.handlers) return false; return _this.enabled; }; _this.getValuesFromEvent = function (event) { var prevValues = _this.state.values; var _getWheelEventValues = getWheelEventValues(event), values = _getWheelEventValues.values; return { values: addV(values, prevValues) }; }; _this.onWheel = function (event) { if (!_this.wheelShouldRun(event)) return; _this.clearTimeout(); _this.setTimeout(_this.onWheelEnd); if (!_this.state._active) _this.onWheelStart(event);else _this.onWheelChange(event); }; _this.onWheelStart = function (event) { var _this$getValuesFromEv = _this.getValuesFromEvent(event), values = _this$getValuesFromEv.values; _this.updateSharedState(getGenericEventData(event)); var startState = _extends(_extends(_extends({}, _this.getStartGestureState(values, event)), _this.getGenericPayload(event, true)), {}, { initial: _this.state.values }); var movementDetection = _this.getMovement(values, startState); var delta = movementDetection.delta; _this.updateGestureState(_extends(_extends(_extends({}, startState), movementDetection), {}, { distance: calculateDistance(delta), direction: calculateDirection(delta) })); _this.fireGestureHandler(); }; _this.onWheelChange = function (event) { var genericEventData = getGenericEventData(event); _this.updateSharedState(genericEventData); var _this$getValuesFromEv2 = _this.getValuesFromEvent(event), values = _this$getValuesFromEv2.values; var kinematics = _this.getKinematics(values, event); _this.updateGestureState(_extends(_extends({}, _this.getGenericPayload(event)), kinematics)); _this.fireGestureHandler(); }; _this.onWheelEnd = function () { _this.state._active = false; _this.updateGestureState(_extends(_extends({}, _this.getMovement(_this.state.values)), {}, { velocities: [0, 0], velocity: 0 })); _this.fireGestureHandler(); }; return _this; } var _proto = WheelRecognizer.prototype; _proto.addBindings = function addBindings() { this.controller.addBindings('onWheel', this.onWheel); }; return WheelRecognizer; }(CoordinatesRecognizer); /** * @public * * Wheel hook. * * @param {Handler<'wheel'>} handler - the function fired every time the wheel gesture updates * @param {(Config | {})} [config={}] - the config object including generic options and wheel options * @returns {(...args: any[]) => HookReturnType} */ function useWheel(handler, config) { if (config === void 0) { config = {}; } var _config = config, domTarget = _config.domTarget, eventOptions = _config.eventOptions, window = _config.window, wheel = _objectWithoutPropertiesLoose(_config, ["domTarget", "eventOptions", "window"]); /** * TODO: at the moment we recompute the config object at every render * this could probably be optimized */ var mergedConfig = _extends(_extends({}, getInternalGenericOptions({ domTarget: domTarget, eventOptions: eventOptions, window: window })), {}, { wheel: getInternalCoordinatesOptions(wheel) }); return useRecognizers({ wheel: handler }, [WheelRecognizer], mergedConfig); } var MoveRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { react_use_gesture_esm_inheritsLoose(MoveRecognizer, _CoordinatesRecognize); function MoveRecognizer(controller, args) { var _this; _this = _CoordinatesRecognize.call(this, 'move', controller, args) || this; _this.ingKey = 'moving'; _this.debounced = true; _this.moveShouldRun = function () { return _this.enabled; }; _this.onMove = function (event) { if (!_this.moveShouldRun()) return; _this.clearTimeout(); _this.setTimeout(_this.onMoveEnd); if (!_this.state._active) _this.onMoveStart(event);else _this.onMoveChange(event); }; _this.onMoveStart = function (event) { var _getPointerEventValue = getPointerEventValues(event), values = _getPointerEventValue.values; _this.updateSharedState(getGenericEventData(event)); var startState = _extends(_extends({}, _this.getStartGestureState(values, event)), _this.getGenericPayload(event, true)); _this.updateGestureState(_extends(_extends({}, startState), _this.getMovement(values, startState))); _this.fireGestureHandler(); }; _this.onMoveChange = function (event) { var genericEventData = getGenericEventData(event); _this.updateSharedState(genericEventData); var _getPointerEventValue2 = getPointerEventValues(event), values = _getPointerEventValue2.values; var kinematics = _this.getKinematics(values, event); _this.updateGestureState(_extends(_extends({}, _this.getGenericPayload(event)), kinematics)); _this.fireGestureHandler(); }; _this.onMoveEnd = function () { _this.state._active = false; _this.updateGestureState(_extends(_extends({}, _this.getMovement(_this.state.values)), {}, { velocities: [0, 0], velocity: 0 })); _this.fireGestureHandler(); }; _this.onPointerEnter = function (event) { _this.controller.state.shared.hovering = true; if (!_this.controller.config.enabled) return; if (_this.controller.config.hover.enabled) { var _getPointerEventValue3 = getPointerEventValues(event), values = _getPointerEventValue3.values; var state = _extends(_extends(_extends(_extends({}, _this.controller.state.shared), _this.state), _this.getGenericPayload(event, true)), {}, { values: values, active: true, hovering: true }); _this.controller.handlers.hover(_extends(_extends({}, state), _this.mapStateValues(state))); } if ('move' in _this.controller.handlers) _this.onMoveStart(event); }; _this.onPointerLeave = function (event) { _this.controller.state.shared.hovering = false; if ('move' in _this.controller.handlers) _this.onMoveEnd(); if (_this.controller.config.hover.enabled) { var _getPointerEventValue4 = getPointerEventValues(event), values = _getPointerEventValue4.values; var state = _extends(_extends(_extends(_extends({}, _this.controller.state.shared), _this.state), _this.getGenericPayload(event)), {}, { values: values, active: false }); _this.controller.handlers.hover(_extends(_extends({}, state), _this.mapStateValues(state))); } }; return _this; } var _proto = MoveRecognizer.prototype; _proto.addBindings = function addBindings() { if (this.controller.config.pointer) { if ('move' in this.controller.handlers) { this.controller.addBindings('onPointerMove', this.onMove); } if ('hover' in this.controller.handlers) { this.controller.addBindings('onPointerEnter', this.onPointerEnter); this.controller.addBindings('onPointerLeave', this.onPointerLeave); } } else { if ('move' in this.controller.handlers) { this.controller.addBindings('onMouseMove', this.onMove); } if ('hover' in this.controller.handlers) { this.controller.addBindings('onMouseEnter', this.onPointerEnter); this.controller.addBindings('onMouseLeave', this.onPointerLeave); } } }; return MoveRecognizer; }(CoordinatesRecognizer); /** * @public * * Move hook. * * @param {Handler<'move'>} handler - the function fired every time the move gesture updates * @param {(Config | {})} [config={}] - the config object including generic options and move options * @returns {(...args: any[]) => HookReturnType} */ function useMove(handler, config) { if (config === void 0) { config = {}; } var _config = config, domTarget = _config.domTarget, eventOptions = _config.eventOptions, window = _config.window, move = _objectWithoutPropertiesLoose(_config, ["domTarget", "eventOptions", "window"]); /** * TODO: at the moment we recompute the config object at every render * this could probably be optimized */ var mergedConfig = _extends(_extends({}, getInternalGenericOptions({ domTarget: domTarget, eventOptions: eventOptions, window: window })), {}, { move: getInternalCoordinatesOptions(move) }); return useRecognizers({ move: handler }, [MoveRecognizer], mergedConfig); } /** * @public * * Hover hook. * * @param {Handler<'hover'>} handler - the function fired every time the hover gesture updates * @param {(Config | {})} [config={}] - the config object including generic options and hover options * @returns {(...args: any[]) => HookReturnType} */ function useHover(handler, config) { if (config === void 0) { config = {}; } var _config = config, domTarget = _config.domTarget, eventOptions = _config.eventOptions, window = _config.window, hover = _objectWithoutPropertiesLoose(_config, ["domTarget", "eventOptions", "window"]); /** * TODO: at the moment we recompute the config object at every render * this could probably be optimized */ var mergedConfig = _extends(_extends({}, getInternalGenericOptions({ domTarget: domTarget, eventOptions: eventOptions, window: window })), {}, { hover: _extends({ enabled: true }, hover) }); return useRecognizers({ hover: handler }, [MoveRecognizer], mergedConfig); } var ScrollRecognizer = /*#__PURE__*/function (_CoordinatesRecognize) { react_use_gesture_esm_inheritsLoose(ScrollRecognizer, _CoordinatesRecognize); function ScrollRecognizer(controller, args) { var _this; _this = _CoordinatesRecognize.call(this, 'scroll', controller, args) || this; _this.ingKey = 'scrolling'; _this.debounced = true; _this.scrollShouldRun = function () { return _this.enabled; }; _this.onScroll = function (event) { if (!_this.scrollShouldRun()) return; _this.clearTimeout(); _this.setTimeout(_this.onScrollEnd); if (!_this.state._active) _this.onScrollStart(event);else _this.onScrollChange(event); }; _this.onScrollStart = function (event) { var _getScrollEventValues = getScrollEventValues(event), values = _getScrollEventValues.values; _this.updateSharedState(getGenericEventData(event)); var startState = _extends(_extends(_extends({}, _this.getStartGestureState(values, event)), _this.getGenericPayload(event, true)), {}, { initial: _this.state.values }); var movementDetection = _this.getMovement(values, startState); var delta = movementDetection.delta; _this.updateGestureState(_extends(_extends(_extends({}, startState), movementDetection), {}, { distance: calculateDistance(delta), direction: calculateDirection(delta) })); _this.fireGestureHandler(); }; _this.onScrollChange = function (event) { var genericEventData = getGenericEventData(event); _this.updateSharedState(genericEventData); var _getScrollEventValues2 = getScrollEventValues(event), values = _getScrollEventValues2.values; var kinematics = _this.getKinematics(values, event); _this.updateGestureState(_extends(_extends({}, _this.getGenericPayload(event)), kinematics)); _this.fireGestureHandler(); }; _this.onScrollEnd = function () { _this.state._active = false; _this.updateGestureState(_extends(_extends({}, _this.getMovement(_this.state.values)), {}, { velocities: [0, 0], velocity: 0 })); _this.fireGestureHandler(); }; return _this; } var _proto = ScrollRecognizer.prototype; _proto.addBindings = function addBindings() { this.controller.addBindings('onScroll', this.onScroll); }; return ScrollRecognizer; }(CoordinatesRecognizer); /** * @public * * Scroll hook. * * @param {Handler<'scroll'>} handler - the function fired every time the scroll gesture updates * @param {(Config | {})} [config={}] - the config object including generic options and scroll options * @returns {(...args: any[]) => HookReturnType} */ function useScroll(handler, config) { if (config === void 0) { config = {}; } var _config = config, domTarget = _config.domTarget, eventOptions = _config.eventOptions, window = _config.window, scroll = _objectWithoutPropertiesLoose(_config, ["domTarget", "eventOptions", "window"]); /** * TODO: at the moment we recompute the config object at every render * this could probably be optimized */ var mergedConfig = _extends(_extends({}, getInternalGenericOptions({ domTarget: domTarget, eventOptions: eventOptions, window: window })), {}, { scroll: getInternalCoordinatesOptions(scroll) }); return useRecognizers({ scroll: handler }, [ScrollRecognizer], mergedConfig); } /** * @public * * The most complete gesture hook, allowing support for multiple gestures. * * @param {UserHandlersPartial} handlers - an object with on[Gesture] keys containg gesture handlers * @param {UseGestureConfig} [config={}] - the full config object * @returns {(...args: any[]) => HookReturnType} */ function useGesture(handlers, config) { if (config === void 0) { config = {}; } /** * If handlers contains {onDragStart, onDrag, onDragEnd, onMoveStart, onMove} * actions will include 'onDrag' and 'onMove. */ var _React$useState = external_this_React_default.a.useState(function () { return new Set(Object.keys(handlers).map(function (k) { return k.replace(/End|Start/, ''); })); }), actions = _React$useState[0]; /** * Here we compute the derived internal config based on the provided config object. * We decompose the config into its generic and gesture options and compute each. * TODO: this is currently done on every render! */ var _config = config, drag = _config.drag, wheel = _config.wheel, move = _config.move, scroll = _config.scroll, pinch = _config.pinch, hover = _config.hover, restConfig = _objectWithoutPropertiesLoose(_config, ["drag", "wheel", "move", "scroll", "pinch", "hover"]); var mergedConfig = getInternalGenericOptions(restConfig); var classes = []; var internalHandlers = {}; // will hold reference to native handlers such as onClick, onMouseDown, etc. var _nativeHandlers = _extends({}, handlers); if (actions.has('onDrag')) { classes.push(DragRecognizer); internalHandlers.drag = includeStartEndHandlers(handlers, 'onDrag', _nativeHandlers); mergedConfig.drag = getInternalDragOptions(drag); } if (actions.has('onWheel')) { classes.push(WheelRecognizer); internalHandlers.wheel = includeStartEndHandlers(handlers, 'onWheel', _nativeHandlers); mergedConfig.wheel = getInternalCoordinatesOptions(wheel); } if (actions.has('onScroll')) { classes.push(ScrollRecognizer); internalHandlers.scroll = includeStartEndHandlers(handlers, 'onScroll', _nativeHandlers); mergedConfig.scroll = getInternalCoordinatesOptions(scroll); } if (actions.has('onMove')) { classes.push(MoveRecognizer); internalHandlers.move = includeStartEndHandlers(handlers, 'onMove', _nativeHandlers); mergedConfig.move = getInternalCoordinatesOptions(move); } if (actions.has('onPinch')) { classes.push(PinchRecognizer); internalHandlers.pinch = includeStartEndHandlers(handlers, 'onPinch', _nativeHandlers); mergedConfig.pinch = getInternalDistanceAngleOptions(pinch); } if (actions.has('onHover')) { if (!actions.has('onMove')) classes.push(MoveRecognizer); internalHandlers.hover = handlers.onHover; mergedConfig.hover = _extends({ enabled: true }, hover); delete _nativeHandlers.onHover; } return useRecognizers(internalHandlers, classes, mergedConfig, _nativeHandlers); } /** * @private * * This utility function will integrate start and end handlers into the regular * handler function by using first and last conditions. * * @param {UserHandlersPartial} handlers - the handlers function object * @param {HandlerKey} handlerKey - the key for which to integrate start and end handlers * @returns */ function includeStartEndHandlers(handlers, handlerKey, _nativeHandlers) { var startKey = handlerKey + 'Start'; var endKey = handlerKey + 'End'; delete _nativeHandlers[handlerKey]; delete _nativeHandlers[startKey]; delete _nativeHandlers[endKey]; var fn = function fn(state) { var memo = undefined; if (state.first && startKey in handlers) handlers[startKey](state); if (handlerKey in handlers) memo = handlers[handlerKey](state); if (state.last && endKey in handlers) handlers[endKey](state); return memo; }; return fn; } // EXTERNAL MODULE: external {"this":["wp","keycodes"]} var external_this_wp_keycodes_ = __webpack_require__(18); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/utils.js /** * WordPress dependencies */ /** * Gets a CSS cursor value based on a drag direction. * * @param {string} dragDirection The drag direction. * @return {string} The CSS cursor value. */ function getDragCursor(dragDirection) { var dragCursor = 'ns-resize'; switch (dragDirection) { case 'n': case 's': dragCursor = 'ns-resize'; break; case 'e': case 'w': dragCursor = 'ew-resize'; break; } return dragCursor; } /** * Custom hook that renders a drag cursor when dragging. * * @param {boolean} isDragging The dragging state. * @param {string} dragDirection The drag direction. * * @return {string} The CSS cursor value. */ function useDragCursor(isDragging, dragDirection) { var dragCursor = getDragCursor(dragDirection); Object(external_this_wp_element_["useEffect"])(function () { if (isDragging) { document.documentElement.style.cursor = dragCursor; document.documentElement.style.pointerEvents = 'none'; } else { document.documentElement.style.cursor = null; document.documentElement.style.pointerEvents = null; } }, [isDragging]); return dragCursor; } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/state.js function state_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function state_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { state_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { state_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * External dependencies */ /** * WordPress dependencies */ var initialStateReducer = function initialStateReducer(state) { return state; }; var initialInputControlState = { _event: {}, error: null, initialValue: '', isDirty: false, isDragEnabled: false, isDragging: false, isPressEnterToChange: false, value: '' }; var actionTypes = { CHANGE: 'CHANGE', COMMIT: 'COMMIT', DRAG_END: 'DRAG_END', DRAG_START: 'DRAG_START', DRAG: 'DRAG', INVALIDATE: 'INVALIDATE', PRESS_DOWN: 'PRESS_DOWN', PRESS_ENTER: 'PRESS_ENTER', PRESS_UP: 'PRESS_UP', RESET: 'RESET', UPDATE: 'UPDATE' }; var inputControlActionTypes = actionTypes; /** * Prepares initialState for the reducer. * * @param {Object} initialState The initial state. * @return {Object} Prepared initialState for the reducer */ function mergeInitialState() { var initialState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialInputControlState; var value = initialState.value; return state_objectSpread(state_objectSpread(state_objectSpread({}, initialInputControlState), initialState), {}, { initialValue: value }); } /** * Composes multiple stateReducers into a single stateReducer, building * the pipeline to control the flow for state and actions. * * @param {...Function} fns State reducers. * @return {Function} The single composed stateReducer. */ var state_composeStateReducers = function composeStateReducers() { for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) { fns[_key] = arguments[_key]; } return function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return fns.reduceRight(function (state, fn) { var fnState = fn.apply(void 0, args); return Object(external_this_lodash_["isEmpty"])(fnState) ? state : state_objectSpread(state_objectSpread({}, state), fnState); }, {}); }; }; /** * Creates a reducer that opens the channel for external state subscription * and modification. * * This technique uses the "stateReducer" design pattern: * https://kentcdodds.com/blog/the-state-reducer-pattern/ * * @param {Function} composedStateReducers A custom reducer that can subscribe and modify state. * @return {Function} The reducer. */ function inputControlStateReducer(composedStateReducers) { return function (state, action) { var nextState = state_objectSpread({}, state); var type = action.type, payload = action.payload; switch (type) { /** * Keyboard events */ case actionTypes.PRESS_UP: nextState.isDirty = false; break; case actionTypes.PRESS_DOWN: nextState.isDirty = false; break; /** * Drag events */ case actionTypes.DRAG_START: nextState.isDragging = true; break; case actionTypes.DRAG_END: nextState.isDragging = false; break; /** * Input events */ case actionTypes.CHANGE: nextState.error = null; nextState.value = payload.value; if (state.isPressEnterToChange) { nextState.isDirty = true; } break; case actionTypes.COMMIT: nextState.value = payload.value; nextState.isDirty = false; break; case actionTypes.RESET: nextState.error = null; nextState.isDirty = false; nextState.value = payload.value || state.initialValue; break; case actionTypes.UPDATE: nextState.value = payload.value; nextState.isDirty = false; break; /** * Validation */ case actionTypes.INVALIDATE: nextState.error = payload.error; break; } if (payload.event) { nextState._event = payload.event; } /** * Send the nextState + action to the composedReducers via * this "bridge" mechanism. This allows external stateReducers * to hook into actions, and modify state if needed. */ return composedStateReducers(nextState, action); }; } /** * A custom hook that connects and external stateReducer with an internal * reducer. This hook manages the internal state of InputControl. * However, by connecting an external stateReducer function, other * components can react to actions as well as modify state before it is * applied. * * This technique uses the "stateReducer" design pattern: * https://kentcdodds.com/blog/the-state-reducer-pattern/ * * @param {Function} stateReducer An external state reducer. * @param {Object} initialState The initial state for the reducer. * @return {Object} State, dispatch, and a collection of actions. */ function useInputControlStateReducer() { var stateReducer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialStateReducer; var initialState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : initialInputControlState; var _useReducer = Object(external_this_wp_element_["useReducer"])(inputControlStateReducer(stateReducer), mergeInitialState(initialState)), _useReducer2 = Object(slicedToArray["a" /* default */])(_useReducer, 2), state = _useReducer2[0], dispatch = _useReducer2[1]; var createChangeEvent = function createChangeEvent(type) { return function (nextValue, event) { /** * Persist allows for the (Synthetic) event to be used outside of * this function call. * https://reactjs.org/docs/events.html#event-pooling */ if (event && event.persist) { event.persist(); } dispatch({ type: type, payload: { value: nextValue, event: event } }); }; }; var createKeyEvent = function createKeyEvent(type) { return function (event) { /** * Persist allows for the (Synthetic) event to be used outside of * this function call. * https://reactjs.org/docs/events.html#event-pooling */ if (event && event.persist) { event.persist(); } dispatch({ type: type, payload: { event: event } }); }; }; var createDragEvent = function createDragEvent(type) { return function (dragProps) { dispatch({ type: type, payload: dragProps }); }; }; /** * Actions for the reducer */ var change = createChangeEvent(actionTypes.CHANGE); var invalidate = createChangeEvent(actionTypes.INVALIDATE); var reset = createChangeEvent(actionTypes.RESET); var commit = createChangeEvent(actionTypes.COMMIT); var update = createChangeEvent(actionTypes.UPDATE); var dragStart = createDragEvent(actionTypes.DRAG_START); var drag = createDragEvent(actionTypes.DRAG); var dragEnd = createDragEvent(actionTypes.DRAG_END); var pressUp = createKeyEvent(actionTypes.PRESS_UP); var pressDown = createKeyEvent(actionTypes.PRESS_DOWN); var pressEnter = createKeyEvent(actionTypes.PRESS_ENTER); return { change: change, commit: commit, dispatch: dispatch, drag: drag, dragEnd: dragEnd, dragStart: dragStart, invalidate: invalidate, pressDown: pressDown, pressEnter: pressEnter, pressUp: pressUp, reset: reset, state: state, update: update }; } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/values.js /** * Determines if a value is null or undefined. * * @param {any} value The value to check. * @return {boolean} Whether value is null or undefined. */ function isValueDefined(value) { return value !== undefined && value !== null; } /** * Determines if a value is empty, null, or undefined. * * @param {any} value The value to check. * @return {boolean} Whether value is empty. */ function isValueEmpty(value) { var isEmptyString = value === ''; return !isValueDefined(value) || isEmptyString; } /** * Attempts to get a defined/non-null value from a collection of arguments. * * @param {Array} values Values to derive from. * @param {any} fallbackValue Fallback value if there are no defined values. * @return {any} A defined value or the fallback value. */ function getDefinedValue() { var _values$find; var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; var fallbackValue = arguments.length > 1 ? arguments[1] : undefined; return (_values$find = values.find(isValueDefined)) !== null && _values$find !== void 0 ? _values$find : fallbackValue; } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-update-effect.js /** * WordPress dependencies */ /* * A `React.useEffect` that will not run on the first render. * Source: * https://github.com/reakit/reakit/blob/master/packages/reakit-utils/src/useUpdateEffect.ts */ function useUpdateEffect(effect, deps) { var mounted = Object(external_this_wp_element_["useRef"])(false); Object(external_this_wp_element_["useEffect"])(function () { if (mounted.current) { return effect(); } mounted.current = true; return undefined; }, deps); } /* harmony default export */ var use_update_effect = (useUpdateEffect); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/input-field.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function InputField(_ref, ref) { var _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$dragDirection = _ref.dragDirection, dragDirection = _ref$dragDirection === void 0 ? 'n' : _ref$dragDirection, _ref$dragThreshold = _ref.dragThreshold, dragThreshold = _ref$dragThreshold === void 0 ? 10 : _ref$dragThreshold, id = _ref.id, _ref$isDragEnabled = _ref.isDragEnabled, isDragEnabled = _ref$isDragEnabled === void 0 ? false : _ref$isDragEnabled, isFocused = _ref.isFocused, _ref$isPressEnterToCh = _ref.isPressEnterToChange, isPressEnterToChange = _ref$isPressEnterToCh === void 0 ? false : _ref$isPressEnterToCh, _ref$onBlur = _ref.onBlur, onBlur = _ref$onBlur === void 0 ? external_this_lodash_["noop"] : _ref$onBlur, _ref$onChange = _ref.onChange, onChange = _ref$onChange === void 0 ? external_this_lodash_["noop"] : _ref$onChange, _ref$onDrag = _ref.onDrag, onDrag = _ref$onDrag === void 0 ? external_this_lodash_["noop"] : _ref$onDrag, _ref$onDragEnd = _ref.onDragEnd, onDragEnd = _ref$onDragEnd === void 0 ? external_this_lodash_["noop"] : _ref$onDragEnd, _ref$onDragStart = _ref.onDragStart, onDragStart = _ref$onDragStart === void 0 ? external_this_lodash_["noop"] : _ref$onDragStart, _ref$onFocus = _ref.onFocus, onFocus = _ref$onFocus === void 0 ? external_this_lodash_["noop"] : _ref$onFocus, _ref$onKeyDown = _ref.onKeyDown, onKeyDown = _ref$onKeyDown === void 0 ? external_this_lodash_["noop"] : _ref$onKeyDown, _ref$onValidate = _ref.onValidate, onValidate = _ref$onValidate === void 0 ? external_this_lodash_["noop"] : _ref$onValidate, _ref$size = _ref.size, size = _ref$size === void 0 ? 'default' : _ref$size, setIsFocused = _ref.setIsFocused, _ref$stateReducer = _ref.stateReducer, stateReducer = _ref$stateReducer === void 0 ? function (state) { return state; } : _ref$stateReducer, valueProp = _ref.value, type = _ref.type, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["disabled", "dragDirection", "dragThreshold", "id", "isDragEnabled", "isFocused", "isPressEnterToChange", "onBlur", "onChange", "onDrag", "onDragEnd", "onDragStart", "onFocus", "onKeyDown", "onValidate", "size", "setIsFocused", "stateReducer", "value", "type"]); var _useInputControlState = useInputControlStateReducer(stateReducer, { isDragEnabled: isDragEnabled, value: valueProp, isPressEnterToChange: isPressEnterToChange }), state = _useInputControlState.state, change = _useInputControlState.change, commit = _useInputControlState.commit, drag = _useInputControlState.drag, dragEnd = _useInputControlState.dragEnd, dragStart = _useInputControlState.dragStart, invalidate = _useInputControlState.invalidate, pressDown = _useInputControlState.pressDown, pressEnter = _useInputControlState.pressEnter, pressUp = _useInputControlState.pressUp, reset = _useInputControlState.reset, update = _useInputControlState.update; var _event = state._event, value = state.value, isDragging = state.isDragging, isDirty = state.isDirty; var wasDirtyOnBlur = Object(external_this_wp_element_["useRef"])(false); var dragCursor = useDragCursor(isDragging, dragDirection); /* * Handles syncronization of external and internal value state. * If not focused and did not hold a dirty value[1] on blur * updates the value from the props. Otherwise if not holding * a dirty value[1] propagates the value and event through onChange. * [1] value is only made dirty if isPressEnterToChange is true */ use_update_effect(function () { if (valueProp === value) { return; } if (!isFocused && !wasDirtyOnBlur.current) { update(valueProp); } else if (!isDirty) { onChange(value, { event: _event }); wasDirtyOnBlur.current = false; } }, [value, isDirty, isFocused, valueProp]); var handleOnBlur = function handleOnBlur(event) { onBlur(event); setIsFocused(false); /** * If isPressEnterToChange is set, this commits the value to * the onChange callback. */ if (isPressEnterToChange && isDirty) { wasDirtyOnBlur.current = true; if (!isValueEmpty(value)) { handleOnCommit(event); } else { reset(valueProp); } } }; var handleOnFocus = function handleOnFocus(event) { onFocus(event); setIsFocused(true); }; var handleOnChange = function handleOnChange(event) { var nextValue = event.target.value; change(nextValue, event); }; var handleOnCommit = function handleOnCommit(event) { var nextValue = event.target.value; try { onValidate(nextValue, event); commit(nextValue, event); } catch (err) { invalidate(err, event); } }; var handleOnKeyDown = function handleOnKeyDown(event) { var keyCode = event.keyCode; onKeyDown(event); switch (keyCode) { case external_this_wp_keycodes_["UP"]: pressUp(event); break; case external_this_wp_keycodes_["DOWN"]: pressDown(event); break; case external_this_wp_keycodes_["ENTER"]: pressEnter(event); if (isPressEnterToChange) { event.preventDefault(); handleOnCommit(event); } break; } }; var dragGestureProps = useDrag(function (dragProps) { var distance = dragProps.distance, dragging = dragProps.dragging, event = dragProps.event; if (!distance) return; event.stopPropagation(); /** * Quick return if no longer dragging. * This prevents unnecessary value calculations. */ if (!dragging) { onDragEnd(dragProps); dragEnd(dragProps); return; } onDrag(dragProps); drag(dragProps); if (!isDragging) { onDragStart(dragProps); dragStart(dragProps); } }, { threshold: dragThreshold, enabled: isDragEnabled }); var _ref2 = isDragEnabled ? dragGestureProps() : {}, onMouseDown = _ref2.onMouseDown, onTouchStart = _ref2.onTouchStart; var handleOnMouseDown = onMouseDown; /* * Works around the odd UA (e.g. Firefox) that does not focus inputs of * type=number when their spinner arrows are pressed. */ if (type === 'number') { handleOnMouseDown = function handleOnMouseDown(event) { if (event.target !== event.target.ownerDocument.activeElement) { event.target.focus(); } if (isDragEnabled) { onMouseDown(event); } }; } return Object(external_this_wp_element_["createElement"])(input_control_styles_Input, Object(esm_extends["a" /* default */])({}, props, { className: "components-input-control__input", disabled: disabled, dragCursor: dragCursor, isDragging: isDragging, id: id, onBlur: handleOnBlur, onChange: handleOnChange, onFocus: handleOnFocus, onKeyDown: handleOnKeyDown, onMouseDown: handleOnMouseDown, onTouchStart: onTouchStart, ref: ref, size: size, value: value, type: type })); } var ForwardedComponent = Object(external_this_wp_element_["forwardRef"])(InputField); /* harmony default export */ var input_field = (ForwardedComponent); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/input-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function input_control_useUniqueId(idProp) { var instanceId = Object(external_this_wp_compose_["useInstanceId"])(InputControl); var id = "inspector-input-control-".concat(instanceId); return idProp || id; } function InputControl(_ref, ref) { var _ref$__unstableStateR = _ref.__unstableStateReducer, stateReducer = _ref$__unstableStateR === void 0 ? function (state) { return state; } : _ref$__unstableStateR, __unstableInputWidth = _ref.__unstableInputWidth, className = _ref.className, _ref$disabled = _ref.disabled, disabled = _ref$disabled === void 0 ? false : _ref$disabled, _ref$hideLabelFromVis = _ref.hideLabelFromVision, hideLabelFromVision = _ref$hideLabelFromVis === void 0 ? false : _ref$hideLabelFromVis, idProp = _ref.id, _ref$isPressEnterToCh = _ref.isPressEnterToChange, isPressEnterToChange = _ref$isPressEnterToCh === void 0 ? false : _ref$isPressEnterToCh, label = _ref.label, _ref$labelPosition = _ref.labelPosition, labelPosition = _ref$labelPosition === void 0 ? 'top' : _ref$labelPosition, _ref$onChange = _ref.onChange, onChange = _ref$onChange === void 0 ? external_this_lodash_["noop"] : _ref$onChange, _ref$onValidate = _ref.onValidate, onValidate = _ref$onValidate === void 0 ? external_this_lodash_["noop"] : _ref$onValidate, _ref$onKeyDown = _ref.onKeyDown, onKeyDown = _ref$onKeyDown === void 0 ? external_this_lodash_["noop"] : _ref$onKeyDown, prefix = _ref.prefix, _ref$size = _ref.size, size = _ref$size === void 0 ? 'default' : _ref$size, suffix = _ref.suffix, value = _ref.value, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["__unstableStateReducer", "__unstableInputWidth", "className", "disabled", "hideLabelFromVision", "id", "isPressEnterToChange", "label", "labelPosition", "onChange", "onValidate", "onKeyDown", "prefix", "size", "suffix", "value"]); var _useState = Object(external_this_wp_element_["useState"])(false), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), isFocused = _useState2[0], setIsFocused = _useState2[1]; var id = input_control_useUniqueId(idProp); var classes = classnames_default()('components-input-control', className); return Object(external_this_wp_element_["createElement"])(input_base, { __unstableInputWidth: __unstableInputWidth, className: classes, disabled: disabled, gap: 3, hideLabelFromVision: hideLabelFromVision, id: id, isFocused: isFocused, justify: "left", label: label, labelPosition: labelPosition, prefix: prefix, size: size, suffix: suffix }, Object(external_this_wp_element_["createElement"])(input_field, Object(esm_extends["a" /* default */])({}, props, { className: "components-input-control__input", disabled: disabled, id: id, isFocused: isFocused, isPressEnterToChange: isPressEnterToChange, onChange: onChange, onKeyDown: onKeyDown, onValidate: onValidate, ref: ref, setIsFocused: setIsFocused, size: size, stateReducer: stateReducer, value: value }))); } var input_control_ForwardedComponent = Object(external_this_wp_element_["forwardRef"])(InputControl); /* harmony default export */ var input_control = (input_control_ForwardedComponent); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/styles/number-control-styles.js function number_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ var number_control_styles_ref = true ? { name: "1b9wwt5", styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none !important;margin:0 !important;}" } : undefined; var htmlArrowStyles = function htmlArrowStyles(_ref2) { var hideHTMLArrows = _ref2.hideHTMLArrows; if (!hideHTMLArrows) return ""; return number_control_styles_ref; }; var number_control_styles_Input = /*#__PURE__*/styled_base_browser_esm(input_control, { target: "ep48uk90", label: "Input" })(htmlArrowStyles, ";" + ( true ? "" : undefined)); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/math.js /** * External dependencies */ /** * Parses and retrieves a number value. * * @param {any} value The incoming value. * * @return {number} The parsed number value. */ function getNumber(value) { var number = Number(value); return isNaN(number) ? 0 : number; } /** * Safely adds 2 values. * * @param {number|string} args Values to add together. * * @return {number} The sum of values. */ function add() { for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return args.reduce(function (sum, arg) { return sum + getNumber(arg); }, 0); } /** * Safely subtracts 2 values. * * @param {number|string} args Values to subtract together. * * @return {number} The difference of the 2 values. */ function subtract() { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } return args.reduce(function (diff, arg, index) { var value = getNumber(arg); return index === 0 ? value : diff - value; }); } /** * Determines the decimal position of a number value. * * @param {number} value The number to evaluate. * * @return {number} The number of decimal places. */ function getPrecision(value) { var split = (value + '').split('.'); return split[1] !== undefined ? split[1].length : 0; } /** * Clamps a value based on a min/max range with rounding * * @param {number} value The value. * @param {number} min The minimum range. * @param {number} max The maximum range. * @param {number} step A multiplier for the value. * * @return {number} The rounded and clamped value. */ function roundClamp() { var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; var min = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity; var max = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity; var step = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1; var baseValue = getNumber(value); var stepValue = getNumber(step); var precision = getPrecision(step); var rounded = Math.round(baseValue / stepValue) * stepValue; var clampedValue = Object(external_this_lodash_["clamp"])(rounded, min, max); return precision ? getNumber(clampedValue.toFixed(precision)) : clampedValue; } /** * Clamps a value based on a min/max range with rounding. * Returns a string. * * @param {any} args Arguments for roundClamp(). * @property {number} value The value. * @property {number} min The minimum range. * @property {number} max The maximum range. * @property {number} step A multiplier for the value. * * @return {string} The rounded and clamped value. */ function roundClampString() { return roundClamp.apply(void 0, arguments).toString(); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-jump-step.js /** * WordPress dependencies */ /** * A custom hook that calculates a step value (used by elements like input * [type="number"]). This value can be modified based on whether the Shift * key is being held down. * * For example, a shiftStep of 10, and a step of 1... * Starting from 10, the next incremented value will be 11. * * Holding down shift... * Starting from 10, the next incremented value will be 20. * * @param {Object} props Properties for the hook. * @param {boolean} [props.isShiftStepEnabled=true] Determines if jumping values with shift is enabled * @param {number} [props.shiftStep=10] Multiplier to jump by, when holding shift key. * @param {number} [props.step=1] Multiplier to jump by, when not-holding shift key. * * @return {number} The jump step value. */ function useJumpStep(_ref) { var _ref$isShiftStepEnabl = _ref.isShiftStepEnabled, isShiftStepEnabled = _ref$isShiftStepEnabl === void 0 ? true : _ref$isShiftStepEnabl, _ref$shiftStep = _ref.shiftStep, shiftStep = _ref$shiftStep === void 0 ? 10 : _ref$shiftStep, _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step; var _useState = Object(external_this_wp_element_["useState"])(false), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), isShiftKey = _useState2[0], setIsShiftKey = _useState2[1]; Object(external_this_wp_element_["useEffect"])(function () { var handleShiftKeyToggle = function handleShiftKeyToggle(event) { setIsShiftKey(event.shiftKey); }; window.addEventListener('keydown', handleShiftKeyToggle); window.addEventListener('keyup', handleShiftKeyToggle); return function () { window.removeEventListener('keydown', handleShiftKeyToggle); window.removeEventListener('keyup', handleShiftKeyToggle); }; }, []); var isEnabled = isShiftStepEnabled && isShiftKey; return isEnabled ? shiftStep * step : step; } /* harmony default export */ var use_jump_step = (useJumpStep); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/number-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function NumberControl(_ref, ref) { var _ref$__unstableStateR = _ref.__unstableStateReducer, stateReducer = _ref$__unstableStateR === void 0 ? function (state) { return state; } : _ref$__unstableStateR, className = _ref.className, _ref$dragDirection = _ref.dragDirection, dragDirection = _ref$dragDirection === void 0 ? 'n' : _ref$dragDirection, _ref$hideHTMLArrows = _ref.hideHTMLArrows, hideHTMLArrows = _ref$hideHTMLArrows === void 0 ? false : _ref$hideHTMLArrows, _ref$isDragEnabled = _ref.isDragEnabled, isDragEnabled = _ref$isDragEnabled === void 0 ? true : _ref$isDragEnabled, _ref$isShiftStepEnabl = _ref.isShiftStepEnabled, isShiftStepEnabled = _ref$isShiftStepEnabl === void 0 ? true : _ref$isShiftStepEnabl, label = _ref.label, _ref$max = _ref.max, max = _ref$max === void 0 ? Infinity : _ref$max, _ref$min = _ref.min, min = _ref$min === void 0 ? -Infinity : _ref$min, _ref$shiftStep = _ref.shiftStep, shiftStep = _ref$shiftStep === void 0 ? 10 : _ref$shiftStep, _ref$step = _ref.step, step = _ref$step === void 0 ? 1 : _ref$step, _ref$type = _ref.type, typeProp = _ref$type === void 0 ? 'number' : _ref$type, valueProp = _ref.value, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["__unstableStateReducer", "className", "dragDirection", "hideHTMLArrows", "isDragEnabled", "isShiftStepEnabled", "label", "max", "min", "shiftStep", "step", "type", "value"]); var isRtl = useRTL(); var baseValue = roundClamp(0, min, max, step); var jumpStep = use_jump_step({ step: step, shiftStep: shiftStep, isShiftStepEnabled: isShiftStepEnabled }); var autoComplete = typeProp === 'number' ? 'off' : null; var classes = classnames_default()('components-number-control', className); /** * "Middleware" function that intercepts updates from InputControl. * This allows us to tap into actions to transform the (next) state for * InputControl. * * @param {Object} state State from InputControl * @param {Object} action Action triggering state change * @return {Object} The updated state to apply to InputControl */ var numberControlStateReducer = function numberControlStateReducer(state, action) { var type = action.type, payload = action.payload; var event = payload === null || payload === void 0 ? void 0 : payload.event; var currentValue = state.value; /** * Handles custom UP and DOWN Keyboard events */ if (type === inputControlActionTypes.PRESS_UP || type === inputControlActionTypes.PRESS_DOWN) { var enableShift = event.shiftKey && isShiftStepEnabled; var incrementalValue = enableShift ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step); var nextValue = isValueEmpty(currentValue) ? baseValue : currentValue; if (event === null || event === void 0 ? void 0 : event.preventDefault) { event.preventDefault(); } if (type === inputControlActionTypes.PRESS_UP) { nextValue = add(nextValue, incrementalValue); } if (type === inputControlActionTypes.PRESS_DOWN) { nextValue = subtract(nextValue, incrementalValue); } nextValue = roundClamp(nextValue, min, max, incrementalValue); state.value = nextValue; } /** * Handles drag to update events */ if (type === inputControlActionTypes.DRAG && isDragEnabled) { var delta = payload.delta, shiftKey = payload.shiftKey; var _delta = Object(slicedToArray["a" /* default */])(delta, 2), x = _delta[0], y = _delta[1]; var modifier = shiftKey ? parseFloat(shiftStep) * parseFloat(step) : parseFloat(step); var directionModifier; var directionBaseValue; switch (dragDirection) { case 'n': directionBaseValue = y; directionModifier = -1; break; case 'e': directionBaseValue = x; directionModifier = isRtl ? -1 : 1; break; case 's': directionBaseValue = y; directionModifier = 1; break; case 'w': directionBaseValue = x; directionModifier = isRtl ? 1 : -1; break; } var distance = directionBaseValue * modifier * directionModifier; var _nextValue; if (distance !== 0) { _nextValue = roundClamp(add(currentValue, distance), min, max, modifier); state.value = _nextValue; } } /** * Handles commit (ENTER key press or on blur if isPressEnterToChange) */ if (type === inputControlActionTypes.PRESS_ENTER || type === inputControlActionTypes.COMMIT) { state.value = roundClamp(currentValue, min, max); } return state; }; return Object(external_this_wp_element_["createElement"])(number_control_styles_Input, Object(esm_extends["a" /* default */])({ autoComplete: autoComplete, inputMode: "numeric" }, props, { className: classes, dragDirection: dragDirection, hideHTMLArrows: hideHTMLArrows, isDragEnabled: isDragEnabled, label: label, max: max, min: min, ref: ref, step: jumpStep, type: typeProp, value: valueProp, __unstableStateReducer: state_composeStateReducers(numberControlStateReducer, stateReducer) })); } /* harmony default export */ var number_control = (Object(external_this_wp_element_["forwardRef"])(NumberControl)); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/styles/angle-picker-control-styles.js function angle_picker_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * Internal dependencies */ var CIRCLE_SIZE = 30; var angle_picker_control_styles_Root = /*#__PURE__*/styled_base_browser_esm(flex_Flex, { target: "e65ony40", label: "Root" })( true ? { name: "tn9ygg", styles: "max-width:200px;" } : undefined); var NumberControlWrapper = /*#__PURE__*/styled_base_browser_esm(flex_item, { target: "e65ony41", label: "NumberControlWrapper" })( true ? { name: "1jgxixz", styles: "width:80px;" } : undefined); var CircleRoot = styled_base_browser_esm("div", { target: "e65ony42", label: "CircleRoot" })("border-radius:50%;border:1px solid ", colors_color('ui.borderLight'), ";box-sizing:border-box;cursor:grab;height:", CIRCLE_SIZE, "px;overflow:hidden;width:", CIRCLE_SIZE, "px;" + ( true ? "" : undefined)); var CircleIndicatorWrapper = styled_base_browser_esm("div", { target: "e65ony43", label: "CircleIndicatorWrapper" })( true ? { name: "11t5m37", styles: "box-sizing:border-box;position:relative;width:100%;height:100%;" } : undefined); var CircleIndicator = styled_base_browser_esm("div", { target: "e65ony44", label: "CircleIndicator" })("background:", colors_color('ui.border'), ";border-radius:50%;border:3px solid ", colors_color('ui.border'), ";bottom:0;box-sizing:border-box;display:block;height:1px;left:0;margin:auto;position:absolute;right:0;top:-", CIRCLE_SIZE / 2, "px;width:1px;" + ( true ? "" : undefined)); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/angle-circle.js /** * WordPress dependencies */ /** * Internal dependencies */ function AngleCircle(_ref) { var value = _ref.value, onChange = _ref.onChange, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["value", "onChange"]); var angleCircleRef = Object(external_this_wp_element_["useRef"])(); var angleCircleCenter = Object(external_this_wp_element_["useRef"])(); var previousCursorValue = Object(external_this_wp_element_["useRef"])(); var setAngleCircleCenter = function setAngleCircleCenter() { var rect = angleCircleRef.current.getBoundingClientRect(); angleCircleCenter.current = { x: rect.x + rect.width / 2, y: rect.y + rect.height / 2 }; }; var changeAngleToPosition = function changeAngleToPosition(event) { var _angleCircleCenter$cu = angleCircleCenter.current, centerX = _angleCircleCenter$cu.x, centerY = _angleCircleCenter$cu.y; // Prevent (drag) mouse events from selecting and accidentally // triggering actions from other elements. event.preventDefault(); // Ensure the input isn't focused as preventDefault would leave it document.activeElement.blur(); onChange(getAngle(centerX, centerY, event.clientX, event.clientY)); }; var _useDragging = Object(external_this_wp_compose_["__experimentalUseDragging"])({ onDragStart: function onDragStart(event) { setAngleCircleCenter(); changeAngleToPosition(event); }, onDragMove: changeAngleToPosition, onDragEnd: changeAngleToPosition }), startDrag = _useDragging.startDrag, isDragging = _useDragging.isDragging; Object(external_this_wp_element_["useEffect"])(function () { if (isDragging) { if (previousCursorValue.current === undefined) { previousCursorValue.current = document.body.style.cursor; } document.body.style.cursor = 'grabbing'; } else { document.body.style.cursor = previousCursorValue.current || null; previousCursorValue.current = undefined; } }, [isDragging]); return ( /* eslint-disable jsx-a11y/no-static-element-interactions */ Object(external_this_wp_element_["createElement"])(CircleRoot, Object(esm_extends["a" /* default */])({ ref: angleCircleRef, onMouseDown: startDrag, className: "components-angle-picker-control__angle-circle", style: isDragging ? { cursor: 'grabbing' } : undefined }, props), Object(external_this_wp_element_["createElement"])(CircleIndicatorWrapper, { style: value ? { transform: "rotate(".concat(value, "deg)") } : undefined, className: "components-angle-picker-control__angle-circle-indicator-wrapper" }, Object(external_this_wp_element_["createElement"])(CircleIndicator, { className: "components-angle-picker-control__angle-circle-indicator" }))) /* eslint-enable jsx-a11y/no-static-element-interactions */ ); } function getAngle(centerX, centerY, pointX, pointY) { var y = pointY - centerY; var x = pointX - centerX; var angleInRadians = Math.atan2(y, x); var angleInDeg = Math.round(angleInRadians * (180 / Math.PI)) + 90; if (angleInDeg < 0) { return 360 + angleInDeg; } return angleInDeg; } /* harmony default export */ var angle_circle = (AngleCircle); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/angle-picker-control/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ function AnglePickerControl(_ref) { var className = _ref.className, idProp = _ref.id, value = _ref.value, onChange = _ref.onChange, label = _ref.label, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "id", "value", "onChange", "label"]); var instanceId = Object(external_this_wp_compose_["useInstanceId"])(AnglePickerControl, 'components-angle-picker-control__input'); var id = idProp || instanceId; var handleOnNumberChange = function handleOnNumberChange(unprocessedValue) { var inputValue = unprocessedValue !== '' ? parseInt(unprocessedValue, 10) : 0; onChange(inputValue); }; var classes = classnames_default()('components-angle-picker-control', className); return Object(external_this_wp_element_["createElement"])(base_control, Object(esm_extends["a" /* default */])({ className: classes, id: id, label: label }, props), Object(external_this_wp_element_["createElement"])(angle_picker_control_styles_Root, { gap: 3 }, Object(external_this_wp_element_["createElement"])(NumberControlWrapper, null, Object(external_this_wp_element_["createElement"])(number_control, { className: "components-angle-picker-control__input-field", id: id, max: 360, min: 0, onChange: handleOnNumberChange, step: "1", value: value })), Object(external_this_wp_element_["createElement"])(block, null, Object(external_this_wp_element_["createElement"])(angle_circle, { "aria-hidden": "true", value: value, onChange: onChange })))); } // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules var toConsumableArray = __webpack_require__(17); // EXTERNAL MODULE: external {"this":["wp","richText"]} var external_this_wp_richText_ = __webpack_require__(25); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js var build_module_button = __webpack_require__(35); // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js + 2 modules var popover = __webpack_require__(114); // EXTERNAL MODULE: external {"this":["wp","a11y"]} var external_this_wp_a11y_ = __webpack_require__(46); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/higher-order/with-spoken-messages/index.js /** * WordPress dependencies */ /** * A Higher Order Component used to be provide speak and debounced speak * functions. * * @see https://developer.wordpress.org/block-editor/packages/packages-a11y/#speak * * @param {WPComponent} Component The component to be wrapped. * * @return {WPComponent} The wrapped component. */ /* harmony default export */ var with_spoken_messages = (Object(external_this_wp_compose_["createHigherOrderComponent"])(function (Component) { return function (props) { return Object(external_this_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({}, props, { speak: external_this_wp_a11y_["speak"], debouncedSpeak: Object(external_this_wp_compose_["useDebounce"])(external_this_wp_a11y_["speak"], 500) })); }; }, 'withSpokenMessages')); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/autocomplete/index.js /** * External dependencies */ /** * WordPress dependencies */ /** * Internal dependencies */ /** * A raw completer option. * * @typedef {*} CompleterOption */ /** * @callback FnGetOptions * * @return {(CompleterOption[]|Promise.)} The completer options or a promise for them. */ /** * @callback FnGetOptionKeywords * @param {CompleterOption} option a completer option. * * @return {string[]} list of key words to search. */ /** * @callback FnIsOptionDisabled * @param {CompleterOption} option a completer option. * * @return {string[]} whether or not the given option is disabled. */ /** * @callback FnGetOptionLabel * @param {CompleterOption} option a completer option. * * @return {(string|Array.<(string|WPElement)>)} list of react components to render. */ /** * @callback FnAllowContext * @param {string} before the string before the auto complete trigger and query. * @param {string} after the string after the autocomplete trigger and query. * * @return {boolean} true if the completer can handle. */ /** * @typedef {Object} OptionCompletion * @property {'insert-at-caret'|'replace'} action the intended placement of the completion. * @property {OptionCompletionValue} value the completion value. */ /** * A completion value. * * @typedef {(string|WPElement|Object)} OptionCompletionValue */ /** * @callback FnGetOptionCompletion * @param {CompleterOption} value the value of the completer option. * @param {string} query the text value of the autocomplete query. * * @return {(OptionCompletion|OptionCompletionValue)} the completion for the given option. If an * OptionCompletionValue is returned, the * completion action defaults to `insert-at-caret`. */ /** * @typedef {Object} WPCompleter * @property {string} name a way to identify a completer, useful for selective overriding. * @property {?string} className A class to apply to the popup menu. * @property {string} triggerPrefix the prefix that will display the menu. * @property {(CompleterOption[]|FnGetOptions)} options the completer options or a function to get them. * @property {?FnGetOptionKeywords} getOptionKeywords get the keywords for a given option. * @property {?FnIsOptionDisabled} isOptionDisabled get whether or not the given option is disabled. * @property {FnGetOptionLabel} getOptionLabel get the label for a given option. * @property {?FnAllowContext} allowContext filter the context under which the autocomplete activates. * @property {FnGetOptionCompletion} getOptionCompletion get the completion associated with a given option. */ function filterOptions(search) { var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; var maxResults = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10; var filtered = []; for (var i = 0; i < options.length; i++) { var option = options[i]; // Merge label into keywords var _option$keywords = option.keywords, keywords = _option$keywords === void 0 ? [] : _option$keywords; if ('string' === typeof option.label) { keywords = [].concat(Object(toConsumableArray["a" /* default */])(keywords), [option.label]); } var isMatch = keywords.some(function (keyword) { return search.test(Object(external_this_lodash_["deburr"])(keyword)); }); if (!isMatch) { continue; } filtered.push(option); // Abort early if max reached if (filtered.length === maxResults) { break; } } return filtered; } function getRange() { var selection = window.getSelection(); return selection.rangeCount ? selection.getRangeAt(0) : null; } var autocomplete_getAutoCompleterUI = function getAutoCompleterUI(autocompleter) { var useItems = autocompleter.useItems ? autocompleter.useItems : function (filterValue) { var _useState = Object(external_this_wp_element_["useState"])([]), _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), items = _useState2[0], setItems = _useState2[1]; /* * We support both synchronous and asynchronous retrieval of completer options * but internally treat all as async so we maintain a single, consistent code path. * * Because networks can be slow, and the internet is wonderfully unpredictable, * we don't want two promises updating the state at once. This ensures that only * the most recent promise will act on `optionsData`. This doesn't use the state * because `setState` is batched, and so there's no guarantee that setting * `activePromise` in the state would result in it actually being in `this.state` * before the promise resolves and we check to see if this is the active promise or not. */ Object(external_this_wp_element_["useLayoutEffect"])(function () { var options = autocompleter.options, isDebounced = autocompleter.isDebounced; var loadOptions = Object(external_this_lodash_["debounce"])(function () { var promise = Promise.resolve(typeof options === 'function' ? options(filterValue) : options).then(function (optionsData) { if (promise.canceled) { return; } var keyedOptions = optionsData.map(function (optionData, optionIndex) { return { key: "".concat(autocompleter.name, "-").concat(optionIndex), value: optionData, label: autocompleter.getOptionLabel(optionData), keywords: autocompleter.getOptionKeywords ? autocompleter.getOptionKeywords(optionData) : [], isDisabled: autocompleter.isOptionDisabled ? autocompleter.isOptionDisabled(optionData) : false }; }); // create a regular expression to filter the options var search = new RegExp('(?:\\b|\\s|^)' + Object(external_this_lodash_["escapeRegExp"])(filterValue), 'i'); setItems(filterOptions(search, keyedOptions)); }); return promise; }, isDebounced ? 250 : 0); var promise = loadOptions(); return function () { loadOptions.cancel(); if (promise) { promise.canceled = true; } }; }, [filterValue]); return [items]; }; function AutocompleterUI(_ref) { var filterValue = _ref.filterValue, instanceId = _ref.instanceId, listBoxId = _ref.listBoxId, className = _ref.className, selectedIndex = _ref.selectedIndex, onChangeOptions = _ref.onChangeOptions, onSelect = _ref.onSelect, onReset = _ref.onReset; var _useItems = useItems(filterValue), _useItems2 = Object(slicedToArray["a" /* default */])(_useItems, 1), items = _useItems2[0]; Object(external_this_wp_element_["useLayoutEffect"])(function () { onChangeOptions(items); }, [items]); if (!items.length > 0) { return null; } return Object(external_this_wp_element_["createElement"])(popover["a" /* default */], { focusOnMount: false, onClose: onReset, position: "top right", className: "components-autocomplete__popover", anchorRef: getRange() }, Object(external_this_wp_element_["createElement"])("div", { id: listBoxId, role: "listbox", className: "components-autocomplete__results" }, Object(external_this_lodash_["map"])(items, function (option, index) { return Object(external_this_wp_element_["createElement"])(build_module_button["a" /* default */], { key: option.key, id: "components-autocomplete-item-".concat(instanceId, "-").concat(option.key), role: "option", "aria-selected": index === selectedIndex, disabled: option.isDisabled, className: classnames_default()('components-autocomplete__result', className, { 'is-selected': index === selectedIndex }), onClick: function onClick() { return onSelect(option); } }, option.label); }))); } return AutocompleterUI; }; function Autocomplete(_ref2) { var children = _ref2.children, isSelected = _ref2.isSelected, record = _ref2.record, onChange = _ref2.onChange, onReplace = _ref2.onReplace, completers = _ref2.completers, debouncedSpeak = _ref2.debouncedSpeak; var instanceId = Object(external_this_wp_compose_["useInstanceId"])(Autocomplete); var _useState3 = Object(external_this_wp_element_["useState"])(0), _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), selectedIndex = _useState4[0], setSelectedIndex = _useState4[1]; var _useState5 = Object(external_this_wp_element_["useState"])([]), _useState6 = Object(slicedToArray["a" /* default */])(_useState5, 2), filteredOptions = _useState6[0], setFilteredOptions = _useState6[1]; var _useState7 = Object(external_this_wp_element_["useState"])(''), _useState8 = Object(slicedToArray["a" /* default */])(_useState7, 2), filterValue = _useState8[0], setFilterValue = _useState8[1]; var _useState9 = Object(external_this_wp_element_["useState"])(null), _useState10 = Object(slicedToArray["a" /* default */])(_useState9, 2), autocompleter = _useState10[0], setAutocompleter = _useState10[1]; var _useState11 = Object(external_this_wp_element_["useState"])(null), _useState12 = Object(slicedToArray["a" /* default */])(_useState11, 2), AutocompleterUI = _useState12[0], setAutocompleterUI = _useState12[1]; function insertCompletion(replacement) { var end = record.start; var start = end - autocompleter.triggerPrefix.length - filterValue.length; var toInsert = Object(external_this_wp_richText_["create"])({ html: Object(external_this_wp_element_["renderToString"])(replacement) }); onChange(Object(external_this_wp_richText_["insert"])(record, toInsert, start, end)); } function select(option) { var _ref3 = autocompleter || {}, getOptionCompletion = _ref3.getOptionCompletion; if (option.isDisabled) { return; } if (getOptionCompletion) { var completion = getOptionCompletion(option.value, filterValue); var _ref4 = undefined === completion.action || undefined === completion.value ? { action: 'insert-at-caret', value: completion } : completion, action = _ref4.action, value = _ref4.value; if ('replace' === action) { onReplace([value]); } else if ('insert-at-caret' === action) { insertCompletion(value); } } // Reset autocomplete state after insertion rather than before // so insertion events don't cause the completion menu to redisplay. reset(); } function reset() { setSelectedIndex(0); setFilteredOptions([]); setFilterValue(''); setAutocompleter(null); setAutocompleterUI(null); } function announce(options) { if (!debouncedSpeak) { return; } if (!!options.length) { debouncedSpeak(Object(external_this_wp_i18n_["sprintf"])( /* translators: %d: number of results. */ Object(external_this_wp_i18n_["_n"])('%d result found, use up and down arrow keys to navigate.', '%d results found, use up and down arrow keys to navigate.', options.length), options.length), 'assertive'); } else { debouncedSpeak(Object(external_this_wp_i18n_["__"])('No results.'), 'assertive'); } } /** * Load options for an autocompleter. * * @param {Array} options */ function onChangeOptions(options) { setSelectedIndex(options.length === filteredOptions.length ? selectedIndex : 0); setFilteredOptions(options); announce(options); } function handleKeyDown(event) { if (!autocompleter) { return; } if (filteredOptions.length === 0) { return; } switch (event.keyCode) { case external_this_wp_keycodes_["UP"]: setSelectedIndex((selectedIndex === 0 ? filteredOptions.length : selectedIndex) - 1); break; case external_this_wp_keycodes_["DOWN"]: setSelectedIndex((selectedIndex + 1) % filteredOptions.length); break; case external_this_wp_keycodes_["ESCAPE"]: setAutocompleter(null); setAutocompleterUI(null); break; case external_this_wp_keycodes_["ENTER"]: select(filteredOptions[selectedIndex]); break; case external_this_wp_keycodes_["LEFT"]: case external_this_wp_keycodes_["RIGHT"]: reset(); return; default: return; } // Any handled keycode should prevent original behavior. This relies on // the early return in the default case. event.preventDefault(); event.stopPropagation(); } var textContent; if (Object(external_this_wp_richText_["isCollapsed"])(record)) { textContent = Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["slice"])(record, 0)); } Object(external_this_wp_element_["useEffect"])(function () { if (!textContent) { return; } var text = Object(external_this_lodash_["deburr"])(textContent); var textAfterSelection = Object(external_this_wp_richText_["getTextContent"])(Object(external_this_wp_richText_["slice"])(record, undefined, Object(external_this_wp_richText_["getTextContent"])(record).length)); var completer = Object(external_this_lodash_["find"])(completers, function (_ref5) { var triggerPrefix = _ref5.triggerPrefix, allowContext = _ref5.allowContext; var index = text.lastIndexOf(triggerPrefix); if (index === -1) { return false; } if (allowContext && !allowContext(text.slice(0, index), textAfterSelection)) { return false; } return /^\S*$/.test(text.slice(index + triggerPrefix.length)); }); if (!completer) { reset(); return; } var safeTrigger = Object(external_this_lodash_["escapeRegExp"])(completer.triggerPrefix); var match = text.match(new RegExp("".concat(safeTrigger, "(\\S*)$"))); var query = match && match[1]; setAutocompleter(completer); setAutocompleterUI(function () { return completer !== autocompleter ? autocomplete_getAutoCompleterUI(completer) : AutocompleterUI; }); setFilterValue(query); }, [textContent]); var _ref6 = filteredOptions[selectedIndex] || {}, _ref6$key = _ref6.key, selectedKey = _ref6$key === void 0 ? '' : _ref6$key; var _ref7 = autocompleter || {}, className = _ref7.className; var isExpanded = !!autocompleter && filteredOptions.length > 0; var listBoxId = isExpanded ? "components-autocomplete-listbox-".concat(instanceId) : null; var activeId = isExpanded ? "components-autocomplete-item-".concat(instanceId, "-").concat(selectedKey) : null; return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, children({ isExpanded: isExpanded, listBoxId: listBoxId, activeId: activeId, onKeyDown: handleKeyDown }), isSelected && AutocompleterUI && Object(external_this_wp_element_["createElement"])(AutocompleterUI, { className: className, filterValue: filterValue, instanceId: instanceId, listBoxId: listBoxId, selectedIndex: selectedIndex, onChangeOptions: onChangeOptions, onSelect: select })); } /* harmony default export */ var autocomplete = (with_spoken_messages(Autocomplete)); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/styles/unit-control-styles.js function unit_control_styles_EMOTION_STRINGIFIED_CSS_ERROR_() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /** * External dependencies */ /** * Internal dependencies */ var unit_control_styles_Root = styled_base_browser_esm("div", { target: "e1agakv00", label: "Root" })( true ? { name: "1bt0omd", styles: "box-sizing:border-box;position:relative;" } : undefined); var unit_control_styles_paddingStyles = function paddingStyles(_ref2) { var disableUnits = _ref2.disableUnits; var value = disableUnits ? 3 : 24; return /*#__PURE__*/css_browser_esm(rtl({ paddingRight: value })(), ";" + ( true ? "" : undefined)); }; var unit_control_styles_ref = true ? { name: "1y65o8", styles: "&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0;}" } : undefined; var arrowStyles = function arrowStyles(_ref3) { var disableUnits = _ref3.disableUnits; if (disableUnits) return ''; return unit_control_styles_ref; }; // TODO: Resolve need to use &&& to increase specificity // https://github.com/WordPress/gutenberg/issues/18483 var ValueInput = /*#__PURE__*/styled_base_browser_esm(number_control, { target: "e1agakv01", label: "ValueInput" })("&&&{input{appearance:none;-moz-appearance:textfield;display:block;width:100%;", arrowStyles, ";", unit_control_styles_paddingStyles, ";}}" + ( true ? "" : undefined)); var unit_control_styles_unitSizeStyles = function unitSizeStyles(_ref4) { var size = _ref4.size; var sizes = { default: { height: 28, lineHeight: '24px', minHeight: 28, top: 1 }, small: { height: 22, lineHeight: '18px', minHeight: 22, top: 1 } }; return /*#__PURE__*/css_browser_esm(sizes[size], true ? "" : undefined); }; var unit_control_styles_baseUnitLabelStyles = function baseUnitLabelStyles(props) { return /*#__PURE__*/css_browser_esm("appearance:none;background:transparent;border-radius:2px;border:none;box-sizing:border-box;color:", colors_color('darkGray.500'), ";display:block;font-size:8px;line-height:1;letter-spacing:-0.5px;outline:none;padding:2px 1px;position:absolute;text-align-last:center;text-transform:uppercase;width:20px;", rtl({ borderTopLeftRadius: 0, borderBottomLeftRadius: 0 })(), " ", rtl({ right: 0 })(), " ", unit_control_styles_unitSizeStyles(props), true ? "" : undefined); }; var UnitLabel = styled_base_browser_esm("div", { target: "e1agakv02", label: "UnitLabel" })("&&&{pointer-events:none;", unit_control_styles_baseUnitLabelStyles, ";}" + ( true ? "" : undefined)); var UnitSelect = styled_base_browser_esm("select", { target: "e1agakv03", label: "UnitSelect" })("&&&{", unit_control_styles_baseUnitLabelStyles, ";cursor:pointer;border:1px solid transparent;&:hover{background-color:", colors_color('lightGray.300'), ";}&:focus{border-color:", colors_color('ui.borderFocus'), ";outline:2px solid transparent;outline-offset:0;}&:disabled{cursor:initial;&:hover{background-color:transparent;}}}" + ( true ? "" : undefined)); // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/utils.js /** * External dependencies */ var CSS_UNITS = [{ value: 'px', label: 'px', default: 0 }, { value: '%', label: '%', default: 10 }, { value: 'em', label: 'em', default: 0 }, { value: 'rem', label: 'rem', default: 0 }, { value: 'vw', label: 'vw', default: 10 }, { value: 'vh', label: 'vh', default: 10 }]; var DEFAULT_UNIT = CSS_UNITS[0]; /** * Handles legacy value + unit handling. * This component use to manage both incoming value and units separately. * * Moving forward, ideally the value should be a string that contains both * the value and unit, example: '10px' * * @param {number|string} value Value * @param {string} unit Unit value * @param {Array} units Units to derive from. * @return {Array} The extracted number and unit. */ function getParsedValue(value, unit, units) { var initialValue = unit ? "".concat(value).concat(unit) : value; return parseUnit(initialValue, units); } /** * Checks if units are defined. * * @param {any} units Units to check. * @return {boolean} Whether units are defined. */ function hasUnits(units) { return !Object(external_this_lodash_["isEmpty"])(units) && units.length > 1 && units !== false; } /** * Parses a number and unit from a value. * * @param {string} initialValue Value to parse * @param {Array} units Units to derive from. * @return {Array} The extracted number and unit. */ function parseUnit(initialValue) { var units = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : CSS_UNITS; var value = String(initialValue).trim(); var num = parseFloat(value, 10); num = isNaN(num) ? '' : num; var unitMatch = value.match(/[\d.\-\+]*\s*(.*)/)[1]; var unit = unitMatch !== undefined ? unitMatch : ''; unit = unit.toLowerCase(); if (hasUnits(units)) { var match = units.find(function (item) { return item.value === unit; }); unit = match === null || match === void 0 ? void 0 : match.value; } else { unit = DEFAULT_UNIT.value; } return [num, unit]; } /** * Parses a number and unit from a value. Validates parsed value, using fallback * value if invalid. * * @param {number|string} next The next value. * @param {Array} units Units to derive from. * @param {number|string} fallbackValue The fallback value. * @param {string} fallbackUnit The fallback value. * @return {Array} The extracted number and unit. */ function getValidParsedUnit(next, units, fallbackValue, fallbackUnit) { var _parseUnit = parseUnit(next, units), _parseUnit2 = Object(slicedToArray["a" /* default */])(_parseUnit, 2), parsedValue = _parseUnit2[0], parsedUnit = _parseUnit2[1]; var baseValue = parsedValue; var baseUnit; if (isNaN(parsedValue) || parsedValue === '') { baseValue = fallbackValue; } baseUnit = parsedUnit || fallbackUnit; /** * If no unit is found, attempt to use the first value from the collection * of units as a default fallback. */ if (hasUnits(units) && !baseUnit) { var _units$; baseUnit = (_units$ = units[0]) === null || _units$ === void 0 ? void 0 : _units$.value; } return [baseValue, baseUnit]; } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/unit-control/unit-select-control.js /** * External dependencies */ /** * Internal dependencies */ /** * Renders a `select` if there are multiple units. * Otherwise, renders a non-selectable label. * * @param {Object} props Component props. * @param {string} [props.className] Class to set on the `select` element. * @param {boolean} [props.isTabbable=true] Whether the control can be focused via keyboard navigation. * @param {Array} [props.options=CSS_UNITS] Available units to select from. * @param {Function} [props.onChange=noop] A callback function invoked when the value is changed. * @param {string} [props.size="default"] Size of the control option. Supports "default" and "small". * @param {string} [props.value="px"] Current unit. */ function UnitSelectControl(_ref) { var className = _ref.className, _ref$isTabbable = _ref.isTabbable, isTabbable = _ref$isTabbable === void 0 ? true : _ref$isTabbable, _ref$options = _ref.options, options = _ref$options === void 0 ? CSS_UNITS : _ref$options, _ref$onChange = _ref.onChange, onChange = _ref$onChange === void 0 ? external_this_lodash_["noop"] : _ref$onChange, _ref$size = _ref.size, size = _ref$size === void 0 ? 'default' : _ref$size, _ref$value = _ref.value, value = _ref$value === void 0 ? 'px' : _ref$value, props = Object(objectWithoutProperties["a" /* default */])(_ref, ["className", "isTabbable", "options", "onChange", "size", "value"]); if (!hasUnits(options)) { return Object(external_this_wp_element_["createElement"])(UnitLabel, { className: "components-unit-control__unit-label", size: size }, value); } var handleOnChange = function handleOnChange(event) { var unitValue = event.target.value; var data = options.find(function (option) { return option.value === unitValue; }); onChange(unitValue, { event: event, data: data }); }; var classes = classnames_default()('components-unit-control__select', className); return Object(external_this_wp_element_["createElement"])(UnitSelect, Object(esm_extends["a" /* default */])({ className: classes, onChange: handleOnChange, size: size, tabIndex: isTabbable ? null : '-1', value: value }, props), options.map(function (option) { return Object(external_this_wp_element_["createElement"])("option", { value: option.value, key: option.value }, option.label); })); } // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/utils/hooks/use-controlled-state.js function use_controlled_state_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function use_controlled_state_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { use_controlled_state_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { use_controlled_state_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } /** * WordPress dependencies */ /** * Internal dependencies */ var defaultOptions = { initial: undefined, /** * Defaults to empty string, as that is preferred for usage with * ,