@grafana/aws-sdk 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/esm/node_modules/@emotion/cache/dist/emotion-cache.esm.js +654 -0
  2. package/dist/esm/node_modules/@emotion/cache/dist/emotion-cache.esm.js.map +1 -0
  3. package/dist/esm/node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js +145 -0
  4. package/dist/esm/node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js.map +1 -0
  5. package/dist/esm/node_modules/@emotion/css/dist/emotion-css.esm.js +10 -0
  6. package/dist/esm/node_modules/@emotion/css/dist/emotion-css.esm.js.map +1 -0
  7. package/dist/esm/node_modules/@emotion/hash/dist/emotion-hash.esm.js +56 -0
  8. package/dist/esm/node_modules/@emotion/hash/dist/emotion-hash.esm.js.map +1 -0
  9. package/dist/esm/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js +10 -0
  10. package/dist/esm/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js.map +1 -0
  11. package/dist/esm/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js +317 -0
  12. package/dist/esm/node_modules/@emotion/serialize/dist/emotion-serialize.esm.js.map +1 -0
  13. package/dist/esm/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js +155 -0
  14. package/dist/esm/node_modules/@emotion/sheet/dist/emotion-sheet.esm.js.map +1 -0
  15. package/dist/esm/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js +51 -0
  16. package/dist/esm/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js.map +1 -0
  17. package/dist/esm/node_modules/@emotion/utils/dist/emotion-utils.esm.js +54 -0
  18. package/dist/esm/node_modules/@emotion/utils/dist/emotion-utils.esm.js.map +1 -0
  19. package/dist/esm/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js +17 -0
  20. package/dist/esm/node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js.map +1 -0
  21. package/dist/esm/node_modules/stylis/src/Enum.js +12 -0
  22. package/dist/esm/node_modules/stylis/src/Enum.js.map +1 -0
  23. package/dist/esm/node_modules/stylis/src/Middleware.js +33 -0
  24. package/dist/esm/node_modules/stylis/src/Middleware.js.map +1 -0
  25. package/dist/esm/node_modules/stylis/src/Parser.js +194 -0
  26. package/dist/esm/node_modules/stylis/src/Parser.js.map +1 -0
  27. package/dist/esm/node_modules/stylis/src/Serializer.js +38 -0
  28. package/dist/esm/node_modules/stylis/src/Serializer.js.map +1 -0
  29. package/dist/esm/node_modules/stylis/src/Tokenizer.js +224 -0
  30. package/dist/esm/node_modules/stylis/src/Tokenizer.js.map +1 -0
  31. package/dist/esm/node_modules/stylis/src/Utility.js +118 -0
  32. package/dist/esm/node_modules/stylis/src/Utility.js.map +1 -0
  33. package/dist/esm/{ConnectionConfig.js → src/ConnectionConfig.js} +13 -4
  34. package/dist/esm/src/ConnectionConfig.js.map +1 -0
  35. package/dist/esm/src/SIGV4ConnectionConfig.js.map +1 -0
  36. package/dist/esm/src/providers.js.map +1 -0
  37. package/dist/esm/src/regions.js.map +1 -0
  38. package/dist/esm/src/sql/ConfigEditor/ConfigSelect.js.map +1 -0
  39. package/dist/esm/src/sql/ConfigEditor/InlineInput.js.map +1 -0
  40. package/dist/esm/src/sql/QueryEditor/FillValueSelect.js.map +1 -0
  41. package/dist/esm/src/sql/QueryEditor/FormatSelect.js.map +1 -0
  42. package/dist/esm/src/sql/QueryEditor/QueryCodeEditor.js.map +1 -0
  43. package/dist/esm/src/sql/QueryEditor/QueryEditorHeader.js.map +1 -0
  44. package/dist/esm/src/sql/ResourceSelector.js.map +1 -0
  45. package/dist/esm/src/sql/types.js.map +1 -0
  46. package/dist/esm/src/sql/utils/utils.js.map +1 -0
  47. package/dist/esm/src/types.js.map +1 -0
  48. package/dist/index.js +2035 -3
  49. package/dist/index.js.map +1 -1
  50. package/package.json +1 -1
  51. package/dist/esm/ConnectionConfig.js.map +0 -1
  52. package/dist/esm/SIGV4ConnectionConfig.js.map +0 -1
  53. package/dist/esm/providers.js.map +0 -1
  54. package/dist/esm/regions.js.map +0 -1
  55. package/dist/esm/sql/ConfigEditor/ConfigSelect.js.map +0 -1
  56. package/dist/esm/sql/ConfigEditor/InlineInput.js.map +0 -1
  57. package/dist/esm/sql/QueryEditor/FillValueSelect.js.map +0 -1
  58. package/dist/esm/sql/QueryEditor/FormatSelect.js.map +0 -1
  59. package/dist/esm/sql/QueryEditor/QueryCodeEditor.js.map +0 -1
  60. package/dist/esm/sql/QueryEditor/QueryEditorHeader.js.map +0 -1
  61. package/dist/esm/sql/ResourceSelector.js.map +0 -1
  62. package/dist/esm/sql/types.js.map +0 -1
  63. package/dist/esm/sql/utils/utils.js.map +0 -1
  64. package/dist/esm/types.js.map +0 -1
  65. /package/dist/esm/{SIGV4ConnectionConfig.js → src/SIGV4ConnectionConfig.js} +0 -0
  66. /package/dist/esm/{index.js → src/index.js} +0 -0
  67. /package/dist/esm/{index.js.map → src/index.js.map} +0 -0
  68. /package/dist/esm/{providers.js → src/providers.js} +0 -0
  69. /package/dist/esm/{regions.js → src/regions.js} +0 -0
  70. /package/dist/esm/{sql → src/sql}/ConfigEditor/ConfigSelect.js +0 -0
  71. /package/dist/esm/{sql → src/sql}/ConfigEditor/InlineInput.js +0 -0
  72. /package/dist/esm/{sql → src/sql}/QueryEditor/FillValueSelect.js +0 -0
  73. /package/dist/esm/{sql → src/sql}/QueryEditor/FormatSelect.js +0 -0
  74. /package/dist/esm/{sql → src/sql}/QueryEditor/QueryCodeEditor.js +0 -0
  75. /package/dist/esm/{sql → src/sql}/QueryEditor/QueryEditorHeader.js +0 -0
  76. /package/dist/esm/{sql → src/sql}/ResourceSelector.js +0 -0
  77. /package/dist/esm/{sql → src/sql}/types.js +0 -0
  78. /package/dist/esm/{sql → src/sql}/utils/utils.js +0 -0
  79. /package/dist/esm/{types.js → src/types.js} +0 -0
package/dist/index.js CHANGED
@@ -76,6 +76,2030 @@ const awsAuthProviderOptions = [
76
76
  }
77
77
  ];
78
78
 
79
+ /*
80
+
81
+ Based off glamor's StyleSheet, thanks Sunil ❤️
82
+
83
+ high performance StyleSheet for css-in-js systems
84
+
85
+ - uses multiple style tags behind the scenes for millions of rules
86
+ - uses `insertRule` for appending in production for *much* faster performance
87
+
88
+ // usage
89
+
90
+ import { StyleSheet } from '@emotion/sheet'
91
+
92
+ let styleSheet = new StyleSheet({ key: '', container: document.head })
93
+
94
+ styleSheet.insert('#box { border: 1px solid red; }')
95
+ - appends a css rule into the stylesheet
96
+
97
+ styleSheet.flush()
98
+ - empties the stylesheet of all its contents
99
+
100
+ */
101
+ // $FlowFixMe
102
+ function sheetForTag(tag) {
103
+ if (tag.sheet) {
104
+ // $FlowFixMe
105
+ return tag.sheet;
106
+ } // this weirdness brought to you by firefox
107
+
108
+ /* istanbul ignore next */
109
+
110
+
111
+ for (var i = 0; i < document.styleSheets.length; i++) {
112
+ if (document.styleSheets[i].ownerNode === tag) {
113
+ // $FlowFixMe
114
+ return document.styleSheets[i];
115
+ }
116
+ }
117
+ }
118
+
119
+ function createStyleElement(options) {
120
+ var tag = document.createElement('style');
121
+ tag.setAttribute('data-emotion', options.key);
122
+
123
+ if (options.nonce !== undefined) {
124
+ tag.setAttribute('nonce', options.nonce);
125
+ }
126
+
127
+ tag.appendChild(document.createTextNode(''));
128
+ tag.setAttribute('data-s', '');
129
+ return tag;
130
+ }
131
+
132
+ var StyleSheet = /*#__PURE__*/function () {
133
+ // Using Node instead of HTMLElement since container may be a ShadowRoot
134
+ function StyleSheet(options) {
135
+ var _this = this;
136
+
137
+ this._insertTag = function (tag) {
138
+ var before;
139
+
140
+ if (_this.tags.length === 0) {
141
+ if (_this.insertionPoint) {
142
+ before = _this.insertionPoint.nextSibling;
143
+ } else if (_this.prepend) {
144
+ before = _this.container.firstChild;
145
+ } else {
146
+ before = _this.before;
147
+ }
148
+ } else {
149
+ before = _this.tags[_this.tags.length - 1].nextSibling;
150
+ }
151
+
152
+ _this.container.insertBefore(tag, before);
153
+
154
+ _this.tags.push(tag);
155
+ };
156
+
157
+ this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
158
+ this.tags = [];
159
+ this.ctr = 0;
160
+ this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
161
+
162
+ this.key = options.key;
163
+ this.container = options.container;
164
+ this.prepend = options.prepend;
165
+ this.insertionPoint = options.insertionPoint;
166
+ this.before = null;
167
+ }
168
+
169
+ var _proto = StyleSheet.prototype;
170
+
171
+ _proto.hydrate = function hydrate(nodes) {
172
+ nodes.forEach(this._insertTag);
173
+ };
174
+
175
+ _proto.insert = function insert(rule) {
176
+ // the max length is how many rules we have per style tag, it's 65000 in speedy mode
177
+ // it's 1 in dev because we insert source maps that map a single rule to a location
178
+ // and you can only have one source map per style tag
179
+ if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
180
+ this._insertTag(createStyleElement(this));
181
+ }
182
+
183
+ var tag = this.tags[this.tags.length - 1];
184
+
185
+ if (process.env.NODE_ENV !== 'production') {
186
+ var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
187
+
188
+ if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
189
+ // this would only cause problem in speedy mode
190
+ // but we don't want enabling speedy to affect the observable behavior
191
+ // so we report this error at all times
192
+ 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.');
193
+ }
194
+ this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
195
+ }
196
+
197
+ if (this.isSpeedy) {
198
+ var sheet = sheetForTag(tag);
199
+
200
+ try {
201
+ // this is the ultrafast version, works across browsers
202
+ // the big drawback is that the css won't be editable in devtools
203
+ sheet.insertRule(rule, sheet.cssRules.length);
204
+ } catch (e) {
205
+ 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)) {
206
+ console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
207
+ }
208
+ }
209
+ } else {
210
+ tag.appendChild(document.createTextNode(rule));
211
+ }
212
+
213
+ this.ctr++;
214
+ };
215
+
216
+ _proto.flush = function flush() {
217
+ // $FlowFixMe
218
+ this.tags.forEach(function (tag) {
219
+ return tag.parentNode && tag.parentNode.removeChild(tag);
220
+ });
221
+ this.tags = [];
222
+ this.ctr = 0;
223
+
224
+ if (process.env.NODE_ENV !== 'production') {
225
+ this._alreadyInsertedOrderInsensitiveRule = false;
226
+ }
227
+ };
228
+
229
+ return StyleSheet;
230
+ }();
231
+
232
+ var MS = '-ms-';
233
+ var MOZ = '-moz-';
234
+ var WEBKIT = '-webkit-';
235
+
236
+ var COMMENT = 'comm';
237
+ var RULESET = 'rule';
238
+ var DECLARATION = 'decl';
239
+ var IMPORT = '@import';
240
+ var KEYFRAMES = '@keyframes';
241
+
242
+ /**
243
+ * @param {number}
244
+ * @return {number}
245
+ */
246
+ var abs = Math.abs;
247
+
248
+ /**
249
+ * @param {number}
250
+ * @return {string}
251
+ */
252
+ var from = String.fromCharCode;
253
+
254
+ /**
255
+ * @param {object}
256
+ * @return {object}
257
+ */
258
+ var assign = Object.assign;
259
+
260
+ /**
261
+ * @param {string} value
262
+ * @param {number} length
263
+ * @return {number}
264
+ */
265
+ function hash (value, length) {
266
+ return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
267
+ }
268
+
269
+ /**
270
+ * @param {string} value
271
+ * @return {string}
272
+ */
273
+ function trim (value) {
274
+ return value.trim()
275
+ }
276
+
277
+ /**
278
+ * @param {string} value
279
+ * @param {RegExp} pattern
280
+ * @return {string?}
281
+ */
282
+ function match (value, pattern) {
283
+ return (value = pattern.exec(value)) ? value[0] : value
284
+ }
285
+
286
+ /**
287
+ * @param {string} value
288
+ * @param {(string|RegExp)} pattern
289
+ * @param {string} replacement
290
+ * @return {string}
291
+ */
292
+ function replace (value, pattern, replacement) {
293
+ return value.replace(pattern, replacement)
294
+ }
295
+
296
+ /**
297
+ * @param {string} value
298
+ * @param {string} search
299
+ * @return {number}
300
+ */
301
+ function indexof (value, search) {
302
+ return value.indexOf(search)
303
+ }
304
+
305
+ /**
306
+ * @param {string} value
307
+ * @param {number} index
308
+ * @return {number}
309
+ */
310
+ function charat (value, index) {
311
+ return value.charCodeAt(index) | 0
312
+ }
313
+
314
+ /**
315
+ * @param {string} value
316
+ * @param {number} begin
317
+ * @param {number} end
318
+ * @return {string}
319
+ */
320
+ function substr (value, begin, end) {
321
+ return value.slice(begin, end)
322
+ }
323
+
324
+ /**
325
+ * @param {string} value
326
+ * @return {number}
327
+ */
328
+ function strlen (value) {
329
+ return value.length
330
+ }
331
+
332
+ /**
333
+ * @param {any[]} value
334
+ * @return {number}
335
+ */
336
+ function sizeof (value) {
337
+ return value.length
338
+ }
339
+
340
+ /**
341
+ * @param {any} value
342
+ * @param {any[]} array
343
+ * @return {any}
344
+ */
345
+ function append (value, array) {
346
+ return array.push(value), value
347
+ }
348
+
349
+ /**
350
+ * @param {string[]} array
351
+ * @param {function} callback
352
+ * @return {string}
353
+ */
354
+ function combine (array, callback) {
355
+ return array.map(callback).join('')
356
+ }
357
+
358
+ var line = 1;
359
+ var column = 1;
360
+ var length = 0;
361
+ var position = 0;
362
+ var character = 0;
363
+ var characters = '';
364
+
365
+ /**
366
+ * @param {string} value
367
+ * @param {object | null} root
368
+ * @param {object | null} parent
369
+ * @param {string} type
370
+ * @param {string[] | string} props
371
+ * @param {object[] | string} children
372
+ * @param {number} length
373
+ */
374
+ function node (value, root, parent, type, props, children, length) {
375
+ return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
376
+ }
377
+
378
+ /**
379
+ * @param {object} root
380
+ * @param {object} props
381
+ * @return {object}
382
+ */
383
+ function copy (root, props) {
384
+ return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
385
+ }
386
+
387
+ /**
388
+ * @return {number}
389
+ */
390
+ function char () {
391
+ return character
392
+ }
393
+
394
+ /**
395
+ * @return {number}
396
+ */
397
+ function prev () {
398
+ character = position > 0 ? charat(characters, --position) : 0;
399
+
400
+ if (column--, character === 10)
401
+ column = 1, line--;
402
+
403
+ return character
404
+ }
405
+
406
+ /**
407
+ * @return {number}
408
+ */
409
+ function next () {
410
+ character = position < length ? charat(characters, position++) : 0;
411
+
412
+ if (column++, character === 10)
413
+ column = 1, line++;
414
+
415
+ return character
416
+ }
417
+
418
+ /**
419
+ * @return {number}
420
+ */
421
+ function peek () {
422
+ return charat(characters, position)
423
+ }
424
+
425
+ /**
426
+ * @return {number}
427
+ */
428
+ function caret () {
429
+ return position
430
+ }
431
+
432
+ /**
433
+ * @param {number} begin
434
+ * @param {number} end
435
+ * @return {string}
436
+ */
437
+ function slice (begin, end) {
438
+ return substr(characters, begin, end)
439
+ }
440
+
441
+ /**
442
+ * @param {number} type
443
+ * @return {number}
444
+ */
445
+ function token (type) {
446
+ switch (type) {
447
+ // \0 \t \n \r \s whitespace token
448
+ case 0: case 9: case 10: case 13: case 32:
449
+ return 5
450
+ // ! + , / > @ ~ isolate token
451
+ case 33: case 43: case 44: case 47: case 62: case 64: case 126:
452
+ // ; { } breakpoint token
453
+ case 59: case 123: case 125:
454
+ return 4
455
+ // : accompanied token
456
+ case 58:
457
+ return 3
458
+ // " ' ( [ opening delimit token
459
+ case 34: case 39: case 40: case 91:
460
+ return 2
461
+ // ) ] closing delimit token
462
+ case 41: case 93:
463
+ return 1
464
+ }
465
+
466
+ return 0
467
+ }
468
+
469
+ /**
470
+ * @param {string} value
471
+ * @return {any[]}
472
+ */
473
+ function alloc (value) {
474
+ return line = column = 1, length = strlen(characters = value), position = 0, []
475
+ }
476
+
477
+ /**
478
+ * @param {any} value
479
+ * @return {any}
480
+ */
481
+ function dealloc (value) {
482
+ return characters = '', value
483
+ }
484
+
485
+ /**
486
+ * @param {number} type
487
+ * @return {string}
488
+ */
489
+ function delimit (type) {
490
+ return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
491
+ }
492
+
493
+ /**
494
+ * @param {number} type
495
+ * @return {string}
496
+ */
497
+ function whitespace (type) {
498
+ while (character = peek())
499
+ if (character < 33)
500
+ next();
501
+ else
502
+ break
503
+
504
+ return token(type) > 2 || token(character) > 3 ? '' : ' '
505
+ }
506
+
507
+ /**
508
+ * @param {number} index
509
+ * @param {number} count
510
+ * @return {string}
511
+ */
512
+ function escaping (index, count) {
513
+ while (--count && next())
514
+ // not 0-9 A-F a-f
515
+ if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
516
+ break
517
+
518
+ return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
519
+ }
520
+
521
+ /**
522
+ * @param {number} type
523
+ * @return {number}
524
+ */
525
+ function delimiter (type) {
526
+ while (next())
527
+ switch (character) {
528
+ // ] ) " '
529
+ case type:
530
+ return position
531
+ // " '
532
+ case 34: case 39:
533
+ if (type !== 34 && type !== 39)
534
+ delimiter(character);
535
+ break
536
+ // (
537
+ case 40:
538
+ if (type === 41)
539
+ delimiter(type);
540
+ break
541
+ // \
542
+ case 92:
543
+ next();
544
+ break
545
+ }
546
+
547
+ return position
548
+ }
549
+
550
+ /**
551
+ * @param {number} type
552
+ * @param {number} index
553
+ * @return {number}
554
+ */
555
+ function commenter (type, index) {
556
+ while (next())
557
+ // //
558
+ if (type + character === 47 + 10)
559
+ break
560
+ // /*
561
+ else if (type + character === 42 + 42 && peek() === 47)
562
+ break
563
+
564
+ return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
565
+ }
566
+
567
+ /**
568
+ * @param {number} index
569
+ * @return {string}
570
+ */
571
+ function identifier (index) {
572
+ while (!token(peek()))
573
+ next();
574
+
575
+ return slice(index, position)
576
+ }
577
+
578
+ /**
579
+ * @param {string} value
580
+ * @return {object[]}
581
+ */
582
+ function compile (value) {
583
+ return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
584
+ }
585
+
586
+ /**
587
+ * @param {string} value
588
+ * @param {object} root
589
+ * @param {object?} parent
590
+ * @param {string[]} rule
591
+ * @param {string[]} rules
592
+ * @param {string[]} rulesets
593
+ * @param {number[]} pseudo
594
+ * @param {number[]} points
595
+ * @param {string[]} declarations
596
+ * @return {object}
597
+ */
598
+ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
599
+ var index = 0;
600
+ var offset = 0;
601
+ var length = pseudo;
602
+ var atrule = 0;
603
+ var property = 0;
604
+ var previous = 0;
605
+ var variable = 1;
606
+ var scanning = 1;
607
+ var ampersand = 1;
608
+ var character = 0;
609
+ var type = '';
610
+ var props = rules;
611
+ var children = rulesets;
612
+ var reference = rule;
613
+ var characters = type;
614
+
615
+ while (scanning)
616
+ switch (previous = character, character = next()) {
617
+ // (
618
+ case 40:
619
+ if (previous != 108 && charat(characters, length - 1) == 58) {
620
+ if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
621
+ ampersand = -1;
622
+ break
623
+ }
624
+ // " ' [
625
+ case 34: case 39: case 91:
626
+ characters += delimit(character);
627
+ break
628
+ // \t \n \r \s
629
+ case 9: case 10: case 13: case 32:
630
+ characters += whitespace(previous);
631
+ break
632
+ // \
633
+ case 92:
634
+ characters += escaping(caret() - 1, 7);
635
+ continue
636
+ // /
637
+ case 47:
638
+ switch (peek()) {
639
+ case 42: case 47:
640
+ append(comment(commenter(next(), caret()), root, parent), declarations);
641
+ break
642
+ default:
643
+ characters += '/';
644
+ }
645
+ break
646
+ // {
647
+ case 123 * variable:
648
+ points[index++] = strlen(characters) * ampersand;
649
+ // } ; \0
650
+ case 125 * variable: case 59: case 0:
651
+ switch (character) {
652
+ // \0 }
653
+ case 0: case 125: scanning = 0;
654
+ // ;
655
+ case 59 + offset:
656
+ if (property > 0 && (strlen(characters) - length))
657
+ append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
658
+ break
659
+ // @ ;
660
+ case 59: characters += ';';
661
+ // { rule/at-rule
662
+ default:
663
+ append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
664
+
665
+ if (character === 123)
666
+ if (offset === 0)
667
+ parse(characters, root, reference, reference, props, rulesets, length, points, children);
668
+ else
669
+ switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
670
+ // d m s
671
+ case 100: case 109: case 115:
672
+ 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);
673
+ break
674
+ default:
675
+ parse(characters, reference, reference, reference, [''], children, 0, points, children);
676
+ }
677
+ }
678
+
679
+ index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
680
+ break
681
+ // :
682
+ case 58:
683
+ length = 1 + strlen(characters), property = previous;
684
+ default:
685
+ if (variable < 1)
686
+ if (character == 123)
687
+ --variable;
688
+ else if (character == 125 && variable++ == 0 && prev() == 125)
689
+ continue
690
+
691
+ switch (characters += from(character), character * variable) {
692
+ // &
693
+ case 38:
694
+ ampersand = offset > 0 ? 1 : (characters += '\f', -1);
695
+ break
696
+ // ,
697
+ case 44:
698
+ points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
699
+ break
700
+ // @
701
+ case 64:
702
+ // -
703
+ if (peek() === 45)
704
+ characters += delimit(next());
705
+
706
+ atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
707
+ break
708
+ // -
709
+ case 45:
710
+ if (previous === 45 && strlen(characters) == 2)
711
+ variable = 0;
712
+ }
713
+ }
714
+
715
+ return rulesets
716
+ }
717
+
718
+ /**
719
+ * @param {string} value
720
+ * @param {object} root
721
+ * @param {object?} parent
722
+ * @param {number} index
723
+ * @param {number} offset
724
+ * @param {string[]} rules
725
+ * @param {number[]} points
726
+ * @param {string} type
727
+ * @param {string[]} props
728
+ * @param {string[]} children
729
+ * @param {number} length
730
+ * @return {object}
731
+ */
732
+ function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
733
+ var post = offset - 1;
734
+ var rule = offset === 0 ? rules : [''];
735
+ var size = sizeof(rule);
736
+
737
+ for (var i = 0, j = 0, k = 0; i < index; ++i)
738
+ for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
739
+ if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
740
+ props[k++] = z;
741
+
742
+ return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
743
+ }
744
+
745
+ /**
746
+ * @param {number} value
747
+ * @param {object} root
748
+ * @param {object?} parent
749
+ * @return {object}
750
+ */
751
+ function comment (value, root, parent) {
752
+ return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
753
+ }
754
+
755
+ /**
756
+ * @param {string} value
757
+ * @param {object} root
758
+ * @param {object?} parent
759
+ * @param {number} length
760
+ * @return {object}
761
+ */
762
+ function declaration (value, root, parent, length) {
763
+ return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
764
+ }
765
+
766
+ /**
767
+ * @param {object[]} children
768
+ * @param {function} callback
769
+ * @return {string}
770
+ */
771
+ function serialize (children, callback) {
772
+ var output = '';
773
+ var length = sizeof(children);
774
+
775
+ for (var i = 0; i < length; i++)
776
+ output += callback(children[i], i, children, callback) || '';
777
+
778
+ return output
779
+ }
780
+
781
+ /**
782
+ * @param {object} element
783
+ * @param {number} index
784
+ * @param {object[]} children
785
+ * @param {function} callback
786
+ * @return {string}
787
+ */
788
+ function stringify (element, index, children, callback) {
789
+ switch (element.type) {
790
+ case IMPORT: case DECLARATION: return element.return = element.return || element.value
791
+ case COMMENT: return ''
792
+ case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
793
+ case RULESET: element.value = element.props.join(',');
794
+ }
795
+
796
+ return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
797
+ }
798
+
799
+ /**
800
+ * @param {function[]} collection
801
+ * @return {function}
802
+ */
803
+ function middleware (collection) {
804
+ var length = sizeof(collection);
805
+
806
+ return function (element, index, children, callback) {
807
+ var output = '';
808
+
809
+ for (var i = 0; i < length; i++)
810
+ output += collection[i](element, index, children, callback) || '';
811
+
812
+ return output
813
+ }
814
+ }
815
+
816
+ /**
817
+ * @param {function} callback
818
+ * @return {function}
819
+ */
820
+ function rulesheet (callback) {
821
+ return function (element) {
822
+ if (!element.root)
823
+ if (element = element.return)
824
+ callback(element);
825
+ }
826
+ }
827
+
828
+ var weakMemoize = function weakMemoize(func) {
829
+ // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
830
+ var cache = new WeakMap();
831
+ return function (arg) {
832
+ if (cache.has(arg)) {
833
+ // $FlowFixMe
834
+ return cache.get(arg);
835
+ }
836
+
837
+ var ret = func(arg);
838
+ cache.set(arg, ret);
839
+ return ret;
840
+ };
841
+ };
842
+
843
+ function memoize(fn) {
844
+ var cache = Object.create(null);
845
+ return function (arg) {
846
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
847
+ return cache[arg];
848
+ };
849
+ }
850
+
851
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
852
+ var previous = 0;
853
+ var character = 0;
854
+
855
+ while (true) {
856
+ previous = character;
857
+ character = peek(); // &\f
858
+
859
+ if (previous === 38 && character === 12) {
860
+ points[index] = 1;
861
+ }
862
+
863
+ if (token(character)) {
864
+ break;
865
+ }
866
+
867
+ next();
868
+ }
869
+
870
+ return slice(begin, position);
871
+ };
872
+
873
+ var toRules = function toRules(parsed, points) {
874
+ // pretend we've started with a comma
875
+ var index = -1;
876
+ var character = 44;
877
+
878
+ do {
879
+ switch (token(character)) {
880
+ case 0:
881
+ // &\f
882
+ if (character === 38 && peek() === 12) {
883
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
884
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
885
+ // and when it should just concatenate the outer and inner selectors
886
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
887
+ points[index] = 1;
888
+ }
889
+
890
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
891
+ break;
892
+
893
+ case 2:
894
+ parsed[index] += delimit(character);
895
+ break;
896
+
897
+ case 4:
898
+ // comma
899
+ if (character === 44) {
900
+ // colon
901
+ parsed[++index] = peek() === 58 ? '&\f' : '';
902
+ points[index] = parsed[index].length;
903
+ break;
904
+ }
905
+
906
+ // fallthrough
907
+
908
+ default:
909
+ parsed[index] += from(character);
910
+ }
911
+ } while (character = next());
912
+
913
+ return parsed;
914
+ };
915
+
916
+ var getRules = function getRules(value, points) {
917
+ return dealloc(toRules(alloc(value), points));
918
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
919
+
920
+
921
+ var fixedElements = /* #__PURE__ */new WeakMap();
922
+ var compat = function compat(element) {
923
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
924
+ // negative .length indicates that this rule has been already prefixed
925
+ element.length < 1) {
926
+ return;
927
+ }
928
+
929
+ var value = element.value,
930
+ parent = element.parent;
931
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
932
+
933
+ while (parent.type !== 'rule') {
934
+ parent = parent.parent;
935
+ if (!parent) return;
936
+ } // short-circuit for the simplest case
937
+
938
+
939
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
940
+ /* colon */
941
+ && !fixedElements.get(parent)) {
942
+ return;
943
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
944
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
945
+
946
+
947
+ if (isImplicitRule) {
948
+ return;
949
+ }
950
+
951
+ fixedElements.set(element, true);
952
+ var points = [];
953
+ var rules = getRules(value, points);
954
+ var parentRules = parent.props;
955
+
956
+ for (var i = 0, k = 0; i < rules.length; i++) {
957
+ for (var j = 0; j < parentRules.length; j++, k++) {
958
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
959
+ }
960
+ }
961
+ };
962
+ var removeLabel = function removeLabel(element) {
963
+ if (element.type === 'decl') {
964
+ var value = element.value;
965
+
966
+ if ( // charcode for l
967
+ value.charCodeAt(0) === 108 && // charcode for b
968
+ value.charCodeAt(2) === 98) {
969
+ // this ignores label
970
+ element["return"] = '';
971
+ element.value = '';
972
+ }
973
+ }
974
+ };
975
+ var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
976
+
977
+ var isIgnoringComment = function isIgnoringComment(element) {
978
+ return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
979
+ };
980
+
981
+ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
982
+ return function (element, index, children) {
983
+ if (element.type !== 'rule' || cache.compat) return;
984
+ var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
985
+
986
+ if (unsafePseudoClasses) {
987
+ var isNested = element.parent === children[0]; // in nested rules comments become children of the "auto-inserted" rule
988
+ //
989
+ // considering this input:
990
+ // .a {
991
+ // .b /* comm */ {}
992
+ // color: hotpink;
993
+ // }
994
+ // we get output corresponding to this:
995
+ // .a {
996
+ // & {
997
+ // /* comm */
998
+ // color: hotpink;
999
+ // }
1000
+ // .b {}
1001
+ // }
1002
+
1003
+ var commentContainer = isNested ? children[0].children : // global rule at the root level
1004
+ children;
1005
+
1006
+ for (var i = commentContainer.length - 1; i >= 0; i--) {
1007
+ var node = commentContainer[i];
1008
+
1009
+ if (node.line < element.line) {
1010
+ break;
1011
+ } // it is quite weird but comments are *usually* put at `column: element.column - 1`
1012
+ // so we seek *from the end* for the node that is earlier than the rule's `element` and check that
1013
+ // this will also match inputs like this:
1014
+ // .a {
1015
+ // /* comm */
1016
+ // .b {}
1017
+ // }
1018
+ //
1019
+ // but that is fine
1020
+ //
1021
+ // it would be the easiest to change the placement of the comment to be the first child of the rule:
1022
+ // .a {
1023
+ // .b { /* comm */ }
1024
+ // }
1025
+ // with such inputs we wouldn't have to search for the comment at all
1026
+ // TODO: consider changing this comment placement in the next major version
1027
+
1028
+
1029
+ if (node.column < element.column) {
1030
+ if (isIgnoringComment(node)) {
1031
+ return;
1032
+ }
1033
+
1034
+ break;
1035
+ }
1036
+ }
1037
+
1038
+ unsafePseudoClasses.forEach(function (unsafePseudoClass) {
1039
+ console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
1040
+ });
1041
+ }
1042
+ };
1043
+ };
1044
+
1045
+ var isImportRule = function isImportRule(element) {
1046
+ return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
1047
+ };
1048
+
1049
+ var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
1050
+ for (var i = index - 1; i >= 0; i--) {
1051
+ if (!isImportRule(children[i])) {
1052
+ return true;
1053
+ }
1054
+ }
1055
+
1056
+ return false;
1057
+ }; // use this to remove incorrect elements from further processing
1058
+ // so they don't get handed to the `sheet` (or anything else)
1059
+ // as that could potentially lead to additional logs which in turn could be overhelming to the user
1060
+
1061
+
1062
+ var nullifyElement = function nullifyElement(element) {
1063
+ element.type = '';
1064
+ element.value = '';
1065
+ element["return"] = '';
1066
+ element.children = '';
1067
+ element.props = '';
1068
+ };
1069
+
1070
+ var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
1071
+ if (!isImportRule(element)) {
1072
+ return;
1073
+ }
1074
+
1075
+ if (element.parent) {
1076
+ 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.");
1077
+ nullifyElement(element);
1078
+ } else if (isPrependedWithRegularRules(index, children)) {
1079
+ console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
1080
+ nullifyElement(element);
1081
+ }
1082
+ };
1083
+
1084
+ /* eslint-disable no-fallthrough */
1085
+
1086
+ function prefix(value, length) {
1087
+ switch (hash(value, length)) {
1088
+ // color-adjust
1089
+ case 5103:
1090
+ return WEBKIT + 'print-' + value + value;
1091
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
1092
+
1093
+ case 5737:
1094
+ case 4201:
1095
+ case 3177:
1096
+ case 3433:
1097
+ case 1641:
1098
+ case 4457:
1099
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
1100
+
1101
+ case 5572:
1102
+ case 6356:
1103
+ case 5844:
1104
+ case 3191:
1105
+ case 6645:
1106
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
1107
+
1108
+ case 6391:
1109
+ case 5879:
1110
+ case 5623:
1111
+ case 6135:
1112
+ case 4599:
1113
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
1114
+
1115
+ case 4215:
1116
+ case 6389:
1117
+ case 5109:
1118
+ case 5365:
1119
+ case 5621:
1120
+ case 3829:
1121
+ return WEBKIT + value + value;
1122
+ // appearance, user-select, transform, hyphens, text-size-adjust
1123
+
1124
+ case 5349:
1125
+ case 4246:
1126
+ case 4810:
1127
+ case 6968:
1128
+ case 2756:
1129
+ return WEBKIT + value + MOZ + value + MS + value + value;
1130
+ // flex, flex-direction
1131
+
1132
+ case 6828:
1133
+ case 4268:
1134
+ return WEBKIT + value + MS + value + value;
1135
+ // order
1136
+
1137
+ case 6165:
1138
+ return WEBKIT + value + MS + 'flex-' + value + value;
1139
+ // align-items
1140
+
1141
+ case 5187:
1142
+ return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
1143
+ // align-self
1144
+
1145
+ case 5443:
1146
+ return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
1147
+ // align-content
1148
+
1149
+ case 4675:
1150
+ return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
1151
+ // flex-shrink
1152
+
1153
+ case 5548:
1154
+ return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
1155
+ // flex-basis
1156
+
1157
+ case 5292:
1158
+ return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
1159
+ // flex-grow
1160
+
1161
+ case 6060:
1162
+ return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
1163
+ // transition
1164
+
1165
+ case 4554:
1166
+ return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
1167
+ // cursor
1168
+
1169
+ case 6187:
1170
+ return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
1171
+ // background, background-image
1172
+
1173
+ case 5495:
1174
+ case 3959:
1175
+ return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
1176
+ // justify-content
1177
+
1178
+ case 4968:
1179
+ return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
1180
+ // (margin|padding)-inline-(start|end)
1181
+
1182
+ case 4095:
1183
+ case 3583:
1184
+ case 4068:
1185
+ case 2532:
1186
+ return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
1187
+ // (min|max)?(width|height|inline-size|block-size)
1188
+
1189
+ case 8116:
1190
+ case 7059:
1191
+ case 5753:
1192
+ case 5535:
1193
+ case 5445:
1194
+ case 5701:
1195
+ case 4933:
1196
+ case 4677:
1197
+ case 5533:
1198
+ case 5789:
1199
+ case 5021:
1200
+ case 4765:
1201
+ // stretch, max-content, min-content, fill-available
1202
+ if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
1203
+ // (m)ax-content, (m)in-content
1204
+ case 109:
1205
+ // -
1206
+ if (charat(value, length + 4) !== 45) break;
1207
+ // (f)ill-available, (f)it-content
1208
+
1209
+ case 102:
1210
+ return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
1211
+ // (s)tretch
1212
+
1213
+ case 115:
1214
+ return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
1215
+ }
1216
+ break;
1217
+ // position: sticky
1218
+
1219
+ case 4949:
1220
+ // (s)ticky?
1221
+ if (charat(value, length + 1) !== 115) break;
1222
+ // display: (flex|inline-flex)
1223
+
1224
+ case 6444:
1225
+ switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
1226
+ // stic(k)y
1227
+ case 107:
1228
+ return replace(value, ':', ':' + WEBKIT) + value;
1229
+ // (inline-)?fl(e)x
1230
+
1231
+ case 101:
1232
+ return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
1233
+ }
1234
+
1235
+ break;
1236
+ // writing-mode
1237
+
1238
+ case 5936:
1239
+ switch (charat(value, length + 11)) {
1240
+ // vertical-l(r)
1241
+ case 114:
1242
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
1243
+ // vertical-r(l)
1244
+
1245
+ case 108:
1246
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
1247
+ // horizontal(-)tb
1248
+
1249
+ case 45:
1250
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
1251
+ }
1252
+
1253
+ return WEBKIT + value + MS + value + value;
1254
+ }
1255
+
1256
+ return value;
1257
+ }
1258
+
1259
+ var prefixer = function prefixer(element, index, children, callback) {
1260
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
1261
+ case DECLARATION:
1262
+ element["return"] = prefix(element.value, element.length);
1263
+ break;
1264
+
1265
+ case KEYFRAMES:
1266
+ return serialize([copy(element, {
1267
+ value: replace(element.value, '@', '@' + WEBKIT)
1268
+ })], callback);
1269
+
1270
+ case RULESET:
1271
+ if (element.length) return combine(element.props, function (value) {
1272
+ switch (match(value, /(::plac\w+|:read-\w+)/)) {
1273
+ // :read-(only|write)
1274
+ case ':read-only':
1275
+ case ':read-write':
1276
+ return serialize([copy(element, {
1277
+ props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
1278
+ })], callback);
1279
+ // :placeholder
1280
+
1281
+ case '::placeholder':
1282
+ return serialize([copy(element, {
1283
+ props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
1284
+ }), copy(element, {
1285
+ props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
1286
+ }), copy(element, {
1287
+ props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
1288
+ })], callback);
1289
+ }
1290
+
1291
+ return '';
1292
+ });
1293
+ }
1294
+ };
1295
+
1296
+ var isBrowser$1 = typeof document !== 'undefined';
1297
+ var getServerStylisCache = isBrowser$1 ? undefined : weakMemoize(function () {
1298
+ return memoize(function () {
1299
+ var cache = {};
1300
+ return function (name) {
1301
+ return cache[name];
1302
+ };
1303
+ });
1304
+ });
1305
+ var defaultStylisPlugins = [prefixer];
1306
+
1307
+ var createCache = function createCache(options) {
1308
+ var key = options.key;
1309
+
1310
+ if (process.env.NODE_ENV !== 'production' && !key) {
1311
+ 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.");
1312
+ }
1313
+
1314
+ if (isBrowser$1 && key === 'css') {
1315
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
1316
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
1317
+ // note this very very intentionally targets all style elements regardless of the key to ensure
1318
+ // that creating a cache works inside of render of a React component
1319
+
1320
+ Array.prototype.forEach.call(ssrStyles, function (node) {
1321
+ // we want to only move elements which have a space in the data-emotion attribute value
1322
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
1323
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
1324
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
1325
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
1326
+ // will not result in the Emotion 10 styles being destroyed
1327
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
1328
+
1329
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
1330
+ return;
1331
+ }
1332
+ document.head.appendChild(node);
1333
+ node.setAttribute('data-s', '');
1334
+ });
1335
+ }
1336
+
1337
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1338
+
1339
+ if (process.env.NODE_ENV !== 'production') {
1340
+ // $FlowFixMe
1341
+ if (/[^a-z-]/.test(key)) {
1342
+ throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
1343
+ }
1344
+ }
1345
+
1346
+ var inserted = {};
1347
+ var container;
1348
+ var nodesToHydrate = [];
1349
+
1350
+ if (isBrowser$1) {
1351
+ container = options.container || document.head;
1352
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
1353
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
1354
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
1355
+ var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
1356
+
1357
+ for (var i = 1; i < attrib.length; i++) {
1358
+ inserted[attrib[i]] = true;
1359
+ }
1360
+
1361
+ nodesToHydrate.push(node);
1362
+ });
1363
+ }
1364
+
1365
+ var _insert;
1366
+
1367
+ var omnipresentPlugins = [compat, removeLabel];
1368
+
1369
+ if (process.env.NODE_ENV !== 'production') {
1370
+ omnipresentPlugins.push(createUnsafeSelectorsAlarm({
1371
+ get compat() {
1372
+ return cache.compat;
1373
+ }
1374
+
1375
+ }), incorrectImportAlarm);
1376
+ }
1377
+
1378
+ if (isBrowser$1) {
1379
+ var currentSheet;
1380
+ var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {
1381
+ if (!element.root) {
1382
+ if (element["return"]) {
1383
+ currentSheet.insert(element["return"]);
1384
+ } else if (element.value && element.type !== COMMENT) {
1385
+ // insert empty rule in non-production environments
1386
+ // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
1387
+ currentSheet.insert(element.value + "{}");
1388
+ }
1389
+ }
1390
+ } : rulesheet(function (rule) {
1391
+ currentSheet.insert(rule);
1392
+ })];
1393
+ var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
1394
+
1395
+ var stylis = function stylis(styles) {
1396
+ return serialize(compile(styles), serializer);
1397
+ };
1398
+
1399
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
1400
+ currentSheet = sheet;
1401
+
1402
+ if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
1403
+ currentSheet = {
1404
+ insert: function insert(rule) {
1405
+ sheet.insert(rule + serialized.map);
1406
+ }
1407
+ };
1408
+ }
1409
+
1410
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1411
+
1412
+ if (shouldCache) {
1413
+ cache.inserted[serialized.name] = true;
1414
+ }
1415
+ };
1416
+ } else {
1417
+ var _finalizingPlugins = [stringify];
1418
+
1419
+ var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
1420
+
1421
+ var _stylis = function _stylis(styles) {
1422
+ return serialize(compile(styles), _serializer);
1423
+ }; // $FlowFixMe
1424
+
1425
+
1426
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
1427
+
1428
+ var getRules = function getRules(selector, serialized) {
1429
+ var name = serialized.name;
1430
+
1431
+ if (serverStylisCache[name] === undefined) {
1432
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1433
+ }
1434
+
1435
+ return serverStylisCache[name];
1436
+ };
1437
+
1438
+ _insert = function _insert(selector, serialized, sheet, shouldCache) {
1439
+ var name = serialized.name;
1440
+ var rules = getRules(selector, serialized);
1441
+
1442
+ if (cache.compat === undefined) {
1443
+ // in regular mode, we don't set the styles on the inserted cache
1444
+ // since we don't need to and that would be wasting memory
1445
+ // we return them so that they are rendered in a style tag
1446
+ if (shouldCache) {
1447
+ cache.inserted[name] = true;
1448
+ }
1449
+
1450
+ if ( // using === development instead of !== production
1451
+ // because if people do ssr in tests, the source maps showing up would be annoying
1452
+ process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
1453
+ return rules + serialized.map;
1454
+ }
1455
+
1456
+ return rules;
1457
+ } else {
1458
+ // in compat mode, we put the styles on the inserted cache so
1459
+ // that emotion-server can pull out the styles
1460
+ // except when we don't want to cache it which was in Global but now
1461
+ // is nowhere but we don't want to do a major right now
1462
+ // and just in case we're going to leave the case here
1463
+ // it's also not affecting client side bundle size
1464
+ // so it's really not a big deal
1465
+ if (shouldCache) {
1466
+ cache.inserted[name] = rules;
1467
+ } else {
1468
+ return rules;
1469
+ }
1470
+ }
1471
+ };
1472
+ }
1473
+
1474
+ var cache = {
1475
+ key: key,
1476
+ sheet: new StyleSheet({
1477
+ key: key,
1478
+ container: container,
1479
+ nonce: options.nonce,
1480
+ speedy: options.speedy,
1481
+ prepend: options.prepend,
1482
+ insertionPoint: options.insertionPoint
1483
+ }),
1484
+ nonce: options.nonce,
1485
+ inserted: inserted,
1486
+ registered: {},
1487
+ insert: _insert
1488
+ };
1489
+ cache.sheet.hydrate(nodesToHydrate);
1490
+ return cache;
1491
+ };
1492
+
1493
+ /* eslint-disable */
1494
+ // Inspired by https://github.com/garycourt/murmurhash-js
1495
+ // Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
1496
+ function murmur2(str) {
1497
+ // 'm' and 'r' are mixing constants generated offline.
1498
+ // They're not really 'magic', they just happen to work well.
1499
+ // const m = 0x5bd1e995;
1500
+ // const r = 24;
1501
+ // Initialize the hash
1502
+ var h = 0; // Mix 4 bytes at a time into the hash
1503
+
1504
+ var k,
1505
+ i = 0,
1506
+ len = str.length;
1507
+
1508
+ for (; len >= 4; ++i, len -= 4) {
1509
+ k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;
1510
+ k =
1511
+ /* Math.imul(k, m): */
1512
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);
1513
+ k ^=
1514
+ /* k >>> r: */
1515
+ k >>> 24;
1516
+ h =
1517
+ /* Math.imul(k, m): */
1518
+ (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^
1519
+ /* Math.imul(h, m): */
1520
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1521
+ } // Handle the last few bytes of the input array
1522
+
1523
+
1524
+ switch (len) {
1525
+ case 3:
1526
+ h ^= (str.charCodeAt(i + 2) & 0xff) << 16;
1527
+
1528
+ case 2:
1529
+ h ^= (str.charCodeAt(i + 1) & 0xff) << 8;
1530
+
1531
+ case 1:
1532
+ h ^= str.charCodeAt(i) & 0xff;
1533
+ h =
1534
+ /* Math.imul(h, m): */
1535
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1536
+ } // Do a few final mixes of the hash to ensure the last few
1537
+ // bytes are well-incorporated.
1538
+
1539
+
1540
+ h ^= h >>> 13;
1541
+ h =
1542
+ /* Math.imul(h, m): */
1543
+ (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);
1544
+ return ((h ^ h >>> 15) >>> 0).toString(36);
1545
+ }
1546
+
1547
+ var unitlessKeys = {
1548
+ animationIterationCount: 1,
1549
+ borderImageOutset: 1,
1550
+ borderImageSlice: 1,
1551
+ borderImageWidth: 1,
1552
+ boxFlex: 1,
1553
+ boxFlexGroup: 1,
1554
+ boxOrdinalGroup: 1,
1555
+ columnCount: 1,
1556
+ columns: 1,
1557
+ flex: 1,
1558
+ flexGrow: 1,
1559
+ flexPositive: 1,
1560
+ flexShrink: 1,
1561
+ flexNegative: 1,
1562
+ flexOrder: 1,
1563
+ gridRow: 1,
1564
+ gridRowEnd: 1,
1565
+ gridRowSpan: 1,
1566
+ gridRowStart: 1,
1567
+ gridColumn: 1,
1568
+ gridColumnEnd: 1,
1569
+ gridColumnSpan: 1,
1570
+ gridColumnStart: 1,
1571
+ msGridRow: 1,
1572
+ msGridRowSpan: 1,
1573
+ msGridColumn: 1,
1574
+ msGridColumnSpan: 1,
1575
+ fontWeight: 1,
1576
+ lineHeight: 1,
1577
+ opacity: 1,
1578
+ order: 1,
1579
+ orphans: 1,
1580
+ tabSize: 1,
1581
+ widows: 1,
1582
+ zIndex: 1,
1583
+ zoom: 1,
1584
+ WebkitLineClamp: 1,
1585
+ // SVG-related properties
1586
+ fillOpacity: 1,
1587
+ floodOpacity: 1,
1588
+ stopOpacity: 1,
1589
+ strokeDasharray: 1,
1590
+ strokeDashoffset: 1,
1591
+ strokeMiterlimit: 1,
1592
+ strokeOpacity: 1,
1593
+ strokeWidth: 1
1594
+ };
1595
+
1596
+ 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";
1597
+ 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).";
1598
+ var hyphenateRegex = /[A-Z]|^ms/g;
1599
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
1600
+
1601
+ var isCustomProperty = function isCustomProperty(property) {
1602
+ return property.charCodeAt(1) === 45;
1603
+ };
1604
+
1605
+ var isProcessableValue = function isProcessableValue(value) {
1606
+ return value != null && typeof value !== 'boolean';
1607
+ };
1608
+
1609
+ var processStyleName = /* #__PURE__ */memoize(function (styleName) {
1610
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();
1611
+ });
1612
+
1613
+ var processStyleValue = function processStyleValue(key, value) {
1614
+ switch (key) {
1615
+ case 'animation':
1616
+ case 'animationName':
1617
+ {
1618
+ if (typeof value === 'string') {
1619
+ return value.replace(animationRegex, function (match, p1, p2) {
1620
+ cursor = {
1621
+ name: p1,
1622
+ styles: p2,
1623
+ next: cursor
1624
+ };
1625
+ return p1;
1626
+ });
1627
+ }
1628
+ }
1629
+ }
1630
+
1631
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {
1632
+ return value + 'px';
1633
+ }
1634
+
1635
+ return value;
1636
+ };
1637
+
1638
+ if (process.env.NODE_ENV !== 'production') {
1639
+ var contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
1640
+ var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];
1641
+ var oldProcessStyleValue = processStyleValue;
1642
+ var msPattern = /^-ms-/;
1643
+ var hyphenPattern = /-(.)/g;
1644
+ var hyphenatedCache = {};
1645
+
1646
+ processStyleValue = function processStyleValue(key, value) {
1647
+ if (key === 'content') {
1648
+ 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) !== "'")) {
1649
+ throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
1650
+ }
1651
+ }
1652
+
1653
+ var processed = oldProcessStyleValue(key, value);
1654
+
1655
+ if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {
1656
+ hyphenatedCache[key] = true;
1657
+ 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) {
1658
+ return _char.toUpperCase();
1659
+ }) + "?");
1660
+ }
1661
+
1662
+ return processed;
1663
+ };
1664
+ }
1665
+
1666
+ var noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';
1667
+
1668
+ function handleInterpolation(mergedProps, registered, interpolation) {
1669
+ if (interpolation == null) {
1670
+ return '';
1671
+ }
1672
+
1673
+ if (interpolation.__emotion_styles !== undefined) {
1674
+ if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {
1675
+ throw new Error(noComponentSelectorMessage);
1676
+ }
1677
+
1678
+ return interpolation;
1679
+ }
1680
+
1681
+ switch (typeof interpolation) {
1682
+ case 'boolean':
1683
+ {
1684
+ return '';
1685
+ }
1686
+
1687
+ case 'object':
1688
+ {
1689
+ if (interpolation.anim === 1) {
1690
+ cursor = {
1691
+ name: interpolation.name,
1692
+ styles: interpolation.styles,
1693
+ next: cursor
1694
+ };
1695
+ return interpolation.name;
1696
+ }
1697
+
1698
+ if (interpolation.styles !== undefined) {
1699
+ var next = interpolation.next;
1700
+
1701
+ if (next !== undefined) {
1702
+ // not the most efficient thing ever but this is a pretty rare case
1703
+ // and there will be very few iterations of this generally
1704
+ while (next !== undefined) {
1705
+ cursor = {
1706
+ name: next.name,
1707
+ styles: next.styles,
1708
+ next: cursor
1709
+ };
1710
+ next = next.next;
1711
+ }
1712
+ }
1713
+
1714
+ var styles = interpolation.styles + ";";
1715
+
1716
+ if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {
1717
+ styles += interpolation.map;
1718
+ }
1719
+
1720
+ return styles;
1721
+ }
1722
+
1723
+ return createStringFromObject(mergedProps, registered, interpolation);
1724
+ }
1725
+
1726
+ case 'function':
1727
+ {
1728
+ if (mergedProps !== undefined) {
1729
+ var previousCursor = cursor;
1730
+ var result = interpolation(mergedProps);
1731
+ cursor = previousCursor;
1732
+ return handleInterpolation(mergedProps, registered, result);
1733
+ } else if (process.env.NODE_ENV !== 'production') {
1734
+ 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}`");
1735
+ }
1736
+
1737
+ break;
1738
+ }
1739
+
1740
+ case 'string':
1741
+ if (process.env.NODE_ENV !== 'production') {
1742
+ var matched = [];
1743
+ var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {
1744
+ var fakeVarName = "animation" + matched.length;
1745
+ matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, '') + "`");
1746
+ return "${" + fakeVarName + "}";
1747
+ });
1748
+
1749
+ if (matched.length) {
1750
+ 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 + "`"));
1751
+ }
1752
+ }
1753
+
1754
+ break;
1755
+ } // finalize string values (regular strings and functions interpolated into css calls)
1756
+
1757
+
1758
+ if (registered == null) {
1759
+ return interpolation;
1760
+ }
1761
+
1762
+ var cached = registered[interpolation];
1763
+ return cached !== undefined ? cached : interpolation;
1764
+ }
1765
+
1766
+ function createStringFromObject(mergedProps, registered, obj) {
1767
+ var string = '';
1768
+
1769
+ if (Array.isArray(obj)) {
1770
+ for (var i = 0; i < obj.length; i++) {
1771
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
1772
+ }
1773
+ } else {
1774
+ for (var _key in obj) {
1775
+ var value = obj[_key];
1776
+
1777
+ if (typeof value !== 'object') {
1778
+ if (registered != null && registered[value] !== undefined) {
1779
+ string += _key + "{" + registered[value] + "}";
1780
+ } else if (isProcessableValue(value)) {
1781
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
1782
+ }
1783
+ } else {
1784
+ if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {
1785
+ throw new Error(noComponentSelectorMessage);
1786
+ }
1787
+
1788
+ if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
1789
+ for (var _i = 0; _i < value.length; _i++) {
1790
+ if (isProcessableValue(value[_i])) {
1791
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
1792
+ }
1793
+ }
1794
+ } else {
1795
+ var interpolated = handleInterpolation(mergedProps, registered, value);
1796
+
1797
+ switch (_key) {
1798
+ case 'animation':
1799
+ case 'animationName':
1800
+ {
1801
+ string += processStyleName(_key) + ":" + interpolated + ";";
1802
+ break;
1803
+ }
1804
+
1805
+ default:
1806
+ {
1807
+ if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {
1808
+ console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
1809
+ }
1810
+
1811
+ string += _key + "{" + interpolated + "}";
1812
+ }
1813
+ }
1814
+ }
1815
+ }
1816
+ }
1817
+ }
1818
+
1819
+ return string;
1820
+ }
1821
+
1822
+ var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
1823
+ var sourceMapPattern;
1824
+
1825
+ if (process.env.NODE_ENV !== 'production') {
1826
+ sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
1827
+ } // this is the cursor for keyframes
1828
+ // keyframes are stored on the SerializedStyles object as a linked list
1829
+
1830
+
1831
+ var cursor;
1832
+ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
1833
+ if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {
1834
+ return args[0];
1835
+ }
1836
+
1837
+ var stringMode = true;
1838
+ var styles = '';
1839
+ cursor = undefined;
1840
+ var strings = args[0];
1841
+
1842
+ if (strings == null || strings.raw === undefined) {
1843
+ stringMode = false;
1844
+ styles += handleInterpolation(mergedProps, registered, strings);
1845
+ } else {
1846
+ if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {
1847
+ console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
1848
+ }
1849
+
1850
+ styles += strings[0];
1851
+ } // we start at 1 since we've already handled the first arg
1852
+
1853
+
1854
+ for (var i = 1; i < args.length; i++) {
1855
+ styles += handleInterpolation(mergedProps, registered, args[i]);
1856
+
1857
+ if (stringMode) {
1858
+ if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {
1859
+ console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
1860
+ }
1861
+
1862
+ styles += strings[i];
1863
+ }
1864
+ }
1865
+
1866
+ var sourceMap;
1867
+
1868
+ if (process.env.NODE_ENV !== 'production') {
1869
+ styles = styles.replace(sourceMapPattern, function (match) {
1870
+ sourceMap = match;
1871
+ return '';
1872
+ });
1873
+ } // using a global regex with .exec is stateful so lastIndex has to be reset each time
1874
+
1875
+
1876
+ labelPattern.lastIndex = 0;
1877
+ var identifierName = '';
1878
+ var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5
1879
+
1880
+ while ((match = labelPattern.exec(styles)) !== null) {
1881
+ identifierName += '-' + // $FlowFixMe we know it's not null
1882
+ match[1];
1883
+ }
1884
+
1885
+ var name = murmur2(styles) + identifierName;
1886
+
1887
+ if (process.env.NODE_ENV !== 'production') {
1888
+ // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)
1889
+ return {
1890
+ name: name,
1891
+ styles: styles,
1892
+ map: sourceMap,
1893
+ next: cursor,
1894
+ toString: function toString() {
1895
+ 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).";
1896
+ }
1897
+ };
1898
+ }
1899
+
1900
+ return {
1901
+ name: name,
1902
+ styles: styles,
1903
+ next: cursor
1904
+ };
1905
+ };
1906
+
1907
+ var isBrowser = typeof document !== 'undefined';
1908
+ function getRegisteredStyles(registered, registeredStyles, classNames) {
1909
+ var rawClassName = '';
1910
+ classNames.split(' ').forEach(function (className) {
1911
+ if (registered[className] !== undefined) {
1912
+ registeredStyles.push(registered[className] + ";");
1913
+ } else {
1914
+ rawClassName += className + " ";
1915
+ }
1916
+ });
1917
+ return rawClassName;
1918
+ }
1919
+ var registerStyles = function registerStyles(cache, serialized, isStringTag) {
1920
+ var className = cache.key + "-" + serialized.name;
1921
+
1922
+ if ( // we only need to add the styles to the registered cache if the
1923
+ // class name could be used further down
1924
+ // the tree but if it's a string tag, we know it won't
1925
+ // so we don't have to add it to registered cache.
1926
+ // this improves memory usage since we can avoid storing the whole style string
1927
+ (isStringTag === false || // we need to always store it if we're in compat mode and
1928
+ // in node since emotion-server relies on whether a style is in
1929
+ // the registered cache to know whether a style is global or not
1930
+ // also, note that this check will be dead code eliminated in the browser
1931
+ isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {
1932
+ cache.registered[className] = serialized.styles;
1933
+ }
1934
+ };
1935
+ var insertStyles = function insertStyles(cache, serialized, isStringTag) {
1936
+ registerStyles(cache, serialized, isStringTag);
1937
+ var className = cache.key + "-" + serialized.name;
1938
+
1939
+ if (cache.inserted[serialized.name] === undefined) {
1940
+ var stylesForSSR = '';
1941
+ var current = serialized;
1942
+
1943
+ do {
1944
+ var maybeStyles = cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
1945
+
1946
+ if (!isBrowser && maybeStyles !== undefined) {
1947
+ stylesForSSR += maybeStyles;
1948
+ }
1949
+
1950
+ current = current.next;
1951
+ } while (current !== undefined);
1952
+
1953
+ if (!isBrowser && stylesForSSR.length !== 0) {
1954
+ return stylesForSSR;
1955
+ }
1956
+ }
1957
+ };
1958
+
1959
+ function insertWithoutScoping(cache, serialized) {
1960
+ if (cache.inserted[serialized.name] === undefined) {
1961
+ return cache.insert('', serialized, cache.sheet, true);
1962
+ }
1963
+ }
1964
+
1965
+ function merge(registered, css, className) {
1966
+ var registeredStyles = [];
1967
+ var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
1968
+
1969
+ if (registeredStyles.length < 2) {
1970
+ return className;
1971
+ }
1972
+
1973
+ return rawClassName + css(registeredStyles);
1974
+ }
1975
+
1976
+ var createEmotion = function createEmotion(options) {
1977
+ var cache = createCache(options); // $FlowFixMe
1978
+
1979
+ cache.sheet.speedy = function (value) {
1980
+ if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) {
1981
+ throw new Error('speedy must be changed before any rules are inserted');
1982
+ }
1983
+
1984
+ this.isSpeedy = value;
1985
+ };
1986
+
1987
+ cache.compat = true;
1988
+
1989
+ var css = function css() {
1990
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1991
+ args[_key] = arguments[_key];
1992
+ }
1993
+
1994
+ var serialized = serializeStyles(args, cache.registered, undefined);
1995
+ insertStyles(cache, serialized, false);
1996
+ return cache.key + "-" + serialized.name;
1997
+ };
1998
+
1999
+ var keyframes = function keyframes() {
2000
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
2001
+ args[_key2] = arguments[_key2];
2002
+ }
2003
+
2004
+ var serialized = serializeStyles(args, cache.registered);
2005
+ var animation = "animation-" + serialized.name;
2006
+ insertWithoutScoping(cache, {
2007
+ name: serialized.name,
2008
+ styles: "@keyframes " + animation + "{" + serialized.styles + "}"
2009
+ });
2010
+ return animation;
2011
+ };
2012
+
2013
+ var injectGlobal = function injectGlobal() {
2014
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
2015
+ args[_key3] = arguments[_key3];
2016
+ }
2017
+
2018
+ var serialized = serializeStyles(args, cache.registered);
2019
+ insertWithoutScoping(cache, serialized);
2020
+ };
2021
+
2022
+ var cx = function cx() {
2023
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
2024
+ args[_key4] = arguments[_key4];
2025
+ }
2026
+
2027
+ return merge(cache.registered, css, classnames(args));
2028
+ };
2029
+
2030
+ return {
2031
+ css: css,
2032
+ cx: cx,
2033
+ injectGlobal: injectGlobal,
2034
+ keyframes: keyframes,
2035
+ hydrate: function hydrate(ids) {
2036
+ ids.forEach(function (key) {
2037
+ cache.inserted[key] = true;
2038
+ });
2039
+ },
2040
+ flush: function flush() {
2041
+ cache.registered = {};
2042
+ cache.inserted = {};
2043
+ cache.sheet.flush();
2044
+ },
2045
+ // $FlowFixMe
2046
+ sheet: cache.sheet,
2047
+ cache: cache,
2048
+ getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
2049
+ merge: merge.bind(null, cache.registered, css)
2050
+ };
2051
+ };
2052
+
2053
+ var classnames = function classnames(args) {
2054
+ var cls = '';
2055
+
2056
+ for (var i = 0; i < args.length; i++) {
2057
+ var arg = args[i];
2058
+ if (arg == null) continue;
2059
+ var toAdd = void 0;
2060
+
2061
+ switch (typeof arg) {
2062
+ case 'boolean':
2063
+ break;
2064
+
2065
+ case 'object':
2066
+ {
2067
+ if (Array.isArray(arg)) {
2068
+ toAdd = classnames(arg);
2069
+ } else {
2070
+ toAdd = '';
2071
+
2072
+ for (var k in arg) {
2073
+ if (arg[k] && k) {
2074
+ toAdd && (toAdd += ' ');
2075
+ toAdd += k;
2076
+ }
2077
+ }
2078
+ }
2079
+
2080
+ break;
2081
+ }
2082
+
2083
+ default:
2084
+ {
2085
+ toAdd = arg;
2086
+ }
2087
+ }
2088
+
2089
+ if (toAdd) {
2090
+ cls && (cls += ' ');
2091
+ cls += toAdd;
2092
+ }
2093
+ }
2094
+
2095
+ return cls;
2096
+ };
2097
+
2098
+ var _createEmotion = createEmotion({
2099
+ key: 'css'
2100
+ }),
2101
+ css = _createEmotion.css;
2102
+
79
2103
  var __defProp$7 = Object.defineProperty;
80
2104
  var __defProps$6 = Object.defineProperties;
81
2105
  var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
@@ -96,7 +2120,7 @@ var __spreadValues$7 = (a, b) => {
96
2120
  };
97
2121
  var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
98
2122
  const DEFAULT_LABEL_WIDTH = 28;
99
- const DS_TYPES_THAT_SUPPORT_TEMP_CREDS = ["cloudwatch"];
2123
+ const DS_TYPES_THAT_SUPPORT_TEMP_CREDS = ["cloudwatch", "grafana-athena-datasource"];
100
2124
  const toOption = (value) => ({ value, label: value });
101
2125
  const isAwsAuthType = (value) => {
102
2126
  return typeof value === "string" && awsAuthProviderOptions.some((opt) => opt.value === value);
@@ -134,6 +2158,7 @@ const ConnectionConfig = (props) => {
134
2158
  loadRegions().then((regions2) => setRegions(regions2.map(toOption)));
135
2159
  }, [loadRegions]);
136
2160
  const inputWidth = inExperimentalAuthComponent ? "width-20" : "width-30";
2161
+ const styles = ui.useStyles2(getStyles);
137
2162
  return /* @__PURE__ */ React__default["default"].createElement(ui.FieldSet, { label: skipHeader ? "" : "Connection Details", "data-testid": "connection-config" }, /* @__PURE__ */ React__default["default"].createElement(
138
2163
  ui.InlineField,
139
2164
  {
@@ -204,7 +2229,7 @@ const ConnectionConfig = (props) => {
204
2229
  value: (_g = (_f = options.secureJsonData) == null ? void 0 : _f.secretKey) != null ? _g : "",
205
2230
  onChange: data.onUpdateDatasourceSecureJsonDataOption(props, "secretKey")
206
2231
  }
207
- ))), options.jsonData.authType === AwsAuthType.GrafanaAssumeRole && /* @__PURE__ */ React__default["default"].createElement(
2232
+ ))), options.jsonData.authType === AwsAuthType.GrafanaAssumeRole && /* @__PURE__ */ React__default["default"].createElement("div", { className: styles.assumeRoleInstructions }, /* @__PURE__ */ React__default["default"].createElement(
208
2233
  ui.Collapse,
209
2234
  {
210
2235
  label: "How to create an IAM role for grafana to assume:",
@@ -221,7 +2246,7 @@ const ConnectionConfig = (props) => {
221
2246
  },
222
2247
  "read through our documentation"
223
2248
  ), ".")), /* @__PURE__ */ React__default["default"].createElement("li", null, /* @__PURE__ */ React__default["default"].createElement("p", null, "5. Give the role a name and description, and click ", /* @__PURE__ */ React__default["default"].createElement("code", null, "Create role"), ".")), /* @__PURE__ */ React__default["default"].createElement("li", null, /* @__PURE__ */ React__default["default"].createElement("p", null, "6. Copy the ARN of the role you just created and paste it into the ", /* @__PURE__ */ React__default["default"].createElement("code", null, "Assume Role ARN"), " field below.")))
224
- ), awsAssumeRoleEnabled && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(
2249
+ )), awsAssumeRoleEnabled && /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement(
225
2250
  ui.InlineField,
226
2251
  {
227
2252
  label: "Assume Role ARN",
@@ -295,6 +2320,13 @@ const ConnectionConfig = (props) => {
295
2320
  )
296
2321
  ), props.children);
297
2322
  };
2323
+ function getStyles() {
2324
+ return {
2325
+ assumeRoleInstructions: css({
2326
+ maxWidth: "715px"
2327
+ })
2328
+ };
2329
+ }
298
2330
 
299
2331
  var __defProp$6 = Object.defineProperty;
300
2332
  var __defProps$5 = Object.defineProperties;