grep-components 1.18.0-grepf-1801.1 → 1.18.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/components/AppBar/types.d.ts +1 -0
- package/dist/index.js +635 -1782
- package/dist/index.js.map +1 -1
- package/package.json +17 -17
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ import LocalizedFormatPlugin from 'dayjs/plugin/localizedFormat';
|
|
|
4
4
|
import isBetweenPlugin from 'dayjs/plugin/isBetween';
|
|
5
5
|
import { red, pink, purple, deepPurple, indigo, blue, lightBlue, cyan, teal, green, lightGreen, lime, yellow, amber, orange, deepOrange, brown, grey, blueGrey } from '@mui/material/colors';
|
|
6
6
|
import * as React from 'react';
|
|
7
|
-
import React__default, { useContext,
|
|
7
|
+
import React__default, { useRef, useContext, createContext, createElement, Fragment, forwardRef, useMemo as useMemo$1, useState, useCallback as useCallback$1, useEffect, useLayoutEffect } from 'react';
|
|
8
8
|
import AccountCircle from '@mui/icons-material/AccountCircle';
|
|
9
9
|
import ArrowDropdown from '@mui/icons-material/ArrowDropDown';
|
|
10
10
|
import { Button, Box, Typography, IconButton, Menu, MenuItem, Tabs, Tab, Collapse, MenuList, Tooltip, Container, List, ListItem, ListItemText, ListItemIcon, Divider, styled, TableCell, TableRow, TableSortLabel, TableHead, TablePagination, TableContainer, Table, TableBody, TableFooter, CircularProgress, Link, TextField, FormControl, InputLabel, Select, OutlinedInput, Input, Checkbox, FormHelperText, Grid, ToggleButtonGroup, AppBar as AppBar$1, Toolbar as Toolbar$1, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions } from '@mui/material';
|
|
11
|
-
import { useTheme
|
|
11
|
+
import { useTheme } from '@mui/material/styles';
|
|
12
12
|
import { useHistory, NavLink, Prompt } from 'react-router-dom';
|
|
13
13
|
import MenuIcon from '@mui/icons-material/Menu';
|
|
14
14
|
import IconExpand from '@mui/icons-material/ExpandMore';
|
|
@@ -128,27 +128,6 @@ var getExcelDateTime = function (datetime, options) { return parseDate(datetime,
|
|
|
128
128
|
|
|
129
129
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
130
130
|
|
|
131
|
-
function getAugmentedNamespace(n) {
|
|
132
|
-
var f = n.default;
|
|
133
|
-
if (typeof f == "function") {
|
|
134
|
-
var a = function () {
|
|
135
|
-
return f.apply(this, arguments);
|
|
136
|
-
};
|
|
137
|
-
a.prototype = f.prototype;
|
|
138
|
-
} else a = {};
|
|
139
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
140
|
-
Object.keys(n).forEach(function (k) {
|
|
141
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
142
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
143
|
-
enumerable: true,
|
|
144
|
-
get: function () {
|
|
145
|
-
return n[k];
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
return a;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
131
|
var Key_enum = {};
|
|
153
132
|
|
|
154
133
|
(function (exports) {
|
|
@@ -433,16 +412,28 @@ var convertToRgba = function (color, alpha) {
|
|
|
433
412
|
return value ? "rgba(".concat(value, ", ").concat(alpha, ")") : color;
|
|
434
413
|
};
|
|
435
414
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
415
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
416
|
+
const objectFromEntries = !Object
|
|
417
|
+
.fromEntries
|
|
418
|
+
? (entries) => {
|
|
419
|
+
if (!entries || !entries[Symbol.iterator]) {
|
|
420
|
+
throw new Error("Object.fromEntries() requires a single iterable argument");
|
|
421
|
+
}
|
|
422
|
+
const o = {};
|
|
423
|
+
Object.keys(entries).forEach(key => {
|
|
424
|
+
const [k, v] = entries[key];
|
|
425
|
+
o[k] = v;
|
|
426
|
+
});
|
|
427
|
+
return o;
|
|
428
|
+
}
|
|
429
|
+
: Object.fromEntries;
|
|
441
430
|
|
|
442
|
-
|
|
431
|
+
/** Object.keys() with types */
|
|
432
|
+
function objectKeys(o) {
|
|
433
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
434
|
+
return Object.keys(o);
|
|
435
|
+
}
|
|
443
436
|
|
|
444
|
-
Object.defineProperty(assert$1, "__esModule", { value: true });
|
|
445
|
-
assert$1.assert = void 0;
|
|
446
437
|
/** https://docs.tsafe.dev/assert */
|
|
447
438
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
448
439
|
function assert(condition, msg) {
|
|
@@ -450,74 +441,61 @@ function assert(condition, msg) {
|
|
|
450
441
|
throw new Error(msg);
|
|
451
442
|
}
|
|
452
443
|
}
|
|
453
|
-
assert$1.assert = assert;
|
|
454
|
-
|
|
455
|
-
var typeGuard$1 = {};
|
|
456
444
|
|
|
457
445
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
458
|
-
Object.defineProperty(typeGuard$1, "__esModule", { value: true });
|
|
459
|
-
typeGuard$1.typeGuard = void 0;
|
|
460
446
|
/** https://docs.tsafe.dev/typeguard */
|
|
461
447
|
function typeGuard(_value, isMatched) {
|
|
462
448
|
return isMatched;
|
|
463
449
|
}
|
|
464
|
-
typeGuard$1.typeGuard = typeGuard;
|
|
465
450
|
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
cls += toAdd;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
return cls;
|
|
518
|
-
};
|
|
519
|
-
exports.classnames = classnames;
|
|
520
|
-
} (classnames$1));
|
|
451
|
+
/** Copy pasted from
|
|
452
|
+
* https://github.com/emotion-js/emotion/blob/23f43ab9f24d44219b0b007a00f4ac681fe8712e/packages/react/src/class-names.js#L17-L63
|
|
453
|
+
**/
|
|
454
|
+
const classnames = (args) => {
|
|
455
|
+
const len = args.length;
|
|
456
|
+
let i = 0;
|
|
457
|
+
let cls = "";
|
|
458
|
+
for (; i < len; i++) {
|
|
459
|
+
const arg = args[i];
|
|
460
|
+
if (arg == null)
|
|
461
|
+
continue;
|
|
462
|
+
let toAdd;
|
|
463
|
+
switch (typeof arg) {
|
|
464
|
+
case "boolean":
|
|
465
|
+
break;
|
|
466
|
+
case "object": {
|
|
467
|
+
if (Array.isArray(arg)) {
|
|
468
|
+
toAdd = classnames(arg);
|
|
469
|
+
}
|
|
470
|
+
else {
|
|
471
|
+
assert(!typeGuard(arg, false));
|
|
472
|
+
if (process.env.NODE_ENV !== "production" &&
|
|
473
|
+
arg.styles !== undefined &&
|
|
474
|
+
arg.name !== undefined) {
|
|
475
|
+
console.error("You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n" +
|
|
476
|
+
"`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.");
|
|
477
|
+
}
|
|
478
|
+
toAdd = "";
|
|
479
|
+
for (const k in arg) {
|
|
480
|
+
if (arg[k] && k) {
|
|
481
|
+
toAdd && (toAdd += " ");
|
|
482
|
+
toAdd += k;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
default: {
|
|
489
|
+
toAdd = arg;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
if (toAdd) {
|
|
493
|
+
cls && (cls += " ");
|
|
494
|
+
cls += toAdd;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return cls;
|
|
498
|
+
};
|
|
521
499
|
|
|
522
500
|
/* eslint-disable */
|
|
523
501
|
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
@@ -941,13 +919,6 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
941
919
|
};
|
|
942
920
|
};
|
|
943
921
|
|
|
944
|
-
var emotionSerialize_esm = /*#__PURE__*/Object.freeze({
|
|
945
|
-
__proto__: null,
|
|
946
|
-
serializeStyles: serializeStyles
|
|
947
|
-
});
|
|
948
|
-
|
|
949
|
-
var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(emotionSerialize_esm);
|
|
950
|
-
|
|
951
922
|
var isBrowser$3 = typeof document !== 'undefined';
|
|
952
923
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
953
924
|
var rawClassName = '';
|
|
@@ -1000,24 +971,10 @@ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
|
1000
971
|
}
|
|
1001
972
|
};
|
|
1002
973
|
|
|
1003
|
-
var emotionUtils_esm = /*#__PURE__*/Object.freeze({
|
|
1004
|
-
__proto__: null,
|
|
1005
|
-
getRegisteredStyles: getRegisteredStyles,
|
|
1006
|
-
insertStyles: insertStyles,
|
|
1007
|
-
registerStyles: registerStyles
|
|
1008
|
-
});
|
|
1009
|
-
|
|
1010
|
-
var require$$2 = /*@__PURE__*/getAugmentedNamespace(emotionUtils_esm);
|
|
1011
|
-
|
|
1012
|
-
var useGuaranteedMemo$1 = {};
|
|
1013
|
-
|
|
1014
|
-
Object.defineProperty(useGuaranteedMemo$1, "__esModule", { value: true });
|
|
1015
|
-
useGuaranteedMemo$1.useGuaranteedMemo = void 0;
|
|
1016
|
-
const react_1$5 = React__default;
|
|
1017
974
|
/** Like react's useMemo but with guarantee that the fn
|
|
1018
975
|
* won't be invoked again if deps hasn't change */
|
|
1019
976
|
function useGuaranteedMemo(fn, deps) {
|
|
1020
|
-
const ref =
|
|
977
|
+
const ref = useRef();
|
|
1021
978
|
if (!ref.current ||
|
|
1022
979
|
deps.length !== ref.current.prevDeps.length ||
|
|
1023
980
|
ref.current.prevDeps.map((v, i) => v === deps[i]).indexOf(false) >= 0) {
|
|
@@ -1028,9 +985,169 @@ function useGuaranteedMemo(fn, deps) {
|
|
|
1028
985
|
}
|
|
1029
986
|
return ref.current.v;
|
|
1030
987
|
}
|
|
1031
|
-
useGuaranteedMemo$1.useGuaranteedMemo = useGuaranteedMemo;
|
|
1032
988
|
|
|
1033
|
-
|
|
989
|
+
function matchCSSObject(arg) {
|
|
990
|
+
return (arg instanceof Object &&
|
|
991
|
+
!("styles" in arg) &&
|
|
992
|
+
!("length" in arg) &&
|
|
993
|
+
!("__emotion_styles" in arg));
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
const { createCssAndCx } = (() => {
|
|
997
|
+
function merge(registered, css, className) {
|
|
998
|
+
const registeredStyles = [];
|
|
999
|
+
const rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
1000
|
+
if (registeredStyles.length < 2) {
|
|
1001
|
+
return className;
|
|
1002
|
+
}
|
|
1003
|
+
return rawClassName + css(registeredStyles);
|
|
1004
|
+
}
|
|
1005
|
+
function createCssAndCx(params) {
|
|
1006
|
+
const { cache } = params;
|
|
1007
|
+
const css = (...args) => {
|
|
1008
|
+
const serialized = serializeStyles(args, cache.registered);
|
|
1009
|
+
insertStyles(cache, serialized, false);
|
|
1010
|
+
const className = `${cache.key}-${serialized.name}`;
|
|
1011
|
+
scope: {
|
|
1012
|
+
const arg = args[0];
|
|
1013
|
+
if (!matchCSSObject(arg)) {
|
|
1014
|
+
break scope;
|
|
1015
|
+
}
|
|
1016
|
+
increaseSpecificityToTakePrecedenceOverMediaQueries.saveClassNameCSSObjectMapping(cache, className, arg);
|
|
1017
|
+
}
|
|
1018
|
+
return className;
|
|
1019
|
+
};
|
|
1020
|
+
const cx = (...args) => {
|
|
1021
|
+
const className = classnames(args);
|
|
1022
|
+
const feat27FixedClassnames = increaseSpecificityToTakePrecedenceOverMediaQueries.fixClassName(cache, className, css);
|
|
1023
|
+
return merge(cache.registered, css, feat27FixedClassnames);
|
|
1024
|
+
//return merge(cache.registered, css, className);
|
|
1025
|
+
};
|
|
1026
|
+
return { css, cx };
|
|
1027
|
+
}
|
|
1028
|
+
return { createCssAndCx };
|
|
1029
|
+
})();
|
|
1030
|
+
function createUseCssAndCx(params) {
|
|
1031
|
+
const { useCache } = params;
|
|
1032
|
+
function useCssAndCx() {
|
|
1033
|
+
const cache = useCache();
|
|
1034
|
+
const { css, cx } = useGuaranteedMemo(() => createCssAndCx({ cache }), [cache]);
|
|
1035
|
+
return { css, cx };
|
|
1036
|
+
}
|
|
1037
|
+
return { useCssAndCx };
|
|
1038
|
+
}
|
|
1039
|
+
// https://github.com/garronej/tss-react/issues/27
|
|
1040
|
+
const increaseSpecificityToTakePrecedenceOverMediaQueries = (() => {
|
|
1041
|
+
const cssObjectMapByCache = new WeakMap();
|
|
1042
|
+
return {
|
|
1043
|
+
"saveClassNameCSSObjectMapping": (cache, className, cssObject) => {
|
|
1044
|
+
let cssObjectMap = cssObjectMapByCache.get(cache);
|
|
1045
|
+
if (cssObjectMap === undefined) {
|
|
1046
|
+
cssObjectMap = new Map();
|
|
1047
|
+
cssObjectMapByCache.set(cache, cssObjectMap);
|
|
1048
|
+
}
|
|
1049
|
+
cssObjectMap.set(className, cssObject);
|
|
1050
|
+
},
|
|
1051
|
+
"fixClassName": (() => {
|
|
1052
|
+
function fix(classNameCSSObjects) {
|
|
1053
|
+
let isThereAnyMediaQueriesInPreviousClasses = false;
|
|
1054
|
+
return classNameCSSObjects.map(([className, cssObject]) => {
|
|
1055
|
+
if (cssObject === undefined) {
|
|
1056
|
+
return className;
|
|
1057
|
+
}
|
|
1058
|
+
let out;
|
|
1059
|
+
if (!isThereAnyMediaQueriesInPreviousClasses) {
|
|
1060
|
+
out = className;
|
|
1061
|
+
for (const key in cssObject) {
|
|
1062
|
+
if (key.startsWith("@media")) {
|
|
1063
|
+
isThereAnyMediaQueriesInPreviousClasses = true;
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
}
|
|
1068
|
+
else {
|
|
1069
|
+
out = {
|
|
1070
|
+
"&&": cssObject,
|
|
1071
|
+
};
|
|
1072
|
+
}
|
|
1073
|
+
return out;
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
return (cache, className, css) => {
|
|
1077
|
+
const cssObjectMap = cssObjectMapByCache.get(cache);
|
|
1078
|
+
return classnames(fix(className
|
|
1079
|
+
.split(" ")
|
|
1080
|
+
.map(className => [
|
|
1081
|
+
className,
|
|
1082
|
+
cssObjectMap === null || cssObjectMap === void 0 ? void 0 : cssObjectMap.get(className),
|
|
1083
|
+
])).map(classNameOrCSSObject => typeof classNameOrCSSObject === "string"
|
|
1084
|
+
? classNameOrCSSObject
|
|
1085
|
+
: css(classNameOrCSSObject)));
|
|
1086
|
+
};
|
|
1087
|
+
})(),
|
|
1088
|
+
};
|
|
1089
|
+
})();
|
|
1090
|
+
|
|
1091
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1092
|
+
/**
|
|
1093
|
+
* useEffect(
|
|
1094
|
+
* ()=> { ... },
|
|
1095
|
+
* [ { "foo": "bar" } ]
|
|
1096
|
+
* )
|
|
1097
|
+
* => The callback will be invoked every render.
|
|
1098
|
+
* because { "foo": "bar" } is a new instance every render.
|
|
1099
|
+
*
|
|
1100
|
+
* useEffect(
|
|
1101
|
+
* ()=> { ... },
|
|
1102
|
+
* [ getDependencyArrayRef({ "foo": "bar" }) ]
|
|
1103
|
+
* );
|
|
1104
|
+
* => The callback will only be invoked once.
|
|
1105
|
+
*
|
|
1106
|
+
* The optimization will be enabled only if obj is
|
|
1107
|
+
* of the form Record<string, string | number | undefined | null>
|
|
1108
|
+
* overwise the object is returned (the function is the identity function).
|
|
1109
|
+
*/
|
|
1110
|
+
function getDependencyArrayRef(obj) {
|
|
1111
|
+
if (!(obj instanceof Object) || typeof obj === "function") {
|
|
1112
|
+
return obj;
|
|
1113
|
+
}
|
|
1114
|
+
const arr = [];
|
|
1115
|
+
for (const key in obj) {
|
|
1116
|
+
const value = obj[key];
|
|
1117
|
+
const typeofValue = typeof value;
|
|
1118
|
+
if (!(typeofValue === "string" ||
|
|
1119
|
+
(typeofValue === "number" && !isNaN(value)) ||
|
|
1120
|
+
typeofValue === "boolean" ||
|
|
1121
|
+
value === undefined ||
|
|
1122
|
+
value === null)) {
|
|
1123
|
+
return obj;
|
|
1124
|
+
}
|
|
1125
|
+
arr.push(`${key}:${typeofValue}_${value}`);
|
|
1126
|
+
}
|
|
1127
|
+
return "xSqLiJdLMd9s" + arr.join("|");
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
1131
|
+
function mergeClasses(classesFromUseStyles, classesFromProps, cx) {
|
|
1132
|
+
//NOTE: We use this test to be resilient in case classesFromProps is not of the expected type.
|
|
1133
|
+
if (!(classesFromProps instanceof Object)) {
|
|
1134
|
+
return classesFromUseStyles;
|
|
1135
|
+
}
|
|
1136
|
+
const out = {};
|
|
1137
|
+
objectKeys(classesFromUseStyles).forEach(ruleName => (out[ruleName] = cx(classesFromUseStyles[ruleName], classesFromProps[ruleName])));
|
|
1138
|
+
objectKeys(classesFromProps).forEach(ruleName => {
|
|
1139
|
+
if (ruleName in classesFromUseStyles) {
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
const className = classesFromProps[ruleName];
|
|
1143
|
+
//...Same here, that why we don't do className === undefined
|
|
1144
|
+
if (typeof className !== "string") {
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
out[ruleName] = className;
|
|
1148
|
+
});
|
|
1149
|
+
return out;
|
|
1150
|
+
}
|
|
1034
1151
|
|
|
1035
1152
|
/*
|
|
1036
1153
|
|
|
@@ -1948,11 +2065,6 @@ var weakMemoize = function weakMemoize(func) {
|
|
|
1948
2065
|
};
|
|
1949
2066
|
};
|
|
1950
2067
|
|
|
1951
|
-
var last = function last(arr) {
|
|
1952
|
-
return arr.length ? arr[arr.length - 1] : null;
|
|
1953
|
-
}; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
2068
|
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
1957
2069
|
var previous = 0;
|
|
1958
2070
|
var character = 0;
|
|
@@ -2080,19 +2192,64 @@ var removeLabel = function removeLabel(element) {
|
|
|
2080
2192
|
var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
|
|
2081
2193
|
|
|
2082
2194
|
var isIgnoringComment = function isIgnoringComment(element) {
|
|
2083
|
-
return
|
|
2195
|
+
return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
|
|
2084
2196
|
};
|
|
2085
2197
|
|
|
2086
2198
|
var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
|
|
2087
2199
|
return function (element, index, children) {
|
|
2088
|
-
if (element.type !== 'rule') return;
|
|
2200
|
+
if (element.type !== 'rule' || cache.compat) return;
|
|
2089
2201
|
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
2090
2202
|
|
|
2091
|
-
if (unsafePseudoClasses
|
|
2092
|
-
var
|
|
2203
|
+
if (unsafePseudoClasses) {
|
|
2204
|
+
var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule
|
|
2205
|
+
//
|
|
2206
|
+
// considering this input:
|
|
2207
|
+
// .a {
|
|
2208
|
+
// .b /* comm */ {}
|
|
2209
|
+
// color: hotpink;
|
|
2210
|
+
// }
|
|
2211
|
+
// we get output corresponding to this:
|
|
2212
|
+
// .a {
|
|
2213
|
+
// & {
|
|
2214
|
+
// /* comm */
|
|
2215
|
+
// color: hotpink;
|
|
2216
|
+
// }
|
|
2217
|
+
// .b {}
|
|
2218
|
+
// }
|
|
2219
|
+
|
|
2220
|
+
var commentContainer = isNested ? children[0].children : // global rule at the root level
|
|
2221
|
+
children;
|
|
2222
|
+
|
|
2223
|
+
for (var i = commentContainer.length - 1; i >= 0; i--) {
|
|
2224
|
+
var node = commentContainer[i];
|
|
2225
|
+
|
|
2226
|
+
if (node.line < element.line) {
|
|
2227
|
+
break;
|
|
2228
|
+
} // it is quite weird but comments are *usually* put at `column: element.column - 1`
|
|
2229
|
+
// so we seek *from the end* for the node that is earlier than the rule's `element` and check that
|
|
2230
|
+
// this will also match inputs like this:
|
|
2231
|
+
// .a {
|
|
2232
|
+
// /* comm */
|
|
2233
|
+
// .b {}
|
|
2234
|
+
// }
|
|
2235
|
+
//
|
|
2236
|
+
// but that is fine
|
|
2237
|
+
//
|
|
2238
|
+
// it would be the easiest to change the placement of the comment to be the first child of the rule:
|
|
2239
|
+
// .a {
|
|
2240
|
+
// .b { /* comm */ }
|
|
2241
|
+
// }
|
|
2242
|
+
// with such inputs we wouldn't have to search for the comment at all
|
|
2243
|
+
// TODO: consider changing this comment placement in the next major version
|
|
2244
|
+
|
|
2245
|
+
|
|
2246
|
+
if (node.column < element.column) {
|
|
2247
|
+
if (isIgnoringComment(node)) {
|
|
2248
|
+
return;
|
|
2249
|
+
}
|
|
2093
2250
|
|
|
2094
|
-
|
|
2095
|
-
|
|
2251
|
+
break;
|
|
2252
|
+
}
|
|
2096
2253
|
}
|
|
2097
2254
|
|
|
2098
2255
|
unsafePseudoClasses.forEach(function (unsafePseudoClass) {
|
|
@@ -2338,951 +2495,56 @@ var createCache = function createCache(options) {
|
|
|
2338
2495
|
return cache;
|
|
2339
2496
|
};
|
|
2340
2497
|
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2351
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2352
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2353
|
-
}
|
|
2354
|
-
Object.defineProperty(o, k2, desc);
|
|
2355
|
-
}) : (function(o, m, k, k2) {
|
|
2356
|
-
if (k2 === undefined) k2 = k;
|
|
2357
|
-
o[k2] = m[k];
|
|
2358
|
-
}));
|
|
2359
|
-
var __setModuleDefault$2 = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2360
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2361
|
-
}) : function(o, v) {
|
|
2362
|
-
o["default"] = v;
|
|
2363
|
-
});
|
|
2364
|
-
var __importStar$2 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
|
|
2365
|
-
if (mod && mod.__esModule) return mod;
|
|
2366
|
-
var result = {};
|
|
2367
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$2(result, mod, k);
|
|
2368
|
-
__setModuleDefault$2(result, mod);
|
|
2369
|
-
return result;
|
|
2370
|
-
};
|
|
2371
|
-
var __importDefault$1 = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
2372
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2373
|
-
};
|
|
2374
|
-
Object.defineProperty(cache, "__esModule", { value: true });
|
|
2375
|
-
cache.TssCacheProvider = cache.useTssEmotionCache = cache.getTssDefaultEmotionCache = cache.getDoExistsTssDefaultEmotionCacheMemoizedValue = void 0;
|
|
2376
|
-
const react_1$4 = __importStar$2(React__default);
|
|
2377
|
-
const cache_1$1 = __importDefault$1(require$$1);
|
|
2378
|
-
const { getDoExistsTssDefaultEmotionCacheMemoizedValue, getTssDefaultEmotionCache, reactContext, } = (() => {
|
|
2379
|
-
const propertyKey = "__tss-react_context";
|
|
2380
|
-
const peerDepObj =
|
|
2381
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2382
|
-
react_1$4.createContext;
|
|
2383
|
-
let sharedContext = peerDepObj["__tss-react_context"];
|
|
2384
|
-
if (sharedContext === undefined) {
|
|
2385
|
-
const { getTssDefaultEmotionCache, getDoExistsTssDefaultEmotionCacheMemoizedValue, } = (() => {
|
|
2386
|
-
let cache = undefined;
|
|
2387
|
-
/**
|
|
2388
|
-
* Lazily initialized singleton
|
|
2389
|
-
* If doReset is set to true the memoized instance will be
|
|
2390
|
-
* discarded and a new one created.
|
|
2391
|
-
* */
|
|
2392
|
-
function getTssDefaultEmotionCache(params) {
|
|
2393
|
-
const { doReset = false } = params !== null && params !== void 0 ? params : {};
|
|
2394
|
-
if (doReset) {
|
|
2395
|
-
cache = undefined;
|
|
2396
|
-
}
|
|
2397
|
-
if (cache === undefined) {
|
|
2398
|
-
cache = (0, cache_1$1.default)({ "key": "tss" });
|
|
2399
|
-
}
|
|
2400
|
-
return cache;
|
|
2401
|
-
}
|
|
2402
|
-
return {
|
|
2403
|
-
getTssDefaultEmotionCache,
|
|
2404
|
-
"getDoExistsTssDefaultEmotionCacheMemoizedValue": () => cache !== undefined,
|
|
2405
|
-
};
|
|
2406
|
-
})();
|
|
2407
|
-
sharedContext = {
|
|
2408
|
-
getTssDefaultEmotionCache,
|
|
2409
|
-
getDoExistsTssDefaultEmotionCacheMemoizedValue,
|
|
2410
|
-
"reactContext": (0, react_1$4.createContext)(undefined),
|
|
2411
|
-
};
|
|
2412
|
-
Object.defineProperty(peerDepObj, propertyKey, {
|
|
2413
|
-
"configurable": false,
|
|
2414
|
-
"enumerable": false,
|
|
2415
|
-
"writable": false,
|
|
2416
|
-
"value": sharedContext,
|
|
2417
|
-
});
|
|
2498
|
+
function _extends() {
|
|
2499
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
2500
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2501
|
+
var source = arguments[i];
|
|
2502
|
+
for (var key in source) {
|
|
2503
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2504
|
+
target[key] = source[key];
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2418
2507
|
}
|
|
2419
|
-
return
|
|
2420
|
-
}
|
|
2421
|
-
|
|
2422
|
-
cache.getTssDefaultEmotionCache = getTssDefaultEmotionCache;
|
|
2423
|
-
function useTssEmotionCache() {
|
|
2424
|
-
const cacheExplicitlyProvidedForTss = (0, react_1$4.useContext)(reactContext);
|
|
2425
|
-
return cacheExplicitlyProvidedForTss !== null && cacheExplicitlyProvidedForTss !== void 0 ? cacheExplicitlyProvidedForTss : getTssDefaultEmotionCache();
|
|
2426
|
-
}
|
|
2427
|
-
cache.useTssEmotionCache = useTssEmotionCache;
|
|
2428
|
-
function TssCacheProvider(props) {
|
|
2429
|
-
const { children, value } = props;
|
|
2430
|
-
return (react_1$4.default.createElement(reactContext.Provider, { value: value }, children));
|
|
2508
|
+
return target;
|
|
2509
|
+
};
|
|
2510
|
+
return _extends.apply(this, arguments);
|
|
2431
2511
|
}
|
|
2432
|
-
cache.TssCacheProvider = TssCacheProvider;
|
|
2433
2512
|
|
|
2434
|
-
var
|
|
2435
|
-
|
|
2436
|
-
Object.defineProperty(types, "__esModule", { value: true });
|
|
2437
|
-
types.matchCSSObject = void 0;
|
|
2438
|
-
function matchCSSObject(arg) {
|
|
2439
|
-
return (arg instanceof Object &&
|
|
2440
|
-
!("styles" in arg) &&
|
|
2441
|
-
!("length" in arg) &&
|
|
2442
|
-
!("__emotion_styles" in arg));
|
|
2443
|
-
}
|
|
2444
|
-
types.matchCSSObject = matchCSSObject;
|
|
2513
|
+
var isBrowser = typeof document !== 'undefined';
|
|
2514
|
+
var hasOwnProperty = {}.hasOwnProperty;
|
|
2445
2515
|
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
exports.createCssAndCx = (() => {
|
|
2456
|
-
function merge(registered, css, className) {
|
|
2457
|
-
const registeredStyles = [];
|
|
2458
|
-
const rawClassName = (0, utils_1.getRegisteredStyles)(registered, registeredStyles, className);
|
|
2459
|
-
if (registeredStyles.length < 2) {
|
|
2460
|
-
return className;
|
|
2461
|
-
}
|
|
2462
|
-
return rawClassName + css(registeredStyles);
|
|
2463
|
-
}
|
|
2464
|
-
function createCssAndCx(params) {
|
|
2465
|
-
const { cache } = params;
|
|
2466
|
-
const css = (...args) => {
|
|
2467
|
-
const serialized = (0, serialize_1.serializeStyles)(args, cache.registered);
|
|
2468
|
-
(0, utils_1.insertStyles)(cache, serialized, false);
|
|
2469
|
-
const className = `${cache.key}-${serialized.name}`;
|
|
2470
|
-
scope: {
|
|
2471
|
-
const arg = args[0];
|
|
2472
|
-
if (!(0, types_1.matchCSSObject)(arg)) {
|
|
2473
|
-
break scope;
|
|
2474
|
-
}
|
|
2475
|
-
increaseSpecificityToTakePrecedenceOverMediaQuerries.saveClassNameCSSObjectMapping(cache, className, arg);
|
|
2476
|
-
}
|
|
2477
|
-
return className;
|
|
2478
|
-
};
|
|
2479
|
-
const cx = (...args) => {
|
|
2480
|
-
const className = (0, classnames_1.classnames)(args);
|
|
2481
|
-
const feat27FixedClassnames = increaseSpecificityToTakePrecedenceOverMediaQuerries.fixClassName(cache, className, css);
|
|
2482
|
-
return merge(cache.registered, css, feat27FixedClassnames);
|
|
2483
|
-
//return merge(cache.registered, css, className);
|
|
2484
|
-
};
|
|
2485
|
-
return { css, cx };
|
|
2486
|
-
}
|
|
2487
|
-
return { createCssAndCx };
|
|
2488
|
-
})().createCssAndCx;
|
|
2489
|
-
/** Will pickup the contextual cache if any */
|
|
2490
|
-
function useCssAndCx() {
|
|
2491
|
-
const cache = (0, cache_1.useTssEmotionCache)();
|
|
2492
|
-
const { css, cx } = (0, useGuaranteedMemo_1.useGuaranteedMemo)(() => (0, exports.createCssAndCx)({ cache }), [cache]);
|
|
2493
|
-
return { css, cx };
|
|
2494
|
-
}
|
|
2495
|
-
exports.useCssAndCx = useCssAndCx;
|
|
2496
|
-
// https://github.com/garronej/tss-react/issues/27
|
|
2497
|
-
const increaseSpecificityToTakePrecedenceOverMediaQuerries = (() => {
|
|
2498
|
-
const cssObjectMapByCache = new WeakMap();
|
|
2499
|
-
return {
|
|
2500
|
-
"saveClassNameCSSObjectMapping": (cache, className, cssObject) => {
|
|
2501
|
-
let cssObjectMap = cssObjectMapByCache.get(cache);
|
|
2502
|
-
if (cssObjectMap === undefined) {
|
|
2503
|
-
cssObjectMap = new Map();
|
|
2504
|
-
cssObjectMapByCache.set(cache, cssObjectMap);
|
|
2505
|
-
}
|
|
2506
|
-
cssObjectMap.set(className, cssObject);
|
|
2507
|
-
},
|
|
2508
|
-
"fixClassName": (() => {
|
|
2509
|
-
function fix(classNameCSSObjects) {
|
|
2510
|
-
let isThereAnyMediaQueriesInPreviousClasses = false;
|
|
2511
|
-
return classNameCSSObjects.map(([className, cssObject]) => {
|
|
2512
|
-
if (cssObject === undefined) {
|
|
2513
|
-
return className;
|
|
2514
|
-
}
|
|
2515
|
-
let out;
|
|
2516
|
-
if (!isThereAnyMediaQueriesInPreviousClasses) {
|
|
2517
|
-
out = className;
|
|
2518
|
-
for (const key in cssObject) {
|
|
2519
|
-
if (key.startsWith("@media")) {
|
|
2520
|
-
isThereAnyMediaQueriesInPreviousClasses = true;
|
|
2521
|
-
break;
|
|
2522
|
-
}
|
|
2523
|
-
}
|
|
2524
|
-
}
|
|
2525
|
-
else {
|
|
2526
|
-
out = {
|
|
2527
|
-
"&&": cssObject,
|
|
2528
|
-
};
|
|
2529
|
-
}
|
|
2530
|
-
return out;
|
|
2531
|
-
});
|
|
2532
|
-
}
|
|
2533
|
-
return (cache, className, css) => {
|
|
2534
|
-
const cssObjectMap = cssObjectMapByCache.get(cache);
|
|
2535
|
-
return (0, classnames_1.classnames)(fix(className
|
|
2536
|
-
.split(" ")
|
|
2537
|
-
.map(className => [
|
|
2538
|
-
className,
|
|
2539
|
-
cssObjectMap === null || cssObjectMap === void 0 ? void 0 : cssObjectMap.get(className),
|
|
2540
|
-
])).map(classNameOrCSSObject => typeof classNameOrCSSObject === "string"
|
|
2541
|
-
? classNameOrCSSObject
|
|
2542
|
-
: css(classNameOrCSSObject)));
|
|
2543
|
-
};
|
|
2544
|
-
})(),
|
|
2545
|
-
};
|
|
2546
|
-
})();
|
|
2547
|
-
} (cssAndCx));
|
|
2516
|
+
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2517
|
+
// because this module is primarily intended for the browser and node
|
|
2518
|
+
// but it's also required in react native and similar environments sometimes
|
|
2519
|
+
// and we could have a special build just for that
|
|
2520
|
+
// but this is much easier and the native packages
|
|
2521
|
+
// might use a different theme context in the future anyway
|
|
2522
|
+
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
2523
|
+
key: 'css'
|
|
2524
|
+
}) : null);
|
|
2548
2525
|
|
|
2549
|
-
|
|
2526
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2527
|
+
EmotionCacheContext.displayName = 'EmotionCacheContext';
|
|
2528
|
+
}
|
|
2550
2529
|
|
|
2551
|
-
|
|
2530
|
+
EmotionCacheContext.Provider;
|
|
2531
|
+
var __unsafe_useEmotionCache = function useEmotionCache() {
|
|
2532
|
+
return useContext(EmotionCacheContext);
|
|
2533
|
+
};
|
|
2552
2534
|
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
return
|
|
2559
|
-
}
|
|
2560
|
-
|
|
2535
|
+
var withEmotionCache = function withEmotionCache(func) {
|
|
2536
|
+
// $FlowFixMe
|
|
2537
|
+
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
2538
|
+
// the cache will never be null in the browser
|
|
2539
|
+
var cache = useContext(EmotionCacheContext);
|
|
2540
|
+
return func(props, cache, ref);
|
|
2541
|
+
});
|
|
2542
|
+
};
|
|
2561
2543
|
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
getDependencyArrayRef$1.getDependencyArrayRef = void 0;
|
|
2567
|
-
/**
|
|
2568
|
-
* useEffect(
|
|
2569
|
-
* ()=> { ... },
|
|
2570
|
-
* [ { "foo": "bar" } ]
|
|
2571
|
-
* )
|
|
2572
|
-
* => The callback will be invoked every render.
|
|
2573
|
-
* because { "foo": "bar" } is a new instance every render.
|
|
2574
|
-
*
|
|
2575
|
-
* useEffect(
|
|
2576
|
-
* ()=> { ... },
|
|
2577
|
-
* [ getDependencyArrayRef({ "foo": "bar" }) ]
|
|
2578
|
-
* );
|
|
2579
|
-
* => The callback will only be invoked once.
|
|
2580
|
-
*
|
|
2581
|
-
* The optimization will be enabled only if obj is
|
|
2582
|
-
* of the form Record<string, string | number | undefined | null>
|
|
2583
|
-
* overwise the object is returned (the function is the identity function).
|
|
2584
|
-
*/
|
|
2585
|
-
function getDependencyArrayRef(obj) {
|
|
2586
|
-
if (!(obj instanceof Object) || typeof obj === "function") {
|
|
2587
|
-
return obj;
|
|
2588
|
-
}
|
|
2589
|
-
const arr = [];
|
|
2590
|
-
for (const key in obj) {
|
|
2591
|
-
const value = obj[key];
|
|
2592
|
-
const typeofValue = typeof value;
|
|
2593
|
-
if (!(typeofValue === "string" ||
|
|
2594
|
-
(typeofValue === "number" && !isNaN(value)) ||
|
|
2595
|
-
typeofValue === "boolean" ||
|
|
2596
|
-
value === undefined ||
|
|
2597
|
-
value === null)) {
|
|
2598
|
-
return obj;
|
|
2599
|
-
}
|
|
2600
|
-
arr.push(`${key}:${typeofValue}_${value}`);
|
|
2601
|
-
}
|
|
2602
|
-
return "xSqLiJdLMd9s" + arr.join("|");
|
|
2603
|
-
}
|
|
2604
|
-
getDependencyArrayRef$1.getDependencyArrayRef = getDependencyArrayRef;
|
|
2605
|
-
|
|
2606
|
-
/* eslint-disable @typescript-eslint/ban-types */
|
|
2607
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2608
|
-
Object.defineProperty(mergeClasses$1, "__esModule", { value: true });
|
|
2609
|
-
mergeClasses$1.useMergedClasses = mergeClasses$1.mergeClasses = void 0;
|
|
2610
|
-
const objectKeys_1$1 = objectKeys$1;
|
|
2611
|
-
const getDependencyArrayRef_1$1 = getDependencyArrayRef$1;
|
|
2612
|
-
const cssAndCx_1$1 = cssAndCx;
|
|
2613
|
-
const react_1$3 = React__default;
|
|
2614
|
-
function mergeClasses(classesFromUseStyles, classesFromProps, cx) {
|
|
2615
|
-
//NOTE: We use this test to be resilient in case classesFromProps is not of the expected type.
|
|
2616
|
-
if (!(classesFromProps instanceof Object)) {
|
|
2617
|
-
return classesFromUseStyles;
|
|
2618
|
-
}
|
|
2619
|
-
const out = {};
|
|
2620
|
-
(0, objectKeys_1$1.objectKeys)(classesFromUseStyles).forEach(ruleName => (out[ruleName] = cx(classesFromUseStyles[ruleName], classesFromProps[ruleName])));
|
|
2621
|
-
(0, objectKeys_1$1.objectKeys)(classesFromProps).forEach(ruleName => {
|
|
2622
|
-
if (ruleName in classesFromUseStyles) {
|
|
2623
|
-
return;
|
|
2624
|
-
}
|
|
2625
|
-
const className = classesFromProps[ruleName];
|
|
2626
|
-
//...Same here, that why we don't do className === undefined
|
|
2627
|
-
if (typeof className !== "string") {
|
|
2628
|
-
return;
|
|
2629
|
-
}
|
|
2630
|
-
out[ruleName] = className;
|
|
2631
|
-
});
|
|
2632
|
-
return out;
|
|
2633
|
-
}
|
|
2634
|
-
mergeClasses$1.mergeClasses = mergeClasses;
|
|
2635
|
-
function useMergedClasses(classes, classesOv) {
|
|
2636
|
-
const { cx } = (0, cssAndCx_1$1.useCssAndCx)();
|
|
2637
|
-
return (0, react_1$3.useMemo)(() => mergeClasses(classes, classesOv, cx), [classes, (0, getDependencyArrayRef_1$1.getDependencyArrayRef)(classesOv), cx]);
|
|
2638
|
-
}
|
|
2639
|
-
mergeClasses$1.useMergedClasses = useMergedClasses;
|
|
2640
|
-
|
|
2641
|
-
var makeStyles$1 = {};
|
|
2642
|
-
|
|
2643
|
-
var Object_fromEntries = {};
|
|
2644
|
-
|
|
2645
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2646
|
-
Object.defineProperty(Object_fromEntries, "__esModule", { value: true });
|
|
2647
|
-
Object_fromEntries.objectFromEntries = void 0;
|
|
2648
|
-
Object_fromEntries.objectFromEntries = !Object
|
|
2649
|
-
.fromEntries
|
|
2650
|
-
? (entries) => {
|
|
2651
|
-
if (!entries || !entries[Symbol.iterator]) {
|
|
2652
|
-
throw new Error("Object.fromEntries() requires a single iterable argument");
|
|
2653
|
-
}
|
|
2654
|
-
const o = {};
|
|
2655
|
-
Object.keys(entries).forEach(key => {
|
|
2656
|
-
const [k, v] = entries[key];
|
|
2657
|
-
o[k] = v;
|
|
2658
|
-
});
|
|
2659
|
-
return o;
|
|
2660
|
-
}
|
|
2661
|
-
: Object.fromEntries;
|
|
2662
|
-
|
|
2663
|
-
Object.defineProperty(makeStyles$1, "__esModule", { value: true });
|
|
2664
|
-
makeStyles$1.createMakeStyles = void 0;
|
|
2665
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2666
|
-
const react_1$2 = React__default;
|
|
2667
|
-
const Object_fromEntries_1 = Object_fromEntries;
|
|
2668
|
-
const objectKeys_1 = objectKeys$1;
|
|
2669
|
-
const cssAndCx_1 = cssAndCx;
|
|
2670
|
-
const getDependencyArrayRef_1 = getDependencyArrayRef$1;
|
|
2671
|
-
const typeGuard_1 = typeGuard$1;
|
|
2672
|
-
const cache_1 = cache;
|
|
2673
|
-
const assert_1 = assert$1;
|
|
2674
|
-
const mergeClasses_1 = mergeClasses$1;
|
|
2675
|
-
let counter = 0;
|
|
2676
|
-
function createMakeStyles(params) {
|
|
2677
|
-
const { useTheme } = params;
|
|
2678
|
-
/** returns useStyle. */
|
|
2679
|
-
function makeStyles(params) {
|
|
2680
|
-
const { name: nameOrWrappedName, uniqId = counter++ } = params !== null && params !== void 0 ? params : {};
|
|
2681
|
-
const name = typeof nameOrWrappedName !== "object"
|
|
2682
|
-
? nameOrWrappedName
|
|
2683
|
-
: Object.keys(nameOrWrappedName)[0];
|
|
2684
|
-
return function (cssObjectByRuleNameOrGetCssObjectByRuleName) {
|
|
2685
|
-
const getCssObjectByRuleName = typeof cssObjectByRuleNameOrGetCssObjectByRuleName ===
|
|
2686
|
-
"function"
|
|
2687
|
-
? cssObjectByRuleNameOrGetCssObjectByRuleName
|
|
2688
|
-
: () => cssObjectByRuleNameOrGetCssObjectByRuleName;
|
|
2689
|
-
return function useStyles(params, styleOverrides) {
|
|
2690
|
-
var _a, _b;
|
|
2691
|
-
const theme = useTheme();
|
|
2692
|
-
const { css, cx } = (0, cssAndCx_1.useCssAndCx)();
|
|
2693
|
-
const cache = (0, cache_1.useTssEmotionCache)();
|
|
2694
|
-
let classes = (0, react_1$2.useMemo)(() => {
|
|
2695
|
-
const refClassesCache = {};
|
|
2696
|
-
const refClasses = typeof Proxy !== "undefined" &&
|
|
2697
|
-
new Proxy({}, {
|
|
2698
|
-
"get": (_target, propertyKey) => {
|
|
2699
|
-
if (typeof propertyKey === "symbol") {
|
|
2700
|
-
(0, assert_1.assert)(false);
|
|
2701
|
-
}
|
|
2702
|
-
return (refClassesCache[propertyKey] = `${cache.key}-${uniqId}${name !== undefined ? `-${name}` : ""}-${propertyKey}-ref`);
|
|
2703
|
-
},
|
|
2704
|
-
});
|
|
2705
|
-
const cssObjectByRuleName = getCssObjectByRuleName(theme, params, refClasses || {});
|
|
2706
|
-
const classes = (0, Object_fromEntries_1.objectFromEntries)((0, objectKeys_1.objectKeys)(cssObjectByRuleName).map(ruleName => {
|
|
2707
|
-
const cssObject = cssObjectByRuleName[ruleName];
|
|
2708
|
-
if (!cssObject.label) {
|
|
2709
|
-
cssObject.label = `${name !== undefined ? `${name}-` : ""}${ruleName}`;
|
|
2710
|
-
}
|
|
2711
|
-
return [
|
|
2712
|
-
ruleName,
|
|
2713
|
-
`${css(cssObject)}${(0, typeGuard_1.typeGuard)(ruleName, ruleName in refClassesCache)
|
|
2714
|
-
? ` ${refClassesCache[ruleName]}`
|
|
2715
|
-
: ""}`,
|
|
2716
|
-
];
|
|
2717
|
-
}));
|
|
2718
|
-
(0, objectKeys_1.objectKeys)(refClassesCache).forEach(ruleName => {
|
|
2719
|
-
if (ruleName in classes) {
|
|
2720
|
-
return;
|
|
2721
|
-
}
|
|
2722
|
-
classes[ruleName] =
|
|
2723
|
-
refClassesCache[ruleName];
|
|
2724
|
-
});
|
|
2725
|
-
return classes;
|
|
2726
|
-
}, [cache, css, cx, theme, (0, getDependencyArrayRef_1.getDependencyArrayRef)(params)]);
|
|
2727
|
-
const propsClasses = styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props.classes;
|
|
2728
|
-
{
|
|
2729
|
-
classes = (0, react_1$2.useMemo)(() => (0, mergeClasses_1.mergeClasses)(classes, propsClasses, cx), [classes, (0, getDependencyArrayRef_1.getDependencyArrayRef)(propsClasses), cx]);
|
|
2730
|
-
}
|
|
2731
|
-
{
|
|
2732
|
-
let cssObjectByRuleNameOrGetCssObjectByRuleName = undefined;
|
|
2733
|
-
try {
|
|
2734
|
-
cssObjectByRuleNameOrGetCssObjectByRuleName =
|
|
2735
|
-
name !== undefined
|
|
2736
|
-
? (_b = (_a = theme.components) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.styleOverrides
|
|
2737
|
-
: undefined;
|
|
2738
|
-
// eslint-disable-next-line no-empty
|
|
2739
|
-
}
|
|
2740
|
-
catch (_c) { }
|
|
2741
|
-
const themeClasses = (0, react_1$2.useMemo)(() => {
|
|
2742
|
-
if (!cssObjectByRuleNameOrGetCssObjectByRuleName) {
|
|
2743
|
-
return undefined;
|
|
2744
|
-
}
|
|
2745
|
-
const themeClasses = {};
|
|
2746
|
-
for (const ruleName in cssObjectByRuleNameOrGetCssObjectByRuleName) {
|
|
2747
|
-
const cssObjectOrGetCssObject = cssObjectByRuleNameOrGetCssObjectByRuleName[ruleName];
|
|
2748
|
-
if (!(cssObjectOrGetCssObject instanceof Object)) {
|
|
2749
|
-
continue;
|
|
2750
|
-
}
|
|
2751
|
-
themeClasses[ruleName] = css(typeof cssObjectOrGetCssObject === "function"
|
|
2752
|
-
? cssObjectOrGetCssObject(Object.assign({ theme, "ownerState": styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.ownerState }, styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props))
|
|
2753
|
-
: cssObjectOrGetCssObject);
|
|
2754
|
-
}
|
|
2755
|
-
return themeClasses;
|
|
2756
|
-
}, [
|
|
2757
|
-
cssObjectByRuleNameOrGetCssObjectByRuleName ===
|
|
2758
|
-
undefined
|
|
2759
|
-
? undefined
|
|
2760
|
-
: JSON.stringify(cssObjectByRuleNameOrGetCssObjectByRuleName),
|
|
2761
|
-
(0, getDependencyArrayRef_1.getDependencyArrayRef)(styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props),
|
|
2762
|
-
(0, getDependencyArrayRef_1.getDependencyArrayRef)(styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.ownerState),
|
|
2763
|
-
css,
|
|
2764
|
-
]);
|
|
2765
|
-
classes = (0, react_1$2.useMemo)(() => (0, mergeClasses_1.mergeClasses)(classes, themeClasses, cx), [classes, themeClasses, cx]);
|
|
2766
|
-
}
|
|
2767
|
-
return {
|
|
2768
|
-
classes,
|
|
2769
|
-
theme,
|
|
2770
|
-
css,
|
|
2771
|
-
cx,
|
|
2772
|
-
};
|
|
2773
|
-
};
|
|
2774
|
-
};
|
|
2775
|
-
}
|
|
2776
|
-
function useStyles() {
|
|
2777
|
-
const theme = useTheme();
|
|
2778
|
-
const { css, cx } = (0, cssAndCx_1.useCssAndCx)();
|
|
2779
|
-
return { theme, css, cx };
|
|
2780
|
-
}
|
|
2781
|
-
return { makeStyles, useStyles };
|
|
2782
|
-
}
|
|
2783
|
-
makeStyles$1.createMakeStyles = createMakeStyles;
|
|
2784
|
-
|
|
2785
|
-
var withStyles$1 = {};
|
|
2786
|
-
|
|
2787
|
-
var capitalize$1 = {};
|
|
2788
|
-
|
|
2789
|
-
Object.defineProperty(capitalize$1, "__esModule", { value: true });
|
|
2790
|
-
capitalize$1.capitalize = void 0;
|
|
2791
|
-
/** @see <https://docs.tsafe.dev/capitalize> */
|
|
2792
|
-
function capitalize(str) {
|
|
2793
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2794
|
-
return (str.charAt(0).toUpperCase() + str.slice(1));
|
|
2795
|
-
}
|
|
2796
|
-
capitalize$1.capitalize = capitalize;
|
|
2797
|
-
|
|
2798
|
-
var __createBinding$1 = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
2799
|
-
if (k2 === undefined) k2 = k;
|
|
2800
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2801
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
2802
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
2803
|
-
}
|
|
2804
|
-
Object.defineProperty(o, k2, desc);
|
|
2805
|
-
}) : (function(o, m, k, k2) {
|
|
2806
|
-
if (k2 === undefined) k2 = k;
|
|
2807
|
-
o[k2] = m[k];
|
|
2808
|
-
}));
|
|
2809
|
-
var __setModuleDefault$1 = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
2810
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
2811
|
-
}) : function(o, v) {
|
|
2812
|
-
o["default"] = v;
|
|
2813
|
-
});
|
|
2814
|
-
var __importStar$1 = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
|
|
2815
|
-
if (mod && mod.__esModule) return mod;
|
|
2816
|
-
var result = {};
|
|
2817
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding$1(result, mod, k);
|
|
2818
|
-
__setModuleDefault$1(result, mod);
|
|
2819
|
-
return result;
|
|
2820
|
-
};
|
|
2821
|
-
var __rest = (commonjsGlobal && commonjsGlobal.__rest) || function (s, e) {
|
|
2822
|
-
var t = {};
|
|
2823
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2824
|
-
t[p] = s[p];
|
|
2825
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2826
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2827
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2828
|
-
t[p[i]] = s[p[i]];
|
|
2829
|
-
}
|
|
2830
|
-
return t;
|
|
2831
|
-
};
|
|
2832
|
-
Object.defineProperty(withStyles$1, "__esModule", { value: true });
|
|
2833
|
-
withStyles$1.createWithStyles = void 0;
|
|
2834
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2835
|
-
const react_1$1 = __importStar$1(React__default);
|
|
2836
|
-
const makeStyles_1 = makeStyles$1;
|
|
2837
|
-
const capitalize_1 = capitalize$1;
|
|
2838
|
-
function createWithStyles(params) {
|
|
2839
|
-
const { useTheme } = params;
|
|
2840
|
-
const { makeStyles } = (0, makeStyles_1.createMakeStyles)({ useTheme });
|
|
2841
|
-
function withStyles(Component, cssObjectByRuleNameOrGetCssObjectByRuleName, params) {
|
|
2842
|
-
const Component_ = typeof Component === "string"
|
|
2843
|
-
? (() => {
|
|
2844
|
-
const tag = Component;
|
|
2845
|
-
const Out = function (_a) {
|
|
2846
|
-
var { children } = _a, props = __rest(_a, ["children"]);
|
|
2847
|
-
return (0, react_1$1.createElement)(tag, props, children);
|
|
2848
|
-
};
|
|
2849
|
-
Object.defineProperty(Out, "name", {
|
|
2850
|
-
"value": (0, capitalize_1.capitalize)(tag),
|
|
2851
|
-
});
|
|
2852
|
-
return Out;
|
|
2853
|
-
})()
|
|
2854
|
-
: Component;
|
|
2855
|
-
const name = (() => {
|
|
2856
|
-
const { name } = Component_;
|
|
2857
|
-
return typeof name === "string" ? name : undefined;
|
|
2858
|
-
})();
|
|
2859
|
-
const useStyles = makeStyles(params)(typeof cssObjectByRuleNameOrGetCssObjectByRuleName === "function"
|
|
2860
|
-
? (theme, props, classes) => incorporateMediaQueries(cssObjectByRuleNameOrGetCssObjectByRuleName(theme, props, classes))
|
|
2861
|
-
: incorporateMediaQueries(cssObjectByRuleNameOrGetCssObjectByRuleName));
|
|
2862
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2863
|
-
const Out = (0, react_1$1.forwardRef)(function (props, ref) {
|
|
2864
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2865
|
-
const { className, classes: _classes } = props, rest = __rest(props, ["className", "classes"]);
|
|
2866
|
-
const { classes, cx } = useStyles(props, { props });
|
|
2867
|
-
return (react_1$1.default.createElement(Component_, Object.assign({ ref: ref, className: cx(classes.root, className) }, (typeof Component === "string" ? {} : { classes }), rest)));
|
|
2868
|
-
});
|
|
2869
|
-
if (name !== undefined) {
|
|
2870
|
-
Object.defineProperty(Out, "name", {
|
|
2871
|
-
"value": `${name}WithStyles`,
|
|
2872
|
-
});
|
|
2873
|
-
}
|
|
2874
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2875
|
-
return Out;
|
|
2876
|
-
}
|
|
2877
|
-
return { withStyles };
|
|
2878
|
-
}
|
|
2879
|
-
withStyles$1.createWithStyles = createWithStyles;
|
|
2880
|
-
function incorporateMediaQueries(cssObjectByRuleNameWithMediaQueries) {
|
|
2881
|
-
const cssObjectByRuleName = {};
|
|
2882
|
-
const cssObjectByRuleNameWithMediaQueriesByMediaQuery = {};
|
|
2883
|
-
Object.keys(cssObjectByRuleNameWithMediaQueries).forEach(ruleNameOrMediaQuery => ((ruleNameOrMediaQuery.startsWith("@media")
|
|
2884
|
-
? cssObjectByRuleNameWithMediaQueriesByMediaQuery
|
|
2885
|
-
: cssObjectByRuleName)[ruleNameOrMediaQuery] =
|
|
2886
|
-
cssObjectByRuleNameWithMediaQueries[ruleNameOrMediaQuery]));
|
|
2887
|
-
Object.keys(cssObjectByRuleNameWithMediaQueriesByMediaQuery).forEach(mediaQuery => {
|
|
2888
|
-
const cssObjectByRuleNameBis = cssObjectByRuleNameWithMediaQueriesByMediaQuery[mediaQuery];
|
|
2889
|
-
Object.keys(cssObjectByRuleNameBis).forEach(ruleName => {
|
|
2890
|
-
var _a;
|
|
2891
|
-
return (cssObjectByRuleName[ruleName] = Object.assign(Object.assign({}, ((_a = cssObjectByRuleName[ruleName]) !== null && _a !== void 0 ? _a : {})), { [mediaQuery]: cssObjectByRuleNameBis[ruleName] }));
|
|
2892
|
-
});
|
|
2893
|
-
});
|
|
2894
|
-
return cssObjectByRuleName;
|
|
2895
|
-
}
|
|
2896
|
-
|
|
2897
|
-
function _extends() {
|
|
2898
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
2899
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2900
|
-
var source = arguments[i];
|
|
2901
|
-
|
|
2902
|
-
for (var key in source) {
|
|
2903
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2904
|
-
target[key] = source[key];
|
|
2905
|
-
}
|
|
2906
|
-
}
|
|
2907
|
-
}
|
|
2908
|
-
|
|
2909
|
-
return target;
|
|
2910
|
-
};
|
|
2911
|
-
return _extends.apply(this, arguments);
|
|
2912
|
-
}
|
|
2913
|
-
|
|
2914
|
-
var reactIs$1 = {exports: {}};
|
|
2915
|
-
|
|
2916
|
-
var reactIs_production_min = {};
|
|
2917
|
-
|
|
2918
|
-
/** @license React v16.13.1
|
|
2919
|
-
* react-is.production.min.js
|
|
2920
|
-
*
|
|
2921
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
2922
|
-
*
|
|
2923
|
-
* This source code is licensed under the MIT license found in the
|
|
2924
|
-
* LICENSE file in the root directory of this source tree.
|
|
2925
|
-
*/
|
|
2926
|
-
|
|
2927
|
-
var hasRequiredReactIs_production_min;
|
|
2928
|
-
|
|
2929
|
-
function requireReactIs_production_min () {
|
|
2930
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
2931
|
-
hasRequiredReactIs_production_min = 1;
|
|
2932
|
-
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?
|
|
2933
|
-
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;
|
|
2934
|
-
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;
|
|
2935
|
-
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};
|
|
2936
|
-
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};
|
|
2937
|
-
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;
|
|
2938
|
-
return reactIs_production_min;
|
|
2939
|
-
}
|
|
2940
|
-
|
|
2941
|
-
var reactIs_development = {};
|
|
2942
|
-
|
|
2943
|
-
/** @license React v16.13.1
|
|
2944
|
-
* react-is.development.js
|
|
2945
|
-
*
|
|
2946
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
2947
|
-
*
|
|
2948
|
-
* This source code is licensed under the MIT license found in the
|
|
2949
|
-
* LICENSE file in the root directory of this source tree.
|
|
2950
|
-
*/
|
|
2951
|
-
|
|
2952
|
-
var hasRequiredReactIs_development;
|
|
2953
|
-
|
|
2954
|
-
function requireReactIs_development () {
|
|
2955
|
-
if (hasRequiredReactIs_development) return reactIs_development;
|
|
2956
|
-
hasRequiredReactIs_development = 1;
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
if (process.env.NODE_ENV !== "production") {
|
|
2961
|
-
(function() {
|
|
2962
|
-
|
|
2963
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
2964
|
-
// nor polyfill, then a plain number is used for performance.
|
|
2965
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
2966
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
2967
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
2968
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
2969
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
2970
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
2971
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
2972
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
2973
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
2974
|
-
|
|
2975
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
2976
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
2977
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
2978
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
2979
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
2980
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
2981
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
2982
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
2983
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
2984
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
2985
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
2986
|
-
|
|
2987
|
-
function isValidElementType(type) {
|
|
2988
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
2989
|
-
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);
|
|
2990
|
-
}
|
|
2991
|
-
|
|
2992
|
-
function typeOf(object) {
|
|
2993
|
-
if (typeof object === 'object' && object !== null) {
|
|
2994
|
-
var $$typeof = object.$$typeof;
|
|
2995
|
-
|
|
2996
|
-
switch ($$typeof) {
|
|
2997
|
-
case REACT_ELEMENT_TYPE:
|
|
2998
|
-
var type = object.type;
|
|
2999
|
-
|
|
3000
|
-
switch (type) {
|
|
3001
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
3002
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
3003
|
-
case REACT_FRAGMENT_TYPE:
|
|
3004
|
-
case REACT_PROFILER_TYPE:
|
|
3005
|
-
case REACT_STRICT_MODE_TYPE:
|
|
3006
|
-
case REACT_SUSPENSE_TYPE:
|
|
3007
|
-
return type;
|
|
3008
|
-
|
|
3009
|
-
default:
|
|
3010
|
-
var $$typeofType = type && type.$$typeof;
|
|
3011
|
-
|
|
3012
|
-
switch ($$typeofType) {
|
|
3013
|
-
case REACT_CONTEXT_TYPE:
|
|
3014
|
-
case REACT_FORWARD_REF_TYPE:
|
|
3015
|
-
case REACT_LAZY_TYPE:
|
|
3016
|
-
case REACT_MEMO_TYPE:
|
|
3017
|
-
case REACT_PROVIDER_TYPE:
|
|
3018
|
-
return $$typeofType;
|
|
3019
|
-
|
|
3020
|
-
default:
|
|
3021
|
-
return $$typeof;
|
|
3022
|
-
}
|
|
3023
|
-
|
|
3024
|
-
}
|
|
3025
|
-
|
|
3026
|
-
case REACT_PORTAL_TYPE:
|
|
3027
|
-
return $$typeof;
|
|
3028
|
-
}
|
|
3029
|
-
}
|
|
3030
|
-
|
|
3031
|
-
return undefined;
|
|
3032
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
3033
|
-
|
|
3034
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
3035
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
3036
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
3037
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
3038
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
3039
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
3040
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
3041
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
3042
|
-
var Memo = REACT_MEMO_TYPE;
|
|
3043
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
3044
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
3045
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
3046
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
3047
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
3048
|
-
|
|
3049
|
-
function isAsyncMode(object) {
|
|
3050
|
-
{
|
|
3051
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
3052
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
3053
|
-
|
|
3054
|
-
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.');
|
|
3055
|
-
}
|
|
3056
|
-
}
|
|
3057
|
-
|
|
3058
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
3059
|
-
}
|
|
3060
|
-
function isConcurrentMode(object) {
|
|
3061
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
3062
|
-
}
|
|
3063
|
-
function isContextConsumer(object) {
|
|
3064
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
3065
|
-
}
|
|
3066
|
-
function isContextProvider(object) {
|
|
3067
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
3068
|
-
}
|
|
3069
|
-
function isElement(object) {
|
|
3070
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
3071
|
-
}
|
|
3072
|
-
function isForwardRef(object) {
|
|
3073
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
3074
|
-
}
|
|
3075
|
-
function isFragment(object) {
|
|
3076
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
3077
|
-
}
|
|
3078
|
-
function isLazy(object) {
|
|
3079
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
3080
|
-
}
|
|
3081
|
-
function isMemo(object) {
|
|
3082
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
3083
|
-
}
|
|
3084
|
-
function isPortal(object) {
|
|
3085
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
3086
|
-
}
|
|
3087
|
-
function isProfiler(object) {
|
|
3088
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
3089
|
-
}
|
|
3090
|
-
function isStrictMode(object) {
|
|
3091
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
3092
|
-
}
|
|
3093
|
-
function isSuspense(object) {
|
|
3094
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
3095
|
-
}
|
|
3096
|
-
|
|
3097
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
3098
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
3099
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
3100
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
3101
|
-
reactIs_development.Element = Element;
|
|
3102
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
3103
|
-
reactIs_development.Fragment = Fragment;
|
|
3104
|
-
reactIs_development.Lazy = Lazy;
|
|
3105
|
-
reactIs_development.Memo = Memo;
|
|
3106
|
-
reactIs_development.Portal = Portal;
|
|
3107
|
-
reactIs_development.Profiler = Profiler;
|
|
3108
|
-
reactIs_development.StrictMode = StrictMode;
|
|
3109
|
-
reactIs_development.Suspense = Suspense;
|
|
3110
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
3111
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
3112
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
3113
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
3114
|
-
reactIs_development.isElement = isElement;
|
|
3115
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
3116
|
-
reactIs_development.isFragment = isFragment;
|
|
3117
|
-
reactIs_development.isLazy = isLazy;
|
|
3118
|
-
reactIs_development.isMemo = isMemo;
|
|
3119
|
-
reactIs_development.isPortal = isPortal;
|
|
3120
|
-
reactIs_development.isProfiler = isProfiler;
|
|
3121
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
3122
|
-
reactIs_development.isSuspense = isSuspense;
|
|
3123
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
3124
|
-
reactIs_development.typeOf = typeOf;
|
|
3125
|
-
})();
|
|
3126
|
-
}
|
|
3127
|
-
return reactIs_development;
|
|
3128
|
-
}
|
|
3129
|
-
|
|
3130
|
-
(function (module) {
|
|
3131
|
-
|
|
3132
|
-
if (process.env.NODE_ENV === 'production') {
|
|
3133
|
-
module.exports = requireReactIs_production_min();
|
|
3134
|
-
} else {
|
|
3135
|
-
module.exports = requireReactIs_development();
|
|
3136
|
-
}
|
|
3137
|
-
} (reactIs$1));
|
|
3138
|
-
|
|
3139
|
-
var reactIs = reactIs$1.exports;
|
|
3140
|
-
|
|
3141
|
-
/**
|
|
3142
|
-
* Copyright 2015, Yahoo! Inc.
|
|
3143
|
-
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
|
3144
|
-
*/
|
|
3145
|
-
var REACT_STATICS = {
|
|
3146
|
-
childContextTypes: true,
|
|
3147
|
-
contextType: true,
|
|
3148
|
-
contextTypes: true,
|
|
3149
|
-
defaultProps: true,
|
|
3150
|
-
displayName: true,
|
|
3151
|
-
getDefaultProps: true,
|
|
3152
|
-
getDerivedStateFromError: true,
|
|
3153
|
-
getDerivedStateFromProps: true,
|
|
3154
|
-
mixins: true,
|
|
3155
|
-
propTypes: true,
|
|
3156
|
-
type: true
|
|
3157
|
-
};
|
|
3158
|
-
var KNOWN_STATICS = {
|
|
3159
|
-
name: true,
|
|
3160
|
-
length: true,
|
|
3161
|
-
prototype: true,
|
|
3162
|
-
caller: true,
|
|
3163
|
-
callee: true,
|
|
3164
|
-
arguments: true,
|
|
3165
|
-
arity: true
|
|
3166
|
-
};
|
|
3167
|
-
var FORWARD_REF_STATICS = {
|
|
3168
|
-
'$$typeof': true,
|
|
3169
|
-
render: true,
|
|
3170
|
-
defaultProps: true,
|
|
3171
|
-
displayName: true,
|
|
3172
|
-
propTypes: true
|
|
3173
|
-
};
|
|
3174
|
-
var MEMO_STATICS = {
|
|
3175
|
-
'$$typeof': true,
|
|
3176
|
-
compare: true,
|
|
3177
|
-
defaultProps: true,
|
|
3178
|
-
displayName: true,
|
|
3179
|
-
propTypes: true,
|
|
3180
|
-
type: true
|
|
3181
|
-
};
|
|
3182
|
-
var TYPE_STATICS = {};
|
|
3183
|
-
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
3184
|
-
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
3185
|
-
|
|
3186
|
-
function getStatics(component) {
|
|
3187
|
-
// React v16.11 and below
|
|
3188
|
-
if (reactIs.isMemo(component)) {
|
|
3189
|
-
return MEMO_STATICS;
|
|
3190
|
-
} // React v16.12 and above
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;
|
|
3194
|
-
}
|
|
3195
|
-
|
|
3196
|
-
var defineProperty = Object.defineProperty;
|
|
3197
|
-
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
|
3198
|
-
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
3199
|
-
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
|
3200
|
-
var getPrototypeOf = Object.getPrototypeOf;
|
|
3201
|
-
var objectPrototype = Object.prototype;
|
|
3202
|
-
function hoistNonReactStatics$2(targetComponent, sourceComponent, blacklist) {
|
|
3203
|
-
if (typeof sourceComponent !== 'string') {
|
|
3204
|
-
// don't hoist over string (html) components
|
|
3205
|
-
if (objectPrototype) {
|
|
3206
|
-
var inheritedComponent = getPrototypeOf(sourceComponent);
|
|
3207
|
-
|
|
3208
|
-
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
|
3209
|
-
hoistNonReactStatics$2(targetComponent, inheritedComponent, blacklist);
|
|
3210
|
-
}
|
|
3211
|
-
}
|
|
3212
|
-
|
|
3213
|
-
var keys = getOwnPropertyNames(sourceComponent);
|
|
3214
|
-
|
|
3215
|
-
if (getOwnPropertySymbols) {
|
|
3216
|
-
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
|
3217
|
-
}
|
|
3218
|
-
|
|
3219
|
-
var targetStatics = getStatics(targetComponent);
|
|
3220
|
-
var sourceStatics = getStatics(sourceComponent);
|
|
3221
|
-
|
|
3222
|
-
for (var i = 0; i < keys.length; ++i) {
|
|
3223
|
-
var key = keys[i];
|
|
3224
|
-
|
|
3225
|
-
if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {
|
|
3226
|
-
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
|
3227
|
-
|
|
3228
|
-
try {
|
|
3229
|
-
// Avoid failures from read-only properties
|
|
3230
|
-
defineProperty(targetComponent, key, descriptor);
|
|
3231
|
-
} catch (e) {}
|
|
3232
|
-
}
|
|
3233
|
-
}
|
|
3234
|
-
}
|
|
3235
|
-
|
|
3236
|
-
return targetComponent;
|
|
3237
|
-
}
|
|
3238
|
-
|
|
3239
|
-
var hoistNonReactStatics_cjs = hoistNonReactStatics$2;
|
|
3240
|
-
|
|
3241
|
-
// this file isolates this package that is not tree-shakeable
|
|
3242
|
-
// and if this module doesn't actually contain any logic of its own
|
|
3243
|
-
// then Rollup just use 'hoist-non-react-statics' directly in other chunks
|
|
3244
|
-
|
|
3245
|
-
var hoistNonReactStatics = (function (targetComponent, sourceComponent) {
|
|
3246
|
-
return hoistNonReactStatics_cjs(targetComponent, sourceComponent);
|
|
3247
|
-
});
|
|
3248
|
-
|
|
3249
|
-
var hoistNonReactStatics$1 = hoistNonReactStatics;
|
|
3250
|
-
|
|
3251
|
-
var isBrowser$1 = typeof document !== 'undefined';
|
|
3252
|
-
var hasOwnProperty = {}.hasOwnProperty;
|
|
3253
|
-
|
|
3254
|
-
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
3255
|
-
// because this module is primarily intended for the browser and node
|
|
3256
|
-
// but it's also required in react native and similar environments sometimes
|
|
3257
|
-
// and we could have a special build just for that
|
|
3258
|
-
// but this is much easier and the native packages
|
|
3259
|
-
// might use a different theme context in the future anyway
|
|
3260
|
-
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
3261
|
-
key: 'css'
|
|
3262
|
-
}) : null);
|
|
3263
|
-
|
|
3264
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3265
|
-
EmotionCacheContext.displayName = 'EmotionCacheContext';
|
|
3266
|
-
}
|
|
3267
|
-
|
|
3268
|
-
var CacheProvider = EmotionCacheContext.Provider;
|
|
3269
|
-
var __unsafe_useEmotionCache = function useEmotionCache() {
|
|
3270
|
-
return useContext(EmotionCacheContext);
|
|
3271
|
-
};
|
|
3272
|
-
|
|
3273
|
-
var withEmotionCache = function withEmotionCache(func) {
|
|
3274
|
-
// $FlowFixMe
|
|
3275
|
-
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
3276
|
-
// the cache will never be null in the browser
|
|
3277
|
-
var cache = useContext(EmotionCacheContext);
|
|
3278
|
-
return func(props, cache, ref);
|
|
3279
|
-
});
|
|
3280
|
-
};
|
|
3281
|
-
|
|
3282
|
-
if (!isBrowser$1) {
|
|
3283
|
-
withEmotionCache = function withEmotionCache(func) {
|
|
3284
|
-
return function (props) {
|
|
3285
|
-
var cache = useContext(EmotionCacheContext);
|
|
2544
|
+
if (!isBrowser) {
|
|
2545
|
+
withEmotionCache = function withEmotionCache(func) {
|
|
2546
|
+
return function (props) {
|
|
2547
|
+
var cache = useContext(EmotionCacheContext);
|
|
3286
2548
|
|
|
3287
2549
|
if (cache === null) {
|
|
3288
2550
|
// yes, we're potentially creating this on every render
|
|
@@ -3301,593 +2563,50 @@ if (!isBrowser$1) {
|
|
|
3301
2563
|
}
|
|
3302
2564
|
};
|
|
3303
2565
|
};
|
|
3304
|
-
}
|
|
3305
|
-
|
|
3306
|
-
var ThemeContext = /* #__PURE__ */createContext({});
|
|
3307
|
-
|
|
3308
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3309
|
-
ThemeContext.displayName = 'EmotionThemeContext';
|
|
3310
|
-
}
|
|
3311
|
-
|
|
3312
|
-
var useTheme = function useTheme() {
|
|
3313
|
-
return useContext(ThemeContext);
|
|
3314
|
-
};
|
|
3315
|
-
|
|
3316
|
-
var getTheme = function getTheme(outerTheme, theme) {
|
|
3317
|
-
if (typeof theme === 'function') {
|
|
3318
|
-
var mergedTheme = theme(outerTheme);
|
|
3319
|
-
|
|
3320
|
-
if (process.env.NODE_ENV !== 'production' && (mergedTheme == null || typeof mergedTheme !== 'object' || Array.isArray(mergedTheme))) {
|
|
3321
|
-
throw new Error('[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!');
|
|
3322
|
-
}
|
|
3323
|
-
|
|
3324
|
-
return mergedTheme;
|
|
3325
|
-
}
|
|
3326
|
-
|
|
3327
|
-
if (process.env.NODE_ENV !== 'production' && (theme == null || typeof theme !== 'object' || Array.isArray(theme))) {
|
|
3328
|
-
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
|
|
3329
|
-
}
|
|
3330
|
-
|
|
3331
|
-
return _extends({}, outerTheme, theme);
|
|
3332
|
-
};
|
|
3333
|
-
|
|
3334
|
-
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
3335
|
-
return weakMemoize(function (theme) {
|
|
3336
|
-
return getTheme(outerTheme, theme);
|
|
3337
|
-
});
|
|
3338
|
-
});
|
|
3339
|
-
var ThemeProvider = function ThemeProvider(props) {
|
|
3340
|
-
var theme = useContext(ThemeContext);
|
|
3341
|
-
|
|
3342
|
-
if (props.theme !== theme) {
|
|
3343
|
-
theme = createCacheWithTheme(theme)(props.theme);
|
|
3344
|
-
}
|
|
3345
|
-
|
|
3346
|
-
return /*#__PURE__*/createElement(ThemeContext.Provider, {
|
|
3347
|
-
value: theme
|
|
3348
|
-
}, props.children);
|
|
3349
|
-
};
|
|
3350
|
-
function withTheme(Component) {
|
|
3351
|
-
var componentName = Component.displayName || Component.name || 'Component';
|
|
3352
|
-
|
|
3353
|
-
var render = function render(props, ref) {
|
|
3354
|
-
var theme = useContext(ThemeContext);
|
|
3355
|
-
return /*#__PURE__*/createElement(Component, _extends({
|
|
3356
|
-
theme: theme,
|
|
3357
|
-
ref: ref
|
|
3358
|
-
}, props));
|
|
3359
|
-
}; // $FlowFixMe
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
var WithTheme = /*#__PURE__*/forwardRef(render);
|
|
3363
|
-
WithTheme.displayName = "WithTheme(" + componentName + ")";
|
|
3364
|
-
return hoistNonReactStatics$1(WithTheme, Component);
|
|
3365
|
-
}
|
|
3366
|
-
|
|
3367
|
-
var getLastPart = function getLastPart(functionName) {
|
|
3368
|
-
// The match may be something like 'Object.createEmotionProps' or
|
|
3369
|
-
// 'Loader.prototype.render'
|
|
3370
|
-
var parts = functionName.split('.');
|
|
3371
|
-
return parts[parts.length - 1];
|
|
3372
|
-
};
|
|
3373
|
-
|
|
3374
|
-
var getFunctionNameFromStackTraceLine = function getFunctionNameFromStackTraceLine(line) {
|
|
3375
|
-
// V8
|
|
3376
|
-
var match = /^\s+at\s+([A-Za-z0-9$.]+)\s/.exec(line);
|
|
3377
|
-
if (match) return getLastPart(match[1]); // Safari / Firefox
|
|
3378
|
-
|
|
3379
|
-
match = /^([A-Za-z0-9$.]+)@/.exec(line);
|
|
3380
|
-
if (match) return getLastPart(match[1]);
|
|
3381
|
-
return undefined;
|
|
3382
|
-
};
|
|
3383
|
-
|
|
3384
|
-
var internalReactFunctionNames = /* #__PURE__ */new Set(['renderWithHooks', 'processChild', 'finishClassComponent', 'renderToString']); // These identifiers come from error stacks, so they have to be valid JS
|
|
3385
|
-
// identifiers, thus we only need to replace what is a valid character for JS,
|
|
3386
|
-
// but not for CSS.
|
|
3387
|
-
|
|
3388
|
-
var sanitizeIdentifier = function sanitizeIdentifier(identifier) {
|
|
3389
|
-
return identifier.replace(/\$/g, '-');
|
|
3390
|
-
};
|
|
3391
|
-
|
|
3392
|
-
var getLabelFromStackTrace = function getLabelFromStackTrace(stackTrace) {
|
|
3393
|
-
if (!stackTrace) return undefined;
|
|
3394
|
-
var lines = stackTrace.split('\n');
|
|
3395
|
-
|
|
3396
|
-
for (var i = 0; i < lines.length; i++) {
|
|
3397
|
-
var functionName = getFunctionNameFromStackTraceLine(lines[i]); // The first line of V8 stack traces is just "Error"
|
|
3398
|
-
|
|
3399
|
-
if (!functionName) continue; // If we reach one of these, we have gone too far and should quit
|
|
3400
|
-
|
|
3401
|
-
if (internalReactFunctionNames.has(functionName)) break; // The component name is the first function in the stack that starts with an
|
|
3402
|
-
// uppercase letter
|
|
3403
|
-
|
|
3404
|
-
if (/^[A-Z]/.test(functionName)) return sanitizeIdentifier(functionName);
|
|
3405
|
-
}
|
|
3406
|
-
|
|
3407
|
-
return undefined;
|
|
3408
|
-
};
|
|
3409
|
-
|
|
3410
|
-
var isBrowser$1$1 = typeof document !== 'undefined';
|
|
3411
|
-
var useInsertionEffect$1 = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : function useInsertionEffect(create) {
|
|
3412
|
-
create();
|
|
3413
|
-
};
|
|
3414
|
-
function useInsertionEffectMaybe(create) {
|
|
3415
|
-
if (!isBrowser$1$1) {
|
|
3416
|
-
return create();
|
|
3417
|
-
}
|
|
3418
|
-
|
|
3419
|
-
useInsertionEffect$1(create);
|
|
3420
|
-
}
|
|
3421
|
-
|
|
3422
|
-
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
3423
|
-
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
|
|
3424
|
-
var createEmotionProps = function createEmotionProps(type, props) {
|
|
3425
|
-
if (process.env.NODE_ENV !== 'production' && typeof props.css === 'string' && // check if there is a css declaration
|
|
3426
|
-
props.css.indexOf(':') !== -1) {
|
|
3427
|
-
throw new Error("Strings are not allowed as css prop values, please wrap it in a css template literal from '@emotion/react' like this: css`" + props.css + "`");
|
|
3428
|
-
}
|
|
3429
|
-
|
|
3430
|
-
var newProps = {};
|
|
3431
|
-
|
|
3432
|
-
for (var key in props) {
|
|
3433
|
-
if (hasOwnProperty.call(props, key)) {
|
|
3434
|
-
newProps[key] = props[key];
|
|
3435
|
-
}
|
|
3436
|
-
}
|
|
3437
|
-
|
|
3438
|
-
newProps[typePropName] = type; // For performance, only call getLabelFromStackTrace in development and when
|
|
3439
|
-
// the label hasn't already been computed
|
|
3440
|
-
|
|
3441
|
-
if (process.env.NODE_ENV !== 'production' && !!props.css && (typeof props.css !== 'object' || typeof props.css.name !== 'string' || props.css.name.indexOf('-') === -1)) {
|
|
3442
|
-
var label = getLabelFromStackTrace(new Error().stack);
|
|
3443
|
-
if (label) newProps[labelPropName] = label;
|
|
3444
|
-
}
|
|
3445
|
-
|
|
3446
|
-
return newProps;
|
|
3447
|
-
};
|
|
3448
|
-
|
|
3449
|
-
var Insertion$1 = function Insertion(_ref) {
|
|
3450
|
-
var cache = _ref.cache,
|
|
3451
|
-
serialized = _ref.serialized,
|
|
3452
|
-
isStringTag = _ref.isStringTag;
|
|
3453
|
-
registerStyles(cache, serialized, isStringTag);
|
|
3454
|
-
var rules = useInsertionEffectMaybe(function () {
|
|
3455
|
-
return insertStyles(cache, serialized, isStringTag);
|
|
3456
|
-
});
|
|
3457
|
-
|
|
3458
|
-
if (!isBrowser$1 && rules !== undefined) {
|
|
3459
|
-
var _ref2;
|
|
3460
|
-
|
|
3461
|
-
var serializedNames = serialized.name;
|
|
3462
|
-
var next = serialized.next;
|
|
3463
|
-
|
|
3464
|
-
while (next !== undefined) {
|
|
3465
|
-
serializedNames += ' ' + next.name;
|
|
3466
|
-
next = next.next;
|
|
3467
|
-
}
|
|
3468
|
-
|
|
3469
|
-
return /*#__PURE__*/createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
3470
|
-
__html: rules
|
|
3471
|
-
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
3472
|
-
}
|
|
3473
|
-
|
|
3474
|
-
return null;
|
|
3475
|
-
};
|
|
3476
|
-
|
|
3477
|
-
var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
3478
|
-
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
|
|
3479
|
-
// not passing the registered cache to serializeStyles because it would
|
|
3480
|
-
// make certain babel optimisations not possible
|
|
3481
|
-
|
|
3482
|
-
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
|
|
3483
|
-
cssProp = cache.registered[cssProp];
|
|
3484
|
-
}
|
|
3485
|
-
|
|
3486
|
-
var WrappedComponent = props[typePropName];
|
|
3487
|
-
var registeredStyles = [cssProp];
|
|
3488
|
-
var className = '';
|
|
3489
|
-
|
|
3490
|
-
if (typeof props.className === 'string') {
|
|
3491
|
-
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
3492
|
-
} else if (props.className != null) {
|
|
3493
|
-
className = props.className + " ";
|
|
3494
|
-
}
|
|
3495
|
-
|
|
3496
|
-
var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext));
|
|
3497
|
-
|
|
3498
|
-
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
|
|
3499
|
-
var labelFromStack = props[labelPropName];
|
|
3500
|
-
|
|
3501
|
-
if (labelFromStack) {
|
|
3502
|
-
serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
|
|
3503
|
-
}
|
|
3504
|
-
}
|
|
3505
|
-
|
|
3506
|
-
className += cache.key + "-" + serialized.name;
|
|
3507
|
-
var newProps = {};
|
|
3508
|
-
|
|
3509
|
-
for (var key in props) {
|
|
3510
|
-
if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
3511
|
-
newProps[key] = props[key];
|
|
3512
|
-
}
|
|
3513
|
-
}
|
|
3514
|
-
|
|
3515
|
-
newProps.ref = ref;
|
|
3516
|
-
newProps.className = className;
|
|
3517
|
-
return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion$1, {
|
|
3518
|
-
cache: cache,
|
|
3519
|
-
serialized: serialized,
|
|
3520
|
-
isStringTag: typeof WrappedComponent === 'string'
|
|
3521
|
-
}), /*#__PURE__*/createElement(WrappedComponent, newProps));
|
|
3522
|
-
});
|
|
3523
|
-
|
|
3524
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3525
|
-
Emotion.displayName = 'EmotionCssPropInternal';
|
|
3526
|
-
}
|
|
3527
|
-
|
|
3528
|
-
var pkg = {
|
|
3529
|
-
name: "@emotion/react",
|
|
3530
|
-
version: "11.10.0",
|
|
3531
|
-
main: "dist/emotion-react.cjs.js",
|
|
3532
|
-
module: "dist/emotion-react.esm.js",
|
|
3533
|
-
browser: {
|
|
3534
|
-
"./dist/emotion-react.esm.js": "./dist/emotion-react.browser.esm.js"
|
|
3535
|
-
},
|
|
3536
|
-
exports: {
|
|
3537
|
-
".": {
|
|
3538
|
-
module: {
|
|
3539
|
-
worker: "./dist/emotion-react.worker.esm.js",
|
|
3540
|
-
browser: "./dist/emotion-react.browser.esm.js",
|
|
3541
|
-
"default": "./dist/emotion-react.esm.js"
|
|
3542
|
-
},
|
|
3543
|
-
"default": "./dist/emotion-react.cjs.js"
|
|
3544
|
-
},
|
|
3545
|
-
"./jsx-runtime": {
|
|
3546
|
-
module: {
|
|
3547
|
-
worker: "./jsx-runtime/dist/emotion-react-jsx-runtime.worker.esm.js",
|
|
3548
|
-
browser: "./jsx-runtime/dist/emotion-react-jsx-runtime.browser.esm.js",
|
|
3549
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.esm.js"
|
|
3550
|
-
},
|
|
3551
|
-
"default": "./jsx-runtime/dist/emotion-react-jsx-runtime.cjs.js"
|
|
3552
|
-
},
|
|
3553
|
-
"./_isolated-hnrs": {
|
|
3554
|
-
module: {
|
|
3555
|
-
worker: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.worker.esm.js",
|
|
3556
|
-
browser: "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.browser.esm.js",
|
|
3557
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js"
|
|
3558
|
-
},
|
|
3559
|
-
"default": "./_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js"
|
|
3560
|
-
},
|
|
3561
|
-
"./jsx-dev-runtime": {
|
|
3562
|
-
module: {
|
|
3563
|
-
worker: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.worker.esm.js",
|
|
3564
|
-
browser: "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.browser.esm.js",
|
|
3565
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.esm.js"
|
|
3566
|
-
},
|
|
3567
|
-
"default": "./jsx-dev-runtime/dist/emotion-react-jsx-dev-runtime.cjs.js"
|
|
3568
|
-
},
|
|
3569
|
-
"./package.json": "./package.json",
|
|
3570
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
3571
|
-
"./macro": "./macro.js"
|
|
3572
|
-
},
|
|
3573
|
-
types: "types/index.d.ts",
|
|
3574
|
-
files: [
|
|
3575
|
-
"src",
|
|
3576
|
-
"dist",
|
|
3577
|
-
"jsx-runtime",
|
|
3578
|
-
"jsx-dev-runtime",
|
|
3579
|
-
"_isolated-hnrs",
|
|
3580
|
-
"types/*.d.ts",
|
|
3581
|
-
"macro.js",
|
|
3582
|
-
"macro.d.ts",
|
|
3583
|
-
"macro.js.flow"
|
|
3584
|
-
],
|
|
3585
|
-
sideEffects: false,
|
|
3586
|
-
author: "Emotion Contributors",
|
|
3587
|
-
license: "MIT",
|
|
3588
|
-
scripts: {
|
|
3589
|
-
"test:typescript": "dtslint types"
|
|
3590
|
-
},
|
|
3591
|
-
dependencies: {
|
|
3592
|
-
"@babel/runtime": "^7.18.3",
|
|
3593
|
-
"@emotion/babel-plugin": "^11.10.0",
|
|
3594
|
-
"@emotion/cache": "^11.10.0",
|
|
3595
|
-
"@emotion/serialize": "^1.1.0",
|
|
3596
|
-
"@emotion/utils": "^1.2.0",
|
|
3597
|
-
"@emotion/weak-memoize": "^0.3.0",
|
|
3598
|
-
"hoist-non-react-statics": "^3.3.1"
|
|
3599
|
-
},
|
|
3600
|
-
peerDependencies: {
|
|
3601
|
-
"@babel/core": "^7.0.0",
|
|
3602
|
-
react: ">=16.8.0"
|
|
3603
|
-
},
|
|
3604
|
-
peerDependenciesMeta: {
|
|
3605
|
-
"@babel/core": {
|
|
3606
|
-
optional: true
|
|
3607
|
-
},
|
|
3608
|
-
"@types/react": {
|
|
3609
|
-
optional: true
|
|
3610
|
-
}
|
|
3611
|
-
},
|
|
3612
|
-
devDependencies: {
|
|
3613
|
-
"@babel/core": "^7.18.5",
|
|
3614
|
-
"@definitelytyped/dtslint": "0.0.112",
|
|
3615
|
-
"@emotion/css": "11.10.0",
|
|
3616
|
-
"@emotion/css-prettifier": "1.1.0",
|
|
3617
|
-
"@emotion/server": "11.10.0",
|
|
3618
|
-
"@emotion/styled": "11.10.0",
|
|
3619
|
-
"html-tag-names": "^1.1.2",
|
|
3620
|
-
react: "16.14.0",
|
|
3621
|
-
"svg-tag-names": "^1.1.1",
|
|
3622
|
-
typescript: "^4.5.5"
|
|
3623
|
-
},
|
|
3624
|
-
repository: "https://github.com/emotion-js/emotion/tree/main/packages/react",
|
|
3625
|
-
publishConfig: {
|
|
3626
|
-
access: "public"
|
|
3627
|
-
},
|
|
3628
|
-
"umd:main": "dist/emotion-react.umd.min.js",
|
|
3629
|
-
preconstruct: {
|
|
3630
|
-
entrypoints: [
|
|
3631
|
-
"./index.js",
|
|
3632
|
-
"./jsx-runtime.js",
|
|
3633
|
-
"./jsx-dev-runtime.js",
|
|
3634
|
-
"./_isolated-hnrs.js"
|
|
3635
|
-
],
|
|
3636
|
-
umdName: "emotionReact",
|
|
3637
|
-
exports: {
|
|
3638
|
-
envConditions: [
|
|
3639
|
-
"browser",
|
|
3640
|
-
"worker"
|
|
3641
|
-
],
|
|
3642
|
-
extra: {
|
|
3643
|
-
"./types/css-prop": "./types/css-prop.d.ts",
|
|
3644
|
-
"./macro": "./macro.js"
|
|
3645
|
-
}
|
|
3646
|
-
}
|
|
3647
|
-
}
|
|
3648
|
-
};
|
|
3649
|
-
|
|
3650
|
-
var jsx = function jsx(type, props) {
|
|
3651
|
-
var args = arguments;
|
|
3652
|
-
|
|
3653
|
-
if (props == null || !hasOwnProperty.call(props, 'css')) {
|
|
3654
|
-
// $FlowFixMe
|
|
3655
|
-
return createElement.apply(undefined, args);
|
|
3656
|
-
}
|
|
3657
|
-
|
|
3658
|
-
var argsLength = args.length;
|
|
3659
|
-
var createElementArgArray = new Array(argsLength);
|
|
3660
|
-
createElementArgArray[0] = Emotion;
|
|
3661
|
-
createElementArgArray[1] = createEmotionProps(type, props);
|
|
3662
|
-
|
|
3663
|
-
for (var i = 2; i < argsLength; i++) {
|
|
3664
|
-
createElementArgArray[i] = args[i];
|
|
3665
|
-
} // $FlowFixMe
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
return createElement.apply(null, createElementArgArray);
|
|
3669
|
-
};
|
|
3670
|
-
|
|
3671
|
-
var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : useLayoutEffect;
|
|
3672
|
-
var warnedAboutCssPropForGlobal = false; // maintain place over rerenders.
|
|
3673
|
-
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
|
|
3674
|
-
// initial client-side render from SSR, use place of hydrating tag
|
|
3675
|
-
|
|
3676
|
-
var Global = /* #__PURE__ */withEmotionCache(function (props, cache) {
|
|
3677
|
-
if (process.env.NODE_ENV !== 'production' && !warnedAboutCssPropForGlobal && ( // check for className as well since the user is
|
|
3678
|
-
// probably using the custom createElement which
|
|
3679
|
-
// means it will be turned into a className prop
|
|
3680
|
-
// $FlowFixMe I don't really want to add it to the type since it shouldn't be used
|
|
3681
|
-
props.className || props.css)) {
|
|
3682
|
-
console.error("It looks like you're using the css prop on Global, did you mean to use the styles prop instead?");
|
|
3683
|
-
warnedAboutCssPropForGlobal = true;
|
|
3684
|
-
}
|
|
3685
|
-
|
|
3686
|
-
var styles = props.styles;
|
|
3687
|
-
var serialized = serializeStyles([styles], undefined, useContext(ThemeContext));
|
|
3688
|
-
|
|
3689
|
-
if (!isBrowser$1) {
|
|
3690
|
-
var _ref;
|
|
3691
|
-
|
|
3692
|
-
var serializedNames = serialized.name;
|
|
3693
|
-
var serializedStyles = serialized.styles;
|
|
3694
|
-
var next = serialized.next;
|
|
3695
|
-
|
|
3696
|
-
while (next !== undefined) {
|
|
3697
|
-
serializedNames += ' ' + next.name;
|
|
3698
|
-
serializedStyles += next.styles;
|
|
3699
|
-
next = next.next;
|
|
3700
|
-
}
|
|
3701
|
-
|
|
3702
|
-
var shouldCache = cache.compat === true;
|
|
3703
|
-
var rules = cache.insert("", {
|
|
3704
|
-
name: serializedNames,
|
|
3705
|
-
styles: serializedStyles
|
|
3706
|
-
}, cache.sheet, shouldCache);
|
|
3707
|
-
|
|
3708
|
-
if (shouldCache) {
|
|
3709
|
-
return null;
|
|
3710
|
-
}
|
|
3711
|
-
|
|
3712
|
-
return /*#__PURE__*/createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
|
|
3713
|
-
__html: rules
|
|
3714
|
-
}, _ref.nonce = cache.sheet.nonce, _ref));
|
|
3715
|
-
} // yes, i know these hooks are used conditionally
|
|
3716
|
-
// but it is based on a constant that will never change at runtime
|
|
3717
|
-
// it's effectively like having two implementations and switching them out
|
|
3718
|
-
// so it's not actually breaking anything
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
var sheetRef = useRef();
|
|
3722
|
-
useInsertionEffect(function () {
|
|
3723
|
-
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
|
|
3724
|
-
|
|
3725
|
-
var sheet = new cache.sheet.constructor({
|
|
3726
|
-
key: key,
|
|
3727
|
-
nonce: cache.sheet.nonce,
|
|
3728
|
-
container: cache.sheet.container,
|
|
3729
|
-
speedy: cache.sheet.isSpeedy
|
|
3730
|
-
});
|
|
3731
|
-
var rehydrating = false; // $FlowFixMe
|
|
3732
|
-
|
|
3733
|
-
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
|
|
3734
|
-
|
|
3735
|
-
if (cache.sheet.tags.length) {
|
|
3736
|
-
sheet.before = cache.sheet.tags[0];
|
|
3737
|
-
}
|
|
3738
|
-
|
|
3739
|
-
if (node !== null) {
|
|
3740
|
-
rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
|
|
3741
|
-
|
|
3742
|
-
node.setAttribute('data-emotion', key);
|
|
3743
|
-
sheet.hydrate([node]);
|
|
3744
|
-
}
|
|
3745
|
-
|
|
3746
|
-
sheetRef.current = [sheet, rehydrating];
|
|
3747
|
-
return function () {
|
|
3748
|
-
sheet.flush();
|
|
3749
|
-
};
|
|
3750
|
-
}, [cache]);
|
|
3751
|
-
useInsertionEffect(function () {
|
|
3752
|
-
var sheetRefCurrent = sheetRef.current;
|
|
3753
|
-
var sheet = sheetRefCurrent[0],
|
|
3754
|
-
rehydrating = sheetRefCurrent[1];
|
|
3755
|
-
|
|
3756
|
-
if (rehydrating) {
|
|
3757
|
-
sheetRefCurrent[1] = false;
|
|
3758
|
-
return;
|
|
3759
|
-
}
|
|
3760
|
-
|
|
3761
|
-
if (serialized.next !== undefined) {
|
|
3762
|
-
// insert keyframes
|
|
3763
|
-
insertStyles(cache, serialized.next, true);
|
|
3764
|
-
}
|
|
3765
|
-
|
|
3766
|
-
if (sheet.tags.length) {
|
|
3767
|
-
// if this doesn't exist then it will be null so the style element will be appended
|
|
3768
|
-
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
|
|
3769
|
-
sheet.before = element;
|
|
3770
|
-
sheet.flush();
|
|
3771
|
-
}
|
|
3772
|
-
|
|
3773
|
-
cache.insert("", serialized, sheet, false);
|
|
3774
|
-
}, [cache, serialized.name]);
|
|
3775
|
-
return null;
|
|
3776
|
-
});
|
|
3777
|
-
|
|
3778
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
3779
|
-
Global.displayName = 'EmotionGlobal';
|
|
3780
|
-
}
|
|
3781
|
-
|
|
3782
|
-
function css() {
|
|
3783
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3784
|
-
args[_key] = arguments[_key];
|
|
3785
|
-
}
|
|
3786
|
-
|
|
3787
|
-
return serializeStyles(args);
|
|
3788
|
-
}
|
|
3789
|
-
|
|
3790
|
-
var keyframes = function keyframes() {
|
|
3791
|
-
var insertable = css.apply(void 0, arguments);
|
|
3792
|
-
var name = "animation-" + insertable.name; // $FlowFixMe
|
|
3793
|
-
|
|
3794
|
-
return {
|
|
3795
|
-
name: name,
|
|
3796
|
-
styles: "@keyframes " + name + "{" + insertable.styles + "}",
|
|
3797
|
-
anim: 1,
|
|
3798
|
-
toString: function toString() {
|
|
3799
|
-
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
|
|
3800
|
-
}
|
|
3801
|
-
};
|
|
3802
|
-
};
|
|
3803
|
-
|
|
3804
|
-
var classnames = function classnames(args) {
|
|
3805
|
-
var len = args.length;
|
|
3806
|
-
var i = 0;
|
|
3807
|
-
var cls = '';
|
|
3808
|
-
|
|
3809
|
-
for (; i < len; i++) {
|
|
3810
|
-
var arg = args[i];
|
|
3811
|
-
if (arg == null) continue;
|
|
3812
|
-
var toAdd = void 0;
|
|
3813
|
-
|
|
3814
|
-
switch (typeof arg) {
|
|
3815
|
-
case 'boolean':
|
|
3816
|
-
break;
|
|
3817
|
-
|
|
3818
|
-
case 'object':
|
|
3819
|
-
{
|
|
3820
|
-
if (Array.isArray(arg)) {
|
|
3821
|
-
toAdd = classnames(arg);
|
|
3822
|
-
} else {
|
|
3823
|
-
if (process.env.NODE_ENV !== 'production' && arg.styles !== undefined && arg.name !== undefined) {
|
|
3824
|
-
console.error('You have passed styles created with `css` from `@emotion/react` package to the `cx`.\n' + '`cx` is meant to compose class names (strings) so you should convert those styles to a class name by passing them to the `css` received from <ClassNames/> component.');
|
|
3825
|
-
}
|
|
3826
|
-
|
|
3827
|
-
toAdd = '';
|
|
3828
|
-
|
|
3829
|
-
for (var k in arg) {
|
|
3830
|
-
if (arg[k] && k) {
|
|
3831
|
-
toAdd && (toAdd += ' ');
|
|
3832
|
-
toAdd += k;
|
|
3833
|
-
}
|
|
3834
|
-
}
|
|
3835
|
-
}
|
|
3836
|
-
|
|
3837
|
-
break;
|
|
3838
|
-
}
|
|
2566
|
+
}
|
|
3839
2567
|
|
|
3840
|
-
|
|
3841
|
-
{
|
|
3842
|
-
toAdd = arg;
|
|
3843
|
-
}
|
|
3844
|
-
}
|
|
2568
|
+
var ThemeContext = /* #__PURE__ */createContext({});
|
|
3845
2569
|
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
}
|
|
3850
|
-
}
|
|
2570
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2571
|
+
ThemeContext.displayName = 'EmotionThemeContext';
|
|
2572
|
+
}
|
|
3851
2573
|
|
|
3852
|
-
|
|
2574
|
+
var isBrowser$1 = typeof document !== 'undefined';
|
|
2575
|
+
var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : function useInsertionEffect(create) {
|
|
2576
|
+
create();
|
|
3853
2577
|
};
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
3858
|
-
|
|
3859
|
-
if (registeredStyles.length < 2) {
|
|
3860
|
-
return className;
|
|
2578
|
+
function useInsertionEffectMaybe(create) {
|
|
2579
|
+
if (!isBrowser$1) {
|
|
2580
|
+
return create();
|
|
3861
2581
|
}
|
|
3862
2582
|
|
|
3863
|
-
|
|
2583
|
+
useInsertionEffect(create);
|
|
3864
2584
|
}
|
|
3865
2585
|
|
|
2586
|
+
var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
|
|
2587
|
+
var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
|
|
2588
|
+
|
|
3866
2589
|
var Insertion = function Insertion(_ref) {
|
|
3867
2590
|
var cache = _ref.cache,
|
|
3868
|
-
|
|
2591
|
+
serialized = _ref.serialized,
|
|
2592
|
+
isStringTag = _ref.isStringTag;
|
|
2593
|
+
registerStyles(cache, serialized, isStringTag);
|
|
3869
2594
|
var rules = useInsertionEffectMaybe(function () {
|
|
3870
|
-
|
|
2595
|
+
return insertStyles(cache, serialized, isStringTag);
|
|
2596
|
+
});
|
|
3871
2597
|
|
|
3872
|
-
|
|
3873
|
-
|
|
2598
|
+
if (!isBrowser && rules !== undefined) {
|
|
2599
|
+
var _ref2;
|
|
3874
2600
|
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
}
|
|
3878
|
-
}
|
|
2601
|
+
var serializedNames = serialized.name;
|
|
2602
|
+
var next = serialized.next;
|
|
3879
2603
|
|
|
3880
|
-
|
|
3881
|
-
|
|
2604
|
+
while (next !== undefined) {
|
|
2605
|
+
serializedNames += ' ' + next.name;
|
|
2606
|
+
next = next.next;
|
|
3882
2607
|
}
|
|
3883
|
-
});
|
|
3884
|
-
|
|
3885
|
-
if (!isBrowser$1 && rules.length !== 0) {
|
|
3886
|
-
var _ref2;
|
|
3887
2608
|
|
|
3888
|
-
return /*#__PURE__*/createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " +
|
|
3889
|
-
return serialized.name;
|
|
3890
|
-
}).join(' '), _ref2.dangerouslySetInnerHTML = {
|
|
2609
|
+
return /*#__PURE__*/createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
|
|
3891
2610
|
__html: rules
|
|
3892
2611
|
}, _ref2.nonce = cache.sheet.nonce, _ref2));
|
|
3893
2612
|
}
|
|
@@ -3895,164 +2614,295 @@ var Insertion = function Insertion(_ref) {
|
|
|
3895
2614
|
return null;
|
|
3896
2615
|
};
|
|
3897
2616
|
|
|
3898
|
-
var
|
|
3899
|
-
var
|
|
3900
|
-
|
|
2617
|
+
var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
2618
|
+
var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
|
|
2619
|
+
// not passing the registered cache to serializeStyles because it would
|
|
2620
|
+
// make certain babel optimisations not possible
|
|
3901
2621
|
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
}
|
|
2622
|
+
if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
|
|
2623
|
+
cssProp = cache.registered[cssProp];
|
|
2624
|
+
}
|
|
3906
2625
|
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
2626
|
+
var WrappedComponent = props[typePropName];
|
|
2627
|
+
var registeredStyles = [cssProp];
|
|
2628
|
+
var className = '';
|
|
3910
2629
|
|
|
3911
|
-
|
|
3912
|
-
|
|
2630
|
+
if (typeof props.className === 'string') {
|
|
2631
|
+
className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
|
|
2632
|
+
} else if (props.className != null) {
|
|
2633
|
+
className = props.className + " ";
|
|
2634
|
+
}
|
|
3913
2635
|
|
|
3914
|
-
|
|
3915
|
-
return cache.key + "-" + serialized.name;
|
|
3916
|
-
};
|
|
2636
|
+
var serialized = serializeStyles(registeredStyles, undefined, useContext(ThemeContext));
|
|
3917
2637
|
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
throw new Error('cx can only be used during render');
|
|
3921
|
-
}
|
|
2638
|
+
if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
|
|
2639
|
+
var labelFromStack = props[labelPropName];
|
|
3922
2640
|
|
|
3923
|
-
|
|
3924
|
-
|
|
2641
|
+
if (labelFromStack) {
|
|
2642
|
+
serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
|
|
3925
2643
|
}
|
|
2644
|
+
}
|
|
3926
2645
|
|
|
3927
|
-
|
|
3928
|
-
};
|
|
2646
|
+
className += cache.key + "-" + serialized.name;
|
|
2647
|
+
var newProps = {};
|
|
3929
2648
|
|
|
3930
|
-
var
|
|
3931
|
-
css
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
}
|
|
3935
|
-
|
|
3936
|
-
|
|
2649
|
+
for (var key in props) {
|
|
2650
|
+
if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
2651
|
+
newProps[key] = props[key];
|
|
2652
|
+
}
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
newProps.ref = ref;
|
|
2656
|
+
newProps.className = className;
|
|
3937
2657
|
return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {
|
|
3938
2658
|
cache: cache,
|
|
3939
|
-
|
|
3940
|
-
|
|
2659
|
+
serialized: serialized,
|
|
2660
|
+
isStringTag: typeof WrappedComponent === 'string'
|
|
2661
|
+
}), /*#__PURE__*/createElement(WrappedComponent, newProps));
|
|
3941
2662
|
});
|
|
3942
2663
|
|
|
3943
2664
|
if (process.env.NODE_ENV !== 'production') {
|
|
3944
|
-
|
|
2665
|
+
Emotion.displayName = 'EmotionCssPropInternal';
|
|
3945
2666
|
}
|
|
3946
2667
|
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
2668
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2669
|
+
let counter = 0;
|
|
2670
|
+
function createMakeStyles(params) {
|
|
2671
|
+
const { useTheme, cache: cacheProvidedAtInception } = params;
|
|
2672
|
+
function useCache() {
|
|
2673
|
+
var _a;
|
|
2674
|
+
const contextualCache = __unsafe_useEmotionCache();
|
|
2675
|
+
const cacheExplicitlyProvidedForTss = useCacheProvidedByProvider();
|
|
2676
|
+
const cacheToBeUsed = (_a = cacheProvidedAtInception !== null && cacheProvidedAtInception !== void 0 ? cacheProvidedAtInception : cacheExplicitlyProvidedForTss) !== null && _a !== void 0 ? _a : contextualCache;
|
|
2677
|
+
if (cacheToBeUsed === null) {
|
|
2678
|
+
throw new Error([
|
|
2679
|
+
"In order to get SSR working with tss-react you need to explicitly provide an Emotion cache.",
|
|
2680
|
+
"MUI users be aware: This is not an error strictly related to tss-react, with or without tss-react,",
|
|
2681
|
+
"MUI needs an Emotion cache to be provided for SSR to work.",
|
|
2682
|
+
"Here is the MUI documentation related to SSR setup: https://mui.com/material-ui/guides/server-rendering/",
|
|
2683
|
+
"TSS provides helper that makes the process of setting up SSR easier: https://docs.tss-react.dev/ssr",
|
|
2684
|
+
].join("\n"));
|
|
2685
|
+
}
|
|
2686
|
+
return cacheToBeUsed;
|
|
3961
2687
|
}
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
2688
|
+
const { useCssAndCx } = createUseCssAndCx({ useCache });
|
|
2689
|
+
/** returns useStyle. */
|
|
2690
|
+
function makeStyles(params) {
|
|
2691
|
+
const { name: nameOrWrappedName, uniqId = counter++ } = params !== null && params !== void 0 ? params : {};
|
|
2692
|
+
const name = typeof nameOrWrappedName !== "object"
|
|
2693
|
+
? nameOrWrappedName
|
|
2694
|
+
: Object.keys(nameOrWrappedName)[0];
|
|
2695
|
+
return function (cssObjectByRuleNameOrGetCssObjectByRuleName) {
|
|
2696
|
+
const getCssObjectByRuleName = typeof cssObjectByRuleNameOrGetCssObjectByRuleName ===
|
|
2697
|
+
"function"
|
|
2698
|
+
? cssObjectByRuleNameOrGetCssObjectByRuleName
|
|
2699
|
+
: () => cssObjectByRuleNameOrGetCssObjectByRuleName;
|
|
2700
|
+
return function useStyles(params, styleOverrides) {
|
|
2701
|
+
var _a, _b;
|
|
2702
|
+
const theme = useTheme();
|
|
2703
|
+
const { css, cx } = useCssAndCx();
|
|
2704
|
+
const cache = useCache();
|
|
2705
|
+
let classes = useMemo$1(() => {
|
|
2706
|
+
const refClassesCache = {};
|
|
2707
|
+
const refClasses = typeof Proxy !== "undefined" &&
|
|
2708
|
+
new Proxy({}, {
|
|
2709
|
+
"get": (_target, propertyKey) => {
|
|
2710
|
+
if (typeof propertyKey === "symbol") {
|
|
2711
|
+
assert(false);
|
|
2712
|
+
}
|
|
2713
|
+
return (refClassesCache[propertyKey] = `${cache.key}-${uniqId}${name !== undefined ? `-${name}` : ""}-${propertyKey}-ref`);
|
|
2714
|
+
},
|
|
2715
|
+
});
|
|
2716
|
+
const cssObjectByRuleName = getCssObjectByRuleName(theme, params, refClasses || {});
|
|
2717
|
+
const classes = objectFromEntries(objectKeys(cssObjectByRuleName).map(ruleName => {
|
|
2718
|
+
const cssObject = cssObjectByRuleName[ruleName];
|
|
2719
|
+
if (!cssObject.label) {
|
|
2720
|
+
cssObject.label = `${name !== undefined ? `${name}-` : ""}${ruleName}`;
|
|
2721
|
+
}
|
|
2722
|
+
return [
|
|
2723
|
+
ruleName,
|
|
2724
|
+
`${css(cssObject)}${typeGuard(ruleName, ruleName in refClassesCache)
|
|
2725
|
+
? ` ${refClassesCache[ruleName]}`
|
|
2726
|
+
: ""}`,
|
|
2727
|
+
];
|
|
2728
|
+
}));
|
|
2729
|
+
objectKeys(refClassesCache).forEach(ruleName => {
|
|
2730
|
+
if (ruleName in classes) {
|
|
2731
|
+
return;
|
|
2732
|
+
}
|
|
2733
|
+
classes[ruleName] =
|
|
2734
|
+
refClassesCache[ruleName];
|
|
2735
|
+
});
|
|
2736
|
+
return classes;
|
|
2737
|
+
}, [cache, css, cx, theme, getDependencyArrayRef(params)]);
|
|
2738
|
+
const propsClasses = styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props.classes;
|
|
2739
|
+
classes = useMemo$1(() => mergeClasses(classes, propsClasses, cx), [classes, getDependencyArrayRef(propsClasses), cx]);
|
|
2740
|
+
{
|
|
2741
|
+
let cssObjectByRuleNameOrGetCssObjectByRuleName = undefined;
|
|
2742
|
+
try {
|
|
2743
|
+
cssObjectByRuleNameOrGetCssObjectByRuleName =
|
|
2744
|
+
name !== undefined
|
|
2745
|
+
? (_b = (_a = theme.components) === null || _a === void 0 ? void 0 : _a[name]) === null || _b === void 0 ? void 0 : _b.styleOverrides
|
|
2746
|
+
: undefined;
|
|
2747
|
+
// eslint-disable-next-line no-empty
|
|
2748
|
+
}
|
|
2749
|
+
catch (_c) { }
|
|
2750
|
+
const themeClasses = useMemo$1(() => {
|
|
2751
|
+
if (!cssObjectByRuleNameOrGetCssObjectByRuleName) {
|
|
2752
|
+
return undefined;
|
|
2753
|
+
}
|
|
2754
|
+
const themeClasses = {};
|
|
2755
|
+
for (const ruleName in cssObjectByRuleNameOrGetCssObjectByRuleName) {
|
|
2756
|
+
const cssObjectOrGetCssObject = cssObjectByRuleNameOrGetCssObjectByRuleName[ruleName];
|
|
2757
|
+
if (!(cssObjectOrGetCssObject instanceof Object)) {
|
|
2758
|
+
continue;
|
|
2759
|
+
}
|
|
2760
|
+
themeClasses[ruleName] = css(typeof cssObjectOrGetCssObject === "function"
|
|
2761
|
+
? cssObjectOrGetCssObject(Object.assign({ theme, "ownerState": styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.ownerState }, styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props))
|
|
2762
|
+
: cssObjectOrGetCssObject);
|
|
2763
|
+
}
|
|
2764
|
+
return themeClasses;
|
|
2765
|
+
}, [
|
|
2766
|
+
cssObjectByRuleNameOrGetCssObjectByRuleName ===
|
|
2767
|
+
undefined
|
|
2768
|
+
? undefined
|
|
2769
|
+
: JSON.stringify(cssObjectByRuleNameOrGetCssObjectByRuleName),
|
|
2770
|
+
getDependencyArrayRef(styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.props),
|
|
2771
|
+
getDependencyArrayRef(styleOverrides === null || styleOverrides === void 0 ? void 0 : styleOverrides.ownerState),
|
|
2772
|
+
css,
|
|
2773
|
+
]);
|
|
2774
|
+
classes = useMemo$1(() => mergeClasses(classes, themeClasses, cx), [classes, themeClasses, cx]);
|
|
2775
|
+
}
|
|
2776
|
+
return {
|
|
2777
|
+
classes,
|
|
2778
|
+
theme,
|
|
2779
|
+
css,
|
|
2780
|
+
cx,
|
|
2781
|
+
};
|
|
2782
|
+
};
|
|
2783
|
+
};
|
|
2784
|
+
}
|
|
2785
|
+
function useStyles() {
|
|
2786
|
+
const theme = useTheme();
|
|
2787
|
+
const { css, cx } = useCssAndCx();
|
|
2788
|
+
return { theme, css, cx };
|
|
2789
|
+
}
|
|
2790
|
+
return { makeStyles, useStyles };
|
|
2791
|
+
}
|
|
2792
|
+
const reactContext = createContext(undefined);
|
|
2793
|
+
function useCacheProvidedByProvider() {
|
|
2794
|
+
const cacheExplicitlyProvidedForTss = useContext(reactContext);
|
|
2795
|
+
return cacheExplicitlyProvidedForTss;
|
|
3965
2796
|
}
|
|
3966
2797
|
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
css: css,
|
|
3973
|
-
jsx: jsx,
|
|
3974
|
-
keyframes: keyframes,
|
|
3975
|
-
CacheProvider: CacheProvider,
|
|
3976
|
-
ThemeContext: ThemeContext,
|
|
3977
|
-
ThemeProvider: ThemeProvider,
|
|
3978
|
-
__unsafe_useEmotionCache: __unsafe_useEmotionCache,
|
|
3979
|
-
useTheme: useTheme,
|
|
3980
|
-
get withEmotionCache () { return withEmotionCache; },
|
|
3981
|
-
withTheme: withTheme
|
|
3982
|
-
});
|
|
2798
|
+
/** @see <https://docs.tsafe.dev/capitalize> */
|
|
2799
|
+
function capitalize(str) {
|
|
2800
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2801
|
+
return (str.charAt(0).toUpperCase() + str.slice(1));
|
|
2802
|
+
}
|
|
3983
2803
|
|
|
3984
|
-
var
|
|
3985
|
-
|
|
3986
|
-
var
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
Object.defineProperty(o, k2, desc);
|
|
3995
|
-
}) : (function(o, m, k, k2) {
|
|
3996
|
-
if (k2 === undefined) k2 = k;
|
|
3997
|
-
o[k2] = m[k];
|
|
3998
|
-
}));
|
|
3999
|
-
var __setModuleDefault = (commonjsGlobal && commonjsGlobal.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
4000
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
4001
|
-
}) : function(o, v) {
|
|
4002
|
-
o["default"] = v;
|
|
4003
|
-
});
|
|
4004
|
-
var __importStar = (commonjsGlobal && commonjsGlobal.__importStar) || function (mod) {
|
|
4005
|
-
if (mod && mod.__esModule) return mod;
|
|
4006
|
-
var result = {};
|
|
4007
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
4008
|
-
__setModuleDefault(result, mod);
|
|
4009
|
-
return result;
|
|
4010
|
-
};
|
|
4011
|
-
var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || function (mod) {
|
|
4012
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
2804
|
+
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
2805
|
+
var t = {};
|
|
2806
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
2807
|
+
t[p] = s[p];
|
|
2808
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
2809
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2810
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
2811
|
+
t[p[i]] = s[p[i]];
|
|
2812
|
+
}
|
|
2813
|
+
return t;
|
|
4013
2814
|
};
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
const
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
2815
|
+
function createWithStyles(params) {
|
|
2816
|
+
const { useTheme, cache } = params;
|
|
2817
|
+
const { makeStyles } = createMakeStyles({ useTheme, cache });
|
|
2818
|
+
function withStyles(Component, cssObjectByRuleNameOrGetCssObjectByRuleName, params) {
|
|
2819
|
+
const Component_ = typeof Component === "string"
|
|
2820
|
+
? (() => {
|
|
2821
|
+
const tag = Component;
|
|
2822
|
+
const Out = function (_a) {
|
|
2823
|
+
var { children } = _a, props = __rest(_a, ["children"]);
|
|
2824
|
+
return createElement(tag, props, children);
|
|
2825
|
+
};
|
|
2826
|
+
Object.defineProperty(Out, "name", {
|
|
2827
|
+
"value": capitalize(tag),
|
|
2828
|
+
});
|
|
2829
|
+
return Out;
|
|
2830
|
+
})()
|
|
2831
|
+
: Component;
|
|
2832
|
+
/**
|
|
2833
|
+
* Get component name for wrapping
|
|
2834
|
+
* @see https://reactjs.org/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging
|
|
2835
|
+
*/
|
|
2836
|
+
const name = (() => {
|
|
2837
|
+
{
|
|
2838
|
+
const displayName = Component_.displayName;
|
|
2839
|
+
if (displayName) {
|
|
2840
|
+
return displayName;
|
|
2841
|
+
}
|
|
2842
|
+
}
|
|
2843
|
+
{
|
|
2844
|
+
const { name } = Component_;
|
|
2845
|
+
if (name) {
|
|
2846
|
+
return name;
|
|
2847
|
+
}
|
|
2848
|
+
}
|
|
2849
|
+
return params === null || params === void 0 ? void 0 : params.name;
|
|
2850
|
+
})();
|
|
2851
|
+
const useStyles = makeStyles(Object.assign(Object.assign({}, params), { name }))(typeof cssObjectByRuleNameOrGetCssObjectByRuleName === "function"
|
|
2852
|
+
? (theme, props, classes) => incorporateMediaQueries(cssObjectByRuleNameOrGetCssObjectByRuleName(theme, props, classes))
|
|
2853
|
+
: incorporateMediaQueries(cssObjectByRuleNameOrGetCssObjectByRuleName));
|
|
2854
|
+
function getHasNonRootClasses(classes) {
|
|
2855
|
+
for (const name in classes) {
|
|
2856
|
+
if (name === "root") {
|
|
2857
|
+
continue;
|
|
2858
|
+
}
|
|
2859
|
+
return true;
|
|
2860
|
+
}
|
|
2861
|
+
return false;
|
|
2862
|
+
}
|
|
2863
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2864
|
+
const Out = forwardRef(function (props, ref) {
|
|
2865
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2866
|
+
const { className, classes: _classes } = props, rest = __rest(props, ["className", "classes"]);
|
|
2867
|
+
const { classes, cx } = useStyles(props, { props });
|
|
2868
|
+
return (React__default.createElement(Component_, Object.assign({ ref: ref, className: getHasNonRootClasses(classes)
|
|
2869
|
+
? className
|
|
2870
|
+
: cx(classes.root, className) }, (typeof Component === "string" ? {} : { classes }), rest)));
|
|
2871
|
+
});
|
|
2872
|
+
if (name !== undefined) {
|
|
2873
|
+
Out.displayName = `${capitalize(name)}WithStyles`;
|
|
2874
|
+
Object.defineProperty(Out, "name", { "value": Out.displayName });
|
|
2875
|
+
}
|
|
2876
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2877
|
+
return Out;
|
|
2878
|
+
}
|
|
2879
|
+
return { withStyles };
|
|
2880
|
+
}
|
|
2881
|
+
function incorporateMediaQueries(cssObjectByRuleNameWithMediaQueries) {
|
|
2882
|
+
const cssObjectByRuleName = {};
|
|
2883
|
+
const cssObjectByRuleNameWithMediaQueriesByMediaQuery = {};
|
|
2884
|
+
Object.keys(cssObjectByRuleNameWithMediaQueries).forEach(ruleNameOrMediaQuery => ((ruleNameOrMediaQuery.startsWith("@media")
|
|
2885
|
+
? cssObjectByRuleNameWithMediaQueriesByMediaQuery
|
|
2886
|
+
: cssObjectByRuleName)[ruleNameOrMediaQuery] =
|
|
2887
|
+
cssObjectByRuleNameWithMediaQueries[ruleNameOrMediaQuery]));
|
|
2888
|
+
Object.keys(cssObjectByRuleNameWithMediaQueriesByMediaQuery).forEach(mediaQuery => {
|
|
2889
|
+
const cssObjectByRuleNameBis = cssObjectByRuleNameWithMediaQueriesByMediaQuery[mediaQuery];
|
|
2890
|
+
Object.keys(cssObjectByRuleNameBis).forEach(ruleName => {
|
|
2891
|
+
var _a;
|
|
2892
|
+
return (cssObjectByRuleName[ruleName] = Object.assign(Object.assign({}, ((_a = cssObjectByRuleName[ruleName]) !== null && _a !== void 0 ? _a : {})), { [mediaQuery]: cssObjectByRuleNameBis[ruleName] }));
|
|
2893
|
+
});
|
|
2894
|
+
});
|
|
2895
|
+
return cssObjectByRuleName;
|
|
4021
2896
|
}
|
|
4022
|
-
GlobalStyles$1.GlobalStyles = GlobalStyles;
|
|
4023
2897
|
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
var cssAndCx_1 = cssAndCx;
|
|
4029
|
-
Object.defineProperty(exports, "useCssAndCx", { enumerable: true, get: function () { return cssAndCx_1.useCssAndCx; } });
|
|
4030
|
-
var mergeClasses_1 = mergeClasses$1;
|
|
4031
|
-
Object.defineProperty(exports, "useMergedClasses", { enumerable: true, get: function () { return mergeClasses_1.useMergedClasses; } });
|
|
4032
|
-
const makeStyles_1 = makeStyles$1;
|
|
4033
|
-
Object.defineProperty(exports, "createMakeStyles", { enumerable: true, get: function () { return makeStyles_1.createMakeStyles; } });
|
|
4034
|
-
const withStyles_1 = withStyles$1;
|
|
4035
|
-
Object.defineProperty(exports, "createWithStyles", { enumerable: true, get: function () { return withStyles_1.createWithStyles; } });
|
|
4036
|
-
/** @see <https://docs.tss-react.dev/api-references/keyframes> */
|
|
4037
|
-
var react_1 = require$$4;
|
|
4038
|
-
Object.defineProperty(exports, "keyframes", { enumerable: true, get: function () { return react_1.keyframes; } });
|
|
4039
|
-
/** @see <https://docs.tss-react.dev/api-references/globalstyles> */
|
|
4040
|
-
var GlobalStyles_1 = GlobalStyles$1;
|
|
4041
|
-
Object.defineProperty(exports, "GlobalStyles", { enumerable: true, get: function () { return GlobalStyles_1.GlobalStyles; } });
|
|
4042
|
-
/** @see <https://docs.tss-react.dev/cache> */
|
|
4043
|
-
var cache_1 = cache;
|
|
4044
|
-
Object.defineProperty(exports, "getTssDefaultEmotionCache", { enumerable: true, get: function () { return cache_1.getTssDefaultEmotionCache; } });
|
|
4045
|
-
Object.defineProperty(exports, "TssCacheProvider", { enumerable: true, get: function () { return cache_1.TssCacheProvider; } });
|
|
4046
|
-
/** @see <https://docs.tss-react.dev/api-references/makestyles-usestyles> */
|
|
4047
|
-
function createMakeAndWithStyles(params) {
|
|
4048
|
-
return Object.assign(Object.assign({}, (0, makeStyles_1.createMakeStyles)(params)), (0, withStyles_1.createWithStyles)(params));
|
|
4049
|
-
}
|
|
4050
|
-
exports.createMakeAndWithStyles = createMakeAndWithStyles;
|
|
4051
|
-
} (tssReact));
|
|
2898
|
+
/** @see <https://docs.tss-react.dev/api/makestyles> */
|
|
2899
|
+
function createMakeAndWithStyles(params) {
|
|
2900
|
+
return Object.assign(Object.assign({}, createMakeStyles(params)), createWithStyles(params));
|
|
2901
|
+
}
|
|
4052
2902
|
|
|
4053
2903
|
var _a;
|
|
4054
|
-
var makeStyles = (_a =
|
|
4055
|
-
useTheme: useTheme
|
|
2904
|
+
var makeStyles = (_a = createMakeAndWithStyles({
|
|
2905
|
+
useTheme: useTheme,
|
|
4056
2906
|
/*
|
|
4057
2907
|
OR, if you have extended the default mui theme adding your own custom properties:
|
|
4058
2908
|
Let's assume the myTheme object that you provide to the <ThemeProvider /> is of
|
|
@@ -4467,7 +3317,7 @@ var Footer = function (_a) {
|
|
|
4467
3317
|
var renderItem = function (text) { return (React__default.createElement(ListItemText, { className: classes.itemText, primary: text, primaryTypographyProps: {
|
|
4468
3318
|
style: { fontSize: 14, fontFamily: 'Montserrat', fontWeight: 400 },
|
|
4469
3319
|
} })); };
|
|
4470
|
-
return (React__default.createElement(Box, { className: classes.footer },
|
|
3320
|
+
return (React__default.createElement(Box, { className: classes.footer, role: "contentinfo" },
|
|
4471
3321
|
React__default.createElement(Box, { className: classes.content },
|
|
4472
3322
|
React__default.createElement("a", { href: udirLink },
|
|
4473
3323
|
React__default.createElement("img", { src: udirLogo, alt: "Utdanningsdirektoratet logo", style: { height: '43px', width: '150px' } })),
|
|
@@ -4921,7 +3771,7 @@ var LoadingOverlay = function (_a) {
|
|
|
4921
3771
|
opacity: show ? 1 : 0,
|
|
4922
3772
|
transition: "opacity ".concat(show ? 0 : minTime, "ms ease"),
|
|
4923
3773
|
}, sx: sx }, box),
|
|
4924
|
-
React__default.createElement(CircularProgress,
|
|
3774
|
+
React__default.createElement(CircularProgress, null))));
|
|
4925
3775
|
};
|
|
4926
3776
|
|
|
4927
3777
|
var useStyles$b = makeStyles()({
|
|
@@ -4933,13 +3783,14 @@ var useStyles$b = makeStyles()({
|
|
|
4933
3783
|
fontSize: 16,
|
|
4934
3784
|
},
|
|
4935
3785
|
current: {
|
|
4936
|
-
overflow: 'hidden',
|
|
4937
3786
|
textOverflow: 'ellipsis',
|
|
4938
3787
|
whiteSpace: 'nowrap',
|
|
4939
3788
|
fontWeight: 'bold',
|
|
3789
|
+
lineHeight: '16px',
|
|
4940
3790
|
},
|
|
4941
3791
|
link: {
|
|
4942
3792
|
fontSize: 16,
|
|
3793
|
+
margin: 'auto 0',
|
|
4943
3794
|
textDecoration: 'none',
|
|
4944
3795
|
'&:hover': {
|
|
4945
3796
|
textDecoration: 'underline',
|
|
@@ -4969,7 +3820,7 @@ var GrepCrumbs = function (_a) {
|
|
|
4969
3820
|
return (React__default.createElement("div", { className: classes.container, style: style }, breadcrumbs.map(function (crumb, index) {
|
|
4970
3821
|
return crumb.path ? (React__default.createElement(Box, { key: index, display: "flex" },
|
|
4971
3822
|
React__default.createElement(Link, { className: classes.link, tabIndex: 0, component: "button", onClick: function () { return handleClick(crumb); } }, crumb.label),
|
|
4972
|
-
index !== breadcrumbs.length - 1 && React__default.createElement(Box, { margin: "
|
|
3823
|
+
index !== breadcrumbs.length - 1 && (React__default.createElement(Box, { margin: "auto 8px", height: "fit-content" /*lineHeight="20px"*/ }, ">")))) : (React__default.createElement(Tooltip, { key: index, title: showTooltip ? crumb.label : '' },
|
|
4973
3824
|
React__default.createElement("div", { className: classes.current, ref: ref }, crumb.label)));
|
|
4974
3825
|
})));
|
|
4975
3826
|
};
|
|
@@ -5019,7 +3870,7 @@ var SearchBar = function (props) {
|
|
|
5019
3870
|
} },
|
|
5020
3871
|
React.createElement(Box, { className: classes.icon },
|
|
5021
3872
|
React.createElement(Search, null)),
|
|
5022
|
-
React.createElement(TextField, { className: classes.input, value: value, variant: "standard", inputRef: inputRef, onChange: _handleChange, autoFocus: props.autoFocus, placeholder: props.placeholder, InputProps: { disableUnderline: true, fullWidth: true } }),
|
|
3873
|
+
React.createElement(TextField, { role: "search", className: classes.input, value: value, variant: "standard", inputRef: inputRef, onChange: _handleChange, autoFocus: props.autoFocus, placeholder: props.placeholder, InputProps: { disableUnderline: true, fullWidth: true } }),
|
|
5023
3874
|
React.createElement(Box, { className: classes.icon, style: { cursor: 'pointer' } }, !!value.length && (React.createElement(Close, { "data-testid": "searchBarClearBtn", tabIndex: 0, onClick: _handleClear, onKeyPress: keyboard.onActivation(_handleClear) })))),
|
|
5024
3875
|
React.createElement("div", { style: { display: 'flex', alignItems: 'center' } },
|
|
5025
3876
|
props.helpText && (React.createElement(Typography, { className: classes.helptext }, props.helpText)),
|
|
@@ -6133,6 +4984,8 @@ var rafSchd = function rafSchd(fn) {
|
|
|
6133
4984
|
return wrapperFn;
|
|
6134
4985
|
};
|
|
6135
4986
|
|
|
4987
|
+
var rafSchd$1 = rafSchd;
|
|
4988
|
+
|
|
6136
4989
|
var isProduction = process.env.NODE_ENV === 'production';
|
|
6137
4990
|
var spacesAndTabs = /[ \t]{2,}/g;
|
|
6138
4991
|
var lineStartWithSpaces = /^[ \t]*/gm;
|
|
@@ -9461,7 +8314,7 @@ function getScrollListener(_ref) {
|
|
|
9461
8314
|
onWindowScroll(getWindowScroll());
|
|
9462
8315
|
}
|
|
9463
8316
|
|
|
9464
|
-
var scheduled = rafSchd(updateScroll);
|
|
8317
|
+
var scheduled = rafSchd$1(updateScroll);
|
|
9465
8318
|
var binding = getWindowScrollBinding(scheduled);
|
|
9466
8319
|
var unbind = noop;
|
|
9467
8320
|
|
|
@@ -10807,8 +9660,8 @@ var scroll$1 = (function (_ref) {
|
|
|
10807
9660
|
var createFluidScroller = (function (_ref) {
|
|
10808
9661
|
var scrollWindow = _ref.scrollWindow,
|
|
10809
9662
|
scrollDroppable = _ref.scrollDroppable;
|
|
10810
|
-
var scheduleWindowScroll = rafSchd(scrollWindow);
|
|
10811
|
-
var scheduleDroppableScroll = rafSchd(scrollDroppable);
|
|
9663
|
+
var scheduleWindowScroll = rafSchd$1(scrollWindow);
|
|
9664
|
+
var scheduleDroppableScroll = rafSchd$1(scrollDroppable);
|
|
10812
9665
|
var dragging = null;
|
|
10813
9666
|
|
|
10814
9667
|
var tryScroll = function tryScroll(state) {
|
|
@@ -12772,7 +11625,7 @@ function tryStart(_ref3) {
|
|
|
12772
11625
|
}
|
|
12773
11626
|
|
|
12774
11627
|
function fluidLift(clientSelection) {
|
|
12775
|
-
var move$1 = rafSchd(function (client) {
|
|
11628
|
+
var move$1 = rafSchd$1(function (client) {
|
|
12776
11629
|
tryDispatchWhenDragging(function () {
|
|
12777
11630
|
return move({
|
|
12778
11631
|
client: client
|
|
@@ -13406,7 +12259,7 @@ function useDroppablePublisher(args) {
|
|
|
13406
12259
|
memoizedUpdateScroll(scroll.x, scroll.y);
|
|
13407
12260
|
}, [getClosestScroll, memoizedUpdateScroll]);
|
|
13408
12261
|
var scheduleScrollUpdate = useMemo(function () {
|
|
13409
|
-
return rafSchd(updateScroll);
|
|
12262
|
+
return rafSchd$1(updateScroll);
|
|
13410
12263
|
}, [updateScroll]);
|
|
13411
12264
|
var onClosestScroll = useCallback(function () {
|
|
13412
12265
|
var dragging = whileDraggingRef.current;
|
|
@@ -22025,7 +20878,7 @@ var MobileAppBar = function (_a) {
|
|
|
22025
20878
|
setAnchorElMenu(null);
|
|
22026
20879
|
};
|
|
22027
20880
|
return (React.createElement(MobileToolbarMenu, { style: { flexGrow: 1 } },
|
|
22028
|
-
React.createElement(AppBar$1, { position: "static" },
|
|
20881
|
+
React.createElement(AppBar$1, { position: "static", role: "navigation" },
|
|
22029
20882
|
React.createElement(Toolbar$1, { style: { minHeight: '50px' } },
|
|
22030
20883
|
React.createElement(IconButton, { size: "medium", edge: "start", color: "inherit", "aria-label": "menu", style: { marginRight: 2 }, onClick: handleClickNav },
|
|
22031
20884
|
React.createElement(Menu$1, { sx: { color: 'white' } })),
|
|
@@ -22068,7 +20921,7 @@ var AppBar = function (_a) {
|
|
|
22068
20921
|
};
|
|
22069
20922
|
return (React.createElement(Toolbar, null,
|
|
22070
20923
|
React.createElement(ToolbarFixer, null,
|
|
22071
|
-
React.createElement(ToolbarInner, { colors: colors },
|
|
20924
|
+
React.createElement(ToolbarInner, { colors: colors, role: "banner" },
|
|
22072
20925
|
React.createElement(ToolbarLeft, null,
|
|
22073
20926
|
React.createElement(ToolbarTitle, { to: '/' },
|
|
22074
20927
|
appTitle,
|
|
@@ -22094,10 +20947,10 @@ var AppBar = function (_a) {
|
|
|
22094
20947
|
} }, i.isAnchor ? (React.createElement("a", { style: {
|
|
22095
20948
|
textDecoration: 'inherit',
|
|
22096
20949
|
color: 'inherit',
|
|
22097
|
-
}, rel: "noreferrer", href: i.href }, i.label)) : (i.label)),
|
|
20950
|
+
}, rel: "noreferrer", href: i.href, onClick: i.onClick }, i.label)) : (i.label)),
|
|
22098
20951
|
userMenuItems.length > index + 1 && React.createElement(Divider$1, null)));
|
|
22099
20952
|
})))),
|
|
22100
|
-
React.createElement(ToolbarMenu,
|
|
20953
|
+
React.createElement(ToolbarMenu, { role: "navigation" },
|
|
22101
20954
|
React.createElement(ToolbarMenuInner, null, menuItems.map(function (page) { return _renderToolbarMenuItem(page); }))),
|
|
22102
20955
|
React.createElement(MobileAppBar, { menuItems: menuItems, userMenuItems: userMenuItems, colors: colors }))));
|
|
22103
20956
|
};
|