@polymarket-developers/clob-client 1.0.7

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 (48) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +78 -0
  4. package/cache/LICENSE +21 -0
  5. package/cache/README.md +62 -0
  6. package/cache/dist/declarations/src/index.d.ts +2 -0
  7. package/cache/dist/declarations/types/index.d.ts +45 -0
  8. package/cache/dist/emotion-cache.browser.cjs.default.js +1 -0
  9. package/cache/dist/emotion-cache.browser.cjs.js +471 -0
  10. package/cache/dist/emotion-cache.browser.cjs.mjs +2 -0
  11. package/cache/dist/emotion-cache.browser.development.cjs.default.js +1 -0
  12. package/cache/dist/emotion-cache.browser.development.cjs.js +616 -0
  13. package/cache/dist/emotion-cache.browser.development.cjs.mjs +2 -0
  14. package/cache/dist/emotion-cache.browser.development.esm.js +612 -0
  15. package/cache/dist/emotion-cache.browser.esm.js +467 -0
  16. package/cache/dist/emotion-cache.cjs.d.mts +3 -0
  17. package/cache/dist/emotion-cache.cjs.d.ts +3 -0
  18. package/cache/dist/emotion-cache.cjs.default.d.ts +1 -0
  19. package/cache/dist/emotion-cache.cjs.default.js +1 -0
  20. package/cache/dist/emotion-cache.cjs.js +565 -0
  21. package/cache/dist/emotion-cache.cjs.mjs +2 -0
  22. package/cache/dist/emotion-cache.development.cjs.default.js +1 -0
  23. package/cache/dist/emotion-cache.development.cjs.js +714 -0
  24. package/cache/dist/emotion-cache.development.cjs.mjs +2 -0
  25. package/cache/dist/emotion-cache.development.edge-light.cjs.default.js +1 -0
  26. package/cache/dist/emotion-cache.development.edge-light.cjs.js +621 -0
  27. package/cache/dist/emotion-cache.development.edge-light.cjs.mjs +2 -0
  28. package/cache/dist/emotion-cache.development.edge-light.esm.js +612 -0
  29. package/cache/dist/emotion-cache.development.esm.js +705 -0
  30. package/cache/dist/emotion-cache.edge-light.cjs.default.js +1 -0
  31. package/cache/dist/emotion-cache.edge-light.cjs.js +490 -0
  32. package/cache/dist/emotion-cache.edge-light.cjs.mjs +2 -0
  33. package/cache/dist/emotion-cache.edge-light.esm.js +481 -0
  34. package/cache/dist/emotion-cache.esm.js +556 -0
  35. package/cache/package.json +100 -0
  36. package/cache/src/conditions/false.js +1 -0
  37. package/cache/src/conditions/is-browser.js +1 -0
  38. package/cache/src/conditions/true.js +1 -0
  39. package/cache/src/index.d.ts +2 -0
  40. package/cache/src/index.js +257 -0
  41. package/cache/src/prefixer.js +340 -0
  42. package/cache/src/stylis-plugins.js +269 -0
  43. package/cache/src/types.js +26 -0
  44. package/cache/types/index.d.ts +45 -0
  45. package/index.d.ts +63 -0
  46. package/index.js +204 -0
  47. package/package.json +27 -0
  48. package/utils.js +15 -0
@@ -0,0 +1,612 @@
1
+ import { StyleSheet } from '@emotion/sheet';
2
+ import { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, middleware, stringify, COMMENT, compile } from 'stylis';
3
+ import '@emotion/weak-memoize';
4
+ import '@emotion/memoize';
5
+
6
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
7
+ var previous = 0;
8
+ var character = 0;
9
+
10
+ while (true) {
11
+ previous = character;
12
+ character = peek(); // &\f
13
+
14
+ if (previous === 38 && character === 12) {
15
+ points[index] = 1;
16
+ }
17
+
18
+ if (token(character)) {
19
+ break;
20
+ }
21
+
22
+ next();
23
+ }
24
+
25
+ return slice(begin, position);
26
+ };
27
+
28
+ var toRules = function toRules(parsed, points) {
29
+ // pretend we've started with a comma
30
+ var index = -1;
31
+ var character = 44;
32
+
33
+ do {
34
+ switch (token(character)) {
35
+ case 0:
36
+ // &\f
37
+ if (character === 38 && peek() === 12) {
38
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
39
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
40
+ // and when it should just concatenate the outer and inner selectors
41
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
42
+ points[index] = 1;
43
+ }
44
+
45
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
46
+ break;
47
+
48
+ case 2:
49
+ parsed[index] += delimit(character);
50
+ break;
51
+
52
+ case 4:
53
+ // comma
54
+ if (character === 44) {
55
+ // colon
56
+ parsed[++index] = peek() === 58 ? '&\f' : '';
57
+ points[index] = parsed[index].length;
58
+ break;
59
+ }
60
+
61
+ // fallthrough
62
+
63
+ default:
64
+ parsed[index] += from(character);
65
+ }
66
+ } while (character = next());
67
+
68
+ return parsed;
69
+ };
70
+
71
+ var getRules = function getRules(value, points) {
72
+ return dealloc(toRules(alloc(value), points));
73
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
74
+
75
+
76
+ var fixedElements = /* #__PURE__ */new WeakMap();
77
+ var compat = function compat(element) {
78
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
79
+ // negative .length indicates that this rule has been already prefixed
80
+ element.length < 1) {
81
+ return;
82
+ }
83
+
84
+ var value = element.value,
85
+ parent = element.parent;
86
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
87
+
88
+ while (parent.type !== 'rule') {
89
+ parent = parent.parent;
90
+ if (!parent) return;
91
+ } // short-circuit for the simplest case
92
+
93
+
94
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
95
+ /* colon */
96
+ && !fixedElements.get(parent)) {
97
+ return;
98
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
99
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
100
+
101
+
102
+ if (isImplicitRule) {
103
+ return;
104
+ }
105
+
106
+ fixedElements.set(element, true);
107
+ var points = [];
108
+ var rules = getRules(value, points);
109
+ var parentRules = parent.props;
110
+
111
+ for (var i = 0, k = 0; i < rules.length; i++) {
112
+ for (var j = 0; j < parentRules.length; j++, k++) {
113
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
114
+ }
115
+ }
116
+ };
117
+ var removeLabel = function removeLabel(element) {
118
+ if (element.type === 'decl') {
119
+ var value = element.value;
120
+
121
+ if ( // charcode for l
122
+ value.charCodeAt(0) === 108 && // charcode for b
123
+ value.charCodeAt(2) === 98) {
124
+ // this ignores label
125
+ element["return"] = '';
126
+ element.value = '';
127
+ }
128
+ }
129
+ };
130
+ var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
131
+
132
+ var isIgnoringComment = function isIgnoringComment(element) {
133
+ return element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
134
+ };
135
+
136
+ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
137
+ return function (element, index, children) {
138
+ if (element.type !== 'rule' || cache.compat) return;
139
+ var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
140
+
141
+ if (unsafePseudoClasses) {
142
+ var isNested = !!element.parent; // in nested rules comments become children of the "auto-inserted" rule and that's always the `element.parent`
143
+ //
144
+ // considering this input:
145
+ // .a {
146
+ // .b /* comm */ {}
147
+ // color: hotpink;
148
+ // }
149
+ // we get output corresponding to this:
150
+ // .a {
151
+ // & {
152
+ // /* comm */
153
+ // color: hotpink;
154
+ // }
155
+ // .b {}
156
+ // }
157
+
158
+ var commentContainer = isNested ? element.parent.children : // global rule at the root level
159
+ children;
160
+
161
+ for (var i = commentContainer.length - 1; i >= 0; i--) {
162
+ var node = commentContainer[i];
163
+
164
+ if (node.line < element.line) {
165
+ break;
166
+ } // it is quite weird but comments are *usually* put at `column: element.column - 1`
167
+ // so we seek *from the end* for the node that is earlier than the rule's `element` and check that
168
+ // this will also match inputs like this:
169
+ // .a {
170
+ // /* comm */
171
+ // .b {}
172
+ // }
173
+ //
174
+ // but that is fine
175
+ //
176
+ // it would be the easiest to change the placement of the comment to be the first child of the rule:
177
+ // .a {
178
+ // .b { /* comm */ }
179
+ // }
180
+ // with such inputs we wouldn't have to search for the comment at all
181
+ // TODO: consider changing this comment placement in the next major version
182
+
183
+
184
+ if (node.column < element.column) {
185
+ if (isIgnoringComment(node)) {
186
+ return;
187
+ }
188
+
189
+ break;
190
+ }
191
+ }
192
+
193
+ unsafePseudoClasses.forEach(function (unsafePseudoClass) {
194
+ console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
195
+ });
196
+ }
197
+ };
198
+ };
199
+
200
+ var isImportRule = function isImportRule(element) {
201
+ return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
202
+ };
203
+
204
+ var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
205
+ for (var i = index - 1; i >= 0; i--) {
206
+ if (!isImportRule(children[i])) {
207
+ return true;
208
+ }
209
+ }
210
+
211
+ return false;
212
+ }; // use this to remove incorrect elements from further processing
213
+ // so they don't get handed to the `sheet` (or anything else)
214
+ // as that could potentially lead to additional logs which in turn could be overhelming to the user
215
+
216
+
217
+ var nullifyElement = function nullifyElement(element) {
218
+ element.type = '';
219
+ element.value = '';
220
+ element["return"] = '';
221
+ element.children = '';
222
+ element.props = '';
223
+ };
224
+
225
+ var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
226
+ if (!isImportRule(element)) {
227
+ return;
228
+ }
229
+
230
+ if (element.parent) {
231
+ 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.");
232
+ nullifyElement(element);
233
+ } else if (isPrependedWithRegularRules(index, children)) {
234
+ console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
235
+ nullifyElement(element);
236
+ }
237
+ };
238
+
239
+ /* eslint-disable no-fallthrough */
240
+
241
+ function prefix(value, length) {
242
+ switch (hash(value, length)) {
243
+ // color-adjust
244
+ case 5103:
245
+ return WEBKIT + 'print-' + value + value;
246
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
247
+
248
+ case 5737:
249
+ case 4201:
250
+ case 3177:
251
+ case 3433:
252
+ case 1641:
253
+ case 4457:
254
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
255
+
256
+ case 5572:
257
+ case 6356:
258
+ case 5844:
259
+ case 3191:
260
+ case 6645:
261
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
262
+
263
+ case 6391:
264
+ case 5879:
265
+ case 5623:
266
+ case 6135:
267
+ case 4599:
268
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
269
+
270
+ case 4215:
271
+ case 6389:
272
+ case 5109:
273
+ case 5365:
274
+ case 5621:
275
+ case 3829:
276
+ return WEBKIT + value + value;
277
+ // appearance, user-select, transform, hyphens, text-size-adjust
278
+
279
+ case 5349:
280
+ case 4246:
281
+ case 4810:
282
+ case 6968:
283
+ case 2756:
284
+ return WEBKIT + value + MOZ + value + MS + value + value;
285
+ // flex, flex-direction
286
+
287
+ case 6828:
288
+ case 4268:
289
+ return WEBKIT + value + MS + value + value;
290
+ // order
291
+
292
+ case 6165:
293
+ return WEBKIT + value + MS + 'flex-' + value + value;
294
+ // align-items
295
+
296
+ case 5187:
297
+ return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
298
+ // align-self
299
+
300
+ case 5443:
301
+ return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
302
+ // align-content
303
+
304
+ case 4675:
305
+ return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
306
+ // flex-shrink
307
+
308
+ case 5548:
309
+ return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
310
+ // flex-basis
311
+
312
+ case 5292:
313
+ return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
314
+ // flex-grow
315
+
316
+ case 6060:
317
+ return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
318
+ // transition
319
+
320
+ case 4554:
321
+ return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
322
+ // cursor
323
+
324
+ case 6187:
325
+ return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
326
+ // background, background-image
327
+
328
+ case 5495:
329
+ case 3959:
330
+ return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
331
+ // justify-content
332
+
333
+ case 4968:
334
+ return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
335
+ // (margin|padding)-inline-(start|end)
336
+
337
+ case 4095:
338
+ case 3583:
339
+ case 4068:
340
+ case 2532:
341
+ return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
342
+ // (min|max)?(width|height|inline-size|block-size)
343
+
344
+ case 8116:
345
+ case 7059:
346
+ case 5753:
347
+ case 5535:
348
+ case 5445:
349
+ case 5701:
350
+ case 4933:
351
+ case 4677:
352
+ case 5533:
353
+ case 5789:
354
+ case 5021:
355
+ case 4765:
356
+ // stretch, max-content, min-content, fill-available
357
+ if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
358
+ // (m)ax-content, (m)in-content
359
+ case 109:
360
+ // -
361
+ if (charat(value, length + 4) !== 45) break;
362
+ // (f)ill-available, (f)it-content
363
+
364
+ case 102:
365
+ return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
366
+ // (s)tretch
367
+
368
+ case 115:
369
+ return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
370
+ }
371
+ break;
372
+ // position: sticky
373
+
374
+ case 4949:
375
+ // (s)ticky?
376
+ if (charat(value, length + 1) !== 115) break;
377
+ // display: (flex|inline-flex)
378
+
379
+ case 6444:
380
+ switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
381
+ // stic(k)y
382
+ case 107:
383
+ return replace(value, ':', ':' + WEBKIT) + value;
384
+ // (inline-)?fl(e)x
385
+
386
+ case 101:
387
+ return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
388
+ }
389
+
390
+ break;
391
+ // writing-mode
392
+
393
+ case 5936:
394
+ switch (charat(value, length + 11)) {
395
+ // vertical-l(r)
396
+ case 114:
397
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
398
+ // vertical-r(l)
399
+
400
+ case 108:
401
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
402
+ // horizontal(-)tb
403
+
404
+ case 45:
405
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
406
+ }
407
+
408
+ return WEBKIT + value + MS + value + value;
409
+ }
410
+
411
+ return value;
412
+ }
413
+
414
+ var prefixer = function prefixer(element, index, children, callback) {
415
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
416
+ case DECLARATION:
417
+ element["return"] = prefix(element.value, element.length);
418
+ break;
419
+
420
+ case KEYFRAMES:
421
+ return serialize([copy(element, {
422
+ value: replace(element.value, '@', '@' + WEBKIT)
423
+ })], callback);
424
+
425
+ case RULESET:
426
+ if (element.length) return combine(element.props, function (value) {
427
+ switch (match(value, /(::plac\w+|:read-\w+)/)) {
428
+ // :read-(only|write)
429
+ case ':read-only':
430
+ case ':read-write':
431
+ return serialize([copy(element, {
432
+ props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
433
+ })], callback);
434
+ // :placeholder
435
+
436
+ case '::placeholder':
437
+ return serialize([copy(element, {
438
+ props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
439
+ }), copy(element, {
440
+ props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
441
+ }), copy(element, {
442
+ props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
443
+ })], callback);
444
+ }
445
+
446
+ return '';
447
+ });
448
+ }
449
+ };
450
+
451
+ var defaultStylisPlugins = [prefixer];
452
+
453
+ var createCache = function
454
+ /*: EmotionCache */
455
+ createCache(options
456
+ /*: Options */
457
+ ) {
458
+ var key = options.key;
459
+
460
+ if (!key) {
461
+ 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.");
462
+ }
463
+
464
+ if (key === 'css') {
465
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
466
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
467
+ // note this very very intentionally targets all style elements regardless of the key to ensure
468
+ // that creating a cache works inside of render of a React component
469
+
470
+ Array.prototype.forEach.call(ssrStyles, function (node
471
+ /*: HTMLStyleElement */
472
+ ) {
473
+ // we want to only move elements which have a space in the data-emotion attribute value
474
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
475
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
476
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
477
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
478
+ // will not result in the Emotion 10 styles being destroyed
479
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
480
+
481
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
482
+ return;
483
+ }
484
+
485
+ document.head.appendChild(node);
486
+ node.setAttribute('data-s', '');
487
+ });
488
+ }
489
+
490
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
491
+
492
+ {
493
+ if (/[^a-z-]/.test(key)) {
494
+ throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
495
+ }
496
+ }
497
+
498
+ var inserted = {};
499
+ var container;
500
+ /* : Node */
501
+
502
+ var nodesToHydrate = [];
503
+
504
+ {
505
+ container = options.container || document.head;
506
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
507
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
508
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
509
+ /*: HTMLStyleElement */
510
+ ) {
511
+ var attrib = node.getAttribute("data-emotion").split(' ');
512
+
513
+ for (var i = 1; i < attrib.length; i++) {
514
+ inserted[attrib[i]] = true;
515
+ }
516
+
517
+ nodesToHydrate.push(node);
518
+ });
519
+ }
520
+
521
+ var _insert;
522
+ /*: (
523
+ selector: string,
524
+ serialized: SerializedStyles,
525
+ sheet: StyleSheet,
526
+ shouldCache: boolean
527
+ ) => string | void */
528
+
529
+
530
+ var omnipresentPlugins = [compat, removeLabel];
531
+
532
+ {
533
+ omnipresentPlugins.push(createUnsafeSelectorsAlarm({
534
+ get compat() {
535
+ return cache.compat;
536
+ }
537
+
538
+ }), incorrectImportAlarm);
539
+ }
540
+
541
+ {
542
+ var currentSheet;
543
+ var finalizingPlugins = [stringify, function (element) {
544
+ if (!element.root) {
545
+ if (element["return"]) {
546
+ currentSheet.insert(element["return"]);
547
+ } else if (element.value && element.type !== COMMENT) {
548
+ // insert empty rule in non-production environments
549
+ // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
550
+ currentSheet.insert(element.value + "{}");
551
+ }
552
+ }
553
+ } ];
554
+ var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
555
+
556
+ var stylis = function stylis(styles) {
557
+ return serialize(compile(styles), serializer);
558
+ };
559
+
560
+ _insert = function
561
+ /*: void */
562
+ insert(selector
563
+ /*: string */
564
+ , serialized
565
+ /*: SerializedStyles */
566
+ , sheet
567
+ /*: StyleSheet */
568
+ , shouldCache
569
+ /*: boolean */
570
+ ) {
571
+ currentSheet = sheet;
572
+
573
+ if (serialized.map !== undefined) {
574
+ currentSheet = {
575
+ insert: function insert(rule
576
+ /*: string */
577
+ ) {
578
+ sheet.insert(rule + serialized.map);
579
+ }
580
+ };
581
+ }
582
+
583
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
584
+
585
+ if (shouldCache) {
586
+ cache.inserted[serialized.name] = true;
587
+ }
588
+ };
589
+ }
590
+
591
+ var cache
592
+ /*: EmotionCache */
593
+ = {
594
+ key: key,
595
+ sheet: new StyleSheet({
596
+ key: key,
597
+ container: container,
598
+ nonce: options.nonce,
599
+ speedy: options.speedy,
600
+ prepend: options.prepend,
601
+ insertionPoint: options.insertionPoint
602
+ }),
603
+ nonce: options.nonce,
604
+ inserted: inserted,
605
+ registered: {},
606
+ insert: _insert
607
+ };
608
+ cache.sheet.hydrate(nodesToHydrate);
609
+ return cache;
610
+ };
611
+
612
+ export { createCache as default };