react-ui89 0.7.8 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import * as React from 'react';
2
- import React__default, { useState, useMemo, createElement, PureComponent, Component, forwardRef } from 'react';
2
+ import React__default, { useState, useMemo, forwardRef } from 'react';
3
+ import { VariableSizeGrid } from 'react-window';
4
+ import AutoSizer from 'react-virtualized-auto-sizer';
3
5
 
4
6
  var Ui89Theme;
5
7
  (function (Ui89Theme) {
@@ -125,38 +127,7 @@ function Ui89HighlightText({ theme, block, children, }) {
125
127
  return (React__default.createElement("span", { className: `${style$1.container} ${chosenThemeStyles[theme]} ${block ? style$1["container--block"] : null}` }, children));
126
128
  }
127
129
 
128
- function getDefaultExportFromCjs (x) {
129
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
130
- }
131
-
132
- function getAugmentedNamespace(n) {
133
- if (n.__esModule) return n;
134
- var f = n.default;
135
- if (typeof f == "function") {
136
- var a = function a () {
137
- if (this instanceof a) {
138
- return Reflect.construct(f, arguments, this.constructor);
139
- }
140
- return f.apply(this, arguments);
141
- };
142
- a.prototype = f.prototype;
143
- } else a = {};
144
- Object.defineProperty(a, '__esModule', {value: true});
145
- Object.keys(n).forEach(function (k) {
146
- var d = Object.getOwnPropertyDescriptor(n, k);
147
- Object.defineProperty(a, k, d.get ? d : {
148
- enumerable: true,
149
- get: function () {
150
- return n[k];
151
- }
152
- });
153
- });
154
- return a;
155
- }
156
-
157
- var lib = {exports: {}};
158
-
159
- var Modal = {};
130
+ var styles$8 = {"dialog":"Ui89ModalDialog-module_dialog__JtOw1","appear":"Ui89ModalDialog-module_appear__Xt-kk","dialog--open":"Ui89ModalDialog-module_dialog--open__9o2xZ","dialogBackdrop":"Ui89ModalDialog-module_dialogBackdrop__pw9Av","dialogBox":"Ui89ModalDialog-module_dialogBox__ilddn","spacer":"Ui89ModalDialog-module_spacer__fS17b","dialogBox--size-big":"Ui89ModalDialog-module_dialogBox--size-big__YT0xb","dialogBox--size-medium":"Ui89ModalDialog-module_dialogBox--size-medium__lZrJR","dialogBox--size-small":"Ui89ModalDialog-module_dialogBox--size-small__-2nH-"};
160
131
 
161
132
  var reactDom = {exports: {}};
162
133
 
@@ -31119,4680 +31090,138 @@ function requireReactDom () {
31119
31090
  return reactDom.exports;
31120
31091
  }
31121
31092
 
31122
- var propTypes = {exports: {}};
31093
+ var reactDomExports = requireReactDom();
31123
31094
 
31124
- var reactIs = {exports: {}};
31095
+ var styles$7 = {"scene":"Ui89Scene-module_scene__5uNRp"};
31125
31096
 
31126
- var reactIs_production_min = {};
31097
+ var lookStyles = {"main":"look-module_main__dCtZk","side":"look-module_side__bCbry"};
31127
31098
 
31128
- /** @license React v16.13.1
31129
- * react-is.production.min.js
31130
- *
31131
- * Copyright (c) Facebook, Inc. and its affiliates.
31132
- *
31133
- * This source code is licensed under the MIT license found in the
31134
- * LICENSE file in the root directory of this source tree.
31135
- */
31099
+ var scrollbarStyles = {"container":"scrollbar-module_container__q4x0n"};
31136
31100
 
31137
- var hasRequiredReactIs_production_min;
31138
-
31139
- function requireReactIs_production_min () {
31140
- if (hasRequiredReactIs_production_min) return reactIs_production_min;
31141
- hasRequiredReactIs_production_min = 1;
31142
- var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
31143
- Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
31144
- function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
31145
- reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
31146
- reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
31147
- reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
31148
- return reactIs_production_min;
31101
+ function Ui89Scene({ look = Ui89Look.main, children, }) {
31102
+ return (React__default.createElement("div", { className: `${styles$7.scene} ${lookStyles[look]} ${typoStyles.normal} ${scrollbarStyles.container}` }, children));
31149
31103
  }
31150
31104
 
31151
- var reactIs_development = {};
31152
-
31153
- /** @license React v16.13.1
31154
- * react-is.development.js
31155
- *
31156
- * Copyright (c) Facebook, Inc. and its affiliates.
31157
- *
31158
- * This source code is licensed under the MIT license found in the
31159
- * LICENSE file in the root directory of this source tree.
31160
- */
31161
-
31162
- var hasRequiredReactIs_development;
31163
-
31164
- function requireReactIs_development () {
31165
- if (hasRequiredReactIs_development) return reactIs_development;
31166
- hasRequiredReactIs_development = 1;
31167
-
31168
-
31169
-
31170
- if (process.env.NODE_ENV !== "production") {
31171
- (function() {
31172
-
31173
- // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
31174
- // nor polyfill, then a plain number is used for performance.
31175
- var hasSymbol = typeof Symbol === 'function' && Symbol.for;
31176
- var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
31177
- var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
31178
- var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
31179
- var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
31180
- var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
31181
- var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
31182
- var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
31183
- // (unstable) APIs that have been removed. Can we remove the symbols?
31184
-
31185
- var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
31186
- var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
31187
- var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
31188
- var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
31189
- var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
31190
- var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
31191
- var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
31192
- var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
31193
- var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
31194
- var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
31195
- var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
31196
-
31197
- function isValidElementType(type) {
31198
- return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
31199
- type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
31200
- }
31201
-
31202
- function typeOf(object) {
31203
- if (typeof object === 'object' && object !== null) {
31204
- var $$typeof = object.$$typeof;
31205
-
31206
- switch ($$typeof) {
31207
- case REACT_ELEMENT_TYPE:
31208
- var type = object.type;
31209
-
31210
- switch (type) {
31211
- case REACT_ASYNC_MODE_TYPE:
31212
- case REACT_CONCURRENT_MODE_TYPE:
31213
- case REACT_FRAGMENT_TYPE:
31214
- case REACT_PROFILER_TYPE:
31215
- case REACT_STRICT_MODE_TYPE:
31216
- case REACT_SUSPENSE_TYPE:
31217
- return type;
31218
-
31219
- default:
31220
- var $$typeofType = type && type.$$typeof;
31221
-
31222
- switch ($$typeofType) {
31223
- case REACT_CONTEXT_TYPE:
31224
- case REACT_FORWARD_REF_TYPE:
31225
- case REACT_LAZY_TYPE:
31226
- case REACT_MEMO_TYPE:
31227
- case REACT_PROVIDER_TYPE:
31228
- return $$typeofType;
31229
-
31230
- default:
31231
- return $$typeof;
31232
- }
31233
-
31234
- }
31235
-
31236
- case REACT_PORTAL_TYPE:
31237
- return $$typeof;
31238
- }
31239
- }
31240
-
31241
- return undefined;
31242
- } // AsyncMode is deprecated along with isAsyncMode
31243
-
31244
- var AsyncMode = REACT_ASYNC_MODE_TYPE;
31245
- var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
31246
- var ContextConsumer = REACT_CONTEXT_TYPE;
31247
- var ContextProvider = REACT_PROVIDER_TYPE;
31248
- var Element = REACT_ELEMENT_TYPE;
31249
- var ForwardRef = REACT_FORWARD_REF_TYPE;
31250
- var Fragment = REACT_FRAGMENT_TYPE;
31251
- var Lazy = REACT_LAZY_TYPE;
31252
- var Memo = REACT_MEMO_TYPE;
31253
- var Portal = REACT_PORTAL_TYPE;
31254
- var Profiler = REACT_PROFILER_TYPE;
31255
- var StrictMode = REACT_STRICT_MODE_TYPE;
31256
- var Suspense = REACT_SUSPENSE_TYPE;
31257
- var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
31258
-
31259
- function isAsyncMode(object) {
31260
- {
31261
- if (!hasWarnedAboutDeprecatedIsAsyncMode) {
31262
- hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
31263
-
31264
- console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
31265
- }
31266
- }
31267
-
31268
- return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
31269
- }
31270
- function isConcurrentMode(object) {
31271
- return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
31272
- }
31273
- function isContextConsumer(object) {
31274
- return typeOf(object) === REACT_CONTEXT_TYPE;
31275
- }
31276
- function isContextProvider(object) {
31277
- return typeOf(object) === REACT_PROVIDER_TYPE;
31278
- }
31279
- function isElement(object) {
31280
- return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
31281
- }
31282
- function isForwardRef(object) {
31283
- return typeOf(object) === REACT_FORWARD_REF_TYPE;
31284
- }
31285
- function isFragment(object) {
31286
- return typeOf(object) === REACT_FRAGMENT_TYPE;
31287
- }
31288
- function isLazy(object) {
31289
- return typeOf(object) === REACT_LAZY_TYPE;
31290
- }
31291
- function isMemo(object) {
31292
- return typeOf(object) === REACT_MEMO_TYPE;
31293
- }
31294
- function isPortal(object) {
31295
- return typeOf(object) === REACT_PORTAL_TYPE;
31296
- }
31297
- function isProfiler(object) {
31298
- return typeOf(object) === REACT_PROFILER_TYPE;
31299
- }
31300
- function isStrictMode(object) {
31301
- return typeOf(object) === REACT_STRICT_MODE_TYPE;
31302
- }
31303
- function isSuspense(object) {
31304
- return typeOf(object) === REACT_SUSPENSE_TYPE;
31305
- }
31105
+ var styles$6 = {"gridExpandTrick":"GridExpandTrick-module_gridExpandTrick__10Eg5"};
31306
31106
 
31307
- reactIs_development.AsyncMode = AsyncMode;
31308
- reactIs_development.ConcurrentMode = ConcurrentMode;
31309
- reactIs_development.ContextConsumer = ContextConsumer;
31310
- reactIs_development.ContextProvider = ContextProvider;
31311
- reactIs_development.Element = Element;
31312
- reactIs_development.ForwardRef = ForwardRef;
31313
- reactIs_development.Fragment = Fragment;
31314
- reactIs_development.Lazy = Lazy;
31315
- reactIs_development.Memo = Memo;
31316
- reactIs_development.Portal = Portal;
31317
- reactIs_development.Profiler = Profiler;
31318
- reactIs_development.StrictMode = StrictMode;
31319
- reactIs_development.Suspense = Suspense;
31320
- reactIs_development.isAsyncMode = isAsyncMode;
31321
- reactIs_development.isConcurrentMode = isConcurrentMode;
31322
- reactIs_development.isContextConsumer = isContextConsumer;
31323
- reactIs_development.isContextProvider = isContextProvider;
31324
- reactIs_development.isElement = isElement;
31325
- reactIs_development.isForwardRef = isForwardRef;
31326
- reactIs_development.isFragment = isFragment;
31327
- reactIs_development.isLazy = isLazy;
31328
- reactIs_development.isMemo = isMemo;
31329
- reactIs_development.isPortal = isPortal;
31330
- reactIs_development.isProfiler = isProfiler;
31331
- reactIs_development.isStrictMode = isStrictMode;
31332
- reactIs_development.isSuspense = isSuspense;
31333
- reactIs_development.isValidElementType = isValidElementType;
31334
- reactIs_development.typeOf = typeOf;
31335
- })();
31336
- }
31337
- return reactIs_development;
31107
+ function GridExpandTrick({ children, }) {
31108
+ return React__default.createElement("span", { className: styles$6.gridExpandTrick }, children);
31338
31109
  }
31339
31110
 
31340
- var hasRequiredReactIs;
31341
-
31342
- function requireReactIs () {
31343
- if (hasRequiredReactIs) return reactIs.exports;
31344
- hasRequiredReactIs = 1;
31111
+ var styles$5 = {"scrollContainer":"ScrollContainer-module_scrollContainer__J82cj"};
31345
31112
 
31346
- if (process.env.NODE_ENV === 'production') {
31347
- reactIs.exports = requireReactIs_production_min();
31348
- } else {
31349
- reactIs.exports = requireReactIs_development();
31350
- }
31351
- return reactIs.exports;
31113
+ function ScrollContainer({ children, }) {
31114
+ return React__default.createElement("span", { className: styles$5.scrollContainer }, children);
31352
31115
  }
31353
31116
 
31354
- /*
31355
- object-assign
31356
- (c) Sindre Sorhus
31357
- @license MIT
31358
- */
31359
-
31360
- var objectAssign;
31361
- var hasRequiredObjectAssign;
31362
-
31363
- function requireObjectAssign () {
31364
- if (hasRequiredObjectAssign) return objectAssign;
31365
- hasRequiredObjectAssign = 1;
31366
- /* eslint-disable no-unused-vars */
31367
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
31368
- var hasOwnProperty = Object.prototype.hasOwnProperty;
31369
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
31370
-
31371
- function toObject(val) {
31372
- if (val === null || val === undefined) {
31373
- throw new TypeError('Object.assign cannot be called with null or undefined');
31374
- }
31375
-
31376
- return Object(val);
31377
- }
31378
-
31379
- function shouldUseNative() {
31380
- try {
31381
- if (!Object.assign) {
31382
- return false;
31383
- }
31384
-
31385
- // Detect buggy property enumeration order in older V8 versions.
31386
-
31387
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
31388
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
31389
- test1[5] = 'de';
31390
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
31391
- return false;
31392
- }
31393
-
31394
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
31395
- var test2 = {};
31396
- for (var i = 0; i < 10; i++) {
31397
- test2['_' + String.fromCharCode(i)] = i;
31398
- }
31399
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
31400
- return test2[n];
31401
- });
31402
- if (order2.join('') !== '0123456789') {
31403
- return false;
31404
- }
31405
-
31406
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
31407
- var test3 = {};
31408
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
31409
- test3[letter] = letter;
31410
- });
31411
- if (Object.keys(Object.assign({}, test3)).join('') !==
31412
- 'abcdefghijklmnopqrst') {
31413
- return false;
31414
- }
31415
-
31416
- return true;
31417
- } catch (err) {
31418
- // We don't expect any of the above to throw, but better to be safe.
31419
- return false;
31420
- }
31421
- }
31422
-
31423
- objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
31424
- var from;
31425
- var to = toObject(target);
31426
- var symbols;
31427
-
31428
- for (var s = 1; s < arguments.length; s++) {
31429
- from = Object(arguments[s]);
31430
-
31431
- for (var key in from) {
31432
- if (hasOwnProperty.call(from, key)) {
31433
- to[key] = from[key];
31434
- }
31435
- }
31436
-
31437
- if (getOwnPropertySymbols) {
31438
- symbols = getOwnPropertySymbols(from);
31439
- for (var i = 0; i < symbols.length; i++) {
31440
- if (propIsEnumerable.call(from, symbols[i])) {
31441
- to[symbols[i]] = from[symbols[i]];
31442
- }
31443
- }
31444
- }
31445
- }
31446
-
31447
- return to;
31448
- };
31449
- return objectAssign;
31117
+ function Ui89ModalDialog({ open, size = "medium", children, topCenter, onRequestClose, }) {
31118
+ const dialogClass = useMemo(() => {
31119
+ return [styles$8.dialog, open ? styles$8['dialog--open'] : ''].join(" ");
31120
+ }, [size, open]);
31121
+ const dialogBoxClass = useMemo(() => {
31122
+ return [styles$8.dialogBox, styles$8[`dialogBox--size-${size}`]].join(" ");
31123
+ }, [size, open]);
31124
+ function onClickBackdrop() {
31125
+ if (onRequestClose !== undefined) {
31126
+ onRequestClose();
31127
+ }
31128
+ }
31129
+ return reactDomExports.createPortal(React__default.createElement("div", { className: dialogClass, role: "dialog" },
31130
+ React__default.createElement("div", { className: styles$8.dialogBackdrop, role: "presentation", onClick: onClickBackdrop }),
31131
+ React__default.createElement("div", { className: dialogBoxClass },
31132
+ React__default.createElement("div", { className: styles$8.spacer }),
31133
+ React__default.createElement(HoverShadow, null,
31134
+ React__default.createElement(GridExpandTrick, null,
31135
+ React__default.createElement(Ui89Scene, { look: "side" },
31136
+ React__default.createElement(Ui89Card, { topCenter: topCenter },
31137
+ React__default.createElement(ScrollContainer, null, children))))))), document.body);
31450
31138
  }
31451
31139
 
31452
- /**
31453
- * Copyright (c) 2013-present, Facebook, Inc.
31454
- *
31455
- * This source code is licensed under the MIT license found in the
31456
- * LICENSE file in the root directory of this source tree.
31457
- */
31458
-
31459
- var ReactPropTypesSecret_1;
31460
- var hasRequiredReactPropTypesSecret;
31461
-
31462
- function requireReactPropTypesSecret () {
31463
- if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
31464
- hasRequiredReactPropTypesSecret = 1;
31140
+ var _path, _path2;
31141
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
31142
+ const SvgShortcut = props => /*#__PURE__*/React.createElement("svg", _extends({
31143
+ xmlns: "http://www.w3.org/2000/svg",
31144
+ width: 100,
31145
+ height: 100
31146
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
31147
+ stroke: "#000",
31148
+ strokeWidth: 15,
31149
+ d: "M80 80 20 20"
31150
+ })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
31151
+ stroke: "#000",
31152
+ strokeLinecap: "round",
31153
+ strokeWidth: 15,
31154
+ d: "M20 20h30M20 20v30"
31155
+ })));
31465
31156
 
31466
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
31157
+ var styles$4 = {"container":"Ui89Shortcut-module_container__L07CL","image":"Ui89Shortcut-module_image__f4Hsg","shortcutIcon":"Ui89Shortcut-module_shortcutIcon__SjZkr"};
31467
31158
 
31468
- ReactPropTypesSecret_1 = ReactPropTypesSecret;
31469
- return ReactPropTypesSecret_1;
31159
+ function Ui89Shortcut({ imageUrl, label, onClick = () => { }, }) {
31160
+ function onNativeClick() {
31161
+ onClick();
31162
+ }
31163
+ return (React__default.createElement("div", { className: styles$4.container },
31164
+ React__default.createElement("img", { className: styles$4.image, src: imageUrl, onClick: onNativeClick }),
31165
+ React__default.createElement(SvgShortcut, { className: styles$4.shortcutIcon, width: 16, height: 16 }),
31166
+ React__default.createElement("div", { className: `${typoStyles.smallBold}` }, label)));
31470
31167
  }
31471
31168
 
31472
- var has;
31473
- var hasRequiredHas;
31474
-
31475
- function requireHas () {
31476
- if (hasRequiredHas) return has;
31477
- hasRequiredHas = 1;
31478
- has = Function.call.bind(Object.prototype.hasOwnProperty);
31479
- return has;
31169
+ function Ui89SpaceVertical({ gap = 1 }) {
31170
+ const style = {
31171
+ paddingTop: `calc(var(--ui89-safe-space) * ${gap})`,
31172
+ };
31173
+ return React__default.createElement("div", { style: style });
31480
31174
  }
31481
31175
 
31482
- /**
31483
- * Copyright (c) 2013-present, Facebook, Inc.
31484
- *
31485
- * This source code is licensed under the MIT license found in the
31486
- * LICENSE file in the root directory of this source tree.
31487
- */
31488
-
31489
- var checkPropTypes_1;
31490
- var hasRequiredCheckPropTypes;
31491
-
31492
- function requireCheckPropTypes () {
31493
- if (hasRequiredCheckPropTypes) return checkPropTypes_1;
31494
- hasRequiredCheckPropTypes = 1;
31495
-
31496
- var printWarning = function() {};
31497
-
31498
- if (process.env.NODE_ENV !== 'production') {
31499
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
31500
- var loggedTypeFailures = {};
31501
- var has = /*@__PURE__*/ requireHas();
31502
-
31503
- printWarning = function(text) {
31504
- var message = 'Warning: ' + text;
31505
- if (typeof console !== 'undefined') {
31506
- console.error(message);
31507
- }
31508
- try {
31509
- // --- Welcome to debugging React ---
31510
- // This error was thrown as a convenience so that you can use this stack
31511
- // to find the callsite that caused this warning to fire.
31512
- throw new Error(message);
31513
- } catch (x) { /**/ }
31514
- };
31515
- }
31516
-
31517
- /**
31518
- * Assert that the values match with the type specs.
31519
- * Error messages are memorized and will only be shown once.
31520
- *
31521
- * @param {object} typeSpecs Map of name to a ReactPropType
31522
- * @param {object} values Runtime values that need to be type-checked
31523
- * @param {string} location e.g. "prop", "context", "child context"
31524
- * @param {string} componentName Name of the component for error messages.
31525
- * @param {?Function} getStack Returns the component stack.
31526
- * @private
31527
- */
31528
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
31529
- if (process.env.NODE_ENV !== 'production') {
31530
- for (var typeSpecName in typeSpecs) {
31531
- if (has(typeSpecs, typeSpecName)) {
31532
- var error;
31533
- // Prop type validation may throw. In case they do, we don't want to
31534
- // fail the render phase where it didn't fail before. So we log it.
31535
- // After these have been cleaned up, we'll let them throw.
31536
- try {
31537
- // This is intentionally an invariant that gets caught. It's the same
31538
- // behavior as without this statement except with a better message.
31539
- if (typeof typeSpecs[typeSpecName] !== 'function') {
31540
- var err = Error(
31541
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
31542
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
31543
- 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
31544
- );
31545
- err.name = 'Invariant Violation';
31546
- throw err;
31547
- }
31548
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
31549
- } catch (ex) {
31550
- error = ex;
31551
- }
31552
- if (error && !(error instanceof Error)) {
31553
- printWarning(
31554
- (componentName || 'React class') + ': type specification of ' +
31555
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
31556
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
31557
- 'You may have forgotten to pass an argument to the type checker ' +
31558
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
31559
- 'shape all require an argument).'
31560
- );
31561
- }
31562
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
31563
- // Only monitor this failure once because there tends to be a lot of the
31564
- // same error.
31565
- loggedTypeFailures[error.message] = true;
31566
-
31567
- var stack = getStack ? getStack() : '';
31568
-
31569
- printWarning(
31570
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
31571
- );
31572
- }
31573
- }
31574
- }
31575
- }
31576
- }
31577
-
31578
- /**
31579
- * Resets warning cache when testing.
31580
- *
31581
- * @private
31582
- */
31583
- checkPropTypes.resetWarningCache = function() {
31584
- if (process.env.NODE_ENV !== 'production') {
31585
- loggedTypeFailures = {};
31586
- }
31587
- };
31176
+ var styles$3 = {"navigation":"Ui89Tabs-module_navigation__y1WSG","navigationItem":"Ui89Tabs-module_navigationItem__keX-1","navigationItemSelected":"Ui89Tabs-module_navigationItemSelected__R7dba"};
31588
31177
 
31589
- checkPropTypes_1 = checkPropTypes;
31590
- return checkPropTypes_1;
31178
+ function Ui89Tabs({ selected, onChange = () => { }, items = [], }) {
31179
+ function handleOnChange(value) {
31180
+ onChange(value);
31181
+ }
31182
+ return (React__default.createElement("div", { className: styles$3.navigation }, items.map((item) => (React__default.createElement("div", { className: [
31183
+ styles$3.navigationItem,
31184
+ typoStyles.smallBold,
31185
+ selected === item.value ? styles$3.navigationItemSelected : "",
31186
+ ].join(" "), key: item.value, onClick: () => handleOnChange(item.value) }, item.label)))));
31591
31187
  }
31592
31188
 
31593
- /**
31594
- * Copyright (c) 2013-present, Facebook, Inc.
31595
- *
31596
- * This source code is licensed under the MIT license found in the
31597
- * LICENSE file in the root directory of this source tree.
31598
- */
31599
-
31600
- var factoryWithTypeCheckers;
31601
- var hasRequiredFactoryWithTypeCheckers;
31602
-
31603
- function requireFactoryWithTypeCheckers () {
31604
- if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
31605
- hasRequiredFactoryWithTypeCheckers = 1;
31606
-
31607
- var ReactIs = requireReactIs();
31608
- var assign = requireObjectAssign();
31609
-
31610
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
31611
- var has = /*@__PURE__*/ requireHas();
31612
- var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes();
31613
-
31614
- var printWarning = function() {};
31615
-
31616
- if (process.env.NODE_ENV !== 'production') {
31617
- printWarning = function(text) {
31618
- var message = 'Warning: ' + text;
31619
- if (typeof console !== 'undefined') {
31620
- console.error(message);
31621
- }
31622
- try {
31623
- // --- Welcome to debugging React ---
31624
- // This error was thrown as a convenience so that you can use this stack
31625
- // to find the callsite that caused this warning to fire.
31626
- throw new Error(message);
31627
- } catch (x) {}
31628
- };
31629
- }
31189
+ function Ui89TabbedCard({ selected, onChange = () => { }, items = [], }) {
31190
+ const selectedItem = useMemo(() => {
31191
+ return items.find((item) => item.value === selected) ?? null;
31192
+ }, [selected, items]);
31193
+ const render = useMemo(() => {
31194
+ return selectedItem !== null ? selectedItem.render : () => React__default.createElement(React__default.Fragment, null);
31195
+ }, [selectedItem]);
31196
+ const renderKey = useMemo(() => {
31197
+ return selectedItem !== null ? selectedItem.value : undefined;
31198
+ }, [selectedItem]);
31199
+ return (React__default.createElement(Ui89Card, { topCenter: React__default.createElement(Ui89Tabs, { selected: selected, items: items, onChange: onChange }) },
31200
+ React__default.createElement(React__default.Fragment, { key: renderKey }, render())));
31201
+ }
31630
31202
 
31631
- function emptyFunctionThatReturnsNull() {
31632
- return null;
31633
- }
31203
+ var style = {"container":"Ui89TagBox-module_container__2GXMj"};
31634
31204
 
31635
- factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
31636
- /* global Symbol */
31637
- var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
31638
- var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
31205
+ function Ui89TagBox({ theme, children, }) {
31206
+ return (React__default.createElement("div", { className: `${style.container} ${typoStyles.special} ${chosenThemeStyles[theme]}` }, children));
31207
+ }
31639
31208
 
31640
- /**
31641
- * Returns the iterator method function contained on the iterable object.
31642
- *
31643
- * Be sure to invoke the function with the iterable as context:
31644
- *
31645
- * var iteratorFn = getIteratorFn(myIterable);
31646
- * if (iteratorFn) {
31647
- * var iterator = iteratorFn.call(myIterable);
31648
- * ...
31649
- * }
31650
- *
31651
- * @param {?object} maybeIterable
31652
- * @return {?function}
31653
- */
31654
- function getIteratorFn(maybeIterable) {
31655
- var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
31656
- if (typeof iteratorFn === 'function') {
31657
- return iteratorFn;
31658
- }
31659
- }
31209
+ var styles$2 = {"container":"Ui89TitleBox-module_container__M-b7J","inside":"Ui89TitleBox-module_inside__GWTlP"};
31660
31210
 
31661
- /**
31662
- * Collection of methods that allow declaration and validation of props that are
31663
- * supplied to React components. Example usage:
31664
- *
31665
- * var Props = require('ReactPropTypes');
31666
- * var MyArticle = React.createClass({
31667
- * propTypes: {
31668
- * // An optional string prop named "description".
31669
- * description: Props.string,
31670
- *
31671
- * // A required enum prop named "category".
31672
- * category: Props.oneOf(['News','Photos']).isRequired,
31673
- *
31674
- * // A prop named "dialog" that requires an instance of Dialog.
31675
- * dialog: Props.instanceOf(Dialog).isRequired
31676
- * },
31677
- * render: function() { ... }
31678
- * });
31679
- *
31680
- * A more formal specification of how these methods are used:
31681
- *
31682
- * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
31683
- * decl := ReactPropTypes.{type}(.isRequired)?
31684
- *
31685
- * Each and every declaration produces a function with the same signature. This
31686
- * allows the creation of custom validation functions. For example:
31687
- *
31688
- * var MyLink = React.createClass({
31689
- * propTypes: {
31690
- * // An optional string or URI prop named "href".
31691
- * href: function(props, propName, componentName) {
31692
- * var propValue = props[propName];
31693
- * if (propValue != null && typeof propValue !== 'string' &&
31694
- * !(propValue instanceof URI)) {
31695
- * return new Error(
31696
- * 'Expected a string or an URI for ' + propName + ' in ' +
31697
- * componentName
31698
- * );
31699
- * }
31700
- * }
31701
- * },
31702
- * render: function() {...}
31703
- * });
31704
- *
31705
- * @internal
31706
- */
31211
+ var textStyles = {"unbreakable":"text-module_unbreakable__3eDe3","ellipsis":"text-module_ellipsis__3-f-B","singleLine":"text-module_singleLine__X6pYL"};
31707
31212
 
31708
- var ANONYMOUS = '<<anonymous>>';
31709
-
31710
- // Important!
31711
- // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
31712
- var ReactPropTypes = {
31713
- array: createPrimitiveTypeChecker('array'),
31714
- bigint: createPrimitiveTypeChecker('bigint'),
31715
- bool: createPrimitiveTypeChecker('boolean'),
31716
- func: createPrimitiveTypeChecker('function'),
31717
- number: createPrimitiveTypeChecker('number'),
31718
- object: createPrimitiveTypeChecker('object'),
31719
- string: createPrimitiveTypeChecker('string'),
31720
- symbol: createPrimitiveTypeChecker('symbol'),
31721
-
31722
- any: createAnyTypeChecker(),
31723
- arrayOf: createArrayOfTypeChecker,
31724
- element: createElementTypeChecker(),
31725
- elementType: createElementTypeTypeChecker(),
31726
- instanceOf: createInstanceTypeChecker,
31727
- node: createNodeChecker(),
31728
- objectOf: createObjectOfTypeChecker,
31729
- oneOf: createEnumTypeChecker,
31730
- oneOfType: createUnionTypeChecker,
31731
- shape: createShapeTypeChecker,
31732
- exact: createStrictShapeTypeChecker,
31733
- };
31213
+ function Ui89TitleBox({ children }) {
31214
+ return (React__default.createElement("div", { className: `${styles$2.container} ${typoStyles.special}` },
31215
+ React__default.createElement("div", { className: `${styles$2.inside} ${textStyles.singleLine}` }, children)));
31216
+ }
31734
31217
 
31735
- /**
31736
- * inlined Object.is polyfill to avoid requiring consumers ship their own
31737
- * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
31738
- */
31739
- /*eslint-disable no-self-compare*/
31740
- function is(x, y) {
31741
- // SameValue algorithm
31742
- if (x === y) {
31743
- // Steps 1-5, 7-10
31744
- // Steps 6.b-6.e: +0 != -0
31745
- return x !== 0 || 1 / x === 1 / y;
31746
- } else {
31747
- // Step 6.a: NaN == NaN
31748
- return x !== x && y !== y;
31749
- }
31750
- }
31751
- /*eslint-enable no-self-compare*/
31752
-
31753
- /**
31754
- * We use an Error-like object for backward compatibility as people may call
31755
- * PropTypes directly and inspect their output. However, we don't use real
31756
- * Errors anymore. We don't inspect their stack anyway, and creating them
31757
- * is prohibitively expensive if they are created too often, such as what
31758
- * happens in oneOfType() for any type before the one that matched.
31759
- */
31760
- function PropTypeError(message, data) {
31761
- this.message = message;
31762
- this.data = data && typeof data === 'object' ? data: {};
31763
- this.stack = '';
31764
- }
31765
- // Make `instanceof Error` still work for returned errors.
31766
- PropTypeError.prototype = Error.prototype;
31767
-
31768
- function createChainableTypeChecker(validate) {
31769
- if (process.env.NODE_ENV !== 'production') {
31770
- var manualPropTypeCallCache = {};
31771
- var manualPropTypeWarningCount = 0;
31772
- }
31773
- function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
31774
- componentName = componentName || ANONYMOUS;
31775
- propFullName = propFullName || propName;
31776
-
31777
- if (secret !== ReactPropTypesSecret) {
31778
- if (throwOnDirectAccess) {
31779
- // New behavior only for users of `prop-types` package
31780
- var err = new Error(
31781
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
31782
- 'Use `PropTypes.checkPropTypes()` to call them. ' +
31783
- 'Read more at http://fb.me/use-check-prop-types'
31784
- );
31785
- err.name = 'Invariant Violation';
31786
- throw err;
31787
- } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
31788
- // Old behavior for people using React.PropTypes
31789
- var cacheKey = componentName + ':' + propName;
31790
- if (
31791
- !manualPropTypeCallCache[cacheKey] &&
31792
- // Avoid spamming the console because they are often not actionable except for lib authors
31793
- manualPropTypeWarningCount < 3
31794
- ) {
31795
- printWarning(
31796
- 'You are manually calling a React.PropTypes validation ' +
31797
- 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
31798
- 'and will throw in the standalone `prop-types` package. ' +
31799
- 'You may be seeing this warning due to a third-party PropTypes ' +
31800
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
31801
- );
31802
- manualPropTypeCallCache[cacheKey] = true;
31803
- manualPropTypeWarningCount++;
31804
- }
31805
- }
31806
- }
31807
- if (props[propName] == null) {
31808
- if (isRequired) {
31809
- if (props[propName] === null) {
31810
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
31811
- }
31812
- return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
31813
- }
31814
- return null;
31815
- } else {
31816
- return validate(props, propName, componentName, location, propFullName);
31817
- }
31818
- }
31819
-
31820
- var chainedCheckType = checkType.bind(null, false);
31821
- chainedCheckType.isRequired = checkType.bind(null, true);
31822
-
31823
- return chainedCheckType;
31824
- }
31825
-
31826
- function createPrimitiveTypeChecker(expectedType) {
31827
- function validate(props, propName, componentName, location, propFullName, secret) {
31828
- var propValue = props[propName];
31829
- var propType = getPropType(propValue);
31830
- if (propType !== expectedType) {
31831
- // `propValue` being instance of, say, date/regexp, pass the 'object'
31832
- // check, but we can offer a more precise error message here rather than
31833
- // 'of type `object`'.
31834
- var preciseType = getPreciseType(propValue);
31835
-
31836
- return new PropTypeError(
31837
- 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
31838
- {expectedType: expectedType}
31839
- );
31840
- }
31841
- return null;
31842
- }
31843
- return createChainableTypeChecker(validate);
31844
- }
31845
-
31846
- function createAnyTypeChecker() {
31847
- return createChainableTypeChecker(emptyFunctionThatReturnsNull);
31848
- }
31849
-
31850
- function createArrayOfTypeChecker(typeChecker) {
31851
- function validate(props, propName, componentName, location, propFullName) {
31852
- if (typeof typeChecker !== 'function') {
31853
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
31854
- }
31855
- var propValue = props[propName];
31856
- if (!Array.isArray(propValue)) {
31857
- var propType = getPropType(propValue);
31858
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
31859
- }
31860
- for (var i = 0; i < propValue.length; i++) {
31861
- var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
31862
- if (error instanceof Error) {
31863
- return error;
31864
- }
31865
- }
31866
- return null;
31867
- }
31868
- return createChainableTypeChecker(validate);
31869
- }
31870
-
31871
- function createElementTypeChecker() {
31872
- function validate(props, propName, componentName, location, propFullName) {
31873
- var propValue = props[propName];
31874
- if (!isValidElement(propValue)) {
31875
- var propType = getPropType(propValue);
31876
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
31877
- }
31878
- return null;
31879
- }
31880
- return createChainableTypeChecker(validate);
31881
- }
31882
-
31883
- function createElementTypeTypeChecker() {
31884
- function validate(props, propName, componentName, location, propFullName) {
31885
- var propValue = props[propName];
31886
- if (!ReactIs.isValidElementType(propValue)) {
31887
- var propType = getPropType(propValue);
31888
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
31889
- }
31890
- return null;
31891
- }
31892
- return createChainableTypeChecker(validate);
31893
- }
31894
-
31895
- function createInstanceTypeChecker(expectedClass) {
31896
- function validate(props, propName, componentName, location, propFullName) {
31897
- if (!(props[propName] instanceof expectedClass)) {
31898
- var expectedClassName = expectedClass.name || ANONYMOUS;
31899
- var actualClassName = getClassName(props[propName]);
31900
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
31901
- }
31902
- return null;
31903
- }
31904
- return createChainableTypeChecker(validate);
31905
- }
31906
-
31907
- function createEnumTypeChecker(expectedValues) {
31908
- if (!Array.isArray(expectedValues)) {
31909
- if (process.env.NODE_ENV !== 'production') {
31910
- if (arguments.length > 1) {
31911
- printWarning(
31912
- 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
31913
- 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
31914
- );
31915
- } else {
31916
- printWarning('Invalid argument supplied to oneOf, expected an array.');
31917
- }
31918
- }
31919
- return emptyFunctionThatReturnsNull;
31920
- }
31921
-
31922
- function validate(props, propName, componentName, location, propFullName) {
31923
- var propValue = props[propName];
31924
- for (var i = 0; i < expectedValues.length; i++) {
31925
- if (is(propValue, expectedValues[i])) {
31926
- return null;
31927
- }
31928
- }
31929
-
31930
- var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
31931
- var type = getPreciseType(value);
31932
- if (type === 'symbol') {
31933
- return String(value);
31934
- }
31935
- return value;
31936
- });
31937
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
31938
- }
31939
- return createChainableTypeChecker(validate);
31940
- }
31941
-
31942
- function createObjectOfTypeChecker(typeChecker) {
31943
- function validate(props, propName, componentName, location, propFullName) {
31944
- if (typeof typeChecker !== 'function') {
31945
- return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
31946
- }
31947
- var propValue = props[propName];
31948
- var propType = getPropType(propValue);
31949
- if (propType !== 'object') {
31950
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
31951
- }
31952
- for (var key in propValue) {
31953
- if (has(propValue, key)) {
31954
- var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
31955
- if (error instanceof Error) {
31956
- return error;
31957
- }
31958
- }
31959
- }
31960
- return null;
31961
- }
31962
- return createChainableTypeChecker(validate);
31963
- }
31964
-
31965
- function createUnionTypeChecker(arrayOfTypeCheckers) {
31966
- if (!Array.isArray(arrayOfTypeCheckers)) {
31967
- process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
31968
- return emptyFunctionThatReturnsNull;
31969
- }
31970
-
31971
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
31972
- var checker = arrayOfTypeCheckers[i];
31973
- if (typeof checker !== 'function') {
31974
- printWarning(
31975
- 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
31976
- 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
31977
- );
31978
- return emptyFunctionThatReturnsNull;
31979
- }
31980
- }
31981
-
31982
- function validate(props, propName, componentName, location, propFullName) {
31983
- var expectedTypes = [];
31984
- for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
31985
- var checker = arrayOfTypeCheckers[i];
31986
- var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
31987
- if (checkerResult == null) {
31988
- return null;
31989
- }
31990
- if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
31991
- expectedTypes.push(checkerResult.data.expectedType);
31992
- }
31993
- }
31994
- var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
31995
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
31996
- }
31997
- return createChainableTypeChecker(validate);
31998
- }
31999
-
32000
- function createNodeChecker() {
32001
- function validate(props, propName, componentName, location, propFullName) {
32002
- if (!isNode(props[propName])) {
32003
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
32004
- }
32005
- return null;
32006
- }
32007
- return createChainableTypeChecker(validate);
32008
- }
32009
-
32010
- function invalidValidatorError(componentName, location, propFullName, key, type) {
32011
- return new PropTypeError(
32012
- (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
32013
- 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
32014
- );
32015
- }
32016
-
32017
- function createShapeTypeChecker(shapeTypes) {
32018
- function validate(props, propName, componentName, location, propFullName) {
32019
- var propValue = props[propName];
32020
- var propType = getPropType(propValue);
32021
- if (propType !== 'object') {
32022
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
32023
- }
32024
- for (var key in shapeTypes) {
32025
- var checker = shapeTypes[key];
32026
- if (typeof checker !== 'function') {
32027
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
32028
- }
32029
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
32030
- if (error) {
32031
- return error;
32032
- }
32033
- }
32034
- return null;
32035
- }
32036
- return createChainableTypeChecker(validate);
32037
- }
32038
-
32039
- function createStrictShapeTypeChecker(shapeTypes) {
32040
- function validate(props, propName, componentName, location, propFullName) {
32041
- var propValue = props[propName];
32042
- var propType = getPropType(propValue);
32043
- if (propType !== 'object') {
32044
- return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
32045
- }
32046
- // We need to check all keys in case some are required but missing from props.
32047
- var allKeys = assign({}, props[propName], shapeTypes);
32048
- for (var key in allKeys) {
32049
- var checker = shapeTypes[key];
32050
- if (has(shapeTypes, key) && typeof checker !== 'function') {
32051
- return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
32052
- }
32053
- if (!checker) {
32054
- return new PropTypeError(
32055
- 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
32056
- '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
32057
- '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
32058
- );
32059
- }
32060
- var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
32061
- if (error) {
32062
- return error;
32063
- }
32064
- }
32065
- return null;
32066
- }
32067
-
32068
- return createChainableTypeChecker(validate);
32069
- }
32070
-
32071
- function isNode(propValue) {
32072
- switch (typeof propValue) {
32073
- case 'number':
32074
- case 'string':
32075
- case 'undefined':
32076
- return true;
32077
- case 'boolean':
32078
- return !propValue;
32079
- case 'object':
32080
- if (Array.isArray(propValue)) {
32081
- return propValue.every(isNode);
32082
- }
32083
- if (propValue === null || isValidElement(propValue)) {
32084
- return true;
32085
- }
32086
-
32087
- var iteratorFn = getIteratorFn(propValue);
32088
- if (iteratorFn) {
32089
- var iterator = iteratorFn.call(propValue);
32090
- var step;
32091
- if (iteratorFn !== propValue.entries) {
32092
- while (!(step = iterator.next()).done) {
32093
- if (!isNode(step.value)) {
32094
- return false;
32095
- }
32096
- }
32097
- } else {
32098
- // Iterator will provide entry [k,v] tuples rather than values.
32099
- while (!(step = iterator.next()).done) {
32100
- var entry = step.value;
32101
- if (entry) {
32102
- if (!isNode(entry[1])) {
32103
- return false;
32104
- }
32105
- }
32106
- }
32107
- }
32108
- } else {
32109
- return false;
32110
- }
32111
-
32112
- return true;
32113
- default:
32114
- return false;
32115
- }
32116
- }
32117
-
32118
- function isSymbol(propType, propValue) {
32119
- // Native Symbol.
32120
- if (propType === 'symbol') {
32121
- return true;
32122
- }
32123
-
32124
- // falsy value can't be a Symbol
32125
- if (!propValue) {
32126
- return false;
32127
- }
32128
-
32129
- // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
32130
- if (propValue['@@toStringTag'] === 'Symbol') {
32131
- return true;
32132
- }
32133
-
32134
- // Fallback for non-spec compliant Symbols which are polyfilled.
32135
- if (typeof Symbol === 'function' && propValue instanceof Symbol) {
32136
- return true;
32137
- }
32138
-
32139
- return false;
32140
- }
32141
-
32142
- // Equivalent of `typeof` but with special handling for array and regexp.
32143
- function getPropType(propValue) {
32144
- var propType = typeof propValue;
32145
- if (Array.isArray(propValue)) {
32146
- return 'array';
32147
- }
32148
- if (propValue instanceof RegExp) {
32149
- // Old webkits (at least until Android 4.0) return 'function' rather than
32150
- // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
32151
- // passes PropTypes.object.
32152
- return 'object';
32153
- }
32154
- if (isSymbol(propType, propValue)) {
32155
- return 'symbol';
32156
- }
32157
- return propType;
32158
- }
32159
-
32160
- // This handles more types than `getPropType`. Only used for error messages.
32161
- // See `createPrimitiveTypeChecker`.
32162
- function getPreciseType(propValue) {
32163
- if (typeof propValue === 'undefined' || propValue === null) {
32164
- return '' + propValue;
32165
- }
32166
- var propType = getPropType(propValue);
32167
- if (propType === 'object') {
32168
- if (propValue instanceof Date) {
32169
- return 'date';
32170
- } else if (propValue instanceof RegExp) {
32171
- return 'regexp';
32172
- }
32173
- }
32174
- return propType;
32175
- }
32176
-
32177
- // Returns a string that is postfixed to a warning about an invalid type.
32178
- // For example, "undefined" or "of type array"
32179
- function getPostfixForTypeWarning(value) {
32180
- var type = getPreciseType(value);
32181
- switch (type) {
32182
- case 'array':
32183
- case 'object':
32184
- return 'an ' + type;
32185
- case 'boolean':
32186
- case 'date':
32187
- case 'regexp':
32188
- return 'a ' + type;
32189
- default:
32190
- return type;
32191
- }
32192
- }
32193
-
32194
- // Returns class name of the object, if any.
32195
- function getClassName(propValue) {
32196
- if (!propValue.constructor || !propValue.constructor.name) {
32197
- return ANONYMOUS;
32198
- }
32199
- return propValue.constructor.name;
32200
- }
32201
-
32202
- ReactPropTypes.checkPropTypes = checkPropTypes;
32203
- ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
32204
- ReactPropTypes.PropTypes = ReactPropTypes;
32205
-
32206
- return ReactPropTypes;
32207
- };
32208
- return factoryWithTypeCheckers;
32209
- }
32210
-
32211
- /**
32212
- * Copyright (c) 2013-present, Facebook, Inc.
32213
- *
32214
- * This source code is licensed under the MIT license found in the
32215
- * LICENSE file in the root directory of this source tree.
32216
- */
32217
-
32218
- var factoryWithThrowingShims;
32219
- var hasRequiredFactoryWithThrowingShims;
32220
-
32221
- function requireFactoryWithThrowingShims () {
32222
- if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
32223
- hasRequiredFactoryWithThrowingShims = 1;
32224
-
32225
- var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
32226
-
32227
- function emptyFunction() {}
32228
- function emptyFunctionWithReset() {}
32229
- emptyFunctionWithReset.resetWarningCache = emptyFunction;
32230
-
32231
- factoryWithThrowingShims = function() {
32232
- function shim(props, propName, componentName, location, propFullName, secret) {
32233
- if (secret === ReactPropTypesSecret) {
32234
- // It is still safe when called from React.
32235
- return;
32236
- }
32237
- var err = new Error(
32238
- 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
32239
- 'Use PropTypes.checkPropTypes() to call them. ' +
32240
- 'Read more at http://fb.me/use-check-prop-types'
32241
- );
32242
- err.name = 'Invariant Violation';
32243
- throw err;
32244
- } shim.isRequired = shim;
32245
- function getShim() {
32246
- return shim;
32247
- } // Important!
32248
- // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
32249
- var ReactPropTypes = {
32250
- array: shim,
32251
- bigint: shim,
32252
- bool: shim,
32253
- func: shim,
32254
- number: shim,
32255
- object: shim,
32256
- string: shim,
32257
- symbol: shim,
32258
-
32259
- any: shim,
32260
- arrayOf: getShim,
32261
- element: shim,
32262
- elementType: shim,
32263
- instanceOf: getShim,
32264
- node: shim,
32265
- objectOf: getShim,
32266
- oneOf: getShim,
32267
- oneOfType: getShim,
32268
- shape: getShim,
32269
- exact: getShim,
32270
-
32271
- checkPropTypes: emptyFunctionWithReset,
32272
- resetWarningCache: emptyFunction
32273
- };
32274
-
32275
- ReactPropTypes.PropTypes = ReactPropTypes;
32276
-
32277
- return ReactPropTypes;
32278
- };
32279
- return factoryWithThrowingShims;
32280
- }
32281
-
32282
- /**
32283
- * Copyright (c) 2013-present, Facebook, Inc.
32284
- *
32285
- * This source code is licensed under the MIT license found in the
32286
- * LICENSE file in the root directory of this source tree.
32287
- */
32288
-
32289
- var hasRequiredPropTypes;
32290
-
32291
- function requirePropTypes () {
32292
- if (hasRequiredPropTypes) return propTypes.exports;
32293
- hasRequiredPropTypes = 1;
32294
- if (process.env.NODE_ENV !== 'production') {
32295
- var ReactIs = requireReactIs();
32296
-
32297
- // By explicitly using `prop-types` you are opting into new development behavior.
32298
- // http://fb.me/prop-types-in-prod
32299
- var throwOnDirectAccess = true;
32300
- propTypes.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
32301
- } else {
32302
- // By explicitly using `prop-types` you are opting into new production behavior.
32303
- // http://fb.me/prop-types-in-prod
32304
- propTypes.exports = /*@__PURE__*/ requireFactoryWithThrowingShims()();
32305
- }
32306
- return propTypes.exports;
32307
- }
32308
-
32309
- var ModalPortal = {exports: {}};
32310
-
32311
- var focusManager = {};
32312
-
32313
- var tabbable = {exports: {}};
32314
-
32315
- var hasRequiredTabbable;
32316
-
32317
- function requireTabbable () {
32318
- if (hasRequiredTabbable) return tabbable.exports;
32319
- hasRequiredTabbable = 1;
32320
- (function (module, exports) {
32321
-
32322
- Object.defineProperty(exports, "__esModule", {
32323
- value: true
32324
- });
32325
- exports.default = findTabbableDescendants;
32326
- /*!
32327
- * Adapted from jQuery UI core
32328
- *
32329
- * http://jqueryui.com
32330
- *
32331
- * Copyright 2014 jQuery Foundation and other contributors
32332
- * Released under the MIT license.
32333
- * http://jquery.org/license
32334
- *
32335
- * http://api.jqueryui.com/category/ui-core/
32336
- */
32337
-
32338
- var DISPLAY_NONE = "none";
32339
- var DISPLAY_CONTENTS = "contents";
32340
-
32341
- var tabbableNode = /input|select|textarea|button|object|iframe/;
32342
-
32343
- function isNotOverflowing(element, style) {
32344
- return style.getPropertyValue("overflow") !== "visible" ||
32345
- // if 'overflow: visible' set, check if there is actually any overflow
32346
- element.scrollWidth <= 0 && element.scrollHeight <= 0;
32347
- }
32348
-
32349
- function hidesContents(element) {
32350
- var zeroSize = element.offsetWidth <= 0 && element.offsetHeight <= 0;
32351
-
32352
- // If the node is empty, this is good enough
32353
- if (zeroSize && !element.innerHTML) return true;
32354
-
32355
- try {
32356
- // Otherwise we need to check some styles
32357
- var style = window.getComputedStyle(element);
32358
- var displayValue = style.getPropertyValue("display");
32359
- return zeroSize ? displayValue !== DISPLAY_CONTENTS && isNotOverflowing(element, style) : displayValue === DISPLAY_NONE;
32360
- } catch (exception) {
32361
- // eslint-disable-next-line no-console
32362
- console.warn("Failed to inspect element style");
32363
- return false;
32364
- }
32365
- }
32366
-
32367
- function visible(element) {
32368
- var parentElement = element;
32369
- var rootNode = element.getRootNode && element.getRootNode();
32370
- while (parentElement) {
32371
- if (parentElement === document.body) break;
32372
-
32373
- // if we are not hidden yet, skip to checking outside the Web Component
32374
- if (rootNode && parentElement === rootNode) parentElement = rootNode.host.parentNode;
32375
-
32376
- if (hidesContents(parentElement)) return false;
32377
- parentElement = parentElement.parentNode;
32378
- }
32379
- return true;
32380
- }
32381
-
32382
- function focusable(element, isTabIndexNotNaN) {
32383
- var nodeName = element.nodeName.toLowerCase();
32384
- var res = tabbableNode.test(nodeName) && !element.disabled || (nodeName === "a" ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);
32385
- return res && visible(element);
32386
- }
32387
-
32388
- function tabbable(element) {
32389
- var tabIndex = element.getAttribute("tabindex");
32390
- if (tabIndex === null) tabIndex = undefined;
32391
- var isTabIndexNaN = isNaN(tabIndex);
32392
- return (isTabIndexNaN || tabIndex >= 0) && focusable(element, !isTabIndexNaN);
32393
- }
32394
-
32395
- function findTabbableDescendants(element) {
32396
- var descendants = [].slice.call(element.querySelectorAll("*"), 0).reduce(function (finished, el) {
32397
- return finished.concat(!el.shadowRoot ? [el] : findTabbableDescendants(el.shadowRoot));
32398
- }, []);
32399
- return descendants.filter(tabbable);
32400
- }
32401
- module.exports = exports["default"];
32402
- } (tabbable, tabbable.exports));
32403
- return tabbable.exports;
32404
- }
32405
-
32406
- var hasRequiredFocusManager;
32407
-
32408
- function requireFocusManager () {
32409
- if (hasRequiredFocusManager) return focusManager;
32410
- hasRequiredFocusManager = 1;
32411
-
32412
- Object.defineProperty(focusManager, "__esModule", {
32413
- value: true
32414
- });
32415
- focusManager.resetState = resetState;
32416
- focusManager.log = log;
32417
- focusManager.handleBlur = handleBlur;
32418
- focusManager.handleFocus = handleFocus;
32419
- focusManager.markForFocusLater = markForFocusLater;
32420
- focusManager.returnFocus = returnFocus;
32421
- focusManager.popWithoutFocus = popWithoutFocus;
32422
- focusManager.setupScopedFocus = setupScopedFocus;
32423
- focusManager.teardownScopedFocus = teardownScopedFocus;
32424
-
32425
- var _tabbable = requireTabbable();
32426
-
32427
- var _tabbable2 = _interopRequireDefault(_tabbable);
32428
-
32429
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32430
-
32431
- var focusLaterElements = [];
32432
- var modalElement = null;
32433
- var needToFocus = false;
32434
-
32435
- /* eslint-disable no-console */
32436
- /* istanbul ignore next */
32437
- function resetState() {
32438
- focusLaterElements = [];
32439
- }
32440
-
32441
- /* istanbul ignore next */
32442
- function log() {
32443
- if (process.env.NODE_ENV !== "production") {
32444
- console.log("focusManager ----------");
32445
- focusLaterElements.forEach(function (f) {
32446
- var check = f || {};
32447
- console.log(check.nodeName, check.className, check.id);
32448
- });
32449
- console.log("end focusManager ----------");
32450
- }
32451
- }
32452
- /* eslint-enable no-console */
32453
-
32454
- function handleBlur() {
32455
- needToFocus = true;
32456
- }
32457
-
32458
- function handleFocus() {
32459
- if (needToFocus) {
32460
- needToFocus = false;
32461
- if (!modalElement) {
32462
- return;
32463
- }
32464
- // need to see how jQuery shims document.on('focusin') so we don't need the
32465
- // setTimeout, firefox doesn't support focusin, if it did, we could focus
32466
- // the element outside of a setTimeout. Side-effect of this implementation
32467
- // is that the document.body gets focus, and then we focus our element right
32468
- // after, seems fine.
32469
- setTimeout(function () {
32470
- if (modalElement.contains(document.activeElement)) {
32471
- return;
32472
- }
32473
- var el = (0, _tabbable2.default)(modalElement)[0] || modalElement;
32474
- el.focus();
32475
- }, 0);
32476
- }
32477
- }
32478
-
32479
- function markForFocusLater() {
32480
- focusLaterElements.push(document.activeElement);
32481
- }
32482
-
32483
- /* eslint-disable no-console */
32484
- function returnFocus() {
32485
- var preventScroll = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
32486
-
32487
- var toFocus = null;
32488
- try {
32489
- if (focusLaterElements.length !== 0) {
32490
- toFocus = focusLaterElements.pop();
32491
- toFocus.focus({ preventScroll: preventScroll });
32492
- }
32493
- return;
32494
- } catch (e) {
32495
- console.warn(["You tried to return focus to", toFocus, "but it is not in the DOM anymore"].join(" "));
32496
- }
32497
- }
32498
- /* eslint-enable no-console */
32499
-
32500
- function popWithoutFocus() {
32501
- focusLaterElements.length > 0 && focusLaterElements.pop();
32502
- }
32503
-
32504
- function setupScopedFocus(element) {
32505
- modalElement = element;
32506
-
32507
- if (window.addEventListener) {
32508
- window.addEventListener("blur", handleBlur, false);
32509
- document.addEventListener("focus", handleFocus, true);
32510
- } else {
32511
- window.attachEvent("onBlur", handleBlur);
32512
- document.attachEvent("onFocus", handleFocus);
32513
- }
32514
- }
32515
-
32516
- function teardownScopedFocus() {
32517
- modalElement = null;
32518
-
32519
- if (window.addEventListener) {
32520
- window.removeEventListener("blur", handleBlur);
32521
- document.removeEventListener("focus", handleFocus);
32522
- } else {
32523
- window.detachEvent("onBlur", handleBlur);
32524
- document.detachEvent("onFocus", handleFocus);
32525
- }
32526
- }
32527
- return focusManager;
32528
- }
32529
-
32530
- var scopeTab = {exports: {}};
32531
-
32532
- var hasRequiredScopeTab;
32533
-
32534
- function requireScopeTab () {
32535
- if (hasRequiredScopeTab) return scopeTab.exports;
32536
- hasRequiredScopeTab = 1;
32537
- (function (module, exports) {
32538
-
32539
- Object.defineProperty(exports, "__esModule", {
32540
- value: true
32541
- });
32542
- exports.default = scopeTab;
32543
-
32544
- var _tabbable = requireTabbable();
32545
-
32546
- var _tabbable2 = _interopRequireDefault(_tabbable);
32547
-
32548
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32549
-
32550
- function getActiveElement() {
32551
- var el = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
32552
-
32553
- return el.activeElement.shadowRoot ? getActiveElement(el.activeElement.shadowRoot) : el.activeElement;
32554
- }
32555
-
32556
- function scopeTab(node, event) {
32557
- var tabbable = (0, _tabbable2.default)(node);
32558
-
32559
- if (!tabbable.length) {
32560
- // Do nothing, since there are no elements that can receive focus.
32561
- event.preventDefault();
32562
- return;
32563
- }
32564
-
32565
- var target = void 0;
32566
-
32567
- var shiftKey = event.shiftKey;
32568
- var head = tabbable[0];
32569
- var tail = tabbable[tabbable.length - 1];
32570
- var activeElement = getActiveElement();
32571
-
32572
- // proceed with default browser behavior on tab.
32573
- // Focus on last element on shift + tab.
32574
- if (node === activeElement) {
32575
- if (!shiftKey) return;
32576
- target = tail;
32577
- }
32578
-
32579
- if (tail === activeElement && !shiftKey) {
32580
- target = head;
32581
- }
32582
-
32583
- if (head === activeElement && shiftKey) {
32584
- target = tail;
32585
- }
32586
-
32587
- if (target) {
32588
- event.preventDefault();
32589
- target.focus();
32590
- return;
32591
- }
32592
-
32593
- // Safari radio issue.
32594
- //
32595
- // Safari does not move the focus to the radio button,
32596
- // so we need to force it to really walk through all elements.
32597
- //
32598
- // This is very error prone, since we are trying to guess
32599
- // if it is a safari browser from the first occurence between
32600
- // chrome or safari.
32601
- //
32602
- // The chrome user agent contains the first ocurrence
32603
- // as the 'chrome/version' and later the 'safari/version'.
32604
- var checkSafari = /(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent);
32605
- var isSafariDesktop = checkSafari != null && checkSafari[1] != "Chrome" && /\biPod\b|\biPad\b/g.exec(navigator.userAgent) == null;
32606
-
32607
- // If we are not in safari desktop, let the browser control
32608
- // the focus
32609
- if (!isSafariDesktop) return;
32610
-
32611
- var x = tabbable.indexOf(activeElement);
32612
-
32613
- if (x > -1) {
32614
- x += shiftKey ? -1 : 1;
32615
- }
32616
-
32617
- target = tabbable[x];
32618
-
32619
- // If the tabbable element does not exist,
32620
- // focus head/tail based on shiftKey
32621
- if (typeof target === "undefined") {
32622
- event.preventDefault();
32623
- target = shiftKey ? tail : head;
32624
- target.focus();
32625
- return;
32626
- }
32627
-
32628
- event.preventDefault();
32629
-
32630
- target.focus();
32631
- }
32632
- module.exports = exports["default"];
32633
- } (scopeTab, scopeTab.exports));
32634
- return scopeTab.exports;
32635
- }
32636
-
32637
- var ariaAppHider = {};
32638
-
32639
- /**
32640
- * Copyright (c) 2014-present, Facebook, Inc.
32641
- *
32642
- * This source code is licensed under the MIT license found in the
32643
- * LICENSE file in the root directory of this source tree.
32644
- */
32645
-
32646
- var warning_1;
32647
- var hasRequiredWarning;
32648
-
32649
- function requireWarning () {
32650
- if (hasRequiredWarning) return warning_1;
32651
- hasRequiredWarning = 1;
32652
-
32653
- /**
32654
- * Similar to invariant but only logs a warning if the condition is not met.
32655
- * This can be used to log issues in development environments in critical
32656
- * paths. Removing the logging code for production environments will keep the
32657
- * same logic and follow the same code paths.
32658
- */
32659
-
32660
- var __DEV__ = process.env.NODE_ENV !== 'production';
32661
-
32662
- var warning = function() {};
32663
-
32664
- if (__DEV__) {
32665
- var printWarning = function printWarning(format, args) {
32666
- var len = arguments.length;
32667
- args = new Array(len > 1 ? len - 1 : 0);
32668
- for (var key = 1; key < len; key++) {
32669
- args[key - 1] = arguments[key];
32670
- }
32671
- var argIndex = 0;
32672
- var message = 'Warning: ' +
32673
- format.replace(/%s/g, function() {
32674
- return args[argIndex++];
32675
- });
32676
- if (typeof console !== 'undefined') {
32677
- console.error(message);
32678
- }
32679
- try {
32680
- // --- Welcome to debugging React ---
32681
- // This error was thrown as a convenience so that you can use this stack
32682
- // to find the callsite that caused this warning to fire.
32683
- throw new Error(message);
32684
- } catch (x) {}
32685
- };
32686
-
32687
- warning = function(condition, format, args) {
32688
- var len = arguments.length;
32689
- args = new Array(len > 2 ? len - 2 : 0);
32690
- for (var key = 2; key < len; key++) {
32691
- args[key - 2] = arguments[key];
32692
- }
32693
- if (format === undefined) {
32694
- throw new Error(
32695
- '`warning(condition, format, ...args)` requires a warning ' +
32696
- 'message argument'
32697
- );
32698
- }
32699
- if (!condition) {
32700
- printWarning.apply(null, [format].concat(args));
32701
- }
32702
- };
32703
- }
32704
-
32705
- warning_1 = warning;
32706
- return warning_1;
32707
- }
32708
-
32709
- var safeHTMLElement = {};
32710
-
32711
- var exenv = {exports: {}};
32712
-
32713
- /*!
32714
- Copyright (c) 2015 Jed Watson.
32715
- Based on code that is Copyright 2013-2015, Facebook, Inc.
32716
- All rights reserved.
32717
- */
32718
-
32719
- var hasRequiredExenv;
32720
-
32721
- function requireExenv () {
32722
- if (hasRequiredExenv) return exenv.exports;
32723
- hasRequiredExenv = 1;
32724
- (function (module) {
32725
- /* global define */
32726
-
32727
- (function () {
32728
-
32729
- var canUseDOM = !!(
32730
- typeof window !== 'undefined' &&
32731
- window.document &&
32732
- window.document.createElement
32733
- );
32734
-
32735
- var ExecutionEnvironment = {
32736
-
32737
- canUseDOM: canUseDOM,
32738
-
32739
- canUseWorkers: typeof Worker !== 'undefined',
32740
-
32741
- canUseEventListeners:
32742
- canUseDOM && !!(window.addEventListener || window.attachEvent),
32743
-
32744
- canUseViewport: canUseDOM && !!window.screen
32745
-
32746
- };
32747
-
32748
- if (module.exports) {
32749
- module.exports = ExecutionEnvironment;
32750
- } else {
32751
- window.ExecutionEnvironment = ExecutionEnvironment;
32752
- }
32753
-
32754
- }());
32755
- } (exenv));
32756
- return exenv.exports;
32757
- }
32758
-
32759
- var hasRequiredSafeHTMLElement;
32760
-
32761
- function requireSafeHTMLElement () {
32762
- if (hasRequiredSafeHTMLElement) return safeHTMLElement;
32763
- hasRequiredSafeHTMLElement = 1;
32764
-
32765
- Object.defineProperty(safeHTMLElement, "__esModule", {
32766
- value: true
32767
- });
32768
- safeHTMLElement.canUseDOM = safeHTMLElement.SafeNodeList = safeHTMLElement.SafeHTMLCollection = undefined;
32769
-
32770
- var _exenv = requireExenv();
32771
-
32772
- var _exenv2 = _interopRequireDefault(_exenv);
32773
-
32774
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32775
-
32776
- var EE = _exenv2.default;
32777
-
32778
- var SafeHTMLElement = EE.canUseDOM ? window.HTMLElement : {};
32779
-
32780
- safeHTMLElement.SafeHTMLCollection = EE.canUseDOM ? window.HTMLCollection : {};
32781
-
32782
- safeHTMLElement.SafeNodeList = EE.canUseDOM ? window.NodeList : {};
32783
-
32784
- safeHTMLElement.canUseDOM = EE.canUseDOM;
32785
-
32786
- safeHTMLElement.default = SafeHTMLElement;
32787
- return safeHTMLElement;
32788
- }
32789
-
32790
- var hasRequiredAriaAppHider;
32791
-
32792
- function requireAriaAppHider () {
32793
- if (hasRequiredAriaAppHider) return ariaAppHider;
32794
- hasRequiredAriaAppHider = 1;
32795
-
32796
- Object.defineProperty(ariaAppHider, "__esModule", {
32797
- value: true
32798
- });
32799
- ariaAppHider.resetState = resetState;
32800
- ariaAppHider.log = log;
32801
- ariaAppHider.assertNodeList = assertNodeList;
32802
- ariaAppHider.setElement = setElement;
32803
- ariaAppHider.validateElement = validateElement;
32804
- ariaAppHider.hide = hide;
32805
- ariaAppHider.show = show;
32806
- ariaAppHider.documentNotReadyOrSSRTesting = documentNotReadyOrSSRTesting;
32807
-
32808
- var _warning = requireWarning();
32809
-
32810
- var _warning2 = _interopRequireDefault(_warning);
32811
-
32812
- var _safeHTMLElement = requireSafeHTMLElement();
32813
-
32814
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32815
-
32816
- var globalElement = null;
32817
-
32818
- /* eslint-disable no-console */
32819
- /* istanbul ignore next */
32820
- function resetState() {
32821
- if (globalElement) {
32822
- if (globalElement.removeAttribute) {
32823
- globalElement.removeAttribute("aria-hidden");
32824
- } else if (globalElement.length != null) {
32825
- globalElement.forEach(function (element) {
32826
- return element.removeAttribute("aria-hidden");
32827
- });
32828
- } else {
32829
- document.querySelectorAll(globalElement).forEach(function (element) {
32830
- return element.removeAttribute("aria-hidden");
32831
- });
32832
- }
32833
- }
32834
- globalElement = null;
32835
- }
32836
-
32837
- /* istanbul ignore next */
32838
- function log() {
32839
- if (process.env.NODE_ENV !== "production") {
32840
- var check = globalElement || {};
32841
- console.log("ariaAppHider ----------");
32842
- console.log(check.nodeName, check.className, check.id);
32843
- console.log("end ariaAppHider ----------");
32844
- }
32845
- }
32846
- /* eslint-enable no-console */
32847
-
32848
- function assertNodeList(nodeList, selector) {
32849
- if (!nodeList || !nodeList.length) {
32850
- throw new Error("react-modal: No elements were found for selector " + selector + ".");
32851
- }
32852
- }
32853
-
32854
- function setElement(element) {
32855
- var useElement = element;
32856
- if (typeof useElement === "string" && _safeHTMLElement.canUseDOM) {
32857
- var el = document.querySelectorAll(useElement);
32858
- assertNodeList(el, useElement);
32859
- useElement = el;
32860
- }
32861
- globalElement = useElement || globalElement;
32862
- return globalElement;
32863
- }
32864
-
32865
- function validateElement(appElement) {
32866
- var el = appElement || globalElement;
32867
- if (el) {
32868
- return Array.isArray(el) || el instanceof HTMLCollection || el instanceof NodeList ? el : [el];
32869
- } else {
32870
- (0, _warning2.default)(false, ["react-modal: App element is not defined.", "Please use `Modal.setAppElement(el)` or set `appElement={el}`.", "This is needed so screen readers don't see main content", "when modal is opened. It is not recommended, but you can opt-out", "by setting `ariaHideApp={false}`."].join(" "));
32871
-
32872
- return [];
32873
- }
32874
- }
32875
-
32876
- function hide(appElement) {
32877
- var _iteratorNormalCompletion = true;
32878
- var _didIteratorError = false;
32879
- var _iteratorError = undefined;
32880
-
32881
- try {
32882
- for (var _iterator = validateElement(appElement)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
32883
- var el = _step.value;
32884
-
32885
- el.setAttribute("aria-hidden", "true");
32886
- }
32887
- } catch (err) {
32888
- _didIteratorError = true;
32889
- _iteratorError = err;
32890
- } finally {
32891
- try {
32892
- if (!_iteratorNormalCompletion && _iterator.return) {
32893
- _iterator.return();
32894
- }
32895
- } finally {
32896
- if (_didIteratorError) {
32897
- throw _iteratorError;
32898
- }
32899
- }
32900
- }
32901
- }
32902
-
32903
- function show(appElement) {
32904
- var _iteratorNormalCompletion2 = true;
32905
- var _didIteratorError2 = false;
32906
- var _iteratorError2 = undefined;
32907
-
32908
- try {
32909
- for (var _iterator2 = validateElement(appElement)[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
32910
- var el = _step2.value;
32911
-
32912
- el.removeAttribute("aria-hidden");
32913
- }
32914
- } catch (err) {
32915
- _didIteratorError2 = true;
32916
- _iteratorError2 = err;
32917
- } finally {
32918
- try {
32919
- if (!_iteratorNormalCompletion2 && _iterator2.return) {
32920
- _iterator2.return();
32921
- }
32922
- } finally {
32923
- if (_didIteratorError2) {
32924
- throw _iteratorError2;
32925
- }
32926
- }
32927
- }
32928
- }
32929
-
32930
- function documentNotReadyOrSSRTesting() {
32931
- globalElement = null;
32932
- }
32933
- return ariaAppHider;
32934
- }
32935
-
32936
- var classList = {};
32937
-
32938
- var hasRequiredClassList;
32939
-
32940
- function requireClassList () {
32941
- if (hasRequiredClassList) return classList;
32942
- hasRequiredClassList = 1;
32943
-
32944
- Object.defineProperty(classList, "__esModule", {
32945
- value: true
32946
- });
32947
- classList.resetState = resetState;
32948
- classList.log = log;
32949
- var htmlClassList = {};
32950
- var docBodyClassList = {};
32951
-
32952
- /* eslint-disable no-console */
32953
- /* istanbul ignore next */
32954
- function removeClass(at, cls) {
32955
- at.classList.remove(cls);
32956
- }
32957
-
32958
- /* istanbul ignore next */
32959
- function resetState() {
32960
- var htmlElement = document.getElementsByTagName("html")[0];
32961
- for (var cls in htmlClassList) {
32962
- removeClass(htmlElement, htmlClassList[cls]);
32963
- }
32964
-
32965
- var body = document.body;
32966
- for (var _cls in docBodyClassList) {
32967
- removeClass(body, docBodyClassList[_cls]);
32968
- }
32969
-
32970
- htmlClassList = {};
32971
- docBodyClassList = {};
32972
- }
32973
-
32974
- /* istanbul ignore next */
32975
- function log() {
32976
- if (process.env.NODE_ENV !== "production") {
32977
- var classes = document.getElementsByTagName("html")[0].className;
32978
- var buffer = "Show tracked classes:\n\n";
32979
-
32980
- buffer += "<html /> (" + classes + "):\n ";
32981
- for (var x in htmlClassList) {
32982
- buffer += " " + x + " " + htmlClassList[x] + "\n ";
32983
- }
32984
-
32985
- classes = document.body.className;
32986
-
32987
- buffer += "\n\ndoc.body (" + classes + "):\n ";
32988
- for (var _x in docBodyClassList) {
32989
- buffer += " " + _x + " " + docBodyClassList[_x] + "\n ";
32990
- }
32991
-
32992
- buffer += "\n";
32993
-
32994
- console.log(buffer);
32995
- }
32996
- }
32997
- /* eslint-enable no-console */
32998
-
32999
- /**
33000
- * Track the number of reference of a class.
33001
- * @param {object} poll The poll to receive the reference.
33002
- * @param {string} className The class name.
33003
- * @return {string}
33004
- */
33005
- var incrementReference = function incrementReference(poll, className) {
33006
- if (!poll[className]) {
33007
- poll[className] = 0;
33008
- }
33009
- poll[className] += 1;
33010
- return className;
33011
- };
33012
-
33013
- /**
33014
- * Drop the reference of a class.
33015
- * @param {object} poll The poll to receive the reference.
33016
- * @param {string} className The class name.
33017
- * @return {string}
33018
- */
33019
- var decrementReference = function decrementReference(poll, className) {
33020
- if (poll[className]) {
33021
- poll[className] -= 1;
33022
- }
33023
- return className;
33024
- };
33025
-
33026
- /**
33027
- * Track a class and add to the given class list.
33028
- * @param {Object} classListRef A class list of an element.
33029
- * @param {Object} poll The poll to be used.
33030
- * @param {Array} classes The list of classes to be tracked.
33031
- */
33032
- var trackClass = function trackClass(classListRef, poll, classes) {
33033
- classes.forEach(function (className) {
33034
- incrementReference(poll, className);
33035
- classListRef.add(className);
33036
- });
33037
- };
33038
-
33039
- /**
33040
- * Untrack a class and remove from the given class list if the reference
33041
- * reaches 0.
33042
- * @param {Object} classListRef A class list of an element.
33043
- * @param {Object} poll The poll to be used.
33044
- * @param {Array} classes The list of classes to be untracked.
33045
- */
33046
- var untrackClass = function untrackClass(classListRef, poll, classes) {
33047
- classes.forEach(function (className) {
33048
- decrementReference(poll, className);
33049
- poll[className] === 0 && classListRef.remove(className);
33050
- });
33051
- };
33052
-
33053
- /**
33054
- * Public inferface to add classes to the document.body.
33055
- * @param {string} bodyClass The class string to be added.
33056
- * It may contain more then one class
33057
- * with ' ' as separator.
33058
- */
33059
- classList.add = function add(element, classString) {
33060
- return trackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
33061
- };
33062
-
33063
- /**
33064
- * Public inferface to remove classes from the document.body.
33065
- * @param {string} bodyClass The class string to be added.
33066
- * It may contain more then one class
33067
- * with ' ' as separator.
33068
- */
33069
- classList.remove = function remove(element, classString) {
33070
- return untrackClass(element.classList, element.nodeName.toLowerCase() == "html" ? htmlClassList : docBodyClassList, classString.split(" "));
33071
- };
33072
- return classList;
33073
- }
33074
-
33075
- var portalOpenInstances = {};
33076
-
33077
- var hasRequiredPortalOpenInstances;
33078
-
33079
- function requirePortalOpenInstances () {
33080
- if (hasRequiredPortalOpenInstances) return portalOpenInstances;
33081
- hasRequiredPortalOpenInstances = 1;
33082
-
33083
- Object.defineProperty(portalOpenInstances, "__esModule", {
33084
- value: true
33085
- });
33086
- portalOpenInstances.log = log;
33087
- portalOpenInstances.resetState = resetState;
33088
-
33089
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33090
-
33091
- // Tracks portals that are open and emits events to subscribers
33092
-
33093
- var PortalOpenInstances = function PortalOpenInstances() {
33094
- var _this = this;
33095
-
33096
- _classCallCheck(this, PortalOpenInstances);
33097
-
33098
- this.register = function (openInstance) {
33099
- if (_this.openInstances.indexOf(openInstance) !== -1) {
33100
- if (process.env.NODE_ENV !== "production") {
33101
- // eslint-disable-next-line no-console
33102
- console.warn("React-Modal: Cannot register modal instance that's already open");
33103
- }
33104
- return;
33105
- }
33106
- _this.openInstances.push(openInstance);
33107
- _this.emit("register");
33108
- };
33109
-
33110
- this.deregister = function (openInstance) {
33111
- var index = _this.openInstances.indexOf(openInstance);
33112
- if (index === -1) {
33113
- if (process.env.NODE_ENV !== "production") {
33114
- // eslint-disable-next-line no-console
33115
- console.warn("React-Modal: Unable to deregister " + openInstance + " as " + "it was never registered");
33116
- }
33117
- return;
33118
- }
33119
- _this.openInstances.splice(index, 1);
33120
- _this.emit("deregister");
33121
- };
33122
-
33123
- this.subscribe = function (callback) {
33124
- _this.subscribers.push(callback);
33125
- };
33126
-
33127
- this.emit = function (eventType) {
33128
- _this.subscribers.forEach(function (subscriber) {
33129
- return subscriber(eventType,
33130
- // shallow copy to avoid accidental mutation
33131
- _this.openInstances.slice());
33132
- });
33133
- };
33134
-
33135
- this.openInstances = [];
33136
- this.subscribers = [];
33137
- };
33138
-
33139
- var portalOpenInstances$1 = new PortalOpenInstances();
33140
-
33141
- /* eslint-disable no-console */
33142
- /* istanbul ignore next */
33143
- function log() {
33144
- console.log("portalOpenInstances ----------");
33145
- console.log(portalOpenInstances$1.openInstances.length);
33146
- portalOpenInstances$1.openInstances.forEach(function (p) {
33147
- return console.log(p);
33148
- });
33149
- console.log("end portalOpenInstances ----------");
33150
- }
33151
-
33152
- /* istanbul ignore next */
33153
- function resetState() {
33154
- portalOpenInstances$1 = new PortalOpenInstances();
33155
- }
33156
- /* eslint-enable no-console */
33157
-
33158
- portalOpenInstances.default = portalOpenInstances$1;
33159
- return portalOpenInstances;
33160
- }
33161
-
33162
- var bodyTrap = {};
33163
-
33164
- var hasRequiredBodyTrap;
33165
-
33166
- function requireBodyTrap () {
33167
- if (hasRequiredBodyTrap) return bodyTrap;
33168
- hasRequiredBodyTrap = 1;
33169
-
33170
- Object.defineProperty(bodyTrap, "__esModule", {
33171
- value: true
33172
- });
33173
- bodyTrap.resetState = resetState;
33174
- bodyTrap.log = log;
33175
-
33176
- var _portalOpenInstances = requirePortalOpenInstances();
33177
-
33178
- var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);
33179
-
33180
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33181
-
33182
- // Body focus trap see Issue #742
33183
-
33184
- var before = void 0,
33185
- after = void 0,
33186
- instances = [];
33187
-
33188
- /* eslint-disable no-console */
33189
- /* istanbul ignore next */
33190
- function resetState() {
33191
- var _arr = [before, after];
33192
-
33193
- for (var _i = 0; _i < _arr.length; _i++) {
33194
- var item = _arr[_i];
33195
- if (!item) continue;
33196
- item.parentNode && item.parentNode.removeChild(item);
33197
- }
33198
- before = after = null;
33199
- instances = [];
33200
- }
33201
-
33202
- /* istanbul ignore next */
33203
- function log() {
33204
- console.log("bodyTrap ----------");
33205
- console.log(instances.length);
33206
- var _arr2 = [before, after];
33207
- for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
33208
- var item = _arr2[_i2];
33209
- var check = item || {};
33210
- console.log(check.nodeName, check.className, check.id);
33211
- }
33212
- console.log("edn bodyTrap ----------");
33213
- }
33214
- /* eslint-enable no-console */
33215
-
33216
- function focusContent() {
33217
- if (instances.length === 0) {
33218
- if (process.env.NODE_ENV !== "production") {
33219
- // eslint-disable-next-line no-console
33220
- console.warn("React-Modal: Open instances > 0 expected");
33221
- }
33222
- return;
33223
- }
33224
- instances[instances.length - 1].focusContent();
33225
- }
33226
-
33227
- function bodyTrap$1(eventType, openInstances) {
33228
- if (!before && !after) {
33229
- before = document.createElement("div");
33230
- before.setAttribute("data-react-modal-body-trap", "");
33231
- before.style.position = "absolute";
33232
- before.style.opacity = "0";
33233
- before.setAttribute("tabindex", "0");
33234
- before.addEventListener("focus", focusContent);
33235
- after = before.cloneNode();
33236
- after.addEventListener("focus", focusContent);
33237
- }
33238
-
33239
- instances = openInstances;
33240
-
33241
- if (instances.length > 0) {
33242
- // Add focus trap
33243
- if (document.body.firstChild !== before) {
33244
- document.body.insertBefore(before, document.body.firstChild);
33245
- }
33246
- if (document.body.lastChild !== after) {
33247
- document.body.appendChild(after);
33248
- }
33249
- } else {
33250
- // Remove focus trap
33251
- if (before.parentElement) {
33252
- before.parentElement.removeChild(before);
33253
- }
33254
- if (after.parentElement) {
33255
- after.parentElement.removeChild(after);
33256
- }
33257
- }
33258
- }
33259
-
33260
- _portalOpenInstances2.default.subscribe(bodyTrap$1);
33261
- return bodyTrap;
33262
- }
33263
-
33264
- var hasRequiredModalPortal;
33265
-
33266
- function requireModalPortal () {
33267
- if (hasRequiredModalPortal) return ModalPortal.exports;
33268
- hasRequiredModalPortal = 1;
33269
- (function (module, exports) {
33270
-
33271
- Object.defineProperty(exports, "__esModule", {
33272
- value: true
33273
- });
33274
-
33275
- 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; };
33276
-
33277
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
33278
-
33279
- 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; }; }();
33280
-
33281
- var _react = React__default;
33282
-
33283
- var _propTypes = /*@__PURE__*/ requirePropTypes();
33284
-
33285
- var _propTypes2 = _interopRequireDefault(_propTypes);
33286
-
33287
- var _focusManager = requireFocusManager();
33288
-
33289
- var focusManager = _interopRequireWildcard(_focusManager);
33290
-
33291
- var _scopeTab = requireScopeTab();
33292
-
33293
- var _scopeTab2 = _interopRequireDefault(_scopeTab);
33294
-
33295
- var _ariaAppHider = requireAriaAppHider();
33296
-
33297
- var ariaAppHider = _interopRequireWildcard(_ariaAppHider);
33298
-
33299
- var _classList = requireClassList();
33300
-
33301
- var classList = _interopRequireWildcard(_classList);
33302
-
33303
- var _safeHTMLElement = requireSafeHTMLElement();
33304
-
33305
- var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);
33306
-
33307
- var _portalOpenInstances = requirePortalOpenInstances();
33308
-
33309
- var _portalOpenInstances2 = _interopRequireDefault(_portalOpenInstances);
33310
-
33311
- requireBodyTrap();
33312
-
33313
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
33314
-
33315
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33316
-
33317
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33318
-
33319
- 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; }
33320
-
33321
- 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; }
33322
-
33323
- // so that our CSS is statically analyzable
33324
- var CLASS_NAMES = {
33325
- overlay: "ReactModal__Overlay",
33326
- content: "ReactModal__Content"
33327
- };
33328
-
33329
- /**
33330
- * We need to support the deprecated `KeyboardEvent.keyCode` in addition to
33331
- * `KeyboardEvent.code` for apps that still support IE11. Can be removed when
33332
- * `react-modal` only supports React >18 (which dropped IE support).
33333
- */
33334
- var isTabKey = function isTabKey(event) {
33335
- return event.code === "Tab" || event.keyCode === 9;
33336
- };
33337
- var isEscKey = function isEscKey(event) {
33338
- return event.code === "Escape" || event.keyCode === 27;
33339
- };
33340
-
33341
- var ariaHiddenInstances = 0;
33342
-
33343
- var ModalPortal = function (_Component) {
33344
- _inherits(ModalPortal, _Component);
33345
-
33346
- function ModalPortal(props) {
33347
- _classCallCheck(this, ModalPortal);
33348
-
33349
- var _this = _possibleConstructorReturn(this, (ModalPortal.__proto__ || Object.getPrototypeOf(ModalPortal)).call(this, props));
33350
-
33351
- _this.setOverlayRef = function (overlay) {
33352
- _this.overlay = overlay;
33353
- _this.props.overlayRef && _this.props.overlayRef(overlay);
33354
- };
33355
-
33356
- _this.setContentRef = function (content) {
33357
- _this.content = content;
33358
- _this.props.contentRef && _this.props.contentRef(content);
33359
- };
33360
-
33361
- _this.afterClose = function () {
33362
- var _this$props = _this.props,
33363
- appElement = _this$props.appElement,
33364
- ariaHideApp = _this$props.ariaHideApp,
33365
- htmlOpenClassName = _this$props.htmlOpenClassName,
33366
- bodyOpenClassName = _this$props.bodyOpenClassName,
33367
- parentSelector = _this$props.parentSelector;
33368
-
33369
-
33370
- var parentDocument = parentSelector && parentSelector().ownerDocument || document;
33371
-
33372
- // Remove classes.
33373
- bodyOpenClassName && classList.remove(parentDocument.body, bodyOpenClassName);
33374
-
33375
- htmlOpenClassName && classList.remove(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
33376
-
33377
- // Reset aria-hidden attribute if all modals have been removed
33378
- if (ariaHideApp && ariaHiddenInstances > 0) {
33379
- ariaHiddenInstances -= 1;
33380
-
33381
- if (ariaHiddenInstances === 0) {
33382
- ariaAppHider.show(appElement);
33383
- }
33384
- }
33385
-
33386
- if (_this.props.shouldFocusAfterRender) {
33387
- if (_this.props.shouldReturnFocusAfterClose) {
33388
- focusManager.returnFocus(_this.props.preventScroll);
33389
- focusManager.teardownScopedFocus();
33390
- } else {
33391
- focusManager.popWithoutFocus();
33392
- }
33393
- }
33394
-
33395
- if (_this.props.onAfterClose) {
33396
- _this.props.onAfterClose();
33397
- }
33398
-
33399
- _portalOpenInstances2.default.deregister(_this);
33400
- };
33401
-
33402
- _this.open = function () {
33403
- _this.beforeOpen();
33404
- if (_this.state.afterOpen && _this.state.beforeClose) {
33405
- clearTimeout(_this.closeTimer);
33406
- _this.setState({ beforeClose: false });
33407
- } else {
33408
- if (_this.props.shouldFocusAfterRender) {
33409
- focusManager.setupScopedFocus(_this.node);
33410
- focusManager.markForFocusLater();
33411
- }
33412
-
33413
- _this.setState({ isOpen: true }, function () {
33414
- _this.openAnimationFrame = requestAnimationFrame(function () {
33415
- _this.setState({ afterOpen: true });
33416
-
33417
- if (_this.props.isOpen && _this.props.onAfterOpen) {
33418
- _this.props.onAfterOpen({
33419
- overlayEl: _this.overlay,
33420
- contentEl: _this.content
33421
- });
33422
- }
33423
- });
33424
- });
33425
- }
33426
- };
33427
-
33428
- _this.close = function () {
33429
- if (_this.props.closeTimeoutMS > 0) {
33430
- _this.closeWithTimeout();
33431
- } else {
33432
- _this.closeWithoutTimeout();
33433
- }
33434
- };
33435
-
33436
- _this.focusContent = function () {
33437
- return _this.content && !_this.contentHasFocus() && _this.content.focus({ preventScroll: true });
33438
- };
33439
-
33440
- _this.closeWithTimeout = function () {
33441
- var closesAt = Date.now() + _this.props.closeTimeoutMS;
33442
- _this.setState({ beforeClose: true, closesAt: closesAt }, function () {
33443
- _this.closeTimer = setTimeout(_this.closeWithoutTimeout, _this.state.closesAt - Date.now());
33444
- });
33445
- };
33446
-
33447
- _this.closeWithoutTimeout = function () {
33448
- _this.setState({
33449
- beforeClose: false,
33450
- isOpen: false,
33451
- afterOpen: false,
33452
- closesAt: null
33453
- }, _this.afterClose);
33454
- };
33455
-
33456
- _this.handleKeyDown = function (event) {
33457
- if (isTabKey(event)) {
33458
- (0, _scopeTab2.default)(_this.content, event);
33459
- }
33460
-
33461
- if (_this.props.shouldCloseOnEsc && isEscKey(event)) {
33462
- event.stopPropagation();
33463
- _this.requestClose(event);
33464
- }
33465
- };
33466
-
33467
- _this.handleOverlayOnClick = function (event) {
33468
- if (_this.shouldClose === null) {
33469
- _this.shouldClose = true;
33470
- }
33471
-
33472
- if (_this.shouldClose && _this.props.shouldCloseOnOverlayClick) {
33473
- if (_this.ownerHandlesClose()) {
33474
- _this.requestClose(event);
33475
- } else {
33476
- _this.focusContent();
33477
- }
33478
- }
33479
- _this.shouldClose = null;
33480
- };
33481
-
33482
- _this.handleContentOnMouseUp = function () {
33483
- _this.shouldClose = false;
33484
- };
33485
-
33486
- _this.handleOverlayOnMouseDown = function (event) {
33487
- if (!_this.props.shouldCloseOnOverlayClick && event.target == _this.overlay) {
33488
- event.preventDefault();
33489
- }
33490
- };
33491
-
33492
- _this.handleContentOnClick = function () {
33493
- _this.shouldClose = false;
33494
- };
33495
-
33496
- _this.handleContentOnMouseDown = function () {
33497
- _this.shouldClose = false;
33498
- };
33499
-
33500
- _this.requestClose = function (event) {
33501
- return _this.ownerHandlesClose() && _this.props.onRequestClose(event);
33502
- };
33503
-
33504
- _this.ownerHandlesClose = function () {
33505
- return _this.props.onRequestClose;
33506
- };
33507
-
33508
- _this.shouldBeClosed = function () {
33509
- return !_this.state.isOpen && !_this.state.beforeClose;
33510
- };
33511
-
33512
- _this.contentHasFocus = function () {
33513
- return document.activeElement === _this.content || _this.content.contains(document.activeElement);
33514
- };
33515
-
33516
- _this.buildClassName = function (which, additional) {
33517
- var classNames = (typeof additional === "undefined" ? "undefined" : _typeof(additional)) === "object" ? additional : {
33518
- base: CLASS_NAMES[which],
33519
- afterOpen: CLASS_NAMES[which] + "--after-open",
33520
- beforeClose: CLASS_NAMES[which] + "--before-close"
33521
- };
33522
- var className = classNames.base;
33523
- if (_this.state.afterOpen) {
33524
- className = className + " " + classNames.afterOpen;
33525
- }
33526
- if (_this.state.beforeClose) {
33527
- className = className + " " + classNames.beforeClose;
33528
- }
33529
- return typeof additional === "string" && additional ? className + " " + additional : className;
33530
- };
33531
-
33532
- _this.attributesFromObject = function (prefix, items) {
33533
- return Object.keys(items).reduce(function (acc, name) {
33534
- acc[prefix + "-" + name] = items[name];
33535
- return acc;
33536
- }, {});
33537
- };
33538
-
33539
- _this.state = {
33540
- afterOpen: false,
33541
- beforeClose: false
33542
- };
33543
-
33544
- _this.shouldClose = null;
33545
- _this.moveFromContentToOverlay = null;
33546
- return _this;
33547
- }
33548
-
33549
- _createClass(ModalPortal, [{
33550
- key: "componentDidMount",
33551
- value: function componentDidMount() {
33552
- if (this.props.isOpen) {
33553
- this.open();
33554
- }
33555
- }
33556
- }, {
33557
- key: "componentDidUpdate",
33558
- value: function componentDidUpdate(prevProps, prevState) {
33559
- if (process.env.NODE_ENV !== "production") {
33560
- if (prevProps.bodyOpenClassName !== this.props.bodyOpenClassName) {
33561
- // eslint-disable-next-line no-console
33562
- console.warn('React-Modal: "bodyOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
33563
- }
33564
- if (prevProps.htmlOpenClassName !== this.props.htmlOpenClassName) {
33565
- // eslint-disable-next-line no-console
33566
- console.warn('React-Modal: "htmlOpenClassName" prop has been modified. ' + "This may cause unexpected behavior when multiple modals are open.");
33567
- }
33568
- }
33569
-
33570
- if (this.props.isOpen && !prevProps.isOpen) {
33571
- this.open();
33572
- } else if (!this.props.isOpen && prevProps.isOpen) {
33573
- this.close();
33574
- }
33575
-
33576
- // Focus only needs to be set once when the modal is being opened
33577
- if (this.props.shouldFocusAfterRender && this.state.isOpen && !prevState.isOpen) {
33578
- this.focusContent();
33579
- }
33580
- }
33581
- }, {
33582
- key: "componentWillUnmount",
33583
- value: function componentWillUnmount() {
33584
- if (this.state.isOpen) {
33585
- this.afterClose();
33586
- }
33587
- clearTimeout(this.closeTimer);
33588
- cancelAnimationFrame(this.openAnimationFrame);
33589
- }
33590
- }, {
33591
- key: "beforeOpen",
33592
- value: function beforeOpen() {
33593
- var _props = this.props,
33594
- appElement = _props.appElement,
33595
- ariaHideApp = _props.ariaHideApp,
33596
- htmlOpenClassName = _props.htmlOpenClassName,
33597
- bodyOpenClassName = _props.bodyOpenClassName,
33598
- parentSelector = _props.parentSelector;
33599
-
33600
-
33601
- var parentDocument = parentSelector && parentSelector().ownerDocument || document;
33602
-
33603
- // Add classes.
33604
- bodyOpenClassName && classList.add(parentDocument.body, bodyOpenClassName);
33605
-
33606
- htmlOpenClassName && classList.add(parentDocument.getElementsByTagName("html")[0], htmlOpenClassName);
33607
-
33608
- if (ariaHideApp) {
33609
- ariaHiddenInstances += 1;
33610
- ariaAppHider.hide(appElement);
33611
- }
33612
-
33613
- _portalOpenInstances2.default.register(this);
33614
- }
33615
-
33616
- // Don't steal focus from inner elements
33617
-
33618
- }, {
33619
- key: "render",
33620
- value: function render() {
33621
- var _props2 = this.props,
33622
- id = _props2.id,
33623
- className = _props2.className,
33624
- overlayClassName = _props2.overlayClassName,
33625
- defaultStyles = _props2.defaultStyles,
33626
- children = _props2.children;
33627
-
33628
- var contentStyles = className ? {} : defaultStyles.content;
33629
- var overlayStyles = overlayClassName ? {} : defaultStyles.overlay;
33630
-
33631
- if (this.shouldBeClosed()) {
33632
- return null;
33633
- }
33634
-
33635
- var overlayProps = {
33636
- ref: this.setOverlayRef,
33637
- className: this.buildClassName("overlay", overlayClassName),
33638
- style: _extends({}, overlayStyles, this.props.style.overlay),
33639
- onClick: this.handleOverlayOnClick,
33640
- onMouseDown: this.handleOverlayOnMouseDown
33641
- };
33642
-
33643
- var contentProps = _extends({
33644
- id: id,
33645
- ref: this.setContentRef,
33646
- style: _extends({}, contentStyles, this.props.style.content),
33647
- className: this.buildClassName("content", className),
33648
- tabIndex: "-1",
33649
- onKeyDown: this.handleKeyDown,
33650
- onMouseDown: this.handleContentOnMouseDown,
33651
- onMouseUp: this.handleContentOnMouseUp,
33652
- onClick: this.handleContentOnClick,
33653
- role: this.props.role,
33654
- "aria-label": this.props.contentLabel
33655
- }, this.attributesFromObject("aria", _extends({ modal: true }, this.props.aria)), this.attributesFromObject("data", this.props.data || {}), {
33656
- "data-testid": this.props.testId
33657
- });
33658
-
33659
- var contentElement = this.props.contentElement(contentProps, children);
33660
- return this.props.overlayElement(overlayProps, contentElement);
33661
- }
33662
- }]);
33663
-
33664
- return ModalPortal;
33665
- }(_react.Component);
33666
-
33667
- ModalPortal.defaultProps = {
33668
- style: {
33669
- overlay: {},
33670
- content: {}
33671
- },
33672
- defaultStyles: {}
33673
- };
33674
- ModalPortal.propTypes = {
33675
- isOpen: _propTypes2.default.bool.isRequired,
33676
- defaultStyles: _propTypes2.default.shape({
33677
- content: _propTypes2.default.object,
33678
- overlay: _propTypes2.default.object
33679
- }),
33680
- style: _propTypes2.default.shape({
33681
- content: _propTypes2.default.object,
33682
- overlay: _propTypes2.default.object
33683
- }),
33684
- className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
33685
- overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.object]),
33686
- parentSelector: _propTypes2.default.func,
33687
- bodyOpenClassName: _propTypes2.default.string,
33688
- htmlOpenClassName: _propTypes2.default.string,
33689
- ariaHideApp: _propTypes2.default.bool,
33690
- appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
33691
- onAfterOpen: _propTypes2.default.func,
33692
- onAfterClose: _propTypes2.default.func,
33693
- onRequestClose: _propTypes2.default.func,
33694
- closeTimeoutMS: _propTypes2.default.number,
33695
- shouldFocusAfterRender: _propTypes2.default.bool,
33696
- shouldCloseOnOverlayClick: _propTypes2.default.bool,
33697
- shouldReturnFocusAfterClose: _propTypes2.default.bool,
33698
- preventScroll: _propTypes2.default.bool,
33699
- role: _propTypes2.default.string,
33700
- contentLabel: _propTypes2.default.string,
33701
- aria: _propTypes2.default.object,
33702
- data: _propTypes2.default.object,
33703
- children: _propTypes2.default.node,
33704
- shouldCloseOnEsc: _propTypes2.default.bool,
33705
- overlayRef: _propTypes2.default.func,
33706
- contentRef: _propTypes2.default.func,
33707
- id: _propTypes2.default.string,
33708
- overlayElement: _propTypes2.default.func,
33709
- contentElement: _propTypes2.default.func,
33710
- testId: _propTypes2.default.string
33711
- };
33712
- exports.default = ModalPortal;
33713
- module.exports = exports["default"];
33714
- } (ModalPortal, ModalPortal.exports));
33715
- return ModalPortal.exports;
33716
- }
33717
-
33718
- /**
33719
- * Copyright (c) 2013-present, Facebook, Inc.
33720
- *
33721
- * This source code is licensed under the MIT license found in the
33722
- * LICENSE file in the root directory of this source tree.
33723
- */
33724
-
33725
- function componentWillMount() {
33726
- // Call this.constructor.gDSFP to support sub-classes.
33727
- var state = this.constructor.getDerivedStateFromProps(this.props, this.state);
33728
- if (state !== null && state !== undefined) {
33729
- this.setState(state);
33730
- }
33731
- }
33732
-
33733
- function componentWillReceiveProps(nextProps) {
33734
- // Call this.constructor.gDSFP to support sub-classes.
33735
- // Use the setState() updater to ensure state isn't stale in certain edge cases.
33736
- function updater(prevState) {
33737
- var state = this.constructor.getDerivedStateFromProps(nextProps, prevState);
33738
- return state !== null && state !== undefined ? state : null;
33739
- }
33740
- // Binding "this" is important for shallow renderer support.
33741
- this.setState(updater.bind(this));
33742
- }
33743
-
33744
- function componentWillUpdate(nextProps, nextState) {
33745
- try {
33746
- var prevProps = this.props;
33747
- var prevState = this.state;
33748
- this.props = nextProps;
33749
- this.state = nextState;
33750
- this.__reactInternalSnapshotFlag = true;
33751
- this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(
33752
- prevProps,
33753
- prevState
33754
- );
33755
- } finally {
33756
- this.props = prevProps;
33757
- this.state = prevState;
33758
- }
33759
- }
33760
-
33761
- // React may warn about cWM/cWRP/cWU methods being deprecated.
33762
- // Add a flag to suppress these warnings for this special case.
33763
- componentWillMount.__suppressDeprecationWarning = true;
33764
- componentWillReceiveProps.__suppressDeprecationWarning = true;
33765
- componentWillUpdate.__suppressDeprecationWarning = true;
33766
-
33767
- function polyfill(Component) {
33768
- var prototype = Component.prototype;
33769
-
33770
- if (!prototype || !prototype.isReactComponent) {
33771
- throw new Error('Can only polyfill class components');
33772
- }
33773
-
33774
- if (
33775
- typeof Component.getDerivedStateFromProps !== 'function' &&
33776
- typeof prototype.getSnapshotBeforeUpdate !== 'function'
33777
- ) {
33778
- return Component;
33779
- }
33780
-
33781
- // If new component APIs are defined, "unsafe" lifecycles won't be called.
33782
- // Error if any of these lifecycles are present,
33783
- // Because they would work differently between older and newer (16.3+) versions of React.
33784
- var foundWillMountName = null;
33785
- var foundWillReceivePropsName = null;
33786
- var foundWillUpdateName = null;
33787
- if (typeof prototype.componentWillMount === 'function') {
33788
- foundWillMountName = 'componentWillMount';
33789
- } else if (typeof prototype.UNSAFE_componentWillMount === 'function') {
33790
- foundWillMountName = 'UNSAFE_componentWillMount';
33791
- }
33792
- if (typeof prototype.componentWillReceiveProps === 'function') {
33793
- foundWillReceivePropsName = 'componentWillReceiveProps';
33794
- } else if (typeof prototype.UNSAFE_componentWillReceiveProps === 'function') {
33795
- foundWillReceivePropsName = 'UNSAFE_componentWillReceiveProps';
33796
- }
33797
- if (typeof prototype.componentWillUpdate === 'function') {
33798
- foundWillUpdateName = 'componentWillUpdate';
33799
- } else if (typeof prototype.UNSAFE_componentWillUpdate === 'function') {
33800
- foundWillUpdateName = 'UNSAFE_componentWillUpdate';
33801
- }
33802
- if (
33803
- foundWillMountName !== null ||
33804
- foundWillReceivePropsName !== null ||
33805
- foundWillUpdateName !== null
33806
- ) {
33807
- var componentName = Component.displayName || Component.name;
33808
- var newApiName =
33809
- typeof Component.getDerivedStateFromProps === 'function'
33810
- ? 'getDerivedStateFromProps()'
33811
- : 'getSnapshotBeforeUpdate()';
33812
-
33813
- throw Error(
33814
- 'Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n' +
33815
- componentName +
33816
- ' uses ' +
33817
- newApiName +
33818
- ' but also contains the following legacy lifecycles:' +
33819
- (foundWillMountName !== null ? '\n ' + foundWillMountName : '') +
33820
- (foundWillReceivePropsName !== null
33821
- ? '\n ' + foundWillReceivePropsName
33822
- : '') +
33823
- (foundWillUpdateName !== null ? '\n ' + foundWillUpdateName : '') +
33824
- '\n\nThe above lifecycles should be removed. Learn more about this warning here:\n' +
33825
- 'https://fb.me/react-async-component-lifecycle-hooks'
33826
- );
33827
- }
33828
-
33829
- // React <= 16.2 does not support static getDerivedStateFromProps.
33830
- // As a workaround, use cWM and cWRP to invoke the new static lifecycle.
33831
- // Newer versions of React will ignore these lifecycles if gDSFP exists.
33832
- if (typeof Component.getDerivedStateFromProps === 'function') {
33833
- prototype.componentWillMount = componentWillMount;
33834
- prototype.componentWillReceiveProps = componentWillReceiveProps;
33835
- }
33836
-
33837
- // React <= 16.2 does not support getSnapshotBeforeUpdate.
33838
- // As a workaround, use cWU to invoke the new lifecycle.
33839
- // Newer versions of React will ignore that lifecycle if gSBU exists.
33840
- if (typeof prototype.getSnapshotBeforeUpdate === 'function') {
33841
- if (typeof prototype.componentDidUpdate !== 'function') {
33842
- throw new Error(
33843
- 'Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype'
33844
- );
33845
- }
33846
-
33847
- prototype.componentWillUpdate = componentWillUpdate;
33848
-
33849
- var componentDidUpdate = prototype.componentDidUpdate;
33850
-
33851
- prototype.componentDidUpdate = function componentDidUpdatePolyfill(
33852
- prevProps,
33853
- prevState,
33854
- maybeSnapshot
33855
- ) {
33856
- // 16.3+ will not execute our will-update method;
33857
- // It will pass a snapshot value to did-update though.
33858
- // Older versions will require our polyfilled will-update value.
33859
- // We need to handle both cases, but can't just check for the presence of "maybeSnapshot",
33860
- // Because for <= 15.x versions this might be a "prevContext" object.
33861
- // We also can't just check "__reactInternalSnapshot",
33862
- // Because get-snapshot might return a falsy value.
33863
- // So check for the explicit __reactInternalSnapshotFlag flag to determine behavior.
33864
- var snapshot = this.__reactInternalSnapshotFlag
33865
- ? this.__reactInternalSnapshot
33866
- : maybeSnapshot;
33867
-
33868
- componentDidUpdate.call(this, prevProps, prevState, snapshot);
33869
- };
33870
- }
33871
-
33872
- return Component;
33873
- }
33874
-
33875
- var reactLifecyclesCompat_es = /*#__PURE__*/Object.freeze({
33876
- __proto__: null,
33877
- polyfill: polyfill
33878
- });
33879
-
33880
- var require$$6 = /*@__PURE__*/getAugmentedNamespace(reactLifecyclesCompat_es);
33881
-
33882
- var hasRequiredModal;
33883
-
33884
- function requireModal () {
33885
- if (hasRequiredModal) return Modal;
33886
- hasRequiredModal = 1;
33887
-
33888
- Object.defineProperty(Modal, "__esModule", {
33889
- value: true
33890
- });
33891
- Modal.bodyOpenClassName = Modal.portalClassName = undefined;
33892
-
33893
- 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; };
33894
-
33895
- 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; }; }();
33896
-
33897
- var _react = React__default;
33898
-
33899
- var _react2 = _interopRequireDefault(_react);
33900
-
33901
- var _reactDom = requireReactDom();
33902
-
33903
- var _reactDom2 = _interopRequireDefault(_reactDom);
33904
-
33905
- var _propTypes = /*@__PURE__*/ requirePropTypes();
33906
-
33907
- var _propTypes2 = _interopRequireDefault(_propTypes);
33908
-
33909
- var _ModalPortal = requireModalPortal();
33910
-
33911
- var _ModalPortal2 = _interopRequireDefault(_ModalPortal);
33912
-
33913
- var _ariaAppHider = requireAriaAppHider();
33914
-
33915
- var ariaAppHider = _interopRequireWildcard(_ariaAppHider);
33916
-
33917
- var _safeHTMLElement = requireSafeHTMLElement();
33918
-
33919
- var _safeHTMLElement2 = _interopRequireDefault(_safeHTMLElement);
33920
-
33921
- var _reactLifecyclesCompat = require$$6;
33922
-
33923
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
33924
-
33925
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33926
-
33927
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33928
-
33929
- 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; }
33930
-
33931
- 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; }
33932
-
33933
- var portalClassName = Modal.portalClassName = "ReactModalPortal";
33934
- var bodyOpenClassName = Modal.bodyOpenClassName = "ReactModal__Body--open";
33935
-
33936
- var isReact16 = _safeHTMLElement.canUseDOM && _reactDom2.default.createPortal !== undefined;
33937
-
33938
- var createHTMLElement = function createHTMLElement(name) {
33939
- return document.createElement(name);
33940
- };
33941
-
33942
- var getCreatePortal = function getCreatePortal() {
33943
- return isReact16 ? _reactDom2.default.createPortal : _reactDom2.default.unstable_renderSubtreeIntoContainer;
33944
- };
33945
-
33946
- function getParentElement(parentSelector) {
33947
- return parentSelector();
33948
- }
33949
-
33950
- var Modal$1 = function (_Component) {
33951
- _inherits(Modal, _Component);
33952
-
33953
- function Modal() {
33954
- var _ref;
33955
-
33956
- var _temp, _this, _ret;
33957
-
33958
- _classCallCheck(this, Modal);
33959
-
33960
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
33961
- args[_key] = arguments[_key];
33962
- }
33963
-
33964
- return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Modal.__proto__ || Object.getPrototypeOf(Modal)).call.apply(_ref, [this].concat(args))), _this), _this.removePortal = function () {
33965
- !isReact16 && _reactDom2.default.unmountComponentAtNode(_this.node);
33966
- var parent = getParentElement(_this.props.parentSelector);
33967
- if (parent && parent.contains(_this.node)) {
33968
- parent.removeChild(_this.node);
33969
- } else {
33970
- // eslint-disable-next-line no-console
33971
- console.warn('React-Modal: "parentSelector" prop did not returned any DOM ' + "element. Make sure that the parent element is unmounted to " + "avoid any memory leaks.");
33972
- }
33973
- }, _this.portalRef = function (ref) {
33974
- _this.portal = ref;
33975
- }, _this.renderPortal = function (props) {
33976
- var createPortal = getCreatePortal();
33977
- var portal = createPortal(_this, _react2.default.createElement(_ModalPortal2.default, _extends({ defaultStyles: Modal.defaultStyles }, props)), _this.node);
33978
- _this.portalRef(portal);
33979
- }, _temp), _possibleConstructorReturn(_this, _ret);
33980
- }
33981
-
33982
- _createClass(Modal, [{
33983
- key: "componentDidMount",
33984
- value: function componentDidMount() {
33985
- if (!_safeHTMLElement.canUseDOM) return;
33986
-
33987
- if (!isReact16) {
33988
- this.node = createHTMLElement("div");
33989
- }
33990
- this.node.className = this.props.portalClassName;
33991
-
33992
- var parent = getParentElement(this.props.parentSelector);
33993
- parent.appendChild(this.node);
33994
-
33995
- !isReact16 && this.renderPortal(this.props);
33996
- }
33997
- }, {
33998
- key: "getSnapshotBeforeUpdate",
33999
- value: function getSnapshotBeforeUpdate(prevProps) {
34000
- var prevParent = getParentElement(prevProps.parentSelector);
34001
- var nextParent = getParentElement(this.props.parentSelector);
34002
- return { prevParent: prevParent, nextParent: nextParent };
34003
- }
34004
- }, {
34005
- key: "componentDidUpdate",
34006
- value: function componentDidUpdate(prevProps, _, snapshot) {
34007
- if (!_safeHTMLElement.canUseDOM) return;
34008
- var _props = this.props,
34009
- isOpen = _props.isOpen,
34010
- portalClassName = _props.portalClassName;
34011
-
34012
-
34013
- if (prevProps.portalClassName !== portalClassName) {
34014
- this.node.className = portalClassName;
34015
- }
34016
-
34017
- var prevParent = snapshot.prevParent,
34018
- nextParent = snapshot.nextParent;
34019
-
34020
- if (nextParent !== prevParent) {
34021
- prevParent.removeChild(this.node);
34022
- nextParent.appendChild(this.node);
34023
- }
34024
-
34025
- // Stop unnecessary renders if modal is remaining closed
34026
- if (!prevProps.isOpen && !isOpen) return;
34027
-
34028
- !isReact16 && this.renderPortal(this.props);
34029
- }
34030
- }, {
34031
- key: "componentWillUnmount",
34032
- value: function componentWillUnmount() {
34033
- if (!_safeHTMLElement.canUseDOM || !this.node || !this.portal) return;
34034
-
34035
- var state = this.portal.state;
34036
- var now = Date.now();
34037
- var closesAt = state.isOpen && this.props.closeTimeoutMS && (state.closesAt || now + this.props.closeTimeoutMS);
34038
-
34039
- if (closesAt) {
34040
- if (!state.beforeClose) {
34041
- this.portal.closeWithTimeout();
34042
- }
34043
-
34044
- setTimeout(this.removePortal, closesAt - now);
34045
- } else {
34046
- this.removePortal();
34047
- }
34048
- }
34049
- }, {
34050
- key: "render",
34051
- value: function render() {
34052
- if (!_safeHTMLElement.canUseDOM || !isReact16) {
34053
- return null;
34054
- }
34055
-
34056
- if (!this.node && isReact16) {
34057
- this.node = createHTMLElement("div");
34058
- }
34059
-
34060
- var createPortal = getCreatePortal();
34061
- return createPortal(_react2.default.createElement(_ModalPortal2.default, _extends({
34062
- ref: this.portalRef,
34063
- defaultStyles: Modal.defaultStyles
34064
- }, this.props)), this.node);
34065
- }
34066
- }], [{
34067
- key: "setAppElement",
34068
- value: function setAppElement(element) {
34069
- ariaAppHider.setElement(element);
34070
- }
34071
-
34072
- /* eslint-disable react/no-unused-prop-types */
34073
-
34074
- /* eslint-enable react/no-unused-prop-types */
34075
-
34076
- }]);
34077
-
34078
- return Modal;
34079
- }(_react.Component);
34080
-
34081
- Modal$1.propTypes = {
34082
- isOpen: _propTypes2.default.bool.isRequired,
34083
- style: _propTypes2.default.shape({
34084
- content: _propTypes2.default.object,
34085
- overlay: _propTypes2.default.object
34086
- }),
34087
- portalClassName: _propTypes2.default.string,
34088
- bodyOpenClassName: _propTypes2.default.string,
34089
- htmlOpenClassName: _propTypes2.default.string,
34090
- className: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
34091
- base: _propTypes2.default.string.isRequired,
34092
- afterOpen: _propTypes2.default.string.isRequired,
34093
- beforeClose: _propTypes2.default.string.isRequired
34094
- })]),
34095
- overlayClassName: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.shape({
34096
- base: _propTypes2.default.string.isRequired,
34097
- afterOpen: _propTypes2.default.string.isRequired,
34098
- beforeClose: _propTypes2.default.string.isRequired
34099
- })]),
34100
- appElement: _propTypes2.default.oneOfType([_propTypes2.default.instanceOf(_safeHTMLElement2.default), _propTypes2.default.instanceOf(_safeHTMLElement.SafeHTMLCollection), _propTypes2.default.instanceOf(_safeHTMLElement.SafeNodeList), _propTypes2.default.arrayOf(_propTypes2.default.instanceOf(_safeHTMLElement2.default))]),
34101
- onAfterOpen: _propTypes2.default.func,
34102
- onRequestClose: _propTypes2.default.func,
34103
- closeTimeoutMS: _propTypes2.default.number,
34104
- ariaHideApp: _propTypes2.default.bool,
34105
- shouldFocusAfterRender: _propTypes2.default.bool,
34106
- shouldCloseOnOverlayClick: _propTypes2.default.bool,
34107
- shouldReturnFocusAfterClose: _propTypes2.default.bool,
34108
- preventScroll: _propTypes2.default.bool,
34109
- parentSelector: _propTypes2.default.func,
34110
- aria: _propTypes2.default.object,
34111
- data: _propTypes2.default.object,
34112
- role: _propTypes2.default.string,
34113
- contentLabel: _propTypes2.default.string,
34114
- shouldCloseOnEsc: _propTypes2.default.bool,
34115
- overlayRef: _propTypes2.default.func,
34116
- contentRef: _propTypes2.default.func,
34117
- id: _propTypes2.default.string,
34118
- overlayElement: _propTypes2.default.func,
34119
- contentElement: _propTypes2.default.func
34120
- };
34121
- Modal$1.defaultProps = {
34122
- isOpen: false,
34123
- portalClassName: portalClassName,
34124
- bodyOpenClassName: bodyOpenClassName,
34125
- role: "dialog",
34126
- ariaHideApp: true,
34127
- closeTimeoutMS: 0,
34128
- shouldFocusAfterRender: true,
34129
- shouldCloseOnEsc: true,
34130
- shouldCloseOnOverlayClick: true,
34131
- shouldReturnFocusAfterClose: true,
34132
- preventScroll: false,
34133
- parentSelector: function parentSelector() {
34134
- return document.body;
34135
- },
34136
- overlayElement: function overlayElement(props, contentEl) {
34137
- return _react2.default.createElement(
34138
- "div",
34139
- props,
34140
- contentEl
34141
- );
34142
- },
34143
- contentElement: function contentElement(props, children) {
34144
- return _react2.default.createElement(
34145
- "div",
34146
- props,
34147
- children
34148
- );
34149
- }
34150
- };
34151
- Modal$1.defaultStyles = {
34152
- overlay: {
34153
- position: "fixed",
34154
- top: 0,
34155
- left: 0,
34156
- right: 0,
34157
- bottom: 0,
34158
- backgroundColor: "rgba(255, 255, 255, 0.75)"
34159
- },
34160
- content: {
34161
- position: "absolute",
34162
- top: "40px",
34163
- left: "40px",
34164
- right: "40px",
34165
- bottom: "40px",
34166
- border: "1px solid #ccc",
34167
- background: "#fff",
34168
- overflow: "auto",
34169
- WebkitOverflowScrolling: "touch",
34170
- borderRadius: "4px",
34171
- outline: "none",
34172
- padding: "20px"
34173
- }
34174
- };
34175
-
34176
-
34177
- (0, _reactLifecyclesCompat.polyfill)(Modal$1);
34178
-
34179
- if (process.env.NODE_ENV !== "production") {
34180
- Modal$1.setCreateHTMLElement = function (fn) {
34181
- return createHTMLElement = fn;
34182
- };
34183
- }
34184
-
34185
- Modal.default = Modal$1;
34186
- return Modal;
34187
- }
34188
-
34189
- var hasRequiredLib;
34190
-
34191
- function requireLib () {
34192
- if (hasRequiredLib) return lib.exports;
34193
- hasRequiredLib = 1;
34194
- (function (module, exports) {
34195
-
34196
- Object.defineProperty(exports, "__esModule", {
34197
- value: true
34198
- });
34199
-
34200
- var _Modal = requireModal();
34201
-
34202
- var _Modal2 = _interopRequireDefault(_Modal);
34203
-
34204
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
34205
-
34206
- exports.default = _Modal2.default;
34207
- module.exports = exports["default"];
34208
- } (lib, lib.exports));
34209
- return lib.exports;
34210
- }
34211
-
34212
- var libExports = requireLib();
34213
- var ReactModal = /*@__PURE__*/getDefaultExportFromCjs(libExports);
34214
-
34215
- var styles$8 = {"container":"Ui89ModalDialog-module_container__-azd7","appear":"Ui89ModalDialog-module_appear__Xt-kk","backdrop":"Ui89ModalDialog-module_backdrop__Hg1Dn","spacer":"Ui89ModalDialog-module_spacer__fS17b","container--size-big":"Ui89ModalDialog-module_container--size-big__03rgP","container--size-medium":"Ui89ModalDialog-module_container--size-medium__A3TJY","container--size-small":"Ui89ModalDialog-module_container--size-small__mxNgm"};
34216
-
34217
- var styles$7 = {"scene":"Ui89Scene-module_scene__5uNRp"};
34218
-
34219
- var lookStyles = {"main":"look-module_main__dCtZk","side":"look-module_side__bCbry"};
34220
-
34221
- var scrollbarStyles = {"container":"scrollbar-module_container__q4x0n"};
34222
-
34223
- function Ui89Scene({ look = Ui89Look.main, children, }) {
34224
- return (React__default.createElement("div", { className: `${styles$7.scene} ${lookStyles[look]} ${typoStyles.normal} ${scrollbarStyles.container}` }, children));
34225
- }
34226
-
34227
- var styles$6 = {"gridExpandTrick":"GridExpandTrick-module_gridExpandTrick__10Eg5"};
34228
-
34229
- function GridExpandTrick({ children, }) {
34230
- return React__default.createElement("span", { className: styles$6.gridExpandTrick }, children);
34231
- }
34232
-
34233
- var styles$5 = {"scrollContainer":"ScrollContainer-module_scrollContainer__J82cj"};
34234
-
34235
- function ScrollContainer({ children, }) {
34236
- return React__default.createElement("span", { className: styles$5.scrollContainer }, children);
34237
- }
34238
-
34239
- // @ts-ignore
34240
- function Ui89ModalDialog({ open, size = "medium", children, topCenter, onClose, onRequestClose, }) {
34241
- const className = useMemo(() => {
34242
- return [styles$8.container, styles$8[`container--size-${size}`]].join(" ");
34243
- }, [size]);
34244
- return (React__default.createElement(ReactModal, { className: className, overlayClassName: styles$8.backdrop, isOpen: open, onAfterClose: onClose, onRequestClose: onRequestClose,
34245
- // So it shuts up.
34246
- ariaHideApp: false },
34247
- React__default.createElement("div", { className: styles$8.spacer }),
34248
- React__default.createElement(HoverShadow, null,
34249
- React__default.createElement(GridExpandTrick, null,
34250
- React__default.createElement(Ui89Scene, { look: "side" },
34251
- React__default.createElement(Ui89Card, { topCenter: topCenter },
34252
- React__default.createElement(ScrollContainer, null, children)))))));
34253
- }
34254
-
34255
- var _path, _path2;
34256
- function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
34257
- const SvgShortcut = props => /*#__PURE__*/React.createElement("svg", _extends$1({
34258
- xmlns: "http://www.w3.org/2000/svg",
34259
- width: 100,
34260
- height: 100
34261
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
34262
- stroke: "#000",
34263
- strokeWidth: 15,
34264
- d: "M80 80 20 20"
34265
- })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
34266
- stroke: "#000",
34267
- strokeLinecap: "round",
34268
- strokeWidth: 15,
34269
- d: "M20 20h30M20 20v30"
34270
- })));
34271
-
34272
- var styles$4 = {"container":"Ui89Shortcut-module_container__L07CL","image":"Ui89Shortcut-module_image__f4Hsg","shortcutIcon":"Ui89Shortcut-module_shortcutIcon__SjZkr"};
34273
-
34274
- function Ui89Shortcut({ imageUrl, label, onClick = () => { }, }) {
34275
- function onNativeClick() {
34276
- onClick();
34277
- }
34278
- return (React__default.createElement("div", { className: styles$4.container },
34279
- React__default.createElement("img", { className: styles$4.image, src: imageUrl, onClick: onNativeClick }),
34280
- React__default.createElement(SvgShortcut, { className: styles$4.shortcutIcon, width: 16, height: 16 }),
34281
- React__default.createElement("div", { className: `${typoStyles.smallBold}` }, label)));
34282
- }
34283
-
34284
- function Ui89SpaceVertical({ gap = 1 }) {
34285
- const style = {
34286
- paddingTop: `calc(var(--ui89-safe-space) * ${gap})`,
34287
- };
34288
- return React__default.createElement("div", { style: style });
34289
- }
34290
-
34291
- var styles$3 = {"navigation":"Ui89Tabs-module_navigation__y1WSG","navigationItem":"Ui89Tabs-module_navigationItem__keX-1","navigationItemSelected":"Ui89Tabs-module_navigationItemSelected__R7dba"};
34292
-
34293
- function Ui89Tabs({ selected, onChange = () => { }, items = [], }) {
34294
- function handleOnChange(value) {
34295
- onChange(value);
34296
- }
34297
- return (React__default.createElement("div", { className: styles$3.navigation }, items.map((item) => (React__default.createElement("div", { className: [
34298
- styles$3.navigationItem,
34299
- typoStyles.smallBold,
34300
- selected === item.value ? styles$3.navigationItemSelected : "",
34301
- ].join(" "), key: item.value, onClick: () => handleOnChange(item.value) }, item.label)))));
34302
- }
34303
-
34304
- function Ui89TabbedCard({ selected, onChange = () => { }, items = [], }) {
34305
- const selectedItem = useMemo(() => {
34306
- return items.find((item) => item.value === selected) ?? null;
34307
- }, [selected, items]);
34308
- const render = useMemo(() => {
34309
- return selectedItem !== null ? selectedItem.render : () => React__default.createElement(React__default.Fragment, null);
34310
- }, [selectedItem]);
34311
- const renderKey = useMemo(() => {
34312
- return selectedItem !== null ? selectedItem.value : undefined;
34313
- }, [selectedItem]);
34314
- return (React__default.createElement(Ui89Card, { topCenter: React__default.createElement(Ui89Tabs, { selected: selected, items: items, onChange: onChange }) },
34315
- React__default.createElement(React__default.Fragment, { key: renderKey }, render())));
34316
- }
34317
-
34318
- var style = {"container":"Ui89TagBox-module_container__2GXMj"};
34319
-
34320
- function Ui89TagBox({ theme, children, }) {
34321
- return (React__default.createElement("div", { className: `${style.container} ${typoStyles.special} ${chosenThemeStyles[theme]}` }, children));
34322
- }
34323
-
34324
- var styles$2 = {"container":"Ui89TitleBox-module_container__M-b7J","inside":"Ui89TitleBox-module_inside__GWTlP"};
34325
-
34326
- var textStyles = {"unbreakable":"text-module_unbreakable__3eDe3","ellipsis":"text-module_ellipsis__3-f-B","singleLine":"text-module_singleLine__X6pYL"};
34327
-
34328
- function Ui89TitleBox({ children }) {
34329
- return (React__default.createElement("div", { className: `${styles$2.container} ${typoStyles.special}` },
34330
- React__default.createElement("div", { className: `${styles$2.inside} ${textStyles.singleLine}` }, children)));
34331
- }
34332
-
34333
- var styles$1 = {"container":"Ui89TitleUnderline-module_container__EaGZi","inside":"Ui89TitleUnderline-module_inside__uwwxa"};
31218
+ var styles$1 = {"container":"Ui89TitleUnderline-module_container__EaGZi","inside":"Ui89TitleUnderline-module_inside__uwwxa"};
34334
31219
 
34335
31220
  function Ui89TitleUnderline({ children, }) {
34336
31221
  return (React__default.createElement("div", { className: `${styles$1.container} ${typoStyles.special}` },
34337
31222
  React__default.createElement("div", { className: `${styles$1.inside} ${textStyles.singleLine}` }, children)));
34338
31223
  }
34339
31224
 
34340
- function _extends() {
34341
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
34342
- for (var e = 1; e < arguments.length; e++) {
34343
- var t = arguments[e];
34344
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
34345
- }
34346
- return n;
34347
- }, _extends.apply(null, arguments);
34348
- }
34349
-
34350
- function _assertThisInitialized(e) {
34351
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
34352
- return e;
34353
- }
34354
-
34355
- function _setPrototypeOf(t, e) {
34356
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
34357
- return t.__proto__ = e, t;
34358
- }, _setPrototypeOf(t, e);
34359
- }
34360
-
34361
- function _inheritsLoose(t, o) {
34362
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
34363
- }
34364
-
34365
- var safeIsNaN = Number.isNaN ||
34366
- function ponyfill(value) {
34367
- return typeof value === 'number' && value !== value;
34368
- };
34369
- function isEqual(first, second) {
34370
- if (first === second) {
34371
- return true;
34372
- }
34373
- if (safeIsNaN(first) && safeIsNaN(second)) {
34374
- return true;
34375
- }
34376
- return false;
34377
- }
34378
- function areInputsEqual(newInputs, lastInputs) {
34379
- if (newInputs.length !== lastInputs.length) {
34380
- return false;
34381
- }
34382
- for (var i = 0; i < newInputs.length; i++) {
34383
- if (!isEqual(newInputs[i], lastInputs[i])) {
34384
- return false;
34385
- }
34386
- }
34387
- return true;
34388
- }
34389
-
34390
- function memoizeOne(resultFn, isEqual) {
34391
- if (isEqual === void 0) { isEqual = areInputsEqual; }
34392
- var lastThis;
34393
- var lastArgs = [];
34394
- var lastResult;
34395
- var calledOnce = false;
34396
- function memoized() {
34397
- var newArgs = [];
34398
- for (var _i = 0; _i < arguments.length; _i++) {
34399
- newArgs[_i] = arguments[_i];
34400
- }
34401
- if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
34402
- return lastResult;
34403
- }
34404
- lastResult = resultFn.apply(this, newArgs);
34405
- calledOnce = true;
34406
- lastThis = this;
34407
- lastArgs = newArgs;
34408
- return lastResult;
34409
- }
34410
- return memoized;
34411
- }
34412
-
34413
- // Animation frame based implementation of setTimeout.
34414
- // Inspired by Joe Lambert, https://gist.github.com/joelambert/1002116#file-requesttimeout-js
34415
- var hasNativePerformanceNow = typeof performance === 'object' && typeof performance.now === 'function';
34416
- var now = hasNativePerformanceNow ? function () {
34417
- return performance.now();
34418
- } : function () {
34419
- return Date.now();
34420
- };
34421
- function cancelTimeout(timeoutID) {
34422
- cancelAnimationFrame(timeoutID.id);
34423
- }
34424
- function requestTimeout(callback, delay) {
34425
- var start = now();
34426
-
34427
- function tick() {
34428
- if (now() - start >= delay) {
34429
- callback.call(null);
34430
- } else {
34431
- timeoutID.id = requestAnimationFrame(tick);
34432
- }
34433
- }
34434
-
34435
- var timeoutID = {
34436
- id: requestAnimationFrame(tick)
34437
- };
34438
- return timeoutID;
34439
- }
34440
-
34441
- var size = -1; // This utility copied from "dom-helpers" package.
34442
-
34443
- function getScrollbarSize(recalculate) {
34444
- if (recalculate === void 0) {
34445
- recalculate = false;
34446
- }
34447
-
34448
- if (size === -1 || recalculate) {
34449
- var div = document.createElement('div');
34450
- var style = div.style;
34451
- style.width = '50px';
34452
- style.height = '50px';
34453
- style.overflow = 'scroll';
34454
- document.body.appendChild(div);
34455
- size = div.offsetWidth - div.clientWidth;
34456
- document.body.removeChild(div);
34457
- }
34458
-
34459
- return size;
34460
- }
34461
- var cachedRTLResult = null; // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
34462
- // Chrome does not seem to adhere; its scrollLeft values are positive (measured relative to the left).
34463
- // Safari's elastic bounce makes detecting this even more complicated wrt potential false positives.
34464
- // The safest way to check this is to intentionally set a negative offset,
34465
- // and then verify that the subsequent "scroll" event matches the negative offset.
34466
- // If it does not match, then we can assume a non-standard RTL scroll implementation.
34467
-
34468
- function getRTLOffsetType(recalculate) {
34469
- if (recalculate === void 0) {
34470
- recalculate = false;
34471
- }
34472
-
34473
- if (cachedRTLResult === null || recalculate) {
34474
- var outerDiv = document.createElement('div');
34475
- var outerStyle = outerDiv.style;
34476
- outerStyle.width = '50px';
34477
- outerStyle.height = '50px';
34478
- outerStyle.overflow = 'scroll';
34479
- outerStyle.direction = 'rtl';
34480
- var innerDiv = document.createElement('div');
34481
- var innerStyle = innerDiv.style;
34482
- innerStyle.width = '100px';
34483
- innerStyle.height = '100px';
34484
- outerDiv.appendChild(innerDiv);
34485
- document.body.appendChild(outerDiv);
34486
-
34487
- if (outerDiv.scrollLeft > 0) {
34488
- cachedRTLResult = 'positive-descending';
34489
- } else {
34490
- outerDiv.scrollLeft = 1;
34491
-
34492
- if (outerDiv.scrollLeft === 0) {
34493
- cachedRTLResult = 'negative';
34494
- } else {
34495
- cachedRTLResult = 'positive-ascending';
34496
- }
34497
- }
34498
-
34499
- document.body.removeChild(outerDiv);
34500
- return cachedRTLResult;
34501
- }
34502
-
34503
- return cachedRTLResult;
34504
- }
34505
-
34506
- var IS_SCROLLING_DEBOUNCE_INTERVAL = 150;
34507
-
34508
- var defaultItemKey = function defaultItemKey(_ref) {
34509
- var columnIndex = _ref.columnIndex;
34510
- _ref.data;
34511
- var rowIndex = _ref.rowIndex;
34512
- return rowIndex + ":" + columnIndex;
34513
- }; // In DEV mode, this Set helps us only log a warning once per component instance.
34514
- // This avoids spamming the console every time a render happens.
34515
-
34516
-
34517
- var devWarningsOverscanCount = null;
34518
- var devWarningsOverscanRowsColumnsCount = null;
34519
- var devWarningsTagName = null;
34520
-
34521
- if (process.env.NODE_ENV !== 'production') {
34522
- if (typeof window !== 'undefined' && typeof window.WeakSet !== 'undefined') {
34523
- devWarningsOverscanCount = /*#__PURE__*/new WeakSet();
34524
- devWarningsOverscanRowsColumnsCount = /*#__PURE__*/new WeakSet();
34525
- devWarningsTagName = /*#__PURE__*/new WeakSet();
34526
- }
34527
- }
34528
-
34529
- function createGridComponent(_ref2) {
34530
- var _class;
34531
-
34532
- var getColumnOffset = _ref2.getColumnOffset,
34533
- getColumnStartIndexForOffset = _ref2.getColumnStartIndexForOffset,
34534
- getColumnStopIndexForStartIndex = _ref2.getColumnStopIndexForStartIndex,
34535
- getColumnWidth = _ref2.getColumnWidth,
34536
- getEstimatedTotalHeight = _ref2.getEstimatedTotalHeight,
34537
- getEstimatedTotalWidth = _ref2.getEstimatedTotalWidth,
34538
- getOffsetForColumnAndAlignment = _ref2.getOffsetForColumnAndAlignment,
34539
- getOffsetForRowAndAlignment = _ref2.getOffsetForRowAndAlignment,
34540
- getRowHeight = _ref2.getRowHeight,
34541
- getRowOffset = _ref2.getRowOffset,
34542
- getRowStartIndexForOffset = _ref2.getRowStartIndexForOffset,
34543
- getRowStopIndexForStartIndex = _ref2.getRowStopIndexForStartIndex,
34544
- initInstanceProps = _ref2.initInstanceProps,
34545
- shouldResetStyleCacheOnItemSizeChange = _ref2.shouldResetStyleCacheOnItemSizeChange,
34546
- validateProps = _ref2.validateProps;
34547
- return _class = /*#__PURE__*/function (_PureComponent) {
34548
- _inheritsLoose(Grid, _PureComponent);
34549
-
34550
- // Always use explicit constructor for React components.
34551
- // It produces less code after transpilation. (#26)
34552
- // eslint-disable-next-line no-useless-constructor
34553
- function Grid(props) {
34554
- var _this;
34555
-
34556
- _this = _PureComponent.call(this, props) || this;
34557
- _this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_this));
34558
- _this._resetIsScrollingTimeoutId = null;
34559
- _this._outerRef = void 0;
34560
- _this.state = {
34561
- instance: _assertThisInitialized(_this),
34562
- isScrolling: false,
34563
- horizontalScrollDirection: 'forward',
34564
- scrollLeft: typeof _this.props.initialScrollLeft === 'number' ? _this.props.initialScrollLeft : 0,
34565
- scrollTop: typeof _this.props.initialScrollTop === 'number' ? _this.props.initialScrollTop : 0,
34566
- scrollUpdateWasRequested: false,
34567
- verticalScrollDirection: 'forward'
34568
- };
34569
- _this._callOnItemsRendered = void 0;
34570
- _this._callOnItemsRendered = memoizeOne(function (overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex) {
34571
- return _this.props.onItemsRendered({
34572
- overscanColumnStartIndex: overscanColumnStartIndex,
34573
- overscanColumnStopIndex: overscanColumnStopIndex,
34574
- overscanRowStartIndex: overscanRowStartIndex,
34575
- overscanRowStopIndex: overscanRowStopIndex,
34576
- visibleColumnStartIndex: visibleColumnStartIndex,
34577
- visibleColumnStopIndex: visibleColumnStopIndex,
34578
- visibleRowStartIndex: visibleRowStartIndex,
34579
- visibleRowStopIndex: visibleRowStopIndex
34580
- });
34581
- });
34582
- _this._callOnScroll = void 0;
34583
- _this._callOnScroll = memoizeOne(function (scrollLeft, scrollTop, horizontalScrollDirection, verticalScrollDirection, scrollUpdateWasRequested) {
34584
- return _this.props.onScroll({
34585
- horizontalScrollDirection: horizontalScrollDirection,
34586
- scrollLeft: scrollLeft,
34587
- scrollTop: scrollTop,
34588
- verticalScrollDirection: verticalScrollDirection,
34589
- scrollUpdateWasRequested: scrollUpdateWasRequested
34590
- });
34591
- });
34592
- _this._getItemStyle = void 0;
34593
-
34594
- _this._getItemStyle = function (rowIndex, columnIndex) {
34595
- var _this$props = _this.props,
34596
- columnWidth = _this$props.columnWidth,
34597
- direction = _this$props.direction,
34598
- rowHeight = _this$props.rowHeight;
34599
-
34600
- var itemStyleCache = _this._getItemStyleCache(shouldResetStyleCacheOnItemSizeChange && columnWidth, shouldResetStyleCacheOnItemSizeChange && direction, shouldResetStyleCacheOnItemSizeChange && rowHeight);
34601
-
34602
- var key = rowIndex + ":" + columnIndex;
34603
- var style;
34604
-
34605
- if (itemStyleCache.hasOwnProperty(key)) {
34606
- style = itemStyleCache[key];
34607
- } else {
34608
- var _offset = getColumnOffset(_this.props, columnIndex, _this._instanceProps);
34609
-
34610
- var isRtl = direction === 'rtl';
34611
- itemStyleCache[key] = style = {
34612
- position: 'absolute',
34613
- left: isRtl ? undefined : _offset,
34614
- right: isRtl ? _offset : undefined,
34615
- top: getRowOffset(_this.props, rowIndex, _this._instanceProps),
34616
- height: getRowHeight(_this.props, rowIndex, _this._instanceProps),
34617
- width: getColumnWidth(_this.props, columnIndex, _this._instanceProps)
34618
- };
34619
- }
34620
-
34621
- return style;
34622
- };
34623
-
34624
- _this._getItemStyleCache = void 0;
34625
- _this._getItemStyleCache = memoizeOne(function (_, __, ___) {
34626
- return {};
34627
- });
34628
-
34629
- _this._onScroll = function (event) {
34630
- var _event$currentTarget = event.currentTarget,
34631
- clientHeight = _event$currentTarget.clientHeight,
34632
- clientWidth = _event$currentTarget.clientWidth,
34633
- scrollLeft = _event$currentTarget.scrollLeft,
34634
- scrollTop = _event$currentTarget.scrollTop,
34635
- scrollHeight = _event$currentTarget.scrollHeight,
34636
- scrollWidth = _event$currentTarget.scrollWidth;
34637
-
34638
- _this.setState(function (prevState) {
34639
- if (prevState.scrollLeft === scrollLeft && prevState.scrollTop === scrollTop) {
34640
- // Scroll position may have been updated by cDM/cDU,
34641
- // In which case we don't need to trigger another render,
34642
- // And we don't want to update state.isScrolling.
34643
- return null;
34644
- }
34645
-
34646
- var direction = _this.props.direction; // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
34647
- // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
34648
- // It's also easier for this component if we convert offsets to the same format as they would be in for ltr.
34649
- // So the simplest solution is to determine which browser behavior we're dealing with, and convert based on it.
34650
-
34651
- var calculatedScrollLeft = scrollLeft;
34652
-
34653
- if (direction === 'rtl') {
34654
- switch (getRTLOffsetType()) {
34655
- case 'negative':
34656
- calculatedScrollLeft = -scrollLeft;
34657
- break;
34658
-
34659
- case 'positive-descending':
34660
- calculatedScrollLeft = scrollWidth - clientWidth - scrollLeft;
34661
- break;
34662
- }
34663
- } // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.
34664
-
34665
-
34666
- calculatedScrollLeft = Math.max(0, Math.min(calculatedScrollLeft, scrollWidth - clientWidth));
34667
- var calculatedScrollTop = Math.max(0, Math.min(scrollTop, scrollHeight - clientHeight));
34668
- return {
34669
- isScrolling: true,
34670
- horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
34671
- scrollLeft: calculatedScrollLeft,
34672
- scrollTop: calculatedScrollTop,
34673
- verticalScrollDirection: prevState.scrollTop < scrollTop ? 'forward' : 'backward',
34674
- scrollUpdateWasRequested: false
34675
- };
34676
- }, _this._resetIsScrollingDebounced);
34677
- };
34678
-
34679
- _this._outerRefSetter = function (ref) {
34680
- var outerRef = _this.props.outerRef;
34681
- _this._outerRef = ref;
34682
-
34683
- if (typeof outerRef === 'function') {
34684
- outerRef(ref);
34685
- } else if (outerRef != null && typeof outerRef === 'object' && outerRef.hasOwnProperty('current')) {
34686
- outerRef.current = ref;
34687
- }
34688
- };
34689
-
34690
- _this._resetIsScrollingDebounced = function () {
34691
- if (_this._resetIsScrollingTimeoutId !== null) {
34692
- cancelTimeout(_this._resetIsScrollingTimeoutId);
34693
- }
34694
-
34695
- _this._resetIsScrollingTimeoutId = requestTimeout(_this._resetIsScrolling, IS_SCROLLING_DEBOUNCE_INTERVAL);
34696
- };
34697
-
34698
- _this._resetIsScrolling = function () {
34699
- _this._resetIsScrollingTimeoutId = null;
34700
-
34701
- _this.setState({
34702
- isScrolling: false
34703
- }, function () {
34704
- // Clear style cache after state update has been committed.
34705
- // This way we don't break pure sCU for items that don't use isScrolling param.
34706
- _this._getItemStyleCache(-1);
34707
- });
34708
- };
34709
-
34710
- return _this;
34711
- }
34712
-
34713
- Grid.getDerivedStateFromProps = function getDerivedStateFromProps(nextProps, prevState) {
34714
- validateSharedProps(nextProps, prevState);
34715
- validateProps(nextProps);
34716
- return null;
34717
- };
34718
-
34719
- var _proto = Grid.prototype;
34720
-
34721
- _proto.scrollTo = function scrollTo(_ref3) {
34722
- var scrollLeft = _ref3.scrollLeft,
34723
- scrollTop = _ref3.scrollTop;
34724
-
34725
- if (scrollLeft !== undefined) {
34726
- scrollLeft = Math.max(0, scrollLeft);
34727
- }
34728
-
34729
- if (scrollTop !== undefined) {
34730
- scrollTop = Math.max(0, scrollTop);
34731
- }
34732
-
34733
- this.setState(function (prevState) {
34734
- if (scrollLeft === undefined) {
34735
- scrollLeft = prevState.scrollLeft;
34736
- }
34737
-
34738
- if (scrollTop === undefined) {
34739
- scrollTop = prevState.scrollTop;
34740
- }
34741
-
34742
- if (prevState.scrollLeft === scrollLeft && prevState.scrollTop === scrollTop) {
34743
- return null;
34744
- }
34745
-
34746
- return {
34747
- horizontalScrollDirection: prevState.scrollLeft < scrollLeft ? 'forward' : 'backward',
34748
- scrollLeft: scrollLeft,
34749
- scrollTop: scrollTop,
34750
- scrollUpdateWasRequested: true,
34751
- verticalScrollDirection: prevState.scrollTop < scrollTop ? 'forward' : 'backward'
34752
- };
34753
- }, this._resetIsScrollingDebounced);
34754
- };
34755
-
34756
- _proto.scrollToItem = function scrollToItem(_ref4) {
34757
- var _ref4$align = _ref4.align,
34758
- align = _ref4$align === void 0 ? 'auto' : _ref4$align,
34759
- columnIndex = _ref4.columnIndex,
34760
- rowIndex = _ref4.rowIndex;
34761
- var _this$props2 = this.props,
34762
- columnCount = _this$props2.columnCount,
34763
- height = _this$props2.height,
34764
- rowCount = _this$props2.rowCount,
34765
- width = _this$props2.width;
34766
- var _this$state = this.state,
34767
- scrollLeft = _this$state.scrollLeft,
34768
- scrollTop = _this$state.scrollTop;
34769
- var scrollbarSize = getScrollbarSize();
34770
-
34771
- if (columnIndex !== undefined) {
34772
- columnIndex = Math.max(0, Math.min(columnIndex, columnCount - 1));
34773
- }
34774
-
34775
- if (rowIndex !== undefined) {
34776
- rowIndex = Math.max(0, Math.min(rowIndex, rowCount - 1));
34777
- }
34778
-
34779
- var estimatedTotalHeight = getEstimatedTotalHeight(this.props, this._instanceProps);
34780
- var estimatedTotalWidth = getEstimatedTotalWidth(this.props, this._instanceProps); // The scrollbar size should be considered when scrolling an item into view,
34781
- // to ensure it's fully visible.
34782
- // But we only need to account for its size when it's actually visible.
34783
-
34784
- var horizontalScrollbarSize = estimatedTotalWidth > width ? scrollbarSize : 0;
34785
- var verticalScrollbarSize = estimatedTotalHeight > height ? scrollbarSize : 0;
34786
- this.scrollTo({
34787
- scrollLeft: columnIndex !== undefined ? getOffsetForColumnAndAlignment(this.props, columnIndex, align, scrollLeft, this._instanceProps, verticalScrollbarSize) : scrollLeft,
34788
- scrollTop: rowIndex !== undefined ? getOffsetForRowAndAlignment(this.props, rowIndex, align, scrollTop, this._instanceProps, horizontalScrollbarSize) : scrollTop
34789
- });
34790
- };
34791
-
34792
- _proto.componentDidMount = function componentDidMount() {
34793
- var _this$props3 = this.props,
34794
- initialScrollLeft = _this$props3.initialScrollLeft,
34795
- initialScrollTop = _this$props3.initialScrollTop;
34796
-
34797
- if (this._outerRef != null) {
34798
- var outerRef = this._outerRef;
34799
-
34800
- if (typeof initialScrollLeft === 'number') {
34801
- outerRef.scrollLeft = initialScrollLeft;
34802
- }
34803
-
34804
- if (typeof initialScrollTop === 'number') {
34805
- outerRef.scrollTop = initialScrollTop;
34806
- }
34807
- }
34808
-
34809
- this._callPropsCallbacks();
34810
- };
34811
-
34812
- _proto.componentDidUpdate = function componentDidUpdate() {
34813
- var direction = this.props.direction;
34814
- var _this$state2 = this.state,
34815
- scrollLeft = _this$state2.scrollLeft,
34816
- scrollTop = _this$state2.scrollTop,
34817
- scrollUpdateWasRequested = _this$state2.scrollUpdateWasRequested;
34818
-
34819
- if (scrollUpdateWasRequested && this._outerRef != null) {
34820
- // TRICKY According to the spec, scrollLeft should be negative for RTL aligned elements.
34821
- // This is not the case for all browsers though (e.g. Chrome reports values as positive, measured relative to the left).
34822
- // So we need to determine which browser behavior we're dealing with, and mimic it.
34823
- var outerRef = this._outerRef;
34824
-
34825
- if (direction === 'rtl') {
34826
- switch (getRTLOffsetType()) {
34827
- case 'negative':
34828
- outerRef.scrollLeft = -scrollLeft;
34829
- break;
34830
-
34831
- case 'positive-ascending':
34832
- outerRef.scrollLeft = scrollLeft;
34833
- break;
34834
-
34835
- default:
34836
- var clientWidth = outerRef.clientWidth,
34837
- scrollWidth = outerRef.scrollWidth;
34838
- outerRef.scrollLeft = scrollWidth - clientWidth - scrollLeft;
34839
- break;
34840
- }
34841
- } else {
34842
- outerRef.scrollLeft = Math.max(0, scrollLeft);
34843
- }
34844
-
34845
- outerRef.scrollTop = Math.max(0, scrollTop);
34846
- }
34847
-
34848
- this._callPropsCallbacks();
34849
- };
34850
-
34851
- _proto.componentWillUnmount = function componentWillUnmount() {
34852
- if (this._resetIsScrollingTimeoutId !== null) {
34853
- cancelTimeout(this._resetIsScrollingTimeoutId);
34854
- }
34855
- };
34856
-
34857
- _proto.render = function render() {
34858
- var _this$props4 = this.props,
34859
- children = _this$props4.children,
34860
- className = _this$props4.className,
34861
- columnCount = _this$props4.columnCount,
34862
- direction = _this$props4.direction,
34863
- height = _this$props4.height,
34864
- innerRef = _this$props4.innerRef,
34865
- innerElementType = _this$props4.innerElementType,
34866
- innerTagName = _this$props4.innerTagName,
34867
- itemData = _this$props4.itemData,
34868
- _this$props4$itemKey = _this$props4.itemKey,
34869
- itemKey = _this$props4$itemKey === void 0 ? defaultItemKey : _this$props4$itemKey,
34870
- outerElementType = _this$props4.outerElementType,
34871
- outerTagName = _this$props4.outerTagName,
34872
- rowCount = _this$props4.rowCount,
34873
- style = _this$props4.style,
34874
- useIsScrolling = _this$props4.useIsScrolling,
34875
- width = _this$props4.width;
34876
- var isScrolling = this.state.isScrolling;
34877
-
34878
- var _this$_getHorizontalR = this._getHorizontalRangeToRender(),
34879
- columnStartIndex = _this$_getHorizontalR[0],
34880
- columnStopIndex = _this$_getHorizontalR[1];
34881
-
34882
- var _this$_getVerticalRan = this._getVerticalRangeToRender(),
34883
- rowStartIndex = _this$_getVerticalRan[0],
34884
- rowStopIndex = _this$_getVerticalRan[1];
34885
-
34886
- var items = [];
34887
-
34888
- if (columnCount > 0 && rowCount) {
34889
- for (var _rowIndex = rowStartIndex; _rowIndex <= rowStopIndex; _rowIndex++) {
34890
- for (var _columnIndex = columnStartIndex; _columnIndex <= columnStopIndex; _columnIndex++) {
34891
- items.push(createElement(children, {
34892
- columnIndex: _columnIndex,
34893
- data: itemData,
34894
- isScrolling: useIsScrolling ? isScrolling : undefined,
34895
- key: itemKey({
34896
- columnIndex: _columnIndex,
34897
- data: itemData,
34898
- rowIndex: _rowIndex
34899
- }),
34900
- rowIndex: _rowIndex,
34901
- style: this._getItemStyle(_rowIndex, _columnIndex)
34902
- }));
34903
- }
34904
- }
34905
- } // Read this value AFTER items have been created,
34906
- // So their actual sizes (if variable) are taken into consideration.
34907
-
34908
-
34909
- var estimatedTotalHeight = getEstimatedTotalHeight(this.props, this._instanceProps);
34910
- var estimatedTotalWidth = getEstimatedTotalWidth(this.props, this._instanceProps);
34911
- return createElement(outerElementType || outerTagName || 'div', {
34912
- className: className,
34913
- onScroll: this._onScroll,
34914
- ref: this._outerRefSetter,
34915
- style: _extends({
34916
- position: 'relative',
34917
- height: height,
34918
- width: width,
34919
- overflow: 'auto',
34920
- WebkitOverflowScrolling: 'touch',
34921
- willChange: 'transform',
34922
- direction: direction
34923
- }, style)
34924
- }, createElement(innerElementType || innerTagName || 'div', {
34925
- children: items,
34926
- ref: innerRef,
34927
- style: {
34928
- height: estimatedTotalHeight,
34929
- pointerEvents: isScrolling ? 'none' : undefined,
34930
- width: estimatedTotalWidth
34931
- }
34932
- }));
34933
- };
34934
-
34935
- _proto._callPropsCallbacks = function _callPropsCallbacks() {
34936
- var _this$props5 = this.props,
34937
- columnCount = _this$props5.columnCount,
34938
- onItemsRendered = _this$props5.onItemsRendered,
34939
- onScroll = _this$props5.onScroll,
34940
- rowCount = _this$props5.rowCount;
34941
-
34942
- if (typeof onItemsRendered === 'function') {
34943
- if (columnCount > 0 && rowCount > 0) {
34944
- var _this$_getHorizontalR2 = this._getHorizontalRangeToRender(),
34945
- _overscanColumnStartIndex = _this$_getHorizontalR2[0],
34946
- _overscanColumnStopIndex = _this$_getHorizontalR2[1],
34947
- _visibleColumnStartIndex = _this$_getHorizontalR2[2],
34948
- _visibleColumnStopIndex = _this$_getHorizontalR2[3];
34949
-
34950
- var _this$_getVerticalRan2 = this._getVerticalRangeToRender(),
34951
- _overscanRowStartIndex = _this$_getVerticalRan2[0],
34952
- _overscanRowStopIndex = _this$_getVerticalRan2[1],
34953
- _visibleRowStartIndex = _this$_getVerticalRan2[2],
34954
- _visibleRowStopIndex = _this$_getVerticalRan2[3];
34955
-
34956
- this._callOnItemsRendered(_overscanColumnStartIndex, _overscanColumnStopIndex, _overscanRowStartIndex, _overscanRowStopIndex, _visibleColumnStartIndex, _visibleColumnStopIndex, _visibleRowStartIndex, _visibleRowStopIndex);
34957
- }
34958
- }
34959
-
34960
- if (typeof onScroll === 'function') {
34961
- var _this$state3 = this.state,
34962
- _horizontalScrollDirection = _this$state3.horizontalScrollDirection,
34963
- _scrollLeft = _this$state3.scrollLeft,
34964
- _scrollTop = _this$state3.scrollTop,
34965
- _scrollUpdateWasRequested = _this$state3.scrollUpdateWasRequested,
34966
- _verticalScrollDirection = _this$state3.verticalScrollDirection;
34967
-
34968
- this._callOnScroll(_scrollLeft, _scrollTop, _horizontalScrollDirection, _verticalScrollDirection, _scrollUpdateWasRequested);
34969
- }
34970
- } // Lazily create and cache item styles while scrolling,
34971
- // So that pure component sCU will prevent re-renders.
34972
- // We maintain this cache, and pass a style prop rather than index,
34973
- // So that List can clear cached styles and force item re-render if necessary.
34974
- ;
34975
-
34976
- _proto._getHorizontalRangeToRender = function _getHorizontalRangeToRender() {
34977
- var _this$props6 = this.props,
34978
- columnCount = _this$props6.columnCount,
34979
- overscanColumnCount = _this$props6.overscanColumnCount,
34980
- overscanColumnsCount = _this$props6.overscanColumnsCount,
34981
- overscanCount = _this$props6.overscanCount,
34982
- rowCount = _this$props6.rowCount;
34983
- var _this$state4 = this.state,
34984
- horizontalScrollDirection = _this$state4.horizontalScrollDirection,
34985
- isScrolling = _this$state4.isScrolling,
34986
- scrollLeft = _this$state4.scrollLeft;
34987
- var overscanCountResolved = overscanColumnCount || overscanColumnsCount || overscanCount || 1;
34988
-
34989
- if (columnCount === 0 || rowCount === 0) {
34990
- return [0, 0, 0, 0];
34991
- }
34992
-
34993
- var startIndex = getColumnStartIndexForOffset(this.props, scrollLeft, this._instanceProps);
34994
- var stopIndex = getColumnStopIndexForStartIndex(this.props, startIndex, scrollLeft, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.
34995
- // If there isn't at least one extra item, tab loops back around.
34996
-
34997
- var overscanBackward = !isScrolling || horizontalScrollDirection === 'backward' ? Math.max(1, overscanCountResolved) : 1;
34998
- var overscanForward = !isScrolling || horizontalScrollDirection === 'forward' ? Math.max(1, overscanCountResolved) : 1;
34999
- return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(columnCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
35000
- };
35001
-
35002
- _proto._getVerticalRangeToRender = function _getVerticalRangeToRender() {
35003
- var _this$props7 = this.props,
35004
- columnCount = _this$props7.columnCount,
35005
- overscanCount = _this$props7.overscanCount,
35006
- overscanRowCount = _this$props7.overscanRowCount,
35007
- overscanRowsCount = _this$props7.overscanRowsCount,
35008
- rowCount = _this$props7.rowCount;
35009
- var _this$state5 = this.state,
35010
- isScrolling = _this$state5.isScrolling,
35011
- verticalScrollDirection = _this$state5.verticalScrollDirection,
35012
- scrollTop = _this$state5.scrollTop;
35013
- var overscanCountResolved = overscanRowCount || overscanRowsCount || overscanCount || 1;
35014
-
35015
- if (columnCount === 0 || rowCount === 0) {
35016
- return [0, 0, 0, 0];
35017
- }
35018
-
35019
- var startIndex = getRowStartIndexForOffset(this.props, scrollTop, this._instanceProps);
35020
- var stopIndex = getRowStopIndexForStartIndex(this.props, startIndex, scrollTop, this._instanceProps); // Overscan by one item in each direction so that tab/focus works.
35021
- // If there isn't at least one extra item, tab loops back around.
35022
-
35023
- var overscanBackward = !isScrolling || verticalScrollDirection === 'backward' ? Math.max(1, overscanCountResolved) : 1;
35024
- var overscanForward = !isScrolling || verticalScrollDirection === 'forward' ? Math.max(1, overscanCountResolved) : 1;
35025
- return [Math.max(0, startIndex - overscanBackward), Math.max(0, Math.min(rowCount - 1, stopIndex + overscanForward)), startIndex, stopIndex];
35026
- };
35027
-
35028
- return Grid;
35029
- }(PureComponent), _class.defaultProps = {
35030
- direction: 'ltr',
35031
- itemData: undefined,
35032
- useIsScrolling: false
35033
- }, _class;
35034
- }
35035
-
35036
- var validateSharedProps = function validateSharedProps(_ref5, _ref6) {
35037
- var children = _ref5.children,
35038
- direction = _ref5.direction,
35039
- height = _ref5.height,
35040
- innerTagName = _ref5.innerTagName,
35041
- outerTagName = _ref5.outerTagName,
35042
- overscanColumnsCount = _ref5.overscanColumnsCount,
35043
- overscanCount = _ref5.overscanCount,
35044
- overscanRowsCount = _ref5.overscanRowsCount,
35045
- width = _ref5.width;
35046
- var instance = _ref6.instance;
35047
-
35048
- if (process.env.NODE_ENV !== 'production') {
35049
- if (typeof overscanCount === 'number') {
35050
- if (devWarningsOverscanCount && !devWarningsOverscanCount.has(instance)) {
35051
- devWarningsOverscanCount.add(instance);
35052
- console.warn('The overscanCount prop has been deprecated. ' + 'Please use the overscanColumnCount and overscanRowCount props instead.');
35053
- }
35054
- }
35055
-
35056
- if (typeof overscanColumnsCount === 'number' || typeof overscanRowsCount === 'number') {
35057
- if (devWarningsOverscanRowsColumnsCount && !devWarningsOverscanRowsColumnsCount.has(instance)) {
35058
- devWarningsOverscanRowsColumnsCount.add(instance);
35059
- console.warn('The overscanColumnsCount and overscanRowsCount props have been deprecated. ' + 'Please use the overscanColumnCount and overscanRowCount props instead.');
35060
- }
35061
- }
35062
-
35063
- if (innerTagName != null || outerTagName != null) {
35064
- if (devWarningsTagName && !devWarningsTagName.has(instance)) {
35065
- devWarningsTagName.add(instance);
35066
- console.warn('The innerTagName and outerTagName props have been deprecated. ' + 'Please use the innerElementType and outerElementType props instead.');
35067
- }
35068
- }
35069
-
35070
- if (children == null) {
35071
- throw Error('An invalid "children" prop has been specified. ' + 'Value should be a React component. ' + ("\"" + (children === null ? 'null' : typeof children) + "\" was specified."));
35072
- }
35073
-
35074
- switch (direction) {
35075
- case 'ltr':
35076
- case 'rtl':
35077
- // Valid values
35078
- break;
35079
-
35080
- default:
35081
- throw Error('An invalid "direction" prop has been specified. ' + 'Value should be either "ltr" or "rtl". ' + ("\"" + direction + "\" was specified."));
35082
- }
35083
-
35084
- if (typeof width !== 'number') {
35085
- throw Error('An invalid "width" prop has been specified. ' + 'Grids must specify a number for width. ' + ("\"" + (width === null ? 'null' : typeof width) + "\" was specified."));
35086
- }
35087
-
35088
- if (typeof height !== 'number') {
35089
- throw Error('An invalid "height" prop has been specified. ' + 'Grids must specify a number for height. ' + ("\"" + (height === null ? 'null' : typeof height) + "\" was specified."));
35090
- }
35091
- }
35092
- };
35093
-
35094
- var DEFAULT_ESTIMATED_ITEM_SIZE = 50;
35095
-
35096
- var getEstimatedTotalHeight = function getEstimatedTotalHeight(_ref, _ref2) {
35097
- var rowCount = _ref.rowCount;
35098
- var rowMetadataMap = _ref2.rowMetadataMap,
35099
- estimatedRowHeight = _ref2.estimatedRowHeight,
35100
- lastMeasuredRowIndex = _ref2.lastMeasuredRowIndex;
35101
- var totalSizeOfMeasuredRows = 0; // Edge case check for when the number of items decreases while a scroll is in progress.
35102
- // https://github.com/bvaughn/react-window/pull/138
35103
-
35104
- if (lastMeasuredRowIndex >= rowCount) {
35105
- lastMeasuredRowIndex = rowCount - 1;
35106
- }
35107
-
35108
- if (lastMeasuredRowIndex >= 0) {
35109
- var itemMetadata = rowMetadataMap[lastMeasuredRowIndex];
35110
- totalSizeOfMeasuredRows = itemMetadata.offset + itemMetadata.size;
35111
- }
35112
-
35113
- var numUnmeasuredItems = rowCount - lastMeasuredRowIndex - 1;
35114
- var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedRowHeight;
35115
- return totalSizeOfMeasuredRows + totalSizeOfUnmeasuredItems;
35116
- };
35117
-
35118
- var getEstimatedTotalWidth = function getEstimatedTotalWidth(_ref3, _ref4) {
35119
- var columnCount = _ref3.columnCount;
35120
- var columnMetadataMap = _ref4.columnMetadataMap,
35121
- estimatedColumnWidth = _ref4.estimatedColumnWidth,
35122
- lastMeasuredColumnIndex = _ref4.lastMeasuredColumnIndex;
35123
- var totalSizeOfMeasuredRows = 0; // Edge case check for when the number of items decreases while a scroll is in progress.
35124
- // https://github.com/bvaughn/react-window/pull/138
35125
-
35126
- if (lastMeasuredColumnIndex >= columnCount) {
35127
- lastMeasuredColumnIndex = columnCount - 1;
35128
- }
35129
-
35130
- if (lastMeasuredColumnIndex >= 0) {
35131
- var itemMetadata = columnMetadataMap[lastMeasuredColumnIndex];
35132
- totalSizeOfMeasuredRows = itemMetadata.offset + itemMetadata.size;
35133
- }
35134
-
35135
- var numUnmeasuredItems = columnCount - lastMeasuredColumnIndex - 1;
35136
- var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedColumnWidth;
35137
- return totalSizeOfMeasuredRows + totalSizeOfUnmeasuredItems;
35138
- };
35139
-
35140
- var getItemMetadata = function getItemMetadata(itemType, props, index, instanceProps) {
35141
- var itemMetadataMap, itemSize, lastMeasuredIndex;
35142
-
35143
- if (itemType === 'column') {
35144
- itemMetadataMap = instanceProps.columnMetadataMap;
35145
- itemSize = props.columnWidth;
35146
- lastMeasuredIndex = instanceProps.lastMeasuredColumnIndex;
35147
- } else {
35148
- itemMetadataMap = instanceProps.rowMetadataMap;
35149
- itemSize = props.rowHeight;
35150
- lastMeasuredIndex = instanceProps.lastMeasuredRowIndex;
35151
- }
35152
-
35153
- if (index > lastMeasuredIndex) {
35154
- var offset = 0;
35155
-
35156
- if (lastMeasuredIndex >= 0) {
35157
- var itemMetadata = itemMetadataMap[lastMeasuredIndex];
35158
- offset = itemMetadata.offset + itemMetadata.size;
35159
- }
35160
-
35161
- for (var i = lastMeasuredIndex + 1; i <= index; i++) {
35162
- var size = itemSize(i);
35163
- itemMetadataMap[i] = {
35164
- offset: offset,
35165
- size: size
35166
- };
35167
- offset += size;
35168
- }
35169
-
35170
- if (itemType === 'column') {
35171
- instanceProps.lastMeasuredColumnIndex = index;
35172
- } else {
35173
- instanceProps.lastMeasuredRowIndex = index;
35174
- }
35175
- }
35176
-
35177
- return itemMetadataMap[index];
35178
- };
35179
-
35180
- var findNearestItem = function findNearestItem(itemType, props, instanceProps, offset) {
35181
- var itemMetadataMap, lastMeasuredIndex;
35182
-
35183
- if (itemType === 'column') {
35184
- itemMetadataMap = instanceProps.columnMetadataMap;
35185
- lastMeasuredIndex = instanceProps.lastMeasuredColumnIndex;
35186
- } else {
35187
- itemMetadataMap = instanceProps.rowMetadataMap;
35188
- lastMeasuredIndex = instanceProps.lastMeasuredRowIndex;
35189
- }
35190
-
35191
- var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;
35192
-
35193
- if (lastMeasuredItemOffset >= offset) {
35194
- // If we've already measured items within this range just use a binary search as it's faster.
35195
- return findNearestItemBinarySearch(itemType, props, instanceProps, lastMeasuredIndex, 0, offset);
35196
- } else {
35197
- // If we haven't yet measured this high, fallback to an exponential search with an inner binary search.
35198
- // The exponential search avoids pre-computing sizes for the full set of items as a binary search would.
35199
- // The overall complexity for this approach is O(log n).
35200
- return findNearestItemExponentialSearch(itemType, props, instanceProps, Math.max(0, lastMeasuredIndex), offset);
35201
- }
35202
- };
35203
-
35204
- var findNearestItemBinarySearch = function findNearestItemBinarySearch(itemType, props, instanceProps, high, low, offset) {
35205
- while (low <= high) {
35206
- var middle = low + Math.floor((high - low) / 2);
35207
- var currentOffset = getItemMetadata(itemType, props, middle, instanceProps).offset;
35208
-
35209
- if (currentOffset === offset) {
35210
- return middle;
35211
- } else if (currentOffset < offset) {
35212
- low = middle + 1;
35213
- } else if (currentOffset > offset) {
35214
- high = middle - 1;
35215
- }
35216
- }
35217
-
35218
- if (low > 0) {
35219
- return low - 1;
35220
- } else {
35221
- return 0;
35222
- }
35223
- };
35224
-
35225
- var findNearestItemExponentialSearch = function findNearestItemExponentialSearch(itemType, props, instanceProps, index, offset) {
35226
- var itemCount = itemType === 'column' ? props.columnCount : props.rowCount;
35227
- var interval = 1;
35228
-
35229
- while (index < itemCount && getItemMetadata(itemType, props, index, instanceProps).offset < offset) {
35230
- index += interval;
35231
- interval *= 2;
35232
- }
35233
-
35234
- return findNearestItemBinarySearch(itemType, props, instanceProps, Math.min(index, itemCount - 1), Math.floor(index / 2), offset);
35235
- };
35236
-
35237
- var getOffsetForIndexAndAlignment = function getOffsetForIndexAndAlignment(itemType, props, index, align, scrollOffset, instanceProps, scrollbarSize) {
35238
- var size = itemType === 'column' ? props.width : props.height;
35239
- var itemMetadata = getItemMetadata(itemType, props, index, instanceProps); // Get estimated total size after ItemMetadata is computed,
35240
- // To ensure it reflects actual measurements instead of just estimates.
35241
-
35242
- var estimatedTotalSize = itemType === 'column' ? getEstimatedTotalWidth(props, instanceProps) : getEstimatedTotalHeight(props, instanceProps);
35243
- var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size, itemMetadata.offset));
35244
- var minOffset = Math.max(0, itemMetadata.offset - size + scrollbarSize + itemMetadata.size);
35245
-
35246
- if (align === 'smart') {
35247
- if (scrollOffset >= minOffset - size && scrollOffset <= maxOffset + size) {
35248
- align = 'auto';
35249
- } else {
35250
- align = 'center';
35251
- }
35252
- }
35253
-
35254
- switch (align) {
35255
- case 'start':
35256
- return maxOffset;
35257
-
35258
- case 'end':
35259
- return minOffset;
35260
-
35261
- case 'center':
35262
- return Math.round(minOffset + (maxOffset - minOffset) / 2);
35263
-
35264
- case 'auto':
35265
- default:
35266
- if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
35267
- return scrollOffset;
35268
- } else if (minOffset > maxOffset) {
35269
- // Because we only take into account the scrollbar size when calculating minOffset
35270
- // this value can be larger than maxOffset when at the end of the list
35271
- return minOffset;
35272
- } else if (scrollOffset < minOffset) {
35273
- return minOffset;
35274
- } else {
35275
- return maxOffset;
35276
- }
35277
-
35278
- }
35279
- };
35280
-
35281
- var VariableSizeGrid = /*#__PURE__*/createGridComponent({
35282
- getColumnOffset: function getColumnOffset(props, index, instanceProps) {
35283
- return getItemMetadata('column', props, index, instanceProps).offset;
35284
- },
35285
- getColumnStartIndexForOffset: function getColumnStartIndexForOffset(props, scrollLeft, instanceProps) {
35286
- return findNearestItem('column', props, instanceProps, scrollLeft);
35287
- },
35288
- getColumnStopIndexForStartIndex: function getColumnStopIndexForStartIndex(props, startIndex, scrollLeft, instanceProps) {
35289
- var columnCount = props.columnCount,
35290
- width = props.width;
35291
- var itemMetadata = getItemMetadata('column', props, startIndex, instanceProps);
35292
- var maxOffset = scrollLeft + width;
35293
- var offset = itemMetadata.offset + itemMetadata.size;
35294
- var stopIndex = startIndex;
35295
-
35296
- while (stopIndex < columnCount - 1 && offset < maxOffset) {
35297
- stopIndex++;
35298
- offset += getItemMetadata('column', props, stopIndex, instanceProps).size;
35299
- }
35300
-
35301
- return stopIndex;
35302
- },
35303
- getColumnWidth: function getColumnWidth(props, index, instanceProps) {
35304
- return instanceProps.columnMetadataMap[index].size;
35305
- },
35306
- getEstimatedTotalHeight: getEstimatedTotalHeight,
35307
- getEstimatedTotalWidth: getEstimatedTotalWidth,
35308
- getOffsetForColumnAndAlignment: function getOffsetForColumnAndAlignment(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
35309
- return getOffsetForIndexAndAlignment('column', props, index, align, scrollOffset, instanceProps, scrollbarSize);
35310
- },
35311
- getOffsetForRowAndAlignment: function getOffsetForRowAndAlignment(props, index, align, scrollOffset, instanceProps, scrollbarSize) {
35312
- return getOffsetForIndexAndAlignment('row', props, index, align, scrollOffset, instanceProps, scrollbarSize);
35313
- },
35314
- getRowOffset: function getRowOffset(props, index, instanceProps) {
35315
- return getItemMetadata('row', props, index, instanceProps).offset;
35316
- },
35317
- getRowHeight: function getRowHeight(props, index, instanceProps) {
35318
- return instanceProps.rowMetadataMap[index].size;
35319
- },
35320
- getRowStartIndexForOffset: function getRowStartIndexForOffset(props, scrollTop, instanceProps) {
35321
- return findNearestItem('row', props, instanceProps, scrollTop);
35322
- },
35323
- getRowStopIndexForStartIndex: function getRowStopIndexForStartIndex(props, startIndex, scrollTop, instanceProps) {
35324
- var rowCount = props.rowCount,
35325
- height = props.height;
35326
- var itemMetadata = getItemMetadata('row', props, startIndex, instanceProps);
35327
- var maxOffset = scrollTop + height;
35328
- var offset = itemMetadata.offset + itemMetadata.size;
35329
- var stopIndex = startIndex;
35330
-
35331
- while (stopIndex < rowCount - 1 && offset < maxOffset) {
35332
- stopIndex++;
35333
- offset += getItemMetadata('row', props, stopIndex, instanceProps).size;
35334
- }
35335
-
35336
- return stopIndex;
35337
- },
35338
- initInstanceProps: function initInstanceProps(props, instance) {
35339
- var _ref5 = props,
35340
- estimatedColumnWidth = _ref5.estimatedColumnWidth,
35341
- estimatedRowHeight = _ref5.estimatedRowHeight;
35342
- var instanceProps = {
35343
- columnMetadataMap: {},
35344
- estimatedColumnWidth: estimatedColumnWidth || DEFAULT_ESTIMATED_ITEM_SIZE,
35345
- estimatedRowHeight: estimatedRowHeight || DEFAULT_ESTIMATED_ITEM_SIZE,
35346
- lastMeasuredColumnIndex: -1,
35347
- lastMeasuredRowIndex: -1,
35348
- rowMetadataMap: {}
35349
- };
35350
-
35351
- instance.resetAfterColumnIndex = function (columnIndex, shouldForceUpdate) {
35352
- if (shouldForceUpdate === void 0) {
35353
- shouldForceUpdate = true;
35354
- }
35355
-
35356
- instance.resetAfterIndices({
35357
- columnIndex: columnIndex,
35358
- shouldForceUpdate: shouldForceUpdate
35359
- });
35360
- };
35361
-
35362
- instance.resetAfterRowIndex = function (rowIndex, shouldForceUpdate) {
35363
- if (shouldForceUpdate === void 0) {
35364
- shouldForceUpdate = true;
35365
- }
35366
-
35367
- instance.resetAfterIndices({
35368
- rowIndex: rowIndex,
35369
- shouldForceUpdate: shouldForceUpdate
35370
- });
35371
- };
35372
-
35373
- instance.resetAfterIndices = function (_ref6) {
35374
- var columnIndex = _ref6.columnIndex,
35375
- rowIndex = _ref6.rowIndex,
35376
- _ref6$shouldForceUpda = _ref6.shouldForceUpdate,
35377
- shouldForceUpdate = _ref6$shouldForceUpda === void 0 ? true : _ref6$shouldForceUpda;
35378
-
35379
- if (typeof columnIndex === 'number') {
35380
- instanceProps.lastMeasuredColumnIndex = Math.min(instanceProps.lastMeasuredColumnIndex, columnIndex - 1);
35381
- }
35382
-
35383
- if (typeof rowIndex === 'number') {
35384
- instanceProps.lastMeasuredRowIndex = Math.min(instanceProps.lastMeasuredRowIndex, rowIndex - 1);
35385
- } // We could potentially optimize further by only evicting styles after this index,
35386
- // But since styles are only cached while scrolling is in progress-
35387
- // It seems an unnecessary optimization.
35388
- // It's unlikely that resetAfterIndex() will be called while a user is scrolling.
35389
-
35390
-
35391
- instance._getItemStyleCache(-1);
35392
-
35393
- if (shouldForceUpdate) {
35394
- instance.forceUpdate();
35395
- }
35396
- };
35397
-
35398
- return instanceProps;
35399
- },
35400
- shouldResetStyleCacheOnItemSizeChange: false,
35401
- validateProps: function validateProps(_ref7) {
35402
- var columnWidth = _ref7.columnWidth,
35403
- rowHeight = _ref7.rowHeight;
35404
-
35405
- if (process.env.NODE_ENV !== 'production') {
35406
- if (typeof columnWidth !== 'function') {
35407
- throw Error('An invalid "columnWidth" prop has been specified. ' + 'Value should be a function. ' + ("\"" + (columnWidth === null ? 'null' : typeof columnWidth) + "\" was specified."));
35408
- } else if (typeof rowHeight !== 'function') {
35409
- throw Error('An invalid "rowHeight" prop has been specified. ' + 'Value should be a function. ' + ("\"" + (rowHeight === null ? 'null' : typeof rowHeight) + "\" was specified."));
35410
- }
35411
- }
35412
- }
35413
- });
35414
-
35415
- if (process.env.NODE_ENV !== 'production') ;
35416
-
35417
- /**
35418
- * Detect Element Resize.
35419
- * https://github.com/sdecima/javascript-detect-element-resize
35420
- * Sebastian Decima
35421
- *
35422
- * Forked from version 0.5.3; includes the following modifications:
35423
- * 1) Guard against unsafe 'window' and 'document' references (to support SSR).
35424
- * 2) Defer initialization code via a top-level function wrapper (to support SSR).
35425
- * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.
35426
- * 4) Add nonce for style element.
35427
- * 5) Use 'export' statement over 'module.exports' assignment
35428
- **/
35429
-
35430
- // Check `document` and `window` in case of server-side rendering
35431
- let windowObject;
35432
- if (typeof window !== "undefined") {
35433
- windowObject = window;
35434
-
35435
- // eslint-disable-next-line no-restricted-globals
35436
- } else if (typeof self !== "undefined") {
35437
- // eslint-disable-next-line no-restricted-globals
35438
- windowObject = self;
35439
- } else {
35440
- windowObject = global;
35441
- }
35442
- let cancelFrame = null;
35443
- let requestFrame = null;
35444
- const TIMEOUT_DURATION = 20;
35445
- const clearTimeoutFn = windowObject.clearTimeout;
35446
- const setTimeoutFn = windowObject.setTimeout;
35447
- const cancelAnimationFrameFn = windowObject.cancelAnimationFrame || windowObject.mozCancelAnimationFrame || windowObject.webkitCancelAnimationFrame;
35448
- const requestAnimationFrameFn = windowObject.requestAnimationFrame || windowObject.mozRequestAnimationFrame || windowObject.webkitRequestAnimationFrame;
35449
- if (cancelAnimationFrameFn == null || requestAnimationFrameFn == null) {
35450
- // For environments that don't support animation frame,
35451
- // fallback to a setTimeout based approach.
35452
- cancelFrame = clearTimeoutFn;
35453
- requestFrame = function requestAnimationFrameViaSetTimeout(callback) {
35454
- return setTimeoutFn(callback, TIMEOUT_DURATION);
35455
- };
35456
- } else {
35457
- // Counter intuitively, environments that support animation frames can be trickier.
35458
- // Chrome's "Throttle non-visible cross-origin iframes" flag can prevent rAFs from being called.
35459
- // In this case, we should fallback to a setTimeout() implementation.
35460
- cancelFrame = function cancelFrame([animationFrameID, timeoutID]) {
35461
- cancelAnimationFrameFn(animationFrameID);
35462
- clearTimeoutFn(timeoutID);
35463
- };
35464
- requestFrame = function requestAnimationFrameWithSetTimeoutFallback(callback) {
35465
- const animationFrameID = requestAnimationFrameFn(function animationFrameCallback() {
35466
- clearTimeoutFn(timeoutID);
35467
- callback();
35468
- });
35469
- const timeoutID = setTimeoutFn(function timeoutCallback() {
35470
- cancelAnimationFrameFn(animationFrameID);
35471
- callback();
35472
- }, TIMEOUT_DURATION);
35473
- return [animationFrameID, timeoutID];
35474
- };
35475
- }
35476
- function createDetectElementResize(nonce) {
35477
- let animationKeyframes;
35478
- let animationName;
35479
- let animationStartEvent;
35480
- let animationStyle;
35481
- let checkTriggers;
35482
- let resetTriggers;
35483
- let scrollListener;
35484
- const attachEvent = typeof document !== "undefined" && document.attachEvent;
35485
- if (!attachEvent) {
35486
- resetTriggers = function (element) {
35487
- const triggers = element.__resizeTriggers__,
35488
- expand = triggers.firstElementChild,
35489
- contract = triggers.lastElementChild,
35490
- expandChild = expand.firstElementChild;
35491
- contract.scrollLeft = contract.scrollWidth;
35492
- contract.scrollTop = contract.scrollHeight;
35493
- expandChild.style.width = expand.offsetWidth + 1 + "px";
35494
- expandChild.style.height = expand.offsetHeight + 1 + "px";
35495
- expand.scrollLeft = expand.scrollWidth;
35496
- expand.scrollTop = expand.scrollHeight;
35497
- };
35498
- checkTriggers = function (element) {
35499
- return element.offsetWidth !== element.__resizeLast__.width || element.offsetHeight !== element.__resizeLast__.height;
35500
- };
35501
- scrollListener = function (e) {
35502
- // Don't measure (which forces) reflow for scrolls that happen inside of children!
35503
- if (e.target.className && typeof e.target.className.indexOf === "function" && e.target.className.indexOf("contract-trigger") < 0 && e.target.className.indexOf("expand-trigger") < 0) {
35504
- return;
35505
- }
35506
- const element = this;
35507
- resetTriggers(this);
35508
- if (this.__resizeRAF__) {
35509
- cancelFrame(this.__resizeRAF__);
35510
- }
35511
- this.__resizeRAF__ = requestFrame(function animationFrame() {
35512
- if (checkTriggers(element)) {
35513
- element.__resizeLast__.width = element.offsetWidth;
35514
- element.__resizeLast__.height = element.offsetHeight;
35515
- element.__resizeListeners__.forEach(function forEachResizeListener(fn) {
35516
- fn.call(element, e);
35517
- });
35518
- }
35519
- });
35520
- };
35521
-
35522
- /* Detect CSS Animations support to detect element display/re-attach */
35523
- let animation = false;
35524
- let keyframeprefix = "";
35525
- animationStartEvent = "animationstart";
35526
- const domPrefixes = "Webkit Moz O ms".split(" ");
35527
- let startEvents = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" ");
35528
- let pfx = "";
35529
- {
35530
- const elm = document.createElement("fakeelement");
35531
- if (elm.style.animationName !== undefined) {
35532
- animation = true;
35533
- }
35534
- if (animation === false) {
35535
- for (let i = 0; i < domPrefixes.length; i++) {
35536
- if (elm.style[domPrefixes[i] + "AnimationName"] !== undefined) {
35537
- pfx = domPrefixes[i];
35538
- keyframeprefix = "-" + pfx.toLowerCase() + "-";
35539
- animationStartEvent = startEvents[i];
35540
- animation = true;
35541
- break;
35542
- }
35543
- }
35544
- }
35545
- }
35546
- animationName = "resizeanim";
35547
- animationKeyframes = "@" + keyframeprefix + "keyframes " + animationName + " { from { opacity: 0; } to { opacity: 0; } } ";
35548
- animationStyle = keyframeprefix + "animation: 1ms " + animationName + "; ";
35549
- }
35550
- const createStyles = function (doc) {
35551
- if (!doc.getElementById("detectElementResize")) {
35552
- //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360
35553
- const css = (animationKeyframes ? animationKeyframes : "") + ".resize-triggers { " + (animationStyle ? animationStyle : "") + "visibility: hidden; opacity: 0; } " + '.resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',
35554
- head = doc.head || doc.getElementsByTagName("head")[0],
35555
- style = doc.createElement("style");
35556
- style.id = "detectElementResize";
35557
- style.type = "text/css";
35558
- if (nonce != null) {
35559
- style.setAttribute("nonce", nonce);
35560
- }
35561
- if (style.styleSheet) {
35562
- style.styleSheet.cssText = css;
35563
- } else {
35564
- style.appendChild(doc.createTextNode(css));
35565
- }
35566
- head.appendChild(style);
35567
- }
35568
- };
35569
- const addResizeListener = function (element, fn) {
35570
- if (attachEvent) {
35571
- element.attachEvent("onresize", fn);
35572
- } else {
35573
- if (!element.__resizeTriggers__) {
35574
- const doc = element.ownerDocument;
35575
- const elementStyle = windowObject.getComputedStyle(element);
35576
- if (elementStyle && elementStyle.position === "static") {
35577
- element.style.position = "relative";
35578
- }
35579
- createStyles(doc);
35580
- element.__resizeLast__ = {};
35581
- element.__resizeListeners__ = [];
35582
- (element.__resizeTriggers__ = doc.createElement("div")).className = "resize-triggers";
35583
- const expandTrigger = doc.createElement("div");
35584
- expandTrigger.className = "expand-trigger";
35585
- expandTrigger.appendChild(doc.createElement("div"));
35586
- const contractTrigger = doc.createElement("div");
35587
- contractTrigger.className = "contract-trigger";
35588
- element.__resizeTriggers__.appendChild(expandTrigger);
35589
- element.__resizeTriggers__.appendChild(contractTrigger);
35590
- element.appendChild(element.__resizeTriggers__);
35591
- resetTriggers(element);
35592
- element.addEventListener("scroll", scrollListener, true);
35593
-
35594
- /* Listen for a css animation to detect element display/re-attach */
35595
- if (animationStartEvent) {
35596
- element.__resizeTriggers__.__animationListener__ = function animationListener(e) {
35597
- if (e.animationName === animationName) {
35598
- resetTriggers(element);
35599
- }
35600
- };
35601
- element.__resizeTriggers__.addEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
35602
- }
35603
- }
35604
- element.__resizeListeners__.push(fn);
35605
- }
35606
- };
35607
- const removeResizeListener = function (element, fn) {
35608
- if (attachEvent) {
35609
- element.detachEvent("onresize", fn);
35610
- } else {
35611
- element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);
35612
- if (!element.__resizeListeners__.length) {
35613
- element.removeEventListener("scroll", scrollListener, true);
35614
- if (element.__resizeTriggers__.__animationListener__) {
35615
- element.__resizeTriggers__.removeEventListener(animationStartEvent, element.__resizeTriggers__.__animationListener__);
35616
- element.__resizeTriggers__.__animationListener__ = null;
35617
- }
35618
- try {
35619
- element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);
35620
- } catch (e) {
35621
- // Preact compat; see developit/preact-compat/issues/228
35622
- }
35623
- }
35624
- }
35625
- };
35626
- return {
35627
- addResizeListener,
35628
- removeResizeListener
35629
- };
35630
- }
35631
-
35632
- class AutoSizer extends Component {
35633
- constructor(...args) {
35634
- super(...args);
35635
- this.state = {
35636
- height: this.props.defaultHeight || 0,
35637
- scaledHeight: this.props.defaultHeight || 0,
35638
- scaledWidth: this.props.defaultWidth || 0,
35639
- width: this.props.defaultWidth || 0
35640
- };
35641
- this._autoSizer = null;
35642
- this._detectElementResize = null;
35643
- this._parentNode = null;
35644
- this._resizeObserver = null;
35645
- this._timeoutId = null;
35646
- this._onResize = () => {
35647
- this._timeoutId = null;
35648
- const {
35649
- disableHeight,
35650
- disableWidth,
35651
- onResize
35652
- } = this.props;
35653
- if (this._parentNode) {
35654
- // Guard against AutoSizer component being removed from the DOM immediately after being added.
35655
- // This can result in invalid style values which can result in NaN values if we don't handle them.
35656
- // See issue #150 for more context.
35657
-
35658
- const style = window.getComputedStyle(this._parentNode) || {};
35659
- const paddingLeft = parseFloat(style.paddingLeft || "0");
35660
- const paddingRight = parseFloat(style.paddingRight || "0");
35661
- const paddingTop = parseFloat(style.paddingTop || "0");
35662
- const paddingBottom = parseFloat(style.paddingBottom || "0");
35663
- const rect = this._parentNode.getBoundingClientRect();
35664
- const scaledHeight = rect.height - paddingTop - paddingBottom;
35665
- const scaledWidth = rect.width - paddingLeft - paddingRight;
35666
- const height = this._parentNode.offsetHeight - paddingTop - paddingBottom;
35667
- const width = this._parentNode.offsetWidth - paddingLeft - paddingRight;
35668
- if (!disableHeight && (this.state.height !== height || this.state.scaledHeight !== scaledHeight) || !disableWidth && (this.state.width !== width || this.state.scaledWidth !== scaledWidth)) {
35669
- this.setState({
35670
- height,
35671
- width,
35672
- scaledHeight,
35673
- scaledWidth
35674
- });
35675
- if (typeof onResize === "function") {
35676
- onResize({
35677
- height,
35678
- scaledHeight,
35679
- scaledWidth,
35680
- width
35681
- });
35682
- }
35683
- }
35684
- }
35685
- };
35686
- this._setRef = autoSizer => {
35687
- this._autoSizer = autoSizer;
35688
- };
35689
- }
35690
- componentDidMount() {
35691
- const {
35692
- nonce
35693
- } = this.props;
35694
- const parentNode = this._autoSizer ? this._autoSizer.parentNode : null;
35695
- if (parentNode != null && parentNode.ownerDocument && parentNode.ownerDocument.defaultView && parentNode instanceof parentNode.ownerDocument.defaultView.HTMLElement) {
35696
- // Delay access of parentNode until mount.
35697
- // This handles edge-cases where the component has already been unmounted before its ref has been set,
35698
- // As well as libraries like react-lite which have a slightly different lifecycle.
35699
- this._parentNode = parentNode;
35700
-
35701
- // Use ResizeObserver from the same context where parentNode (which we will observe) was defined
35702
- // Using just global can result into onResize events not being emitted in cases with multiple realms
35703
- const ResizeObserverInstance = parentNode.ownerDocument.defaultView.ResizeObserver;
35704
- if (ResizeObserverInstance != null) {
35705
- this._resizeObserver = new ResizeObserverInstance(() => {
35706
- // Guard against "ResizeObserver loop limit exceeded" error;
35707
- // could be triggered if the state update causes the ResizeObserver handler to run long.
35708
- // See https://github.com/bvaughn/react-virtualized-auto-sizer/issues/55
35709
- this._timeoutId = setTimeout(this._onResize, 0);
35710
- });
35711
- this._resizeObserver.observe(parentNode);
35712
- } else {
35713
- // Defer requiring resize handler in order to support server-side rendering.
35714
- // See issue #41
35715
- this._detectElementResize = createDetectElementResize(nonce);
35716
- this._detectElementResize.addResizeListener(parentNode, this._onResize);
35717
- }
35718
- this._onResize();
35719
- }
35720
- }
35721
- componentWillUnmount() {
35722
- if (this._parentNode) {
35723
- if (this._detectElementResize) {
35724
- this._detectElementResize.removeResizeListener(this._parentNode, this._onResize);
35725
- }
35726
- if (this._timeoutId !== null) {
35727
- clearTimeout(this._timeoutId);
35728
- }
35729
- if (this._resizeObserver) {
35730
- this._resizeObserver.disconnect();
35731
- }
35732
- }
35733
- }
35734
- render() {
35735
- const {
35736
- children,
35737
- defaultHeight,
35738
- defaultWidth,
35739
- disableHeight = false,
35740
- disableWidth = false,
35741
- doNotBailOutOnEmptyChildren = false,
35742
- nonce,
35743
- onResize,
35744
- style = {},
35745
- tagName = "div",
35746
- ...rest
35747
- } = this.props;
35748
- const {
35749
- height,
35750
- scaledHeight,
35751
- scaledWidth,
35752
- width
35753
- } = this.state;
35754
-
35755
- // Outer div should not force width/height since that may prevent containers from shrinking.
35756
- // Inner component should overflow and use calculated width/height.
35757
- // See issue #68 for more information.
35758
- const outerStyle = {
35759
- overflow: "visible"
35760
- };
35761
- const childParams = {};
35762
-
35763
- // Avoid rendering children before the initial measurements have been collected.
35764
- // At best this would just be wasting cycles.
35765
- let bailoutOnChildren = false;
35766
- if (!disableHeight) {
35767
- if (height === 0) {
35768
- bailoutOnChildren = true;
35769
- }
35770
- outerStyle.height = 0;
35771
- childParams.height = height;
35772
- childParams.scaledHeight = scaledHeight;
35773
- }
35774
- if (!disableWidth) {
35775
- if (width === 0) {
35776
- bailoutOnChildren = true;
35777
- }
35778
- outerStyle.width = 0;
35779
- childParams.width = width;
35780
- childParams.scaledWidth = scaledWidth;
35781
- }
35782
- if (doNotBailOutOnEmptyChildren) {
35783
- bailoutOnChildren = false;
35784
- }
35785
- return createElement(tagName, {
35786
- ref: this._setRef,
35787
- style: {
35788
- ...outerStyle,
35789
- ...style
35790
- },
35791
- ...rest
35792
- }, !bailoutOnChildren && children(childParams));
35793
- }
35794
- }
35795
-
35796
31225
  var styles = {"table":"Ui89VirtualTable-module_table__TkJv-","tableBody":"Ui89VirtualTable-module_tableBody__S53mE","empty":"Ui89VirtualTable-module_empty__0TQZA","tableHeader":"Ui89VirtualTable-module_tableHeader__gK1W1","cell":"Ui89VirtualTable-module_cell__yecQB","cell--column-first":"Ui89VirtualTable-module_cell--column-first__ymIC-","cell--column-last":"Ui89VirtualTable-module_cell--column-last__fEGx6","cell--row-first":"Ui89VirtualTable-module_cell--row-first__aWHap","cell--row-last":"Ui89VirtualTable-module_cell--row-last__hcdZH"};
35797
31226
 
35798
31227
  const HEADER_HEIGHT = 30;