[ Index ] |
PHP Cross Reference of WordPress |
[Summary view] [Print] [Text view]
1 this["wp"] = this["wp"] || {}; this["wp"]["components"] = 2 /******/ (function(modules) { // webpackBootstrap 3 /******/ // The module cache 4 /******/ var installedModules = {}; 5 /******/ 6 /******/ // The require function 7 /******/ function __webpack_require__(moduleId) { 8 /******/ 9 /******/ // Check if module is in cache 10 /******/ if(installedModules[moduleId]) { 11 /******/ return installedModules[moduleId].exports; 12 /******/ } 13 /******/ // Create a new module (and put it into the cache) 14 /******/ var module = installedModules[moduleId] = { 15 /******/ i: moduleId, 16 /******/ l: false, 17 /******/ exports: {} 18 /******/ }; 19 /******/ 20 /******/ // Execute the module function 21 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 22 /******/ 23 /******/ // Flag the module as loaded 24 /******/ module.l = true; 25 /******/ 26 /******/ // Return the exports of the module 27 /******/ return module.exports; 28 /******/ } 29 /******/ 30 /******/ 31 /******/ // expose the modules object (__webpack_modules__) 32 /******/ __webpack_require__.m = modules; 33 /******/ 34 /******/ // expose the module cache 35 /******/ __webpack_require__.c = installedModules; 36 /******/ 37 /******/ // define getter function for harmony exports 38 /******/ __webpack_require__.d = function(exports, name, getter) { 39 /******/ if(!__webpack_require__.o(exports, name)) { 40 /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 41 /******/ } 42 /******/ }; 43 /******/ 44 /******/ // define __esModule on exports 45 /******/ __webpack_require__.r = function(exports) { 46 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 47 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 48 /******/ } 49 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 50 /******/ }; 51 /******/ 52 /******/ // create a fake namespace object 53 /******/ // mode & 1: value is a module id, require it 54 /******/ // mode & 2: merge all properties of value into the ns 55 /******/ // mode & 4: return value when already ns object 56 /******/ // mode & 8|1: behave like require 57 /******/ __webpack_require__.t = function(value, mode) { 58 /******/ if(mode & 1) value = __webpack_require__(value); 59 /******/ if(mode & 8) return value; 60 /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 61 /******/ var ns = Object.create(null); 62 /******/ __webpack_require__.r(ns); 63 /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 64 /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 65 /******/ return ns; 66 /******/ }; 67 /******/ 68 /******/ // getDefaultExport function for compatibility with non-harmony modules 69 /******/ __webpack_require__.n = function(module) { 70 /******/ var getter = module && module.__esModule ? 71 /******/ function getDefault() { return module['default']; } : 72 /******/ function getModuleExports() { return module; }; 73 /******/ __webpack_require__.d(getter, 'a', getter); 74 /******/ return getter; 75 /******/ }; 76 /******/ 77 /******/ // Object.prototype.hasOwnProperty.call 78 /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 79 /******/ 80 /******/ // __webpack_public_path__ 81 /******/ __webpack_require__.p = ""; 82 /******/ 83 /******/ 84 /******/ // Load entry module and return exports 85 /******/ return __webpack_require__(__webpack_require__.s = 271); 86 /******/ }) 87 /************************************************************************/ 88 /******/ ([ 89 /* 0 */ 90 /***/ (function(module, exports) { 91 92 (function() { module.exports = window["wp"]["element"]; }()); 93 94 /***/ }), 95 /* 1 */ 96 /***/ (function(module, exports) { 97 98 (function() { module.exports = window["wp"]["i18n"]; }()); 99 100 /***/ }), 101 /* 2 */ 102 /***/ (function(module, exports) { 103 104 (function() { module.exports = window["lodash"]; }()); 105 106 /***/ }), 107 /* 3 */, 108 /* 4 */, 109 /* 5 */ 110 /***/ (function(module, __webpack_exports__, __webpack_require__) { 111 112 "use strict"; 113 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _defineProperty; }); 114 function _defineProperty(obj, key, value) { 115 if (key in obj) { 116 Object.defineProperty(obj, key, { 117 value: value, 118 enumerable: true, 119 configurable: true, 120 writable: true 121 }); 122 } else { 123 obj[key] = value; 124 } 125 126 return obj; 127 } 128 129 /***/ }), 130 /* 6 */, 131 /* 7 */ 132 /***/ (function(module, exports) { 133 134 (function() { module.exports = window["wp"]["primitives"]; }()); 135 136 /***/ }), 137 /* 8 */ 138 /***/ (function(module, __webpack_exports__, __webpack_require__) { 139 140 "use strict"; 141 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _extends; }); 142 function _extends() { 143 _extends = Object.assign || function (target) { 144 for (var i = 1; i < arguments.length; i++) { 145 var source = arguments[i]; 146 147 for (var key in source) { 148 if (Object.prototype.hasOwnProperty.call(source, key)) { 149 target[key] = source[key]; 150 } 151 } 152 } 153 154 return target; 155 }; 156 157 return _extends.apply(this, arguments); 158 } 159 160 /***/ }), 161 /* 9 */, 162 /* 10 */ 163 /***/ (function(module, exports, __webpack_require__) { 164 165 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 166 Copyright (c) 2018 Jed Watson. 167 Licensed under the MIT License (MIT), see 168 http://jedwatson.github.io/classnames 169 */ 170 /* global define */ 171 172 (function () { 173 'use strict'; 174 175 var hasOwn = {}.hasOwnProperty; 176 177 function classNames() { 178 var classes = []; 179 180 for (var i = 0; i < arguments.length; i++) { 181 var arg = arguments[i]; 182 if (!arg) continue; 183 184 var argType = typeof arg; 185 186 if (argType === 'string' || argType === 'number') { 187 classes.push(arg); 188 } else if (Array.isArray(arg)) { 189 if (arg.length) { 190 var inner = classNames.apply(null, arg); 191 if (inner) { 192 classes.push(inner); 193 } 194 } 195 } else if (argType === 'object') { 196 if (arg.toString === Object.prototype.toString) { 197 for (var key in arg) { 198 if (hasOwn.call(arg, key) && arg[key]) { 199 classes.push(key); 200 } 201 } 202 } else { 203 classes.push(arg.toString()); 204 } 205 } 206 } 207 208 return classes.join(' '); 209 } 210 211 if ( true && module.exports) { 212 classNames.default = classNames; 213 module.exports = classNames; 214 } else if (true) { 215 // register as 'classnames', consistent with npm package name 216 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { 217 return classNames; 218 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 219 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 220 } else {} 221 }()); 222 223 224 /***/ }), 225 /* 11 */ 226 /***/ (function(module, exports) { 227 228 (function() { module.exports = window["wp"]["compose"]; }()); 229 230 /***/ }), 231 /* 12 */ 232 /***/ (function(module, __webpack_exports__, __webpack_require__) { 233 234 "use strict"; 235 236 // EXPORTS 237 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _slicedToArray; }); 238 239 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js 240 var arrayWithHoles = __webpack_require__(37); 241 242 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js 243 function _iterableToArrayLimit(arr, i) { 244 if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; 245 var _arr = []; 246 var _n = true; 247 var _d = false; 248 var _e = undefined; 249 250 try { 251 for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { 252 _arr.push(_s.value); 253 254 if (i && _arr.length === i) break; 255 } 256 } catch (err) { 257 _d = true; 258 _e = err; 259 } finally { 260 try { 261 if (!_n && _i["return"] != null) _i["return"](); 262 } finally { 263 if (_d) throw _e; 264 } 265 } 266 267 return _arr; 268 } 269 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 270 var unsupportedIterableToArray = __webpack_require__(28); 271 272 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js 273 var nonIterableRest = __webpack_require__(38); 274 275 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js 276 277 278 279 280 function _slicedToArray(arr, i) { 281 return Object(arrayWithHoles["a" /* default */])(arr) || _iterableToArrayLimit(arr, i) || Object(unsupportedIterableToArray["a" /* default */])(arr, i) || Object(nonIterableRest["a" /* default */])(); 282 } 283 284 /***/ }), 285 /* 13 */ 286 /***/ (function(module, __webpack_exports__, __webpack_require__) { 287 288 "use strict"; 289 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutProperties; }); 290 /* harmony import */ var _objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44); 291 292 function _objectWithoutProperties(source, excluded) { 293 if (source == null) return {}; 294 var target = Object(_objectWithoutPropertiesLoose_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(source, excluded); 295 var key, i; 296 297 if (Object.getOwnPropertySymbols) { 298 var sourceSymbolKeys = Object.getOwnPropertySymbols(source); 299 300 for (i = 0; i < sourceSymbolKeys.length; i++) { 301 key = sourceSymbolKeys[i]; 302 if (excluded.indexOf(key) >= 0) continue; 303 if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; 304 target[key] = source[key]; 305 } 306 } 307 308 return target; 309 } 310 311 /***/ }), 312 /* 14 */ 313 /***/ (function(module, exports) { 314 315 (function() { module.exports = window["React"]; }()); 316 317 /***/ }), 318 /* 15 */ 319 /***/ (function(module, __webpack_exports__, __webpack_require__) { 320 321 "use strict"; 322 323 // EXPORTS 324 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ _toConsumableArray; }); 325 326 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js 327 var arrayLikeToArray = __webpack_require__(24); 328 329 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js 330 331 function _arrayWithoutHoles(arr) { 332 if (Array.isArray(arr)) return Object(arrayLikeToArray["a" /* default */])(arr); 333 } 334 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js 335 var iterableToArray = __webpack_require__(39); 336 337 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js 338 var unsupportedIterableToArray = __webpack_require__(28); 339 340 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js 341 function _nonIterableSpread() { 342 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 343 } 344 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js 345 346 347 348 349 function _toConsumableArray(arr) { 350 return _arrayWithoutHoles(arr) || Object(iterableToArray["a" /* default */])(arr) || Object(unsupportedIterableToArray["a" /* default */])(arr) || _nonIterableSpread(); 351 } 352 353 /***/ }), 354 /* 16 */ 355 /***/ (function(module, exports) { 356 357 (function() { module.exports = window["regeneratorRuntime"]; }()); 358 359 /***/ }), 360 /* 17 */ 361 /***/ (function(module, exports) { 362 363 (function() { module.exports = window["wp"]["keycodes"]; }()); 364 365 /***/ }), 366 /* 18 */ 367 /***/ (function(module, __webpack_exports__, __webpack_require__) { 368 369 "use strict"; 370 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _assertThisInitialized; }); 371 function _assertThisInitialized(self) { 372 if (self === void 0) { 373 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 374 } 375 376 return self; 377 } 378 379 /***/ }), 380 /* 19 */ 381 /***/ (function(module, exports) { 382 383 (function() { module.exports = window["wp"]["richText"]; }()); 384 385 /***/ }), 386 /* 20 */ 387 /***/ (function(module, __webpack_exports__, __webpack_require__) { 388 389 "use strict"; 390 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); 391 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; }); 392 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; }); 393 function _defineProperty(obj, key, value) { 394 if (key in obj) { 395 Object.defineProperty(obj, key, { 396 value: value, 397 enumerable: true, 398 configurable: true, 399 writable: true 400 }); 401 } else { 402 obj[key] = value; 403 } 404 405 return obj; 406 } 407 408 function ownKeys(object, enumerableOnly) { 409 var keys = Object.keys(object); 410 411 if (Object.getOwnPropertySymbols) { 412 var symbols = Object.getOwnPropertySymbols(object); 413 if (enumerableOnly) symbols = symbols.filter(function (sym) { 414 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 415 }); 416 keys.push.apply(keys, symbols); 417 } 418 419 return keys; 420 } 421 422 function _objectSpread2(target) { 423 for (var i = 1; i < arguments.length; i++) { 424 var source = arguments[i] != null ? arguments[i] : {}; 425 426 if (i % 2) { 427 ownKeys(Object(source), true).forEach(function (key) { 428 _defineProperty(target, key, source[key]); 429 }); 430 } else if (Object.getOwnPropertyDescriptors) { 431 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 432 } else { 433 ownKeys(Object(source)).forEach(function (key) { 434 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 435 }); 436 } 437 } 438 439 return target; 440 } 441 442 function _objectWithoutPropertiesLoose(source, excluded) { 443 if (source == null) return {}; 444 var target = {}; 445 var sourceKeys = Object.keys(source); 446 var key, i; 447 448 for (i = 0; i < sourceKeys.length; i++) { 449 key = sourceKeys[i]; 450 if (excluded.indexOf(key) >= 0) continue; 451 target[key] = source[key]; 452 } 453 454 return target; 455 } 456 457 function _unsupportedIterableToArray(o, minLen) { 458 if (!o) return; 459 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 460 var n = Object.prototype.toString.call(o).slice(8, -1); 461 if (n === "Object" && o.constructor) n = o.constructor.name; 462 if (n === "Map" || n === "Set") return Array.from(o); 463 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 464 } 465 466 function _arrayLikeToArray(arr, len) { 467 if (len == null || len > arr.length) len = arr.length; 468 469 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 470 471 return arr2; 472 } 473 474 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 475 var it; 476 477 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 478 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 479 if (it) o = it; 480 var i = 0; 481 return function () { 482 if (i >= o.length) return { 483 done: true 484 }; 485 return { 486 done: false, 487 value: o[i++] 488 }; 489 }; 490 } 491 492 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 493 } 494 495 it = o[Symbol.iterator](); 496 return it.next.bind(it); 497 } 498 499 500 501 502 /***/ }), 503 /* 21 */, 504 /* 22 */ 505 /***/ (function(module, __webpack_exports__, __webpack_require__) { 506 507 "use strict"; 508 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _getPrototypeOf; }); 509 function _getPrototypeOf(o) { 510 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 511 return o.__proto__ || Object.getPrototypeOf(o); 512 }; 513 return _getPrototypeOf(o); 514 } 515 516 /***/ }), 517 /* 23 */, 518 /* 24 */ 519 /***/ (function(module, __webpack_exports__, __webpack_require__) { 520 521 "use strict"; 522 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayLikeToArray; }); 523 function _arrayLikeToArray(arr, len) { 524 if (len == null || len > arr.length) len = arr.length; 525 526 for (var i = 0, arr2 = new Array(len); i < len; i++) { 527 arr2[i] = arr[i]; 528 } 529 530 return arr2; 531 } 532 533 /***/ }), 534 /* 25 */ 535 /***/ (function(module, __webpack_exports__, __webpack_require__) { 536 537 "use strict"; 538 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _classCallCheck; }); 539 function _classCallCheck(instance, Constructor) { 540 if (!(instance instanceof Constructor)) { 541 throw new TypeError("Cannot call a class as a function"); 542 } 543 } 544 545 /***/ }), 546 /* 26 */ 547 /***/ (function(module, __webpack_exports__, __webpack_require__) { 548 549 "use strict"; 550 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _createClass; }); 551 function _defineProperties(target, props) { 552 for (var i = 0; i < props.length; i++) { 553 var descriptor = props[i]; 554 descriptor.enumerable = descriptor.enumerable || false; 555 descriptor.configurable = true; 556 if ("value" in descriptor) descriptor.writable = true; 557 Object.defineProperty(target, descriptor.key, descriptor); 558 } 559 } 560 561 function _createClass(Constructor, protoProps, staticProps) { 562 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 563 if (staticProps) _defineProperties(Constructor, staticProps); 564 return Constructor; 565 } 566 567 /***/ }), 568 /* 27 */ 569 /***/ (function(module, exports) { 570 571 (function() { module.exports = window["wp"]["dom"]; }()); 572 573 /***/ }), 574 /* 28 */ 575 /***/ (function(module, __webpack_exports__, __webpack_require__) { 576 577 "use strict"; 578 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _unsupportedIterableToArray; }); 579 /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(24); 580 581 function _unsupportedIterableToArray(o, minLen) { 582 if (!o) return; 583 if (typeof o === "string") return Object(_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); 584 var n = Object.prototype.toString.call(o).slice(8, -1); 585 if (n === "Object" && o.constructor) n = o.constructor.name; 586 if (n === "Map" || n === "Set") return Array.from(o); 587 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(_arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(o, minLen); 588 } 589 590 /***/ }), 591 /* 29 */, 592 /* 30 */, 593 /* 31 */ 594 /***/ (function(module, exports, __webpack_require__) { 595 596 /** 597 * Copyright (c) 2013-present, Facebook, Inc. 598 * 599 * This source code is licensed under the MIT license found in the 600 * LICENSE file in the root directory of this source tree. 601 */ 602 603 if (false) { var throwOnDirectAccess, ReactIs; } else { 604 // By explicitly using `prop-types` you are opting into new production behavior. 605 // http://fb.me/prop-types-in-prod 606 module.exports = __webpack_require__(137)(); 607 } 608 609 610 /***/ }), 611 /* 32 */ 612 /***/ (function(module, __webpack_exports__, __webpack_require__) { 613 614 "use strict"; 615 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _inherits; }); 616 /* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(55); 617 618 function _inherits(subClass, superClass) { 619 if (typeof superClass !== "function" && superClass !== null) { 620 throw new TypeError("Super expression must either be null or a function"); 621 } 622 623 subClass.prototype = Object.create(superClass && superClass.prototype, { 624 constructor: { 625 value: subClass, 626 writable: true, 627 configurable: true 628 } 629 }); 630 if (superClass) Object(_setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__[/* default */ "a"])(subClass, superClass); 631 } 632 633 /***/ }), 634 /* 33 */ 635 /***/ (function(module, exports) { 636 637 (function() { module.exports = window["wp"]["hooks"]; }()); 638 639 /***/ }), 640 /* 34 */ 641 /***/ (function(module, __webpack_exports__, __webpack_require__) { 642 643 "use strict"; 644 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _possibleConstructorReturn; }); 645 /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(59); 646 /* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__); 647 /* harmony import */ var _assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18); 648 649 650 function _possibleConstructorReturn(self, call) { 651 if (call && (_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(call) === "object" || typeof call === "function")) { 652 return call; 653 } 654 655 return Object(_assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(self); 656 } 657 658 /***/ }), 659 /* 35 */ 660 /***/ (function(module, exports) { 661 662 (function() { module.exports = window["wp"]["deprecated"]; }()); 663 664 /***/ }), 665 /* 36 */ 666 /***/ (function(module, __webpack_exports__, __webpack_require__) { 667 668 "use strict"; 669 670 // UNUSED EXPORTS: Button 671 672 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 673 var esm_extends = __webpack_require__(8); 674 675 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 676 var objectWithoutProperties = __webpack_require__(13); 677 678 // EXTERNAL MODULE: external ["wp","element"] 679 var external_wp_element_ = __webpack_require__(0); 680 681 // EXTERNAL MODULE: ./node_modules/classnames/index.js 682 var classnames = __webpack_require__(10); 683 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 684 685 // EXTERNAL MODULE: external "lodash" 686 var external_lodash_ = __webpack_require__(2); 687 688 // EXTERNAL MODULE: external ["wp","deprecated"] 689 var external_wp_deprecated_ = __webpack_require__(35); 690 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); 691 692 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js + 1 modules 693 var tooltip = __webpack_require__(80); 694 695 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/icon/index.js 696 var build_module_icon = __webpack_require__(77); 697 698 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js + 2 modules 699 var visually_hidden = __webpack_require__(58); 700 701 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 702 var defineProperty = __webpack_require__(5); 703 704 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js 705 var with_next = __webpack_require__(526); 706 707 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/next.js 708 709 710 711 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; } 712 713 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; } 714 715 /** 716 * Internal dependencies 717 */ 718 719 720 var Button = false ? undefined : undefined; 721 722 var getVariant = function getVariant(_ref) { 723 var isPrimary = _ref.isPrimary, 724 isTertiary = _ref.isTertiary, 725 isSecondary = _ref.isSecondary, 726 isLink = _ref.isLink, 727 isDefault = _ref.isDefault; 728 729 if (isPrimary) { 730 return 'primary'; 731 } 732 733 if (isTertiary) { 734 return 'tertiary'; 735 } 736 737 if (isSecondary) { 738 return 'secondary'; 739 } 740 741 if (isDefault) { 742 return 'plain'; 743 } 744 745 if (isLink) { 746 return 'link'; 747 } 748 749 return 'plain'; 750 }; 751 752 var next_adapter = function adapter(_ref2) { 753 var isPrimary = _ref2.isPrimary, 754 isTertiary = _ref2.isTertiary, 755 isSecondary = _ref2.isSecondary, 756 isLink = _ref2.isLink, 757 isDefault = _ref2.isDefault, 758 isSmall = _ref2.isSmall, 759 isBusy = _ref2.isBusy, 760 label = _ref2.label, 761 ariaLabel = _ref2['aria-label'], 762 describedBy = _ref2.describedBy, 763 shortcut = _ref2.shortcut, 764 tooltipPosition = _ref2.tooltipPosition, 765 text = _ref2.text, 766 props = Object(objectWithoutProperties["a" /* default */])(_ref2, ["isPrimary", "isTertiary", "isSecondary", "isLink", "isDefault", "isSmall", "isBusy", "label", "aria-label", "describedBy", "shortcut", "tooltipPosition", "text"]); 767 768 return _objectSpread(_objectSpread({}, props), {}, { 769 describedBy: describedBy, 770 variant: getVariant({ 771 isPrimary: isPrimary, 772 isTertiary: isTertiary, 773 isSecondary: isSecondary, 774 isLink: isLink, 775 isDefault: isDefault 776 }), 777 isActive: isBusy, 778 isLoading: isBusy, 779 size: isSmall ? 'small' : undefined, 780 'aria-label': ariaLabel || label, 781 pre: text, 782 tooltip: { 783 content: describedBy ? describedBy : ariaLabel || label, 784 position: tooltipPosition, 785 shortcut: shortcut 786 } 787 }); 788 }; 789 790 function withNextComponent(Component) { 791 return Object(with_next["a" /* withNext */])(Component, Button, 'WPComponentsButton', next_adapter); 792 } 793 794 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/button/index.js 795 796 797 798 799 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; } } }; } 800 801 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); } 802 803 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; } 804 805 /** 806 * External dependencies 807 */ 808 809 810 /** 811 * WordPress dependencies 812 */ 813 814 815 816 /** 817 * Internal dependencies 818 */ 819 820 821 822 823 824 var disabledEventsOnDisabledButton = ['onMouseDown', 'onClick']; 825 function button_Button(props, ref) { 826 var href = props.href, 827 target = props.target, 828 isPrimary = props.isPrimary, 829 isSmall = props.isSmall, 830 isTertiary = props.isTertiary, 831 isPressed = props.isPressed, 832 isBusy = props.isBusy, 833 isDefault = props.isDefault, 834 isSecondary = props.isSecondary, 835 isLink = props.isLink, 836 isDestructive = props.isDestructive, 837 className = props.className, 838 disabled = props.disabled, 839 icon = props.icon, 840 _props$iconPosition = props.iconPosition, 841 iconPosition = _props$iconPosition === void 0 ? 'left' : _props$iconPosition, 842 iconSize = props.iconSize, 843 showTooltip = props.showTooltip, 844 tooltipPosition = props.tooltipPosition, 845 shortcut = props.shortcut, 846 label = props.label, 847 children = props.children, 848 text = props.text, 849 isFocusable = props.__experimentalIsFocusable, 850 describedBy = props.describedBy, 851 additionalProps = Object(objectWithoutProperties["a" /* default */])(props, ["href", "target", "isPrimary", "isSmall", "isTertiary", "isPressed", "isBusy", "isDefault", "isSecondary", "isLink", "isDestructive", "className", "disabled", "icon", "iconPosition", "iconSize", "showTooltip", "tooltipPosition", "shortcut", "label", "children", "text", "__experimentalIsFocusable", "describedBy"]); 852 853 if (isDefault) { 854 external_wp_deprecated_default()('Button isDefault prop', { 855 since: '5.4', 856 alternative: 'isSecondary' 857 }); 858 } 859 860 var classes = classnames_default()('components-button', className, { 861 'is-secondary': isDefault || isSecondary, 862 'is-primary': isPrimary, 863 'is-small': isSmall, 864 'is-tertiary': isTertiary, 865 'is-pressed': isPressed, 866 'is-busy': isBusy, 867 'is-link': isLink, 868 'is-destructive': isDestructive, 869 'has-text': !!icon && !!children, 870 'has-icon': !!icon 871 }); 872 var trulyDisabled = disabled && !isFocusable; 873 var Tag = href !== undefined && !trulyDisabled ? 'a' : 'button'; 874 var tagProps = Tag === 'a' ? { 875 href: href, 876 target: target 877 } : { 878 type: 'button', 879 disabled: trulyDisabled, 880 'aria-pressed': isPressed 881 }; 882 883 if (disabled && isFocusable) { 884 // In this case, the button will be disabled, but still focusable and 885 // perceivable by screen reader users. 886 tagProps['aria-disabled'] = true; 887 888 var _iterator = _createForOfIteratorHelper(disabledEventsOnDisabledButton), 889 _step; 890 891 try { 892 for (_iterator.s(); !(_step = _iterator.n()).done;) { 893 var disabledEvent = _step.value; 894 895 additionalProps[disabledEvent] = function (event) { 896 event.stopPropagation(); 897 event.preventDefault(); 898 }; 899 } 900 } catch (err) { 901 _iterator.e(err); 902 } finally { 903 _iterator.f(); 904 } 905 } // Should show the tooltip if... 906 907 908 var shouldShowTooltip = !trulyDisabled && ( // an explicit tooltip is passed or... 909 showTooltip && label || // there's a shortcut or... 910 shortcut || // there's a label and... 911 !!label && ( // the children are empty and... 912 !children || Object(external_lodash_["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled. 913 false !== showTooltip); 914 var descriptionId = describedBy ? Object(external_lodash_["uniqueId"])() : null; 915 var describedById = additionalProps['aria-describedby'] || descriptionId; 916 var element = Object(external_wp_element_["createElement"])(Tag, Object(esm_extends["a" /* default */])({}, tagProps, additionalProps, { 917 className: classes, 918 "aria-label": additionalProps['aria-label'] || label, 919 "aria-describedby": describedById, 920 ref: ref 921 }), icon && iconPosition === 'left' && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 922 icon: icon, 923 size: iconSize 924 }), text && Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, text), icon && iconPosition === 'right' && Object(external_wp_element_["createElement"])(build_module_icon["a" /* default */], { 925 icon: icon, 926 size: iconSize 927 }), children); 928 929 if (!shouldShowTooltip) { 930 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, element, describedBy && Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], null, Object(external_wp_element_["createElement"])("span", { 931 id: descriptionId 932 }, describedBy))); 933 } 934 935 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(tooltip["a" /* default */], { 936 text: describedBy ? describedBy : label, 937 shortcut: shortcut, 938 position: tooltipPosition 939 }, element), describedBy && Object(external_wp_element_["createElement"])(visually_hidden["a" /* default */], null, Object(external_wp_element_["createElement"])("span", { 940 id: descriptionId 941 }, describedBy))); 942 } 943 /* harmony default export */ var build_module_button = __webpack_exports__["a"] = (withNextComponent(Object(external_wp_element_["forwardRef"])(button_Button))); 944 945 946 /***/ }), 947 /* 37 */ 948 /***/ (function(module, __webpack_exports__, __webpack_require__) { 949 950 "use strict"; 951 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _arrayWithHoles; }); 952 function _arrayWithHoles(arr) { 953 if (Array.isArray(arr)) return arr; 954 } 955 956 /***/ }), 957 /* 38 */ 958 /***/ (function(module, __webpack_exports__, __webpack_require__) { 959 960 "use strict"; 961 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _nonIterableRest; }); 962 function _nonIterableRest() { 963 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 964 } 965 966 /***/ }), 967 /* 39 */ 968 /***/ (function(module, __webpack_exports__, __webpack_require__) { 969 970 "use strict"; 971 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _iterableToArray; }); 972 function _iterableToArray(iter) { 973 if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); 974 } 975 976 /***/ }), 977 /* 40 */, 978 /* 41 */ 979 /***/ (function(module, __webpack_exports__, __webpack_require__) { 980 981 "use strict"; 982 983 // EXPORTS 984 __webpack_require__.d(__webpack_exports__, "a", function() { return /* reexport */ ThemeContext; }); 985 __webpack_require__.d(__webpack_exports__, "d", function() { return /* reexport */ emotion_element_57a3a7a3_browser_esm_withEmotionCache; }); 986 __webpack_require__.d(__webpack_exports__, "b", function() { return /* reexport */ css_browser_esm; }); 987 __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ core_browser_esm_keyframes; }); 988 989 // UNUSED EXPORTS: CacheProvider, ClassNames, Global, createElement, jsx 990 991 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js 992 var inheritsLoose = __webpack_require__(178); 993 994 // EXTERNAL MODULE: external "React" 995 var external_React_ = __webpack_require__(14); 996 997 // EXTERNAL MODULE: ./node_modules/@emotion/cache/dist/cache.browser.esm.js + 1 modules 998 var cache_browser_esm = __webpack_require__(204); 999 1000 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inheritsLoose.js 1001 var helpers_inheritsLoose = __webpack_require__(158); 1002 1003 // EXTERNAL MODULE: ./node_modules/@emotion/utils/dist/utils.browser.esm.js 1004 var utils_browser_esm = __webpack_require__(99); 1005 1006 // EXTERNAL MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js + 2 modules 1007 var serialize_browser_esm = __webpack_require__(98); 1008 1009 // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/emotion-element-57a3a7a3.browser.esm.js 1010 1011 1012 1013 1014 1015 1016 var emotion_element_57a3a7a3_browser_esm_hasOwnProperty = Object.prototype.hasOwnProperty; 1017 1018 var EmotionCacheContext = /*#__PURE__*/Object(external_React_["createContext"])( // we're doing this to avoid preconstruct's dead code elimination in this one case 1019 // because this module is primarily intended for the browser and node 1020 // but it's also required in react native and similar environments sometimes 1021 // and we could have a special build just for that 1022 // but this is much easier and the native packages 1023 // might use a different theme context in the future anyway 1024 typeof HTMLElement !== 'undefined' ? Object(cache_browser_esm["a" /* default */])() : null); 1025 var ThemeContext = /*#__PURE__*/Object(external_React_["createContext"])({}); 1026 var CacheProvider = EmotionCacheContext.Provider; 1027 1028 var emotion_element_57a3a7a3_browser_esm_withEmotionCache = function withEmotionCache(func) { 1029 var render = function render(props, ref) { 1030 return /*#__PURE__*/Object(external_React_["createElement"])(EmotionCacheContext.Consumer, null, function (cache) { 1031 return func(props, cache, ref); 1032 }); 1033 }; // $FlowFixMe 1034 1035 1036 return /*#__PURE__*/Object(external_React_["forwardRef"])(render); 1037 }; 1038 1039 // thus we only need to replace what is a valid character for JS, but not for CSS 1040 1041 var sanitizeIdentifier = function sanitizeIdentifier(identifier) { 1042 return identifier.replace(/\$/g, '-'); 1043 }; 1044 1045 var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__'; 1046 var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__'; 1047 var createEmotionProps = function createEmotionProps(type, props) { 1048 if (false) {} 1049 1050 var newProps = {}; 1051 1052 for (var key in props) { 1053 if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key)) { 1054 newProps[key] = props[key]; 1055 } 1056 } 1057 1058 newProps[typePropName] = type; // TODO: check if this still works with all of those different JSX functions 1059 1060 if (false) { var match, error; } 1061 1062 return newProps; 1063 }; 1064 1065 var emotion_element_57a3a7a3_browser_esm_render = function render(cache, props, theme, ref) { 1066 var cssProp = theme === null ? props.css : props.css(theme); // so that using `css` from `emotion` and passing the result to the css prop works 1067 // not passing the registered cache to serializeStyles because it would 1068 // make certain babel optimisations not possible 1069 1070 if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) { 1071 cssProp = cache.registered[cssProp]; 1072 } 1073 1074 var type = props[typePropName]; 1075 var registeredStyles = [cssProp]; 1076 var className = ''; 1077 1078 if (typeof props.className === 'string') { 1079 className = Object(utils_browser_esm["a" /* getRegisteredStyles */])(cache.registered, registeredStyles, props.className); 1080 } else if (props.className != null) { 1081 className = props.className + " "; 1082 } 1083 1084 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(registeredStyles); 1085 1086 if (false) { var labelFromStack; } 1087 1088 var rules = Object(utils_browser_esm["b" /* insertStyles */])(cache, serialized, typeof type === 'string'); 1089 className += cache.key + "-" + serialized.name; 1090 var newProps = {}; 1091 1092 for (var key in props) { 1093 if (emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && ( true || false)) { 1094 newProps[key] = props[key]; 1095 } 1096 } 1097 1098 newProps.ref = ref; 1099 newProps.className = className; 1100 var ele = /*#__PURE__*/Object(external_React_["createElement"])(type, newProps); 1101 1102 return ele; 1103 }; // eslint-disable-next-line no-undef 1104 1105 1106 var Emotion = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache, ref) { 1107 if (typeof props.css === 'function') { 1108 return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { 1109 return emotion_element_57a3a7a3_browser_esm_render(cache, props, theme, ref); 1110 }); 1111 } 1112 1113 return emotion_element_57a3a7a3_browser_esm_render(cache, props, null, ref); 1114 }); 1115 1116 if (false) {} 1117 1118 1119 1120 // EXTERNAL MODULE: ./node_modules/@emotion/sheet/dist/sheet.browser.esm.js 1121 var sheet_browser_esm = __webpack_require__(179); 1122 1123 // CONCATENATED MODULE: ./node_modules/@emotion/css/dist/css.browser.esm.js 1124 1125 1126 function css_browser_esm_css() { 1127 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 1128 args[_key] = arguments[_key]; 1129 } 1130 1131 return Object(serialize_browser_esm["a" /* serializeStyles */])(args); 1132 } 1133 1134 /* harmony default export */ var css_browser_esm = (css_browser_esm_css); 1135 1136 // CONCATENATED MODULE: ./node_modules/@emotion/core/dist/core.browser.esm.js 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 var core_browser_esm_jsx = function jsx(type, props) { 1149 var args = arguments; 1150 1151 if (props == null || !emotion_element_57a3a7a3_browser_esm_hasOwnProperty.call(props, 'css')) { 1152 // $FlowFixMe 1153 return external_React_["createElement"].apply(undefined, args); 1154 } 1155 1156 var argsLength = args.length; 1157 var createElementArgArray = new Array(argsLength); 1158 createElementArgArray[0] = Emotion; 1159 createElementArgArray[1] = createEmotionProps(type, props); 1160 1161 for (var i = 2; i < argsLength; i++) { 1162 createElementArgArray[i] = args[i]; 1163 } // $FlowFixMe 1164 1165 1166 return external_React_["createElement"].apply(null, createElementArgArray); 1167 }; 1168 1169 var warnedAboutCssPropForGlobal = false; 1170 var Global = /* #__PURE__ */emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, cache) { 1171 if (false) {} 1172 1173 var styles = props.styles; 1174 1175 if (typeof styles === 'function') { 1176 return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { 1177 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles(theme)]); 1178 return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, { 1179 serialized: serialized, 1180 cache: cache 1181 }); 1182 }); 1183 } 1184 1185 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])([styles]); 1186 return /*#__PURE__*/Object(external_React_["createElement"])(core_browser_esm_InnerGlobal, { 1187 serialized: serialized, 1188 cache: cache 1189 }); 1190 }); 1191 1192 // maintain place over rerenders. 1193 // initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild 1194 // initial client-side render from SSR, use place of hydrating tag 1195 var core_browser_esm_InnerGlobal = /*#__PURE__*/function (_React$Component) { 1196 Object(inheritsLoose["a" /* default */])(InnerGlobal, _React$Component); 1197 1198 function InnerGlobal(props, context, updater) { 1199 return _React$Component.call(this, props, context, updater) || this; 1200 } 1201 1202 var _proto = InnerGlobal.prototype; 1203 1204 _proto.componentDidMount = function componentDidMount() { 1205 this.sheet = new sheet_browser_esm["a" /* StyleSheet */]({ 1206 key: this.props.cache.key + "-global", 1207 nonce: this.props.cache.sheet.nonce, 1208 container: this.props.cache.sheet.container 1209 }); // $FlowFixMe 1210 1211 var node = document.querySelector("style[data-emotion-" + this.props.cache.key + "=\"" + this.props.serialized.name + "\"]"); 1212 1213 if (node !== null) { 1214 this.sheet.tags.push(node); 1215 } 1216 1217 if (this.props.cache.sheet.tags.length) { 1218 this.sheet.before = this.props.cache.sheet.tags[0]; 1219 } 1220 1221 this.insertStyles(); 1222 }; 1223 1224 _proto.componentDidUpdate = function componentDidUpdate(prevProps) { 1225 if (prevProps.serialized.name !== this.props.serialized.name) { 1226 this.insertStyles(); 1227 } 1228 }; 1229 1230 _proto.insertStyles = function insertStyles$1() { 1231 if (this.props.serialized.next !== undefined) { 1232 // insert keyframes 1233 Object(utils_browser_esm["b" /* insertStyles */])(this.props.cache, this.props.serialized.next, true); 1234 } 1235 1236 if (this.sheet.tags.length) { 1237 // if this doesn't exist then it will be null so the style element will be appended 1238 var element = this.sheet.tags[this.sheet.tags.length - 1].nextElementSibling; 1239 this.sheet.before = element; 1240 this.sheet.flush(); 1241 } 1242 1243 this.props.cache.insert("", this.props.serialized, this.sheet, false); 1244 }; 1245 1246 _proto.componentWillUnmount = function componentWillUnmount() { 1247 this.sheet.flush(); 1248 }; 1249 1250 _proto.render = function render() { 1251 1252 return null; 1253 }; 1254 1255 return InnerGlobal; 1256 }(external_React_["Component"]); 1257 1258 var core_browser_esm_keyframes = function keyframes() { 1259 var insertable = css_browser_esm.apply(void 0, arguments); 1260 var name = "animation-" + insertable.name; // $FlowFixMe 1261 1262 return { 1263 name: name, 1264 styles: "@keyframes " + name + "{" + insertable.styles + "}", 1265 anim: 1, 1266 toString: function toString() { 1267 return "_EMO_" + this.name + "_" + this.styles + "_EMO_"; 1268 } 1269 }; 1270 }; 1271 1272 var classnames = function classnames(args) { 1273 var len = args.length; 1274 var i = 0; 1275 var cls = ''; 1276 1277 for (; i < len; i++) { 1278 var arg = args[i]; 1279 if (arg == null) continue; 1280 var toAdd = void 0; 1281 1282 switch (typeof arg) { 1283 case 'boolean': 1284 break; 1285 1286 case 'object': 1287 { 1288 if (Array.isArray(arg)) { 1289 toAdd = classnames(arg); 1290 } else { 1291 toAdd = ''; 1292 1293 for (var k in arg) { 1294 if (arg[k] && k) { 1295 toAdd && (toAdd += ' '); 1296 toAdd += k; 1297 } 1298 } 1299 } 1300 1301 break; 1302 } 1303 1304 default: 1305 { 1306 toAdd = arg; 1307 } 1308 } 1309 1310 if (toAdd) { 1311 cls && (cls += ' '); 1312 cls += toAdd; 1313 } 1314 } 1315 1316 return cls; 1317 }; 1318 1319 function merge(registered, css, className) { 1320 var registeredStyles = []; 1321 var rawClassName = Object(utils_browser_esm["a" /* getRegisteredStyles */])(registered, registeredStyles, className); 1322 1323 if (registeredStyles.length < 2) { 1324 return className; 1325 } 1326 1327 return rawClassName + css(registeredStyles); 1328 } 1329 1330 var ClassNames = emotion_element_57a3a7a3_browser_esm_withEmotionCache(function (props, context) { 1331 return /*#__PURE__*/Object(external_React_["createElement"])(ThemeContext.Consumer, null, function (theme) { 1332 var hasRendered = false; 1333 1334 var css = function css() { 1335 if (hasRendered && "production" !== 'production') { 1336 throw new Error('css can only be used during render'); 1337 } 1338 1339 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 1340 args[_key] = arguments[_key]; 1341 } 1342 1343 var serialized = Object(serialize_browser_esm["a" /* serializeStyles */])(args, context.registered); 1344 1345 { 1346 Object(utils_browser_esm["b" /* insertStyles */])(context, serialized, false); 1347 } 1348 1349 return context.key + "-" + serialized.name; 1350 }; 1351 1352 var cx = function cx() { 1353 if (hasRendered && "production" !== 'production') { 1354 throw new Error('cx can only be used during render'); 1355 } 1356 1357 for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 1358 args[_key2] = arguments[_key2]; 1359 } 1360 1361 return merge(context.registered, css, classnames(args)); 1362 }; 1363 1364 var content = { 1365 css: css, 1366 cx: cx, 1367 theme: theme 1368 }; 1369 var ele = props.children(content); 1370 hasRendered = true; 1371 1372 return ele; 1373 }); 1374 }); 1375 1376 1377 1378 1379 /***/ }), 1380 /* 42 */, 1381 /* 43 */, 1382 /* 44 */ 1383 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1384 1385 "use strict"; 1386 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); 1387 function _objectWithoutPropertiesLoose(source, excluded) { 1388 if (source == null) return {}; 1389 var target = {}; 1390 var sourceKeys = Object.keys(source); 1391 var key, i; 1392 1393 for (i = 0; i < sourceKeys.length; i++) { 1394 key = sourceKeys[i]; 1395 if (excluded.indexOf(key) >= 0) continue; 1396 target[key] = source[key]; 1397 } 1398 1399 return target; 1400 } 1401 1402 /***/ }), 1403 /* 45 */ 1404 /***/ (function(module, exports) { 1405 1406 (function() { module.exports = window["moment"]; }()); 1407 1408 /***/ }), 1409 /* 46 */ 1410 /***/ (function(module, exports) { 1411 1412 (function() { module.exports = window["wp"]["a11y"]; }()); 1413 1414 /***/ }), 1415 /* 47 */, 1416 /* 48 */ 1417 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1418 1419 "use strict"; 1420 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _asyncToGenerator; }); 1421 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { 1422 try { 1423 var info = gen[key](arg); 1424 var value = info.value; 1425 } catch (error) { 1426 reject(error); 1427 return; 1428 } 1429 1430 if (info.done) { 1431 resolve(value); 1432 } else { 1433 Promise.resolve(value).then(_next, _throw); 1434 } 1435 } 1436 1437 function _asyncToGenerator(fn) { 1438 return function () { 1439 var self = this, 1440 args = arguments; 1441 return new Promise(function (resolve, reject) { 1442 var gen = fn.apply(self, args); 1443 1444 function _next(value) { 1445 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); 1446 } 1447 1448 function _throw(err) { 1449 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); 1450 } 1451 1452 _next(undefined); 1453 }); 1454 }; 1455 } 1456 1457 /***/ }), 1458 /* 49 */, 1459 /* 50 */, 1460 /* 51 */, 1461 /* 52 */ 1462 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1463 1464 "use strict"; 1465 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useLiveRef; }); 1466 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); 1467 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 1468 /* harmony import */ var _useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(71); 1469 1470 1471 1472 1473 1474 1475 /** 1476 * A `React.Ref` that keeps track of the passed `value`. 1477 */ 1478 1479 function useLiveRef(value) { 1480 var ref = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(value); 1481 Object(_useIsomorphicEffect_js__WEBPACK_IMPORTED_MODULE_1__[/* useIsomorphicEffect */ "a"])(function () { 1482 ref.current = value; 1483 }); 1484 return ref; 1485 } 1486 1487 1488 1489 1490 /***/ }), 1491 /* 53 */ 1492 /***/ (function(module, exports, __webpack_require__) { 1493 1494 "use strict"; 1495 1496 1497 var undefined; 1498 1499 var $SyntaxError = SyntaxError; 1500 var $Function = Function; 1501 var $TypeError = TypeError; 1502 1503 // eslint-disable-next-line consistent-return 1504 var getEvalledConstructor = function (expressionSyntax) { 1505 try { 1506 return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')(); 1507 } catch (e) {} 1508 }; 1509 1510 var $gOPD = Object.getOwnPropertyDescriptor; 1511 if ($gOPD) { 1512 try { 1513 $gOPD({}, ''); 1514 } catch (e) { 1515 $gOPD = null; // this is IE 8, which has a broken gOPD 1516 } 1517 } 1518 1519 var throwTypeError = function () { 1520 throw new $TypeError(); 1521 }; 1522 var ThrowTypeError = $gOPD 1523 ? (function () { 1524 try { 1525 // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties 1526 arguments.callee; // IE 8 does not throw here 1527 return throwTypeError; 1528 } catch (calleeThrows) { 1529 try { 1530 // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '') 1531 return $gOPD(arguments, 'callee').get; 1532 } catch (gOPDthrows) { 1533 return throwTypeError; 1534 } 1535 } 1536 }()) 1537 : throwTypeError; 1538 1539 var hasSymbols = __webpack_require__(226)(); 1540 1541 var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto 1542 1543 var needsEval = {}; 1544 1545 var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); 1546 1547 var INTRINSICS = { 1548 '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, 1549 '%Array%': Array, 1550 '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, 1551 '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, 1552 '%AsyncFromSyncIteratorPrototype%': undefined, 1553 '%AsyncFunction%': needsEval, 1554 '%AsyncGenerator%': needsEval, 1555 '%AsyncGeneratorFunction%': needsEval, 1556 '%AsyncIteratorPrototype%': needsEval, 1557 '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, 1558 '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, 1559 '%Boolean%': Boolean, 1560 '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, 1561 '%Date%': Date, 1562 '%decodeURI%': decodeURI, 1563 '%decodeURIComponent%': decodeURIComponent, 1564 '%encodeURI%': encodeURI, 1565 '%encodeURIComponent%': encodeURIComponent, 1566 '%Error%': Error, 1567 '%eval%': eval, // eslint-disable-line no-eval 1568 '%EvalError%': EvalError, 1569 '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, 1570 '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, 1571 '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, 1572 '%Function%': $Function, 1573 '%GeneratorFunction%': needsEval, 1574 '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, 1575 '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, 1576 '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, 1577 '%isFinite%': isFinite, 1578 '%isNaN%': isNaN, 1579 '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, 1580 '%JSON%': typeof JSON === 'object' ? JSON : undefined, 1581 '%Map%': typeof Map === 'undefined' ? undefined : Map, 1582 '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), 1583 '%Math%': Math, 1584 '%Number%': Number, 1585 '%Object%': Object, 1586 '%parseFloat%': parseFloat, 1587 '%parseInt%': parseInt, 1588 '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, 1589 '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, 1590 '%RangeError%': RangeError, 1591 '%ReferenceError%': ReferenceError, 1592 '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, 1593 '%RegExp%': RegExp, 1594 '%Set%': typeof Set === 'undefined' ? undefined : Set, 1595 '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), 1596 '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, 1597 '%String%': String, 1598 '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, 1599 '%Symbol%': hasSymbols ? Symbol : undefined, 1600 '%SyntaxError%': $SyntaxError, 1601 '%ThrowTypeError%': ThrowTypeError, 1602 '%TypedArray%': TypedArray, 1603 '%TypeError%': $TypeError, 1604 '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, 1605 '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, 1606 '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, 1607 '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, 1608 '%URIError%': URIError, 1609 '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, 1610 '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, 1611 '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet 1612 }; 1613 1614 var doEval = function doEval(name) { 1615 var value; 1616 if (name === '%AsyncFunction%') { 1617 value = getEvalledConstructor('async function () {}'); 1618 } else if (name === '%GeneratorFunction%') { 1619 value = getEvalledConstructor('function* () {}'); 1620 } else if (name === '%AsyncGeneratorFunction%') { 1621 value = getEvalledConstructor('async function* () {}'); 1622 } else if (name === '%AsyncGenerator%') { 1623 var fn = doEval('%AsyncGeneratorFunction%'); 1624 if (fn) { 1625 value = fn.prototype; 1626 } 1627 } else if (name === '%AsyncIteratorPrototype%') { 1628 var gen = doEval('%AsyncGenerator%'); 1629 if (gen) { 1630 value = getProto(gen.prototype); 1631 } 1632 } 1633 1634 INTRINSICS[name] = value; 1635 1636 return value; 1637 }; 1638 1639 var LEGACY_ALIASES = { 1640 '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'], 1641 '%ArrayPrototype%': ['Array', 'prototype'], 1642 '%ArrayProto_entries%': ['Array', 'prototype', 'entries'], 1643 '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'], 1644 '%ArrayProto_keys%': ['Array', 'prototype', 'keys'], 1645 '%ArrayProto_values%': ['Array', 'prototype', 'values'], 1646 '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'], 1647 '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'], 1648 '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'], 1649 '%BooleanPrototype%': ['Boolean', 'prototype'], 1650 '%DataViewPrototype%': ['DataView', 'prototype'], 1651 '%DatePrototype%': ['Date', 'prototype'], 1652 '%ErrorPrototype%': ['Error', 'prototype'], 1653 '%EvalErrorPrototype%': ['EvalError', 'prototype'], 1654 '%Float32ArrayPrototype%': ['Float32Array', 'prototype'], 1655 '%Float64ArrayPrototype%': ['Float64Array', 'prototype'], 1656 '%FunctionPrototype%': ['Function', 'prototype'], 1657 '%Generator%': ['GeneratorFunction', 'prototype'], 1658 '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'], 1659 '%Int8ArrayPrototype%': ['Int8Array', 'prototype'], 1660 '%Int16ArrayPrototype%': ['Int16Array', 'prototype'], 1661 '%Int32ArrayPrototype%': ['Int32Array', 'prototype'], 1662 '%JSONParse%': ['JSON', 'parse'], 1663 '%JSONStringify%': ['JSON', 'stringify'], 1664 '%MapPrototype%': ['Map', 'prototype'], 1665 '%NumberPrototype%': ['Number', 'prototype'], 1666 '%ObjectPrototype%': ['Object', 'prototype'], 1667 '%ObjProto_toString%': ['Object', 'prototype', 'toString'], 1668 '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'], 1669 '%PromisePrototype%': ['Promise', 'prototype'], 1670 '%PromiseProto_then%': ['Promise', 'prototype', 'then'], 1671 '%Promise_all%': ['Promise', 'all'], 1672 '%Promise_reject%': ['Promise', 'reject'], 1673 '%Promise_resolve%': ['Promise', 'resolve'], 1674 '%RangeErrorPrototype%': ['RangeError', 'prototype'], 1675 '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'], 1676 '%RegExpPrototype%': ['RegExp', 'prototype'], 1677 '%SetPrototype%': ['Set', 'prototype'], 1678 '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'], 1679 '%StringPrototype%': ['String', 'prototype'], 1680 '%SymbolPrototype%': ['Symbol', 'prototype'], 1681 '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'], 1682 '%TypedArrayPrototype%': ['TypedArray', 'prototype'], 1683 '%TypeErrorPrototype%': ['TypeError', 'prototype'], 1684 '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'], 1685 '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'], 1686 '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'], 1687 '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'], 1688 '%URIErrorPrototype%': ['URIError', 'prototype'], 1689 '%WeakMapPrototype%': ['WeakMap', 'prototype'], 1690 '%WeakSetPrototype%': ['WeakSet', 'prototype'] 1691 }; 1692 1693 var bind = __webpack_require__(122); 1694 var hasOwn = __webpack_require__(92); 1695 var $concat = bind.call(Function.call, Array.prototype.concat); 1696 var $spliceApply = bind.call(Function.apply, Array.prototype.splice); 1697 var $replace = bind.call(Function.call, String.prototype.replace); 1698 var $strSlice = bind.call(Function.call, String.prototype.slice); 1699 1700 /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */ 1701 var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; 1702 var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */ 1703 var stringToPath = function stringToPath(string) { 1704 var first = $strSlice(string, 0, 1); 1705 var last = $strSlice(string, -1); 1706 if (first === '%' && last !== '%') { 1707 throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); 1708 } else if (last === '%' && first !== '%') { 1709 throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); 1710 } 1711 var result = []; 1712 $replace(string, rePropName, function (match, number, quote, subString) { 1713 result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match; 1714 }); 1715 return result; 1716 }; 1717 /* end adaptation */ 1718 1719 var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) { 1720 var intrinsicName = name; 1721 var alias; 1722 if (hasOwn(LEGACY_ALIASES, intrinsicName)) { 1723 alias = LEGACY_ALIASES[intrinsicName]; 1724 intrinsicName = '%' + alias[0] + '%'; 1725 } 1726 1727 if (hasOwn(INTRINSICS, intrinsicName)) { 1728 var value = INTRINSICS[intrinsicName]; 1729 if (value === needsEval) { 1730 value = doEval(intrinsicName); 1731 } 1732 if (typeof value === 'undefined' && !allowMissing) { 1733 throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!'); 1734 } 1735 1736 return { 1737 alias: alias, 1738 name: intrinsicName, 1739 value: value 1740 }; 1741 } 1742 1743 throw new $SyntaxError('intrinsic ' + name + ' does not exist!'); 1744 }; 1745 1746 module.exports = function GetIntrinsic(name, allowMissing) { 1747 if (typeof name !== 'string' || name.length === 0) { 1748 throw new $TypeError('intrinsic name must be a non-empty string'); 1749 } 1750 if (arguments.length > 1 && typeof allowMissing !== 'boolean') { 1751 throw new $TypeError('"allowMissing" argument must be a boolean'); 1752 } 1753 1754 var parts = stringToPath(name); 1755 var intrinsicBaseName = parts.length > 0 ? parts[0] : ''; 1756 1757 var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing); 1758 var intrinsicRealName = intrinsic.name; 1759 var value = intrinsic.value; 1760 var skipFurtherCaching = false; 1761 1762 var alias = intrinsic.alias; 1763 if (alias) { 1764 intrinsicBaseName = alias[0]; 1765 $spliceApply(parts, $concat([0, 1], alias)); 1766 } 1767 1768 for (var i = 1, isOwn = true; i < parts.length; i += 1) { 1769 var part = parts[i]; 1770 var first = $strSlice(part, 0, 1); 1771 var last = $strSlice(part, -1); 1772 if ( 1773 ( 1774 (first === '"' || first === "'" || first === '`') 1775 || (last === '"' || last === "'" || last === '`') 1776 ) 1777 && first !== last 1778 ) { 1779 throw new $SyntaxError('property names with quotes must have matching quotes'); 1780 } 1781 if (part === 'constructor' || !isOwn) { 1782 skipFurtherCaching = true; 1783 } 1784 1785 intrinsicBaseName += '.' + part; 1786 intrinsicRealName = '%' + intrinsicBaseName + '%'; 1787 1788 if (hasOwn(INTRINSICS, intrinsicRealName)) { 1789 value = INTRINSICS[intrinsicRealName]; 1790 } else if (value != null) { 1791 if (!(part in value)) { 1792 if (!allowMissing) { 1793 throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.'); 1794 } 1795 return void undefined; 1796 } 1797 if ($gOPD && (i + 1) >= parts.length) { 1798 var desc = $gOPD(value, part); 1799 isOwn = !!desc; 1800 1801 // By convention, when a data property is converted to an accessor 1802 // property to emulate a data property that does not suffer from 1803 // the override mistake, that accessor's getter is marked with 1804 // an `originalValue` property. Here, when we detect this, we 1805 // uphold the illusion by pretending to see that original data 1806 // property, i.e., returning the value rather than the getter 1807 // itself. 1808 if (isOwn && 'get' in desc && !('originalValue' in desc.get)) { 1809 value = desc.get; 1810 } else { 1811 value = value[part]; 1812 } 1813 } else { 1814 isOwn = hasOwn(value, part); 1815 value = value[part]; 1816 } 1817 1818 if (isOwn && !skipFurtherCaching) { 1819 INTRINSICS[intrinsicRealName] = value; 1820 } 1821 } 1822 } 1823 return value; 1824 }; 1825 1826 1827 /***/ }), 1828 /* 54 */ 1829 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1830 1831 "use strict"; 1832 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getDocument; }); 1833 /** 1834 * Returns `element.ownerDocument || document`. 1835 */ 1836 function getDocument(element) { 1837 return element ? element.ownerDocument || element : document; 1838 } 1839 1840 1841 1842 1843 /***/ }), 1844 /* 55 */ 1845 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1846 1847 "use strict"; 1848 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _setPrototypeOf; }); 1849 function _setPrototypeOf(o, p) { 1850 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 1851 o.__proto__ = p; 1852 return o; 1853 }; 1854 1855 return _setPrototypeOf(o, p); 1856 } 1857 1858 /***/ }), 1859 /* 56 */ 1860 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1861 1862 "use strict"; 1863 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _typeof; }); 1864 function _typeof(obj) { 1865 "@babel/helpers - typeof"; 1866 1867 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 1868 _typeof = function _typeof(obj) { 1869 return typeof obj; 1870 }; 1871 } else { 1872 _typeof = function _typeof(obj) { 1873 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 1874 }; 1875 } 1876 1877 return _typeof(obj); 1878 } 1879 1880 /***/ }), 1881 /* 57 */, 1882 /* 58 */ 1883 /***/ (function(module, __webpack_exports__, __webpack_require__) { 1884 1885 "use strict"; 1886 1887 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 1888 var defineProperty = __webpack_require__(5); 1889 1890 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 1891 var objectWithoutProperties = __webpack_require__(13); 1892 1893 // EXTERNAL MODULE: ./node_modules/classnames/index.js 1894 var classnames = __webpack_require__(10); 1895 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 1896 1897 // EXTERNAL MODULE: external ["wp","element"] 1898 var external_wp_element_ = __webpack_require__(0); 1899 1900 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/utils.js 1901 1902 1903 1904 /** 1905 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 1906 * @typedef OwnProps 1907 * @property {T} [as='div'] Component to render 1908 * @property {import('react').ReactNode | ((props: import('react').ComponentProps<T>) => JSX.Element) } [children] Children or render props function 1909 */ 1910 1911 /** 1912 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 1913 * @typedef {OwnProps<T> & import('react').ComponentProps<T>} Props 1914 */ 1915 1916 /** 1917 * renderAsRenderProps is used to wrap a component and convert 1918 * the passed property "as" either a string or component, to the 1919 * rendered tag if a string, or component. 1920 * 1921 * See VisuallyHidden hidden for example. 1922 * 1923 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 1924 * @param {Props<T>} props 1925 * @return {JSX.Element} The rendered element. 1926 */ 1927 function renderAsRenderProps(_ref) { 1928 var _ref$as = _ref.as, 1929 Component = _ref$as === void 0 ? 'div' : _ref$as, 1930 props = Object(objectWithoutProperties["a" /* default */])(_ref, ["as"]); 1931 1932 if (typeof props.children === 'function') { 1933 return props.children(props); 1934 } 1935 1936 return Object(external_wp_element_["createElement"])(Component, props); 1937 } 1938 1939 1940 1941 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js 1942 var with_next = __webpack_require__(526); 1943 1944 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/next.js 1945 /** 1946 * Internal dependencies 1947 */ 1948 1949 1950 var VisuallyHidden = false ? undefined : undefined; 1951 /** 1952 * There is nothing to adapt, the props are equal. 1953 * 1954 * @param {import('.').Props<any>} props 1955 * @return {import('../ui/visually-hidden/hook').Props} Adapted props 1956 */ 1957 1958 var adapter = function adapter(props) { 1959 return ( 1960 /** @type {import('../ui/visually-hidden/hook').Props} */ 1961 props 1962 ); 1963 }; 1964 /** 1965 * The generic type is too difficult to type here, default to any to circumvent that. 1966 * 1967 * @param {import('react').ForwardRefExoticComponent<import('.').Props<any>>} Current 1968 */ 1969 1970 1971 function withNextComponent(Current) { 1972 return Object(with_next["a" /* withNext */])(Current, VisuallyHidden, 'WPComponentsVisuallyHidden', adapter); 1973 } 1974 1975 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js 1976 1977 1978 1979 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; } 1980 1981 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; } 1982 1983 /** 1984 * External dependencies 1985 */ 1986 1987 /** 1988 * WordPress dependencies 1989 */ 1990 1991 1992 /** 1993 * Internal dependencies 1994 */ 1995 1996 1997 1998 /** 1999 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 2000 * @typedef OwnProps 2001 * @property {T} [as='div'] Component to render, e.g. `"div"` or `MyComponent`. 2002 */ 2003 2004 /** 2005 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T 2006 * @typedef {OwnProps<T> & import('react').ComponentPropsWithRef<T>} Props 2007 */ 2008 2009 /** 2010 * VisuallyHidden component to render text out non-visually 2011 * for use in devices such as a screen reader. 2012 * 2013 * @template {keyof JSX.IntrinsicElements | import('react').JSXElementConstructor<any>} T T 2014 * @param {Props<T>} props 2015 * @param {import('react').Ref<any>} forwardedRef 2016 * @return {JSX.Element} Element 2017 */ 2018 2019 function visually_hidden_VisuallyHidden(_ref, forwardedRef) { 2020 var _ref$as = _ref.as, 2021 as = _ref$as === void 0 ? 'div' : _ref$as, 2022 className = _ref.className, 2023 props = Object(objectWithoutProperties["a" /* default */])(_ref, ["as", "className"]); 2024 2025 return renderAsRenderProps(_objectSpread(_objectSpread({ 2026 as: as, 2027 className: classnames_default()('components-visually-hidden', className) 2028 }, props), {}, { 2029 ref: forwardedRef 2030 })); 2031 } 2032 2033 /* harmony default export */ var visually_hidden = __webpack_exports__["a"] = (withNextComponent(Object(external_wp_element_["forwardRef"])(visually_hidden_VisuallyHidden))); 2034 2035 2036 /***/ }), 2037 /* 59 */ 2038 /***/ (function(module, exports) { 2039 2040 function _typeof(obj) { 2041 "@babel/helpers - typeof"; 2042 2043 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 2044 module.exports = _typeof = function _typeof(obj) { 2045 return typeof obj; 2046 }; 2047 2048 module.exports["default"] = module.exports, module.exports.__esModule = true; 2049 } else { 2050 module.exports = _typeof = function _typeof(obj) { 2051 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 2052 }; 2053 2054 module.exports["default"] = module.exports, module.exports.__esModule = true; 2055 } 2056 2057 return _typeof(obj); 2058 } 2059 2060 module.exports = _typeof; 2061 module.exports["default"] = module.exports, module.exports.__esModule = true; 2062 2063 /***/ }), 2064 /* 60 */ 2065 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2066 2067 "use strict"; 2068 2069 // EXPORTS 2070 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createHook; }); 2071 2072 // EXTERNAL MODULE: external "React" 2073 var external_React_ = __webpack_require__(14); 2074 2075 // EXTERNAL MODULE: ./node_modules/reakit-system/es/SystemContext.js 2076 var SystemContext = __webpack_require__(111); 2077 2078 // CONCATENATED MODULE: ./node_modules/reakit-system/es/useToken.js 2079 2080 2081 2082 /** 2083 * React custom hook that returns the value of any token defined in the 2084 * SystemContext. It's mainly used internally in [`useOptions`](#useoptions) 2085 * and [`useProps`](#useprops). 2086 * 2087 * @example 2088 * import { SystemProvider, useToken } from "reakit-system"; 2089 * 2090 * const system = { 2091 * token: "value", 2092 * }; 2093 * 2094 * function Component(props) { 2095 * const token = useToken("token", "default value"); 2096 * return <div {...props}>{token}</div>; 2097 * } 2098 * 2099 * function App() { 2100 * return ( 2101 * <SystemProvider unstable_system={system}> 2102 * <Component /> 2103 * </SystemProvider> 2104 * ); 2105 * } 2106 */ 2107 2108 function useToken(token, defaultValue) { 2109 Object(external_React_["useDebugValue"])(token); 2110 var context = Object(external_React_["useContext"])(SystemContext["a" /* SystemContext */]); 2111 return context[token] != null ? context[token] : defaultValue; 2112 } 2113 2114 2115 2116 // CONCATENATED MODULE: ./node_modules/reakit-system/es/useProps.js 2117 2118 2119 2120 2121 /** 2122 * React custom hook that returns the props returned by a given 2123 * `use${name}Props` in the SystemContext. 2124 * 2125 * @example 2126 * import { SystemProvider, useProps } from "reakit-system"; 2127 * 2128 * const system = { 2129 * useAProps(options, htmlProps) { 2130 * return { 2131 * ...htmlProps, 2132 * href: options.url, 2133 * }; 2134 * }, 2135 * }; 2136 * 2137 * function A({ url, ...htmlProps }) { 2138 * const props = useProps("A", { url }, htmlProps); 2139 * return <a {...props} />; 2140 * } 2141 * 2142 * function App() { 2143 * return ( 2144 * <SystemProvider unstable_system={system}> 2145 * <A url="url">It will convert url into href in useAProps</A> 2146 * </SystemProvider> 2147 * ); 2148 * } 2149 */ 2150 2151 function useProps(name, options, htmlProps) { 2152 if (options === void 0) { 2153 options = {}; 2154 } 2155 2156 if (htmlProps === void 0) { 2157 htmlProps = {}; 2158 } 2159 2160 var hookName = "use" + name + "Props"; 2161 Object(external_React_["useDebugValue"])(hookName); 2162 var useHook = useToken(hookName); 2163 2164 if (useHook) { 2165 return useHook(options, htmlProps); 2166 } 2167 2168 return htmlProps; 2169 } 2170 2171 2172 2173 // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js 2174 var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__(78); 2175 2176 // CONCATENATED MODULE: ./node_modules/reakit-system/es/useOptions.js 2177 2178 2179 2180 2181 2182 /** 2183 * React custom hook that returns the options returned by a given 2184 * `use${name}Options` in the SystemContext. 2185 * 2186 * @example 2187 * import React from "react"; 2188 * import { SystemProvider, useOptions } from "reakit-system"; 2189 * 2190 * const system = { 2191 * useAOptions(options, htmlProps) { 2192 * return { 2193 * ...options, 2194 * url: htmlProps.href, 2195 * }; 2196 * }, 2197 * }; 2198 * 2199 * function A({ url, ...htmlProps }) { 2200 * const options = useOptions("A", { url }, htmlProps); 2201 * return <a href={options.url} {...htmlProps} />; 2202 * } 2203 * 2204 * function App() { 2205 * return ( 2206 * <SystemProvider unstable_system={system}> 2207 * <A href="url"> 2208 * It will convert href into url in useAOptions and then url into href in A 2209 * </A> 2210 * </SystemProvider> 2211 * ); 2212 * } 2213 */ 2214 2215 function useOptions(name, options, htmlProps) { 2216 if (options === void 0) { 2217 options = {}; 2218 } 2219 2220 if (htmlProps === void 0) { 2221 htmlProps = {}; 2222 } 2223 2224 var hookName = "use" + name + "Options"; 2225 Object(external_React_["useDebugValue"])(hookName); 2226 var useHook = useToken(hookName); 2227 2228 if (useHook) { 2229 return Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, options), useHook(options, htmlProps)); 2230 } 2231 2232 return options; 2233 } 2234 2235 2236 2237 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js 2238 var shallowEqual = __webpack_require__(69); 2239 2240 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/toArray.js 2241 /** 2242 * Transforms `arg` into an array if it's not already. 2243 * 2244 * @example 2245 * import { toArray } from "reakit-utils"; 2246 * 2247 * toArray("a"); // ["a"] 2248 * toArray(["a"]); // ["a"] 2249 */ 2250 function toArray(arg) { 2251 if (Array.isArray(arg)) { 2252 return arg; 2253 } 2254 2255 return typeof arg !== "undefined" ? [arg] : []; 2256 } 2257 2258 2259 2260 // CONCATENATED MODULE: ./node_modules/reakit-system/es/createHook.js 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 /** 2271 * Creates a React custom hook that will return component props. 2272 * 2273 * @example 2274 * import { createHook } from "reakit-system"; 2275 * 2276 * const useA = createHook({ 2277 * name: "A", 2278 * keys: ["url"], // custom props/options keys 2279 * useProps(options, htmlProps) { 2280 * return { 2281 * ...htmlProps, 2282 * href: options.url, 2283 * }; 2284 * }, 2285 * }); 2286 * 2287 * function A({ url, ...htmlProps }) { 2288 * const props = useA({ url }, htmlProps); 2289 * return <a {...props} />; 2290 * } 2291 * 2292 * @param options 2293 */ 2294 function createHook(options) { 2295 var _options$useState, _composedHooks$; 2296 2297 var composedHooks = toArray(options.compose); 2298 2299 var __useOptions = function __useOptions(hookOptions, htmlProps) { 2300 // Call the current hook's useOptions first 2301 if (options.useOptions) { 2302 hookOptions = options.useOptions(hookOptions, htmlProps); 2303 } // If there's name, call useOptions from the system context 2304 2305 2306 if (options.name) { 2307 hookOptions = useOptions(options.name, hookOptions, htmlProps); 2308 } // Run composed hooks useOptions 2309 2310 2311 if (options.compose) { 2312 for (var _iterator = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step; !(_step = _iterator()).done;) { 2313 var hook = _step.value; 2314 hookOptions = hook.__useOptions(hookOptions, htmlProps); 2315 } 2316 } 2317 2318 return hookOptions; 2319 }; 2320 2321 var useHook = function useHook(hookOptions, htmlProps, unstable_ignoreUseOptions) { 2322 if (hookOptions === void 0) { 2323 hookOptions = {}; 2324 } 2325 2326 if (htmlProps === void 0) { 2327 htmlProps = {}; 2328 } 2329 2330 if (unstable_ignoreUseOptions === void 0) { 2331 unstable_ignoreUseOptions = false; 2332 } 2333 2334 // This won't execute when useHook was called from within another useHook 2335 if (!unstable_ignoreUseOptions) { 2336 hookOptions = __useOptions(hookOptions, htmlProps); 2337 } // Call the current hook's useProps 2338 2339 2340 if (options.useProps) { 2341 htmlProps = options.useProps(hookOptions, htmlProps); 2342 } // If there's name, call useProps from the system context 2343 2344 2345 if (options.name) { 2346 htmlProps = useProps(options.name, hookOptions, htmlProps); 2347 } 2348 2349 if (options.compose) { 2350 if (options.useComposeOptions) { 2351 hookOptions = options.useComposeOptions(hookOptions, htmlProps); 2352 } 2353 2354 if (options.useComposeProps) { 2355 htmlProps = options.useComposeProps(hookOptions, htmlProps); 2356 } else { 2357 for (var _iterator2 = Object(_rollupPluginBabelHelpers_0c84a174["c" /* b */])(composedHooks), _step2; !(_step2 = _iterator2()).done;) { 2358 var hook = _step2.value; 2359 htmlProps = hook(hookOptions, htmlProps, true); 2360 } 2361 } 2362 } // Remove undefined values from htmlProps 2363 2364 2365 var finalHTMLProps = {}; 2366 var definedHTMLProps = htmlProps || {}; 2367 2368 for (var prop in definedHTMLProps) { 2369 if (definedHTMLProps[prop] !== undefined) { 2370 finalHTMLProps[prop] = definedHTMLProps[prop]; 2371 } 2372 } 2373 2374 return finalHTMLProps; 2375 }; 2376 2377 useHook.__useOptions = __useOptions; 2378 var composedKeys = composedHooks.reduce(function (keys, hook) { 2379 keys.push.apply(keys, hook.__keys || []); 2380 return keys; 2381 }, []); // It's used by createComponent to split option props (keys) and html props 2382 2383 useHook.__keys = [].concat(composedKeys, ((_options$useState = options.useState) === null || _options$useState === void 0 ? void 0 : _options$useState.__keys) || [], options.keys || []); 2384 useHook.unstable_propsAreEqual = options.propsAreEqual || ((_composedHooks$ = composedHooks[0]) === null || _composedHooks$ === void 0 ? void 0 : _composedHooks$.unstable_propsAreEqual) || shallowEqual["a" /* shallowEqual */]; 2385 2386 if (false) {} 2387 2388 return useHook; 2389 } 2390 2391 2392 2393 2394 /***/ }), 2395 /* 61 */ 2396 /***/ (function(module, __webpack_exports__, __webpack_require__) { 2397 2398 "use strict"; 2399 2400 // EXPORTS 2401 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ createComponent; }); 2402 2403 // EXTERNAL MODULE: external "React" 2404 var external_React_ = __webpack_require__(14); 2405 2406 // EXTERNAL MODULE: ./node_modules/reakit-system/es/_rollupPluginBabelHelpers-0c84a174.js 2407 var _rollupPluginBabelHelpers_0c84a174 = __webpack_require__(78); 2408 2409 // EXTERNAL MODULE: ./node_modules/reakit-system/es/useCreateElement.js 2410 var useCreateElement = __webpack_require__(117); 2411 2412 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/_rollupPluginBabelHelpers-1f0bf8c2.js 2413 var _rollupPluginBabelHelpers_1f0bf8c2 = __webpack_require__(85); 2414 2415 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isObject.js 2416 var isObject = __webpack_require__(123); 2417 2418 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/isPlainObject.js 2419 2420 2421 /** 2422 * Checks whether `arg` is a plain object or not. 2423 * 2424 * @returns {boolean} 2425 */ 2426 2427 function isPlainObject(arg) { 2428 var _proto$constructor; 2429 2430 if (!Object(isObject["a" /* isObject */])(arg)) return false; 2431 var proto = Object.getPrototypeOf(arg); 2432 if (proto == null) return true; 2433 return ((_proto$constructor = proto.constructor) === null || _proto$constructor === void 0 ? void 0 : _proto$constructor.toString()) === Object.toString(); 2434 } 2435 2436 2437 2438 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/splitProps.js 2439 2440 2441 2442 2443 /** 2444 * Splits an object (`props`) into a tuple where the first item is an object 2445 * with the passed `keys`, and the second item is an object with these keys 2446 * omitted. 2447 * 2448 * @deprecated will be removed in version 2 2449 * 2450 * @example 2451 * import { splitProps } from "reakit-utils"; 2452 * 2453 * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] 2454 */ 2455 2456 function __deprecatedSplitProps(props, keys) { 2457 var propsKeys = Object.keys(props); 2458 var picked = {}; 2459 var omitted = {}; 2460 2461 for (var _i = 0, _propsKeys = propsKeys; _i < _propsKeys.length; _i++) { 2462 var key = _propsKeys[_i]; 2463 2464 if (keys.indexOf(key) >= 0) { 2465 picked[key] = props[key]; 2466 } else { 2467 omitted[key] = props[key]; 2468 } 2469 } 2470 2471 return [picked, omitted]; 2472 } 2473 /** 2474 * Splits an object (`props`) into a tuple where the first item 2475 * is the `state` property, and the second item is the rest of the properties. 2476 * 2477 * It is also backward compatible with version 1. If `keys` are passed then 2478 * splits an object (`props`) into a tuple where the first item is an object 2479 * with the passed `keys`, and the second item is an object with these keys 2480 * omitted. 2481 * 2482 * @example 2483 * import { splitProps } from "reakit-utils"; 2484 * 2485 * splitProps({ a: "a", b: "b" }, ["a"]); // [{ a: "a" }, { b: "b" }] 2486 * 2487 * @example 2488 * import { splitProps } from "reakit-utils"; 2489 * 2490 * splitProps({ state: { a: "a" }, b: "b" }); // [{ a: "a" }, { b: "b" }] 2491 */ 2492 2493 2494 function splitProps(props, keys) { 2495 if (keys === void 0) { 2496 keys = []; 2497 } 2498 2499 if (!isPlainObject(props.state)) { 2500 return __deprecatedSplitProps(props, keys); 2501 } 2502 2503 var _deprecatedSplitProp = __deprecatedSplitProps(props, [].concat(keys, ["state"])), 2504 picked = _deprecatedSplitProp[0], 2505 omitted = _deprecatedSplitProp[1]; 2506 2507 var state = picked.state, 2508 restPicked = Object(_rollupPluginBabelHelpers_1f0bf8c2["a" /* _ */])(picked, ["state"]); 2509 2510 return [Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, state), restPicked), omitted]; 2511 } 2512 2513 2514 2515 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/shallowEqual.js 2516 var shallowEqual = __webpack_require__(69); 2517 2518 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/normalizePropsAreEqual.js 2519 2520 2521 2522 2523 /** 2524 * This higher order functions take `propsAreEqual` function and 2525 * returns a new function which normalizes the props. 2526 * 2527 * Normalizing in our case is making sure the `propsAreEqual` works with 2528 * both version 1 (object spreading) and version 2 (state object) state passing. 2529 * 2530 * To achieve this, the returned function in case of a state object 2531 * will spread the state object in both `prev` and `next props. 2532 * 2533 * Other case it just returns the function as is which makes sure 2534 * that we are still backward compatible 2535 */ 2536 function normalizePropsAreEqual(propsAreEqual) { 2537 if (propsAreEqual.name === "normalizePropsAreEqualInner") { 2538 return propsAreEqual; 2539 } 2540 2541 return function normalizePropsAreEqualInner(prev, next) { 2542 if (!isPlainObject(prev.state) || !isPlainObject(next.state)) { 2543 return propsAreEqual(prev, next); 2544 } 2545 2546 return propsAreEqual(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, prev.state), prev), Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])(Object(_rollupPluginBabelHelpers_1f0bf8c2["b" /* a */])({}, next.state), next)); 2547 }; 2548 } 2549 2550 2551 2552 // CONCATENATED MODULE: ./node_modules/reakit-system/es/createComponent.js 2553 2554 2555 2556 2557 2558 2559 2560 2561 function forwardRef(component) { 2562 return /*#__PURE__*/Object(external_React_["forwardRef"])(component); 2563 } 2564 2565 function memo(component, propsAreEqual) { 2566 return /*#__PURE__*/Object(external_React_["memo"])(component, propsAreEqual); 2567 } 2568 2569 /** 2570 * Creates a React component. 2571 * 2572 * @example 2573 * import { createComponent } from "reakit-system"; 2574 * 2575 * const A = createComponent({ as: "a" }); 2576 * 2577 * @param options 2578 */ 2579 function createComponent(_ref) { 2580 var type = _ref.as, 2581 useHook = _ref.useHook, 2582 shouldMemo = _ref.memo, 2583 _ref$propsAreEqual = _ref.propsAreEqual, 2584 propsAreEqual = _ref$propsAreEqual === void 0 ? useHook === null || useHook === void 0 ? void 0 : useHook.unstable_propsAreEqual : _ref$propsAreEqual, 2585 _ref$keys = _ref.keys, 2586 keys = _ref$keys === void 0 ? (useHook === null || useHook === void 0 ? void 0 : useHook.__keys) || [] : _ref$keys, 2587 _ref$useCreateElement = _ref.useCreateElement, 2588 useCreateElement$1 = _ref$useCreateElement === void 0 ? useCreateElement["a" /* useCreateElement */] : _ref$useCreateElement; 2589 2590 var Comp = function Comp(_ref2, ref) { 2591 var _ref2$as = _ref2.as, 2592 as = _ref2$as === void 0 ? type : _ref2$as, 2593 props = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_ref2, ["as"]); 2594 2595 if (useHook) { 2596 var _as$render; 2597 2598 var _splitProps = splitProps(props, keys), 2599 _options = _splitProps[0], 2600 htmlProps = _splitProps[1]; 2601 2602 var _useHook = useHook(_options, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({ 2603 ref: ref 2604 }, htmlProps)), 2605 wrapElement = _useHook.wrapElement, 2606 elementProps = Object(_rollupPluginBabelHelpers_0c84a174["b" /* a */])(_useHook, ["wrapElement"]); // @ts-ignore 2607 2608 2609 var asKeys = ((_as$render = as.render) === null || _as$render === void 0 ? void 0 : _as$render.__keys) || as.__keys; 2610 var asOptions = asKeys && splitProps(props, asKeys)[0]; 2611 var allProps = asOptions ? Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])(Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({}, elementProps), asOptions) : elementProps; 2612 2613 var _element = useCreateElement$1(as, allProps); 2614 2615 if (wrapElement) { 2616 return wrapElement(_element); 2617 } 2618 2619 return _element; 2620 } 2621 2622 return useCreateElement$1(as, Object(_rollupPluginBabelHelpers_0c84a174["a" /* _ */])({ 2623 ref: ref 2624 }, props)); 2625 }; 2626 2627 if (false) {} 2628 2629 Comp = forwardRef(Comp); 2630 2631 if (shouldMemo) { 2632 Comp = memo(Comp, propsAreEqual && normalizePropsAreEqual(propsAreEqual)); 2633 } 2634 2635 Comp.__keys = keys; 2636 Comp.unstable_propsAreEqual = normalizePropsAreEqual(propsAreEqual || shallowEqual["a" /* shallowEqual */]); 2637 return Comp; 2638 } 2639 2640 2641 2642 2643 /***/ }), 2644 /* 62 */ 2645 /***/ (function(module, exports, __webpack_require__) { 2646 2647 var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2 2648 // https://github.com/bgrins/TinyColor 2649 // Brian Grinstead, MIT License 2650 2651 (function(Math) { 2652 2653 var trimLeft = /^\s+/, 2654 trimRight = /\s+$/, 2655 tinyCounter = 0, 2656 mathRound = Math.round, 2657 mathMin = Math.min, 2658 mathMax = Math.max, 2659 mathRandom = Math.random; 2660 2661 function tinycolor (color, opts) { 2662 2663 color = (color) ? color : ''; 2664 opts = opts || { }; 2665 2666 // If input is already a tinycolor, return itself 2667 if (color instanceof tinycolor) { 2668 return color; 2669 } 2670 // If we are called as a function, call using new instead 2671 if (!(this instanceof tinycolor)) { 2672 return new tinycolor(color, opts); 2673 } 2674 2675 var rgb = inputToRGB(color); 2676 this._originalInput = color, 2677 this._r = rgb.r, 2678 this._g = rgb.g, 2679 this._b = rgb.b, 2680 this._a = rgb.a, 2681 this._roundA = mathRound(100*this._a) / 100, 2682 this._format = opts.format || rgb.format; 2683 this._gradientType = opts.gradientType; 2684 2685 // Don't let the range of [0,255] come back in [0,1]. 2686 // Potentially lose a little bit of precision here, but will fix issues where 2687 // .5 gets interpreted as half of the total, instead of half of 1 2688 // If it was supposed to be 128, this was already taken care of by `inputToRgb` 2689 if (this._r < 1) { this._r = mathRound(this._r); } 2690 if (this._g < 1) { this._g = mathRound(this._g); } 2691 if (this._b < 1) { this._b = mathRound(this._b); } 2692 2693 this._ok = rgb.ok; 2694 this._tc_id = tinyCounter++; 2695 } 2696 2697 tinycolor.prototype = { 2698 isDark: function() { 2699 return this.getBrightness() < 128; 2700 }, 2701 isLight: function() { 2702 return !this.isDark(); 2703 }, 2704 isValid: function() { 2705 return this._ok; 2706 }, 2707 getOriginalInput: function() { 2708 return this._originalInput; 2709 }, 2710 getFormat: function() { 2711 return this._format; 2712 }, 2713 getAlpha: function() { 2714 return this._a; 2715 }, 2716 getBrightness: function() { 2717 //http://www.w3.org/TR/AERT#color-contrast 2718 var rgb = this.toRgb(); 2719 return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000; 2720 }, 2721 getLuminance: function() { 2722 //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef 2723 var rgb = this.toRgb(); 2724 var RsRGB, GsRGB, BsRGB, R, G, B; 2725 RsRGB = rgb.r/255; 2726 GsRGB = rgb.g/255; 2727 BsRGB = rgb.b/255; 2728 2729 if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);} 2730 if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);} 2731 if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);} 2732 return (0.2126 * R) + (0.7152 * G) + (0.0722 * B); 2733 }, 2734 setAlpha: function(value) { 2735 this._a = boundAlpha(value); 2736 this._roundA = mathRound(100*this._a) / 100; 2737 return this; 2738 }, 2739 toHsv: function() { 2740 var hsv = rgbToHsv(this._r, this._g, this._b); 2741 return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a }; 2742 }, 2743 toHsvString: function() { 2744 var hsv = rgbToHsv(this._r, this._g, this._b); 2745 var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100); 2746 return (this._a == 1) ? 2747 "hsv(" + h + ", " + s + "%, " + v + "%)" : 2748 "hsva(" + h + ", " + s + "%, " + v + "%, "+ this._roundA + ")"; 2749 }, 2750 toHsl: function() { 2751 var hsl = rgbToHsl(this._r, this._g, this._b); 2752 return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a }; 2753 }, 2754 toHslString: function() { 2755 var hsl = rgbToHsl(this._r, this._g, this._b); 2756 var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100); 2757 return (this._a == 1) ? 2758 "hsl(" + h + ", " + s + "%, " + l + "%)" : 2759 "hsla(" + h + ", " + s + "%, " + l + "%, "+ this._roundA + ")"; 2760 }, 2761 toHex: function(allow3Char) { 2762 return rgbToHex(this._r, this._g, this._b, allow3Char); 2763 }, 2764 toHexString: function(allow3Char) { 2765 return '#' + this.toHex(allow3Char); 2766 }, 2767 toHex8: function(allow4Char) { 2768 return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char); 2769 }, 2770 toHex8String: function(allow4Char) { 2771 return '#' + this.toHex8(allow4Char); 2772 }, 2773 toRgb: function() { 2774 return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a }; 2775 }, 2776 toRgbString: function() { 2777 return (this._a == 1) ? 2778 "rgb(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ")" : 2779 "rgba(" + mathRound(this._r) + ", " + mathRound(this._g) + ", " + mathRound(this._b) + ", " + this._roundA + ")"; 2780 }, 2781 toPercentageRgb: function() { 2782 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 }; 2783 }, 2784 toPercentageRgbString: function() { 2785 return (this._a == 1) ? 2786 "rgb(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%)" : 2787 "rgba(" + mathRound(bound01(this._r, 255) * 100) + "%, " + mathRound(bound01(this._g, 255) * 100) + "%, " + mathRound(bound01(this._b, 255) * 100) + "%, " + this._roundA + ")"; 2788 }, 2789 toName: function() { 2790 if (this._a === 0) { 2791 return "transparent"; 2792 } 2793 2794 if (this._a < 1) { 2795 return false; 2796 } 2797 2798 return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false; 2799 }, 2800 toFilter: function(secondColor) { 2801 var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a); 2802 var secondHex8String = hex8String; 2803 var gradientType = this._gradientType ? "GradientType = 1, " : ""; 2804 2805 if (secondColor) { 2806 var s = tinycolor(secondColor); 2807 secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a); 2808 } 2809 2810 return "progid:DXImageTransform.Microsoft.gradient("+gradientType+"startColorstr="+hex8String+",endColorstr="+secondHex8String+")"; 2811 }, 2812 toString: function(format) { 2813 var formatSet = !!format; 2814 format = format || this._format; 2815 2816 var formattedString = false; 2817 var hasAlpha = this._a < 1 && this._a >= 0; 2818 var needsAlphaFormat = !formatSet && hasAlpha && (format === "hex" || format === "hex6" || format === "hex3" || format === "hex4" || format === "hex8" || format === "name"); 2819 2820 if (needsAlphaFormat) { 2821 // Special case for "transparent", all other non-alpha formats 2822 // will return rgba when there is transparency. 2823 if (format === "name" && this._a === 0) { 2824 return this.toName(); 2825 } 2826 return this.toRgbString(); 2827 } 2828 if (format === "rgb") { 2829 formattedString = this.toRgbString(); 2830 } 2831 if (format === "prgb") { 2832 formattedString = this.toPercentageRgbString(); 2833 } 2834 if (format === "hex" || format === "hex6") { 2835 formattedString = this.toHexString(); 2836 } 2837 if (format === "hex3") { 2838 formattedString = this.toHexString(true); 2839 } 2840 if (format === "hex4") { 2841 formattedString = this.toHex8String(true); 2842 } 2843 if (format === "hex8") { 2844 formattedString = this.toHex8String(); 2845 } 2846 if (format === "name") { 2847 formattedString = this.toName(); 2848 } 2849 if (format === "hsl") { 2850 formattedString = this.toHslString(); 2851 } 2852 if (format === "hsv") { 2853 formattedString = this.toHsvString(); 2854 } 2855 2856 return formattedString || this.toHexString(); 2857 }, 2858 clone: function() { 2859 return tinycolor(this.toString()); 2860 }, 2861 2862 _applyModification: function(fn, args) { 2863 var color = fn.apply(null, [this].concat([].slice.call(args))); 2864 this._r = color._r; 2865 this._g = color._g; 2866 this._b = color._b; 2867 this.setAlpha(color._a); 2868 return this; 2869 }, 2870 lighten: function() { 2871 return this._applyModification(lighten, arguments); 2872 }, 2873 brighten: function() { 2874 return this._applyModification(brighten, arguments); 2875 }, 2876 darken: function() { 2877 return this._applyModification(darken, arguments); 2878 }, 2879 desaturate: function() { 2880 return this._applyModification(desaturate, arguments); 2881 }, 2882 saturate: function() { 2883 return this._applyModification(saturate, arguments); 2884 }, 2885 greyscale: function() { 2886 return this._applyModification(greyscale, arguments); 2887 }, 2888 spin: function() { 2889 return this._applyModification(spin, arguments); 2890 }, 2891 2892 _applyCombination: function(fn, args) { 2893 return fn.apply(null, [this].concat([].slice.call(args))); 2894 }, 2895 analogous: function() { 2896 return this._applyCombination(analogous, arguments); 2897 }, 2898 complement: function() { 2899 return this._applyCombination(complement, arguments); 2900 }, 2901 monochromatic: function() { 2902 return this._applyCombination(monochromatic, arguments); 2903 }, 2904 splitcomplement: function() { 2905 return this._applyCombination(splitcomplement, arguments); 2906 }, 2907 triad: function() { 2908 return this._applyCombination(triad, arguments); 2909 }, 2910 tetrad: function() { 2911 return this._applyCombination(tetrad, arguments); 2912 } 2913 }; 2914 2915 // If input is an object, force 1 into "1.0" to handle ratios properly 2916 // String input requires "1.0" as input, so 1 will be treated as 1 2917 tinycolor.fromRatio = function(color, opts) { 2918 if (typeof color == "object") { 2919 var newColor = {}; 2920 for (var i in color) { 2921 if (color.hasOwnProperty(i)) { 2922 if (i === "a") { 2923 newColor[i] = color[i]; 2924 } 2925 else { 2926 newColor[i] = convertToPercentage(color[i]); 2927 } 2928 } 2929 } 2930 color = newColor; 2931 } 2932 2933 return tinycolor(color, opts); 2934 }; 2935 2936 // Given a string or object, convert that input to RGB 2937 // Possible string inputs: 2938 // 2939 // "red" 2940 // "#f00" or "f00" 2941 // "#ff0000" or "ff0000" 2942 // "#ff000000" or "ff000000" 2943 // "rgb 255 0 0" or "rgb (255, 0, 0)" 2944 // "rgb 1.0 0 0" or "rgb (1, 0, 0)" 2945 // "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1" 2946 // "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1" 2947 // "hsl(0, 100%, 50%)" or "hsl 0 100% 50%" 2948 // "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1" 2949 // "hsv(0, 100%, 100%)" or "hsv 0 100% 100%" 2950 // 2951 function inputToRGB(color) { 2952 2953 var rgb = { r: 0, g: 0, b: 0 }; 2954 var a = 1; 2955 var s = null; 2956 var v = null; 2957 var l = null; 2958 var ok = false; 2959 var format = false; 2960 2961 if (typeof color == "string") { 2962 color = stringInputToObject(color); 2963 } 2964 2965 if (typeof color == "object") { 2966 if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) { 2967 rgb = rgbToRgb(color.r, color.g, color.b); 2968 ok = true; 2969 format = String(color.r).substr(-1) === "%" ? "prgb" : "rgb"; 2970 } 2971 else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) { 2972 s = convertToPercentage(color.s); 2973 v = convertToPercentage(color.v); 2974 rgb = hsvToRgb(color.h, s, v); 2975 ok = true; 2976 format = "hsv"; 2977 } 2978 else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) { 2979 s = convertToPercentage(color.s); 2980 l = convertToPercentage(color.l); 2981 rgb = hslToRgb(color.h, s, l); 2982 ok = true; 2983 format = "hsl"; 2984 } 2985 2986 if (color.hasOwnProperty("a")) { 2987 a = color.a; 2988 } 2989 } 2990 2991 a = boundAlpha(a); 2992 2993 return { 2994 ok: ok, 2995 format: color.format || format, 2996 r: mathMin(255, mathMax(rgb.r, 0)), 2997 g: mathMin(255, mathMax(rgb.g, 0)), 2998 b: mathMin(255, mathMax(rgb.b, 0)), 2999 a: a 3000 }; 3001 } 3002 3003 3004 // Conversion Functions 3005 // -------------------- 3006 3007 // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from: 3008 // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript> 3009 3010 // `rgbToRgb` 3011 // Handle bounds / percentage checking to conform to CSS color spec 3012 // <http://www.w3.org/TR/css3-color/> 3013 // *Assumes:* r, g, b in [0, 255] or [0, 1] 3014 // *Returns:* { r, g, b } in [0, 255] 3015 function rgbToRgb(r, g, b){ 3016 return { 3017 r: bound01(r, 255) * 255, 3018 g: bound01(g, 255) * 255, 3019 b: bound01(b, 255) * 255 3020 }; 3021 } 3022 3023 // `rgbToHsl` 3024 // Converts an RGB color value to HSL. 3025 // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1] 3026 // *Returns:* { h, s, l } in [0,1] 3027 function rgbToHsl(r, g, b) { 3028 3029 r = bound01(r, 255); 3030 g = bound01(g, 255); 3031 b = bound01(b, 255); 3032 3033 var max = mathMax(r, g, b), min = mathMin(r, g, b); 3034 var h, s, l = (max + min) / 2; 3035 3036 if(max == min) { 3037 h = s = 0; // achromatic 3038 } 3039 else { 3040 var d = max - min; 3041 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 3042 switch(max) { 3043 case r: h = (g - b) / d + (g < b ? 6 : 0); break; 3044 case g: h = (b - r) / d + 2; break; 3045 case b: h = (r - g) / d + 4; break; 3046 } 3047 3048 h /= 6; 3049 } 3050 3051 return { h: h, s: s, l: l }; 3052 } 3053 3054 // `hslToRgb` 3055 // Converts an HSL color value to RGB. 3056 // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100] 3057 // *Returns:* { r, g, b } in the set [0, 255] 3058 function hslToRgb(h, s, l) { 3059 var r, g, b; 3060 3061 h = bound01(h, 360); 3062 s = bound01(s, 100); 3063 l = bound01(l, 100); 3064 3065 function hue2rgb(p, q, t) { 3066 if(t < 0) t += 1; 3067 if(t > 1) t -= 1; 3068 if(t < 1/6) return p + (q - p) * 6 * t; 3069 if(t < 1/2) return q; 3070 if(t < 2/3) return p + (q - p) * (2/3 - t) * 6; 3071 return p; 3072 } 3073 3074 if(s === 0) { 3075 r = g = b = l; // achromatic 3076 } 3077 else { 3078 var q = l < 0.5 ? l * (1 + s) : l + s - l * s; 3079 var p = 2 * l - q; 3080 r = hue2rgb(p, q, h + 1/3); 3081 g = hue2rgb(p, q, h); 3082 b = hue2rgb(p, q, h - 1/3); 3083 } 3084 3085 return { r: r * 255, g: g * 255, b: b * 255 }; 3086 } 3087 3088 // `rgbToHsv` 3089 // Converts an RGB color value to HSV 3090 // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1] 3091 // *Returns:* { h, s, v } in [0,1] 3092 function rgbToHsv(r, g, b) { 3093 3094 r = bound01(r, 255); 3095 g = bound01(g, 255); 3096 b = bound01(b, 255); 3097 3098 var max = mathMax(r, g, b), min = mathMin(r, g, b); 3099 var h, s, v = max; 3100 3101 var d = max - min; 3102 s = max === 0 ? 0 : d / max; 3103 3104 if(max == min) { 3105 h = 0; // achromatic 3106 } 3107 else { 3108 switch(max) { 3109 case r: h = (g - b) / d + (g < b ? 6 : 0); break; 3110 case g: h = (b - r) / d + 2; break; 3111 case b: h = (r - g) / d + 4; break; 3112 } 3113 h /= 6; 3114 } 3115 return { h: h, s: s, v: v }; 3116 } 3117 3118 // `hsvToRgb` 3119 // Converts an HSV color value to RGB. 3120 // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100] 3121 // *Returns:* { r, g, b } in the set [0, 255] 3122 function hsvToRgb(h, s, v) { 3123 3124 h = bound01(h, 360) * 6; 3125 s = bound01(s, 100); 3126 v = bound01(v, 100); 3127 3128 var i = Math.floor(h), 3129 f = h - i, 3130 p = v * (1 - s), 3131 q = v * (1 - f * s), 3132 t = v * (1 - (1 - f) * s), 3133 mod = i % 6, 3134 r = [v, q, p, p, t, v][mod], 3135 g = [t, v, v, q, p, p][mod], 3136 b = [p, p, t, v, v, q][mod]; 3137 3138 return { r: r * 255, g: g * 255, b: b * 255 }; 3139 } 3140 3141 // `rgbToHex` 3142 // Converts an RGB color to hex 3143 // Assumes r, g, and b are contained in the set [0, 255] 3144 // Returns a 3 or 6 character hex 3145 function rgbToHex(r, g, b, allow3Char) { 3146 3147 var hex = [ 3148 pad2(mathRound(r).toString(16)), 3149 pad2(mathRound(g).toString(16)), 3150 pad2(mathRound(b).toString(16)) 3151 ]; 3152 3153 // Return a 3 character hex if possible 3154 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)) { 3155 return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0); 3156 } 3157 3158 return hex.join(""); 3159 } 3160 3161 // `rgbaToHex` 3162 // Converts an RGBA color plus alpha transparency to hex 3163 // Assumes r, g, b are contained in the set [0, 255] and 3164 // a in [0, 1]. Returns a 4 or 8 character rgba hex 3165 function rgbaToHex(r, g, b, a, allow4Char) { 3166 3167 var hex = [ 3168 pad2(mathRound(r).toString(16)), 3169 pad2(mathRound(g).toString(16)), 3170 pad2(mathRound(b).toString(16)), 3171 pad2(convertDecimalToHex(a)) 3172 ]; 3173 3174 // Return a 4 character hex if possible 3175 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)) { 3176 return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0); 3177 } 3178 3179 return hex.join(""); 3180 } 3181 3182 // `rgbaToArgbHex` 3183 // Converts an RGBA color to an ARGB Hex8 string 3184 // Rarely used, but required for "toFilter()" 3185 function rgbaToArgbHex(r, g, b, a) { 3186 3187 var hex = [ 3188 pad2(convertDecimalToHex(a)), 3189 pad2(mathRound(r).toString(16)), 3190 pad2(mathRound(g).toString(16)), 3191 pad2(mathRound(b).toString(16)) 3192 ]; 3193 3194 return hex.join(""); 3195 } 3196 3197 // `equals` 3198 // Can be called with any tinycolor input 3199 tinycolor.equals = function (color1, color2) { 3200 if (!color1 || !color2) { return false; } 3201 return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString(); 3202 }; 3203 3204 tinycolor.random = function() { 3205 return tinycolor.fromRatio({ 3206 r: mathRandom(), 3207 g: mathRandom(), 3208 b: mathRandom() 3209 }); 3210 }; 3211 3212 3213 // Modification Functions 3214 // ---------------------- 3215 // Thanks to less.js for some of the basics here 3216 // <https://github.com/cloudhead/less.js/blob/master/lib/less/functions.js> 3217 3218 function desaturate(color, amount) { 3219 amount = (amount === 0) ? 0 : (amount || 10); 3220 var hsl = tinycolor(color).toHsl(); 3221 hsl.s -= amount / 100; 3222 hsl.s = clamp01(hsl.s); 3223 return tinycolor(hsl); 3224 } 3225 3226 function saturate(color, amount) { 3227 amount = (amount === 0) ? 0 : (amount || 10); 3228 var hsl = tinycolor(color).toHsl(); 3229 hsl.s += amount / 100; 3230 hsl.s = clamp01(hsl.s); 3231 return tinycolor(hsl); 3232 } 3233 3234 function greyscale(color) { 3235 return tinycolor(color).desaturate(100); 3236 } 3237 3238 function lighten (color, amount) { 3239 amount = (amount === 0) ? 0 : (amount || 10); 3240 var hsl = tinycolor(color).toHsl(); 3241 hsl.l += amount / 100; 3242 hsl.l = clamp01(hsl.l); 3243 return tinycolor(hsl); 3244 } 3245 3246 function brighten(color, amount) { 3247 amount = (amount === 0) ? 0 : (amount || 10); 3248 var rgb = tinycolor(color).toRgb(); 3249 rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100)))); 3250 rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100)))); 3251 rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100)))); 3252 return tinycolor(rgb); 3253 } 3254 3255 function darken (color, amount) { 3256 amount = (amount === 0) ? 0 : (amount || 10); 3257 var hsl = tinycolor(color).toHsl(); 3258 hsl.l -= amount / 100; 3259 hsl.l = clamp01(hsl.l); 3260 return tinycolor(hsl); 3261 } 3262 3263 // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue. 3264 // Values outside of this range will be wrapped into this range. 3265 function spin(color, amount) { 3266 var hsl = tinycolor(color).toHsl(); 3267 var hue = (hsl.h + amount) % 360; 3268 hsl.h = hue < 0 ? 360 + hue : hue; 3269 return tinycolor(hsl); 3270 } 3271 3272 // Combination Functions 3273 // --------------------- 3274 // Thanks to jQuery xColor for some of the ideas behind these 3275 // <https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js> 3276 3277 function complement(color) { 3278 var hsl = tinycolor(color).toHsl(); 3279 hsl.h = (hsl.h + 180) % 360; 3280 return tinycolor(hsl); 3281 } 3282 3283 function triad(color) { 3284 var hsl = tinycolor(color).toHsl(); 3285 var h = hsl.h; 3286 return [ 3287 tinycolor(color), 3288 tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }), 3289 tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l }) 3290 ]; 3291 } 3292 3293 function tetrad(color) { 3294 var hsl = tinycolor(color).toHsl(); 3295 var h = hsl.h; 3296 return [ 3297 tinycolor(color), 3298 tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }), 3299 tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }), 3300 tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l }) 3301 ]; 3302 } 3303 3304 function splitcomplement(color) { 3305 var hsl = tinycolor(color).toHsl(); 3306 var h = hsl.h; 3307 return [ 3308 tinycolor(color), 3309 tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}), 3310 tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l}) 3311 ]; 3312 } 3313 3314 function analogous(color, results, slices) { 3315 results = results || 6; 3316 slices = slices || 30; 3317 3318 var hsl = tinycolor(color).toHsl(); 3319 var part = 360 / slices; 3320 var ret = [tinycolor(color)]; 3321 3322 for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) { 3323 hsl.h = (hsl.h + part) % 360; 3324 ret.push(tinycolor(hsl)); 3325 } 3326 return ret; 3327 } 3328 3329 function monochromatic(color, results) { 3330 results = results || 6; 3331 var hsv = tinycolor(color).toHsv(); 3332 var h = hsv.h, s = hsv.s, v = hsv.v; 3333 var ret = []; 3334 var modification = 1 / results; 3335 3336 while (results--) { 3337 ret.push(tinycolor({ h: h, s: s, v: v})); 3338 v = (v + modification) % 1; 3339 } 3340 3341 return ret; 3342 } 3343 3344 // Utility Functions 3345 // --------------------- 3346 3347 tinycolor.mix = function(color1, color2, amount) { 3348 amount = (amount === 0) ? 0 : (amount || 50); 3349 3350 var rgb1 = tinycolor(color1).toRgb(); 3351 var rgb2 = tinycolor(color2).toRgb(); 3352 3353 var p = amount / 100; 3354 3355 var rgba = { 3356 r: ((rgb2.r - rgb1.r) * p) + rgb1.r, 3357 g: ((rgb2.g - rgb1.g) * p) + rgb1.g, 3358 b: ((rgb2.b - rgb1.b) * p) + rgb1.b, 3359 a: ((rgb2.a - rgb1.a) * p) + rgb1.a 3360 }; 3361 3362 return tinycolor(rgba); 3363 }; 3364 3365 3366 // Readability Functions 3367 // --------------------- 3368 // <http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef (WCAG Version 2) 3369 3370 // `contrast` 3371 // Analyze the 2 colors and returns the color contrast defined by (WCAG Version 2) 3372 tinycolor.readability = function(color1, color2) { 3373 var c1 = tinycolor(color1); 3374 var c2 = tinycolor(color2); 3375 return (Math.max(c1.getLuminance(),c2.getLuminance())+0.05) / (Math.min(c1.getLuminance(),c2.getLuminance())+0.05); 3376 }; 3377 3378 // `isReadable` 3379 // Ensure that foreground and background color combinations meet WCAG2 guidelines. 3380 // The third argument is an optional Object. 3381 // the 'level' property states 'AA' or 'AAA' - if missing or invalid, it defaults to 'AA'; 3382 // the 'size' property states 'large' or 'small' - if missing or invalid, it defaults to 'small'. 3383 // If the entire object is absent, isReadable defaults to {level:"AA",size:"small"}. 3384 3385 // *Example* 3386 // tinycolor.isReadable("#000", "#111") => false 3387 // tinycolor.isReadable("#000", "#111",{level:"AA",size:"large"}) => false 3388 tinycolor.isReadable = function(color1, color2, wcag2) { 3389 var readability = tinycolor.readability(color1, color2); 3390 var wcag2Parms, out; 3391 3392 out = false; 3393 3394 wcag2Parms = validateWCAG2Parms(wcag2); 3395 switch (wcag2Parms.level + wcag2Parms.size) { 3396 case "AAsmall": 3397 case "AAAlarge": 3398 out = readability >= 4.5; 3399 break; 3400 case "AAlarge": 3401 out = readability >= 3; 3402 break; 3403 case "AAAsmall": 3404 out = readability >= 7; 3405 break; 3406 } 3407 return out; 3408 3409 }; 3410 3411 // `mostReadable` 3412 // Given a base color and a list of possible foreground or background 3413 // colors for that base, returns the most readable color. 3414 // Optionally returns Black or White if the most readable color is unreadable. 3415 // *Example* 3416 // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:false}).toHexString(); // "#112255" 3417 // tinycolor.mostReadable(tinycolor.mostReadable("#123", ["#124", "#125"],{includeFallbackColors:true}).toHexString(); // "#ffffff" 3418 // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"large"}).toHexString(); // "#faf3f3" 3419 // tinycolor.mostReadable("#a8015a", ["#faf3f3"],{includeFallbackColors:true,level:"AAA",size:"small"}).toHexString(); // "#ffffff" 3420 tinycolor.mostReadable = function(baseColor, colorList, args) { 3421 var bestColor = null; 3422 var bestScore = 0; 3423 var readability; 3424 var includeFallbackColors, level, size ; 3425 args = args || {}; 3426 includeFallbackColors = args.includeFallbackColors ; 3427 level = args.level; 3428 size = args.size; 3429 3430 for (var i= 0; i < colorList.length ; i++) { 3431 readability = tinycolor.readability(baseColor, colorList[i]); 3432 if (readability > bestScore) { 3433 bestScore = readability; 3434 bestColor = tinycolor(colorList[i]); 3435 } 3436 } 3437 3438 if (tinycolor.isReadable(baseColor, bestColor, {"level":level,"size":size}) || !includeFallbackColors) { 3439 return bestColor; 3440 } 3441 else { 3442 args.includeFallbackColors=false; 3443 return tinycolor.mostReadable(baseColor,["#fff", "#000"],args); 3444 } 3445 }; 3446 3447 3448 // Big List of Colors 3449 // ------------------ 3450 // <http://www.w3.org/TR/css3-color/#svg-color> 3451 var names = tinycolor.names = { 3452 aliceblue: "f0f8ff", 3453 antiquewhite: "faebd7", 3454 aqua: "0ff", 3455 aquamarine: "7fffd4", 3456 azure: "f0ffff", 3457 beige: "f5f5dc", 3458 bisque: "ffe4c4", 3459 black: "000", 3460 blanchedalmond: "ffebcd", 3461 blue: "00f", 3462 blueviolet: "8a2be2", 3463 brown: "a52a2a", 3464 burlywood: "deb887", 3465 burntsienna: "ea7e5d", 3466 cadetblue: "5f9ea0", 3467 chartreuse: "7fff00", 3468 chocolate: "d2691e", 3469 coral: "ff7f50", 3470 cornflowerblue: "6495ed", 3471 cornsilk: "fff8dc", 3472 crimson: "dc143c", 3473 cyan: "0ff", 3474 darkblue: "00008b", 3475 darkcyan: "008b8b", 3476 darkgoldenrod: "b8860b", 3477 darkgray: "a9a9a9", 3478 darkgreen: "006400", 3479 darkgrey: "a9a9a9", 3480 darkkhaki: "bdb76b", 3481 darkmagenta: "8b008b", 3482 darkolivegreen: "556b2f", 3483 darkorange: "ff8c00", 3484 darkorchid: "9932cc", 3485 darkred: "8b0000", 3486 darksalmon: "e9967a", 3487 darkseagreen: "8fbc8f", 3488 darkslateblue: "483d8b", 3489 darkslategray: "2f4f4f", 3490 darkslategrey: "2f4f4f", 3491 darkturquoise: "00ced1", 3492 darkviolet: "9400d3", 3493 deeppink: "ff1493", 3494 deepskyblue: "00bfff", 3495 dimgray: "696969", 3496 dimgrey: "696969", 3497 dodgerblue: "1e90ff", 3498 firebrick: "b22222", 3499 floralwhite: "fffaf0", 3500 forestgreen: "228b22", 3501 fuchsia: "f0f", 3502 gainsboro: "dcdcdc", 3503 ghostwhite: "f8f8ff", 3504 gold: "ffd700", 3505 goldenrod: "daa520", 3506 gray: "808080", 3507 green: "008000", 3508 greenyellow: "adff2f", 3509 grey: "808080", 3510 honeydew: "f0fff0", 3511 hotpink: "ff69b4", 3512 indianred: "cd5c5c", 3513 indigo: "4b0082", 3514 ivory: "fffff0", 3515 khaki: "f0e68c", 3516 lavender: "e6e6fa", 3517 lavenderblush: "fff0f5", 3518 lawngreen: "7cfc00", 3519 lemonchiffon: "fffacd", 3520 lightblue: "add8e6", 3521 lightcoral: "f08080", 3522 lightcyan: "e0ffff", 3523 lightgoldenrodyellow: "fafad2", 3524 lightgray: "d3d3d3", 3525 lightgreen: "90ee90", 3526 lightgrey: "d3d3d3", 3527 lightpink: "ffb6c1", 3528 lightsalmon: "ffa07a", 3529 lightseagreen: "20b2aa", 3530 lightskyblue: "87cefa", 3531 lightslategray: "789", 3532 lightslategrey: "789", 3533 lightsteelblue: "b0c4de", 3534 lightyellow: "ffffe0", 3535 lime: "0f0", 3536 limegreen: "32cd32", 3537 linen: "faf0e6", 3538 magenta: "f0f", 3539 maroon: "800000", 3540 mediumaquamarine: "66cdaa", 3541 mediumblue: "0000cd", 3542 mediumorchid: "ba55d3", 3543 mediumpurple: "9370db", 3544 mediumseagreen: "3cb371", 3545 mediumslateblue: "7b68ee", 3546 mediumspringgreen: "00fa9a", 3547 mediumturquoise: "48d1cc", 3548 mediumvioletred: "c71585", 3549 midnightblue: "191970", 3550 mintcream: "f5fffa", 3551 mistyrose: "ffe4e1", 3552 moccasin: "ffe4b5", 3553 navajowhite: "ffdead", 3554 navy: "000080", 3555 oldlace: "fdf5e6", 3556 olive: "808000", 3557 olivedrab: "6b8e23", 3558 orange: "ffa500", 3559 orangered: "ff4500", 3560 orchid: "da70d6", 3561 palegoldenrod: "eee8aa", 3562 palegreen: "98fb98", 3563 paleturquoise: "afeeee", 3564 palevioletred: "db7093", 3565 papayawhip: "ffefd5", 3566 peachpuff: "ffdab9", 3567 peru: "cd853f", 3568 pink: "ffc0cb", 3569 plum: "dda0dd", 3570 powderblue: "b0e0e6", 3571 purple: "800080", 3572 rebeccapurple: "663399", 3573 red: "f00", 3574 rosybrown: "bc8f8f", 3575 royalblue: "4169e1", 3576 saddlebrown: "8b4513", 3577 salmon: "fa8072", 3578 sandybrown: "f4a460", 3579 seagreen: "2e8b57", 3580 seashell: "fff5ee", 3581 sienna: "a0522d", 3582 silver: "c0c0c0", 3583 skyblue: "87ceeb", 3584 slateblue: "6a5acd", 3585 slategray: "708090", 3586 slategrey: "708090", 3587 snow: "fffafa", 3588 springgreen: "00ff7f", 3589 steelblue: "4682b4", 3590 tan: "d2b48c", 3591 teal: "008080", 3592 thistle: "d8bfd8", 3593 tomato: "ff6347", 3594 turquoise: "40e0d0", 3595 violet: "ee82ee", 3596 wheat: "f5deb3", 3597 white: "fff", 3598 whitesmoke: "f5f5f5", 3599 yellow: "ff0", 3600 yellowgreen: "9acd32" 3601 }; 3602 3603 // Make it easy to access colors via `hexNames[hex]` 3604 var hexNames = tinycolor.hexNames = flip(names); 3605 3606 3607 // Utilities 3608 // --------- 3609 3610 // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }` 3611 function flip(o) { 3612 var flipped = { }; 3613 for (var i in o) { 3614 if (o.hasOwnProperty(i)) { 3615 flipped[o[i]] = i; 3616 } 3617 } 3618 return flipped; 3619 } 3620 3621 // Return a valid alpha value [0,1] with all invalid values being set to 1 3622 function boundAlpha(a) { 3623 a = parseFloat(a); 3624 3625 if (isNaN(a) || a < 0 || a > 1) { 3626 a = 1; 3627 } 3628 3629 return a; 3630 } 3631 3632 // Take input from [0, n] and return it as [0, 1] 3633 function bound01(n, max) { 3634 if (isOnePointZero(n)) { n = "100%"; } 3635 3636 var processPercent = isPercentage(n); 3637 n = mathMin(max, mathMax(0, parseFloat(n))); 3638 3639 // Automatically convert percentage into number 3640 if (processPercent) { 3641 n = parseInt(n * max, 10) / 100; 3642 } 3643 3644 // Handle floating point rounding errors 3645 if ((Math.abs(n - max) < 0.000001)) { 3646 return 1; 3647 } 3648 3649 // Convert into [0, 1] range if it isn't already 3650 return (n % max) / parseFloat(max); 3651 } 3652 3653 // Force a number between 0 and 1 3654 function clamp01(val) { 3655 return mathMin(1, mathMax(0, val)); 3656 } 3657 3658 // Parse a base-16 hex value into a base-10 integer 3659 function parseIntFromHex(val) { 3660 return parseInt(val, 16); 3661 } 3662 3663 // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1 3664 // <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0> 3665 function isOnePointZero(n) { 3666 return typeof n == "string" && n.indexOf('.') != -1 && parseFloat(n) === 1; 3667 } 3668 3669 // Check to see if string passed in is a percentage 3670 function isPercentage(n) { 3671 return typeof n === "string" && n.indexOf('%') != -1; 3672 } 3673 3674 // Force a hex value to have 2 characters 3675 function pad2(c) { 3676 return c.length == 1 ? '0' + c : '' + c; 3677 } 3678 3679 // Replace a decimal with it's percentage value 3680 function convertToPercentage(n) { 3681 if (n <= 1) { 3682 n = (n * 100) + "%"; 3683 } 3684 3685 return n; 3686 } 3687 3688 // Converts a decimal to a hex value 3689 function convertDecimalToHex(d) { 3690 return Math.round(parseFloat(d) * 255).toString(16); 3691 } 3692 // Converts a hex value to a decimal 3693 function convertHexToDecimal(h) { 3694 return (parseIntFromHex(h) / 255); 3695 } 3696 3697 var matchers = (function() { 3698 3699 // <http://www.w3.org/TR/css3-values/#integers> 3700 var CSS_INTEGER = "[-\\+]?\\d+%?"; 3701 3702 // <http://www.w3.org/TR/css3-values/#number-value> 3703 var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; 3704 3705 // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome. 3706 var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; 3707 3708 // Actual matching. 3709 // Parentheses and commas are optional, but not required. 3710 // Whitespace can take the place of commas or opening paren 3711 var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 3712 var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; 3713 3714 return { 3715 CSS_UNIT: new RegExp(CSS_UNIT), 3716 rgb: new RegExp("rgb" + PERMISSIVE_MATCH3), 3717 rgba: new RegExp("rgba" + PERMISSIVE_MATCH4), 3718 hsl: new RegExp("hsl" + PERMISSIVE_MATCH3), 3719 hsla: new RegExp("hsla" + PERMISSIVE_MATCH4), 3720 hsv: new RegExp("hsv" + PERMISSIVE_MATCH3), 3721 hsva: new RegExp("hsva" + PERMISSIVE_MATCH4), 3722 hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 3723 hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, 3724 hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/, 3725 hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/ 3726 }; 3727 })(); 3728 3729 // `isValidCSSUnit` 3730 // Take in a single string / number and check to see if it looks like a CSS unit 3731 // (see `matchers` above for definition). 3732 function isValidCSSUnit(color) { 3733 return !!matchers.CSS_UNIT.exec(color); 3734 } 3735 3736 // `stringInputToObject` 3737 // Permissive string parsing. Take in a number of formats, and output an object 3738 // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}` 3739 function stringInputToObject(color) { 3740 3741 color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase(); 3742 var named = false; 3743 if (names[color]) { 3744 color = names[color]; 3745 named = true; 3746 } 3747 else if (color == 'transparent') { 3748 return { r: 0, g: 0, b: 0, a: 0, format: "name" }; 3749 } 3750 3751 // Try to match string input using regular expressions. 3752 // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360] 3753 // Just return an object and let the conversion functions handle that. 3754 // This way the result will be the same whether the tinycolor is initialized with string or object. 3755 var match; 3756 if ((match = matchers.rgb.exec(color))) { 3757 return { r: match[1], g: match[2], b: match[3] }; 3758 } 3759 if ((match = matchers.rgba.exec(color))) { 3760 return { r: match[1], g: match[2], b: match[3], a: match[4] }; 3761 } 3762 if ((match = matchers.hsl.exec(color))) { 3763 return { h: match[1], s: match[2], l: match[3] }; 3764 } 3765 if ((match = matchers.hsla.exec(color))) { 3766 return { h: match[1], s: match[2], l: match[3], a: match[4] }; 3767 } 3768 if ((match = matchers.hsv.exec(color))) { 3769 return { h: match[1], s: match[2], v: match[3] }; 3770 } 3771 if ((match = matchers.hsva.exec(color))) { 3772 return { h: match[1], s: match[2], v: match[3], a: match[4] }; 3773 } 3774 if ((match = matchers.hex8.exec(color))) { 3775 return { 3776 r: parseIntFromHex(match[1]), 3777 g: parseIntFromHex(match[2]), 3778 b: parseIntFromHex(match[3]), 3779 a: convertHexToDecimal(match[4]), 3780 format: named ? "name" : "hex8" 3781 }; 3782 } 3783 if ((match = matchers.hex6.exec(color))) { 3784 return { 3785 r: parseIntFromHex(match[1]), 3786 g: parseIntFromHex(match[2]), 3787 b: parseIntFromHex(match[3]), 3788 format: named ? "name" : "hex" 3789 }; 3790 } 3791 if ((match = matchers.hex4.exec(color))) { 3792 return { 3793 r: parseIntFromHex(match[1] + '' + match[1]), 3794 g: parseIntFromHex(match[2] + '' + match[2]), 3795 b: parseIntFromHex(match[3] + '' + match[3]), 3796 a: convertHexToDecimal(match[4] + '' + match[4]), 3797 format: named ? "name" : "hex8" 3798 }; 3799 } 3800 if ((match = matchers.hex3.exec(color))) { 3801 return { 3802 r: parseIntFromHex(match[1] + '' + match[1]), 3803 g: parseIntFromHex(match[2] + '' + match[2]), 3804 b: parseIntFromHex(match[3] + '' + match[3]), 3805 format: named ? "name" : "hex" 3806 }; 3807 } 3808 3809 return false; 3810 } 3811 3812 function validateWCAG2Parms(parms) { 3813 // return valid WCAG2 parms for isReadable. 3814 // If input parms are invalid, return {"level":"AA", "size":"small"} 3815 var level, size; 3816 parms = parms || {"level":"AA", "size":"small"}; 3817 level = (parms.level || "AA").toUpperCase(); 3818 size = (parms.size || "small").toLowerCase(); 3819 if (level !== "AA" && level !== "AAA") { 3820 level = "AA"; 3821 } 3822 if (size !== "small" && size !== "large") { 3823 size = "small"; 3824 } 3825 return {"level":level, "size":size}; 3826 } 3827 3828 // Node: Export function 3829 if ( true && module.exports) { 3830 module.exports = tinycolor; 3831 } 3832 // AMD/requirejs: Define the module 3833 else if (true) { 3834 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module), 3835 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 3836 } 3837 // Browser: Expose to window 3838 else {} 3839 3840 })(Math); 3841 3842 3843 /***/ }), 3844 /* 63 */, 3845 /* 64 */ 3846 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3847 3848 "use strict"; 3849 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return findFirstEnabledItem; }); 3850 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getCurrentId; }); 3851 function findFirstEnabledItem(items, excludeId) { 3852 if (excludeId) { 3853 return items.find(function (item) { 3854 return !item.disabled && item.id !== excludeId; 3855 }); 3856 } 3857 3858 return items.find(function (item) { 3859 return !item.disabled; 3860 }); 3861 } 3862 3863 function getCurrentId(options, passedId) { 3864 var _findFirstEnabledItem; 3865 3866 if (passedId || passedId === null) { 3867 return passedId; 3868 } 3869 3870 if (options.currentId || options.currentId === null) { 3871 return options.currentId; 3872 } 3873 3874 return (_findFirstEnabledItem = findFirstEnabledItem(options.items || [])) === null || _findFirstEnabledItem === void 0 ? void 0 : _findFirstEnabledItem.id; 3875 } 3876 3877 3878 3879 3880 /***/ }), 3881 /* 65 */ 3882 /***/ (function(module, exports) { 3883 3884 (function() { module.exports = window["wp"]["isShallowEqual"]; }()); 3885 3886 /***/ }), 3887 /* 66 */, 3888 /* 67 */ 3889 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3890 3891 "use strict"; 3892 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getActiveElement; }); 3893 /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54); 3894 3895 3896 /** 3897 * Returns `element.ownerDocument.activeElement`. 3898 */ 3899 3900 function getActiveElement(element) { 3901 var _getDocument = Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element), 3902 activeElement = _getDocument.activeElement; 3903 3904 if (!(activeElement !== null && activeElement !== void 0 && activeElement.nodeName)) { 3905 // In IE11, activeElement might be an empty object if we're interacting 3906 // with elements inside of an iframe. 3907 return null; 3908 } 3909 3910 return activeElement; 3911 } 3912 3913 3914 3915 3916 /***/ }), 3917 /* 68 */ 3918 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3919 3920 "use strict"; 3921 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isSelfTarget; }); 3922 /** 3923 * Returns `true` if `event.target` and `event.currentTarget` are the same. 3924 */ 3925 function isSelfTarget(event) { 3926 return event.target === event.currentTarget; 3927 } 3928 3929 3930 3931 3932 /***/ }), 3933 /* 69 */ 3934 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3935 3936 "use strict"; 3937 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return shallowEqual; }); 3938 /** 3939 * Compares two objects. 3940 * 3941 * @example 3942 * import { shallowEqual } from "reakit-utils"; 3943 * 3944 * shallowEqual({ a: "a" }, {}); // false 3945 * shallowEqual({ a: "a" }, { b: "b" }); // false 3946 * shallowEqual({ a: "a" }, { a: "a" }); // true 3947 * shallowEqual({ a: "a" }, { a: "a", b: "b" }); // false 3948 */ 3949 function shallowEqual(objA, objB) { 3950 if (objA === objB) return true; 3951 if (!objA) return false; 3952 if (!objB) return false; 3953 if (typeof objA !== "object") return false; 3954 if (typeof objB !== "object") return false; 3955 var aKeys = Object.keys(objA); 3956 var bKeys = Object.keys(objB); 3957 var length = aKeys.length; 3958 if (bKeys.length !== length) return false; 3959 3960 for (var _i = 0, _aKeys = aKeys; _i < _aKeys.length; _i++) { 3961 var key = _aKeys[_i]; 3962 3963 if (objA[key] !== objB[key]) { 3964 return false; 3965 } 3966 } 3967 3968 return true; 3969 } 3970 3971 3972 3973 3974 /***/ }), 3975 /* 70 */ 3976 /***/ (function(module, exports) { 3977 3978 (function() { module.exports = window["wp"]["date"]; }()); 3979 3980 /***/ }), 3981 /* 71 */ 3982 /***/ (function(module, __webpack_exports__, __webpack_require__) { 3983 3984 "use strict"; 3985 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useIsomorphicEffect; }); 3986 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); 3987 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 3988 /* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(89); 3989 3990 3991 3992 3993 3994 /** 3995 * `React.useLayoutEffect` that fallbacks to `React.useEffect` on server side 3996 * rendering. 3997 */ 3998 3999 var useIsomorphicEffect = !_canUseDOM_js__WEBPACK_IMPORTED_MODULE_1__[/* canUseDOM */ "a"] ? react__WEBPACK_IMPORTED_MODULE_0__["useEffect"] : react__WEBPACK_IMPORTED_MODULE_0__["useLayoutEffect"]; 4000 4001 4002 4003 4004 /***/ }), 4005 /* 72 */, 4006 /* 73 */, 4007 /* 74 */ 4008 /***/ (function(module, exports, __webpack_require__) { 4009 4010 "use strict"; 4011 4012 4013 Object.defineProperty(exports, "__esModule", { 4014 value: true 4015 }); 4016 var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L'; 4017 var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD'; 4018 var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM'; 4019 4020 var START_DATE = exports.START_DATE = 'startDate'; 4021 var END_DATE = exports.END_DATE = 'endDate'; 4022 4023 var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal'; 4024 var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical'; 4025 var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable'; 4026 4027 var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before'; 4028 var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after'; 4029 4030 var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top'; 4031 var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom'; 4032 var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before'; 4033 var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after'; 4034 4035 var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left'; 4036 var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right'; 4037 4038 var OPEN_DOWN = exports.OPEN_DOWN = 'down'; 4039 var OPEN_UP = exports.OPEN_UP = 'up'; 4040 4041 var DAY_SIZE = exports.DAY_SIZE = 39; 4042 var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked'; 4043 var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6]; 4044 4045 var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20; 4046 var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10; 4047 var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22; 4048 4049 var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']); 4050 4051 /***/ }), 4052 /* 75 */ 4053 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4054 4055 "use strict"; 4056 /* unused harmony export Role */ 4057 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useRole; }); 4058 /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20); 4059 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61); 4060 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60); 4061 /* harmony import */ var reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(69); 4062 4063 4064 4065 4066 4067 // Automatically generated 4068 var ROLE_KEYS = ["unstable_system"]; 4069 4070 var useRole = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ 4071 name: "Role", 4072 keys: ROLE_KEYS, 4073 propsAreEqual: function propsAreEqual(prev, next) { 4074 var prevSystem = prev.unstable_system, 4075 prevProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(prev, ["unstable_system"]); 4076 4077 var nextSystem = next.unstable_system, 4078 nextProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(next, ["unstable_system"]); 4079 4080 if (prevSystem !== nextSystem && !Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevSystem, nextSystem)) { 4081 return false; 4082 } 4083 4084 return Object(reakit_utils_shallowEqual__WEBPACK_IMPORTED_MODULE_3__[/* shallowEqual */ "a"])(prevProps, nextProps); 4085 } 4086 }); 4087 var Role = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ 4088 as: "div", 4089 useHook: useRole 4090 }); 4091 4092 4093 4094 4095 /***/ }), 4096 /* 76 */, 4097 /* 77 */ 4098 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4099 4100 "use strict"; 4101 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); 4102 /* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8); 4103 /* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); 4104 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(0); 4105 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); 4106 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7); 4107 /* harmony import */ var _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__); 4108 /* harmony import */ var _dashicon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(148); 4109 4110 4111 4112 4113 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; } 4114 4115 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; } 4116 4117 /** 4118 * WordPress dependencies 4119 */ 4120 4121 4122 /** 4123 * Internal dependencies 4124 */ 4125 4126 4127 4128 function Icon(_ref) { 4129 var _ref$icon = _ref.icon, 4130 icon = _ref$icon === void 0 ? null : _ref$icon, 4131 size = _ref.size, 4132 additionalProps = Object(_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__[/* default */ "a"])(_ref, ["icon", "size"]); 4133 4134 if ('string' === typeof icon) { 4135 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"])({ 4136 icon: icon 4137 }, additionalProps)); 4138 } 4139 4140 if (icon && _dashicon__WEBPACK_IMPORTED_MODULE_5__[/* default */ "a"] === icon.type) { 4141 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({}, additionalProps)); 4142 } // Icons should be 24x24 by default. 4143 4144 4145 var iconSize = size || 24; 4146 4147 if ('function' === typeof icon) { 4148 if (icon.prototype instanceof _wordpress_element__WEBPACK_IMPORTED_MODULE_3__["Component"]) { 4149 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(icon, _objectSpread({ 4150 size: iconSize 4151 }, additionalProps)); 4152 } 4153 4154 return icon(_objectSpread({ 4155 size: iconSize 4156 }, additionalProps)); 4157 } 4158 4159 if (icon && (icon.type === 'svg' || icon.type === _wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__["SVG"])) { 4160 var appliedProps = _objectSpread(_objectSpread({ 4161 width: iconSize, 4162 height: iconSize 4163 }, icon.props), additionalProps); 4164 4165 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["createElement"])(_wordpress_primitives__WEBPACK_IMPORTED_MODULE_4__["SVG"], appliedProps); 4166 } 4167 4168 if (Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["isValidElement"])(icon)) { 4169 return Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["cloneElement"])(icon, _objectSpread({ 4170 size: iconSize 4171 }, additionalProps)); 4172 } 4173 4174 return icon; 4175 } 4176 4177 /* harmony default export */ __webpack_exports__["a"] = (Icon); 4178 4179 4180 /***/ }), 4181 /* 78 */ 4182 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4183 4184 "use strict"; 4185 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectSpread2; }); 4186 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectWithoutPropertiesLoose; }); 4187 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return _createForOfIteratorHelperLoose; }); 4188 function _defineProperty(obj, key, value) { 4189 if (key in obj) { 4190 Object.defineProperty(obj, key, { 4191 value: value, 4192 enumerable: true, 4193 configurable: true, 4194 writable: true 4195 }); 4196 } else { 4197 obj[key] = value; 4198 } 4199 4200 return obj; 4201 } 4202 4203 function ownKeys(object, enumerableOnly) { 4204 var keys = Object.keys(object); 4205 4206 if (Object.getOwnPropertySymbols) { 4207 var symbols = Object.getOwnPropertySymbols(object); 4208 if (enumerableOnly) symbols = symbols.filter(function (sym) { 4209 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 4210 }); 4211 keys.push.apply(keys, symbols); 4212 } 4213 4214 return keys; 4215 } 4216 4217 function _objectSpread2(target) { 4218 for (var i = 1; i < arguments.length; i++) { 4219 var source = arguments[i] != null ? arguments[i] : {}; 4220 4221 if (i % 2) { 4222 ownKeys(Object(source), true).forEach(function (key) { 4223 _defineProperty(target, key, source[key]); 4224 }); 4225 } else if (Object.getOwnPropertyDescriptors) { 4226 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 4227 } else { 4228 ownKeys(Object(source)).forEach(function (key) { 4229 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 4230 }); 4231 } 4232 } 4233 4234 return target; 4235 } 4236 4237 function _objectWithoutPropertiesLoose(source, excluded) { 4238 if (source == null) return {}; 4239 var target = {}; 4240 var sourceKeys = Object.keys(source); 4241 var key, i; 4242 4243 for (i = 0; i < sourceKeys.length; i++) { 4244 key = sourceKeys[i]; 4245 if (excluded.indexOf(key) >= 0) continue; 4246 target[key] = source[key]; 4247 } 4248 4249 return target; 4250 } 4251 4252 function _unsupportedIterableToArray(o, minLen) { 4253 if (!o) return; 4254 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 4255 var n = Object.prototype.toString.call(o).slice(8, -1); 4256 if (n === "Object" && o.constructor) n = o.constructor.name; 4257 if (n === "Map" || n === "Set") return Array.from(o); 4258 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 4259 } 4260 4261 function _arrayLikeToArray(arr, len) { 4262 if (len == null || len > arr.length) len = arr.length; 4263 4264 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 4265 4266 return arr2; 4267 } 4268 4269 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 4270 var it; 4271 4272 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 4273 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 4274 if (it) o = it; 4275 var i = 0; 4276 return function () { 4277 if (i >= o.length) return { 4278 done: true 4279 }; 4280 return { 4281 done: false, 4282 value: o[i++] 4283 }; 4284 }; 4285 } 4286 4287 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 4288 } 4289 4290 it = o[Symbol.iterator](); 4291 return it.next.bind(it); 4292 } 4293 4294 4295 4296 4297 /***/ }), 4298 /* 79 */ 4299 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4300 4301 "use strict"; 4302 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useForkRef; }); 4303 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); 4304 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 4305 4306 4307 // https://github.com/mui-org/material-ui/blob/2bcc874cf07b81202968f769cb9c2398c7c11311/packages/material-ui/src/utils/useForkRef.js 4308 4309 function setRef(ref, value) { 4310 if (value === void 0) { 4311 value = null; 4312 } 4313 4314 if (!ref) return; 4315 4316 if (typeof ref === "function") { 4317 ref(value); 4318 } else { 4319 ref.current = value; 4320 } 4321 } 4322 /** 4323 * Merges up to two React Refs into a single memoized function React Ref so you 4324 * can pass it to an element. 4325 * 4326 * @example 4327 * import React from "react"; 4328 * import { useForkRef } from "reakit-utils"; 4329 * 4330 * const Component = React.forwardRef((props, ref) => { 4331 * const internalRef = React.useRef(); 4332 * return <div {...props} ref={useForkRef(internalRef, ref)} />; 4333 * }); 4334 */ 4335 4336 4337 function useForkRef(refA, refB) { 4338 return Object(react__WEBPACK_IMPORTED_MODULE_0__["useMemo"])(function () { 4339 if (refA == null && refB == null) { 4340 return null; 4341 } 4342 4343 return function (value) { 4344 setRef(refA, value); 4345 setRef(refB, value); 4346 }; 4347 }, [refA, refB]); 4348 } 4349 4350 4351 4352 4353 /***/ }), 4354 /* 80 */ 4355 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4356 4357 "use strict"; 4358 4359 // UNUSED EXPORTS: TOOLTIP_DELAY 4360 4361 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules 4362 var slicedToArray = __webpack_require__(12); 4363 4364 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 4365 var defineProperty = __webpack_require__(5); 4366 4367 // EXTERNAL MODULE: external ["wp","element"] 4368 var external_wp_element_ = __webpack_require__(0); 4369 4370 // EXTERNAL MODULE: external "lodash" 4371 var external_lodash_ = __webpack_require__(2); 4372 4373 // EXTERNAL MODULE: external ["wp","compose"] 4374 var external_wp_compose_ = __webpack_require__(11); 4375 4376 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js + 1 modules 4377 var popover = __webpack_require__(113); 4378 4379 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/shortcut/index.js 4380 var build_module_shortcut = __webpack_require__(180); 4381 4382 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 4383 var objectWithoutProperties = __webpack_require__(13); 4384 4385 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/ui/context/with-next.js 4386 var with_next = __webpack_require__(526); 4387 4388 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tooltip/next.js 4389 4390 4391 4392 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; } 4393 4394 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; } 4395 4396 /** 4397 * Internal dependencies 4398 */ 4399 4400 4401 var Tooltip = false ? undefined : undefined; 4402 4403 var next_adapter = function adapter(_ref) { 4404 var text = _ref.text, 4405 props = Object(objectWithoutProperties["a" /* default */])(_ref, ["text"]); 4406 4407 return _objectSpread(_objectSpread({}, props), {}, { 4408 content: text 4409 }); 4410 }; 4411 4412 function withNextComponent(Component) { 4413 return Object(with_next["a" /* withNext */])(Component, Tooltip, 'WPComponentsTooltip', next_adapter); 4414 } 4415 4416 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/tooltip/index.js 4417 4418 4419 4420 4421 function tooltip_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; } 4422 4423 function tooltip_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { tooltip_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 { tooltip_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; } 4424 4425 /** 4426 * External dependencies 4427 */ 4428 4429 /** 4430 * WordPress dependencies 4431 */ 4432 4433 4434 4435 /** 4436 * Internal dependencies 4437 */ 4438 4439 4440 4441 4442 /** 4443 * Time over children to wait before showing tooltip 4444 * 4445 * @type {number} 4446 */ 4447 4448 var TOOLTIP_DELAY = 700; 4449 var eventCatcher = Object(external_wp_element_["createElement"])("div", { 4450 className: "event-catcher" 4451 }); 4452 4453 var tooltip_getDisabledElement = function getDisabledElement(_ref) { 4454 var eventHandlers = _ref.eventHandlers, 4455 child = _ref.child, 4456 childrenWithPopover = _ref.childrenWithPopover; 4457 return Object(external_wp_element_["cloneElement"])(Object(external_wp_element_["createElement"])("span", { 4458 className: "disabled-element-wrapper" 4459 }, Object(external_wp_element_["cloneElement"])(eventCatcher, eventHandlers), Object(external_wp_element_["cloneElement"])(child, { 4460 children: childrenWithPopover 4461 }), ","), eventHandlers); 4462 }; 4463 4464 var tooltip_getRegularElement = function getRegularElement(_ref2) { 4465 var child = _ref2.child, 4466 eventHandlers = _ref2.eventHandlers, 4467 childrenWithPopover = _ref2.childrenWithPopover; 4468 return Object(external_wp_element_["cloneElement"])(child, tooltip_objectSpread(tooltip_objectSpread({}, eventHandlers), {}, { 4469 children: childrenWithPopover 4470 })); 4471 }; 4472 4473 var tooltip_addPopoverToGrandchildren = function addPopoverToGrandchildren(_ref3) { 4474 var grandchildren = _ref3.grandchildren, 4475 isOver = _ref3.isOver, 4476 position = _ref3.position, 4477 text = _ref3.text, 4478 shortcut = _ref3.shortcut; 4479 return Object(external_wp_element_["concatChildren"])(grandchildren, isOver && Object(external_wp_element_["createElement"])(popover["a" /* default */], { 4480 focusOnMount: false, 4481 position: position, 4482 className: "components-tooltip", 4483 "aria-hidden": "true", 4484 animate: false, 4485 noArrow: true 4486 }, text, Object(external_wp_element_["createElement"])(build_module_shortcut["a" /* default */], { 4487 className: "components-tooltip__shortcut", 4488 shortcut: shortcut 4489 }))); 4490 }; 4491 4492 var tooltip_emitToChild = function emitToChild(children, eventName, event) { 4493 if (external_wp_element_["Children"].count(children) !== 1) { 4494 return; 4495 } 4496 4497 var child = external_wp_element_["Children"].only(children); 4498 4499 if (typeof child.props[eventName] === 'function') { 4500 child.props[eventName](event); 4501 } 4502 }; 4503 4504 function tooltip_Tooltip(_ref4) { 4505 var children = _ref4.children, 4506 position = _ref4.position, 4507 text = _ref4.text, 4508 shortcut = _ref4.shortcut; 4509 4510 /** 4511 * Whether a mouse is currently pressed, used in determining whether 4512 * to handle a focus event as displaying the tooltip immediately. 4513 * 4514 * @type {boolean} 4515 */ 4516 var _useState = Object(external_wp_element_["useState"])(false), 4517 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 4518 isMouseDown = _useState2[0], 4519 setIsMouseDown = _useState2[1]; 4520 4521 var _useState3 = Object(external_wp_element_["useState"])(false), 4522 _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), 4523 isOver = _useState4[0], 4524 setIsOver = _useState4[1]; 4525 4526 var delayedSetIsOver = Object(external_wp_compose_["useDebounce"])(setIsOver, TOOLTIP_DELAY); 4527 4528 var createMouseDown = function createMouseDown(event) { 4529 // Preserve original child callback behavior 4530 tooltip_emitToChild(children, 'onMouseDown', event); // On mouse down, the next `mouseup` should revert the value of the 4531 // instance property and remove its own event handler. The bind is 4532 // made on the document since the `mouseup` might not occur within 4533 // the bounds of the element. 4534 4535 document.addEventListener('mouseup', cancelIsMouseDown); 4536 setIsMouseDown(true); 4537 }; 4538 4539 var createMouseUp = function createMouseUp(event) { 4540 tooltip_emitToChild(children, 'onMouseUp', event); 4541 document.removeEventListener('mouseup', cancelIsMouseDown); 4542 setIsMouseDown(false); 4543 }; 4544 4545 var createMouseEvent = function createMouseEvent(type) { 4546 if (type === 'mouseUp') return createMouseUp; 4547 if (type === 'mouseDown') return createMouseDown; 4548 }; 4549 /** 4550 * Prebound `isInMouseDown` handler, created as a constant reference to 4551 * assure ability to remove in component unmount. 4552 * 4553 * @type {Function} 4554 */ 4555 4556 4557 var cancelIsMouseDown = createMouseEvent('mouseUp'); 4558 4559 var createToggleIsOver = function createToggleIsOver(eventName, isDelayed) { 4560 return function (event) { 4561 // Preserve original child callback behavior 4562 tooltip_emitToChild(children, eventName, event); // Mouse events behave unreliably in React for disabled elements, 4563 // firing on mouseenter but not mouseleave. Further, the default 4564 // behavior for disabled elements in some browsers is to ignore 4565 // mouse events. Don't bother trying to to handle them. 4566 // 4567 // See: https://github.com/facebook/react/issues/4251 4568 4569 if (event.currentTarget.disabled) { 4570 return; 4571 } // A focus event will occur as a result of a mouse click, but it 4572 // should be disambiguated between interacting with the button and 4573 // using an explicit focus shift as a cue to display the tooltip. 4574 4575 4576 if ('focus' === event.type && isMouseDown) { 4577 return; 4578 } // Needed in case unsetting is over while delayed set pending, i.e. 4579 // quickly blur/mouseleave before delayedSetIsOver is called 4580 4581 4582 delayedSetIsOver.cancel(); 4583 4584 var _isOver = Object(external_lodash_["includes"])(['focus', 'mouseenter'], event.type); 4585 4586 if (_isOver === isOver) { 4587 return; 4588 } 4589 4590 if (isDelayed) { 4591 delayedSetIsOver(_isOver); 4592 } else { 4593 setIsOver(_isOver); 4594 } 4595 }; 4596 }; 4597 4598 var clearOnUnmount = function clearOnUnmount() { 4599 delayedSetIsOver.cancel(); 4600 }; 4601 4602 Object(external_wp_element_["useEffect"])(function () { 4603 return clearOnUnmount; 4604 }, []); 4605 4606 if (external_wp_element_["Children"].count(children) !== 1) { 4607 if (false) {} 4608 4609 return children; 4610 } 4611 4612 var eventHandlers = { 4613 onMouseEnter: createToggleIsOver('onMouseEnter', true), 4614 onMouseLeave: createToggleIsOver('onMouseLeave'), 4615 onClick: createToggleIsOver('onClick'), 4616 onFocus: createToggleIsOver('onFocus'), 4617 onBlur: createToggleIsOver('onBlur'), 4618 onMouseDown: createMouseEvent('mouseDown') 4619 }; 4620 var child = external_wp_element_["Children"].only(children); 4621 var _child$props = child.props, 4622 grandchildren = _child$props.children, 4623 disabled = _child$props.disabled; 4624 var getElementWithPopover = disabled ? tooltip_getDisabledElement : tooltip_getRegularElement; 4625 var popoverData = { 4626 isOver: isOver, 4627 position: position, 4628 text: text, 4629 shortcut: shortcut 4630 }; 4631 var childrenWithPopover = tooltip_addPopoverToGrandchildren(tooltip_objectSpread({ 4632 grandchildren: grandchildren 4633 }, popoverData)); 4634 return getElementWithPopover({ 4635 child: child, 4636 eventHandlers: eventHandlers, 4637 childrenWithPopover: childrenWithPopover 4638 }); 4639 } 4640 4641 /* harmony default export */ var tooltip = __webpack_exports__["a"] = (withNextComponent(tooltip_Tooltip)); 4642 4643 4644 /***/ }), 4645 /* 81 */ 4646 /***/ (function(module, exports, __webpack_require__) { 4647 4648 "use strict"; 4649 4650 4651 var ES5Type = __webpack_require__(331); 4652 4653 // https://262.ecma-international.org/11.0/#sec-ecmascript-data-types-and-values 4654 4655 module.exports = function Type(x) { 4656 if (typeof x === 'symbol') { 4657 return 'Symbol'; 4658 } 4659 if (typeof x === 'bigint') { 4660 return 'BigInt'; 4661 } 4662 return ES5Type(x); 4663 }; 4664 4665 4666 /***/ }), 4667 /* 82 */ 4668 /***/ (function(module, exports, __webpack_require__) { 4669 4670 module.exports = true ? __webpack_require__(380) : undefined; 4671 4672 4673 4674 /***/ }), 4675 /* 83 */ 4676 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4677 4678 "use strict"; 4679 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isUA; }); 4680 /* harmony import */ var _canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(89); 4681 4682 4683 4684 4685 /** 4686 * Checks if a given string exists in the user agent string. 4687 */ 4688 4689 function isUA(string) { 4690 if (!_canUseDOM_js__WEBPACK_IMPORTED_MODULE_0__[/* canUseDOM */ "a"]) return false; 4691 return window.navigator.userAgent.indexOf(string) !== -1; 4692 } 4693 4694 4695 4696 4697 /***/ }), 4698 /* 84 */ 4699 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4700 4701 "use strict"; 4702 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0); 4703 /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__); 4704 /** 4705 * WordPress dependencies 4706 */ 4707 4708 var ToolbarContext = Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["createContext"])(); 4709 /* harmony default export */ __webpack_exports__["a"] = (ToolbarContext); 4710 4711 4712 /***/ }), 4713 /* 85 */ 4714 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4715 4716 "use strict"; 4717 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return _objectWithoutPropertiesLoose; }); 4718 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return _objectSpread2; }); 4719 /* unused harmony export b */ 4720 function _defineProperty(obj, key, value) { 4721 if (key in obj) { 4722 Object.defineProperty(obj, key, { 4723 value: value, 4724 enumerable: true, 4725 configurable: true, 4726 writable: true 4727 }); 4728 } else { 4729 obj[key] = value; 4730 } 4731 4732 return obj; 4733 } 4734 4735 function ownKeys(object, enumerableOnly) { 4736 var keys = Object.keys(object); 4737 4738 if (Object.getOwnPropertySymbols) { 4739 var symbols = Object.getOwnPropertySymbols(object); 4740 if (enumerableOnly) symbols = symbols.filter(function (sym) { 4741 return Object.getOwnPropertyDescriptor(object, sym).enumerable; 4742 }); 4743 keys.push.apply(keys, symbols); 4744 } 4745 4746 return keys; 4747 } 4748 4749 function _objectSpread2(target) { 4750 for (var i = 1; i < arguments.length; i++) { 4751 var source = arguments[i] != null ? arguments[i] : {}; 4752 4753 if (i % 2) { 4754 ownKeys(Object(source), true).forEach(function (key) { 4755 _defineProperty(target, key, source[key]); 4756 }); 4757 } else if (Object.getOwnPropertyDescriptors) { 4758 Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); 4759 } else { 4760 ownKeys(Object(source)).forEach(function (key) { 4761 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); 4762 }); 4763 } 4764 } 4765 4766 return target; 4767 } 4768 4769 function _objectWithoutPropertiesLoose(source, excluded) { 4770 if (source == null) return {}; 4771 var target = {}; 4772 var sourceKeys = Object.keys(source); 4773 var key, i; 4774 4775 for (i = 0; i < sourceKeys.length; i++) { 4776 key = sourceKeys[i]; 4777 if (excluded.indexOf(key) >= 0) continue; 4778 target[key] = source[key]; 4779 } 4780 4781 return target; 4782 } 4783 4784 function _unsupportedIterableToArray(o, minLen) { 4785 if (!o) return; 4786 if (typeof o === "string") return _arrayLikeToArray(o, minLen); 4787 var n = Object.prototype.toString.call(o).slice(8, -1); 4788 if (n === "Object" && o.constructor) n = o.constructor.name; 4789 if (n === "Map" || n === "Set") return Array.from(o); 4790 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); 4791 } 4792 4793 function _arrayLikeToArray(arr, len) { 4794 if (len == null || len > arr.length) len = arr.length; 4795 4796 for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; 4797 4798 return arr2; 4799 } 4800 4801 function _createForOfIteratorHelperLoose(o, allowArrayLike) { 4802 var it; 4803 4804 if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { 4805 if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { 4806 if (it) o = it; 4807 var i = 0; 4808 return function () { 4809 if (i >= o.length) return { 4810 done: true 4811 }; 4812 return { 4813 done: false, 4814 value: o[i++] 4815 }; 4816 }; 4817 } 4818 4819 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); 4820 } 4821 4822 it = o[Symbol.iterator](); 4823 return it.next.bind(it); 4824 } 4825 4826 4827 4828 4829 /***/ }), 4830 /* 86 */, 4831 /* 87 */ 4832 /***/ (function(module, exports, __webpack_require__) { 4833 4834 "use strict"; 4835 4836 4837 var defineProperties = __webpack_require__(100); 4838 var callBind = __webpack_require__(163); 4839 4840 var implementation = __webpack_require__(245); 4841 var getPolyfill = __webpack_require__(247); 4842 var shim = __webpack_require__(377); 4843 4844 var polyfill = callBind.apply(getPolyfill()); 4845 // eslint-disable-next-line no-unused-vars 4846 var bound = function assign(target, source1) { 4847 return polyfill(Object, arguments); 4848 }; 4849 4850 defineProperties(bound, { 4851 getPolyfill: getPolyfill, 4852 implementation: implementation, 4853 shim: shim 4854 }); 4855 4856 module.exports = bound; 4857 4858 4859 /***/ }), 4860 /* 88 */ 4861 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4862 4863 "use strict"; 4864 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return unstable_IdContext; }); 4865 /* unused harmony export unstable_IdProvider */ 4866 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); 4867 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 4868 4869 4870 var defaultPrefix = "id"; 4871 function generateRandomString(prefix) { 4872 if (prefix === void 0) { 4873 prefix = defaultPrefix; 4874 } 4875 4876 return "" + (prefix ? prefix + "-" : "") + Math.random().toString(32).substr(2, 6); 4877 } 4878 4879 var unstable_IdContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])(generateRandomString); 4880 function unstable_IdProvider(_ref) { 4881 var children = _ref.children, 4882 _ref$prefix = _ref.prefix, 4883 prefix = _ref$prefix === void 0 ? defaultPrefix : _ref$prefix; 4884 var count = Object(react__WEBPACK_IMPORTED_MODULE_0__["useRef"])(0); 4885 var generateId = Object(react__WEBPACK_IMPORTED_MODULE_0__["useCallback"])(function (localPrefix) { 4886 if (localPrefix === void 0) { 4887 localPrefix = prefix; 4888 } 4889 4890 return "" + (localPrefix ? localPrefix + "-" : "") + ++count.current; 4891 }, [prefix]); 4892 return /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createElement"])(unstable_IdContext.Provider, { 4893 value: generateId 4894 }, children); 4895 } 4896 4897 4898 4899 4900 /***/ }), 4901 /* 89 */ 4902 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4903 4904 "use strict"; 4905 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return canUseDOM; }); 4906 /* harmony import */ var _getWindow_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(110); 4907 4908 4909 4910 function checkIsBrowser() { 4911 var _window = Object(_getWindow_js__WEBPACK_IMPORTED_MODULE_0__[/* getWindow */ "a"])(); 4912 4913 return Boolean(typeof _window !== "undefined" && _window.document && _window.document.createElement); 4914 } 4915 /** 4916 * It's `true` if it is running in a browser environment or `false` if it is not (SSR). 4917 * 4918 * @example 4919 * import { canUseDOM } from "reakit-utils"; 4920 * 4921 * const title = canUseDOM ? document.title : ""; 4922 */ 4923 4924 4925 var canUseDOM = checkIsBrowser(); 4926 4927 4928 4929 4930 /***/ }), 4931 /* 90 */, 4932 /* 91 */ 4933 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4934 4935 "use strict"; 4936 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasUserFocus; }); 4937 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return setUserFocus; }); 4938 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return userFocus; }); 4939 function userFocus(element) { 4940 element.userFocus = true; 4941 element.focus(); 4942 element.userFocus = false; 4943 } 4944 function hasUserFocus(element) { 4945 return !!element.userFocus; 4946 } 4947 function setUserFocus(element, value) { 4948 element.userFocus = value; 4949 } 4950 4951 4952 4953 4954 /***/ }), 4955 /* 92 */ 4956 /***/ (function(module, exports, __webpack_require__) { 4957 4958 "use strict"; 4959 4960 4961 var bind = __webpack_require__(122); 4962 4963 module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty); 4964 4965 4966 /***/ }), 4967 /* 93 */ 4968 /***/ (function(module, __webpack_exports__, __webpack_require__) { 4969 4970 "use strict"; 4971 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return hasFocusWithin; }); 4972 /* harmony import */ var _getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67); 4973 /* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(176); 4974 4975 4976 4977 4978 /** 4979 * Checks if `element` has focus within. Elements that are referenced by 4980 * `aria-activedescendant` are also considered. 4981 * 4982 * @example 4983 * import { hasFocusWithin } from "reakit-utils"; 4984 * 4985 * hasFocusWithin(document.getElementById("id")); 4986 */ 4987 4988 function hasFocusWithin(element) { 4989 var activeElement = Object(_getActiveElement_js__WEBPACK_IMPORTED_MODULE_0__[/* getActiveElement */ "a"])(element); 4990 if (!activeElement) return false; 4991 if (Object(_contains_js__WEBPACK_IMPORTED_MODULE_1__[/* contains */ "a"])(element, activeElement)) return true; 4992 var activeDescendant = activeElement.getAttribute("aria-activedescendant"); 4993 if (!activeDescendant) return false; 4994 if (activeDescendant === element.id) return true; 4995 return !!element.querySelector("#" + activeDescendant); 4996 } 4997 4998 4999 5000 5001 /***/ }), 5002 /* 94 */ 5003 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5004 5005 "use strict"; 5006 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isPortalEvent; }); 5007 /* harmony import */ var _contains_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(176); 5008 5009 5010 /** 5011 * Returns `true` if `event` has been fired within a React Portal element. 5012 */ 5013 5014 function isPortalEvent(event) { 5015 return !Object(_contains_js__WEBPACK_IMPORTED_MODULE_0__[/* contains */ "a"])(event.currentTarget, event.target); 5016 } 5017 5018 5019 5020 5021 /***/ }), 5022 /* 95 */ 5023 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5024 5025 "use strict"; 5026 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isButton; }); 5027 var buttonInputTypes = ["button", "color", "file", "image", "reset", "submit"]; 5028 /** 5029 * Checks whether `element` is a native HTML button element. 5030 * 5031 * @example 5032 * import { isButton } from "reakit-utils"; 5033 * 5034 * isButton(document.querySelector("button")); // true 5035 * isButton(document.querySelector("input[type='button']")); // true 5036 * isButton(document.querySelector("div")); // false 5037 * isButton(document.querySelector("input[type='text']")); // false 5038 * isButton(document.querySelector("div[role='button']")); // false 5039 * 5040 * @returns {boolean} 5041 */ 5042 5043 function isButton(element) { 5044 if (element.tagName === "BUTTON") return true; 5045 5046 if (element.tagName === "INPUT") { 5047 var input = element; 5048 return buttonInputTypes.indexOf(input.type) !== -1; 5049 } 5050 5051 return false; 5052 } 5053 5054 5055 5056 5057 /***/ }), 5058 /* 96 */ 5059 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5060 5061 "use strict"; 5062 /* unused harmony export Tabbable */ 5063 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useTabbable; }); 5064 /* harmony import */ var _rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(20); 5065 /* harmony import */ var reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(61); 5066 /* harmony import */ var reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(60); 5067 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14); 5068 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__); 5069 /* harmony import */ var reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(79); 5070 /* harmony import */ var reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(95); 5071 /* harmony import */ var reakit_warning__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(109); 5072 /* harmony import */ var reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(52); 5073 /* harmony import */ var reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(71); 5074 /* harmony import */ var reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(93); 5075 /* harmony import */ var reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(94); 5076 /* harmony import */ var reakit_utils_getActiveElement__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(67); 5077 /* harmony import */ var reakit_utils_dom__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(83); 5078 /* harmony import */ var reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(101); 5079 /* harmony import */ var _Role_Role_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(75); 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 // Automatically generated 5098 var TABBABLE_KEYS = ["disabled", "focusable"]; 5099 5100 var isSafariOrFirefoxOnMac = Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_12__[/* isUA */ "a"])("Mac") && !Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_12__[/* isUA */ "a"])("Chrome") && (Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_12__[/* isUA */ "a"])("Safari") || Object(reakit_utils_dom__WEBPACK_IMPORTED_MODULE_12__[/* isUA */ "a"])("Firefox")); 5101 5102 function focusIfNeeded(element) { 5103 if (!Object(reakit_utils_hasFocusWithin__WEBPACK_IMPORTED_MODULE_9__[/* hasFocusWithin */ "a"])(element)) { 5104 element.focus(); 5105 } 5106 } // Safari and Firefox on MacOS don't focus on buttons on mouse down like other 5107 // browsers/platforms. Instead, they focus on the closest focusable ancestor 5108 // element, which is ultimately the body element. So we make sure to give focus 5109 // to the tabbable element on mouse down so it works consistently across 5110 // browsers. 5111 // istanbul ignore next 5112 5113 5114 function useFocusOnMouseDown() { 5115 if (!isSafariOrFirefoxOnMac) return undefined; 5116 5117 var _React$useState = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(null), 5118 tabbable = _React$useState[0], 5119 scheduleFocus = _React$useState[1]; 5120 5121 Object(react__WEBPACK_IMPORTED_MODULE_3__["useEffect"])(function () { 5122 if (!tabbable) return; 5123 focusIfNeeded(tabbable); 5124 scheduleFocus(null); 5125 }, [tabbable]); 5126 var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 5127 var element = event.currentTarget; 5128 if (Object(reakit_utils_isPortalEvent__WEBPACK_IMPORTED_MODULE_10__[/* isPortalEvent */ "a"])(event)) return; 5129 if (!Object(reakit_utils_isButton__WEBPACK_IMPORTED_MODULE_5__[/* isButton */ "a"])(element)) return; 5130 var activeElement = Object(reakit_utils_getActiveElement__WEBPACK_IMPORTED_MODULE_11__[/* getActiveElement */ "a"])(element); 5131 if (!activeElement) return; 5132 var activeElementIsBody = activeElement.tagName === "BODY"; 5133 var focusableAncestor = Object(reakit_utils_tabbable__WEBPACK_IMPORTED_MODULE_13__[/* getClosestFocusable */ "a"])(element.parentElement); 5134 5135 if (activeElement === focusableAncestor || activeElementIsBody && !focusableAncestor) { 5136 // When the active element is the focusable ancestor, it'll not emit 5137 // focus/blur events. After all, it's already focused. So we can't 5138 // listen to those events to focus this tabbable element. 5139 // When the active element is body and there's no focusable ancestor, 5140 // we also don't have any other event to listen to since body never 5141 // emits focus/blur events on itself. 5142 // In both of these cases, we have to schedule focus on this tabbable 5143 // element. 5144 scheduleFocus(element); 5145 } else if (focusableAncestor) { 5146 // Clicking (mouse down) on the tabbable element on Safari and Firefox 5147 // on MacOS will fire focus on the focusable ancestor element if 5148 // there's any and if it's not the current active element. So we wait 5149 // for this event to happen before moving focus to this element. 5150 // Instead of moving focus right away, we have to schedule it, 5151 // otherwise it's gonna prevent drag events from happening. 5152 var onFocus = function onFocus() { 5153 return scheduleFocus(element); 5154 }; 5155 5156 focusableAncestor.addEventListener("focusin", onFocus, { 5157 once: true 5158 }); 5159 } else { 5160 // Finally, if there's no focsuable ancestor and there's another 5161 // element with focus, we wait for that element to get blurred before 5162 // focusing this one. 5163 var onBlur = function onBlur() { 5164 return focusIfNeeded(element); 5165 }; 5166 5167 activeElement.addEventListener("blur", onBlur, { 5168 once: true 5169 }); 5170 } 5171 }, []); 5172 return onMouseDown; 5173 } 5174 5175 function isNativeTabbable(element) { 5176 return element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "SELECT" || element.tagName === "TEXTAREA" || element.tagName === "A"; 5177 } 5178 5179 function supportsDisabledAttribute(element) { 5180 return element.tagName === "BUTTON" || element.tagName === "INPUT" || element.tagName === "SELECT" || element.tagName === "TEXTAREA"; 5181 } 5182 5183 function getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex) { 5184 if (trulyDisabled) { 5185 if (nativeTabbable && !supportsDisabled) { 5186 // Anchor, audio and video tags don't support the `disabled` attribute. 5187 // We must pass tabIndex={-1} so they don't receive focus on tab. 5188 return -1; 5189 } // Elements that support the `disabled` attribute don't need tabIndex. 5190 5191 5192 return undefined; 5193 } 5194 5195 if (nativeTabbable) { 5196 // If the element is enabled and it's natively tabbable, we don't need to 5197 // specify a tabIndex attribute unless it's explicitly set by the user. 5198 return htmlTabIndex; 5199 } // If the element is enabled and is not natively tabbable, we have to 5200 // fallback tabIndex={0}. 5201 5202 5203 return htmlTabIndex || 0; 5204 } 5205 5206 function useDisableEvent(htmlEventRef, disabled) { 5207 return Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 5208 var _htmlEventRef$current; 5209 5210 (_htmlEventRef$current = htmlEventRef.current) === null || _htmlEventRef$current === void 0 ? void 0 : _htmlEventRef$current.call(htmlEventRef, event); 5211 if (event.defaultPrevented) return; 5212 5213 if (disabled) { 5214 event.stopPropagation(); 5215 event.preventDefault(); 5216 } 5217 }, [htmlEventRef, disabled]); 5218 } 5219 5220 var useTabbable = Object(reakit_system_createHook__WEBPACK_IMPORTED_MODULE_2__[/* createHook */ "a"])({ 5221 name: "Tabbable", 5222 compose: _Role_Role_js__WEBPACK_IMPORTED_MODULE_14__[/* useRole */ "a"], 5223 keys: TABBABLE_KEYS, 5224 useOptions: function useOptions(options, _ref) { 5225 var disabled = _ref.disabled; 5226 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 5227 disabled: disabled 5228 }, options); 5229 }, 5230 useProps: function useProps(options, _ref2) { 5231 var htmlRef = _ref2.ref, 5232 htmlTabIndex = _ref2.tabIndex, 5233 htmlOnClickCapture = _ref2.onClickCapture, 5234 htmlOnMouseDownCapture = _ref2.onMouseDownCapture, 5235 htmlOnMouseDown = _ref2.onMouseDown, 5236 htmlOnKeyPressCapture = _ref2.onKeyPressCapture, 5237 htmlStyle = _ref2.style, 5238 htmlProps = Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* _ */ "a"])(_ref2, ["ref", "tabIndex", "onClickCapture", "onMouseDownCapture", "onMouseDown", "onKeyPressCapture", "style"]); 5239 5240 var ref = Object(react__WEBPACK_IMPORTED_MODULE_3__["useRef"])(null); 5241 var onClickCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnClickCapture); 5242 var onMouseDownCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDownCapture); 5243 var onMouseDownRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnMouseDown); 5244 var onKeyPressCaptureRef = Object(reakit_utils_useLiveRef__WEBPACK_IMPORTED_MODULE_7__[/* useLiveRef */ "a"])(htmlOnKeyPressCapture); 5245 var trulyDisabled = !!options.disabled && !options.focusable; 5246 5247 var _React$useState2 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true), 5248 nativeTabbable = _React$useState2[0], 5249 setNativeTabbable = _React$useState2[1]; 5250 5251 var _React$useState3 = Object(react__WEBPACK_IMPORTED_MODULE_3__["useState"])(true), 5252 supportsDisabled = _React$useState3[0], 5253 setSupportsDisabled = _React$useState3[1]; 5254 5255 var style = options.disabled ? Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 5256 pointerEvents: "none" 5257 }, htmlStyle) : htmlStyle; 5258 var focusOnMouseDown = useFocusOnMouseDown(); 5259 Object(reakit_utils_useIsomorphicEffect__WEBPACK_IMPORTED_MODULE_8__[/* useIsomorphicEffect */ "a"])(function () { 5260 var tabbable = ref.current; 5261 5262 if (!tabbable) { 5263 false ? undefined : void 0; 5264 return; 5265 } 5266 5267 if (!isNativeTabbable(tabbable)) { 5268 setNativeTabbable(false); 5269 } 5270 5271 if (!supportsDisabledAttribute(tabbable)) { 5272 setSupportsDisabled(false); 5273 } 5274 }, []); 5275 var onClickCapture = useDisableEvent(onClickCaptureRef, options.disabled); 5276 var onMouseDownCapture = useDisableEvent(onMouseDownCaptureRef, options.disabled); 5277 var onKeyPressCapture = useDisableEvent(onKeyPressCaptureRef, options.disabled); 5278 var onMouseDown = Object(react__WEBPACK_IMPORTED_MODULE_3__["useCallback"])(function (event) { 5279 var _onMouseDownRef$curre; 5280 5281 (_onMouseDownRef$curre = onMouseDownRef.current) === null || _onMouseDownRef$curre === void 0 ? void 0 : _onMouseDownRef$curre.call(onMouseDownRef, event); 5282 if (event.defaultPrevented) return; 5283 focusOnMouseDown === null || focusOnMouseDown === void 0 ? void 0 : focusOnMouseDown(event); 5284 }, [options.disabled, focusOnMouseDown]); 5285 return Object(_rollupPluginBabelHelpers_1f0bf8c2_js__WEBPACK_IMPORTED_MODULE_0__[/* a */ "b"])({ 5286 ref: Object(reakit_utils_useForkRef__WEBPACK_IMPORTED_MODULE_4__[/* useForkRef */ "a"])(ref, htmlRef), 5287 style: style, 5288 tabIndex: getTabIndex(trulyDisabled, nativeTabbable, supportsDisabled, htmlTabIndex), 5289 disabled: trulyDisabled && supportsDisabled ? true : undefined, 5290 "aria-disabled": options.disabled ? true : undefined, 5291 onClickCapture: onClickCapture, 5292 onMouseDownCapture: onMouseDownCapture, 5293 onMouseDown: onMouseDown, 5294 onKeyPressCapture: onKeyPressCapture 5295 }, htmlProps); 5296 } 5297 }); 5298 var Tabbable = Object(reakit_system_createComponent__WEBPACK_IMPORTED_MODULE_1__[/* createComponent */ "a"])({ 5299 as: "div", 5300 useHook: useTabbable 5301 }); 5302 5303 5304 5305 5306 /***/ }), 5307 /* 97 */ 5308 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5309 5310 "use strict"; 5311 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return COMPOSITE_KEYS; }); 5312 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return COMPOSITE_GROUP_KEYS; }); 5313 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return COMPOSITE_ITEM_KEYS; }); 5314 /* unused harmony export c */ 5315 // Automatically generated 5316 var COMPOSITE_STATE_KEYS = ["baseId", "unstable_idCountRef", "setBaseId", "unstable_virtual", "rtl", "orientation", "items", "groups", "currentId", "loop", "wrap", "shift", "unstable_moves", "unstable_hasActiveWidget", "unstable_includesBaseElement", "registerItem", "unregisterItem", "registerGroup", "unregisterGroup", "move", "next", "previous", "up", "down", "first", "last", "sort", "unstable_setVirtual", "setRTL", "setOrientation", "setCurrentId", "setLoop", "setWrap", "setShift", "reset", "unstable_setIncludesBaseElement", "unstable_setHasActiveWidget"]; 5317 var COMPOSITE_KEYS = COMPOSITE_STATE_KEYS; 5318 var COMPOSITE_GROUP_KEYS = COMPOSITE_KEYS; 5319 var COMPOSITE_ITEM_KEYS = COMPOSITE_GROUP_KEYS; 5320 var COMPOSITE_ITEM_WIDGET_KEYS = COMPOSITE_ITEM_KEYS; 5321 5322 5323 5324 5325 /***/ }), 5326 /* 98 */ 5327 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5328 5329 "use strict"; 5330 5331 // EXPORTS 5332 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ serialize_browser_esm_serializeStyles; }); 5333 5334 // CONCATENATED MODULE: ./node_modules/@emotion/hash/dist/hash.browser.esm.js 5335 /* eslint-disable */ 5336 // Inspired by https://github.com/garycourt/murmurhash-js 5337 // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86 5338 function murmur2(str) { 5339 // 'm' and 'r' are mixing constants generated offline. 5340 // They're not really 'magic', they just happen to work well. 5341 // const m = 0x5bd1e995; 5342 // const r = 24; 5343 // Initialize the hash 5344 var h = 0; // Mix 4 bytes at a time into the hash 5345 5346 var k, 5347 i = 0, 5348 len = str.length; 5349 5350 for (; len >= 4; ++i, len -= 4) { 5351 k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24; 5352 k = 5353 /* Math.imul(k, m): */ 5354 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16); 5355 k ^= 5356 /* k >>> r: */ 5357 k >>> 24; 5358 h = 5359 /* Math.imul(k, m): */ 5360 (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^ 5361 /* Math.imul(h, m): */ 5362 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 5363 } // Handle the last few bytes of the input array 5364 5365 5366 switch (len) { 5367 case 3: 5368 h ^= (str.charCodeAt(i + 2) & 0xff) << 16; 5369 5370 case 2: 5371 h ^= (str.charCodeAt(i + 1) & 0xff) << 8; 5372 5373 case 1: 5374 h ^= str.charCodeAt(i) & 0xff; 5375 h = 5376 /* Math.imul(h, m): */ 5377 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 5378 } // Do a few final mixes of the hash to ensure the last few 5379 // bytes are well-incorporated. 5380 5381 5382 h ^= h >>> 13; 5383 h = 5384 /* Math.imul(h, m): */ 5385 (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16); 5386 return ((h ^ h >>> 15) >>> 0).toString(36); 5387 } 5388 5389 /* harmony default export */ var hash_browser_esm = (murmur2); 5390 5391 // CONCATENATED MODULE: ./node_modules/@emotion/unitless/dist/unitless.browser.esm.js 5392 var unitlessKeys = { 5393 animationIterationCount: 1, 5394 borderImageOutset: 1, 5395 borderImageSlice: 1, 5396 borderImageWidth: 1, 5397 boxFlex: 1, 5398 boxFlexGroup: 1, 5399 boxOrdinalGroup: 1, 5400 columnCount: 1, 5401 columns: 1, 5402 flex: 1, 5403 flexGrow: 1, 5404 flexPositive: 1, 5405 flexShrink: 1, 5406 flexNegative: 1, 5407 flexOrder: 1, 5408 gridRow: 1, 5409 gridRowEnd: 1, 5410 gridRowSpan: 1, 5411 gridRowStart: 1, 5412 gridColumn: 1, 5413 gridColumnEnd: 1, 5414 gridColumnSpan: 1, 5415 gridColumnStart: 1, 5416 msGridRow: 1, 5417 msGridRowSpan: 1, 5418 msGridColumn: 1, 5419 msGridColumnSpan: 1, 5420 fontWeight: 1, 5421 lineHeight: 1, 5422 opacity: 1, 5423 order: 1, 5424 orphans: 1, 5425 tabSize: 1, 5426 widows: 1, 5427 zIndex: 1, 5428 zoom: 1, 5429 WebkitLineClamp: 1, 5430 // SVG-related properties 5431 fillOpacity: 1, 5432 floodOpacity: 1, 5433 stopOpacity: 1, 5434 strokeDasharray: 1, 5435 strokeDashoffset: 1, 5436 strokeMiterlimit: 1, 5437 strokeOpacity: 1, 5438 strokeWidth: 1 5439 }; 5440 5441 /* harmony default export */ var unitless_browser_esm = (unitlessKeys); 5442 5443 // EXTERNAL MODULE: ./node_modules/@emotion/memoize/dist/memoize.browser.esm.js 5444 var memoize_browser_esm = __webpack_require__(177); 5445 5446 // CONCATENATED MODULE: ./node_modules/@emotion/serialize/dist/serialize.browser.esm.js 5447 5448 5449 5450 5451 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"; 5452 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)."; 5453 var hyphenateRegex = /[A-Z]|^ms/g; 5454 var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; 5455 5456 var isCustomProperty = function isCustomProperty(property) { 5457 return property.charCodeAt(1) === 45; 5458 }; 5459 5460 var isProcessableValue = function isProcessableValue(value) { 5461 return value != null && typeof value !== 'boolean'; 5462 }; 5463 5464 var processStyleName = Object(memoize_browser_esm["a" /* default */])(function (styleName) { 5465 return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase(); 5466 }); 5467 5468 var serialize_browser_esm_processStyleValue = function processStyleValue(key, value) { 5469 switch (key) { 5470 case 'animation': 5471 case 'animationName': 5472 { 5473 if (typeof value === 'string') { 5474 return value.replace(animationRegex, function (match, p1, p2) { 5475 cursor = { 5476 name: p1, 5477 styles: p2, 5478 next: cursor 5479 }; 5480 return p1; 5481 }); 5482 } 5483 } 5484 } 5485 5486 if (unitless_browser_esm[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) { 5487 return value + 'px'; 5488 } 5489 5490 return value; 5491 }; 5492 5493 if (false) { var hyphenatedCache, hyphenPattern, msPattern, oldProcessStyleValue, contentValues, contentValuePattern; } 5494 5495 var shouldWarnAboutInterpolatingClassNameFromCss = true; 5496 5497 function handleInterpolation(mergedProps, registered, interpolation, couldBeSelectorInterpolation) { 5498 if (interpolation == null) { 5499 return ''; 5500 } 5501 5502 if (interpolation.__emotion_styles !== undefined) { 5503 if (false) {} 5504 5505 return interpolation; 5506 } 5507 5508 switch (typeof interpolation) { 5509 case 'boolean': 5510 { 5511 return ''; 5512 } 5513 5514 case 'object': 5515 { 5516 if (interpolation.anim === 1) { 5517 cursor = { 5518 name: interpolation.name, 5519 styles: interpolation.styles, 5520 next: cursor 5521 }; 5522 return interpolation.name; 5523 } 5524 5525 if (interpolation.styles !== undefined) { 5526 var next = interpolation.next; 5527 5528 if (next !== undefined) { 5529 // not the most efficient thing ever but this is a pretty rare case 5530 // and there will be very few iterations of this generally 5531 while (next !== undefined) { 5532 cursor = { 5533 name: next.name, 5534 styles: next.styles, 5535 next: cursor 5536 }; 5537 next = next.next; 5538 } 5539 } 5540 5541 var styles = interpolation.styles + ";"; 5542 5543 if (false) {} 5544 5545 return styles; 5546 } 5547 5548 return createStringFromObject(mergedProps, registered, interpolation); 5549 } 5550 5551 case 'function': 5552 { 5553 if (mergedProps !== undefined) { 5554 var previousCursor = cursor; 5555 var result = interpolation(mergedProps); 5556 cursor = previousCursor; 5557 return handleInterpolation(mergedProps, registered, result, couldBeSelectorInterpolation); 5558 } else if (false) {} 5559 5560 break; 5561 } 5562 5563 case 'string': 5564 if (false) { var replaced, matched; } 5565 5566 break; 5567 } // finalize string values (regular strings and functions interpolated into css calls) 5568 5569 5570 if (registered == null) { 5571 return interpolation; 5572 } 5573 5574 var cached = registered[interpolation]; 5575 5576 if (false) {} 5577 5578 return cached !== undefined && !couldBeSelectorInterpolation ? cached : interpolation; 5579 } 5580 5581 function createStringFromObject(mergedProps, registered, obj) { 5582 var string = ''; 5583 5584 if (Array.isArray(obj)) { 5585 for (var i = 0; i < obj.length; i++) { 5586 string += handleInterpolation(mergedProps, registered, obj[i], false); 5587 } 5588 } else { 5589 for (var _key in obj) { 5590 var value = obj[_key]; 5591 5592 if (typeof value !== 'object') { 5593 if (registered != null && registered[value] !== undefined) { 5594 string += _key + "{" + registered[value] + "}"; 5595 } else if (isProcessableValue(value)) { 5596 string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value) + ";"; 5597 } 5598 } else { 5599 if (_key === 'NO_COMPONENT_SELECTOR' && "production" !== 'production') { 5600 throw new Error('Component selectors can only be used in conjunction with babel-plugin-emotion.'); 5601 } 5602 5603 if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) { 5604 for (var _i = 0; _i < value.length; _i++) { 5605 if (isProcessableValue(value[_i])) { 5606 string += processStyleName(_key) + ":" + serialize_browser_esm_processStyleValue(_key, value[_i]) + ";"; 5607 } 5608 } 5609 } else { 5610 var interpolated = handleInterpolation(mergedProps, registered, value, false); 5611 5612 switch (_key) { 5613 case 'animation': 5614 case 'animationName': 5615 { 5616 string += processStyleName(_key) + ":" + interpolated + ";"; 5617 break; 5618 } 5619 5620 default: 5621 { 5622 if (false) {} 5623 5624 string += _key + "{" + interpolated + "}"; 5625 } 5626 } 5627 } 5628 } 5629 } 5630 } 5631 5632 return string; 5633 } 5634 5635 var labelPattern = /label:\s*([^\s;\n{]+)\s*;/g; 5636 var sourceMapPattern; 5637 5638 if (false) {} // this is the cursor for keyframes 5639 // keyframes are stored on the SerializedStyles object as a linked list 5640 5641 5642 var cursor; 5643 var serialize_browser_esm_serializeStyles = function serializeStyles(args, registered, mergedProps) { 5644 if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) { 5645 return args[0]; 5646 } 5647 5648 var stringMode = true; 5649 var styles = ''; 5650 cursor = undefined; 5651 var strings = args[0]; 5652 5653 if (strings == null || strings.raw === undefined) { 5654 stringMode = false; 5655 styles += handleInterpolation(mergedProps, registered, strings, false); 5656 } else { 5657 if (false) {} 5658 5659 styles += strings[0]; 5660 } // we start at 1 since we've already handled the first arg 5661 5662 5663 for (var i = 1; i < args.length; i++) { 5664 styles += handleInterpolation(mergedProps, registered, args[i], styles.charCodeAt(styles.length - 1) === 46); 5665 5666 if (stringMode) { 5667 if (false) {} 5668 5669 styles += strings[i]; 5670 } 5671 } 5672 5673 var sourceMap; 5674 5675 if (false) {} // using a global regex with .exec is stateful so lastIndex has to be reset each time 5676 5677 5678 labelPattern.lastIndex = 0; 5679 var identifierName = ''; 5680 var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5 5681 5682 while ((match = labelPattern.exec(styles)) !== null) { 5683 identifierName += '-' + // $FlowFixMe we know it's not null 5684 match[1]; 5685 } 5686 5687 var name = hash_browser_esm(styles) + identifierName; 5688 5689 if (false) {} 5690 5691 return { 5692 name: name, 5693 styles: styles, 5694 next: cursor 5695 }; 5696 }; 5697 5698 5699 5700 5701 /***/ }), 5702 /* 99 */ 5703 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5704 5705 "use strict"; 5706 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getRegisteredStyles; }); 5707 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return insertStyles; }); 5708 var isBrowser = "object" !== 'undefined'; 5709 function getRegisteredStyles(registered, registeredStyles, classNames) { 5710 var rawClassName = ''; 5711 classNames.split(' ').forEach(function (className) { 5712 if (registered[className] !== undefined) { 5713 registeredStyles.push(registered[className]); 5714 } else { 5715 rawClassName += className + " "; 5716 } 5717 }); 5718 return rawClassName; 5719 } 5720 var insertStyles = function insertStyles(cache, serialized, isStringTag) { 5721 var className = cache.key + "-" + serialized.name; 5722 5723 if ( // we only need to add the styles to the registered cache if the 5724 // class name could be used further down 5725 // the tree but if it's a string tag, we know it won't 5726 // so we don't have to add it to registered cache. 5727 // this improves memory usage since we can avoid storing the whole style string 5728 (isStringTag === false || // we need to always store it if we're in compat mode and 5729 // in node since emotion-server relies on whether a style is in 5730 // the registered cache to know whether a style is global or not 5731 // also, note that this check will be dead code eliminated in the browser 5732 isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) { 5733 cache.registered[className] = serialized.styles; 5734 } 5735 5736 if (cache.inserted[serialized.name] === undefined) { 5737 var current = serialized; 5738 5739 do { 5740 var maybeStyles = cache.insert("." + className, current, cache.sheet, true); 5741 5742 current = current.next; 5743 } while (current !== undefined); 5744 } 5745 }; 5746 5747 5748 5749 5750 /***/ }), 5751 /* 100 */ 5752 /***/ (function(module, exports, __webpack_require__) { 5753 5754 "use strict"; 5755 5756 5757 var keys = __webpack_require__(221); 5758 var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; 5759 5760 var toStr = Object.prototype.toString; 5761 var concat = Array.prototype.concat; 5762 var origDefineProperty = Object.defineProperty; 5763 5764 var isFunction = function (fn) { 5765 return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; 5766 }; 5767 5768 var arePropertyDescriptorsSupported = function () { 5769 var obj = {}; 5770 try { 5771 origDefineProperty(obj, 'x', { enumerable: false, value: obj }); 5772 // eslint-disable-next-line no-unused-vars, no-restricted-syntax 5773 for (var _ in obj) { // jscs:ignore disallowUnusedVariables 5774 return false; 5775 } 5776 return obj.x === obj; 5777 } catch (e) { /* this is IE 8. */ 5778 return false; 5779 } 5780 }; 5781 var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported(); 5782 5783 var defineProperty = function (object, name, value, predicate) { 5784 if (name in object && (!isFunction(predicate) || !predicate())) { 5785 return; 5786 } 5787 if (supportsDescriptors) { 5788 origDefineProperty(object, name, { 5789 configurable: true, 5790 enumerable: false, 5791 value: value, 5792 writable: true 5793 }); 5794 } else { 5795 object[name] = value; 5796 } 5797 }; 5798 5799 var defineProperties = function (object, map) { 5800 var predicates = arguments.length > 2 ? arguments[2] : {}; 5801 var props = keys(map); 5802 if (hasSymbols) { 5803 props = concat.call(props, Object.getOwnPropertySymbols(map)); 5804 } 5805 for (var i = 0; i < props.length; i += 1) { 5806 defineProperty(object, props[i], map[props[i]], predicates[props[i]]); 5807 } 5808 }; 5809 5810 defineProperties.supportsDescriptors = !!supportsDescriptors; 5811 5812 module.exports = defineProperties; 5813 5814 5815 /***/ }), 5816 /* 101 */ 5817 /***/ (function(module, __webpack_exports__, __webpack_require__) { 5818 5819 "use strict"; 5820 5821 // EXPORTS 5822 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ getClosestFocusable; }); 5823 5824 // UNUSED EXPORTS: getAllFocusableIn, getAllTabbableIn, getFirstFocusableIn, getFirstTabbableIn, getLastTabbableIn, getNextTabbableIn, getPreviousTabbableIn, isFocusable, isTabbable 5825 5826 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/matches.js 5827 /** 5828 * Ponyfill for `Element.prototype.matches` 5829 * 5830 * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/matches 5831 */ 5832 function matches(element, selectors) { 5833 if ("matches" in element) { 5834 return element.matches(selectors); 5835 } 5836 5837 if ("msMatchesSelector" in element) { 5838 return element.msMatchesSelector(selectors); 5839 } 5840 5841 return element.webkitMatchesSelector(selectors); 5842 } 5843 5844 5845 5846 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/closest.js 5847 5848 5849 /** 5850 * Ponyfill for `Element.prototype.closest` 5851 * 5852 * @example 5853 * import { closest } from "reakit-utils"; 5854 * 5855 * closest(document.getElementById("id"), "div"); 5856 * // same as 5857 * document.getElementById("id").closest("div"); 5858 */ 5859 function closest(element, selectors) { 5860 if ("closest" in element) return element.closest(selectors); 5861 5862 do { 5863 if (matches(element, selectors)) return element; 5864 element = element.parentElement || element.parentNode; 5865 } while (element !== null && element.nodeType === 1); 5866 5867 return null; 5868 } 5869 5870 5871 5872 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/getActiveElement.js 5873 var getActiveElement = __webpack_require__(67); 5874 5875 // CONCATENATED MODULE: ./node_modules/reakit-utils/es/tabbable.js 5876 5877 5878 5879 5880 5881 /** @module tabbable */ 5882 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'])"; 5883 5884 function isVisible(element) { 5885 var htmlElement = element; 5886 return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0; 5887 } 5888 5889 function hasNegativeTabIndex(element) { 5890 var tabIndex = parseInt(element.getAttribute("tabindex") || "0", 10); 5891 return tabIndex < 0; 5892 } 5893 /** 5894 * Checks whether `element` is focusable or not. 5895 * 5896 * @memberof tabbable 5897 * 5898 * @example 5899 * import { isFocusable } from "reakit-utils"; 5900 * 5901 * isFocusable(document.querySelector("input")); // true 5902 * isFocusable(document.querySelector("input[tabindex='-1']")); // true 5903 * isFocusable(document.querySelector("input[hidden]")); // false 5904 * isFocusable(document.querySelector("input:disabled")); // false 5905 */ 5906 5907 5908 function isFocusable(element) { 5909 return matches(element, selector) && isVisible(element); 5910 } 5911 /** 5912 * Checks whether `element` is tabbable or not. 5913 * 5914 * @memberof tabbable 5915 * 5916 * @example 5917 * import { isTabbable } from "reakit-utils"; 5918 * 5919 * isTabbable(document.querySelector("input")); // true 5920 * isTabbable(document.querySelector("input[tabindex='-1']")); // false 5921 * isTabbable(document.querySelector("input[hidden]")); // false 5922 * isTabbable(document.querySelector("input:disabled")); // false 5923 */ 5924 5925 function isTabbable(element) { 5926 return isFocusable(element) && !hasNegativeTabIndex(element); 5927 } 5928 /** 5929 * Returns all the focusable elements in `container`. 5930 * 5931 * @memberof tabbable 5932 * 5933 * @param {Element} container 5934 * 5935 * @returns {Element[]} 5936 */ 5937 5938 function getAllFocusableIn(container) { 5939 var allFocusable = Array.from(container.querySelectorAll(selector)); 5940 allFocusable.unshift(container); 5941 return allFocusable.filter(isFocusable); 5942 } 5943 /** 5944 * Returns the first focusable element in `container`. 5945 * 5946 * @memberof tabbable 5947 * 5948 * @param {Element} container 5949 * 5950 * @returns {Element|null} 5951 */ 5952 5953 function getFirstFocusableIn(container) { 5954 var _getAllFocusableIn = getAllFocusableIn(container), 5955 first = _getAllFocusableIn[0]; 5956 5957 return first || null; 5958 } 5959 /** 5960 * Returns all the tabbable elements in `container`, including the container 5961 * itself. 5962 * 5963 * @memberof tabbable 5964 * 5965 * @param {Element} container 5966 * @param fallbackToFocusable If `true`, it'll return focusable elements if there are no tabbable ones. 5967 * 5968 * @returns {Element[]} 5969 */ 5970 5971 function getAllTabbableIn(container, fallbackToFocusable) { 5972 var allFocusable = Array.from(container.querySelectorAll(selector)); 5973 var allTabbable = allFocusable.filter(isTabbable); 5974 5975 if (isTabbable(container)) { 5976 allTabbable.unshift(container); 5977 } 5978 5979 if (!allTabbable.length && fallbackToFocusable) { 5980 return allFocusable; 5981 } 5982 5983 return allTabbable; 5984 } 5985 /** 5986 * Returns the first tabbable element in `container`, including the container 5987 * itself if it's tabbable. 5988 * 5989 * @memberof tabbable 5990 * 5991 * @param {Element} container 5992 * @param fallbackToFocusable If `true`, it'll return the first focusable element if there are no tabbable ones. 5993 * 5994 * @returns {Element|null} 5995 */ 5996 5997 function getFirstTabbableIn(container, fallbackToFocusable) { 5998 var _getAllTabbableIn = getAllTabbableIn(container, fallbackToFocusable), 5999 first = _getAllTabbableIn[0]; 6000 6001 return first || null; 6002 } 6003 /** 6004 * Returns the last tabbable element in `container`, including the container 6005 * itself if it's tabbable. 6006 * 6007 * @memberof tabbable 6008 * 6009 * @param {Element} container 6010 * @param fallbackToFocusable If `true`, it'll return the last focusable element if there are no tabbable ones. 6011 * 6012 * @returns {Element|null} 6013 */ 6014 6015 function getLastTabbableIn(container, fallbackToFocusable) { 6016 var allTabbable = getAllTabbableIn(container, fallbackToFocusable); 6017 return allTabbable[allTabbable.length - 1] || null; 6018 } 6019 /** 6020 * Returns the next tabbable element in `container`. 6021 * 6022 * @memberof tabbable 6023 * 6024 * @param {Element} container 6025 * @param fallbackToFocusable If `true`, it'll return the next focusable element if there are no tabbable ones. 6026 * 6027 * @returns {Element|null} 6028 */ 6029 6030 function getNextTabbableIn(container, fallbackToFocusable) { 6031 var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container); 6032 var allFocusable = getAllFocusableIn(container); 6033 var index = allFocusable.indexOf(activeElement); 6034 var slice = allFocusable.slice(index + 1); 6035 return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); 6036 } 6037 /** 6038 * Returns the previous tabbable element in `container`. 6039 * 6040 * @memberof tabbable 6041 * 6042 * @param {Element} container 6043 * @param fallbackToFocusable If `true`, it'll return the previous focusable element if there are no tabbable ones. 6044 * 6045 * @returns {Element|null} 6046 */ 6047 6048 function getPreviousTabbableIn(container, fallbackToFocusable) { 6049 var activeElement = Object(getActiveElement["a" /* getActiveElement */])(container); 6050 var allFocusable = getAllFocusableIn(container).reverse(); 6051 var index = allFocusable.indexOf(activeElement); 6052 var slice = allFocusable.slice(index + 1); 6053 return slice.find(isTabbable) || allFocusable.find(isTabbable) || (fallbackToFocusable ? slice[0] : null); 6054 } 6055 /** 6056 * Returns the closest focusable element. 6057 * 6058 * @memberof tabbable 6059 * 6060 * @param {Element} container 6061 * 6062 * @returns {Element|null} 6063 */ 6064 6065 function getClosestFocusable(element) { 6066 while (element && !isFocusable(element)) { 6067 element = closest(element, selector); 6068 } 6069 6070 return element; 6071 } 6072 6073 6074 6075 6076 /***/ }), 6077 /* 102 */ 6078 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6079 6080 "use strict"; 6081 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return getAnimateClassName; }); 6082 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Animate; }); 6083 /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5); 6084 /* harmony import */ var _babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12); 6085 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(10); 6086 /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); 6087 6088 6089 6090 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; } 6091 6092 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; } 6093 6094 /** 6095 * External dependencies 6096 */ 6097 6098 /** 6099 * @typedef {'top' | 'top left' | 'top right' | 'middle' | 'middle left' | 'middle right' | 'bottom' | 'bottom left' | 'bottom right'} AppearOrigin 6100 * @typedef {'left' | 'right'} SlideInOrigin 6101 * @typedef {{ type: 'appear'; origin?: AppearOrigin }} AppearOptions 6102 * @typedef {{ type: 'slide-in'; origin?: SlideInOrigin }} SlideInOptions 6103 * @typedef {{ type: 'loading'; }} LoadingOptions 6104 * @typedef {AppearOptions | SlideInOptions | LoadingOptions} GetAnimateOptions 6105 */ 6106 6107 /* eslint-disable jsdoc/valid-types */ 6108 6109 /** 6110 * @param {GetAnimateOptions['type']} type The animation type 6111 * @return {'top' | 'left'} Default origin 6112 */ 6113 6114 function getDefaultOrigin(type) { 6115 return type === 'appear' ? 'top' : 'left'; 6116 } 6117 /* eslint-enable jsdoc/valid-types */ 6118 6119 /** 6120 * @param {GetAnimateOptions} options 6121 * 6122 * @return {string | void} ClassName that applies the animations 6123 */ 6124 6125 6126 function getAnimateClassName(options) { 6127 if (options.type === 'loading') { 6128 return classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__loading'); 6129 } 6130 6131 var type = options.type, 6132 _options$origin = options.origin, 6133 origin = _options$origin === void 0 ? getDefaultOrigin(type) : _options$origin; 6134 6135 if (type === 'appear') { 6136 var _classnames; 6137 6138 var _origin$split = origin.split(' '), 6139 _origin$split2 = Object(_babel_runtime_helpers_esm_slicedToArray__WEBPACK_IMPORTED_MODULE_1__[/* default */ "a"])(_origin$split, 2), 6140 yAxis = _origin$split2[0], 6141 _origin$split2$ = _origin$split2[1], 6142 xAxis = _origin$split2$ === void 0 ? 'center' : _origin$split2$; 6143 6144 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)); 6145 } 6146 6147 if (type === 'slide-in') { 6148 return classnames__WEBPACK_IMPORTED_MODULE_2___default()('components-animate__slide-in', 'is-from-' + origin); 6149 } 6150 } // @ts-ignore Reason: Planned for deprecation 6151 6152 function Animate(_ref) { 6153 var type = _ref.type, 6154 _ref$options = _ref.options, 6155 options = _ref$options === void 0 ? {} : _ref$options, 6156 children = _ref.children; 6157 return children({ 6158 className: getAnimateClassName(_objectSpread({ 6159 type: type 6160 }, options)) 6161 }); 6162 } 6163 6164 6165 /***/ }), 6166 /* 103 */ 6167 /***/ (function(module, exports) { 6168 6169 (function() { module.exports = window["wp"]["warning"]; }()); 6170 6171 /***/ }), 6172 /* 104 */, 6173 /* 105 */, 6174 /* 106 */ 6175 /***/ (function(module, exports, __webpack_require__) { 6176 6177 "use strict"; 6178 6179 6180 Object.defineProperty(exports, "__esModule", { 6181 value: true 6182 }); 6183 var calendarLabel = 'Calendar'; 6184 var closeDatePicker = 'Close'; 6185 var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.'; 6186 var clearDate = 'Clear Date'; 6187 var clearDates = 'Clear Dates'; 6188 var jumpToPrevMonth = 'Move backward to switch to the previous month.'; 6189 var jumpToNextMonth = 'Move forward to switch to the next month.'; 6190 var keyboardShortcuts = 'Keyboard Shortcuts'; 6191 var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.'; 6192 var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.'; 6193 var openThisPanel = 'Open this panel.'; 6194 var enterKey = 'Enter key'; 6195 var leftArrowRightArrow = 'Right and left arrow keys'; 6196 var upArrowDownArrow = 'up and down arrow keys'; 6197 var pageUpPageDown = 'page up and page down keys'; 6198 var homeEnd = 'Home and end keys'; 6199 var escape = 'Escape key'; 6200 var questionMark = 'Question mark'; 6201 var selectFocusedDate = 'Select the date in focus.'; 6202 var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.'; 6203 var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.'; 6204 var moveFocusByOneMonth = 'Switch months.'; 6205 var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.'; 6206 var returnFocusToInput = 'Return to the date input field.'; 6207 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.'; 6208 6209 var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) { 6210 var date = _ref.date; 6211 return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.'; 6212 }; 6213 var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) { 6214 var date = _ref2.date; 6215 return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.'; 6216 }; 6217 var chooseAvailableDate = function chooseAvailableDate(_ref3) { 6218 var date = _ref3.date; 6219 return date; 6220 }; 6221 var dateIsUnavailable = function dateIsUnavailable(_ref4) { 6222 var date = _ref4.date; 6223 return 'Not available. ' + String(date); 6224 }; 6225 var dateIsSelected = function dateIsSelected(_ref5) { 6226 var date = _ref5.date; 6227 return 'Selected. ' + String(date); 6228 }; 6229 6230 exports['default'] = { 6231 calendarLabel: calendarLabel, 6232 closeDatePicker: closeDatePicker, 6233 focusStartDate: focusStartDate, 6234 clearDate: clearDate, 6235 clearDates: clearDates, 6236 jumpToPrevMonth: jumpToPrevMonth, 6237 jumpToNextMonth: jumpToNextMonth, 6238 keyboardShortcuts: keyboardShortcuts, 6239 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 6240 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 6241 openThisPanel: openThisPanel, 6242 enterKey: enterKey, 6243 leftArrowRightArrow: leftArrowRightArrow, 6244 upArrowDownArrow: upArrowDownArrow, 6245 pageUpPageDown: pageUpPageDown, 6246 homeEnd: homeEnd, 6247 escape: escape, 6248 questionMark: questionMark, 6249 selectFocusedDate: selectFocusedDate, 6250 moveFocusByOneDay: moveFocusByOneDay, 6251 moveFocusByOneWeek: moveFocusByOneWeek, 6252 moveFocusByOneMonth: moveFocusByOneMonth, 6253 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 6254 returnFocusToInput: returnFocusToInput, 6255 keyboardNavigationInstructions: keyboardNavigationInstructions, 6256 6257 chooseAvailableStartDate: chooseAvailableStartDate, 6258 chooseAvailableEndDate: chooseAvailableEndDate, 6259 dateIsUnavailable: dateIsUnavailable, 6260 dateIsSelected: dateIsSelected 6261 }; 6262 var DateRangePickerPhrases = exports.DateRangePickerPhrases = { 6263 calendarLabel: calendarLabel, 6264 closeDatePicker: closeDatePicker, 6265 clearDates: clearDates, 6266 focusStartDate: focusStartDate, 6267 jumpToPrevMonth: jumpToPrevMonth, 6268 jumpToNextMonth: jumpToNextMonth, 6269 keyboardShortcuts: keyboardShortcuts, 6270 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 6271 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 6272 openThisPanel: openThisPanel, 6273 enterKey: enterKey, 6274 leftArrowRightArrow: leftArrowRightArrow, 6275 upArrowDownArrow: upArrowDownArrow, 6276 pageUpPageDown: pageUpPageDown, 6277 homeEnd: homeEnd, 6278 escape: escape, 6279 questionMark: questionMark, 6280 selectFocusedDate: selectFocusedDate, 6281 moveFocusByOneDay: moveFocusByOneDay, 6282 moveFocusByOneWeek: moveFocusByOneWeek, 6283 moveFocusByOneMonth: moveFocusByOneMonth, 6284 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 6285 returnFocusToInput: returnFocusToInput, 6286 keyboardNavigationInstructions: keyboardNavigationInstructions, 6287 chooseAvailableStartDate: chooseAvailableStartDate, 6288 chooseAvailableEndDate: chooseAvailableEndDate, 6289 dateIsUnavailable: dateIsUnavailable, 6290 dateIsSelected: dateIsSelected 6291 }; 6292 6293 var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = { 6294 focusStartDate: focusStartDate, 6295 clearDates: clearDates, 6296 keyboardNavigationInstructions: keyboardNavigationInstructions 6297 }; 6298 6299 var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = { 6300 calendarLabel: calendarLabel, 6301 closeDatePicker: closeDatePicker, 6302 clearDate: clearDate, 6303 jumpToPrevMonth: jumpToPrevMonth, 6304 jumpToNextMonth: jumpToNextMonth, 6305 keyboardShortcuts: keyboardShortcuts, 6306 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 6307 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 6308 openThisPanel: openThisPanel, 6309 enterKey: enterKey, 6310 leftArrowRightArrow: leftArrowRightArrow, 6311 upArrowDownArrow: upArrowDownArrow, 6312 pageUpPageDown: pageUpPageDown, 6313 homeEnd: homeEnd, 6314 escape: escape, 6315 questionMark: questionMark, 6316 selectFocusedDate: selectFocusedDate, 6317 moveFocusByOneDay: moveFocusByOneDay, 6318 moveFocusByOneWeek: moveFocusByOneWeek, 6319 moveFocusByOneMonth: moveFocusByOneMonth, 6320 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 6321 returnFocusToInput: returnFocusToInput, 6322 keyboardNavigationInstructions: keyboardNavigationInstructions, 6323 chooseAvailableDate: chooseAvailableDate, 6324 dateIsUnavailable: dateIsUnavailable, 6325 dateIsSelected: dateIsSelected 6326 }; 6327 6328 var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = { 6329 clearDate: clearDate, 6330 keyboardNavigationInstructions: keyboardNavigationInstructions 6331 }; 6332 6333 var DayPickerPhrases = exports.DayPickerPhrases = { 6334 calendarLabel: calendarLabel, 6335 jumpToPrevMonth: jumpToPrevMonth, 6336 jumpToNextMonth: jumpToNextMonth, 6337 keyboardShortcuts: keyboardShortcuts, 6338 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 6339 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 6340 openThisPanel: openThisPanel, 6341 enterKey: enterKey, 6342 leftArrowRightArrow: leftArrowRightArrow, 6343 upArrowDownArrow: upArrowDownArrow, 6344 pageUpPageDown: pageUpPageDown, 6345 homeEnd: homeEnd, 6346 escape: escape, 6347 questionMark: questionMark, 6348 selectFocusedDate: selectFocusedDate, 6349 moveFocusByOneDay: moveFocusByOneDay, 6350 moveFocusByOneWeek: moveFocusByOneWeek, 6351 moveFocusByOneMonth: moveFocusByOneMonth, 6352 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 6353 returnFocusToInput: returnFocusToInput, 6354 chooseAvailableStartDate: chooseAvailableStartDate, 6355 chooseAvailableEndDate: chooseAvailableEndDate, 6356 chooseAvailableDate: chooseAvailableDate, 6357 dateIsUnavailable: dateIsUnavailable, 6358 dateIsSelected: dateIsSelected 6359 }; 6360 6361 var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = { 6362 keyboardShortcuts: keyboardShortcuts, 6363 showKeyboardShortcutsPanel: showKeyboardShortcutsPanel, 6364 hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel, 6365 openThisPanel: openThisPanel, 6366 enterKey: enterKey, 6367 leftArrowRightArrow: leftArrowRightArrow, 6368 upArrowDownArrow: upArrowDownArrow, 6369 pageUpPageDown: pageUpPageDown, 6370 homeEnd: homeEnd, 6371 escape: escape, 6372 questionMark: questionMark, 6373 selectFocusedDate: selectFocusedDate, 6374 moveFocusByOneDay: moveFocusByOneDay, 6375 moveFocusByOneWeek: moveFocusByOneWeek, 6376 moveFocusByOneMonth: moveFocusByOneMonth, 6377 moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek, 6378 returnFocusToInput: returnFocusToInput 6379 }; 6380 6381 var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = { 6382 jumpToPrevMonth: jumpToPrevMonth, 6383 jumpToNextMonth: jumpToNextMonth 6384 }; 6385 6386 var CalendarDayPhrases = exports.CalendarDayPhrases = { 6387 chooseAvailableDate: chooseAvailableDate, 6388 dateIsUnavailable: dateIsUnavailable, 6389 dateIsSelected: dateIsSelected 6390 }; 6391 6392 /***/ }), 6393 /* 107 */ 6394 /***/ (function(module, exports, __webpack_require__) { 6395 6396 "use strict"; 6397 6398 6399 Object.defineProperty(exports, "__esModule", { 6400 value: true 6401 }); 6402 exports['default'] = getPhrasePropTypes; 6403 6404 var _object = __webpack_require__(87); 6405 6406 var _object2 = _interopRequireDefault(_object); 6407 6408 var _propTypes = __webpack_require__(31); 6409 6410 var _propTypes2 = _interopRequireDefault(_propTypes); 6411 6412 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6413 6414 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; } 6415 6416 function getPhrasePropTypes(defaultPhrases) { 6417 return Object.keys(defaultPhrases).reduce(function (phrases, key) { 6418 return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node]))); 6419 }, {}); 6420 } 6421 6422 /***/ }), 6423 /* 108 */ 6424 /***/ (function(module, exports, __webpack_require__) { 6425 6426 "use strict"; 6427 6428 6429 Object.defineProperty(exports, "__esModule", { 6430 value: true 6431 }); 6432 exports.withStylesPropTypes = exports.css = undefined; 6433 6434 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; }; 6435 6436 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; }; }(); 6437 6438 exports.withStyles = withStyles; 6439 6440 var _object = __webpack_require__(87); 6441 6442 var _object2 = _interopRequireDefault(_object); 6443 6444 var _react = __webpack_require__(14); 6445 6446 var _react2 = _interopRequireDefault(_react); 6447 6448 var _propTypes = __webpack_require__(31); 6449 6450 var _propTypes2 = _interopRequireDefault(_propTypes); 6451 6452 var _hoistNonReactStatics = __webpack_require__(387); 6453 6454 var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics); 6455 6456 var _constants = __webpack_require__(390); 6457 6458 var _brcast = __webpack_require__(391); 6459 6460 var _brcast2 = _interopRequireDefault(_brcast); 6461 6462 var _ThemedStyleSheet = __webpack_require__(243); 6463 6464 var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet); 6465 6466 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } 6467 6468 function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 6469 6470 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; } 6471 6472 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; } 6473 6474 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 */ 6475 6476 // Add some named exports to assist in upgrading and for convenience 6477 var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR; 6478 var withStylesPropTypes = exports.withStylesPropTypes = { 6479 styles: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types 6480 theme: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types 6481 css: _propTypes2['default'].func.isRequired 6482 }; 6483 6484 var EMPTY_STYLES = {}; 6485 var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() { 6486 return EMPTY_STYLES; 6487 }; 6488 6489 var START_MARK = 'react-with-styles.createStyles.start'; 6490 var END_MARK = 'react-with-styles.createStyles.end'; 6491 6492 function baseClass(pureComponent) { 6493 if (pureComponent) { 6494 if (!_react2['default'].PureComponent) { 6495 throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later'); 6496 } 6497 6498 return _react2['default'].PureComponent; 6499 } 6500 6501 return _react2['default'].Component; 6502 } 6503 6504 var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']); 6505 6506 var defaultDirection = _constants.DIRECTIONS.LTR; 6507 6508 function withStyles(styleFn) { 6509 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 6510 _ref$stylesPropName = _ref.stylesPropName, 6511 stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName, 6512 _ref$themePropName = _ref.themePropName, 6513 themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName, 6514 _ref$cssPropName = _ref.cssPropName, 6515 cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName, 6516 _ref$flushBefore = _ref.flushBefore, 6517 flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore, 6518 _ref$pureComponent = _ref.pureComponent, 6519 pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent; 6520 6521 var styleDefLTR = void 0; 6522 var styleDefRTL = void 0; 6523 var currentThemeLTR = void 0; 6524 var currentThemeRTL = void 0; 6525 var BaseClass = baseClass(pureComponent); 6526 6527 function getResolveMethod(direction) { 6528 return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL; 6529 } 6530 6531 function getCurrentTheme(direction) { 6532 return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL; 6533 } 6534 6535 function getStyleDef(direction, wrappedComponentName) { 6536 var currentTheme = getCurrentTheme(direction); 6537 var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL; 6538 6539 var registeredTheme = _ThemedStyleSheet2['default'].get(); 6540 6541 // Return the existing styles if they've already been defined 6542 // and if the theme used to create them corresponds to the theme 6543 // registered with ThemedStyleSheet 6544 if (styleDef && currentTheme === registeredTheme) { 6545 return styleDef; 6546 } 6547 6548 if (false) {} 6549 6550 var isRTL = direction === _constants.DIRECTIONS.RTL; 6551 6552 if (isRTL) { 6553 styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN; 6554 6555 currentThemeRTL = registeredTheme; 6556 styleDef = styleDefRTL; 6557 } else { 6558 styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN; 6559 6560 currentThemeLTR = registeredTheme; 6561 styleDef = styleDefLTR; 6562 } 6563 6564 if (false) { var measureName; } 6565 6566 return styleDef; 6567 } 6568 6569 function getState(direction, wrappedComponentName) { 6570 return { 6571 resolveMethod: getResolveMethod(direction), 6572 styleDef: getStyleDef(direction, wrappedComponentName) 6573 }; 6574 } 6575 6576 return function () { 6577 function withStylesHOC(WrappedComponent) { 6578 var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component'; 6579 6580 // NOTE: Use a class here so components are ref-able if need be: 6581 // eslint-disable-next-line react/prefer-stateless-function 6582 6583 var WithStyles = function (_BaseClass) { 6584 _inherits(WithStyles, _BaseClass); 6585 6586 function WithStyles(props, context) { 6587 _classCallCheck(this, WithStyles); 6588 6589 var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context)); 6590 6591 var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection; 6592 6593 _this.state = getState(direction, wrappedComponentName); 6594 return _this; 6595 } 6596 6597 _createClass(WithStyles, [{ 6598 key: 'componentDidMount', 6599 value: function () { 6600 function componentDidMount() { 6601 var _this2 = this; 6602 6603 if (this.context[_constants.CHANNEL]) { 6604 // subscribe to future direction changes 6605 this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) { 6606 _this2.setState(getState(direction, wrappedComponentName)); 6607 }); 6608 } 6609 } 6610 6611 return componentDidMount; 6612 }() 6613 }, { 6614 key: 'componentWillUnmount', 6615 value: function () { 6616 function componentWillUnmount() { 6617 if (this.channelUnsubscribe) { 6618 this.channelUnsubscribe(); 6619 } 6620 } 6621 6622 return componentWillUnmount; 6623 }() 6624 }, { 6625 key: 'render', 6626 value: function () { 6627 function render() { 6628 var _ref2; 6629 6630 // As some components will depend on previous styles in 6631 // the component tree, we provide the option of flushing the 6632 // buffered styles (i.e. to a style tag) **before** the rendering 6633 // cycle begins. 6634 // 6635 // The interfaces provide the optional "flush" method which 6636 // is run in turn by ThemedStyleSheet.flush. 6637 if (flushBefore) { 6638 _ThemedStyleSheet2['default'].flush(); 6639 } 6640 6641 var _state = this.state, 6642 resolveMethod = _state.resolveMethod, 6643 styleDef = _state.styleDef; 6644 6645 6646 return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2))); 6647 } 6648 6649 return render; 6650 }() 6651 }]); 6652 6653 return WithStyles; 6654 }(BaseClass); 6655 6656 WithStyles.WrappedComponent = WrappedComponent; 6657 WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')'; 6658 WithStyles.contextTypes = contextTypes; 6659 if (WrappedComponent.propTypes) { 6660 WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes); 6661 delete WithStyles.propTypes[stylesPropName]; 6662 delete WithStyles.propTypes[themePropName]; 6663 delete WithStyles.propTypes[cssPropName]; 6664 } 6665 if (WrappedComponent.defaultProps) { 6666 WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps); 6667 } 6668 6669 return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent); 6670 } 6671 6672 return withStylesHOC; 6673 }(); 6674 } 6675 6676 /***/ }), 6677 /* 109 */ 6678 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6679 6680 "use strict"; 6681 6682 // UNUSED EXPORTS: warning, useWarning 6683 6684 // EXTERNAL MODULE: ./node_modules/reakit-warning/es/warning.js 6685 var warning = __webpack_require__(162); 6686 6687 // EXTERNAL MODULE: external "React" 6688 var external_React_ = __webpack_require__(14); 6689 6690 // EXTERNAL MODULE: ./node_modules/reakit-utils/es/isObject.js 6691 var isObject = __webpack_require__(123); 6692 6693 // CONCATENATED MODULE: ./node_modules/reakit-warning/es/useWarning.js 6694 6695 6696 6697 6698 6699 function isRefObject(ref) { 6700 return Object(isObject["a" /* isObject */])(ref) && "current" in ref; 6701 } 6702 /** 6703 * Logs `messages` to the console using `console.warn` based on a `condition`. 6704 * This should be used inside components. 6705 */ 6706 6707 6708 function useWarning(condition) { 6709 for (var _len = arguments.length, messages = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { 6710 messages[_key - 1] = arguments[_key]; 6711 } 6712 6713 if (false) {} 6714 } 6715 6716 6717 6718 // CONCATENATED MODULE: ./node_modules/reakit-warning/es/index.js 6719 6720 6721 6722 6723 6724 6725 6726 /***/ }), 6727 /* 110 */ 6728 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6729 6730 "use strict"; 6731 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return getWindow; }); 6732 /* harmony import */ var _getDocument_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(54); 6733 6734 6735 // Thanks to Fluent UI for doing the [research on IE11 memery leak](https://github.com/microsoft/fluentui/pull/9010#issuecomment-490768427) 6736 6737 var _window; // Note: Accessing "window" in IE11 is somewhat expensive, and calling "typeof window" 6738 // hits a memory leak, whereas aliasing it and calling "typeof _window" does not. 6739 // Caching the window value at the file scope lets us minimize the impact. 6740 6741 6742 try { 6743 _window = window; 6744 } catch (e) { 6745 /* no-op */ 6746 } 6747 /** 6748 * Returns `element.ownerDocument.defaultView || window`. 6749 */ 6750 6751 6752 function getWindow(element) { 6753 if (!element) { 6754 return _window; 6755 } 6756 6757 return Object(_getDocument_js__WEBPACK_IMPORTED_MODULE_0__[/* getDocument */ "a"])(element).defaultView || _window; 6758 } 6759 6760 6761 6762 6763 /***/ }), 6764 /* 111 */ 6765 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6766 6767 "use strict"; 6768 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SystemContext; }); 6769 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); 6770 /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); 6771 6772 6773 var SystemContext = /*#__PURE__*/Object(react__WEBPACK_IMPORTED_MODULE_0__["createContext"])({}); 6774 6775 6776 6777 6778 /***/ }), 6779 /* 112 */ 6780 /***/ (function(module, __webpack_exports__, __webpack_require__) { 6781 6782 "use strict"; 6783 6784 // EXPORTS 6785 __webpack_require__.d(__webpack_exports__, "a", function() { return /* binding */ slot_fill_Fill; }); 6786 __webpack_require__.d(__webpack_exports__, "c", function() { return /* binding */ slot_fill_Slot; }); 6787 __webpack_require__.d(__webpack_exports__, "b", function() { return /* binding */ Provider; }); 6788 __webpack_require__.d(__webpack_exports__, "d", function() { return /* binding */ createSlotFill; }); 6789 6790 // UNUSED EXPORTS: useSlot 6791 6792 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 6793 var esm_extends = __webpack_require__(8); 6794 6795 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 6796 var objectWithoutProperties = __webpack_require__(13); 6797 6798 // EXTERNAL MODULE: external ["wp","element"] 6799 var external_wp_element_ = __webpack_require__(0); 6800 6801 // EXTERNAL MODULE: external "lodash" 6802 var external_lodash_ = __webpack_require__(2); 6803 6804 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/context.js 6805 /** 6806 * WordPress dependencies 6807 */ 6808 6809 var SlotFillContext = Object(external_wp_element_["createContext"])({ 6810 registerSlot: function registerSlot() {}, 6811 unregisterSlot: function unregisterSlot() {}, 6812 registerFill: function registerFill() {}, 6813 unregisterFill: function unregisterFill() {}, 6814 getSlot: function getSlot() {}, 6815 getFills: function getFills() {}, 6816 subscribe: function subscribe() {} 6817 }); 6818 /* harmony default export */ var context = (SlotFillContext); 6819 6820 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules 6821 var slicedToArray = __webpack_require__(12); 6822 6823 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/use-slot.js 6824 6825 6826 /** 6827 * WordPress dependencies 6828 */ 6829 6830 /** 6831 * Internal dependencies 6832 */ 6833 6834 6835 /** 6836 * React hook returning the active slot given a name. 6837 * 6838 * @param {string} name Slot name. 6839 * @return {Object} Slot object. 6840 */ 6841 6842 var use_slot_useSlot = function useSlot(name) { 6843 var _useContext = Object(external_wp_element_["useContext"])(context), 6844 getSlot = _useContext.getSlot, 6845 subscribe = _useContext.subscribe; 6846 6847 var _useState = Object(external_wp_element_["useState"])(getSlot(name)), 6848 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 6849 slot = _useState2[0], 6850 setSlot = _useState2[1]; 6851 6852 Object(external_wp_element_["useEffect"])(function () { 6853 setSlot(getSlot(name)); 6854 var unsubscribe = subscribe(function () { 6855 setSlot(getSlot(name)); 6856 }); 6857 return unsubscribe; 6858 }, [name]); 6859 return slot; 6860 }; 6861 6862 /* harmony default export */ var use_slot = (use_slot_useSlot); 6863 6864 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/fill.js 6865 6866 6867 6868 /** 6869 * External dependencies 6870 */ 6871 6872 /** 6873 * WordPress dependencies 6874 */ 6875 6876 6877 /** 6878 * Internal dependencies 6879 */ 6880 6881 6882 6883 6884 function fill_FillComponent(_ref) { 6885 var name = _ref.name, 6886 children = _ref.children, 6887 registerFill = _ref.registerFill, 6888 unregisterFill = _ref.unregisterFill; 6889 var slot = use_slot(name); 6890 var ref = Object(external_wp_element_["useRef"])({ 6891 name: name, 6892 children: children 6893 }); 6894 Object(external_wp_element_["useLayoutEffect"])(function () { 6895 registerFill(name, ref.current); 6896 return function () { 6897 return unregisterFill(name, ref.current); 6898 }; 6899 }, []); 6900 Object(external_wp_element_["useLayoutEffect"])(function () { 6901 ref.current.children = children; 6902 6903 if (slot) { 6904 slot.forceUpdate(); 6905 } 6906 }, [children]); 6907 Object(external_wp_element_["useLayoutEffect"])(function () { 6908 if (name === ref.current.name) { 6909 // ignore initial effect 6910 return; 6911 } 6912 6913 unregisterFill(ref.current.name, ref.current); 6914 ref.current.name = name; 6915 registerFill(name, ref.current); 6916 }, [name]); 6917 6918 if (!slot || !slot.node) { 6919 return null; 6920 } // If a function is passed as a child, provide it with the fillProps. 6921 6922 6923 if (Object(external_lodash_["isFunction"])(children)) { 6924 children = children(slot.props.fillProps); 6925 } 6926 6927 return Object(external_wp_element_["createPortal"])(children, slot.node); 6928 } 6929 6930 var fill_Fill = function Fill(props) { 6931 return Object(external_wp_element_["createElement"])(context.Consumer, null, function (_ref2) { 6932 var registerFill = _ref2.registerFill, 6933 unregisterFill = _ref2.unregisterFill; 6934 return Object(external_wp_element_["createElement"])(fill_FillComponent, Object(esm_extends["a" /* default */])({}, props, { 6935 registerFill: registerFill, 6936 unregisterFill: unregisterFill 6937 })); 6938 }); 6939 }; 6940 6941 /* harmony default export */ var slot_fill_fill = (fill_Fill); 6942 6943 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js 6944 var classCallCheck = __webpack_require__(25); 6945 6946 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js 6947 var createClass = __webpack_require__(26); 6948 6949 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js 6950 var assertThisInitialized = __webpack_require__(18); 6951 6952 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js 6953 var getPrototypeOf = __webpack_require__(22); 6954 6955 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/superPropBase.js 6956 6957 function _superPropBase(object, property) { 6958 while (!Object.prototype.hasOwnProperty.call(object, property)) { 6959 object = Object(getPrototypeOf["a" /* default */])(object); 6960 if (object === null) break; 6961 } 6962 6963 return object; 6964 } 6965 // CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/get.js 6966 6967 function get_get(target, property, receiver) { 6968 if (typeof Reflect !== "undefined" && Reflect.get) { 6969 get_get = Reflect.get; 6970 } else { 6971 get_get = function _get(target, property, receiver) { 6972 var base = _superPropBase(target, property); 6973 if (!base) return; 6974 var desc = Object.getOwnPropertyDescriptor(base, property); 6975 6976 if (desc.get) { 6977 return desc.get.call(receiver); 6978 } 6979 6980 return desc.value; 6981 }; 6982 } 6983 6984 return get_get(target, property, receiver || target); 6985 } 6986 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js 6987 var inherits = __webpack_require__(32); 6988 6989 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js 6990 var possibleConstructorReturn = __webpack_require__(34); 6991 6992 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/slot.js 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 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); }; } 7004 7005 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 7006 7007 /** 7008 * External dependencies 7009 */ 7010 7011 /** 7012 * WordPress dependencies 7013 */ 7014 7015 7016 /** 7017 * Internal dependencies 7018 */ 7019 7020 7021 7022 var slot_SlotComponent = /*#__PURE__*/function (_Component) { 7023 Object(inherits["a" /* default */])(SlotComponent, _Component); 7024 7025 var _super = _createSuper(SlotComponent); 7026 7027 function SlotComponent() { 7028 var _this; 7029 7030 Object(classCallCheck["a" /* default */])(this, SlotComponent); 7031 7032 _this = _super.apply(this, arguments); 7033 _this.isUnmounted = false; 7034 _this.bindNode = _this.bindNode.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7035 return _this; 7036 } 7037 7038 Object(createClass["a" /* default */])(SlotComponent, [{ 7039 key: "componentDidMount", 7040 value: function componentDidMount() { 7041 var registerSlot = this.props.registerSlot; 7042 registerSlot(this.props.name, this); 7043 } 7044 }, { 7045 key: "componentWillUnmount", 7046 value: function componentWillUnmount() { 7047 var unregisterSlot = this.props.unregisterSlot; 7048 this.isUnmounted = true; 7049 unregisterSlot(this.props.name, this); 7050 } 7051 }, { 7052 key: "componentDidUpdate", 7053 value: function componentDidUpdate(prevProps) { 7054 var _this$props = this.props, 7055 name = _this$props.name, 7056 unregisterSlot = _this$props.unregisterSlot, 7057 registerSlot = _this$props.registerSlot; 7058 7059 if (prevProps.name !== name) { 7060 unregisterSlot(prevProps.name); 7061 registerSlot(name, this); 7062 } 7063 } 7064 }, { 7065 key: "bindNode", 7066 value: function bindNode(node) { 7067 this.node = node; 7068 } 7069 }, { 7070 key: "forceUpdate", 7071 value: function forceUpdate() { 7072 if (this.isUnmounted) { 7073 return; 7074 } 7075 7076 get_get(Object(getPrototypeOf["a" /* default */])(SlotComponent.prototype), "forceUpdate", this).call(this); 7077 } 7078 }, { 7079 key: "render", 7080 value: function render() { 7081 var _this$props2 = this.props, 7082 children = _this$props2.children, 7083 name = _this$props2.name, 7084 _this$props2$fillProp = _this$props2.fillProps, 7085 fillProps = _this$props2$fillProp === void 0 ? {} : _this$props2$fillProp, 7086 getFills = _this$props2.getFills; 7087 var fills = Object(external_lodash_["map"])(getFills(name, this), function (fill) { 7088 var fillChildren = Object(external_lodash_["isFunction"])(fill.children) ? fill.children(fillProps) : fill.children; 7089 return external_wp_element_["Children"].map(fillChildren, function (child, childIndex) { 7090 if (!child || Object(external_lodash_["isString"])(child)) { 7091 return child; 7092 } 7093 7094 var childKey = child.key || childIndex; 7095 return Object(external_wp_element_["cloneElement"])(child, { 7096 key: childKey 7097 }); 7098 }); 7099 }).filter( // In some cases fills are rendered only when some conditions apply. 7100 // This ensures that we only use non-empty fills when rendering, i.e., 7101 // it allows us to render wrappers only when the fills are actually present. 7102 Object(external_lodash_["negate"])(external_wp_element_["isEmptyElement"])); 7103 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_lodash_["isFunction"])(children) ? children(fills) : fills); 7104 } 7105 }]); 7106 7107 return SlotComponent; 7108 }(external_wp_element_["Component"]); 7109 7110 var slot_Slot = function Slot(props) { 7111 return Object(external_wp_element_["createElement"])(context.Consumer, null, function (_ref) { 7112 var registerSlot = _ref.registerSlot, 7113 unregisterSlot = _ref.unregisterSlot, 7114 getFills = _ref.getFills; 7115 return Object(external_wp_element_["createElement"])(slot_SlotComponent, Object(esm_extends["a" /* default */])({}, props, { 7116 registerSlot: registerSlot, 7117 unregisterSlot: unregisterSlot, 7118 getFills: getFills 7119 })); 7120 }); 7121 }; 7122 7123 /* harmony default export */ var slot_fill_slot = (slot_Slot); 7124 7125 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js 7126 var bubbles_virtually_use_slot = __webpack_require__(169); 7127 7128 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/fill.js 7129 7130 7131 /** 7132 * WordPress dependencies 7133 */ 7134 7135 /** 7136 * Internal dependencies 7137 */ 7138 7139 7140 7141 function useForceUpdate() { 7142 var _useState = Object(external_wp_element_["useState"])({}), 7143 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 7144 setState = _useState2[1]; 7145 7146 return function () { 7147 return setState({}); 7148 }; 7149 } 7150 7151 function bubbles_virtually_fill_Fill(_ref) { 7152 var name = _ref.name, 7153 children = _ref.children; 7154 var slot = Object(bubbles_virtually_use_slot["a" /* default */])(name); 7155 var ref = Object(external_wp_element_["useRef"])({ 7156 rerender: useForceUpdate() 7157 }); 7158 Object(external_wp_element_["useEffect"])(function () { 7159 // We register fills so we can keep track of their existance. 7160 // Some Slot implementations need to know if there're already fills 7161 // registered so they can choose to render themselves or not. 7162 slot.registerFill(ref); 7163 return function () { 7164 slot.unregisterFill(ref); 7165 }; 7166 }, [slot.registerFill, slot.unregisterFill]); 7167 7168 if (!slot.ref || !slot.ref.current) { 7169 return null; 7170 } 7171 7172 if (typeof children === 'function') { 7173 children = children(slot.fillProps); 7174 } 7175 7176 return Object(external_wp_element_["createPortal"])(children, slot.ref.current); 7177 } 7178 7179 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-context.js 7180 var slot_fill_context = __webpack_require__(133); 7181 7182 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot.js 7183 7184 7185 7186 7187 /** 7188 * WordPress dependencies 7189 */ 7190 7191 /** 7192 * Internal dependencies 7193 */ 7194 7195 7196 function bubbles_virtually_slot_Slot(_ref) { 7197 var name = _ref.name, 7198 _ref$fillProps = _ref.fillProps, 7199 fillProps = _ref$fillProps === void 0 ? {} : _ref$fillProps, 7200 _ref$as = _ref.as, 7201 Component = _ref$as === void 0 ? 'div' : _ref$as, 7202 props = Object(objectWithoutProperties["a" /* default */])(_ref, ["name", "fillProps", "as"]); 7203 7204 var registry = Object(external_wp_element_["useContext"])(slot_fill_context["a" /* default */]); 7205 var ref = Object(external_wp_element_["useRef"])(); 7206 Object(external_wp_element_["useLayoutEffect"])(function () { 7207 registry.registerSlot(name, ref, fillProps); 7208 return function () { 7209 registry.unregisterSlot(name, ref); 7210 }; // We are not including fillProps in the deps because we don't want to 7211 // unregister and register the slot whenever fillProps change, which would 7212 // cause the fill to be re-mounted. We are only considering the initial value 7213 // of fillProps. 7214 }, [registry.registerSlot, registry.unregisterSlot, name]); // fillProps may be an update that interacts with the layout, so we 7215 // useLayoutEffect 7216 7217 Object(external_wp_element_["useLayoutEffect"])(function () { 7218 registry.updateSlot(name, fillProps); 7219 }); 7220 return Object(external_wp_element_["createElement"])(Component, Object(esm_extends["a" /* default */])({ 7221 ref: ref 7222 }, props)); 7223 } 7224 7225 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js 7226 var esm_typeof = __webpack_require__(56); 7227 7228 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 2 modules 7229 var toConsumableArray = __webpack_require__(15); 7230 7231 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 7232 var defineProperty = __webpack_require__(5); 7233 7234 // EXTERNAL MODULE: external ["wp","isShallowEqual"] 7235 var external_wp_isShallowEqual_ = __webpack_require__(65); 7236 var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_); 7237 7238 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/slot-fill-provider.js 7239 7240 7241 7242 7243 7244 7245 7246 function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return Object(esm_typeof["a" /* default */])(key) === "symbol" ? key : String(key); } 7247 7248 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); } 7249 7250 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; } 7251 7252 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; } 7253 7254 /** 7255 * WordPress dependencies 7256 */ 7257 7258 7259 /** 7260 * Internal dependencies 7261 */ 7262 7263 7264 7265 function useSlotRegistry() { 7266 var _useState = Object(external_wp_element_["useState"])({}), 7267 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 7268 slots = _useState2[0], 7269 setSlots = _useState2[1]; 7270 7271 var _useState3 = Object(external_wp_element_["useState"])({}), 7272 _useState4 = Object(slicedToArray["a" /* default */])(_useState3, 2), 7273 fills = _useState4[0], 7274 setFills = _useState4[1]; 7275 7276 var registerSlot = Object(external_wp_element_["useCallback"])(function (name, ref, fillProps) { 7277 setSlots(function (prevSlots) { 7278 var slot = prevSlots[name] || {}; 7279 return _objectSpread(_objectSpread({}, prevSlots), {}, Object(defineProperty["a" /* default */])({}, name, _objectSpread(_objectSpread({}, slot), {}, { 7280 ref: ref || slot.ref, 7281 fillProps: fillProps || slot.fillProps || {} 7282 }))); 7283 }); 7284 }, []); 7285 var unregisterSlot = Object(external_wp_element_["useCallback"])(function (name, ref) { 7286 setSlots(function (prevSlots) { 7287 var slot = prevSlots[name], 7288 nextSlots = Object(objectWithoutProperties["a" /* default */])(prevSlots, [name].map(_toPropertyKey)); // Make sure we're not unregistering a slot registered by another element 7289 // See https://github.com/WordPress/gutenberg/pull/19242#issuecomment-590295412 7290 7291 7292 if ((slot === null || slot === void 0 ? void 0 : slot.ref) === ref) { 7293 return nextSlots; 7294 } 7295 7296 return prevSlots; 7297 }); 7298 }, []); 7299 var updateSlot = Object(external_wp_element_["useCallback"])(function (name, fillProps) { 7300 var slot = slots[name]; 7301 7302 if (!slot) { 7303 return; 7304 } 7305 7306 if (!external_wp_isShallowEqual_default()(slot.fillProps, fillProps)) { 7307 slot.fillProps = fillProps; 7308 var slotFills = fills[name]; 7309 7310 if (slotFills) { 7311 // Force update fills 7312 slotFills.map(function (fill) { 7313 return fill.current.rerender(); 7314 }); 7315 } 7316 } 7317 }, [slots, fills]); 7318 var registerFill = Object(external_wp_element_["useCallback"])(function (name, ref) { 7319 setFills(function (prevFills) { 7320 return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, [].concat(Object(toConsumableArray["a" /* default */])(prevFills[name] || []), [ref]))); 7321 }); 7322 }, []); 7323 var unregisterFill = Object(external_wp_element_["useCallback"])(function (name, ref) { 7324 setFills(function (prevFills) { 7325 if (prevFills[name]) { 7326 return _objectSpread(_objectSpread({}, prevFills), {}, Object(defineProperty["a" /* default */])({}, name, prevFills[name].filter(function (fillRef) { 7327 return fillRef !== ref; 7328 }))); 7329 } 7330 7331 return prevFills; 7332 }); 7333 }, []); // Memoizing the return value so it can be directly passed to Provider value 7334 7335 var registry = Object(external_wp_element_["useMemo"])(function () { 7336 return { 7337 slots: slots, 7338 fills: fills, 7339 registerSlot: registerSlot, 7340 updateSlot: updateSlot, 7341 unregisterSlot: unregisterSlot, 7342 registerFill: registerFill, 7343 unregisterFill: unregisterFill 7344 }; 7345 }, [slots, fills, registerSlot, updateSlot, unregisterSlot, registerFill, unregisterFill]); 7346 return registry; 7347 } 7348 7349 function slot_fill_provider_SlotFillProvider(_ref) { 7350 var children = _ref.children; 7351 var registry = useSlotRegistry(); 7352 return Object(external_wp_element_["createElement"])(slot_fill_context["a" /* default */].Provider, { 7353 value: registry 7354 }, children); 7355 } 7356 7357 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/provider.js 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 function provider_createSuper(Derived) { var hasNativeReflectConstruct = provider_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); }; } 7368 7369 function provider_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } 7370 7371 /** 7372 * External dependencies 7373 */ 7374 7375 /** 7376 * WordPress dependencies 7377 */ 7378 7379 7380 /** 7381 * Internal dependencies 7382 */ 7383 7384 7385 7386 var provider_SlotFillProvider = /*#__PURE__*/function (_Component) { 7387 Object(inherits["a" /* default */])(SlotFillProvider, _Component); 7388 7389 var _super = provider_createSuper(SlotFillProvider); 7390 7391 function SlotFillProvider() { 7392 var _this; 7393 7394 Object(classCallCheck["a" /* default */])(this, SlotFillProvider); 7395 7396 _this = _super.apply(this, arguments); 7397 _this.registerSlot = _this.registerSlot.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7398 _this.registerFill = _this.registerFill.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7399 _this.unregisterSlot = _this.unregisterSlot.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7400 _this.unregisterFill = _this.unregisterFill.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7401 _this.getSlot = _this.getSlot.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7402 _this.getFills = _this.getFills.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7403 _this.hasFills = _this.hasFills.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7404 _this.subscribe = _this.subscribe.bind(Object(assertThisInitialized["a" /* default */])(_this)); 7405 _this.slots = {}; 7406 _this.fills = {}; 7407 _this.listeners = []; 7408 _this.contextValue = { 7409 registerSlot: _this.registerSlot, 7410 unregisterSlot: _this.unregisterSlot, 7411 registerFill: _this.registerFill, 7412 unregisterFill: _this.unregisterFill, 7413 getSlot: _this.getSlot, 7414 getFills: _this.getFills, 7415 hasFills: _this.hasFills, 7416 subscribe: _this.subscribe 7417 }; 7418 return _this; 7419 } 7420 7421 Object(createClass["a" /* default */])(SlotFillProvider, [{ 7422 key: "registerSlot", 7423 value: function registerSlot(name, slot) { 7424 var previousSlot = this.slots[name]; 7425 this.slots[name] = slot; 7426 this.triggerListeners(); // Sometimes the fills are registered after the initial render of slot 7427 // But before the registerSlot call, we need to rerender the slot 7428 7429 this.forceUpdateSlot(name); // If a new instance of a slot is being mounted while another with the 7430 // same name exists, force its update _after_ the new slot has been 7431 // assigned into the instance, such that its own rendering of children 7432 // will be empty (the new Slot will subsume all fills for this name). 7433 7434 if (previousSlot) { 7435 previousSlot.forceUpdate(); 7436 } 7437 } 7438 }, { 7439 key: "registerFill", 7440 value: function registerFill(name, instance) { 7441 this.fills[name] = [].concat(Object(toConsumableArray["a" /* default */])(this.fills[name] || []), [instance]); 7442 this.forceUpdateSlot(name); 7443 } 7444 }, { 7445 key: "unregisterSlot", 7446 value: function unregisterSlot(name, instance) { 7447 // If a previous instance of a Slot by this name unmounts, do nothing, 7448 // as the slot and its fills should only be removed for the current 7449 // known instance. 7450 if (this.slots[name] !== instance) { 7451 return; 7452 } 7453 7454 delete this.slots[name]; 7455 this.triggerListeners(); 7456 } 7457 }, { 7458 key: "unregisterFill", 7459 value: function unregisterFill(name, instance) { 7460 this.fills[name] = Object(external_lodash_["without"])(this.fills[name], instance); 7461 this.forceUpdateSlot(name); 7462 } 7463 }, { 7464 key: "getSlot", 7465 value: function getSlot(name) { 7466 return this.slots[name]; 7467 } 7468 }, { 7469 key: "getFills", 7470 value: function getFills(name, slotInstance) { 7471 // Fills should only be returned for the current instance of the slot 7472 // in which they occupy. 7473 if (this.slots[name] !== slotInstance) { 7474 return []; 7475 } 7476 7477 return this.fills[name]; 7478 } 7479 }, { 7480 key: "hasFills", 7481 value: function hasFills(name) { 7482 return this.fills[name] && !!this.fills[name].length; 7483 } 7484 }, { 7485 key: "forceUpdateSlot", 7486 value: function forceUpdateSlot(name) { 7487 var slot = this.getSlot(name); 7488 7489 if (slot) { 7490 slot.forceUpdate(); 7491 } 7492 } 7493 }, { 7494 key: "triggerListeners", 7495 value: function triggerListeners() { 7496 this.listeners.forEach(function (listener) { 7497 return listener(); 7498 }); 7499 } 7500 }, { 7501 key: "subscribe", 7502 value: function subscribe(listener) { 7503 var _this2 = this; 7504 7505 this.listeners.push(listener); 7506 return function () { 7507 _this2.listeners = Object(external_lodash_["without"])(_this2.listeners, listener); 7508 }; 7509 } 7510 }, { 7511 key: "render", 7512 value: function render() { 7513 return Object(external_wp_element_["createElement"])(context.Provider, { 7514 value: this.contextValue 7515 }, this.props.children); 7516 } 7517 }]); 7518 7519 return SlotFillProvider; 7520 }(external_wp_element_["Component"]); 7521 7522 7523 7524 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js 7525 7526 7527 7528 7529 /** 7530 * Internal dependencies 7531 */ 7532 7533 7534 7535 7536 7537 7538 7539 function slot_fill_Fill(props) { 7540 // We're adding both Fills here so they can register themselves before 7541 // their respective slot has been registered. Only the Fill that has a slot 7542 // will render. The other one will return null. 7543 return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(slot_fill_fill, props), Object(external_wp_element_["createElement"])(bubbles_virtually_fill_Fill, props)); 7544 } 7545 function slot_fill_Slot(_ref) { 7546 var bubblesVirtually = _ref.bubblesVirtually, 7547 props = Object(objectWithoutProperties["a" /* default */])(_ref, ["bubblesVirtually"]); 7548 7549 if (bubblesVirtually) { 7550 return Object(external_wp_element_["createElement"])(bubbles_virtually_slot_Slot, props); 7551 } 7552 7553 return Object(external_wp_element_["createElement"])(slot_fill_slot, props); 7554 } 7555 function Provider(_ref2) { 7556 var children = _ref2.children, 7557 props = Object(objectWithoutProperties["a" /* default */])(_ref2, ["children"]); 7558 7559 return Object(external_wp_element_["createElement"])(provider_SlotFillProvider, props, Object(external_wp_element_["createElement"])(slot_fill_provider_SlotFillProvider, null, children)); 7560 } 7561 function createSlotFill(name) { 7562 var FillComponent = function FillComponent(props) { 7563 return Object(external_wp_element_["createElement"])(slot_fill_Fill, Object(esm_extends["a" /* default */])({ 7564 name: name 7565 }, props)); 7566 }; 7567 7568 FillComponent.displayName = name + 'Fill'; 7569 7570 var SlotComponent = function SlotComponent(props) { 7571 return Object(external_wp_element_["createElement"])(slot_fill_Slot, Object(esm_extends["a" /* default */])({ 7572 name: name 7573 }, props)); 7574 }; 7575 7576 SlotComponent.displayName = name + 'Slot'; 7577 SlotComponent.__unstableName = name; 7578 return { 7579 Fill: FillComponent, 7580 Slot: SlotComponent 7581 }; 7582 } 7583 7584 7585 7586 /***/ }), 7587 /* 113 */ 7588 /***/ (function(module, __webpack_exports__, __webpack_require__) { 7589 7590 "use strict"; 7591 7592 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 7593 var esm_extends = __webpack_require__(8); 7594 7595 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules 7596 var slicedToArray = __webpack_require__(12); 7597 7598 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js 7599 var objectWithoutProperties = __webpack_require__(13); 7600 7601 // EXTERNAL MODULE: external ["wp","element"] 7602 var external_wp_element_ = __webpack_require__(0); 7603 7604 // EXTERNAL MODULE: ./node_modules/classnames/index.js 7605 var classnames = __webpack_require__(10); 7606 var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames); 7607 7608 // EXTERNAL MODULE: external ["wp","dom"] 7609 var external_wp_dom_ = __webpack_require__(27); 7610 7611 // EXTERNAL MODULE: external ["wp","keycodes"] 7612 var external_wp_keycodes_ = __webpack_require__(17); 7613 7614 // EXTERNAL MODULE: external ["wp","deprecated"] 7615 var external_wp_deprecated_ = __webpack_require__(35); 7616 var external_wp_deprecated_default = /*#__PURE__*/__webpack_require__.n(external_wp_deprecated_); 7617 7618 // EXTERNAL MODULE: external ["wp","compose"] 7619 var external_wp_compose_ = __webpack_require__(11); 7620 7621 // EXTERNAL MODULE: ./node_modules/@wordpress/icons/build-module/library/close.js 7622 var library_close = __webpack_require__(160); 7623 7624 // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js 7625 var defineProperty = __webpack_require__(5); 7626 7627 // EXTERNAL MODULE: external ["wp","i18n"] 7628 var external_wp_i18n_ = __webpack_require__(1); 7629 7630 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/utils.js 7631 7632 7633 7634 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; } 7635 7636 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; } 7637 7638 /** 7639 * WordPress dependencies 7640 */ 7641 7642 /** 7643 * Module constants 7644 */ 7645 7646 var HEIGHT_OFFSET = 10; // used by the arrow and a bit of empty space 7647 7648 /** 7649 * Utility used to compute the popover position over the xAxis 7650 * 7651 * @param {Object} anchorRect Anchor Rect. 7652 * @param {Object} contentSize Content Size. 7653 * @param {string} xAxis Desired xAxis. 7654 * @param {string} corner Desired corner. 7655 * @param {boolean} stickyBoundaryElement The boundary element to use when 7656 * switching between sticky and normal 7657 * position. 7658 * @param {string} chosenYAxis yAxis to be used. 7659 * @param {Element} boundaryElement Boundary element. 7660 * @param {boolean} forcePosition Don't adjust position based on anchor. 7661 * 7662 * @return {Object} Popover xAxis position and constraints. 7663 */ 7664 7665 function computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, chosenYAxis, boundaryElement, forcePosition) { 7666 var width = contentSize.width; // Correct xAxis for RTL support 7667 7668 if (xAxis === 'left' && Object(external_wp_i18n_["isRTL"])()) { 7669 xAxis = 'right'; 7670 } else if (xAxis === 'right' && Object(external_wp_i18n_["isRTL"])()) { 7671 xAxis = 'left'; 7672 } 7673 7674 if (corner === 'left' && Object(external_wp_i18n_["isRTL"])()) { 7675 corner = 'right'; 7676 } else if (corner === 'right' && Object(external_wp_i18n_["isRTL"])()) { 7677 corner = 'left'; 7678 } // x axis alignment choices 7679 7680 7681 var anchorMidPoint = Math.round(anchorRect.left + anchorRect.width / 2); 7682 var centerAlignment = { 7683 popoverLeft: anchorMidPoint, 7684 contentWidth: (anchorMidPoint - width / 2 > 0 ? width / 2 : anchorMidPoint) + (anchorMidPoint + width / 2 > window.innerWidth ? window.innerWidth - anchorMidPoint : width / 2) 7685 }; 7686 var leftAlignmentX = anchorRect.left; 7687 7688 if (corner === 'right') { 7689 leftAlignmentX = anchorRect.right; 7690 } else if (chosenYAxis !== 'middle') { 7691 leftAlignmentX = anchorMidPoint; 7692 } 7693 7694 var rightAlignmentX = anchorRect.right; 7695 7696 if (corner === 'left') { 7697 rightAlignmentX = anchorRect.left; 7698 } else if (chosenYAxis !== 'middle') { 7699 rightAlignmentX = anchorMidPoint; 7700 } 7701 7702 var leftAlignment = { 7703 popoverLeft: leftAlignmentX, 7704 contentWidth: leftAlignmentX - width > 0 ? width : leftAlignmentX 7705 }; 7706 var rightAlignment = { 7707 popoverLeft: rightAlignmentX, 7708 contentWidth: rightAlignmentX + width > window.innerWidth ? window.innerWidth - rightAlignmentX : width 7709 }; // Choosing the x axis 7710 7711 var chosenXAxis = xAxis; 7712 var contentWidth = null; 7713 7714 if (!stickyBoundaryElement && !forcePosition) { 7715 if (xAxis === 'center' && centerAlignment.contentWidth === width) { 7716 chosenXAxis = 'center'; 7717 } else if (xAxis === 'left' && leftAlignment.contentWidth === width) { 7718 chosenXAxis = 'left'; 7719 } else if (xAxis === 'right' && rightAlignment.contentWidth === width) { 7720 chosenXAxis = 'right'; 7721 } else { 7722 chosenXAxis = leftAlignment.contentWidth > rightAlignment.contentWidth ? 'left' : 'right'; 7723 var chosenWidth = chosenXAxis === 'left' ? leftAlignment.contentWidth : rightAlignment.contentWidth; // Limit width of the content to the viewport width 7724 7725 if (width > window.innerWidth) { 7726 contentWidth = window.innerWidth; 7727 } // If we can't find any alignment options that could fit 7728 // our content, then let's fallback to the center of the viewport. 7729 7730 7731 if (chosenWidth !== width) { 7732 chosenXAxis = 'center'; 7733 centerAlignment.popoverLeft = window.innerWidth / 2; 7734 } 7735 } 7736 } 7737 7738 var popoverLeft; 7739 7740 if (chosenXAxis === 'center') { 7741 popoverLeft = centerAlignment.popoverLeft; 7742 } else if (chosenXAxis === 'left') { 7743 popoverLeft = leftAlignment.popoverLeft; 7744 } else { 7745 popoverLeft = rightAlignment.popoverLeft; 7746 } 7747 7748 if (boundaryElement) { 7749 var boundaryRect = boundaryElement.getBoundingClientRect(); 7750 popoverLeft = Math.min(popoverLeft, boundaryRect.right - width); 7751 } 7752 7753 return { 7754 xAxis: chosenXAxis, 7755 popoverLeft: popoverLeft, 7756 contentWidth: contentWidth 7757 }; 7758 } 7759 /** 7760 * Utility used to compute the popover position over the yAxis 7761 * 7762 * @param {Object} anchorRect Anchor Rect. 7763 * @param {Object} contentSize Content Size. 7764 * @param {string} yAxis Desired yAxis. 7765 * @param {string} corner Desired corner. 7766 * @param {boolean} stickyBoundaryElement The boundary element to use when 7767 * switching between sticky and normal 7768 * position. 7769 * @param {Element} anchorRef The anchor element. 7770 * @param {Element} relativeOffsetTop If applicable, top offset of the 7771 * relative positioned parent container. 7772 * @param {boolean} forcePosition Don't adjust position based on anchor. 7773 * 7774 * @return {Object} Popover xAxis position and constraints. 7775 */ 7776 7777 function computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition) { 7778 var height = contentSize.height; 7779 7780 if (stickyBoundaryElement) { 7781 var stickyRect = stickyBoundaryElement.getBoundingClientRect(); 7782 var stickyPosition = stickyRect.top + height - relativeOffsetTop; 7783 7784 if (anchorRect.top <= stickyPosition) { 7785 return { 7786 yAxis: yAxis, 7787 popoverTop: Math.min(anchorRect.bottom, stickyPosition) 7788 }; 7789 } 7790 } // y axis alignment choices 7791 7792 7793 var anchorMidPoint = anchorRect.top + anchorRect.height / 2; 7794 7795 if (corner === 'bottom') { 7796 anchorMidPoint = anchorRect.bottom; 7797 } else if (corner === 'top') { 7798 anchorMidPoint = anchorRect.top; 7799 } 7800 7801 var middleAlignment = { 7802 popoverTop: anchorMidPoint, 7803 contentHeight: (anchorMidPoint - height / 2 > 0 ? height / 2 : anchorMidPoint) + (anchorMidPoint + height / 2 > window.innerHeight ? window.innerHeight - anchorMidPoint : height / 2) 7804 }; 7805 var topAlignment = { 7806 popoverTop: anchorRect.top, 7807 contentHeight: anchorRect.top - HEIGHT_OFFSET - height > 0 ? height : anchorRect.top - HEIGHT_OFFSET 7808 }; 7809 var bottomAlignment = { 7810 popoverTop: anchorRect.bottom, 7811 contentHeight: anchorRect.bottom + HEIGHT_OFFSET + height > window.innerHeight ? window.innerHeight - HEIGHT_OFFSET - anchorRect.bottom : height 7812 }; // Choosing the y axis 7813 7814 var chosenYAxis = yAxis; 7815 var contentHeight = null; 7816 7817 if (!stickyBoundaryElement && !forcePosition) { 7818 if (yAxis === 'middle' && middleAlignment.contentHeight === height) { 7819 chosenYAxis = 'middle'; 7820 } else if (yAxis === 'top' && topAlignment.contentHeight === height) { 7821 chosenYAxis = 'top'; 7822 } else if (yAxis === 'bottom' && bottomAlignment.contentHeight === height) { 7823 chosenYAxis = 'bottom'; 7824 } else { 7825 chosenYAxis = topAlignment.contentHeight > bottomAlignment.contentHeight ? 'top' : 'bottom'; 7826 var chosenHeight = chosenYAxis === 'top' ? topAlignment.contentHeight : bottomAlignment.contentHeight; 7827 contentHeight = chosenHeight !== height ? chosenHeight : null; 7828 } 7829 } 7830 7831 var popoverTop; 7832 7833 if (chosenYAxis === 'middle') { 7834 popoverTop = middleAlignment.popoverTop; 7835 } else if (chosenYAxis === 'top') { 7836 popoverTop = topAlignment.popoverTop; 7837 } else { 7838 popoverTop = bottomAlignment.popoverTop; 7839 } 7840 7841 return { 7842 yAxis: chosenYAxis, 7843 popoverTop: popoverTop, 7844 contentHeight: contentHeight 7845 }; 7846 } 7847 /** 7848 * Utility used to compute the popover position and the content max width/height 7849 * for a popover given its anchor rect and its content size. 7850 * 7851 * @param {Object} anchorRect Anchor Rect. 7852 * @param {Object} contentSize Content Size. 7853 * @param {string} position Position. 7854 * @param {boolean} stickyBoundaryElement The boundary element to use when 7855 * switching between sticky and normal 7856 * position. 7857 * @param {Element} anchorRef The anchor element. 7858 * @param {number} relativeOffsetTop If applicable, top offset of the 7859 * relative positioned parent container. 7860 * @param {Element} boundaryElement Boundary element. 7861 * @param {boolean} forcePosition Don't adjust position based on anchor. 7862 * 7863 * @return {Object} Popover position and constraints. 7864 */ 7865 7866 function computePopoverPosition(anchorRect, contentSize) { 7867 var position = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'top'; 7868 var stickyBoundaryElement = arguments.length > 3 ? arguments[3] : undefined; 7869 var anchorRef = arguments.length > 4 ? arguments[4] : undefined; 7870 var relativeOffsetTop = arguments.length > 5 ? arguments[5] : undefined; 7871 var boundaryElement = arguments.length > 6 ? arguments[6] : undefined; 7872 var forcePosition = arguments.length > 7 ? arguments[7] : undefined; 7873 7874 var _position$split = position.split(' '), 7875 _position$split2 = Object(slicedToArray["a" /* default */])(_position$split, 3), 7876 yAxis = _position$split2[0], 7877 _position$split2$ = _position$split2[1], 7878 xAxis = _position$split2$ === void 0 ? 'center' : _position$split2$, 7879 corner = _position$split2[2]; 7880 7881 var yAxisPosition = computePopoverYAxisPosition(anchorRect, contentSize, yAxis, corner, stickyBoundaryElement, anchorRef, relativeOffsetTop, forcePosition); 7882 var xAxisPosition = computePopoverXAxisPosition(anchorRect, contentSize, xAxis, corner, stickyBoundaryElement, yAxisPosition.yAxis, boundaryElement, forcePosition); 7883 return _objectSpread(_objectSpread({}, xAxisPosition), yAxisPosition); 7884 } 7885 /** 7886 * Offsets the given rect by the position of the iframe that contains the element. 7887 * If the owner document is not in an iframe then it returns with the original rect. 7888 * 7889 * @param {DOMRect} rect bounds of the element 7890 * @param {Document} ownerDocument document of the element 7891 * 7892 * @return {DOMRect} offsetted bounds 7893 */ 7894 7895 function offsetIframe(rect, ownerDocument) { 7896 var defaultView = ownerDocument.defaultView; 7897 var frameElement = defaultView.frameElement; 7898 7899 if (!frameElement) { 7900 return rect; 7901 } 7902 7903 var iframeRect = frameElement.getBoundingClientRect(); 7904 return new defaultView.DOMRect(rect.left + iframeRect.left, rect.top + iframeRect.top, rect.width, rect.height); 7905 } 7906 7907 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/button/index.js + 1 modules 7908 var build_module_button = __webpack_require__(36); 7909 7910 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/scroll-lock/index.js 7911 var scroll_lock = __webpack_require__(170); 7912 7913 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/bubbles-virtually/use-slot.js 7914 var use_slot = __webpack_require__(169); 7915 7916 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/slot-fill/index.js + 10 modules 7917 var slot_fill = __webpack_require__(112); 7918 7919 // EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/animate/index.js 7920 var build_module_animate = __webpack_require__(102); 7921 7922 // CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/popover/index.js 7923 7924 7925 7926 7927 7928 /** 7929 * External dependencies 7930 */ 7931 7932 /** 7933 * WordPress dependencies 7934 */ 7935 7936 7937 7938 7939 7940 7941 7942 /** 7943 * Internal dependencies 7944 */ 7945 7946 7947 7948 7949 7950 7951 /** 7952 * Name of slot in which popover should fill. 7953 * 7954 * @type {string} 7955 */ 7956 7957 var SLOT_NAME = 'Popover'; 7958 7959 function computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect) { 7960 var anchorRef = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 7961 var shouldAnchorIncludePadding = arguments.length > 4 ? arguments[4] : undefined; 7962 7963 if (anchorRect) { 7964 return anchorRect; 7965 } 7966 7967 if (getAnchorRect) { 7968 if (!anchorRefFallback.current) { 7969 return; 7970 } 7971 7972 return offsetIframe(getAnchorRect(anchorRefFallback.current), anchorRefFallback.current.ownerDocument); 7973 } 7974 7975 if (anchorRef !== false) { 7976 if (!anchorRef || !window.Range || !window.Element || !window.DOMRect) { 7977 return; 7978 } // Duck-type to check if `anchorRef` is an instance of Range 7979 // `anchorRef instanceof window.Range` checks will break across document boundaries 7980 // such as in an iframe 7981 7982 7983 if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.cloneRange) === 'function') { 7984 return offsetIframe(Object(external_wp_dom_["getRectangleFromRange"])(anchorRef), anchorRef.endContainer.ownerDocument); 7985 } // Duck-type to check if `anchorRef` is an instance of Element 7986 // `anchorRef instanceof window.Element` checks will break across document boundaries 7987 // such as in an iframe 7988 7989 7990 if (typeof (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.getBoundingClientRect) === 'function') { 7991 var _rect2 = offsetIframe(anchorRef.getBoundingClientRect(), anchorRef.ownerDocument); 7992 7993 if (shouldAnchorIncludePadding) { 7994 return _rect2; 7995 } 7996 7997 return withoutPadding(_rect2, anchorRef); 7998 } 7999 8000 var top = anchorRef.top, 8001 bottom = anchorRef.bottom; 8002 var topRect = top.getBoundingClientRect(); 8003 var bottomRect = bottom.getBoundingClientRect(); 8004 8005 var _rect = offsetIframe(new window.DOMRect(topRect.left, topRect.top, topRect.width, bottomRect.bottom - topRect.top), top.ownerDocument); 8006 8007 if (shouldAnchorIncludePadding) { 8008 return _rect; 8009 } 8010 8011 return withoutPadding(_rect, anchorRef); 8012 } 8013 8014 if (!anchorRefFallback.current) { 8015 return; 8016 } 8017 8018 var parentNode = anchorRefFallback.current.parentNode; 8019 var rect = parentNode.getBoundingClientRect(); 8020 8021 if (shouldAnchorIncludePadding) { 8022 return rect; 8023 } 8024 8025 return withoutPadding(rect, parentNode); 8026 } 8027 8028 function getComputedStyle(node) { 8029 return node.ownerDocument.defaultView.getComputedStyle(node); 8030 } 8031 8032 function withoutPadding(rect, element) { 8033 var _getComputedStyle = getComputedStyle(element), 8034 paddingTop = _getComputedStyle.paddingTop, 8035 paddingBottom = _getComputedStyle.paddingBottom, 8036 paddingLeft = _getComputedStyle.paddingLeft, 8037 paddingRight = _getComputedStyle.paddingRight; 8038 8039 var top = paddingTop ? parseInt(paddingTop, 10) : 0; 8040 var bottom = paddingBottom ? parseInt(paddingBottom, 10) : 0; 8041 var left = paddingLeft ? parseInt(paddingLeft, 10) : 0; 8042 var right = paddingRight ? parseInt(paddingRight, 10) : 0; 8043 return { 8044 x: rect.left + left, 8045 y: rect.top + top, 8046 width: rect.width - left - right, 8047 height: rect.height - top - bottom, 8048 left: rect.left + left, 8049 right: rect.right - right, 8050 top: rect.top + top, 8051 bottom: rect.bottom - bottom 8052 }; 8053 } 8054 /** 8055 * Sets or removes an element attribute. 8056 * 8057 * @param {Element} element The element to modify. 8058 * @param {string} name The attribute name to set or remove. 8059 * @param {?string} value The value to set. A falsy value will remove the 8060 * attribute. 8061 */ 8062 8063 8064 function setAttribute(element, name, value) { 8065 if (!value) { 8066 if (element.hasAttribute(name)) { 8067 element.removeAttribute(name); 8068 } 8069 } else if (element.getAttribute(name) !== value) { 8070 element.setAttribute(name, value); 8071 } 8072 } 8073 /** 8074 * Sets or removes an element style property. 8075 * 8076 * @param {Element} element The element to modify. 8077 * @param {string} property The property to set or remove. 8078 * @param {?string} value The value to set. A falsy value will remove the 8079 * property. 8080 */ 8081 8082 8083 function setStyle(element, property) { 8084 var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; 8085 8086 if (element.style[property] !== value) { 8087 element.style[property] = value; 8088 } 8089 } 8090 /** 8091 * Sets or removes an element class. 8092 * 8093 * @param {Element} element The element to modify. 8094 * @param {string} name The class to set or remove. 8095 * @param {boolean} toggle True to set the class, false to remove. 8096 */ 8097 8098 8099 function setClass(element, name, toggle) { 8100 if (toggle) { 8101 if (!element.classList.contains(name)) { 8102 element.classList.add(name); 8103 } 8104 } else if (element.classList.contains(name)) { 8105 element.classList.remove(name); 8106 } 8107 } 8108 8109 function getAnchorDocument(anchor) { 8110 if (!anchor) { 8111 return; 8112 } 8113 8114 if (anchor.endContainer) { 8115 return anchor.endContainer.ownerDocument; 8116 } 8117 8118 if (anchor.top) { 8119 return anchor.top.ownerDocument; 8120 } 8121 8122 return anchor.ownerDocument; 8123 } 8124 8125 var popover_Popover = function Popover(_ref) { 8126 var headerTitle = _ref.headerTitle, 8127 onClose = _ref.onClose, 8128 onKeyDown = _ref.onKeyDown, 8129 children = _ref.children, 8130 className = _ref.className, 8131 _ref$noArrow = _ref.noArrow, 8132 noArrow = _ref$noArrow === void 0 ? true : _ref$noArrow, 8133 isAlternate = _ref.isAlternate, 8134 _ref$position = _ref.position, 8135 position = _ref$position === void 0 ? 'bottom right' : _ref$position, 8136 range = _ref.range, 8137 _ref$focusOnMount = _ref.focusOnMount, 8138 focusOnMount = _ref$focusOnMount === void 0 ? 'firstElement' : _ref$focusOnMount, 8139 anchorRef = _ref.anchorRef, 8140 shouldAnchorIncludePadding = _ref.shouldAnchorIncludePadding, 8141 anchorRect = _ref.anchorRect, 8142 getAnchorRect = _ref.getAnchorRect, 8143 expandOnMobile = _ref.expandOnMobile, 8144 _ref$animate = _ref.animate, 8145 animate = _ref$animate === void 0 ? true : _ref$animate, 8146 onClickOutside = _ref.onClickOutside, 8147 onFocusOutside = _ref.onFocusOutside, 8148 __unstableStickyBoundaryElement = _ref.__unstableStickyBoundaryElement, 8149 _ref$__unstableSlotNa = _ref.__unstableSlotName, 8150 __unstableSlotName = _ref$__unstableSlotNa === void 0 ? SLOT_NAME : _ref$__unstableSlotNa, 8151 __unstableObserveElement = _ref.__unstableObserveElement, 8152 __unstableBoundaryParent = _ref.__unstableBoundaryParent, 8153 __unstableForcePosition = _ref.__unstableForcePosition, 8154 contentProps = Object(objectWithoutProperties["a" /* default */])(_ref, ["headerTitle", "onClose", "onKeyDown", "children", "className", "noArrow", "isAlternate", "position", "range", "focusOnMount", "anchorRef", "shouldAnchorIncludePadding", "anchorRect", "getAnchorRect", "expandOnMobile", "animate", "onClickOutside", "onFocusOutside", "__unstableStickyBoundaryElement", "__unstableSlotName", "__unstableObserveElement", "__unstableBoundaryParent", "__unstableForcePosition"]); 8155 8156 var anchorRefFallback = Object(external_wp_element_["useRef"])(null); 8157 var contentRef = Object(external_wp_element_["useRef"])(null); 8158 var containerRef = Object(external_wp_element_["useRef"])(); 8159 var isMobileViewport = Object(external_wp_compose_["useViewportMatch"])('medium', '<'); 8160 8161 var _useState = Object(external_wp_element_["useState"])(), 8162 _useState2 = Object(slicedToArray["a" /* default */])(_useState, 2), 8163 animateOrigin = _useState2[0], 8164 setAnimateOrigin = _useState2[1]; 8165 8166 var slot = Object(use_slot["a" /* default */])(__unstableSlotName); 8167 var isExpanded = expandOnMobile && isMobileViewport; 8168 8169 var _useResizeObserver = Object(external_wp_compose_["useResizeObserver"])(), 8170 _useResizeObserver2 = Object(slicedToArray["a" /* default */])(_useResizeObserver, 2), 8171 containerResizeListener = _useResizeObserver2[0], 8172 contentSize = _useResizeObserver2[1]; 8173 8174 noArrow = isExpanded || noArrow; 8175 Object(external_wp_element_["useLayoutEffect"])(function () { 8176 if (isExpanded) { 8177 setClass(containerRef.current, 'is-without-arrow', noArrow); 8178 setClass(containerRef.current, 'is-alternate', isAlternate); 8179 setAttribute(containerRef.current, 'data-x-axis'); 8180 setAttribute(containerRef.current, 'data-y-axis'); 8181 setStyle(containerRef.current, 'top'); 8182 setStyle(containerRef.current, 'left'); 8183 setStyle(contentRef.current, 'maxHeight'); 8184 setStyle(contentRef.current, 'maxWidth'); 8185 return; 8186 } 8187 8188 var refresh = function refresh() { 8189 if (!containerRef.current || !contentRef.current) { 8190 return; 8191 } 8192 8193 var anchor = computeAnchorRect(anchorRefFallback, anchorRect, getAnchorRect, anchorRef, shouldAnchorIncludePadding); 8194 8195 if (!anchor) { 8196 return; 8197 } 8198 8199 var _containerRef$current = containerRef.current, 8200 offsetParent = _containerRef$current.offsetParent, 8201 ownerDocument = _containerRef$current.ownerDocument; 8202 var relativeOffsetTop = 0;