@nodeblocks/frontend-how-to-use-block 0.1.0 → 0.1.1
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/index.cjs.js +1458 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1459 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { createElement, Fragment as Fragment$1 } from 'react';
|
|
4
|
-
import emStyled from '@emotion/styled';
|
|
5
|
-
import '@emotion/react';
|
|
3
|
+
import { forwardRef, useContext, createElement, Fragment as Fragment$1 } from 'react';
|
|
6
4
|
|
|
7
5
|
const defaultGenerator = componentName => componentName;
|
|
8
6
|
const createClassNameGenerator = () => {
|
|
@@ -2689,6 +2687,1235 @@ function unstable_createStyleFunctionSx() {
|
|
|
2689
2687
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
2690
2688
|
styleFunctionSx.filterProps = ['sx'];
|
|
2691
2689
|
|
|
2690
|
+
function _extends() {
|
|
2691
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
2692
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2693
|
+
var t = arguments[e];
|
|
2694
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
2695
|
+
}
|
|
2696
|
+
return n;
|
|
2697
|
+
}, _extends.apply(null, arguments);
|
|
2698
|
+
}
|
|
2699
|
+
|
|
2700
|
+
/*
|
|
2701
|
+
|
|
2702
|
+
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
2703
|
+
|
|
2704
|
+
high performance StyleSheet for css-in-js systems
|
|
2705
|
+
|
|
2706
|
+
- uses multiple style tags behind the scenes for millions of rules
|
|
2707
|
+
- uses `insertRule` for appending in production for *much* faster performance
|
|
2708
|
+
|
|
2709
|
+
// usage
|
|
2710
|
+
|
|
2711
|
+
import { StyleSheet } from '@emotion/sheet'
|
|
2712
|
+
|
|
2713
|
+
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
2714
|
+
|
|
2715
|
+
styleSheet.insert('#box { border: 1px solid red; }')
|
|
2716
|
+
- appends a css rule into the stylesheet
|
|
2717
|
+
|
|
2718
|
+
styleSheet.flush()
|
|
2719
|
+
- empties the stylesheet of all its contents
|
|
2720
|
+
|
|
2721
|
+
*/
|
|
2722
|
+
|
|
2723
|
+
function sheetForTag(tag) {
|
|
2724
|
+
if (tag.sheet) {
|
|
2725
|
+
return tag.sheet;
|
|
2726
|
+
} // this weirdness brought to you by firefox
|
|
2727
|
+
|
|
2728
|
+
/* istanbul ignore next */
|
|
2729
|
+
|
|
2730
|
+
|
|
2731
|
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
2732
|
+
if (document.styleSheets[i].ownerNode === tag) {
|
|
2733
|
+
return document.styleSheets[i];
|
|
2734
|
+
}
|
|
2735
|
+
} // this function should always return with a value
|
|
2736
|
+
// TS can't understand it though so we make it stop complaining here
|
|
2737
|
+
|
|
2738
|
+
|
|
2739
|
+
return undefined;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
function createStyleElement(options) {
|
|
2743
|
+
var tag = document.createElement('style');
|
|
2744
|
+
tag.setAttribute('data-emotion', options.key);
|
|
2745
|
+
|
|
2746
|
+
if (options.nonce !== undefined) {
|
|
2747
|
+
tag.setAttribute('nonce', options.nonce);
|
|
2748
|
+
}
|
|
2749
|
+
|
|
2750
|
+
tag.appendChild(document.createTextNode(''));
|
|
2751
|
+
tag.setAttribute('data-s', '');
|
|
2752
|
+
return tag;
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
var StyleSheet = /*#__PURE__*/function () {
|
|
2756
|
+
// Using Node instead of HTMLElement since container may be a ShadowRoot
|
|
2757
|
+
function StyleSheet(options) {
|
|
2758
|
+
var _this = this;
|
|
2759
|
+
|
|
2760
|
+
this._insertTag = function (tag) {
|
|
2761
|
+
var before;
|
|
2762
|
+
|
|
2763
|
+
if (_this.tags.length === 0) {
|
|
2764
|
+
if (_this.insertionPoint) {
|
|
2765
|
+
before = _this.insertionPoint.nextSibling;
|
|
2766
|
+
} else if (_this.prepend) {
|
|
2767
|
+
before = _this.container.firstChild;
|
|
2768
|
+
} else {
|
|
2769
|
+
before = _this.before;
|
|
2770
|
+
}
|
|
2771
|
+
} else {
|
|
2772
|
+
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
_this.container.insertBefore(tag, before);
|
|
2776
|
+
|
|
2777
|
+
_this.tags.push(tag);
|
|
2778
|
+
};
|
|
2779
|
+
|
|
2780
|
+
this.isSpeedy = options.speedy === undefined ? true : options.speedy;
|
|
2781
|
+
this.tags = [];
|
|
2782
|
+
this.ctr = 0;
|
|
2783
|
+
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
2784
|
+
|
|
2785
|
+
this.key = options.key;
|
|
2786
|
+
this.container = options.container;
|
|
2787
|
+
this.prepend = options.prepend;
|
|
2788
|
+
this.insertionPoint = options.insertionPoint;
|
|
2789
|
+
this.before = null;
|
|
2790
|
+
}
|
|
2791
|
+
|
|
2792
|
+
var _proto = StyleSheet.prototype;
|
|
2793
|
+
|
|
2794
|
+
_proto.hydrate = function hydrate(nodes) {
|
|
2795
|
+
nodes.forEach(this._insertTag);
|
|
2796
|
+
};
|
|
2797
|
+
|
|
2798
|
+
_proto.insert = function insert(rule) {
|
|
2799
|
+
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
2800
|
+
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
2801
|
+
// and you can only have one source map per style tag
|
|
2802
|
+
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
2803
|
+
this._insertTag(createStyleElement(this));
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
var tag = this.tags[this.tags.length - 1];
|
|
2807
|
+
|
|
2808
|
+
if (this.isSpeedy) {
|
|
2809
|
+
var sheet = sheetForTag(tag);
|
|
2810
|
+
|
|
2811
|
+
try {
|
|
2812
|
+
// this is the ultrafast version, works across browsers
|
|
2813
|
+
// the big drawback is that the css won't be editable in devtools
|
|
2814
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
2815
|
+
} catch (e) {
|
|
2816
|
+
}
|
|
2817
|
+
} else {
|
|
2818
|
+
tag.appendChild(document.createTextNode(rule));
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
this.ctr++;
|
|
2822
|
+
};
|
|
2823
|
+
|
|
2824
|
+
_proto.flush = function flush() {
|
|
2825
|
+
this.tags.forEach(function (tag) {
|
|
2826
|
+
var _tag$parentNode;
|
|
2827
|
+
|
|
2828
|
+
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
2829
|
+
});
|
|
2830
|
+
this.tags = [];
|
|
2831
|
+
this.ctr = 0;
|
|
2832
|
+
};
|
|
2833
|
+
|
|
2834
|
+
return StyleSheet;
|
|
2835
|
+
}();
|
|
2836
|
+
|
|
2837
|
+
var MS = '-ms-';
|
|
2838
|
+
var MOZ = '-moz-';
|
|
2839
|
+
var WEBKIT = '-webkit-';
|
|
2840
|
+
|
|
2841
|
+
var COMMENT = 'comm';
|
|
2842
|
+
var RULESET = 'rule';
|
|
2843
|
+
var DECLARATION = 'decl';
|
|
2844
|
+
var IMPORT = '@import';
|
|
2845
|
+
var KEYFRAMES = '@keyframes';
|
|
2846
|
+
var LAYER = '@layer';
|
|
2847
|
+
|
|
2848
|
+
/**
|
|
2849
|
+
* @param {number}
|
|
2850
|
+
* @return {number}
|
|
2851
|
+
*/
|
|
2852
|
+
var abs = Math.abs;
|
|
2853
|
+
|
|
2854
|
+
/**
|
|
2855
|
+
* @param {number}
|
|
2856
|
+
* @return {string}
|
|
2857
|
+
*/
|
|
2858
|
+
var from = String.fromCharCode;
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* @param {object}
|
|
2862
|
+
* @return {object}
|
|
2863
|
+
*/
|
|
2864
|
+
var assign = Object.assign;
|
|
2865
|
+
|
|
2866
|
+
/**
|
|
2867
|
+
* @param {string} value
|
|
2868
|
+
* @param {number} length
|
|
2869
|
+
* @return {number}
|
|
2870
|
+
*/
|
|
2871
|
+
function hash (value, length) {
|
|
2872
|
+
return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
/**
|
|
2876
|
+
* @param {string} value
|
|
2877
|
+
* @return {string}
|
|
2878
|
+
*/
|
|
2879
|
+
function trim (value) {
|
|
2880
|
+
return value.trim()
|
|
2881
|
+
}
|
|
2882
|
+
|
|
2883
|
+
/**
|
|
2884
|
+
* @param {string} value
|
|
2885
|
+
* @param {RegExp} pattern
|
|
2886
|
+
* @return {string?}
|
|
2887
|
+
*/
|
|
2888
|
+
function match (value, pattern) {
|
|
2889
|
+
return (value = pattern.exec(value)) ? value[0] : value
|
|
2890
|
+
}
|
|
2891
|
+
|
|
2892
|
+
/**
|
|
2893
|
+
* @param {string} value
|
|
2894
|
+
* @param {(string|RegExp)} pattern
|
|
2895
|
+
* @param {string} replacement
|
|
2896
|
+
* @return {string}
|
|
2897
|
+
*/
|
|
2898
|
+
function replace (value, pattern, replacement) {
|
|
2899
|
+
return value.replace(pattern, replacement)
|
|
2900
|
+
}
|
|
2901
|
+
|
|
2902
|
+
/**
|
|
2903
|
+
* @param {string} value
|
|
2904
|
+
* @param {string} search
|
|
2905
|
+
* @return {number}
|
|
2906
|
+
*/
|
|
2907
|
+
function indexof (value, search) {
|
|
2908
|
+
return value.indexOf(search)
|
|
2909
|
+
}
|
|
2910
|
+
|
|
2911
|
+
/**
|
|
2912
|
+
* @param {string} value
|
|
2913
|
+
* @param {number} index
|
|
2914
|
+
* @return {number}
|
|
2915
|
+
*/
|
|
2916
|
+
function charat (value, index) {
|
|
2917
|
+
return value.charCodeAt(index) | 0
|
|
2918
|
+
}
|
|
2919
|
+
|
|
2920
|
+
/**
|
|
2921
|
+
* @param {string} value
|
|
2922
|
+
* @param {number} begin
|
|
2923
|
+
* @param {number} end
|
|
2924
|
+
* @return {string}
|
|
2925
|
+
*/
|
|
2926
|
+
function substr (value, begin, end) {
|
|
2927
|
+
return value.slice(begin, end)
|
|
2928
|
+
}
|
|
2929
|
+
|
|
2930
|
+
/**
|
|
2931
|
+
* @param {string} value
|
|
2932
|
+
* @return {number}
|
|
2933
|
+
*/
|
|
2934
|
+
function strlen (value) {
|
|
2935
|
+
return value.length
|
|
2936
|
+
}
|
|
2937
|
+
|
|
2938
|
+
/**
|
|
2939
|
+
* @param {any[]} value
|
|
2940
|
+
* @return {number}
|
|
2941
|
+
*/
|
|
2942
|
+
function sizeof (value) {
|
|
2943
|
+
return value.length
|
|
2944
|
+
}
|
|
2945
|
+
|
|
2946
|
+
/**
|
|
2947
|
+
* @param {any} value
|
|
2948
|
+
* @param {any[]} array
|
|
2949
|
+
* @return {any}
|
|
2950
|
+
*/
|
|
2951
|
+
function append (value, array) {
|
|
2952
|
+
return array.push(value), value
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
/**
|
|
2956
|
+
* @param {string[]} array
|
|
2957
|
+
* @param {function} callback
|
|
2958
|
+
* @return {string}
|
|
2959
|
+
*/
|
|
2960
|
+
function combine (array, callback) {
|
|
2961
|
+
return array.map(callback).join('')
|
|
2962
|
+
}
|
|
2963
|
+
|
|
2964
|
+
var line = 1;
|
|
2965
|
+
var column = 1;
|
|
2966
|
+
var length = 0;
|
|
2967
|
+
var position = 0;
|
|
2968
|
+
var character = 0;
|
|
2969
|
+
var characters = '';
|
|
2970
|
+
|
|
2971
|
+
/**
|
|
2972
|
+
* @param {string} value
|
|
2973
|
+
* @param {object | null} root
|
|
2974
|
+
* @param {object | null} parent
|
|
2975
|
+
* @param {string} type
|
|
2976
|
+
* @param {string[] | string} props
|
|
2977
|
+
* @param {object[] | string} children
|
|
2978
|
+
* @param {number} length
|
|
2979
|
+
*/
|
|
2980
|
+
function node (value, root, parent, type, props, children, length) {
|
|
2981
|
+
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
/**
|
|
2985
|
+
* @param {object} root
|
|
2986
|
+
* @param {object} props
|
|
2987
|
+
* @return {object}
|
|
2988
|
+
*/
|
|
2989
|
+
function copy (root, props) {
|
|
2990
|
+
return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
2991
|
+
}
|
|
2992
|
+
|
|
2993
|
+
/**
|
|
2994
|
+
* @return {number}
|
|
2995
|
+
*/
|
|
2996
|
+
function char () {
|
|
2997
|
+
return character
|
|
2998
|
+
}
|
|
2999
|
+
|
|
3000
|
+
/**
|
|
3001
|
+
* @return {number}
|
|
3002
|
+
*/
|
|
3003
|
+
function prev () {
|
|
3004
|
+
character = position > 0 ? charat(characters, --position) : 0;
|
|
3005
|
+
|
|
3006
|
+
if (column--, character === 10)
|
|
3007
|
+
column = 1, line--;
|
|
3008
|
+
|
|
3009
|
+
return character
|
|
3010
|
+
}
|
|
3011
|
+
|
|
3012
|
+
/**
|
|
3013
|
+
* @return {number}
|
|
3014
|
+
*/
|
|
3015
|
+
function next () {
|
|
3016
|
+
character = position < length ? charat(characters, position++) : 0;
|
|
3017
|
+
|
|
3018
|
+
if (column++, character === 10)
|
|
3019
|
+
column = 1, line++;
|
|
3020
|
+
|
|
3021
|
+
return character
|
|
3022
|
+
}
|
|
3023
|
+
|
|
3024
|
+
/**
|
|
3025
|
+
* @return {number}
|
|
3026
|
+
*/
|
|
3027
|
+
function peek () {
|
|
3028
|
+
return charat(characters, position)
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
/**
|
|
3032
|
+
* @return {number}
|
|
3033
|
+
*/
|
|
3034
|
+
function caret () {
|
|
3035
|
+
return position
|
|
3036
|
+
}
|
|
3037
|
+
|
|
3038
|
+
/**
|
|
3039
|
+
* @param {number} begin
|
|
3040
|
+
* @param {number} end
|
|
3041
|
+
* @return {string}
|
|
3042
|
+
*/
|
|
3043
|
+
function slice (begin, end) {
|
|
3044
|
+
return substr(characters, begin, end)
|
|
3045
|
+
}
|
|
3046
|
+
|
|
3047
|
+
/**
|
|
3048
|
+
* @param {number} type
|
|
3049
|
+
* @return {number}
|
|
3050
|
+
*/
|
|
3051
|
+
function token (type) {
|
|
3052
|
+
switch (type) {
|
|
3053
|
+
// \0 \t \n \r \s whitespace token
|
|
3054
|
+
case 0: case 9: case 10: case 13: case 32:
|
|
3055
|
+
return 5
|
|
3056
|
+
// ! + , / > @ ~ isolate token
|
|
3057
|
+
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
|
|
3058
|
+
// ; { } breakpoint token
|
|
3059
|
+
case 59: case 123: case 125:
|
|
3060
|
+
return 4
|
|
3061
|
+
// : accompanied token
|
|
3062
|
+
case 58:
|
|
3063
|
+
return 3
|
|
3064
|
+
// " ' ( [ opening delimit token
|
|
3065
|
+
case 34: case 39: case 40: case 91:
|
|
3066
|
+
return 2
|
|
3067
|
+
// ) ] closing delimit token
|
|
3068
|
+
case 41: case 93:
|
|
3069
|
+
return 1
|
|
3070
|
+
}
|
|
3071
|
+
|
|
3072
|
+
return 0
|
|
3073
|
+
}
|
|
3074
|
+
|
|
3075
|
+
/**
|
|
3076
|
+
* @param {string} value
|
|
3077
|
+
* @return {any[]}
|
|
3078
|
+
*/
|
|
3079
|
+
function alloc (value) {
|
|
3080
|
+
return line = column = 1, length = strlen(characters = value), position = 0, []
|
|
3081
|
+
}
|
|
3082
|
+
|
|
3083
|
+
/**
|
|
3084
|
+
* @param {any} value
|
|
3085
|
+
* @return {any}
|
|
3086
|
+
*/
|
|
3087
|
+
function dealloc (value) {
|
|
3088
|
+
return characters = '', value
|
|
3089
|
+
}
|
|
3090
|
+
|
|
3091
|
+
/**
|
|
3092
|
+
* @param {number} type
|
|
3093
|
+
* @return {string}
|
|
3094
|
+
*/
|
|
3095
|
+
function delimit (type) {
|
|
3096
|
+
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
3097
|
+
}
|
|
3098
|
+
|
|
3099
|
+
/**
|
|
3100
|
+
* @param {number} type
|
|
3101
|
+
* @return {string}
|
|
3102
|
+
*/
|
|
3103
|
+
function whitespace (type) {
|
|
3104
|
+
while (character = peek())
|
|
3105
|
+
if (character < 33)
|
|
3106
|
+
next();
|
|
3107
|
+
else
|
|
3108
|
+
break
|
|
3109
|
+
|
|
3110
|
+
return token(type) > 2 || token(character) > 3 ? '' : ' '
|
|
3111
|
+
}
|
|
3112
|
+
|
|
3113
|
+
/**
|
|
3114
|
+
* @param {number} index
|
|
3115
|
+
* @param {number} count
|
|
3116
|
+
* @return {string}
|
|
3117
|
+
*/
|
|
3118
|
+
function escaping (index, count) {
|
|
3119
|
+
while (--count && next())
|
|
3120
|
+
// not 0-9 A-F a-f
|
|
3121
|
+
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
|
|
3122
|
+
break
|
|
3123
|
+
|
|
3124
|
+
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
|
|
3125
|
+
}
|
|
3126
|
+
|
|
3127
|
+
/**
|
|
3128
|
+
* @param {number} type
|
|
3129
|
+
* @return {number}
|
|
3130
|
+
*/
|
|
3131
|
+
function delimiter (type) {
|
|
3132
|
+
while (next())
|
|
3133
|
+
switch (character) {
|
|
3134
|
+
// ] ) " '
|
|
3135
|
+
case type:
|
|
3136
|
+
return position
|
|
3137
|
+
// " '
|
|
3138
|
+
case 34: case 39:
|
|
3139
|
+
if (type !== 34 && type !== 39)
|
|
3140
|
+
delimiter(character);
|
|
3141
|
+
break
|
|
3142
|
+
// (
|
|
3143
|
+
case 40:
|
|
3144
|
+
if (type === 41)
|
|
3145
|
+
delimiter(type);
|
|
3146
|
+
break
|
|
3147
|
+
// \
|
|
3148
|
+
case 92:
|
|
3149
|
+
next();
|
|
3150
|
+
break
|
|
3151
|
+
}
|
|
3152
|
+
|
|
3153
|
+
return position
|
|
3154
|
+
}
|
|
3155
|
+
|
|
3156
|
+
/**
|
|
3157
|
+
* @param {number} type
|
|
3158
|
+
* @param {number} index
|
|
3159
|
+
* @return {number}
|
|
3160
|
+
*/
|
|
3161
|
+
function commenter (type, index) {
|
|
3162
|
+
while (next())
|
|
3163
|
+
// //
|
|
3164
|
+
if (type + character === 47 + 10)
|
|
3165
|
+
break
|
|
3166
|
+
// /*
|
|
3167
|
+
else if (type + character === 42 + 42 && peek() === 47)
|
|
3168
|
+
break
|
|
3169
|
+
|
|
3170
|
+
return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
|
|
3171
|
+
}
|
|
3172
|
+
|
|
3173
|
+
/**
|
|
3174
|
+
* @param {number} index
|
|
3175
|
+
* @return {string}
|
|
3176
|
+
*/
|
|
3177
|
+
function identifier (index) {
|
|
3178
|
+
while (!token(peek()))
|
|
3179
|
+
next();
|
|
3180
|
+
|
|
3181
|
+
return slice(index, position)
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
/**
|
|
3185
|
+
* @param {string} value
|
|
3186
|
+
* @return {object[]}
|
|
3187
|
+
*/
|
|
3188
|
+
function compile (value) {
|
|
3189
|
+
return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
/**
|
|
3193
|
+
* @param {string} value
|
|
3194
|
+
* @param {object} root
|
|
3195
|
+
* @param {object?} parent
|
|
3196
|
+
* @param {string[]} rule
|
|
3197
|
+
* @param {string[]} rules
|
|
3198
|
+
* @param {string[]} rulesets
|
|
3199
|
+
* @param {number[]} pseudo
|
|
3200
|
+
* @param {number[]} points
|
|
3201
|
+
* @param {string[]} declarations
|
|
3202
|
+
* @return {object}
|
|
3203
|
+
*/
|
|
3204
|
+
function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
3205
|
+
var index = 0;
|
|
3206
|
+
var offset = 0;
|
|
3207
|
+
var length = pseudo;
|
|
3208
|
+
var atrule = 0;
|
|
3209
|
+
var property = 0;
|
|
3210
|
+
var previous = 0;
|
|
3211
|
+
var variable = 1;
|
|
3212
|
+
var scanning = 1;
|
|
3213
|
+
var ampersand = 1;
|
|
3214
|
+
var character = 0;
|
|
3215
|
+
var type = '';
|
|
3216
|
+
var props = rules;
|
|
3217
|
+
var children = rulesets;
|
|
3218
|
+
var reference = rule;
|
|
3219
|
+
var characters = type;
|
|
3220
|
+
|
|
3221
|
+
while (scanning)
|
|
3222
|
+
switch (previous = character, character = next()) {
|
|
3223
|
+
// (
|
|
3224
|
+
case 40:
|
|
3225
|
+
if (previous != 108 && charat(characters, length - 1) == 58) {
|
|
3226
|
+
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
|
|
3227
|
+
ampersand = -1;
|
|
3228
|
+
break
|
|
3229
|
+
}
|
|
3230
|
+
// " ' [
|
|
3231
|
+
case 34: case 39: case 91:
|
|
3232
|
+
characters += delimit(character);
|
|
3233
|
+
break
|
|
3234
|
+
// \t \n \r \s
|
|
3235
|
+
case 9: case 10: case 13: case 32:
|
|
3236
|
+
characters += whitespace(previous);
|
|
3237
|
+
break
|
|
3238
|
+
// \
|
|
3239
|
+
case 92:
|
|
3240
|
+
characters += escaping(caret() - 1, 7);
|
|
3241
|
+
continue
|
|
3242
|
+
// /
|
|
3243
|
+
case 47:
|
|
3244
|
+
switch (peek()) {
|
|
3245
|
+
case 42: case 47:
|
|
3246
|
+
append(comment(commenter(next(), caret()), root, parent), declarations);
|
|
3247
|
+
break
|
|
3248
|
+
default:
|
|
3249
|
+
characters += '/';
|
|
3250
|
+
}
|
|
3251
|
+
break
|
|
3252
|
+
// {
|
|
3253
|
+
case 123 * variable:
|
|
3254
|
+
points[index++] = strlen(characters) * ampersand;
|
|
3255
|
+
// } ; \0
|
|
3256
|
+
case 125 * variable: case 59: case 0:
|
|
3257
|
+
switch (character) {
|
|
3258
|
+
// \0 }
|
|
3259
|
+
case 0: case 125: scanning = 0;
|
|
3260
|
+
// ;
|
|
3261
|
+
case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '');
|
|
3262
|
+
if (property > 0 && (strlen(characters) - length))
|
|
3263
|
+
append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
|
|
3264
|
+
break
|
|
3265
|
+
// @ ;
|
|
3266
|
+
case 59: characters += ';';
|
|
3267
|
+
// { rule/at-rule
|
|
3268
|
+
default:
|
|
3269
|
+
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
|
|
3270
|
+
|
|
3271
|
+
if (character === 123)
|
|
3272
|
+
if (offset === 0)
|
|
3273
|
+
parse(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
3274
|
+
else
|
|
3275
|
+
switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
|
|
3276
|
+
// d l m s
|
|
3277
|
+
case 100: case 108: case 109: case 115:
|
|
3278
|
+
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
|
|
3279
|
+
break
|
|
3280
|
+
default:
|
|
3281
|
+
parse(characters, reference, reference, reference, [''], children, 0, points, children);
|
|
3282
|
+
}
|
|
3283
|
+
}
|
|
3284
|
+
|
|
3285
|
+
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
|
|
3286
|
+
break
|
|
3287
|
+
// :
|
|
3288
|
+
case 58:
|
|
3289
|
+
length = 1 + strlen(characters), property = previous;
|
|
3290
|
+
default:
|
|
3291
|
+
if (variable < 1)
|
|
3292
|
+
if (character == 123)
|
|
3293
|
+
--variable;
|
|
3294
|
+
else if (character == 125 && variable++ == 0 && prev() == 125)
|
|
3295
|
+
continue
|
|
3296
|
+
|
|
3297
|
+
switch (characters += from(character), character * variable) {
|
|
3298
|
+
// &
|
|
3299
|
+
case 38:
|
|
3300
|
+
ampersand = offset > 0 ? 1 : (characters += '\f', -1);
|
|
3301
|
+
break
|
|
3302
|
+
// ,
|
|
3303
|
+
case 44:
|
|
3304
|
+
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
|
|
3305
|
+
break
|
|
3306
|
+
// @
|
|
3307
|
+
case 64:
|
|
3308
|
+
// -
|
|
3309
|
+
if (peek() === 45)
|
|
3310
|
+
characters += delimit(next());
|
|
3311
|
+
|
|
3312
|
+
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
|
|
3313
|
+
break
|
|
3314
|
+
// -
|
|
3315
|
+
case 45:
|
|
3316
|
+
if (previous === 45 && strlen(characters) == 2)
|
|
3317
|
+
variable = 0;
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
|
|
3321
|
+
return rulesets
|
|
3322
|
+
}
|
|
3323
|
+
|
|
3324
|
+
/**
|
|
3325
|
+
* @param {string} value
|
|
3326
|
+
* @param {object} root
|
|
3327
|
+
* @param {object?} parent
|
|
3328
|
+
* @param {number} index
|
|
3329
|
+
* @param {number} offset
|
|
3330
|
+
* @param {string[]} rules
|
|
3331
|
+
* @param {number[]} points
|
|
3332
|
+
* @param {string} type
|
|
3333
|
+
* @param {string[]} props
|
|
3334
|
+
* @param {string[]} children
|
|
3335
|
+
* @param {number} length
|
|
3336
|
+
* @return {object}
|
|
3337
|
+
*/
|
|
3338
|
+
function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
|
|
3339
|
+
var post = offset - 1;
|
|
3340
|
+
var rule = offset === 0 ? rules : [''];
|
|
3341
|
+
var size = sizeof(rule);
|
|
3342
|
+
|
|
3343
|
+
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
3344
|
+
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
3345
|
+
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
3346
|
+
props[k++] = z;
|
|
3347
|
+
|
|
3348
|
+
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
|
|
3349
|
+
}
|
|
3350
|
+
|
|
3351
|
+
/**
|
|
3352
|
+
* @param {number} value
|
|
3353
|
+
* @param {object} root
|
|
3354
|
+
* @param {object?} parent
|
|
3355
|
+
* @return {object}
|
|
3356
|
+
*/
|
|
3357
|
+
function comment (value, root, parent) {
|
|
3358
|
+
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
|
|
3359
|
+
}
|
|
3360
|
+
|
|
3361
|
+
/**
|
|
3362
|
+
* @param {string} value
|
|
3363
|
+
* @param {object} root
|
|
3364
|
+
* @param {object?} parent
|
|
3365
|
+
* @param {number} length
|
|
3366
|
+
* @return {object}
|
|
3367
|
+
*/
|
|
3368
|
+
function declaration (value, root, parent, length) {
|
|
3369
|
+
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
|
|
3370
|
+
}
|
|
3371
|
+
|
|
3372
|
+
/**
|
|
3373
|
+
* @param {object[]} children
|
|
3374
|
+
* @param {function} callback
|
|
3375
|
+
* @return {string}
|
|
3376
|
+
*/
|
|
3377
|
+
function serialize (children, callback) {
|
|
3378
|
+
var output = '';
|
|
3379
|
+
var length = sizeof(children);
|
|
3380
|
+
|
|
3381
|
+
for (var i = 0; i < length; i++)
|
|
3382
|
+
output += callback(children[i], i, children, callback) || '';
|
|
3383
|
+
|
|
3384
|
+
return output
|
|
3385
|
+
}
|
|
3386
|
+
|
|
3387
|
+
/**
|
|
3388
|
+
* @param {object} element
|
|
3389
|
+
* @param {number} index
|
|
3390
|
+
* @param {object[]} children
|
|
3391
|
+
* @param {function} callback
|
|
3392
|
+
* @return {string}
|
|
3393
|
+
*/
|
|
3394
|
+
function stringify (element, index, children, callback) {
|
|
3395
|
+
switch (element.type) {
|
|
3396
|
+
case LAYER: if (element.children.length) break
|
|
3397
|
+
case IMPORT: case DECLARATION: return element.return = element.return || element.value
|
|
3398
|
+
case COMMENT: return ''
|
|
3399
|
+
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
|
|
3400
|
+
case RULESET: element.value = element.props.join(',');
|
|
3401
|
+
}
|
|
3402
|
+
|
|
3403
|
+
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
|
|
3404
|
+
}
|
|
3405
|
+
|
|
3406
|
+
/**
|
|
3407
|
+
* @param {function[]} collection
|
|
3408
|
+
* @return {function}
|
|
3409
|
+
*/
|
|
3410
|
+
function middleware (collection) {
|
|
3411
|
+
var length = sizeof(collection);
|
|
3412
|
+
|
|
3413
|
+
return function (element, index, children, callback) {
|
|
3414
|
+
var output = '';
|
|
3415
|
+
|
|
3416
|
+
for (var i = 0; i < length; i++)
|
|
3417
|
+
output += collection[i](element, index, children, callback) || '';
|
|
3418
|
+
|
|
3419
|
+
return output
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
/**
|
|
3424
|
+
* @param {function} callback
|
|
3425
|
+
* @return {function}
|
|
3426
|
+
*/
|
|
3427
|
+
function rulesheet (callback) {
|
|
3428
|
+
return function (element) {
|
|
3429
|
+
if (!element.root)
|
|
3430
|
+
if (element = element.return)
|
|
3431
|
+
callback(element);
|
|
3432
|
+
}
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
function memoize(fn) {
|
|
3436
|
+
var cache = Object.create(null);
|
|
3437
|
+
return function (arg) {
|
|
3438
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
3439
|
+
return cache[arg];
|
|
3440
|
+
};
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
3444
|
+
var previous = 0;
|
|
3445
|
+
var character = 0;
|
|
3446
|
+
|
|
3447
|
+
while (true) {
|
|
3448
|
+
previous = character;
|
|
3449
|
+
character = peek(); // &\f
|
|
3450
|
+
|
|
3451
|
+
if (previous === 38 && character === 12) {
|
|
3452
|
+
points[index] = 1;
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
if (token(character)) {
|
|
3456
|
+
break;
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3459
|
+
next();
|
|
3460
|
+
}
|
|
3461
|
+
|
|
3462
|
+
return slice(begin, position);
|
|
3463
|
+
};
|
|
3464
|
+
|
|
3465
|
+
var toRules = function toRules(parsed, points) {
|
|
3466
|
+
// pretend we've started with a comma
|
|
3467
|
+
var index = -1;
|
|
3468
|
+
var character = 44;
|
|
3469
|
+
|
|
3470
|
+
do {
|
|
3471
|
+
switch (token(character)) {
|
|
3472
|
+
case 0:
|
|
3473
|
+
// &\f
|
|
3474
|
+
if (character === 38 && peek() === 12) {
|
|
3475
|
+
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
|
|
3476
|
+
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
|
|
3477
|
+
// and when it should just concatenate the outer and inner selectors
|
|
3478
|
+
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
|
|
3479
|
+
points[index] = 1;
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
parsed[index] += identifierWithPointTracking(position - 1, points, index);
|
|
3483
|
+
break;
|
|
3484
|
+
|
|
3485
|
+
case 2:
|
|
3486
|
+
parsed[index] += delimit(character);
|
|
3487
|
+
break;
|
|
3488
|
+
|
|
3489
|
+
case 4:
|
|
3490
|
+
// comma
|
|
3491
|
+
if (character === 44) {
|
|
3492
|
+
// colon
|
|
3493
|
+
parsed[++index] = peek() === 58 ? '&\f' : '';
|
|
3494
|
+
points[index] = parsed[index].length;
|
|
3495
|
+
break;
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
// fallthrough
|
|
3499
|
+
|
|
3500
|
+
default:
|
|
3501
|
+
parsed[index] += from(character);
|
|
3502
|
+
}
|
|
3503
|
+
} while (character = next());
|
|
3504
|
+
|
|
3505
|
+
return parsed;
|
|
3506
|
+
};
|
|
3507
|
+
|
|
3508
|
+
var getRules = function getRules(value, points) {
|
|
3509
|
+
return dealloc(toRules(alloc(value), points));
|
|
3510
|
+
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
|
|
3511
|
+
|
|
3512
|
+
|
|
3513
|
+
var fixedElements = /* #__PURE__ */new WeakMap();
|
|
3514
|
+
var compat = function compat(element) {
|
|
3515
|
+
if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
|
|
3516
|
+
// negative .length indicates that this rule has been already prefixed
|
|
3517
|
+
element.length < 1) {
|
|
3518
|
+
return;
|
|
3519
|
+
}
|
|
3520
|
+
|
|
3521
|
+
var value = element.value;
|
|
3522
|
+
var parent = element.parent;
|
|
3523
|
+
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
3524
|
+
|
|
3525
|
+
while (parent.type !== 'rule') {
|
|
3526
|
+
parent = parent.parent;
|
|
3527
|
+
if (!parent) return;
|
|
3528
|
+
} // short-circuit for the simplest case
|
|
3529
|
+
|
|
3530
|
+
|
|
3531
|
+
if (element.props.length === 1 && value.charCodeAt(0) !== 58
|
|
3532
|
+
/* colon */
|
|
3533
|
+
&& !fixedElements.get(parent)) {
|
|
3534
|
+
return;
|
|
3535
|
+
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
|
|
3536
|
+
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
|
|
3537
|
+
|
|
3538
|
+
|
|
3539
|
+
if (isImplicitRule) {
|
|
3540
|
+
return;
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
fixedElements.set(element, true);
|
|
3544
|
+
var points = [];
|
|
3545
|
+
var rules = getRules(value, points);
|
|
3546
|
+
var parentRules = parent.props;
|
|
3547
|
+
|
|
3548
|
+
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
3549
|
+
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
3550
|
+
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
};
|
|
3554
|
+
var removeLabel = function removeLabel(element) {
|
|
3555
|
+
if (element.type === 'decl') {
|
|
3556
|
+
var value = element.value;
|
|
3557
|
+
|
|
3558
|
+
if ( // charcode for l
|
|
3559
|
+
value.charCodeAt(0) === 108 && // charcode for b
|
|
3560
|
+
value.charCodeAt(2) === 98) {
|
|
3561
|
+
// this ignores label
|
|
3562
|
+
element["return"] = '';
|
|
3563
|
+
element.value = '';
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
};
|
|
3567
|
+
|
|
3568
|
+
/* eslint-disable no-fallthrough */
|
|
3569
|
+
|
|
3570
|
+
function prefix(value, length) {
|
|
3571
|
+
switch (hash(value, length)) {
|
|
3572
|
+
// color-adjust
|
|
3573
|
+
case 5103:
|
|
3574
|
+
return WEBKIT + 'print-' + value + value;
|
|
3575
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
3576
|
+
|
|
3577
|
+
case 5737:
|
|
3578
|
+
case 4201:
|
|
3579
|
+
case 3177:
|
|
3580
|
+
case 3433:
|
|
3581
|
+
case 1641:
|
|
3582
|
+
case 4457:
|
|
3583
|
+
case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
3584
|
+
|
|
3585
|
+
case 5572:
|
|
3586
|
+
case 6356:
|
|
3587
|
+
case 5844:
|
|
3588
|
+
case 3191:
|
|
3589
|
+
case 6645:
|
|
3590
|
+
case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
3591
|
+
|
|
3592
|
+
case 6391:
|
|
3593
|
+
case 5879:
|
|
3594
|
+
case 5623:
|
|
3595
|
+
case 6135:
|
|
3596
|
+
case 4599:
|
|
3597
|
+
case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
3598
|
+
|
|
3599
|
+
case 4215:
|
|
3600
|
+
case 6389:
|
|
3601
|
+
case 5109:
|
|
3602
|
+
case 5365:
|
|
3603
|
+
case 5621:
|
|
3604
|
+
case 3829:
|
|
3605
|
+
return WEBKIT + value + value;
|
|
3606
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
3607
|
+
|
|
3608
|
+
case 5349:
|
|
3609
|
+
case 4246:
|
|
3610
|
+
case 4810:
|
|
3611
|
+
case 6968:
|
|
3612
|
+
case 2756:
|
|
3613
|
+
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
3614
|
+
// flex, flex-direction
|
|
3615
|
+
|
|
3616
|
+
case 6828:
|
|
3617
|
+
case 4268:
|
|
3618
|
+
return WEBKIT + value + MS + value + value;
|
|
3619
|
+
// order
|
|
3620
|
+
|
|
3621
|
+
case 6165:
|
|
3622
|
+
return WEBKIT + value + MS + 'flex-' + value + value;
|
|
3623
|
+
// align-items
|
|
3624
|
+
|
|
3625
|
+
case 5187:
|
|
3626
|
+
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
|
|
3627
|
+
// align-self
|
|
3628
|
+
|
|
3629
|
+
case 5443:
|
|
3630
|
+
return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
|
|
3631
|
+
// align-content
|
|
3632
|
+
|
|
3633
|
+
case 4675:
|
|
3634
|
+
return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
|
|
3635
|
+
// flex-shrink
|
|
3636
|
+
|
|
3637
|
+
case 5548:
|
|
3638
|
+
return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
|
|
3639
|
+
// flex-basis
|
|
3640
|
+
|
|
3641
|
+
case 5292:
|
|
3642
|
+
return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
|
|
3643
|
+
// flex-grow
|
|
3644
|
+
|
|
3645
|
+
case 6060:
|
|
3646
|
+
return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
|
|
3647
|
+
// transition
|
|
3648
|
+
|
|
3649
|
+
case 4554:
|
|
3650
|
+
return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
|
|
3651
|
+
// cursor
|
|
3652
|
+
|
|
3653
|
+
case 6187:
|
|
3654
|
+
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
|
|
3655
|
+
// background, background-image
|
|
3656
|
+
|
|
3657
|
+
case 5495:
|
|
3658
|
+
case 3959:
|
|
3659
|
+
return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
|
|
3660
|
+
// justify-content
|
|
3661
|
+
|
|
3662
|
+
case 4968:
|
|
3663
|
+
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
|
|
3664
|
+
// (margin|padding)-inline-(start|end)
|
|
3665
|
+
|
|
3666
|
+
case 4095:
|
|
3667
|
+
case 3583:
|
|
3668
|
+
case 4068:
|
|
3669
|
+
case 2532:
|
|
3670
|
+
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
|
|
3671
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
3672
|
+
|
|
3673
|
+
case 8116:
|
|
3674
|
+
case 7059:
|
|
3675
|
+
case 5753:
|
|
3676
|
+
case 5535:
|
|
3677
|
+
case 5445:
|
|
3678
|
+
case 5701:
|
|
3679
|
+
case 4933:
|
|
3680
|
+
case 4677:
|
|
3681
|
+
case 5533:
|
|
3682
|
+
case 5789:
|
|
3683
|
+
case 5021:
|
|
3684
|
+
case 4765:
|
|
3685
|
+
// stretch, max-content, min-content, fill-available
|
|
3686
|
+
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
|
|
3687
|
+
// (m)ax-content, (m)in-content
|
|
3688
|
+
case 109:
|
|
3689
|
+
// -
|
|
3690
|
+
if (charat(value, length + 4) !== 45) break;
|
|
3691
|
+
// (f)ill-available, (f)it-content
|
|
3692
|
+
|
|
3693
|
+
case 102:
|
|
3694
|
+
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
|
|
3695
|
+
// (s)tretch
|
|
3696
|
+
|
|
3697
|
+
case 115:
|
|
3698
|
+
return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
|
|
3699
|
+
}
|
|
3700
|
+
break;
|
|
3701
|
+
// position: sticky
|
|
3702
|
+
|
|
3703
|
+
case 4949:
|
|
3704
|
+
// (s)ticky?
|
|
3705
|
+
if (charat(value, length + 1) !== 115) break;
|
|
3706
|
+
// display: (flex|inline-flex)
|
|
3707
|
+
|
|
3708
|
+
case 6444:
|
|
3709
|
+
switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
|
|
3710
|
+
// stic(k)y
|
|
3711
|
+
case 107:
|
|
3712
|
+
return replace(value, ':', ':' + WEBKIT) + value;
|
|
3713
|
+
// (inline-)?fl(e)x
|
|
3714
|
+
|
|
3715
|
+
case 101:
|
|
3716
|
+
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3719
|
+
break;
|
|
3720
|
+
// writing-mode
|
|
3721
|
+
|
|
3722
|
+
case 5936:
|
|
3723
|
+
switch (charat(value, length + 11)) {
|
|
3724
|
+
// vertical-l(r)
|
|
3725
|
+
case 114:
|
|
3726
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
|
|
3727
|
+
// vertical-r(l)
|
|
3728
|
+
|
|
3729
|
+
case 108:
|
|
3730
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
|
|
3731
|
+
// horizontal(-)tb
|
|
3732
|
+
|
|
3733
|
+
case 45:
|
|
3734
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
|
|
3735
|
+
}
|
|
3736
|
+
|
|
3737
|
+
return WEBKIT + value + MS + value + value;
|
|
3738
|
+
}
|
|
3739
|
+
|
|
3740
|
+
return value;
|
|
3741
|
+
}
|
|
3742
|
+
|
|
3743
|
+
var prefixer = function prefixer(element, index, children, callback) {
|
|
3744
|
+
if (element.length > -1) if (!element["return"]) switch (element.type) {
|
|
3745
|
+
case DECLARATION:
|
|
3746
|
+
element["return"] = prefix(element.value, element.length);
|
|
3747
|
+
break;
|
|
3748
|
+
|
|
3749
|
+
case KEYFRAMES:
|
|
3750
|
+
return serialize([copy(element, {
|
|
3751
|
+
value: replace(element.value, '@', '@' + WEBKIT)
|
|
3752
|
+
})], callback);
|
|
3753
|
+
|
|
3754
|
+
case RULESET:
|
|
3755
|
+
if (element.length) return combine(element.props, function (value) {
|
|
3756
|
+
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
3757
|
+
// :read-(only|write)
|
|
3758
|
+
case ':read-only':
|
|
3759
|
+
case ':read-write':
|
|
3760
|
+
return serialize([copy(element, {
|
|
3761
|
+
props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
|
|
3762
|
+
})], callback);
|
|
3763
|
+
// :placeholder
|
|
3764
|
+
|
|
3765
|
+
case '::placeholder':
|
|
3766
|
+
return serialize([copy(element, {
|
|
3767
|
+
props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
|
|
3768
|
+
}), copy(element, {
|
|
3769
|
+
props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
|
|
3770
|
+
}), copy(element, {
|
|
3771
|
+
props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
|
|
3772
|
+
})], callback);
|
|
3773
|
+
}
|
|
3774
|
+
|
|
3775
|
+
return '';
|
|
3776
|
+
});
|
|
3777
|
+
}
|
|
3778
|
+
};
|
|
3779
|
+
|
|
3780
|
+
var defaultStylisPlugins = [prefixer];
|
|
3781
|
+
|
|
3782
|
+
var createCache = function createCache(options) {
|
|
3783
|
+
var key = options.key;
|
|
3784
|
+
|
|
3785
|
+
if (key === 'css') {
|
|
3786
|
+
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
3787
|
+
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
3788
|
+
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
3789
|
+
// that creating a cache works inside of render of a React component
|
|
3790
|
+
|
|
3791
|
+
Array.prototype.forEach.call(ssrStyles, function (node) {
|
|
3792
|
+
// we want to only move elements which have a space in the data-emotion attribute value
|
|
3793
|
+
// because that indicates that it is an Emotion 11 server-side rendered style elements
|
|
3794
|
+
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
|
|
3795
|
+
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
|
|
3796
|
+
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
|
|
3797
|
+
// will not result in the Emotion 10 styles being destroyed
|
|
3798
|
+
var dataEmotionAttribute = node.getAttribute('data-emotion');
|
|
3799
|
+
|
|
3800
|
+
if (dataEmotionAttribute.indexOf(' ') === -1) {
|
|
3801
|
+
return;
|
|
3802
|
+
}
|
|
3803
|
+
|
|
3804
|
+
document.head.appendChild(node);
|
|
3805
|
+
node.setAttribute('data-s', '');
|
|
3806
|
+
});
|
|
3807
|
+
}
|
|
3808
|
+
|
|
3809
|
+
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
3810
|
+
|
|
3811
|
+
var inserted = {};
|
|
3812
|
+
var container;
|
|
3813
|
+
var nodesToHydrate = [];
|
|
3814
|
+
|
|
3815
|
+
{
|
|
3816
|
+
container = options.container || document.head;
|
|
3817
|
+
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
3818
|
+
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
3819
|
+
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
|
|
3820
|
+
var attrib = node.getAttribute("data-emotion").split(' ');
|
|
3821
|
+
|
|
3822
|
+
for (var i = 1; i < attrib.length; i++) {
|
|
3823
|
+
inserted[attrib[i]] = true;
|
|
3824
|
+
}
|
|
3825
|
+
|
|
3826
|
+
nodesToHydrate.push(node);
|
|
3827
|
+
});
|
|
3828
|
+
}
|
|
3829
|
+
|
|
3830
|
+
var _insert;
|
|
3831
|
+
|
|
3832
|
+
var omnipresentPlugins = [compat, removeLabel];
|
|
3833
|
+
|
|
3834
|
+
{
|
|
3835
|
+
var currentSheet;
|
|
3836
|
+
var finalizingPlugins = [stringify, rulesheet(function (rule) {
|
|
3837
|
+
currentSheet.insert(rule);
|
|
3838
|
+
})];
|
|
3839
|
+
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
3840
|
+
|
|
3841
|
+
var stylis = function stylis(styles) {
|
|
3842
|
+
return serialize(compile(styles), serializer);
|
|
3843
|
+
};
|
|
3844
|
+
|
|
3845
|
+
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
3846
|
+
currentSheet = sheet;
|
|
3847
|
+
|
|
3848
|
+
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
3849
|
+
|
|
3850
|
+
if (shouldCache) {
|
|
3851
|
+
cache.inserted[serialized.name] = true;
|
|
3852
|
+
}
|
|
3853
|
+
};
|
|
3854
|
+
}
|
|
3855
|
+
|
|
3856
|
+
var cache = {
|
|
3857
|
+
key: key,
|
|
3858
|
+
sheet: new StyleSheet({
|
|
3859
|
+
key: key,
|
|
3860
|
+
container: container,
|
|
3861
|
+
nonce: options.nonce,
|
|
3862
|
+
speedy: options.speedy,
|
|
3863
|
+
prepend: options.prepend,
|
|
3864
|
+
insertionPoint: options.insertionPoint
|
|
3865
|
+
}),
|
|
3866
|
+
nonce: options.nonce,
|
|
3867
|
+
inserted: inserted,
|
|
3868
|
+
registered: {},
|
|
3869
|
+
insert: _insert
|
|
3870
|
+
};
|
|
3871
|
+
cache.sheet.hydrate(nodesToHydrate);
|
|
3872
|
+
return cache;
|
|
3873
|
+
};
|
|
3874
|
+
|
|
3875
|
+
var isBrowser = true;
|
|
3876
|
+
|
|
3877
|
+
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
3878
|
+
var rawClassName = '';
|
|
3879
|
+
classNames.split(' ').forEach(function (className) {
|
|
3880
|
+
if (registered[className] !== undefined) {
|
|
3881
|
+
registeredStyles.push(registered[className] + ";");
|
|
3882
|
+
} else if (className) {
|
|
3883
|
+
rawClassName += className + " ";
|
|
3884
|
+
}
|
|
3885
|
+
});
|
|
3886
|
+
return rawClassName;
|
|
3887
|
+
}
|
|
3888
|
+
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
3889
|
+
var className = cache.key + "-" + serialized.name;
|
|
3890
|
+
|
|
3891
|
+
if ( // we only need to add the styles to the registered cache if the
|
|
3892
|
+
// class name could be used further down
|
|
3893
|
+
// the tree but if it's a string tag, we know it won't
|
|
3894
|
+
// so we don't have to add it to registered cache.
|
|
3895
|
+
// this improves memory usage since we can avoid storing the whole style string
|
|
3896
|
+
(isStringTag === false || // we need to always store it if we're in compat mode and
|
|
3897
|
+
// in node since emotion-server relies on whether a style is in
|
|
3898
|
+
// the registered cache to know whether a style is global or not
|
|
3899
|
+
// also, note that this check will be dead code eliminated in the browser
|
|
3900
|
+
isBrowser === false ) && cache.registered[className] === undefined) {
|
|
3901
|
+
cache.registered[className] = serialized.styles;
|
|
3902
|
+
}
|
|
3903
|
+
};
|
|
3904
|
+
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
3905
|
+
registerStyles(cache, serialized, isStringTag);
|
|
3906
|
+
var className = cache.key + "-" + serialized.name;
|
|
3907
|
+
|
|
3908
|
+
if (cache.inserted[serialized.name] === undefined) {
|
|
3909
|
+
var current = serialized;
|
|
3910
|
+
|
|
3911
|
+
do {
|
|
3912
|
+
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
3913
|
+
|
|
3914
|
+
current = current.next;
|
|
3915
|
+
} while (current !== undefined);
|
|
3916
|
+
}
|
|
3917
|
+
};
|
|
3918
|
+
|
|
2692
3919
|
/* eslint-disable */
|
|
2693
3920
|
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
2694
3921
|
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
|
@@ -2794,14 +4021,6 @@ var unitlessKeys = {
|
|
|
2794
4021
|
strokeWidth: 1
|
|
2795
4022
|
};
|
|
2796
4023
|
|
|
2797
|
-
function memoize(fn) {
|
|
2798
|
-
var cache = Object.create(null);
|
|
2799
|
-
return function (arg) {
|
|
2800
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
2801
|
-
return cache[arg];
|
|
2802
|
-
};
|
|
2803
|
-
}
|
|
2804
|
-
|
|
2805
4024
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
2806
4025
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
2807
4026
|
|
|
@@ -2897,14 +4116,29 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2897
4116
|
|
|
2898
4117
|
return createStringFromObject(mergedProps, registered, interpolation);
|
|
2899
4118
|
}
|
|
4119
|
+
|
|
4120
|
+
case 'function':
|
|
4121
|
+
{
|
|
4122
|
+
if (mergedProps !== undefined) {
|
|
4123
|
+
var previousCursor = cursor;
|
|
4124
|
+
var result = interpolation(mergedProps);
|
|
4125
|
+
cursor = previousCursor;
|
|
4126
|
+
return handleInterpolation(mergedProps, registered, result);
|
|
4127
|
+
}
|
|
4128
|
+
|
|
4129
|
+
break;
|
|
4130
|
+
}
|
|
2900
4131
|
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
2901
4132
|
|
|
2902
4133
|
|
|
2903
4134
|
var asString = interpolation;
|
|
2904
4135
|
|
|
2905
|
-
{
|
|
4136
|
+
if (registered == null) {
|
|
2906
4137
|
return asString;
|
|
2907
4138
|
}
|
|
4139
|
+
|
|
4140
|
+
var cached = registered[asString];
|
|
4141
|
+
return cached !== undefined ? cached : asString;
|
|
2908
4142
|
}
|
|
2909
4143
|
|
|
2910
4144
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
@@ -2921,12 +4155,14 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
2921
4155
|
if (typeof value !== 'object') {
|
|
2922
4156
|
var asString = value;
|
|
2923
4157
|
|
|
2924
|
-
if (
|
|
4158
|
+
if (registered != null && registered[asString] !== undefined) {
|
|
4159
|
+
string += key + "{" + registered[asString] + "}";
|
|
4160
|
+
} else if (isProcessableValue(asString)) {
|
|
2925
4161
|
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
2926
4162
|
}
|
|
2927
4163
|
} else {
|
|
2928
4164
|
|
|
2929
|
-
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null)) {
|
|
4165
|
+
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
2930
4166
|
for (var _i = 0; _i < value.length; _i++) {
|
|
2931
4167
|
if (isProcessableValue(value[_i])) {
|
|
2932
4168
|
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
@@ -3009,6 +4245,214 @@ function serializeStyles(args, registered, mergedProps) {
|
|
|
3009
4245
|
};
|
|
3010
4246
|
}
|
|
3011
4247
|
|
|
4248
|
+
var syncFallback = function syncFallback(create) {
|
|
4249
|
+
return create();
|
|
4250
|
+
};
|
|
4251
|
+
|
|
4252
|
+
var useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;
|
|
4253
|
+
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
|
|
4254
|
+
|
|
4255
|
+
var EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
4256
|
+
// because this module is primarily intended for the browser and node
|
|
4257
|
+
// but it's also required in react native and similar environments sometimes
|
|
4258
|
+
// and we could have a special build just for that
|
|
4259
|
+
// but this is much easier and the native packages
|
|
4260
|
+
// might use a different theme context in the future anyway
|
|
4261
|
+
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
4262
|
+
key: 'css'
|
|
4263
|
+
}) : null);
|
|
4264
|
+
|
|
4265
|
+
EmotionCacheContext.Provider;
|
|
4266
|
+
|
|
4267
|
+
var withEmotionCache = function withEmotionCache(func) {
|
|
4268
|
+
return /*#__PURE__*/forwardRef(function (props, ref) {
|
|
4269
|
+
// the cache will never be null in the browser
|
|
4270
|
+
var cache = useContext(EmotionCacheContext);
|
|
4271
|
+
return func(props, cache, ref);
|
|
4272
|
+
});
|
|
4273
|
+
};
|
|
4274
|
+
|
|
4275
|
+
var ThemeContext = /* #__PURE__ */React.createContext({});
|
|
4276
|
+
|
|
4277
|
+
// eslint-disable-next-line no-undef
|
|
4278
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
4279
|
+
|
|
4280
|
+
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
|
4281
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
4282
|
+
/* o */
|
|
4283
|
+
&& prop.charCodeAt(1) === 110
|
|
4284
|
+
/* n */
|
|
4285
|
+
&& prop.charCodeAt(2) < 91;
|
|
4286
|
+
}
|
|
4287
|
+
/* Z+1 */
|
|
4288
|
+
);
|
|
4289
|
+
|
|
4290
|
+
var testOmitPropsOnStringTag = isPropValid;
|
|
4291
|
+
|
|
4292
|
+
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
|
|
4293
|
+
return key !== 'theme';
|
|
4294
|
+
};
|
|
4295
|
+
|
|
4296
|
+
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
|
|
4297
|
+
return typeof tag === 'string' && // 96 is one less than the char code
|
|
4298
|
+
// for "a" so this is checking that
|
|
4299
|
+
// it's a lowercase character
|
|
4300
|
+
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
4301
|
+
};
|
|
4302
|
+
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
|
|
4303
|
+
var shouldForwardProp;
|
|
4304
|
+
|
|
4305
|
+
if (options) {
|
|
4306
|
+
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
4307
|
+
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
|
|
4308
|
+
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
4309
|
+
} : optionsShouldForwardProp;
|
|
4310
|
+
}
|
|
4311
|
+
|
|
4312
|
+
if (typeof shouldForwardProp !== 'function' && isReal) {
|
|
4313
|
+
shouldForwardProp = tag.__emotion_forwardProp;
|
|
4314
|
+
}
|
|
4315
|
+
|
|
4316
|
+
return shouldForwardProp;
|
|
4317
|
+
};
|
|
4318
|
+
|
|
4319
|
+
var Insertion = function Insertion(_ref) {
|
|
4320
|
+
var cache = _ref.cache,
|
|
4321
|
+
serialized = _ref.serialized,
|
|
4322
|
+
isStringTag = _ref.isStringTag;
|
|
4323
|
+
registerStyles(cache, serialized, isStringTag);
|
|
4324
|
+
useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
4325
|
+
return insertStyles(cache, serialized, isStringTag);
|
|
4326
|
+
});
|
|
4327
|
+
|
|
4328
|
+
return null;
|
|
4329
|
+
};
|
|
4330
|
+
|
|
4331
|
+
var createStyled$1 = function createStyled(tag, options) {
|
|
4332
|
+
|
|
4333
|
+
var isReal = tag.__emotion_real === tag;
|
|
4334
|
+
var baseTag = isReal && tag.__emotion_base || tag;
|
|
4335
|
+
var identifierName;
|
|
4336
|
+
var targetClassName;
|
|
4337
|
+
|
|
4338
|
+
if (options !== undefined) {
|
|
4339
|
+
identifierName = options.label;
|
|
4340
|
+
targetClassName = options.target;
|
|
4341
|
+
}
|
|
4342
|
+
|
|
4343
|
+
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
|
|
4344
|
+
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
|
4345
|
+
var shouldUseAs = !defaultShouldForwardProp('as');
|
|
4346
|
+
return function () {
|
|
4347
|
+
// eslint-disable-next-line prefer-rest-params
|
|
4348
|
+
var args = arguments;
|
|
4349
|
+
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
|
4350
|
+
|
|
4351
|
+
if (identifierName !== undefined) {
|
|
4352
|
+
styles.push("label:" + identifierName + ";");
|
|
4353
|
+
}
|
|
4354
|
+
|
|
4355
|
+
if (args[0] == null || args[0].raw === undefined) {
|
|
4356
|
+
// eslint-disable-next-line prefer-spread
|
|
4357
|
+
styles.push.apply(styles, args);
|
|
4358
|
+
} else {
|
|
4359
|
+
var templateStringsArr = args[0];
|
|
4360
|
+
|
|
4361
|
+
styles.push(templateStringsArr[0]);
|
|
4362
|
+
var len = args.length;
|
|
4363
|
+
var i = 1;
|
|
4364
|
+
|
|
4365
|
+
for (; i < len; i++) {
|
|
4366
|
+
|
|
4367
|
+
styles.push(args[i], templateStringsArr[i]);
|
|
4368
|
+
}
|
|
4369
|
+
}
|
|
4370
|
+
|
|
4371
|
+
var Styled = withEmotionCache(function (props, cache, ref) {
|
|
4372
|
+
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
4373
|
+
var className = '';
|
|
4374
|
+
var classInterpolations = [];
|
|
4375
|
+
var mergedProps = props;
|
|
4376
|
+
|
|
4377
|
+
if (props.theme == null) {
|
|
4378
|
+
mergedProps = {};
|
|
4379
|
+
|
|
4380
|
+
for (var key in props) {
|
|
4381
|
+
mergedProps[key] = props[key];
|
|
4382
|
+
}
|
|
4383
|
+
|
|
4384
|
+
mergedProps.theme = React.useContext(ThemeContext);
|
|
4385
|
+
}
|
|
4386
|
+
|
|
4387
|
+
if (typeof props.className === 'string') {
|
|
4388
|
+
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
4389
|
+
} else if (props.className != null) {
|
|
4390
|
+
className = props.className + " ";
|
|
4391
|
+
}
|
|
4392
|
+
|
|
4393
|
+
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
4394
|
+
className += cache.key + "-" + serialized.name;
|
|
4395
|
+
|
|
4396
|
+
if (targetClassName !== undefined) {
|
|
4397
|
+
className += " " + targetClassName;
|
|
4398
|
+
}
|
|
4399
|
+
|
|
4400
|
+
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
4401
|
+
var newProps = {};
|
|
4402
|
+
|
|
4403
|
+
for (var _key in props) {
|
|
4404
|
+
if (shouldUseAs && _key === 'as') continue;
|
|
4405
|
+
|
|
4406
|
+
if (finalShouldForwardProp(_key)) {
|
|
4407
|
+
newProps[_key] = props[_key];
|
|
4408
|
+
}
|
|
4409
|
+
}
|
|
4410
|
+
|
|
4411
|
+
newProps.className = className;
|
|
4412
|
+
|
|
4413
|
+
if (ref) {
|
|
4414
|
+
newProps.ref = ref;
|
|
4415
|
+
}
|
|
4416
|
+
|
|
4417
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {
|
|
4418
|
+
cache: cache,
|
|
4419
|
+
serialized: serialized,
|
|
4420
|
+
isStringTag: typeof FinalTag === 'string'
|
|
4421
|
+
}), /*#__PURE__*/React.createElement(FinalTag, newProps));
|
|
4422
|
+
});
|
|
4423
|
+
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
|
|
4424
|
+
Styled.defaultProps = tag.defaultProps;
|
|
4425
|
+
Styled.__emotion_real = Styled;
|
|
4426
|
+
Styled.__emotion_base = baseTag;
|
|
4427
|
+
Styled.__emotion_styles = styles;
|
|
4428
|
+
Styled.__emotion_forwardProp = shouldForwardProp;
|
|
4429
|
+
Object.defineProperty(Styled, 'toString', {
|
|
4430
|
+
value: function value() {
|
|
4431
|
+
|
|
4432
|
+
return "." + targetClassName;
|
|
4433
|
+
}
|
|
4434
|
+
});
|
|
4435
|
+
|
|
4436
|
+
Styled.withComponent = function (nextTag, nextOptions) {
|
|
4437
|
+
var newStyled = createStyled(nextTag, _extends({}, options, nextOptions, {
|
|
4438
|
+
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
4439
|
+
}));
|
|
4440
|
+
return newStyled.apply(void 0, styles);
|
|
4441
|
+
};
|
|
4442
|
+
|
|
4443
|
+
return Styled;
|
|
4444
|
+
};
|
|
4445
|
+
};
|
|
4446
|
+
|
|
4447
|
+
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
|
|
4448
|
+
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
|
|
4449
|
+
|
|
4450
|
+
// bind it to avoid mutating the original function
|
|
4451
|
+
var newStyled = createStyled$1.bind(null);
|
|
4452
|
+
tags.forEach(function (tagName) {
|
|
4453
|
+
newStyled[tagName] = newStyled(tagName);
|
|
4454
|
+
});
|
|
4455
|
+
|
|
3012
4456
|
/**
|
|
3013
4457
|
* @mui/styled-engine v7.1.1
|
|
3014
4458
|
*
|
|
@@ -3017,7 +4461,7 @@ function serializeStyles(args, registered, mergedProps) {
|
|
|
3017
4461
|
* LICENSE file in the root directory of this source tree.
|
|
3018
4462
|
*/
|
|
3019
4463
|
function styled$1(tag, options) {
|
|
3020
|
-
const stylesFactory =
|
|
4464
|
+
const stylesFactory = newStyled(tag, options);
|
|
3021
4465
|
if (process.env.NODE_ENV !== 'production') {
|
|
3022
4466
|
return (...styles) => {
|
|
3023
4467
|
const component = typeof tag === 'string' ? `"${tag}"` : 'component';
|