@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,471 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var sheet = require('@emotion/sheet');
6
+ var stylis = require('stylis');
7
+ require('@emotion/weak-memoize');
8
+ require('@emotion/memoize');
9
+
10
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
11
+ var previous = 0;
12
+ var character = 0;
13
+
14
+ while (true) {
15
+ previous = character;
16
+ character = stylis.peek(); // &\f
17
+
18
+ if (previous === 38 && character === 12) {
19
+ points[index] = 1;
20
+ }
21
+
22
+ if (stylis.token(character)) {
23
+ break;
24
+ }
25
+
26
+ stylis.next();
27
+ }
28
+
29
+ return stylis.slice(begin, stylis.position);
30
+ };
31
+
32
+ var toRules = function toRules(parsed, points) {
33
+ // pretend we've started with a comma
34
+ var index = -1;
35
+ var character = 44;
36
+
37
+ do {
38
+ switch (stylis.token(character)) {
39
+ case 0:
40
+ // &\f
41
+ if (character === 38 && stylis.peek() === 12) {
42
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
43
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
44
+ // and when it should just concatenate the outer and inner selectors
45
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
46
+ points[index] = 1;
47
+ }
48
+
49
+ parsed[index] += identifierWithPointTracking(stylis.position - 1, points, index);
50
+ break;
51
+
52
+ case 2:
53
+ parsed[index] += stylis.delimit(character);
54
+ break;
55
+
56
+ case 4:
57
+ // comma
58
+ if (character === 44) {
59
+ // colon
60
+ parsed[++index] = stylis.peek() === 58 ? '&\f' : '';
61
+ points[index] = parsed[index].length;
62
+ break;
63
+ }
64
+
65
+ // fallthrough
66
+
67
+ default:
68
+ parsed[index] += stylis.from(character);
69
+ }
70
+ } while (character = stylis.next());
71
+
72
+ return parsed;
73
+ };
74
+
75
+ var getRules = function getRules(value, points) {
76
+ return stylis.dealloc(toRules(stylis.alloc(value), points));
77
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
78
+
79
+
80
+ var fixedElements = /* #__PURE__ */new WeakMap();
81
+ var compat = function compat(element) {
82
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
83
+ // negative .length indicates that this rule has been already prefixed
84
+ element.length < 1) {
85
+ return;
86
+ }
87
+
88
+ var value = element.value,
89
+ parent = element.parent;
90
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
91
+
92
+ while (parent.type !== 'rule') {
93
+ parent = parent.parent;
94
+ if (!parent) return;
95
+ } // short-circuit for the simplest case
96
+
97
+
98
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
99
+ /* colon */
100
+ && !fixedElements.get(parent)) {
101
+ return;
102
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
103
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
104
+
105
+
106
+ if (isImplicitRule) {
107
+ return;
108
+ }
109
+
110
+ fixedElements.set(element, true);
111
+ var points = [];
112
+ var rules = getRules(value, points);
113
+ var parentRules = parent.props;
114
+
115
+ for (var i = 0, k = 0; i < rules.length; i++) {
116
+ for (var j = 0; j < parentRules.length; j++, k++) {
117
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
118
+ }
119
+ }
120
+ };
121
+ var removeLabel = function removeLabel(element) {
122
+ if (element.type === 'decl') {
123
+ var value = element.value;
124
+
125
+ if ( // charcode for l
126
+ value.charCodeAt(0) === 108 && // charcode for b
127
+ value.charCodeAt(2) === 98) {
128
+ // this ignores label
129
+ element["return"] = '';
130
+ element.value = '';
131
+ }
132
+ }
133
+ };
134
+
135
+ /* eslint-disable no-fallthrough */
136
+
137
+ function prefix(value, length) {
138
+ switch (stylis.hash(value, length)) {
139
+ // color-adjust
140
+ case 5103:
141
+ return stylis.WEBKIT + 'print-' + value + value;
142
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
143
+
144
+ case 5737:
145
+ case 4201:
146
+ case 3177:
147
+ case 3433:
148
+ case 1641:
149
+ case 4457:
150
+ case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
151
+
152
+ case 5572:
153
+ case 6356:
154
+ case 5844:
155
+ case 3191:
156
+ case 6645:
157
+ case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
158
+
159
+ case 6391:
160
+ case 5879:
161
+ case 5623:
162
+ case 6135:
163
+ case 4599:
164
+ case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
165
+
166
+ case 4215:
167
+ case 6389:
168
+ case 5109:
169
+ case 5365:
170
+ case 5621:
171
+ case 3829:
172
+ return stylis.WEBKIT + value + value;
173
+ // appearance, user-select, transform, hyphens, text-size-adjust
174
+
175
+ case 5349:
176
+ case 4246:
177
+ case 4810:
178
+ case 6968:
179
+ case 2756:
180
+ return stylis.WEBKIT + value + stylis.MOZ + value + stylis.MS + value + value;
181
+ // flex, flex-direction
182
+
183
+ case 6828:
184
+ case 4268:
185
+ return stylis.WEBKIT + value + stylis.MS + value + value;
186
+ // order
187
+
188
+ case 6165:
189
+ return stylis.WEBKIT + value + stylis.MS + 'flex-' + value + value;
190
+ // align-items
191
+
192
+ case 5187:
193
+ return stylis.WEBKIT + value + stylis.replace(value, /(\w+).+(:[^]+)/, stylis.WEBKIT + 'box-$1$2' + stylis.MS + 'flex-$1$2') + value;
194
+ // align-self
195
+
196
+ case 5443:
197
+ return stylis.WEBKIT + value + stylis.MS + 'flex-item-' + stylis.replace(value, /flex-|-self/, '') + value;
198
+ // align-content
199
+
200
+ case 4675:
201
+ return stylis.WEBKIT + value + stylis.MS + 'flex-line-pack' + stylis.replace(value, /align-content|flex-|-self/, '') + value;
202
+ // flex-shrink
203
+
204
+ case 5548:
205
+ return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, 'shrink', 'negative') + value;
206
+ // flex-basis
207
+
208
+ case 5292:
209
+ return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, 'basis', 'preferred-size') + value;
210
+ // flex-grow
211
+
212
+ case 6060:
213
+ return stylis.WEBKIT + 'box-' + stylis.replace(value, '-grow', '') + stylis.WEBKIT + value + stylis.MS + stylis.replace(value, 'grow', 'positive') + value;
214
+ // transition
215
+
216
+ case 4554:
217
+ return stylis.WEBKIT + stylis.replace(value, /([^-])(transform)/g, '$1' + stylis.WEBKIT + '$2') + value;
218
+ // cursor
219
+
220
+ case 6187:
221
+ return stylis.replace(stylis.replace(stylis.replace(value, /(zoom-|grab)/, stylis.WEBKIT + '$1'), /(image-set)/, stylis.WEBKIT + '$1'), value, '') + value;
222
+ // background, background-image
223
+
224
+ case 5495:
225
+ case 3959:
226
+ return stylis.replace(value, /(image-set\([^]*)/, stylis.WEBKIT + '$1' + '$`$1');
227
+ // justify-content
228
+
229
+ case 4968:
230
+ return stylis.replace(stylis.replace(value, /(.+:)(flex-)?(.*)/, stylis.WEBKIT + 'box-pack:$3' + stylis.MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + stylis.WEBKIT + value + value;
231
+ // (margin|padding)-inline-(start|end)
232
+
233
+ case 4095:
234
+ case 3583:
235
+ case 4068:
236
+ case 2532:
237
+ return stylis.replace(value, /(.+)-inline(.+)/, stylis.WEBKIT + '$1$2') + value;
238
+ // (min|max)?(width|height|inline-size|block-size)
239
+
240
+ case 8116:
241
+ case 7059:
242
+ case 5753:
243
+ case 5535:
244
+ case 5445:
245
+ case 5701:
246
+ case 4933:
247
+ case 4677:
248
+ case 5533:
249
+ case 5789:
250
+ case 5021:
251
+ case 4765:
252
+ // stretch, max-content, min-content, fill-available
253
+ if (stylis.strlen(value) - 1 - length > 6) switch (stylis.charat(value, length + 1)) {
254
+ // (m)ax-content, (m)in-content
255
+ case 109:
256
+ // -
257
+ if (stylis.charat(value, length + 4) !== 45) break;
258
+ // (f)ill-available, (f)it-content
259
+
260
+ case 102:
261
+ return stylis.replace(value, /(.+:)(.+)-([^]+)/, '$1' + stylis.WEBKIT + '$2-$3' + '$1' + stylis.MOZ + (stylis.charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
262
+ // (s)tretch
263
+
264
+ case 115:
265
+ return ~stylis.indexof(value, 'stretch') ? prefix(stylis.replace(value, 'stretch', 'fill-available'), length) + value : value;
266
+ }
267
+ break;
268
+ // position: sticky
269
+
270
+ case 4949:
271
+ // (s)ticky?
272
+ if (stylis.charat(value, length + 1) !== 115) break;
273
+ // display: (flex|inline-flex)
274
+
275
+ case 6444:
276
+ switch (stylis.charat(value, stylis.strlen(value) - 3 - (~stylis.indexof(value, '!important') && 10))) {
277
+ // stic(k)y
278
+ case 107:
279
+ return stylis.replace(value, ':', ':' + stylis.WEBKIT) + value;
280
+ // (inline-)?fl(e)x
281
+
282
+ case 101:
283
+ return stylis.replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + stylis.WEBKIT + (stylis.charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + stylis.WEBKIT + '$2$3' + '$1' + stylis.MS + '$2box$3') + value;
284
+ }
285
+
286
+ break;
287
+ // writing-mode
288
+
289
+ case 5936:
290
+ switch (stylis.charat(value, length + 11)) {
291
+ // vertical-l(r)
292
+ case 114:
293
+ return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
294
+ // vertical-r(l)
295
+
296
+ case 108:
297
+ return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
298
+ // horizontal(-)tb
299
+
300
+ case 45:
301
+ return stylis.WEBKIT + value + stylis.MS + stylis.replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
302
+ }
303
+
304
+ return stylis.WEBKIT + value + stylis.MS + value + value;
305
+ }
306
+
307
+ return value;
308
+ }
309
+
310
+ var prefixer = function prefixer(element, index, children, callback) {
311
+ if (element.length > -1) if (!element["return"]) switch (element.type) {
312
+ case stylis.DECLARATION:
313
+ element["return"] = prefix(element.value, element.length);
314
+ break;
315
+
316
+ case stylis.KEYFRAMES:
317
+ return stylis.serialize([stylis.copy(element, {
318
+ value: stylis.replace(element.value, '@', '@' + stylis.WEBKIT)
319
+ })], callback);
320
+
321
+ case stylis.RULESET:
322
+ if (element.length) return stylis.combine(element.props, function (value) {
323
+ switch (stylis.match(value, /(::plac\w+|:read-\w+)/)) {
324
+ // :read-(only|write)
325
+ case ':read-only':
326
+ case ':read-write':
327
+ return stylis.serialize([stylis.copy(element, {
328
+ props: [stylis.replace(value, /:(read-\w+)/, ':' + stylis.MOZ + '$1')]
329
+ })], callback);
330
+ // :placeholder
331
+
332
+ case '::placeholder':
333
+ return stylis.serialize([stylis.copy(element, {
334
+ props: [stylis.replace(value, /:(plac\w+)/, ':' + stylis.WEBKIT + 'input-$1')]
335
+ }), stylis.copy(element, {
336
+ props: [stylis.replace(value, /:(plac\w+)/, ':' + stylis.MOZ + '$1')]
337
+ }), stylis.copy(element, {
338
+ props: [stylis.replace(value, /:(plac\w+)/, stylis.MS + 'input-$1')]
339
+ })], callback);
340
+ }
341
+
342
+ return '';
343
+ });
344
+ }
345
+ };
346
+
347
+ var defaultStylisPlugins = [prefixer];
348
+
349
+ var createCache = function
350
+ /*: EmotionCache */
351
+ createCache(options
352
+ /*: Options */
353
+ ) {
354
+ var key = options.key;
355
+
356
+ if (key === 'css') {
357
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
358
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
359
+ // note this very very intentionally targets all style elements regardless of the key to ensure
360
+ // that creating a cache works inside of render of a React component
361
+
362
+ Array.prototype.forEach.call(ssrStyles, function (node
363
+ /*: HTMLStyleElement */
364
+ ) {
365
+ // we want to only move elements which have a space in the data-emotion attribute value
366
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
367
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
368
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
369
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
370
+ // will not result in the Emotion 10 styles being destroyed
371
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
372
+
373
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
374
+ return;
375
+ }
376
+
377
+ document.head.appendChild(node);
378
+ node.setAttribute('data-s', '');
379
+ });
380
+ }
381
+
382
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
383
+
384
+ var inserted = {};
385
+ var container;
386
+ /* : Node */
387
+
388
+ var nodesToHydrate = [];
389
+
390
+ {
391
+ container = options.container || document.head;
392
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
393
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
394
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node
395
+ /*: HTMLStyleElement */
396
+ ) {
397
+ var attrib = node.getAttribute("data-emotion").split(' ');
398
+
399
+ for (var i = 1; i < attrib.length; i++) {
400
+ inserted[attrib[i]] = true;
401
+ }
402
+
403
+ nodesToHydrate.push(node);
404
+ });
405
+ }
406
+
407
+ var _insert;
408
+ /*: (
409
+ selector: string,
410
+ serialized: SerializedStyles,
411
+ sheet: StyleSheet,
412
+ shouldCache: boolean
413
+ ) => string | void */
414
+
415
+
416
+ var omnipresentPlugins = [compat, removeLabel];
417
+
418
+ {
419
+ var currentSheet;
420
+ var finalizingPlugins = [stylis.stringify, stylis.rulesheet(function (rule) {
421
+ currentSheet.insert(rule);
422
+ })];
423
+ var serializer = stylis.middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
424
+
425
+ var stylis$1 = function stylis$1(styles) {
426
+ return stylis.serialize(stylis.compile(styles), serializer);
427
+ };
428
+
429
+ _insert = function
430
+ /*: void */
431
+ insert(selector
432
+ /*: string */
433
+ , serialized
434
+ /*: SerializedStyles */
435
+ , sheet
436
+ /*: StyleSheet */
437
+ , shouldCache
438
+ /*: boolean */
439
+ ) {
440
+ currentSheet = sheet;
441
+
442
+ stylis$1(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
443
+
444
+ if (shouldCache) {
445
+ cache.inserted[serialized.name] = true;
446
+ }
447
+ };
448
+ }
449
+
450
+ var cache
451
+ /*: EmotionCache */
452
+ = {
453
+ key: key,
454
+ sheet: new sheet.StyleSheet({
455
+ key: key,
456
+ container: container,
457
+ nonce: options.nonce,
458
+ speedy: options.speedy,
459
+ prepend: options.prepend,
460
+ insertionPoint: options.insertionPoint
461
+ }),
462
+ nonce: options.nonce,
463
+ inserted: inserted,
464
+ registered: {},
465
+ insert: _insert
466
+ };
467
+ cache.sheet.hydrate(nodesToHydrate);
468
+ return cache;
469
+ };
470
+
471
+ exports["default"] = createCache;
@@ -0,0 +1,2 @@
1
+ import "./emotion-cache.browser.cjs.js";
2
+ export { _default as default } from "./emotion-cache.browser.cjs.default.js";
@@ -0,0 +1 @@
1
+ exports._default = require("./emotion-cache.browser.development.cjs.js").default;