@kwantis-id3/frontend-library 0.1.2 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -1,3 +1,22 @@
1
+ function _mergeNamespaces(n, m) {
2
+ m.forEach(function (e) {
3
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
4
+ if (k !== 'default' && !(k in n)) {
5
+ var d = Object.getOwnPropertyDescriptor(e, k);
6
+ Object.defineProperty(n, k, d.get ? d : {
7
+ enumerable: true,
8
+ get: function () { return e[k]; }
9
+ });
10
+ }
11
+ });
12
+ });
13
+ return Object.freeze(n);
14
+ }
15
+
16
+ function getDefaultExportFromCjs (x) {
17
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
18
+ }
19
+
1
20
  var reactExports = {};
2
21
  var react = {
3
22
  get exports(){ return reactExports; },
@@ -2802,8 +2821,2294 @@ function requireReact_development () {
2802
2821
  }
2803
2822
  } (react));
2804
2823
 
2824
+ var React = /*@__PURE__*/getDefaultExportFromCjs(reactExports);
2825
+
2826
+ var React$1 = /*#__PURE__*/_mergeNamespaces({
2827
+ __proto__: null,
2828
+ default: React
2829
+ }, [reactExports]);
2830
+
2831
+ /*
2832
+
2833
+ Based off glamor's StyleSheet, thanks Sunil ❤️
2834
+
2835
+ high performance StyleSheet for css-in-js systems
2836
+
2837
+ - uses multiple style tags behind the scenes for millions of rules
2838
+ - uses `insertRule` for appending in production for *much* faster performance
2839
+
2840
+ // usage
2841
+
2842
+ import { StyleSheet } from '@emotion/sheet'
2843
+
2844
+ let styleSheet = new StyleSheet({ key: '', container: document.head })
2845
+
2846
+ styleSheet.insert('#box { border: 1px solid red; }')
2847
+ - appends a css rule into the stylesheet
2848
+
2849
+ styleSheet.flush()
2850
+ - empties the stylesheet of all its contents
2851
+
2852
+ */
2853
+ // $FlowFixMe
2854
+ function sheetForTag(tag) {
2855
+ if (tag.sheet) {
2856
+ // $FlowFixMe
2857
+ return tag.sheet;
2858
+ } // this weirdness brought to you by firefox
2859
+
2860
+ /* istanbul ignore next */
2861
+
2862
+
2863
+ for (var i = 0; i < document.styleSheets.length; i++) {
2864
+ if (document.styleSheets[i].ownerNode === tag) {
2865
+ // $FlowFixMe
2866
+ return document.styleSheets[i];
2867
+ }
2868
+ }
2869
+ }
2870
+
2871
+ function createStyleElement(options) {
2872
+ var tag = document.createElement('style');
2873
+ tag.setAttribute('data-emotion', options.key);
2874
+
2875
+ if (options.nonce !== undefined) {
2876
+ tag.setAttribute('nonce', options.nonce);
2877
+ }
2878
+
2879
+ tag.appendChild(document.createTextNode(''));
2880
+ tag.setAttribute('data-s', '');
2881
+ return tag;
2882
+ }
2883
+
2884
+ var StyleSheet = /*#__PURE__*/function () {
2885
+ // Using Node instead of HTMLElement since container may be a ShadowRoot
2886
+ function StyleSheet(options) {
2887
+ var _this = this;
2888
+
2889
+ this._insertTag = function (tag) {
2890
+ var before;
2891
+
2892
+ if (_this.tags.length === 0) {
2893
+ if (_this.insertionPoint) {
2894
+ before = _this.insertionPoint.nextSibling;
2895
+ } else if (_this.prepend) {
2896
+ before = _this.container.firstChild;
2897
+ } else {
2898
+ before = _this.before;
2899
+ }
2900
+ } else {
2901
+ before = _this.tags[_this.tags.length - 1].nextSibling;
2902
+ }
2903
+
2904
+ _this.container.insertBefore(tag, before);
2905
+
2906
+ _this.tags.push(tag);
2907
+ };
2908
+
2909
+ this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
2910
+ this.tags = [];
2911
+ this.ctr = 0;
2912
+ this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
2913
+
2914
+ this.key = options.key;
2915
+ this.container = options.container;
2916
+ this.prepend = options.prepend;
2917
+ this.insertionPoint = options.insertionPoint;
2918
+ this.before = null;
2919
+ }
2920
+
2921
+ var _proto = StyleSheet.prototype;
2922
+
2923
+ _proto.hydrate = function hydrate(nodes) {
2924
+ nodes.forEach(this._insertTag);
2925
+ };
2926
+
2927
+ _proto.insert = function insert(rule) {
2928
+ // the max length is how many rules we have per style tag, it's 65000 in speedy mode
2929
+ // it's 1 in dev because we insert source maps that map a single rule to a location
2930
+ // and you can only have one source map per style tag
2931
+ if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
2932
+ this._insertTag(createStyleElement(this));
2933
+ }
2934
+
2935
+ var tag = this.tags[this.tags.length - 1];
2936
+
2937
+ if (process.env.NODE_ENV !== 'production') {
2938
+ var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
2939
+
2940
+ if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
2941
+ // this would only cause problem in speedy mode
2942
+ // but we don't want enabling speedy to affect the observable behavior
2943
+ // so we report this error at all times
2944
+ console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
2945
+ }
2946
+ this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
2947
+ }
2948
+
2949
+ if (this.isSpeedy) {
2950
+ var sheet = sheetForTag(tag);
2951
+
2952
+ try {
2953
+ // this is the ultrafast version, works across browsers
2954
+ // the big drawback is that the css won't be editable in devtools
2955
+ sheet.insertRule(rule, sheet.cssRules.length);
2956
+ } catch (e) {
2957
+ if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
2958
+ console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
2959
+ }
2960
+ }
2961
+ } else {
2962
+ tag.appendChild(document.createTextNode(rule));
2963
+ }
2964
+
2965
+ this.ctr++;
2966
+ };
2967
+
2968
+ _proto.flush = function flush() {
2969
+ // $FlowFixMe
2970
+ this.tags.forEach(function (tag) {
2971
+ return tag.parentNode && tag.parentNode.removeChild(tag);
2972
+ });
2973
+ this.tags = [];
2974
+ this.ctr = 0;
2975
+
2976
+ if (process.env.NODE_ENV !== 'production') {
2977
+ this._alreadyInsertedOrderInsensitiveRule = false;
2978
+ }
2979
+ };
2980
+
2981
+ return StyleSheet;
2982
+ }();
2983
+
2984
+ var MS = '-ms-';
2985
+ var MOZ = '-moz-';
2986
+ var WEBKIT = '-webkit-';
2987
+
2988
+ var COMMENT = 'comm';
2989
+ var RULESET = 'rule';
2990
+ var DECLARATION = 'decl';
2991
+ var IMPORT = '@import';
2992
+ var KEYFRAMES = '@keyframes';
2993
+
2994
+ /**
2995
+ * @param {number}
2996
+ * @return {number}
2997
+ */
2998
+ var abs = Math.abs;
2999
+
3000
+ /**
3001
+ * @param {number}
3002
+ * @return {string}
3003
+ */
3004
+ var from = String.fromCharCode;
3005
+
3006
+ /**
3007
+ * @param {object}
3008
+ * @return {object}
3009
+ */
3010
+ var assign = Object.assign;
3011
+
3012
+ /**
3013
+ * @param {string} value
3014
+ * @param {number} length
3015
+ * @return {number}
3016
+ */
3017
+ function hash (value, length) {
3018
+ return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
3019
+ }
3020
+
3021
+ /**
3022
+ * @param {string} value
3023
+ * @return {string}
3024
+ */
3025
+ function trim (value) {
3026
+ return value.trim()
3027
+ }
3028
+
3029
+ /**
3030
+ * @param {string} value
3031
+ * @param {RegExp} pattern
3032
+ * @return {string?}
3033
+ */
3034
+ function match (value, pattern) {
3035
+ return (value = pattern.exec(value)) ? value[0] : value
3036
+ }
3037
+
3038
+ /**
3039
+ * @param {string} value
3040
+ * @param {(string|RegExp)} pattern
3041
+ * @param {string} replacement
3042
+ * @return {string}
3043
+ */
3044
+ function replace (value, pattern, replacement) {
3045
+ return value.replace(pattern, replacement)
3046
+ }
3047
+
3048
+ /**
3049
+ * @param {string} value
3050
+ * @param {string} search
3051
+ * @return {number}
3052
+ */
3053
+ function indexof (value, search) {
3054
+ return value.indexOf(search)
3055
+ }
3056
+
3057
+ /**
3058
+ * @param {string} value
3059
+ * @param {number} index
3060
+ * @return {number}
3061
+ */
3062
+ function charat (value, index) {
3063
+ return value.charCodeAt(index) | 0
3064
+ }
3065
+
3066
+ /**
3067
+ * @param {string} value
3068
+ * @param {number} begin
3069
+ * @param {number} end
3070
+ * @return {string}
3071
+ */
3072
+ function substr (value, begin, end) {
3073
+ return value.slice(begin, end)
3074
+ }
3075
+
3076
+ /**
3077
+ * @param {string} value
3078
+ * @return {number}
3079
+ */
3080
+ function strlen (value) {
3081
+ return value.length
3082
+ }
3083
+
3084
+ /**
3085
+ * @param {any[]} value
3086
+ * @return {number}
3087
+ */
3088
+ function sizeof (value) {
3089
+ return value.length
3090
+ }
3091
+
3092
+ /**
3093
+ * @param {any} value
3094
+ * @param {any[]} array
3095
+ * @return {any}
3096
+ */
3097
+ function append (value, array) {
3098
+ return array.push(value), value
3099
+ }
3100
+
3101
+ /**
3102
+ * @param {string[]} array
3103
+ * @param {function} callback
3104
+ * @return {string}
3105
+ */
3106
+ function combine (array, callback) {
3107
+ return array.map(callback).join('')
3108
+ }
3109
+
3110
+ var line = 1;
3111
+ var column = 1;
3112
+ var length = 0;
3113
+ var position = 0;
3114
+ var character = 0;
3115
+ var characters = '';
3116
+
3117
+ /**
3118
+ * @param {string} value
3119
+ * @param {object | null} root
3120
+ * @param {object | null} parent
3121
+ * @param {string} type
3122
+ * @param {string[] | string} props
3123
+ * @param {object[] | string} children
3124
+ * @param {number} length
3125
+ */
3126
+ function node (value, root, parent, type, props, children, length) {
3127
+ return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
3128
+ }
3129
+
3130
+ /**
3131
+ * @param {object} root
3132
+ * @param {object} props
3133
+ * @return {object}
3134
+ */
3135
+ function copy (root, props) {
3136
+ return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
3137
+ }
3138
+
3139
+ /**
3140
+ * @return {number}
3141
+ */
3142
+ function char () {
3143
+ return character
3144
+ }
3145
+
3146
+ /**
3147
+ * @return {number}
3148
+ */
3149
+ function prev () {
3150
+ character = position > 0 ? charat(characters, --position) : 0;
3151
+
3152
+ if (column--, character === 10)
3153
+ column = 1, line--;
3154
+
3155
+ return character
3156
+ }
3157
+
3158
+ /**
3159
+ * @return {number}
3160
+ */
3161
+ function next () {
3162
+ character = position < length ? charat(characters, position++) : 0;
3163
+
3164
+ if (column++, character === 10)
3165
+ column = 1, line++;
3166
+
3167
+ return character
3168
+ }
3169
+
3170
+ /**
3171
+ * @return {number}
3172
+ */
3173
+ function peek () {
3174
+ return charat(characters, position)
3175
+ }
3176
+
3177
+ /**
3178
+ * @return {number}
3179
+ */
3180
+ function caret () {
3181
+ return position
3182
+ }
3183
+
3184
+ /**
3185
+ * @param {number} begin
3186
+ * @param {number} end
3187
+ * @return {string}
3188
+ */
3189
+ function slice (begin, end) {
3190
+ return substr(characters, begin, end)
3191
+ }
3192
+
3193
+ /**
3194
+ * @param {number} type
3195
+ * @return {number}
3196
+ */
3197
+ function token (type) {
3198
+ switch (type) {
3199
+ // \0 \t \n \r \s whitespace token
3200
+ case 0: case 9: case 10: case 13: case 32:
3201
+ return 5
3202
+ // ! + , / > @ ~ isolate token
3203
+ case 33: case 43: case 44: case 47: case 62: case 64: case 126:
3204
+ // ; { } breakpoint token
3205
+ case 59: case 123: case 125:
3206
+ return 4
3207
+ // : accompanied token
3208
+ case 58:
3209
+ return 3
3210
+ // " ' ( [ opening delimit token
3211
+ case 34: case 39: case 40: case 91:
3212
+ return 2
3213
+ // ) ] closing delimit token
3214
+ case 41: case 93:
3215
+ return 1
3216
+ }
3217
+
3218
+ return 0
3219
+ }
3220
+
3221
+ /**
3222
+ * @param {string} value
3223
+ * @return {any[]}
3224
+ */
3225
+ function alloc (value) {
3226
+ return line = column = 1, length = strlen(characters = value), position = 0, []
3227
+ }
3228
+
3229
+ /**
3230
+ * @param {any} value
3231
+ * @return {any}
3232
+ */
3233
+ function dealloc (value) {
3234
+ return characters = '', value
3235
+ }
3236
+
3237
+ /**
3238
+ * @param {number} type
3239
+ * @return {string}
3240
+ */
3241
+ function delimit (type) {
3242
+ return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
3243
+ }
3244
+
3245
+ /**
3246
+ * @param {number} type
3247
+ * @return {string}
3248
+ */
3249
+ function whitespace (type) {
3250
+ while (character = peek())
3251
+ if (character < 33)
3252
+ next();
3253
+ else
3254
+ break
3255
+
3256
+ return token(type) > 2 || token(character) > 3 ? '' : ' '
3257
+ }
3258
+
3259
+ /**
3260
+ * @param {number} index
3261
+ * @param {number} count
3262
+ * @return {string}
3263
+ */
3264
+ function escaping (index, count) {
3265
+ while (--count && next())
3266
+ // not 0-9 A-F a-f
3267
+ if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
3268
+ break
3269
+
3270
+ return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
3271
+ }
3272
+
3273
+ /**
3274
+ * @param {number} type
3275
+ * @return {number}
3276
+ */
3277
+ function delimiter (type) {
3278
+ while (next())
3279
+ switch (character) {
3280
+ // ] ) " '
3281
+ case type:
3282
+ return position
3283
+ // " '
3284
+ case 34: case 39:
3285
+ if (type !== 34 && type !== 39)
3286
+ delimiter(character);
3287
+ break
3288
+ // (
3289
+ case 40:
3290
+ if (type === 41)
3291
+ delimiter(type);
3292
+ break
3293
+ // \
3294
+ case 92:
3295
+ next();
3296
+ break
3297
+ }
3298
+
3299
+ return position
3300
+ }
3301
+
3302
+ /**
3303
+ * @param {number} type
3304
+ * @param {number} index
3305
+ * @return {number}
3306
+ */
3307
+ function commenter (type, index) {
3308
+ while (next())
3309
+ // //
3310
+ if (type + character === 47 + 10)
3311
+ break
3312
+ // /*
3313
+ else if (type + character === 42 + 42 && peek() === 47)
3314
+ break
3315
+
3316
+ return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
3317
+ }
3318
+
3319
+ /**
3320
+ * @param {number} index
3321
+ * @return {string}
3322
+ */
3323
+ function identifier (index) {
3324
+ while (!token(peek()))
3325
+ next();
3326
+
3327
+ return slice(index, position)
3328
+ }
3329
+
3330
+ /**
3331
+ * @param {string} value
3332
+ * @return {object[]}
3333
+ */
3334
+ function compile (value) {
3335
+ return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
3336
+ }
3337
+
3338
+ /**
3339
+ * @param {string} value
3340
+ * @param {object} root
3341
+ * @param {object?} parent
3342
+ * @param {string[]} rule
3343
+ * @param {string[]} rules
3344
+ * @param {string[]} rulesets
3345
+ * @param {number[]} pseudo
3346
+ * @param {number[]} points
3347
+ * @param {string[]} declarations
3348
+ * @return {object}
3349
+ */
3350
+ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
3351
+ var index = 0;
3352
+ var offset = 0;
3353
+ var length = pseudo;
3354
+ var atrule = 0;
3355
+ var property = 0;
3356
+ var previous = 0;
3357
+ var variable = 1;
3358
+ var scanning = 1;
3359
+ var ampersand = 1;
3360
+ var character = 0;
3361
+ var type = '';
3362
+ var props = rules;
3363
+ var children = rulesets;
3364
+ var reference = rule;
3365
+ var characters = type;
3366
+
3367
+ while (scanning)
3368
+ switch (previous = character, character = next()) {
3369
+ // (
3370
+ case 40:
3371
+ if (previous != 108 && charat(characters, length - 1) == 58) {
3372
+ if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
3373
+ ampersand = -1;
3374
+ break
3375
+ }
3376
+ // " ' [
3377
+ case 34: case 39: case 91:
3378
+ characters += delimit(character);
3379
+ break
3380
+ // \t \n \r \s
3381
+ case 9: case 10: case 13: case 32:
3382
+ characters += whitespace(previous);
3383
+ break
3384
+ // \
3385
+ case 92:
3386
+ characters += escaping(caret() - 1, 7);
3387
+ continue
3388
+ // /
3389
+ case 47:
3390
+ switch (peek()) {
3391
+ case 42: case 47:
3392
+ append(comment(commenter(next(), caret()), root, parent), declarations);
3393
+ break
3394
+ default:
3395
+ characters += '/';
3396
+ }
3397
+ break
3398
+ // {
3399
+ case 123 * variable:
3400
+ points[index++] = strlen(characters) * ampersand;
3401
+ // } ; \0
3402
+ case 125 * variable: case 59: case 0:
3403
+ switch (character) {
3404
+ // \0 }
3405
+ case 0: case 125: scanning = 0;
3406
+ // ;
3407
+ case 59 + offset:
3408
+ if (property > 0 && (strlen(characters) - length))
3409
+ append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
3410
+ break
3411
+ // @ ;
3412
+ case 59: characters += ';';
3413
+ // { rule/at-rule
3414
+ default:
3415
+ append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
3416
+
3417
+ if (character === 123)
3418
+ if (offset === 0)
3419
+ parse(characters, root, reference, reference, props, rulesets, length, points, children);
3420
+ else
3421
+ switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
3422
+ // d m s
3423
+ case 100: case 109: case 115:
3424
+ 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);
3425
+ break
3426
+ default:
3427
+ parse(characters, reference, reference, reference, [''], children, 0, points, children);
3428
+ }
3429
+ }
3430
+
3431
+ index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
3432
+ break
3433
+ // :
3434
+ case 58:
3435
+ length = 1 + strlen(characters), property = previous;
3436
+ default:
3437
+ if (variable < 1)
3438
+ if (character == 123)
3439
+ --variable;
3440
+ else if (character == 125 && variable++ == 0 && prev() == 125)
3441
+ continue
3442
+
3443
+ switch (characters += from(character), character * variable) {
3444
+ // &
3445
+ case 38:
3446
+ ampersand = offset > 0 ? 1 : (characters += '\f', -1);
3447
+ break
3448
+ // ,
3449
+ case 44:
3450
+ points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
3451
+ break
3452
+ // @
3453
+ case 64:
3454
+ // -
3455
+ if (peek() === 45)
3456
+ characters += delimit(next());
3457
+
3458
+ atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
3459
+ break
3460
+ // -
3461
+ case 45:
3462
+ if (previous === 45 && strlen(characters) == 2)
3463
+ variable = 0;
3464
+ }
3465
+ }
3466
+
3467
+ return rulesets
3468
+ }
3469
+
3470
+ /**
3471
+ * @param {string} value
3472
+ * @param {object} root
3473
+ * @param {object?} parent
3474
+ * @param {number} index
3475
+ * @param {number} offset
3476
+ * @param {string[]} rules
3477
+ * @param {number[]} points
3478
+ * @param {string} type
3479
+ * @param {string[]} props
3480
+ * @param {string[]} children
3481
+ * @param {number} length
3482
+ * @return {object}
3483
+ */
3484
+ function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
3485
+ var post = offset - 1;
3486
+ var rule = offset === 0 ? rules : [''];
3487
+ var size = sizeof(rule);
3488
+
3489
+ for (var i = 0, j = 0, k = 0; i < index; ++i)
3490
+ for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
3491
+ if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
3492
+ props[k++] = z;
3493
+
3494
+ return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
3495
+ }
3496
+
3497
+ /**
3498
+ * @param {number} value
3499
+ * @param {object} root
3500
+ * @param {object?} parent
3501
+ * @return {object}
3502
+ */
3503
+ function comment (value, root, parent) {
3504
+ return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
3505
+ }
3506
+
3507
+ /**
3508
+ * @param {string} value
3509
+ * @param {object} root
3510
+ * @param {object?} parent
3511
+ * @param {number} length
3512
+ * @return {object}
3513
+ */
3514
+ function declaration (value, root, parent, length) {
3515
+ return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
3516
+ }
3517
+
3518
+ /**
3519
+ * @param {object[]} children
3520
+ * @param {function} callback
3521
+ * @return {string}
3522
+ */
3523
+ function serialize (children, callback) {
3524
+ var output = '';
3525
+ var length = sizeof(children);
3526
+
3527
+ for (var i = 0; i < length; i++)
3528
+ output += callback(children[i], i, children, callback) || '';
3529
+
3530
+ return output
3531
+ }
3532
+
3533
+ /**
3534
+ * @param {object} element
3535
+ * @param {number} index
3536
+ * @param {object[]} children
3537
+ * @param {function} callback
3538
+ * @return {string}
3539
+ */
3540
+ function stringify (element, index, children, callback) {
3541
+ switch (element.type) {
3542
+ case IMPORT: case DECLARATION: return element.return = element.return || element.value
3543
+ case COMMENT: return ''
3544
+ case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
3545
+ case RULESET: element.value = element.props.join(',');
3546
+ }
3547
+
3548
+ return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
3549
+ }
3550
+
3551
+ /**
3552
+ * @param {function[]} collection
3553
+ * @return {function}
3554
+ */
3555
+ function middleware (collection) {
3556
+ var length = sizeof(collection);
3557
+
3558
+ return function (element, index, children, callback) {
3559
+ var output = '';
3560
+
3561
+ for (var i = 0; i < length; i++)
3562
+ output += collection[i](element, index, children, callback) || '';
3563
+
3564
+ return output
3565
+ }
3566
+ }
3567
+
3568
+ /**
3569
+ * @param {function} callback
3570
+ * @return {function}
3571
+ */
3572
+ function rulesheet (callback) {
3573
+ return function (element) {
3574
+ if (!element.root)
3575
+ if (element = element.return)
3576
+ callback(element);
3577
+ }
3578
+ }
3579
+
3580
+ var weakMemoize = function weakMemoize(func) {
3581
+ // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
3582
+ var cache = new WeakMap();
3583
+ return function (arg) {
3584
+ if (cache.has(arg)) {
3585
+ // $FlowFixMe
3586
+ return cache.get(arg);
3587
+ }
3588
+
3589
+ var ret = func(arg);
3590
+ cache.set(arg, ret);
3591
+ return ret;
3592
+ };
3593
+ };
3594
+
3595
+ function memoize(fn) {
3596
+ var cache = Object.create(null);
3597
+ return function (arg) {
3598
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
3599
+ return cache[arg];
3600
+ };
3601
+ }
3602
+
3603
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
3604
+ var previous = 0;
3605
+ var character = 0;
3606
+
3607
+ while (true) {
3608
+ previous = character;
3609
+ character = peek(); // &\f
3610
+
3611
+ if (previous === 38 && character === 12) {
3612
+ points[index] = 1;
3613
+ }
3614
+
3615
+ if (token(character)) {
3616
+ break;
3617
+ }
3618
+
3619
+ next();
3620
+ }
3621
+
3622
+ return slice(begin, position);
3623
+ };
3624
+
3625
+ var toRules = function toRules(parsed, points) {
3626
+ // pretend we've started with a comma
3627
+ var index = -1;
3628
+ var character = 44;
3629
+
3630
+ do {
3631
+ switch (token(character)) {
3632
+ case 0:
3633
+ // &\f
3634
+ if (character === 38 && peek() === 12) {
3635
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
3636
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
3637
+ // and when it should just concatenate the outer and inner selectors
3638
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
3639
+ points[index] = 1;
3640
+ }
3641
+
3642
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
3643
+ break;
3644
+
3645
+ case 2:
3646
+ parsed[index] += delimit(character);
3647
+ break;
3648
+
3649
+ case 4:
3650
+ // comma
3651
+ if (character === 44) {
3652
+ // colon
3653
+ parsed[++index] = peek() === 58 ? '&\f' : '';
3654
+ points[index] = parsed[index].length;
3655
+ break;
3656
+ }
3657
+
3658
+ // fallthrough
3659
+
3660
+ default:
3661
+ parsed[index] += from(character);
3662
+ }
3663
+ } while (character = next());
3664
+
3665
+ return parsed;
3666
+ };
3667
+
3668
+ var getRules = function getRules(value, points) {
3669
+ return dealloc(toRules(alloc(value), points));
3670
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
3671
+
3672
+
3673
+ var fixedElements = /* #__PURE__ */new WeakMap();
3674
+ var compat = function compat(element) {
3675
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
3676
+ // negative .length indicates that this rule has been already prefixed
3677
+ element.length < 1) {
3678
+ return;
3679
+ }
3680
+
3681
+ var value = element.value,
3682
+ parent = element.parent;
3683
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
3684
+
3685
+ while (parent.type !== 'rule') {
3686
+ parent = parent.parent;
3687
+ if (!parent) return;
3688
+ } // short-circuit for the simplest case
3689
+
3690
+
3691
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
3692
+ /* colon */
3693
+ && !fixedElements.get(parent)) {
3694
+ return;
3695
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
3696
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
3697
+
3698
+
3699
+ if (isImplicitRule) {
3700
+ return;
3701
+ }
3702
+
3703
+ fixedElements.set(element, true);
3704
+ var points = [];
3705
+ var rules = getRules(value, points);
3706
+ var parentRules = parent.props;
3707
+
3708
+ for (var i = 0, k = 0; i < rules.length; i++) {
3709
+ for (var j = 0; j < parentRules.length; j++, k++) {
3710
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
3711
+ }
3712
+ }
3713
+ };
3714
+ var removeLabel = function removeLabel(element) {
3715
+ if (element.type === 'decl') {
3716
+ var value = element.value;
3717
+
3718
+ if ( // charcode for l
3719
+ value.charCodeAt(0) === 108 && // charcode for b
3720
+ value.charCodeAt(2) === 98) {
3721
+ // this ignores label
3722
+ element["return"] = '';
3723
+ element.value = '';
3724
+ }
3725
+ }
3726
+ };
3727
+ var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
3728
+
3729
+ var isIgnoringComment = function isIgnoringComment(element) {
3730
+ return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
3731
+ };
3732
+
3733
+ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
3734
+ return function (element, index, children) {
3735
+ if (element.type !== 'rule' || cache.compat) return;
3736
+ var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
3737
+
3738
+ if (unsafePseudoClasses) {
3739
+ var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
3740
+ //
3741
+ // considering this input:
3742
+ // .a {
3743
+ // .b /* comm */ {}
3744
+ // color: hotpink;
3745
+ // }
3746
+ // we get output corresponding to this:
3747
+ // .a {
3748
+ // & {
3749
+ // /* comm */
3750
+ // color: hotpink;
3751
+ // }
3752
+ // .b {}
3753
+ // }
3754
+
3755
+ var commentContainer = isNested ? element.parent.children : // global rule at the root level
3756
+ children;
3757
+
3758
+ for (var i = commentContainer.length - 1; i >= 0; i--) {
3759
+ var node = commentContainer[i];
3760
+
3761
+ if (node.line < element.line) {
3762
+ break;
3763
+ } // it is quite weird but comments are *usually* put at `column: element.column - 1`
3764
+ // so we seek *from the end* for the node that is earlier than the rule's `element` and check that
3765
+ // this will also match inputs like this:
3766
+ // .a {
3767
+ // /* comm */
3768
+ // .b {}
3769
+ // }
3770
+ //
3771
+ // but that is fine
3772
+ //
3773
+ // it would be the easiest to change the placement of the comment to be the first child of the rule:
3774
+ // .a {
3775
+ // .b { /* comm */ }
3776
+ // }
3777
+ // with such inputs we wouldn't have to search for the comment at all
3778
+ // TODO: consider changing this comment placement in the next major version
3779
+
3780
+
3781
+ if (node.column < element.column) {
3782
+ if (isIgnoringComment(node)) {
3783
+ return;
3784
+ }
3785
+
3786
+ break;
3787
+ }
3788
+ }
3789
+
3790
+ unsafePseudoClasses.forEach(function (unsafePseudoClass) {
3791
+ console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
3792
+ });
3793
+ }
3794
+ };
3795
+ };
3796
+
3797
+ var isImportRule = function isImportRule(element) {
3798
+ return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
3799
+ };
3800
+
3801
+ var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
3802
+ for (var i = index - 1; i >= 0; i--) {
3803
+ if (!isImportRule(children[i])) {
3804
+ return true;
3805
+ }
3806
+ }
3807
+
3808
+ return false;
3809
+ }; // use this to remove incorrect elements from further processing
3810
+ // so they don't get handed to the `sheet` (or anything else)
3811
+ // as that could potentially lead to additional logs which in turn could be overhelming to the user
3812
+
3813
+
3814
+ var nullifyElement = function nullifyElement(element) {
3815
+ element.type = '';
3816
+ element.value = '';
3817
+ element["return"] = '';
3818
+ element.children = '';
3819
+ element.props = '';
3820
+ };
3821
+
3822
+ var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
3823
+ if (!isImportRule(element)) {
3824
+ return;
3825
+ }
3826
+
3827
+ if (element.parent) {
3828
+ console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
3829
+ nullifyElement(element);
3830
+ } else if (isPrependedWithRegularRules(index, children)) {
3831
+ console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
3832
+ nullifyElement(element);
3833
+ }
3834
+ };
3835
+
3836
+ /* eslint-disable no-fallthrough */
3837
+
3838
+ function prefix(value, length) {
3839
+ switch (hash(value, length)) {
3840
+ // color-adjust
3841
+ case 5103:
3842
+ return WEBKIT + 'print-' + value + value;
3843
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
3844
+
3845
+ case 5737:
3846
+ case 4201:
3847
+ case 3177:
3848
+ case 3433:
3849
+ case 1641:
3850
+ case 4457:
3851
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
3852
+
3853
+ case 5572:
3854
+ case 6356:
3855
+ case 5844:
3856
+ case 3191:
3857
+ case 6645:
3858
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
3859
+
3860
+ case 6391:
3861
+ case 5879:
3862
+ case 5623:
3863
+ case 6135:
3864
+ case 4599:
3865
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
3866
+
3867
+ case 4215:
3868
+ case 6389:
3869
+ case 5109:
3870
+ case 5365:
3871
+ case 5621:
3872
+ case 3829:
3873
+ return WEBKIT + value + value;
3874
+ // appearance, user-select, transform, hyphens, text-size-adjust
3875
+
3876
+ case 5349:
3877
+ case 4246:
3878
+ case 4810:
3879
+ case 6968:
3880
+ case 2756:
3881
+ return WEBKIT + value + MOZ + value + MS + value + value;
3882
+ // flex, flex-direction
3883
+
3884
+ case 6828:
3885
+ case 4268:
3886
+ return WEBKIT + value + MS + value + value;
3887
+ // order
3888
+
3889
+ case 6165:
3890
+ return WEBKIT + value + MS + 'flex-' + value + value;
3891
+ // align-items
3892
+
3893
+ case 5187:
3894
+ return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
3895
+ // align-self
3896
+
3897
+ case 5443:
3898
+ return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
3899
+ // align-content
3900
+
3901
+ case 4675:
3902
+ return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
3903
+ // flex-shrink
3904
+
3905
+ case 5548:
3906
+ return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
3907
+ // flex-basis
3908
+
3909
+ case 5292:
3910
+ return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
3911
+ // flex-grow
3912
+
3913
+ case 6060:
3914
+ return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
3915
+ // transition
3916
+
3917
+ case 4554:
3918
+ return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
3919
+ // cursor
3920
+
3921
+ case 6187:
3922
+ return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
3923
+ // background, background-image
3924
+
3925
+ case 5495:
3926
+ case 3959:
3927
+ return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
3928
+ // justify-content
3929
+
3930
+ case 4968:
3931
+ return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
3932
+ // (margin|padding)-inline-(start|end)
3933
+
3934
+ case 4095:
3935
+ case 3583:
3936
+ case 4068:
3937
+ case 2532:
3938
+ return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
3939
+ // (min|max)?(width|height|inline-size|block-size)
3940
+
3941
+ case 8116:
3942
+ case 7059:
3943
+ case 5753:
3944
+ case 5535:
3945
+ case 5445:
3946
+ case 5701:
3947
+ case 4933:
3948
+ case 4677:
3949
+ case 5533:
3950
+ case 5789:
3951
+ case 5021:
3952
+ case 4765:
3953
+ // stretch, max-content, min-content, fill-available
3954
+ if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
3955
+ // (m)ax-content, (m)in-content
3956
+ case 109:
3957
+ // -
3958
+ if (charat(value, length + 4) !== 45) break;
3959
+ // (f)ill-available, (f)it-content
3960
+
3961
+ case 102:
3962
+ return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
3963
+ // (s)tretch
3964
+
3965
+ case 115:
3966
+ return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
3967
+ }
3968
+ break;
3969
+ // position: sticky
3970
+
3971
+ case 4949:
3972
+ // (s)ticky?
3973
+ if (charat(value, length + 1) !== 115) break;
3974
+ // display: (flex|inline-flex)
3975
+
3976
+ case 6444:
3977
+ switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
3978
+ // stic(k)y
3979
+ case 107:
3980
+ return replace(value, ':', ':' + WEBKIT) + value;
3981
+ // (inline-)?fl(e)x
3982
+
3983
+ case 101:
3984
+ return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
3985
+ }
3986
+
3987
+ break;
3988
+ // writing-mode
3989
+
3990
+ case 5936:
3991
+ switch (charat(value, length + 11)) {
3992
+ // vertical-l(r)
3993
+ case 114:
3994
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
3995
+ // vertical-r(l)
3996
+
3997
+ case 108:
3998
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
3999
+ // horizontal(-)tb
4000
+
4001
+ case 45:
4002
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
4003
+ }
4004
+
4005
+ return WEBKIT + value + MS + value + value;
4006
+ }
4007
+
4008
+ return value;
4009
+ }
4010
+
4011
+ var prefixer = function prefixer(element, index, children, callback) {
4012
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
4013
+ case DECLARATION:
4014
+ element["return"] = prefix(element.value, element.length);
4015
+ break;
4016
+
4017
+ case KEYFRAMES:
4018
+ return serialize([copy(element, {
4019
+ value: replace(element.value, '@', '@' + WEBKIT)
4020
+ })], callback);
4021
+
4022
+ case RULESET:
4023
+ if (element.length) return combine(element.props, function (value) {
4024
+ switch (match(value, /(::plac\w+|:read-\w+)/)) {
4025
+ // :read-(only|write)
4026
+ case ':read-only':
4027
+ case ':read-write':
4028
+ return serialize([copy(element, {
4029
+ props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
4030
+ })], callback);
4031
+ // :placeholder
4032
+
4033
+ case '::placeholder':
4034
+ return serialize([copy(element, {
4035
+ props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
4036
+ }), copy(element, {
4037
+ props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
4038
+ }), copy(element, {
4039
+ props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
4040
+ })], callback);
4041
+ }
4042
+
4043
+ return '';
4044
+ });
4045
+ }
4046
+ };
4047
+
4048
+ var isBrowser$4 = typeof document !== 'undefined';
4049
+ var getServerStylisCache = isBrowser$4 ? undefined : weakMemoize(function () {
4050
+ return memoize(function () {
4051
+ var cache = {};
4052
+ return function (name) {
4053
+ return cache[name];
4054
+ };
4055
+ });
4056
+ });
4057
+ var defaultStylisPlugins = [prefixer];
4058
+
4059
+ var createCache = function createCache(options) {
4060
+ var key = options.key;
4061
+
4062
+ if (process.env.NODE_ENV !== 'production' && !key) {
4063
+ throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
4064
+ }
4065
+
4066
+ if (isBrowser$4 && key === 'css') {
4067
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
4068
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
4069
+ // note this very very intentionally targets all style elements regardless of the key to ensure
4070
+ // that creating a cache works inside of render of a React component
4071
+
4072
+ Array.prototype.forEach.call(ssrStyles, function (node) {
4073
+ // we want to only move elements which have a space in the data-emotion attribute value
4074
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
4075
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
4076
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
4077
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
4078
+ // will not result in the Emotion 10 styles being destroyed
4079
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
4080
+
4081
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
4082
+ return;
4083
+ }
4084
+ document.head.appendChild(node);
4085
+ node.setAttribute('data-s', '');
4086
+ });
4087
+ }
4088
+
4089
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
4090
+
4091
+ if (process.env.NODE_ENV !== 'production') {
4092
+ // $FlowFixMe
4093
+ if (/[^a-z-]/.test(key)) {
4094
+ throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
4095
+ }
4096
+ }
4097
+
4098
+ var inserted = {};
4099
+ var container;
4100
+ var nodesToHydrate = [];
4101
+
4102
+ if (isBrowser$4) {
4103
+ container = options.container || document.head;
4104
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
4105
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
4106
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
4107
+ var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
4108
+
4109
+ for (var i = 1; i < attrib.length; i++) {
4110
+ inserted[attrib[i]] = true;
4111
+ }
4112
+
4113
+ nodesToHydrate.push(node);
4114
+ });
4115
+ }
4116
+
4117
+ var _insert;
4118
+
4119
+ var omnipresentPlugins = [compat, removeLabel];
4120
+
4121
+ if (process.env.NODE_ENV !== 'production') {
4122
+ omnipresentPlugins.push(createUnsafeSelectorsAlarm({
4123
+ get compat() {
4124
+ return cache.compat;
4125
+ }
4126
+
4127
+ }), incorrectImportAlarm);
4128
+ }
4129
+
4130
+ if (isBrowser$4) {
4131
+ var currentSheet;
4132
+ var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {
4133
+ if (!element.root) {
4134
+ if (element["return"]) {
4135
+ currentSheet.insert(element["return"]);
4136
+ } else if (element.value && element.type !== COMMENT) {
4137
+ // insert empty rule in non-production environments
4138
+ // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
4139
+ currentSheet.insert(element.value + "{}");
4140
+ }
4141
+ }
4142
+ } : rulesheet(function (rule) {
4143
+ currentSheet.insert(rule);
4144
+ })];
4145
+ var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
4146
+
4147
+ var stylis = function stylis(styles) {
4148
+ return serialize(compile(styles), serializer);
4149
+ };
4150
+
4151
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
4152
+ currentSheet = sheet;
4153
+
4154
+ if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
4155
+ currentSheet = {
4156
+ insert: function insert(rule) {
4157
+ sheet.insert(rule + serialized.map);
4158
+ }
4159
+ };
4160
+ }
4161
+
4162
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
4163
+
4164
+ if (shouldCache) {
4165
+ cache.inserted[serialized.name] = true;
4166
+ }
4167
+ };
4168
+ } else {
4169
+ var _finalizingPlugins = [stringify];
4170
+
4171
+ var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
4172
+
4173
+ var _stylis = function _stylis(styles) {
4174
+ return serialize(compile(styles), _serializer);
4175
+ }; // $FlowFixMe
4176
+
4177
+
4178
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
4179
+
4180
+ var getRules = function getRules(selector, serialized) {
4181
+ var name = serialized.name;
4182
+
4183
+ if (serverStylisCache[name] === undefined) {
4184
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
4185
+ }
4186
+
4187
+ return serverStylisCache[name];
4188
+ };
4189
+
4190
+ _insert = function _insert(selector, serialized, sheet, shouldCache) {
4191
+ var name = serialized.name;
4192
+ var rules = getRules(selector, serialized);
4193
+
4194
+ if (cache.compat === undefined) {
4195
+ // in regular mode, we don't set the styles on the inserted cache
4196
+ // since we don't need to and that would be wasting memory
4197
+ // we return them so that they are rendered in a style tag
4198
+ if (shouldCache) {
4199
+ cache.inserted[name] = true;
4200
+ }
4201
+
4202
+ if ( // using === development instead of !== production
4203
+ // because if people do ssr in tests, the source maps showing up would be annoying
4204
+ process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
4205
+ return rules + serialized.map;
4206
+ }
4207
+
4208
+ return rules;
4209
+ } else {
4210
+ // in compat mode, we put the styles on the inserted cache so
4211
+ // that emotion-server can pull out the styles
4212
+ // except when we don't want to cache it which was in Global but now
4213
+ // is nowhere but we don't want to do a major right now
4214
+ // and just in case we're going to leave the case here
4215
+ // it's also not affecting client side bundle size
4216
+ // so it's really not a big deal
4217
+ if (shouldCache) {
4218
+ cache.inserted[name] = rules;
4219
+ } else {
4220
+ return rules;
4221
+ }
4222
+ }
4223
+ };
4224
+ }
4225
+
4226
+ var cache = {
4227
+ key: key,
4228
+ sheet: new StyleSheet({
4229
+ key: key,
4230
+ container: container,
4231
+ nonce: options.nonce,
4232
+ speedy: options.speedy,
4233
+ prepend: options.prepend,
4234
+ insertionPoint: options.insertionPoint
4235
+ }),
4236
+ nonce: options.nonce,
4237
+ inserted: inserted,
4238
+ registered: {},
4239
+ insert: _insert
4240
+ };
4241
+ cache.sheet.hydrate(nodesToHydrate);
4242
+ return cache;
4243
+ };
4244
+
4245
+ function _extends() {
4246
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
4247
+ for (var i = 1; i < arguments.length; i++) {
4248
+ var source = arguments[i];
4249
+ for (var key in source) {
4250
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
4251
+ target[key] = source[key];
4252
+ }
4253
+ }
4254
+ }
4255
+ return target;
4256
+ };
4257
+ return _extends.apply(this, arguments);
4258
+ }
4259
+
4260
+ var isBrowser$3 = typeof document !== 'undefined';
4261
+ function getRegisteredStyles(registered, registeredStyles, classNames) {
4262
+ var rawClassName = '';
4263
+ classNames.split(' ').forEach(function (className) {
4264
+ if (registered[className] !== undefined) {
4265
+ registeredStyles.push(registered[className] + ";");
4266
+ } else {
4267
+ rawClassName += className + " ";
4268
+ }
4269
+ });
4270
+ return rawClassName;
4271
+ }
4272
+ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
4273
+ var className = cache.key + "-" + serialized.name;
4274
+
4275
+ if ( // we only need to add the styles to the registered cache if the
4276
+ // class name could be used further down
4277
+ // the tree but if it's a string tag, we know it won't
4278
+ // so we don't have to add it to registered cache.
4279
+ // this improves memory usage since we can avoid storing the whole style string
4280
+ (isStringTag === false || // we need to always store it if we're in compat mode and
4281
+ // in node since emotion-server relies on whether a style is in
4282
+ // the registered cache to know whether a style is global or not
4283
+ // also, note that this check will be dead code eliminated in the browser
4284
+ isBrowser$3 === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
4285
+ cache.registered[className] = serialized.styles;
4286
+ }
4287
+ };
4288
+ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
4289
+ registerStyles(cache, serialized, isStringTag);
4290
+ var className = cache.key + "-" + serialized.name;
4291
+
4292
+ if (cache.inserted[serialized.name] === undefined) {
4293
+ var stylesForSSR = '';
4294
+ var current = serialized;
4295
+
4296
+ do {
4297
+ var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
4298
+
4299
+ if (!isBrowser$3 && maybeStyles !== undefined) {
4300
+ stylesForSSR += maybeStyles;
4301
+ }
4302
+
4303
+ current = current.next;
4304
+ } while (current !== undefined);
4305
+
4306
+ if (!isBrowser$3 && stylesForSSR.length !== 0) {
4307
+ return stylesForSSR;
4308
+ }
4309
+ }
4310
+ };
4311
+
4312
+ /* eslint-disable */
4313
+ // Inspired by https://github.com/garycourt/murmurhash-js
4314
+ // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
4315
+ function murmur2(str) {
4316
+ // 'm' and 'r' are mixing constants generated offline.
4317
+ // They're not really 'magic', they just happen to work well.
4318
+ // const m = 0x5bd1e995;
4319
+ // const r = 24;
4320
+ // Initialize the hash
4321
+ var h = 0; // Mix 4 bytes at a time into the hash
4322
+
4323
+ var k,
4324
+ i = 0,
4325
+ len = str.length;
4326
+
4327
+ for (; len >= 4; ++i, len -= 4) {
4328
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
4329
+ k =
4330
+ /* Math.imul(k, m): */
4331
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
4332
+ k ^=
4333
+ /* k >>> r: */
4334
+ k >>> 24;
4335
+ h =
4336
+ /* Math.imul(k, m): */
4337
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
4338
+ /* Math.imul(h, m): */
4339
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
4340
+ } // Handle the last few bytes of the input array
4341
+
4342
+
4343
+ switch (len) {
4344
+ case 3:
4345
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
4346
+
4347
+ case 2:
4348
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
4349
+
4350
+ case 1:
4351
+ h ^= str.charCodeAt(i) & 0xff;
4352
+ h =
4353
+ /* Math.imul(h, m): */
4354
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
4355
+ } // Do a few final mixes of the hash to ensure the last few
4356
+ // bytes are well-incorporated.
4357
+
4358
+
4359
+ h ^= h >>> 13;
4360
+ h =
4361
+ /* Math.imul(h, m): */
4362
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
4363
+ return ((h ^ h >>> 15) >>> 0).toString(36);
4364
+ }
4365
+
4366
+ var unitlessKeys = {
4367
+ animationIterationCount: 1,
4368
+ borderImageOutset: 1,
4369
+ borderImageSlice: 1,
4370
+ borderImageWidth: 1,
4371
+ boxFlex: 1,
4372
+ boxFlexGroup: 1,
4373
+ boxOrdinalGroup: 1,
4374
+ columnCount: 1,
4375
+ columns: 1,
4376
+ flex: 1,
4377
+ flexGrow: 1,
4378
+ flexPositive: 1,
4379
+ flexShrink: 1,
4380
+ flexNegative: 1,
4381
+ flexOrder: 1,
4382
+ gridRow: 1,
4383
+ gridRowEnd: 1,
4384
+ gridRowSpan: 1,
4385
+ gridRowStart: 1,
4386
+ gridColumn: 1,
4387
+ gridColumnEnd: 1,
4388
+ gridColumnSpan: 1,
4389
+ gridColumnStart: 1,
4390
+ msGridRow: 1,
4391
+ msGridRowSpan: 1,
4392
+ msGridColumn: 1,
4393
+ msGridColumnSpan: 1,
4394
+ fontWeight: 1,
4395
+ lineHeight: 1,
4396
+ opacity: 1,
4397
+ order: 1,
4398
+ orphans: 1,
4399
+ tabSize: 1,
4400
+ widows: 1,
4401
+ zIndex: 1,
4402
+ zoom: 1,
4403
+ WebkitLineClamp: 1,
4404
+ // SVG-related properties
4405
+ fillOpacity: 1,
4406
+ floodOpacity: 1,
4407
+ stopOpacity: 1,
4408
+ strokeDasharray: 1,
4409
+ strokeDashoffset: 1,
4410
+ strokeMiterlimit: 1,
4411
+ strokeOpacity: 1,
4412
+ strokeWidth: 1
4413
+ };
4414
+
4415
+ var ILLEGAL_ESCAPE_SEQUENCE_ERROR$1 = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
4416
+ var UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
4417
+ var hyphenateRegex = /[A-Z]|^ms/g;
4418
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
4419
+
4420
+ var isCustomProperty = function isCustomProperty(property) {
4421
+ return property.charCodeAt(1) === 45;
4422
+ };
4423
+
4424
+ var isProcessableValue = function isProcessableValue(value) {
4425
+ return value != null && typeof value !== 'boolean';
4426
+ };
4427
+
4428
+ var processStyleName = /* #__PURE__ */memoize(function (styleName) {
4429
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
4430
+ });
4431
+
4432
+ var processStyleValue = function processStyleValue(key, value) {
4433
+ switch (key) {
4434
+ case 'animation':
4435
+ case 'animationName':
4436
+ {
4437
+ if (typeof value === 'string') {
4438
+ return value.replace(animationRegex, function (match, p1, p2) {
4439
+ cursor = {
4440
+ name: p1,
4441
+ styles: p2,
4442
+ next: cursor
4443
+ };
4444
+ return p1;
4445
+ });
4446
+ }
4447
+ }
4448
+ }
4449
+
4450
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
4451
+ return value + 'px';
4452
+ }
4453
+
4454
+ return value;
4455
+ };
4456
+
4457
+ if (process.env.NODE_ENV !== 'production') {
4458
+ var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
4459
+ var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
4460
+ var oldProcessStyleValue = processStyleValue;
4461
+ var msPattern = /^-ms-/;
4462
+ var hyphenPattern = /-(.)/g;
4463
+ var hyphenatedCache = {};
4464
+
4465
+ processStyleValue = function processStyleValue(key, value) {
4466
+ if (key === 'content') {
4467
+ if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
4468
+ throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
4469
+ }
4470
+ }
4471
+
4472
+ var processed = oldProcessStyleValue(key, value);
4473
+
4474
+ if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
4475
+ hyphenatedCache[key] = true;
4476
+ console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {
4477
+ return _char.toUpperCase();
4478
+ }) + "?");
4479
+ }
4480
+
4481
+ return processed;
4482
+ };
4483
+ }
4484
+
4485
+ var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
4486
+
4487
+ function handleInterpolation(mergedProps, registered, interpolation) {
4488
+ if (interpolation == null) {
4489
+ return '';
4490
+ }
4491
+
4492
+ if (interpolation.__emotion_styles !== undefined) {
4493
+ if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
4494
+ throw new Error(noComponentSelectorMessage);
4495
+ }
4496
+
4497
+ return interpolation;
4498
+ }
4499
+
4500
+ switch (typeof interpolation) {
4501
+ case 'boolean':
4502
+ {
4503
+ return '';
4504
+ }
4505
+
4506
+ case 'object':
4507
+ {
4508
+ if (interpolation.anim === 1) {
4509
+ cursor = {
4510
+ name: interpolation.name,
4511
+ styles: interpolation.styles,
4512
+ next: cursor
4513
+ };
4514
+ return interpolation.name;
4515
+ }
4516
+
4517
+ if (interpolation.styles !== undefined) {
4518
+ var next = interpolation.next;
4519
+
4520
+ if (next !== undefined) {
4521
+ // not the most efficient thing ever but this is a pretty rare case
4522
+ // and there will be very few iterations of this generally
4523
+ while (next !== undefined) {
4524
+ cursor = {
4525
+ name: next.name,
4526
+ styles: next.styles,
4527
+ next: cursor
4528
+ };
4529
+ next = next.next;
4530
+ }
4531
+ }
4532
+
4533
+ var styles = interpolation.styles + ";";
4534
+
4535
+ if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
4536
+ styles += interpolation.map;
4537
+ }
4538
+
4539
+ return styles;
4540
+ }
4541
+
4542
+ return createStringFromObject(mergedProps, registered, interpolation);
4543
+ }
4544
+
4545
+ case 'function':
4546
+ {
4547
+ if (mergedProps !== undefined) {
4548
+ var previousCursor = cursor;
4549
+ var result = interpolation(mergedProps);
4550
+ cursor = previousCursor;
4551
+ return handleInterpolation(mergedProps, registered, result);
4552
+ } else if (process.env.NODE_ENV !== 'production') {
4553
+ console.error('Functions that are interpolated in css calls will be stringified.\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\n' + 'It can be called directly with props or interpolated in a styled call like this\n' + "let SomeComponent = styled('div')`${dynamicStyle}`");
4554
+ }
4555
+
4556
+ break;
4557
+ }
4558
+
4559
+ case 'string':
4560
+ if (process.env.NODE_ENV !== 'production') {
4561
+ var matched = [];
4562
+ var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
4563
+ var fakeVarName = "animation" + matched.length;
4564
+ matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
4565
+ return "${" + fakeVarName + "}";
4566
+ });
4567
+
4568
+ if (matched.length) {
4569
+ console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\n' + 'Instead of doing this:\n\n' + [].concat(matched, ["`" + replaced + "`"]).join('\n') + '\n\nYou should wrap it with `css` like this:\n\n' + ("css`" + replaced + "`"));
4570
+ }
4571
+ }
4572
+
4573
+ break;
4574
+ } // finalize string values (regular strings and functions interpolated into css calls)
4575
+
4576
+
4577
+ if (registered == null) {
4578
+ return interpolation;
4579
+ }
4580
+
4581
+ var cached = registered[interpolation];
4582
+ return cached !== undefined ? cached : interpolation;
4583
+ }
4584
+
4585
+ function createStringFromObject(mergedProps, registered, obj) {
4586
+ var string = '';
4587
+
4588
+ if (Array.isArray(obj)) {
4589
+ for (var i = 0; i < obj.length; i++) {
4590
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
4591
+ }
4592
+ } else {
4593
+ for (var _key in obj) {
4594
+ var value = obj[_key];
4595
+
4596
+ if (typeof value !== 'object') {
4597
+ if (registered != null && registered[value] !== undefined) {
4598
+ string += _key + "{" + registered[value] + "}";
4599
+ } else if (isProcessableValue(value)) {
4600
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
4601
+ }
4602
+ } else {
4603
+ if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
4604
+ throw new Error(noComponentSelectorMessage);
4605
+ }
4606
+
4607
+ if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
4608
+ for (var _i = 0; _i < value.length; _i++) {
4609
+ if (isProcessableValue(value[_i])) {
4610
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
4611
+ }
4612
+ }
4613
+ } else {
4614
+ var interpolated = handleInterpolation(mergedProps, registered, value);
4615
+
4616
+ switch (_key) {
4617
+ case 'animation':
4618
+ case 'animationName':
4619
+ {
4620
+ string += processStyleName(_key) + ":" + interpolated + ";";
4621
+ break;
4622
+ }
4623
+
4624
+ default:
4625
+ {
4626
+ if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
4627
+ console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
4628
+ }
4629
+
4630
+ string += _key + "{" + interpolated + "}";
4631
+ }
4632
+ }
4633
+ }
4634
+ }
4635
+ }
4636
+ }
4637
+
4638
+ return string;
4639
+ }
4640
+
4641
+ var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
4642
+ var sourceMapPattern;
4643
+
4644
+ if (process.env.NODE_ENV !== 'production') {
4645
+ sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
4646
+ } // this is the cursor for keyframes
4647
+ // keyframes are stored on the SerializedStyles object as a linked list
4648
+
4649
+
4650
+ var cursor;
4651
+ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
4652
+ if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
4653
+ return args[0];
4654
+ }
4655
+
4656
+ var stringMode = true;
4657
+ var styles = '';
4658
+ cursor = undefined;
4659
+ var strings = args[0];
4660
+
4661
+ if (strings == null || strings.raw === undefined) {
4662
+ stringMode = false;
4663
+ styles += handleInterpolation(mergedProps, registered, strings);
4664
+ } else {
4665
+ if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
4666
+ console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1);
4667
+ }
4668
+
4669
+ styles += strings[0];
4670
+ } // we start at 1 since we've already handled the first arg
4671
+
4672
+
4673
+ for (var i = 1; i < args.length; i++) {
4674
+ styles += handleInterpolation(mergedProps, registered, args[i]);
4675
+
4676
+ if (stringMode) {
4677
+ if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
4678
+ console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR$1);
4679
+ }
4680
+
4681
+ styles += strings[i];
4682
+ }
4683
+ }
4684
+
4685
+ var sourceMap;
4686
+
4687
+ if (process.env.NODE_ENV !== 'production') {
4688
+ styles = styles.replace(sourceMapPattern, function (match) {
4689
+ sourceMap = match;
4690
+ return '';
4691
+ });
4692
+ } // using a global regex with .exec is stateful so lastIndex has to be reset each time
4693
+
4694
+
4695
+ labelPattern.lastIndex = 0;
4696
+ var identifierName = '';
4697
+ var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
4698
+
4699
+ while ((match = labelPattern.exec(styles)) !== null) {
4700
+ identifierName += '-' + // $FlowFixMe we know it's not null
4701
+ match[1];
4702
+ }
4703
+
4704
+ var name = murmur2(styles) + identifierName;
4705
+
4706
+ if (process.env.NODE_ENV !== 'production') {
4707
+ // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
4708
+ return {
4709
+ name: name,
4710
+ styles: styles,
4711
+ map: sourceMap,
4712
+ next: cursor,
4713
+ toString: function toString() {
4714
+ return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
4715
+ }
4716
+ };
4717
+ }
4718
+
4719
+ return {
4720
+ name: name,
4721
+ styles: styles,
4722
+ next: cursor
4723
+ };
4724
+ };
4725
+
4726
+ var isBrowser$2 = typeof document !== 'undefined';
4727
+
4728
+ var syncFallback = function syncFallback(create) {
4729
+ return create();
4730
+ };
4731
+
4732
+ var useInsertionEffect = React$1['useInsertion' + 'Effect'] ? React$1['useInsertion' + 'Effect'] : false;
4733
+ var useInsertionEffectAlwaysWithSyncFallback = !isBrowser$2 ? syncFallback : useInsertionEffect || syncFallback;
4734
+
4735
+ var isBrowser$1 = typeof document !== 'undefined';
4736
+ var hasOwnProperty = {}.hasOwnProperty;
4737
+
4738
+ var EmotionCacheContext = /* #__PURE__ */reactExports.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
4739
+ // because this module is primarily intended for the browser and node
4740
+ // but it's also required in react native and similar environments sometimes
4741
+ // and we could have a special build just for that
4742
+ // but this is much easier and the native packages
4743
+ // might use a different theme context in the future anyway
4744
+ typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
4745
+ key: 'css'
4746
+ }) : null);
4747
+
4748
+ if (process.env.NODE_ENV !== 'production') {
4749
+ EmotionCacheContext.displayName = 'EmotionCacheContext';
4750
+ }
4751
+
4752
+ EmotionCacheContext.Provider;
4753
+
4754
+ var withEmotionCache = function withEmotionCache(func) {
4755
+ // $FlowFixMe
4756
+ return /*#__PURE__*/reactExports.forwardRef(function (props, ref) {
4757
+ // the cache will never be null in the browser
4758
+ var cache = reactExports.useContext(EmotionCacheContext);
4759
+ return func(props, cache, ref);
4760
+ });
4761
+ };
4762
+
4763
+ if (!isBrowser$1) {
4764
+ withEmotionCache = function withEmotionCache(func) {
4765
+ return function (props) {
4766
+ var cache = reactExports.useContext(EmotionCacheContext);
4767
+
4768
+ if (cache === null) {
4769
+ // yes, we're potentially creating this on every render
4770
+ // it doesn't actually matter though since it's only on the server
4771
+ // so there will only every be a single render
4772
+ // that could change in the future because of suspense and etc. but for now,
4773
+ // this works and i don't want to optimise for a future thing that we aren't sure about
4774
+ cache = createCache({
4775
+ key: 'css'
4776
+ });
4777
+ return /*#__PURE__*/reactExports.createElement(EmotionCacheContext.Provider, {
4778
+ value: cache
4779
+ }, func(props, cache));
4780
+ } else {
4781
+ return func(props, cache);
4782
+ }
4783
+ };
4784
+ };
4785
+ }
4786
+
4787
+ var ThemeContext = /* #__PURE__ */reactExports.createContext({});
4788
+
4789
+ if (process.env.NODE_ENV !== 'production') {
4790
+ ThemeContext.displayName = 'EmotionThemeContext';
4791
+ }
4792
+
4793
+ var useTheme = function useTheme() {
4794
+ return reactExports.useContext(ThemeContext);
4795
+ };
4796
+
4797
+ var typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';
4798
+ var labelPropName = '__EMOTION_LABEL_PLEASE_DO_NOT_USE__';
4799
+
4800
+ var Insertion$1 = function Insertion(_ref) {
4801
+ var cache = _ref.cache,
4802
+ serialized = _ref.serialized,
4803
+ isStringTag = _ref.isStringTag;
4804
+ registerStyles(cache, serialized, isStringTag);
4805
+ var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
4806
+ return insertStyles(cache, serialized, isStringTag);
4807
+ });
4808
+
4809
+ if (!isBrowser$1 && rules !== undefined) {
4810
+ var _ref2;
4811
+
4812
+ var serializedNames = serialized.name;
4813
+ var next = serialized.next;
4814
+
4815
+ while (next !== undefined) {
4816
+ serializedNames += ' ' + next.name;
4817
+ next = next.next;
4818
+ }
4819
+
4820
+ return /*#__PURE__*/reactExports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
4821
+ __html: rules
4822
+ }, _ref2.nonce = cache.sheet.nonce, _ref2));
4823
+ }
4824
+
4825
+ return null;
4826
+ };
4827
+
4828
+ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
4829
+ var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works
4830
+ // not passing the registered cache to serializeStyles because it would
4831
+ // make certain babel optimisations not possible
4832
+
4833
+ if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {
4834
+ cssProp = cache.registered[cssProp];
4835
+ }
4836
+
4837
+ var WrappedComponent = props[typePropName];
4838
+ var registeredStyles = [cssProp];
4839
+ var className = '';
4840
+
4841
+ if (typeof props.className === 'string') {
4842
+ className = getRegisteredStyles(cache.registered, registeredStyles, props.className);
4843
+ } else if (props.className != null) {
4844
+ className = props.className + " ";
4845
+ }
4846
+
4847
+ var serialized = serializeStyles(registeredStyles, undefined, reactExports.useContext(ThemeContext));
4848
+
4849
+ if (process.env.NODE_ENV !== 'production' && serialized.name.indexOf('-') === -1) {
4850
+ var labelFromStack = props[labelPropName];
4851
+
4852
+ if (labelFromStack) {
4853
+ serialized = serializeStyles([serialized, 'label:' + labelFromStack + ';']);
4854
+ }
4855
+ }
4856
+
4857
+ className += cache.key + "-" + serialized.name;
4858
+ var newProps = {};
4859
+
4860
+ for (var key in props) {
4861
+ if (hasOwnProperty.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
4862
+ newProps[key] = props[key];
4863
+ }
4864
+ }
4865
+
4866
+ newProps.ref = ref;
4867
+ newProps.className = className;
4868
+ return /*#__PURE__*/reactExports.createElement(reactExports.Fragment, null, /*#__PURE__*/reactExports.createElement(Insertion$1, {
4869
+ cache: cache,
4870
+ serialized: serialized,
4871
+ isStringTag: typeof WrappedComponent === 'string'
4872
+ }), /*#__PURE__*/reactExports.createElement(WrappedComponent, newProps));
4873
+ });
4874
+
4875
+ if (process.env.NODE_ENV !== 'production') {
4876
+ Emotion.displayName = 'EmotionCssPropInternal';
4877
+ }
4878
+
4879
+ const defaultThemeColors = {
4880
+ primary: "#00739D",
4881
+ secondary: "#01A982",
4882
+ tertiary: "#FFC20A",
4883
+ textPrimary: "#333333",
4884
+ textSecondary: "#666666",
4885
+ textTertiary: "#999999",
4886
+ statusOk: "#01A982",
4887
+ statusWarning: "#FFC20A",
4888
+ statusCritical: "#FF4040",
4889
+ statusNeutral: "#CCCCCC",
4890
+ };
4891
+ React.createContext(defaultThemeColors);
4892
+ const isEmpty = (obj) => {
4893
+ return Object.keys(obj).length === 0;
4894
+ };
4895
+ const useKwantisThemeContext = () => {
4896
+ const contextTheme = useTheme();
4897
+ return isEmpty(contextTheme) ? defaultThemeColors : contextTheme;
4898
+ };
4899
+
4900
+ 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|download|draggable|encType|enterKeyHint|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
4901
+
4902
+ var isPropValid = /* #__PURE__ */memoize(function (prop) {
4903
+ return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
4904
+ /* o */
4905
+ && prop.charCodeAt(1) === 110
4906
+ /* n */
4907
+ && prop.charCodeAt(2) < 91;
4908
+ }
4909
+ /* Z+1 */
4910
+ );
4911
+
4912
+ var testOmitPropsOnStringTag = isPropValid;
4913
+
4914
+ var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
4915
+ return key !== 'theme';
4916
+ };
4917
+
4918
+ var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
4919
+ return typeof tag === 'string' && // 96 is one less than the char code
4920
+ // for "a" so this is checking that
4921
+ // it's a lowercase character
4922
+ tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
4923
+ };
4924
+ var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
4925
+ var shouldForwardProp;
4926
+
4927
+ if (options) {
4928
+ var optionsShouldForwardProp = options.shouldForwardProp;
4929
+ shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
4930
+ return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
4931
+ } : optionsShouldForwardProp;
4932
+ }
4933
+
4934
+ if (typeof shouldForwardProp !== 'function' && isReal) {
4935
+ shouldForwardProp = tag.__emotion_forwardProp;
4936
+ }
4937
+
4938
+ return shouldForwardProp;
4939
+ };
4940
+
4941
+ var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences";
4942
+ var isBrowser = typeof document !== 'undefined';
4943
+
4944
+ var Insertion = function Insertion(_ref) {
4945
+ var cache = _ref.cache,
4946
+ serialized = _ref.serialized,
4947
+ isStringTag = _ref.isStringTag;
4948
+ registerStyles(cache, serialized, isStringTag);
4949
+ var rules = useInsertionEffectAlwaysWithSyncFallback(function () {
4950
+ return insertStyles(cache, serialized, isStringTag);
4951
+ });
4952
+
4953
+ if (!isBrowser && rules !== undefined) {
4954
+ var _ref2;
4955
+
4956
+ var serializedNames = serialized.name;
4957
+ var next = serialized.next;
4958
+
4959
+ while (next !== undefined) {
4960
+ serializedNames += ' ' + next.name;
4961
+ next = next.next;
4962
+ }
4963
+
4964
+ return /*#__PURE__*/reactExports.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedNames, _ref2.dangerouslySetInnerHTML = {
4965
+ __html: rules
4966
+ }, _ref2.nonce = cache.sheet.nonce, _ref2));
4967
+ }
4968
+
4969
+ return null;
4970
+ };
4971
+
4972
+ var createStyled = function createStyled(tag, options) {
4973
+ if (process.env.NODE_ENV !== 'production') {
4974
+ if (tag === undefined) {
4975
+ throw new Error('You are trying to create a styled element with an undefined component.\nYou may have forgotten to import it.');
4976
+ }
4977
+ }
4978
+
4979
+ var isReal = tag.__emotion_real === tag;
4980
+ var baseTag = isReal && tag.__emotion_base || tag;
4981
+ var identifierName;
4982
+ var targetClassName;
4983
+
4984
+ if (options !== undefined) {
4985
+ identifierName = options.label;
4986
+ targetClassName = options.target;
4987
+ }
4988
+
4989
+ var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
4990
+ var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
4991
+ var shouldUseAs = !defaultShouldForwardProp('as');
4992
+ return function () {
4993
+ var args = arguments;
4994
+ var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
4995
+
4996
+ if (identifierName !== undefined) {
4997
+ styles.push("label:" + identifierName + ";");
4998
+ }
4999
+
5000
+ if (args[0] == null || args[0].raw === undefined) {
5001
+ styles.push.apply(styles, args);
5002
+ } else {
5003
+ if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {
5004
+ console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
5005
+ }
5006
+
5007
+ styles.push(args[0][0]);
5008
+ var len = args.length;
5009
+ var i = 1;
5010
+
5011
+ for (; i < len; i++) {
5012
+ if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {
5013
+ console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
5014
+ }
5015
+
5016
+ styles.push(args[i], args[0][i]);
5017
+ }
5018
+ } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class
5019
+
5020
+
5021
+ var Styled = withEmotionCache(function (props, cache, ref) {
5022
+ var FinalTag = shouldUseAs && props.as || baseTag;
5023
+ var className = '';
5024
+ var classInterpolations = [];
5025
+ var mergedProps = props;
5026
+
5027
+ if (props.theme == null) {
5028
+ mergedProps = {};
5029
+
5030
+ for (var key in props) {
5031
+ mergedProps[key] = props[key];
5032
+ }
5033
+
5034
+ mergedProps.theme = reactExports.useContext(ThemeContext);
5035
+ }
5036
+
5037
+ if (typeof props.className === 'string') {
5038
+ className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
5039
+ } else if (props.className != null) {
5040
+ className = props.className + " ";
5041
+ }
5042
+
5043
+ var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
5044
+ className += cache.key + "-" + serialized.name;
5045
+
5046
+ if (targetClassName !== undefined) {
5047
+ className += " " + targetClassName;
5048
+ }
5049
+
5050
+ var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
5051
+ var newProps = {};
5052
+
5053
+ for (var _key in props) {
5054
+ if (shouldUseAs && _key === 'as') continue;
5055
+
5056
+ if ( // $FlowFixMe
5057
+ finalShouldForwardProp(_key)) {
5058
+ newProps[_key] = props[_key];
5059
+ }
5060
+ }
5061
+
5062
+ newProps.className = className;
5063
+ newProps.ref = ref;
5064
+ return /*#__PURE__*/reactExports.createElement(reactExports.Fragment, null, /*#__PURE__*/reactExports.createElement(Insertion, {
5065
+ cache: cache,
5066
+ serialized: serialized,
5067
+ isStringTag: typeof FinalTag === 'string'
5068
+ }), /*#__PURE__*/reactExports.createElement(FinalTag, newProps));
5069
+ });
5070
+ Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
5071
+ Styled.defaultProps = tag.defaultProps;
5072
+ Styled.__emotion_real = Styled;
5073
+ Styled.__emotion_base = baseTag;
5074
+ Styled.__emotion_styles = styles;
5075
+ Styled.__emotion_forwardProp = shouldForwardProp;
5076
+ Object.defineProperty(Styled, 'toString', {
5077
+ value: function value() {
5078
+ if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {
5079
+ return 'NO_COMPONENT_SELECTOR';
5080
+ } // $FlowFixMe: coerce undefined to string
5081
+
5082
+
5083
+ return "." + targetClassName;
5084
+ }
5085
+ });
5086
+
5087
+ Styled.withComponent = function (nextTag, nextOptions) {
5088
+ return createStyled(nextTag, _extends({}, options, nextOptions, {
5089
+ shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
5090
+ })).apply(void 0, styles);
5091
+ };
5092
+
5093
+ return Styled;
5094
+ };
5095
+ };
5096
+
5097
+ 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
5098
+ 'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
5099
+
5100
+ var newStyled = createStyled.bind();
5101
+ tags.forEach(function (tagName) {
5102
+ // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type
5103
+ newStyled[tagName] = newStyled(tagName);
5104
+ });
5105
+
2805
5106
  const Button = (props) => {
2806
- return reactExports.createElement("button", null, props.label);
5107
+ const colors = useKwantisThemeContext();
5108
+ const Button = newStyled.button `
5109
+ background-color: ${colors[props.color || "primary"]};
5110
+ `;
5111
+ return reactExports.createElement(Button, null, props.label);
2807
5112
  };
2808
5113
 
2809
5114
  export { Button };