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