stream-chat 9.20.2 → 9.20.3

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.
@@ -8,9 +8,9 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __commonJS = (cb, mod) => function __require() {
9
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
10
  };
11
- var __export = (target, all3) => {
12
- for (var name in all3)
13
- __defProp(target, name, { get: all3[name], enumerable: true });
11
+ var __export = (target, all) => {
12
+ for (var name in all)
13
+ __defProp(target, name, { get: all[name], enumerable: true });
14
14
  };
15
15
  var __copyProps = (to, from, except, desc) => {
16
16
  if (from && typeof from === "object" || typeof from === "function") {
@@ -30,121 +30,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // node_modules/base64-js/index.js
34
- var require_base64_js = __commonJS({
35
- "node_modules/base64-js/index.js"(exports) {
36
- "use strict";
37
- exports.byteLength = byteLength;
38
- exports.toByteArray = toByteArray;
39
- exports.fromByteArray = fromByteArray2;
40
- var lookup = [];
41
- var revLookup = [];
42
- var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
43
- var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
44
- for (i = 0, len = code.length; i < len; ++i) {
45
- lookup[i] = code[i];
46
- revLookup[code.charCodeAt(i)] = i;
47
- }
48
- var i;
49
- var len;
50
- revLookup["-".charCodeAt(0)] = 62;
51
- revLookup["_".charCodeAt(0)] = 63;
52
- function getLens(b64) {
53
- var len2 = b64.length;
54
- if (len2 % 4 > 0) {
55
- throw new Error("Invalid string. Length must be a multiple of 4");
56
- }
57
- var validLen = b64.indexOf("=");
58
- if (validLen === -1) validLen = len2;
59
- var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
60
- return [validLen, placeHoldersLen];
61
- }
62
- function byteLength(b64) {
63
- var lens = getLens(b64);
64
- var validLen = lens[0];
65
- var placeHoldersLen = lens[1];
66
- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
67
- }
68
- function _byteLength(b64, validLen, placeHoldersLen) {
69
- return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
70
- }
71
- function toByteArray(b64) {
72
- var tmp;
73
- var lens = getLens(b64);
74
- var validLen = lens[0];
75
- var placeHoldersLen = lens[1];
76
- var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
77
- var curByte = 0;
78
- var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;
79
- var i2;
80
- for (i2 = 0; i2 < len2; i2 += 4) {
81
- tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];
82
- arr[curByte++] = tmp >> 16 & 255;
83
- arr[curByte++] = tmp >> 8 & 255;
84
- arr[curByte++] = tmp & 255;
85
- }
86
- if (placeHoldersLen === 2) {
87
- tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;
88
- arr[curByte++] = tmp & 255;
89
- }
90
- if (placeHoldersLen === 1) {
91
- tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;
92
- arr[curByte++] = tmp >> 8 & 255;
93
- arr[curByte++] = tmp & 255;
94
- }
95
- return arr;
96
- }
97
- function tripletToBase64(num) {
98
- return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
99
- }
100
- function encodeChunk(uint8, start, end) {
101
- var tmp;
102
- var output = [];
103
- for (var i2 = start; i2 < end; i2 += 3) {
104
- tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);
105
- output.push(tripletToBase64(tmp));
106
- }
107
- return output.join("");
108
- }
109
- function fromByteArray2(uint8) {
110
- var tmp;
111
- var len2 = uint8.length;
112
- var extraBytes = len2 % 3;
113
- var parts = [];
114
- var maxChunkLength = 16383;
115
- for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {
116
- parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));
117
- }
118
- if (extraBytes === 1) {
119
- tmp = uint8[len2 - 1];
120
- parts.push(
121
- lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
122
- );
123
- } else if (extraBytes === 2) {
124
- tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
125
- parts.push(
126
- lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
127
- );
128
- }
129
- return parts.join("");
130
- }
131
- }
132
- });
133
-
134
33
  // (disabled):https
135
34
  var require_https = __commonJS({
136
35
  "(disabled):https"() {
137
36
  }
138
37
  });
139
38
 
140
- // node_modules/form-data/lib/browser.js
141
- var require_browser = __commonJS({
142
- "node_modules/form-data/lib/browser.js"(exports, module2) {
143
- "use strict";
144
- module2.exports = typeof self === "object" ? self.FormData : window.FormData;
145
- }
146
- });
147
-
148
39
  // (disabled):crypto
149
40
  var require_crypto = __commonJS({
150
41
  "(disabled):crypto"() {
@@ -287,9 +178,9 @@ __export(index_exports, {
287
178
  insertItemWithTrigger: () => insertItemWithTrigger,
288
179
  isAudioAttachment: () => isAudioAttachment,
289
180
  isBlobButNotFile: () => isBlobButNotFile,
290
- isFile: () => isFile2,
181
+ isFile: () => isFile,
291
182
  isFileAttachment: () => isFileAttachment,
292
- isFileList: () => isFileList2,
183
+ isFileList: () => isFileList,
293
184
  isFileReference: () => isFileReference,
294
185
  isImageAttachment: () => isImageAttachment,
295
186
  isImageFile: () => isImageFile,
@@ -307,2245 +198,135 @@ __export(index_exports, {
307
198
  isTargetedOptionTextUpdate: () => isTargetedOptionTextUpdate,
308
199
  isUploadedAttachment: () => isUploadedAttachment,
309
200
  isVideoAttachment: () => isVideoAttachment,
310
- isVoiceRecordingAttachment: () => isVoiceRecordingAttachment,
311
- isVoteAnswer: () => isVoteAnswer,
312
- localMessageToNewMessagePayload: () => localMessageToNewMessagePayload,
313
- logChatPromiseExecution: () => logChatPromiseExecution,
314
- mapPollStateToResponse: () => mapPollStateToResponse,
315
- pollCompositionStateProcessors: () => pollCompositionStateProcessors,
316
- pollStateChangeValidators: () => pollStateChangeValidators,
317
- postInsights: () => postInsights,
318
- promoteChannel: () => promoteChannel,
319
- readFileAsArrayBuffer: () => readFileAsArrayBuffer,
320
- removeDiacritics: () => removeDiacritics,
321
- replaceWordWithEntity: () => replaceWordWithEntity,
322
- textIsEmpty: () => textIsEmpty,
323
- timeLeftMs: () => timeLeftMs
324
- });
325
- module.exports = __toCommonJS(index_exports);
326
-
327
- // src/base64.ts
328
- var import_base64_js = __toESM(require_base64_js());
329
- function isString(arrayOrString) {
330
- return typeof arrayOrString === "string";
331
- }
332
- function isMapStringCallback(arrayOrString, callback) {
333
- return !!callback && isString(arrayOrString);
334
- }
335
- function map(arrayOrString, callback) {
336
- const res = [];
337
- if (isString(arrayOrString) && isMapStringCallback(arrayOrString, callback)) {
338
- for (let k = 0, len = arrayOrString.length; k < len; k++) {
339
- if (arrayOrString.charAt(k)) {
340
- const kValue = arrayOrString.charAt(k);
341
- const mappedValue = callback(kValue, k, arrayOrString);
342
- res[k] = mappedValue;
343
- }
344
- }
345
- } else if (!isString(arrayOrString) && !isMapStringCallback(arrayOrString, callback)) {
346
- for (let k = 0, len = arrayOrString.length; k < len; k++) {
347
- if (k in arrayOrString) {
348
- const kValue = arrayOrString[k];
349
- const mappedValue = callback(kValue, k, arrayOrString);
350
- res[k] = mappedValue;
351
- }
352
- }
353
- }
354
- return res;
355
- }
356
- var encodeBase64 = (data) => (0, import_base64_js.fromByteArray)(new Uint8Array(map(data, (char) => char.charCodeAt(0))));
357
- var decodeBase64 = (s) => {
358
- const e = {}, w = String.fromCharCode, L = s.length;
359
- let i, b = 0, c, x, l = 0, a, r = "";
360
- const A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
361
- for (i = 0; i < 64; i++) {
362
- e[A.charAt(i)] = i;
363
- }
364
- for (x = 0; x < L; x++) {
365
- c = e[s.charAt(x)];
366
- b = (b << 6) + c;
367
- l += 6;
368
- while (l >= 8) {
369
- ((a = b >>> (l -= 8) & 255) || x < L - 2) && (r += w(a));
370
- }
371
- }
372
- return r;
373
- };
374
-
375
- // src/campaign.ts
376
- var Campaign = class {
377
- constructor(client, id, data) {
378
- this.client = client;
379
- this.id = id;
380
- this.data = data;
381
- }
382
- async create() {
383
- const body = {
384
- id: this.id,
385
- message_template: this.data?.message_template,
386
- segment_ids: this.data?.segment_ids,
387
- sender_id: this.data?.sender_id,
388
- sender_mode: this.data?.sender_mode,
389
- sender_visibility: this.data?.sender_visibility,
390
- channel_template: this.data?.channel_template,
391
- create_channels: this.data?.create_channels,
392
- show_channels: this.data?.show_channels,
393
- description: this.data?.description,
394
- name: this.data?.name,
395
- skip_push: this.data?.skip_push,
396
- skip_webhook: this.data?.skip_webhook,
397
- user_ids: this.data?.user_ids
398
- };
399
- const result = await this.client.createCampaign(body);
400
- this.id = result.campaign.id;
401
- this.data = result.campaign;
402
- return result;
403
- }
404
- verifyCampaignId() {
405
- if (!this.id) {
406
- throw new Error(
407
- "Campaign id is missing. Either create the campaign using campaign.create() or set the id during instantiation - const campaign = client.campaign(id)"
408
- );
409
- }
410
- }
411
- async start(options) {
412
- this.verifyCampaignId();
413
- return await this.client.startCampaign(this.id, options);
414
- }
415
- update(data) {
416
- this.verifyCampaignId();
417
- return this.client.updateCampaign(this.id, data);
418
- }
419
- async delete() {
420
- this.verifyCampaignId();
421
- return await this.client.deleteCampaign(this.id);
422
- }
423
- stop() {
424
- this.verifyCampaignId();
425
- return this.client.stopCampaign(this.id);
426
- }
427
- get(options) {
428
- this.verifyCampaignId();
429
- return this.client.getCampaign(this.id, options);
430
- }
431
- };
432
-
433
- // node_modules/axios/lib/helpers/bind.js
434
- function bind(fn, thisArg) {
435
- return function wrap() {
436
- return fn.apply(thisArg, arguments);
437
- };
438
- }
439
-
440
- // node_modules/axios/lib/utils.js
441
- var { toString } = Object.prototype;
442
- var { getPrototypeOf } = Object;
443
- var kindOf = /* @__PURE__ */ ((cache) => (thing) => {
444
- const str = toString.call(thing);
445
- return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());
446
- })(/* @__PURE__ */ Object.create(null));
447
- var kindOfTest = (type) => {
448
- type = type.toLowerCase();
449
- return (thing) => kindOf(thing) === type;
450
- };
451
- var typeOfTest = (type) => (thing) => typeof thing === type;
452
- var { isArray } = Array;
453
- var isUndefined = typeOfTest("undefined");
454
- function isBuffer(val) {
455
- return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);
456
- }
457
- var isArrayBuffer = kindOfTest("ArrayBuffer");
458
- function isArrayBufferView(val) {
459
- let result;
460
- if (typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView) {
461
- result = ArrayBuffer.isView(val);
462
- } else {
463
- result = val && val.buffer && isArrayBuffer(val.buffer);
464
- }
465
- return result;
466
- }
467
- var isString2 = typeOfTest("string");
468
- var isFunction = typeOfTest("function");
469
- var isNumber = typeOfTest("number");
470
- var isObject = (thing) => thing !== null && typeof thing === "object";
471
- var isBoolean = (thing) => thing === true || thing === false;
472
- var isPlainObject = (val) => {
473
- if (kindOf(val) !== "object") {
474
- return false;
475
- }
476
- const prototype3 = getPrototypeOf(val);
477
- return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);
478
- };
479
- var isDate = kindOfTest("Date");
480
- var isFile = kindOfTest("File");
481
- var isBlob = kindOfTest("Blob");
482
- var isFileList = kindOfTest("FileList");
483
- var isStream = (val) => isObject(val) && isFunction(val.pipe);
484
- var isFormData = (thing) => {
485
- let kind;
486
- return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance
487
- kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]"));
488
- };
489
- var isURLSearchParams = kindOfTest("URLSearchParams");
490
- var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
491
- function forEach(obj, fn, { allOwnKeys = false } = {}) {
492
- if (obj === null || typeof obj === "undefined") {
493
- return;
494
- }
495
- let i;
496
- let l;
497
- if (typeof obj !== "object") {
498
- obj = [obj];
499
- }
500
- if (isArray(obj)) {
501
- for (i = 0, l = obj.length; i < l; i++) {
502
- fn.call(null, obj[i], i, obj);
503
- }
504
- } else {
505
- const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);
506
- const len = keys.length;
507
- let key;
508
- for (i = 0; i < len; i++) {
509
- key = keys[i];
510
- fn.call(null, obj[key], key, obj);
511
- }
512
- }
513
- }
514
- function findKey(obj, key) {
515
- key = key.toLowerCase();
516
- const keys = Object.keys(obj);
517
- let i = keys.length;
518
- let _key;
519
- while (i-- > 0) {
520
- _key = keys[i];
521
- if (key === _key.toLowerCase()) {
522
- return _key;
523
- }
524
- }
525
- return null;
526
- }
527
- var _global = (() => {
528
- if (typeof globalThis !== "undefined") return globalThis;
529
- return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global;
530
- })();
531
- var isContextDefined = (context) => !isUndefined(context) && context !== _global;
532
- function merge() {
533
- const { caseless } = isContextDefined(this) && this || {};
534
- const result = {};
535
- const assignValue = (val, key) => {
536
- const targetKey = caseless && findKey(result, key) || key;
537
- if (isPlainObject(result[targetKey]) && isPlainObject(val)) {
538
- result[targetKey] = merge(result[targetKey], val);
539
- } else if (isPlainObject(val)) {
540
- result[targetKey] = merge({}, val);
541
- } else if (isArray(val)) {
542
- result[targetKey] = val.slice();
543
- } else {
544
- result[targetKey] = val;
545
- }
546
- };
547
- for (let i = 0, l = arguments.length; i < l; i++) {
548
- arguments[i] && forEach(arguments[i], assignValue);
549
- }
550
- return result;
551
- }
552
- var extend = (a, b, thisArg, { allOwnKeys } = {}) => {
553
- forEach(b, (val, key) => {
554
- if (thisArg && isFunction(val)) {
555
- a[key] = bind(val, thisArg);
556
- } else {
557
- a[key] = val;
558
- }
559
- }, { allOwnKeys });
560
- return a;
561
- };
562
- var stripBOM = (content) => {
563
- if (content.charCodeAt(0) === 65279) {
564
- content = content.slice(1);
565
- }
566
- return content;
567
- };
568
- var inherits = (constructor, superConstructor, props, descriptors2) => {
569
- constructor.prototype = Object.create(superConstructor.prototype, descriptors2);
570
- constructor.prototype.constructor = constructor;
571
- Object.defineProperty(constructor, "super", {
572
- value: superConstructor.prototype
573
- });
574
- props && Object.assign(constructor.prototype, props);
575
- };
576
- var toFlatObject = (sourceObj, destObj, filter2, propFilter) => {
577
- let props;
578
- let i;
579
- let prop;
580
- const merged = {};
581
- destObj = destObj || {};
582
- if (sourceObj == null) return destObj;
583
- do {
584
- props = Object.getOwnPropertyNames(sourceObj);
585
- i = props.length;
586
- while (i-- > 0) {
587
- prop = props[i];
588
- if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {
589
- destObj[prop] = sourceObj[prop];
590
- merged[prop] = true;
591
- }
592
- }
593
- sourceObj = filter2 !== false && getPrototypeOf(sourceObj);
594
- } while (sourceObj && (!filter2 || filter2(sourceObj, destObj)) && sourceObj !== Object.prototype);
595
- return destObj;
596
- };
597
- var endsWith = (str, searchString, position) => {
598
- str = String(str);
599
- if (position === void 0 || position > str.length) {
600
- position = str.length;
601
- }
602
- position -= searchString.length;
603
- const lastIndex = str.indexOf(searchString, position);
604
- return lastIndex !== -1 && lastIndex === position;
605
- };
606
- var toArray = (thing) => {
607
- if (!thing) return null;
608
- if (isArray(thing)) return thing;
609
- let i = thing.length;
610
- if (!isNumber(i)) return null;
611
- const arr = new Array(i);
612
- while (i-- > 0) {
613
- arr[i] = thing[i];
614
- }
615
- return arr;
616
- };
617
- var isTypedArray = /* @__PURE__ */ ((TypedArray) => {
618
- return (thing) => {
619
- return TypedArray && thing instanceof TypedArray;
620
- };
621
- })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array));
622
- var forEachEntry = (obj, fn) => {
623
- const generator = obj && obj[Symbol.iterator];
624
- const iterator = generator.call(obj);
625
- let result;
626
- while ((result = iterator.next()) && !result.done) {
627
- const pair = result.value;
628
- fn.call(obj, pair[0], pair[1]);
629
- }
630
- };
631
- var matchAll = (regExp, str) => {
632
- let matches;
633
- const arr = [];
634
- while ((matches = regExp.exec(str)) !== null) {
635
- arr.push(matches);
636
- }
637
- return arr;
638
- };
639
- var isHTMLForm = kindOfTest("HTMLFormElement");
640
- var toCamelCase = (str) => {
641
- return str.toLowerCase().replace(
642
- /[-_\s]([a-z\d])(\w*)/g,
643
- function replacer(m, p1, p2) {
644
- return p1.toUpperCase() + p2;
645
- }
646
- );
647
- };
648
- var hasOwnProperty = (({ hasOwnProperty: hasOwnProperty2 }) => (obj, prop) => hasOwnProperty2.call(obj, prop))(Object.prototype);
649
- var isRegExp = kindOfTest("RegExp");
650
- var reduceDescriptors = (obj, reducer) => {
651
- const descriptors2 = Object.getOwnPropertyDescriptors(obj);
652
- const reducedDescriptors = {};
653
- forEach(descriptors2, (descriptor, name) => {
654
- let ret;
655
- if ((ret = reducer(descriptor, name, obj)) !== false) {
656
- reducedDescriptors[name] = ret || descriptor;
657
- }
658
- });
659
- Object.defineProperties(obj, reducedDescriptors);
660
- };
661
- var freezeMethods = (obj) => {
662
- reduceDescriptors(obj, (descriptor, name) => {
663
- if (isFunction(obj) && ["arguments", "caller", "callee"].indexOf(name) !== -1) {
664
- return false;
665
- }
666
- const value = obj[name];
667
- if (!isFunction(value)) return;
668
- descriptor.enumerable = false;
669
- if ("writable" in descriptor) {
670
- descriptor.writable = false;
671
- return;
672
- }
673
- if (!descriptor.set) {
674
- descriptor.set = () => {
675
- throw Error("Can not rewrite read-only method '" + name + "'");
676
- };
677
- }
678
- });
679
- };
680
- var toObjectSet = (arrayOrString, delimiter) => {
681
- const obj = {};
682
- const define = (arr) => {
683
- arr.forEach((value) => {
684
- obj[value] = true;
685
- });
686
- };
687
- isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));
688
- return obj;
689
- };
690
- var noop = () => {
691
- };
692
- var toFiniteNumber = (value, defaultValue) => {
693
- value = +value;
694
- return Number.isFinite(value) ? value : defaultValue;
695
- };
696
- var ALPHA = "abcdefghijklmnopqrstuvwxyz";
697
- var DIGIT = "0123456789";
698
- var ALPHABET = {
699
- DIGIT,
700
- ALPHA,
701
- ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT
702
- };
703
- var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
704
- let str = "";
705
- const { length } = alphabet;
706
- while (size--) {
707
- str += alphabet[Math.random() * length | 0];
708
- }
709
- return str;
710
- };
711
- function isSpecCompliantForm(thing) {
712
- return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]);
713
- }
714
- var toJSONObject = (obj) => {
715
- const stack = new Array(10);
716
- const visit = (source, i) => {
717
- if (isObject(source)) {
718
- if (stack.indexOf(source) >= 0) {
719
- return;
720
- }
721
- if (!("toJSON" in source)) {
722
- stack[i] = source;
723
- const target = isArray(source) ? [] : {};
724
- forEach(source, (value, key) => {
725
- const reducedValue = visit(value, i + 1);
726
- !isUndefined(reducedValue) && (target[key] = reducedValue);
727
- });
728
- stack[i] = void 0;
729
- return target;
730
- }
731
- }
732
- return source;
733
- };
734
- return visit(obj, 0);
735
- };
736
- var isAsyncFn = kindOfTest("AsyncFunction");
737
- var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);
738
- var utils_default = {
739
- isArray,
740
- isArrayBuffer,
741
- isBuffer,
742
- isFormData,
743
- isArrayBufferView,
744
- isString: isString2,
745
- isNumber,
746
- isBoolean,
747
- isObject,
748
- isPlainObject,
749
- isUndefined,
750
- isDate,
751
- isFile,
752
- isBlob,
753
- isRegExp,
754
- isFunction,
755
- isStream,
756
- isURLSearchParams,
757
- isTypedArray,
758
- isFileList,
759
- forEach,
760
- merge,
761
- extend,
762
- trim,
763
- stripBOM,
764
- inherits,
765
- toFlatObject,
766
- kindOf,
767
- kindOfTest,
768
- endsWith,
769
- toArray,
770
- forEachEntry,
771
- matchAll,
772
- isHTMLForm,
773
- hasOwnProperty,
774
- hasOwnProp: hasOwnProperty,
775
- // an alias to avoid ESLint no-prototype-builtins detection
776
- reduceDescriptors,
777
- freezeMethods,
778
- toObjectSet,
779
- toCamelCase,
780
- noop,
781
- toFiniteNumber,
782
- findKey,
783
- global: _global,
784
- isContextDefined,
785
- ALPHABET,
786
- generateString,
787
- isSpecCompliantForm,
788
- toJSONObject,
789
- isAsyncFn,
790
- isThenable
791
- };
792
-
793
- // node_modules/axios/lib/core/AxiosError.js
794
- function AxiosError(message, code, config, request, response) {
795
- Error.call(this);
796
- if (Error.captureStackTrace) {
797
- Error.captureStackTrace(this, this.constructor);
798
- } else {
799
- this.stack = new Error().stack;
800
- }
801
- this.message = message;
802
- this.name = "AxiosError";
803
- code && (this.code = code);
804
- config && (this.config = config);
805
- request && (this.request = request);
806
- response && (this.response = response);
807
- }
808
- utils_default.inherits(AxiosError, Error, {
809
- toJSON: function toJSON() {
810
- return {
811
- // Standard
812
- message: this.message,
813
- name: this.name,
814
- // Microsoft
815
- description: this.description,
816
- number: this.number,
817
- // Mozilla
818
- fileName: this.fileName,
819
- lineNumber: this.lineNumber,
820
- columnNumber: this.columnNumber,
821
- stack: this.stack,
822
- // Axios
823
- config: utils_default.toJSONObject(this.config),
824
- code: this.code,
825
- status: this.response && this.response.status ? this.response.status : null
826
- };
827
- }
828
- });
829
- var prototype = AxiosError.prototype;
830
- var descriptors = {};
831
- [
832
- "ERR_BAD_OPTION_VALUE",
833
- "ERR_BAD_OPTION",
834
- "ECONNABORTED",
835
- "ETIMEDOUT",
836
- "ERR_NETWORK",
837
- "ERR_FR_TOO_MANY_REDIRECTS",
838
- "ERR_DEPRECATED",
839
- "ERR_BAD_RESPONSE",
840
- "ERR_BAD_REQUEST",
841
- "ERR_CANCELED",
842
- "ERR_NOT_SUPPORT",
843
- "ERR_INVALID_URL"
844
- // eslint-disable-next-line func-names
845
- ].forEach((code) => {
846
- descriptors[code] = { value: code };
847
- });
848
- Object.defineProperties(AxiosError, descriptors);
849
- Object.defineProperty(prototype, "isAxiosError", { value: true });
850
- AxiosError.from = (error, code, config, request, response, customProps) => {
851
- const axiosError = Object.create(prototype);
852
- utils_default.toFlatObject(error, axiosError, function filter2(obj) {
853
- return obj !== Error.prototype;
854
- }, (prop) => {
855
- return prop !== "isAxiosError";
856
- });
857
- AxiosError.call(axiosError, error.message, code, config, request, response);
858
- axiosError.cause = error;
859
- axiosError.name = error.name;
860
- customProps && Object.assign(axiosError, customProps);
861
- return axiosError;
862
- };
863
- var AxiosError_default = AxiosError;
864
-
865
- // node_modules/axios/lib/helpers/null.js
866
- var null_default = null;
867
-
868
- // node_modules/axios/lib/helpers/toFormData.js
869
- function isVisitable(thing) {
870
- return utils_default.isPlainObject(thing) || utils_default.isArray(thing);
871
- }
872
- function removeBrackets(key) {
873
- return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
874
- }
875
- function renderKey(path, key, dots) {
876
- if (!path) return key;
877
- return path.concat(key).map(function each(token, i) {
878
- token = removeBrackets(token);
879
- return !dots && i ? "[" + token + "]" : token;
880
- }).join(dots ? "." : "");
881
- }
882
- function isFlatArray(arr) {
883
- return utils_default.isArray(arr) && !arr.some(isVisitable);
884
- }
885
- var predicates = utils_default.toFlatObject(utils_default, {}, null, function filter(prop) {
886
- return /^is[A-Z]/.test(prop);
887
- });
888
- function toFormData(obj, formData, options) {
889
- if (!utils_default.isObject(obj)) {
890
- throw new TypeError("target must be an object");
891
- }
892
- formData = formData || new (null_default || FormData)();
893
- options = utils_default.toFlatObject(options, {
894
- metaTokens: true,
895
- dots: false,
896
- indexes: false
897
- }, false, function defined(option, source) {
898
- return !utils_default.isUndefined(source[option]);
899
- });
900
- const metaTokens = options.metaTokens;
901
- const visitor = options.visitor || defaultVisitor;
902
- const dots = options.dots;
903
- const indexes = options.indexes;
904
- const _Blob = options.Blob || typeof Blob !== "undefined" && Blob;
905
- const useBlob = _Blob && utils_default.isSpecCompliantForm(formData);
906
- if (!utils_default.isFunction(visitor)) {
907
- throw new TypeError("visitor must be a function");
908
- }
909
- function convertValue(value) {
910
- if (value === null) return "";
911
- if (utils_default.isDate(value)) {
912
- return value.toISOString();
913
- }
914
- if (!useBlob && utils_default.isBlob(value)) {
915
- throw new AxiosError_default("Blob is not supported. Use a Buffer instead.");
916
- }
917
- if (utils_default.isArrayBuffer(value) || utils_default.isTypedArray(value)) {
918
- return useBlob && typeof Blob === "function" ? new Blob([value]) : Buffer.from(value);
919
- }
920
- return value;
921
- }
922
- function defaultVisitor(value, key, path) {
923
- let arr = value;
924
- if (value && !path && typeof value === "object") {
925
- if (utils_default.endsWith(key, "{}")) {
926
- key = metaTokens ? key : key.slice(0, -2);
927
- value = JSON.stringify(value);
928
- } else if (utils_default.isArray(value) && isFlatArray(value) || (utils_default.isFileList(value) || utils_default.endsWith(key, "[]")) && (arr = utils_default.toArray(value))) {
929
- key = removeBrackets(key);
930
- arr.forEach(function each(el, index) {
931
- !(utils_default.isUndefined(el) || el === null) && formData.append(
932
- // eslint-disable-next-line no-nested-ternary
933
- indexes === true ? renderKey([key], index, dots) : indexes === null ? key : key + "[]",
934
- convertValue(el)
935
- );
936
- });
937
- return false;
938
- }
939
- }
940
- if (isVisitable(value)) {
941
- return true;
942
- }
943
- formData.append(renderKey(path, key, dots), convertValue(value));
944
- return false;
945
- }
946
- const stack = [];
947
- const exposedHelpers = Object.assign(predicates, {
948
- defaultVisitor,
949
- convertValue,
950
- isVisitable
951
- });
952
- function build(value, path) {
953
- if (utils_default.isUndefined(value)) return;
954
- if (stack.indexOf(value) !== -1) {
955
- throw Error("Circular reference detected in " + path.join("."));
956
- }
957
- stack.push(value);
958
- utils_default.forEach(value, function each(el, key) {
959
- const result = !(utils_default.isUndefined(el) || el === null) && visitor.call(
960
- formData,
961
- el,
962
- utils_default.isString(key) ? key.trim() : key,
963
- path,
964
- exposedHelpers
965
- );
966
- if (result === true) {
967
- build(el, path ? path.concat(key) : [key]);
968
- }
969
- });
970
- stack.pop();
971
- }
972
- if (!utils_default.isObject(obj)) {
973
- throw new TypeError("data must be an object");
974
- }
975
- build(obj);
976
- return formData;
977
- }
978
- var toFormData_default = toFormData;
979
-
980
- // node_modules/axios/lib/helpers/AxiosURLSearchParams.js
981
- function encode(str) {
982
- const charMap = {
983
- "!": "%21",
984
- "'": "%27",
985
- "(": "%28",
986
- ")": "%29",
987
- "~": "%7E",
988
- "%20": "+",
989
- "%00": "\0"
990
- };
991
- return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
992
- return charMap[match];
993
- });
994
- }
995
- function AxiosURLSearchParams(params, options) {
996
- this._pairs = [];
997
- params && toFormData_default(params, this, options);
998
- }
999
- var prototype2 = AxiosURLSearchParams.prototype;
1000
- prototype2.append = function append(name, value) {
1001
- this._pairs.push([name, value]);
1002
- };
1003
- prototype2.toString = function toString2(encoder) {
1004
- const _encode = encoder ? function(value) {
1005
- return encoder.call(this, value, encode);
1006
- } : encode;
1007
- return this._pairs.map(function each(pair) {
1008
- return _encode(pair[0]) + "=" + _encode(pair[1]);
1009
- }, "").join("&");
1010
- };
1011
- var AxiosURLSearchParams_default = AxiosURLSearchParams;
1012
-
1013
- // node_modules/axios/lib/helpers/buildURL.js
1014
- function encode2(val) {
1015
- return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1016
- }
1017
- function buildURL(url, params, options) {
1018
- if (!params) {
1019
- return url;
1020
- }
1021
- const _encode = options && options.encode || encode2;
1022
- const serializeFn = options && options.serialize;
1023
- let serializedParams;
1024
- if (serializeFn) {
1025
- serializedParams = serializeFn(params, options);
1026
- } else {
1027
- serializedParams = utils_default.isURLSearchParams(params) ? params.toString() : new AxiosURLSearchParams_default(params, options).toString(_encode);
1028
- }
1029
- if (serializedParams) {
1030
- const hashmarkIndex = url.indexOf("#");
1031
- if (hashmarkIndex !== -1) {
1032
- url = url.slice(0, hashmarkIndex);
1033
- }
1034
- url += (url.indexOf("?") === -1 ? "?" : "&") + serializedParams;
1035
- }
1036
- return url;
1037
- }
1038
-
1039
- // node_modules/axios/lib/core/InterceptorManager.js
1040
- var InterceptorManager = class {
1041
- constructor() {
1042
- this.handlers = [];
1043
- }
1044
- /**
1045
- * Add a new interceptor to the stack
1046
- *
1047
- * @param {Function} fulfilled The function to handle `then` for a `Promise`
1048
- * @param {Function} rejected The function to handle `reject` for a `Promise`
1049
- *
1050
- * @return {Number} An ID used to remove interceptor later
1051
- */
1052
- use(fulfilled, rejected, options) {
1053
- this.handlers.push({
1054
- fulfilled,
1055
- rejected,
1056
- synchronous: options ? options.synchronous : false,
1057
- runWhen: options ? options.runWhen : null
1058
- });
1059
- return this.handlers.length - 1;
1060
- }
1061
- /**
1062
- * Remove an interceptor from the stack
1063
- *
1064
- * @param {Number} id The ID that was returned by `use`
1065
- *
1066
- * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
1067
- */
1068
- eject(id) {
1069
- if (this.handlers[id]) {
1070
- this.handlers[id] = null;
1071
- }
1072
- }
1073
- /**
1074
- * Clear all interceptors from the stack
1075
- *
1076
- * @returns {void}
1077
- */
1078
- clear() {
1079
- if (this.handlers) {
1080
- this.handlers = [];
1081
- }
1082
- }
1083
- /**
1084
- * Iterate over all the registered interceptors
1085
- *
1086
- * This method is particularly useful for skipping over any
1087
- * interceptors that may have become `null` calling `eject`.
1088
- *
1089
- * @param {Function} fn The function to call for each interceptor
1090
- *
1091
- * @returns {void}
1092
- */
1093
- forEach(fn) {
1094
- utils_default.forEach(this.handlers, function forEachHandler(h) {
1095
- if (h !== null) {
1096
- fn(h);
1097
- }
1098
- });
1099
- }
1100
- };
1101
- var InterceptorManager_default = InterceptorManager;
1102
-
1103
- // node_modules/axios/lib/defaults/transitional.js
1104
- var transitional_default = {
1105
- silentJSONParsing: true,
1106
- forcedJSONParsing: true,
1107
- clarifyTimeoutError: false
1108
- };
1109
-
1110
- // node_modules/axios/lib/platform/browser/classes/URLSearchParams.js
1111
- var URLSearchParams_default = typeof URLSearchParams !== "undefined" ? URLSearchParams : AxiosURLSearchParams_default;
1112
-
1113
- // node_modules/axios/lib/platform/browser/classes/FormData.js
1114
- var FormData_default = typeof FormData !== "undefined" ? FormData : null;
1115
-
1116
- // node_modules/axios/lib/platform/browser/classes/Blob.js
1117
- var Blob_default = typeof Blob !== "undefined" ? Blob : null;
1118
-
1119
- // node_modules/axios/lib/platform/browser/index.js
1120
- var isStandardBrowserEnv = (() => {
1121
- let product;
1122
- if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) {
1123
- return false;
1124
- }
1125
- return typeof window !== "undefined" && typeof document !== "undefined";
1126
- })();
1127
- var isStandardBrowserWebWorkerEnv = (() => {
1128
- return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
1129
- self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
1130
- })();
1131
- var browser_default = {
1132
- isBrowser: true,
1133
- classes: {
1134
- URLSearchParams: URLSearchParams_default,
1135
- FormData: FormData_default,
1136
- Blob: Blob_default
1137
- },
1138
- isStandardBrowserEnv,
1139
- isStandardBrowserWebWorkerEnv,
1140
- protocols: ["http", "https", "file", "blob", "url", "data"]
1141
- };
1142
-
1143
- // node_modules/axios/lib/helpers/toURLEncodedForm.js
1144
- function toURLEncodedForm(data, options) {
1145
- return toFormData_default(data, new browser_default.classes.URLSearchParams(), Object.assign({
1146
- visitor: function(value, key, path, helpers) {
1147
- if (browser_default.isNode && utils_default.isBuffer(value)) {
1148
- this.append(key, value.toString("base64"));
1149
- return false;
1150
- }
1151
- return helpers.defaultVisitor.apply(this, arguments);
1152
- }
1153
- }, options));
1154
- }
1155
-
1156
- // node_modules/axios/lib/helpers/formDataToJSON.js
1157
- function parsePropPath(name) {
1158
- return utils_default.matchAll(/\w+|\[(\w*)]/g, name).map((match) => {
1159
- return match[0] === "[]" ? "" : match[1] || match[0];
1160
- });
1161
- }
1162
- function arrayToObject(arr) {
1163
- const obj = {};
1164
- const keys = Object.keys(arr);
1165
- let i;
1166
- const len = keys.length;
1167
- let key;
1168
- for (i = 0; i < len; i++) {
1169
- key = keys[i];
1170
- obj[key] = arr[key];
1171
- }
1172
- return obj;
1173
- }
1174
- function formDataToJSON(formData) {
1175
- function buildPath(path, value, target, index) {
1176
- let name = path[index++];
1177
- const isNumericKey = Number.isFinite(+name);
1178
- const isLast = index >= path.length;
1179
- name = !name && utils_default.isArray(target) ? target.length : name;
1180
- if (isLast) {
1181
- if (utils_default.hasOwnProp(target, name)) {
1182
- target[name] = [target[name], value];
1183
- } else {
1184
- target[name] = value;
1185
- }
1186
- return !isNumericKey;
1187
- }
1188
- if (!target[name] || !utils_default.isObject(target[name])) {
1189
- target[name] = [];
1190
- }
1191
- const result = buildPath(path, value, target[name], index);
1192
- if (result && utils_default.isArray(target[name])) {
1193
- target[name] = arrayToObject(target[name]);
1194
- }
1195
- return !isNumericKey;
1196
- }
1197
- if (utils_default.isFormData(formData) && utils_default.isFunction(formData.entries)) {
1198
- const obj = {};
1199
- utils_default.forEachEntry(formData, (name, value) => {
1200
- buildPath(parsePropPath(name), value, obj, 0);
1201
- });
1202
- return obj;
1203
- }
1204
- return null;
1205
- }
1206
- var formDataToJSON_default = formDataToJSON;
1207
-
1208
- // node_modules/axios/lib/defaults/index.js
1209
- function stringifySafely(rawValue, parser, encoder) {
1210
- if (utils_default.isString(rawValue)) {
1211
- try {
1212
- (parser || JSON.parse)(rawValue);
1213
- return utils_default.trim(rawValue);
1214
- } catch (e) {
1215
- if (e.name !== "SyntaxError") {
1216
- throw e;
1217
- }
1218
- }
1219
- }
1220
- return (encoder || JSON.stringify)(rawValue);
1221
- }
1222
- var defaults = {
1223
- transitional: transitional_default,
1224
- adapter: ["xhr", "http"],
1225
- transformRequest: [function transformRequest(data, headers) {
1226
- const contentType = headers.getContentType() || "";
1227
- const hasJSONContentType = contentType.indexOf("application/json") > -1;
1228
- const isObjectPayload = utils_default.isObject(data);
1229
- if (isObjectPayload && utils_default.isHTMLForm(data)) {
1230
- data = new FormData(data);
1231
- }
1232
- const isFormData2 = utils_default.isFormData(data);
1233
- if (isFormData2) {
1234
- if (!hasJSONContentType) {
1235
- return data;
1236
- }
1237
- return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data;
1238
- }
1239
- if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) {
1240
- return data;
1241
- }
1242
- if (utils_default.isArrayBufferView(data)) {
1243
- return data.buffer;
1244
- }
1245
- if (utils_default.isURLSearchParams(data)) {
1246
- headers.setContentType("application/x-www-form-urlencoded;charset=utf-8", false);
1247
- return data.toString();
1248
- }
1249
- let isFileList3;
1250
- if (isObjectPayload) {
1251
- if (contentType.indexOf("application/x-www-form-urlencoded") > -1) {
1252
- return toURLEncodedForm(data, this.formSerializer).toString();
1253
- }
1254
- if ((isFileList3 = utils_default.isFileList(data)) || contentType.indexOf("multipart/form-data") > -1) {
1255
- const _FormData = this.env && this.env.FormData;
1256
- return toFormData_default(
1257
- isFileList3 ? { "files[]": data } : data,
1258
- _FormData && new _FormData(),
1259
- this.formSerializer
1260
- );
1261
- }
1262
- }
1263
- if (isObjectPayload || hasJSONContentType) {
1264
- headers.setContentType("application/json", false);
1265
- return stringifySafely(data);
1266
- }
1267
- return data;
1268
- }],
1269
- transformResponse: [function transformResponse(data) {
1270
- const transitional2 = this.transitional || defaults.transitional;
1271
- const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing;
1272
- const JSONRequested = this.responseType === "json";
1273
- if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) {
1274
- const silentJSONParsing = transitional2 && transitional2.silentJSONParsing;
1275
- const strictJSONParsing = !silentJSONParsing && JSONRequested;
1276
- try {
1277
- return JSON.parse(data);
1278
- } catch (e) {
1279
- if (strictJSONParsing) {
1280
- if (e.name === "SyntaxError") {
1281
- throw AxiosError_default.from(e, AxiosError_default.ERR_BAD_RESPONSE, this, null, this.response);
1282
- }
1283
- throw e;
1284
- }
1285
- }
1286
- }
1287
- return data;
1288
- }],
1289
- /**
1290
- * A timeout in milliseconds to abort a request. If set to 0 (default) a
1291
- * timeout is not created.
1292
- */
1293
- timeout: 0,
1294
- xsrfCookieName: "XSRF-TOKEN",
1295
- xsrfHeaderName: "X-XSRF-TOKEN",
1296
- maxContentLength: -1,
1297
- maxBodyLength: -1,
1298
- env: {
1299
- FormData: browser_default.classes.FormData,
1300
- Blob: browser_default.classes.Blob
1301
- },
1302
- validateStatus: function validateStatus(status) {
1303
- return status >= 200 && status < 300;
1304
- },
1305
- headers: {
1306
- common: {
1307
- "Accept": "application/json, text/plain, */*",
1308
- "Content-Type": void 0
1309
- }
1310
- }
1311
- };
1312
- utils_default.forEach(["delete", "get", "head", "post", "put", "patch"], (method) => {
1313
- defaults.headers[method] = {};
1314
- });
1315
- var defaults_default = defaults;
1316
-
1317
- // node_modules/axios/lib/helpers/parseHeaders.js
1318
- var ignoreDuplicateOf = utils_default.toObjectSet([
1319
- "age",
1320
- "authorization",
1321
- "content-length",
1322
- "content-type",
1323
- "etag",
1324
- "expires",
1325
- "from",
1326
- "host",
1327
- "if-modified-since",
1328
- "if-unmodified-since",
1329
- "last-modified",
1330
- "location",
1331
- "max-forwards",
1332
- "proxy-authorization",
1333
- "referer",
1334
- "retry-after",
1335
- "user-agent"
1336
- ]);
1337
- var parseHeaders_default = (rawHeaders) => {
1338
- const parsed = {};
1339
- let key;
1340
- let val;
1341
- let i;
1342
- rawHeaders && rawHeaders.split("\n").forEach(function parser(line) {
1343
- i = line.indexOf(":");
1344
- key = line.substring(0, i).trim().toLowerCase();
1345
- val = line.substring(i + 1).trim();
1346
- if (!key || parsed[key] && ignoreDuplicateOf[key]) {
1347
- return;
1348
- }
1349
- if (key === "set-cookie") {
1350
- if (parsed[key]) {
1351
- parsed[key].push(val);
1352
- } else {
1353
- parsed[key] = [val];
1354
- }
1355
- } else {
1356
- parsed[key] = parsed[key] ? parsed[key] + ", " + val : val;
1357
- }
1358
- });
1359
- return parsed;
1360
- };
1361
-
1362
- // node_modules/axios/lib/core/AxiosHeaders.js
1363
- var $internals = Symbol("internals");
1364
- function normalizeHeader(header) {
1365
- return header && String(header).trim().toLowerCase();
1366
- }
1367
- function normalizeValue(value) {
1368
- if (value === false || value == null) {
1369
- return value;
1370
- }
1371
- return utils_default.isArray(value) ? value.map(normalizeValue) : String(value);
1372
- }
1373
- function parseTokens(str) {
1374
- const tokens = /* @__PURE__ */ Object.create(null);
1375
- const tokensRE = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
1376
- let match;
1377
- while (match = tokensRE.exec(str)) {
1378
- tokens[match[1]] = match[2];
1379
- }
1380
- return tokens;
1381
- }
1382
- var isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());
1383
- function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) {
1384
- if (utils_default.isFunction(filter2)) {
1385
- return filter2.call(this, value, header);
1386
- }
1387
- if (isHeaderNameFilter) {
1388
- value = header;
1389
- }
1390
- if (!utils_default.isString(value)) return;
1391
- if (utils_default.isString(filter2)) {
1392
- return value.indexOf(filter2) !== -1;
1393
- }
1394
- if (utils_default.isRegExp(filter2)) {
1395
- return filter2.test(value);
1396
- }
1397
- }
1398
- function formatHeader(header) {
1399
- return header.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (w, char, str) => {
1400
- return char.toUpperCase() + str;
1401
- });
1402
- }
1403
- function buildAccessors(obj, header) {
1404
- const accessorName = utils_default.toCamelCase(" " + header);
1405
- ["get", "set", "has"].forEach((methodName) => {
1406
- Object.defineProperty(obj, methodName + accessorName, {
1407
- value: function(arg1, arg2, arg3) {
1408
- return this[methodName].call(this, header, arg1, arg2, arg3);
1409
- },
1410
- configurable: true
1411
- });
1412
- });
1413
- }
1414
- var AxiosHeaders = class {
1415
- constructor(headers) {
1416
- headers && this.set(headers);
1417
- }
1418
- set(header, valueOrRewrite, rewrite) {
1419
- const self2 = this;
1420
- function setHeader(_value, _header, _rewrite) {
1421
- const lHeader = normalizeHeader(_header);
1422
- if (!lHeader) {
1423
- throw new Error("header name must be a non-empty string");
1424
- }
1425
- const key = utils_default.findKey(self2, lHeader);
1426
- if (!key || self2[key] === void 0 || _rewrite === true || _rewrite === void 0 && self2[key] !== false) {
1427
- self2[key || _header] = normalizeValue(_value);
1428
- }
1429
- }
1430
- const setHeaders = (headers, _rewrite) => utils_default.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));
1431
- if (utils_default.isPlainObject(header) || header instanceof this.constructor) {
1432
- setHeaders(header, valueOrRewrite);
1433
- } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {
1434
- setHeaders(parseHeaders_default(header), valueOrRewrite);
1435
- } else {
1436
- header != null && setHeader(valueOrRewrite, header, rewrite);
1437
- }
1438
- return this;
1439
- }
1440
- get(header, parser) {
1441
- header = normalizeHeader(header);
1442
- if (header) {
1443
- const key = utils_default.findKey(this, header);
1444
- if (key) {
1445
- const value = this[key];
1446
- if (!parser) {
1447
- return value;
1448
- }
1449
- if (parser === true) {
1450
- return parseTokens(value);
1451
- }
1452
- if (utils_default.isFunction(parser)) {
1453
- return parser.call(this, value, key);
1454
- }
1455
- if (utils_default.isRegExp(parser)) {
1456
- return parser.exec(value);
1457
- }
1458
- throw new TypeError("parser must be boolean|regexp|function");
1459
- }
1460
- }
1461
- }
1462
- has(header, matcher) {
1463
- header = normalizeHeader(header);
1464
- if (header) {
1465
- const key = utils_default.findKey(this, header);
1466
- return !!(key && this[key] !== void 0 && (!matcher || matchHeaderValue(this, this[key], key, matcher)));
1467
- }
1468
- return false;
1469
- }
1470
- delete(header, matcher) {
1471
- const self2 = this;
1472
- let deleted = false;
1473
- function deleteHeader(_header) {
1474
- _header = normalizeHeader(_header);
1475
- if (_header) {
1476
- const key = utils_default.findKey(self2, _header);
1477
- if (key && (!matcher || matchHeaderValue(self2, self2[key], key, matcher))) {
1478
- delete self2[key];
1479
- deleted = true;
1480
- }
1481
- }
1482
- }
1483
- if (utils_default.isArray(header)) {
1484
- header.forEach(deleteHeader);
1485
- } else {
1486
- deleteHeader(header);
1487
- }
1488
- return deleted;
1489
- }
1490
- clear(matcher) {
1491
- const keys = Object.keys(this);
1492
- let i = keys.length;
1493
- let deleted = false;
1494
- while (i--) {
1495
- const key = keys[i];
1496
- if (!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {
1497
- delete this[key];
1498
- deleted = true;
1499
- }
1500
- }
1501
- return deleted;
1502
- }
1503
- normalize(format) {
1504
- const self2 = this;
1505
- const headers = {};
1506
- utils_default.forEach(this, (value, header) => {
1507
- const key = utils_default.findKey(headers, header);
1508
- if (key) {
1509
- self2[key] = normalizeValue(value);
1510
- delete self2[header];
1511
- return;
1512
- }
1513
- const normalized = format ? formatHeader(header) : String(header).trim();
1514
- if (normalized !== header) {
1515
- delete self2[header];
1516
- }
1517
- self2[normalized] = normalizeValue(value);
1518
- headers[normalized] = true;
1519
- });
1520
- return this;
1521
- }
1522
- concat(...targets) {
1523
- return this.constructor.concat(this, ...targets);
1524
- }
1525
- toJSON(asStrings) {
1526
- const obj = /* @__PURE__ */ Object.create(null);
1527
- utils_default.forEach(this, (value, header) => {
1528
- value != null && value !== false && (obj[header] = asStrings && utils_default.isArray(value) ? value.join(", ") : value);
1529
- });
1530
- return obj;
1531
- }
1532
- [Symbol.iterator]() {
1533
- return Object.entries(this.toJSON())[Symbol.iterator]();
1534
- }
1535
- toString() {
1536
- return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n");
1537
- }
1538
- get [Symbol.toStringTag]() {
1539
- return "AxiosHeaders";
1540
- }
1541
- static from(thing) {
1542
- return thing instanceof this ? thing : new this(thing);
1543
- }
1544
- static concat(first, ...targets) {
1545
- const computed = new this(first);
1546
- targets.forEach((target) => computed.set(target));
1547
- return computed;
1548
- }
1549
- static accessor(header) {
1550
- const internals = this[$internals] = this[$internals] = {
1551
- accessors: {}
1552
- };
1553
- const accessors = internals.accessors;
1554
- const prototype3 = this.prototype;
1555
- function defineAccessor(_header) {
1556
- const lHeader = normalizeHeader(_header);
1557
- if (!accessors[lHeader]) {
1558
- buildAccessors(prototype3, _header);
1559
- accessors[lHeader] = true;
1560
- }
1561
- }
1562
- utils_default.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);
1563
- return this;
1564
- }
1565
- };
1566
- AxiosHeaders.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
1567
- utils_default.reduceDescriptors(AxiosHeaders.prototype, ({ value }, key) => {
1568
- let mapped = key[0].toUpperCase() + key.slice(1);
1569
- return {
1570
- get: () => value,
1571
- set(headerValue) {
1572
- this[mapped] = headerValue;
1573
- }
1574
- };
1575
- });
1576
- utils_default.freezeMethods(AxiosHeaders);
1577
- var AxiosHeaders_default = AxiosHeaders;
1578
-
1579
- // node_modules/axios/lib/core/transformData.js
1580
- function transformData(fns, response) {
1581
- const config = this || defaults_default;
1582
- const context = response || config;
1583
- const headers = AxiosHeaders_default.from(context.headers);
1584
- let data = context.data;
1585
- utils_default.forEach(fns, function transform(fn) {
1586
- data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
1587
- });
1588
- headers.normalize();
1589
- return data;
1590
- }
1591
-
1592
- // node_modules/axios/lib/cancel/isCancel.js
1593
- function isCancel(value) {
1594
- return !!(value && value.__CANCEL__);
1595
- }
1596
-
1597
- // node_modules/axios/lib/cancel/CanceledError.js
1598
- function CanceledError(message, config, request) {
1599
- AxiosError_default.call(this, message == null ? "canceled" : message, AxiosError_default.ERR_CANCELED, config, request);
1600
- this.name = "CanceledError";
1601
- }
1602
- utils_default.inherits(CanceledError, AxiosError_default, {
1603
- __CANCEL__: true
1604
- });
1605
- var CanceledError_default = CanceledError;
1606
-
1607
- // node_modules/axios/lib/core/settle.js
1608
- function settle(resolve, reject, response) {
1609
- const validateStatus2 = response.config.validateStatus;
1610
- if (!response.status || !validateStatus2 || validateStatus2(response.status)) {
1611
- resolve(response);
1612
- } else {
1613
- reject(new AxiosError_default(
1614
- "Request failed with status code " + response.status,
1615
- [AxiosError_default.ERR_BAD_REQUEST, AxiosError_default.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
1616
- response.config,
1617
- response.request,
1618
- response
1619
- ));
1620
- }
1621
- }
1622
-
1623
- // node_modules/axios/lib/helpers/cookies.js
1624
- var cookies_default = browser_default.isStandardBrowserEnv ? (
1625
- // Standard browser envs support document.cookie
1626
- /* @__PURE__ */ function standardBrowserEnv() {
1627
- return {
1628
- write: function write(name, value, expires, path, domain, secure) {
1629
- const cookie = [];
1630
- cookie.push(name + "=" + encodeURIComponent(value));
1631
- if (utils_default.isNumber(expires)) {
1632
- cookie.push("expires=" + new Date(expires).toGMTString());
1633
- }
1634
- if (utils_default.isString(path)) {
1635
- cookie.push("path=" + path);
1636
- }
1637
- if (utils_default.isString(domain)) {
1638
- cookie.push("domain=" + domain);
1639
- }
1640
- if (secure === true) {
1641
- cookie.push("secure");
1642
- }
1643
- document.cookie = cookie.join("; ");
1644
- },
1645
- read: function read(name) {
1646
- const match = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)"));
1647
- return match ? decodeURIComponent(match[3]) : null;
1648
- },
1649
- remove: function remove(name) {
1650
- this.write(name, "", Date.now() - 864e5);
1651
- }
1652
- };
1653
- }()
1654
- ) : (
1655
- // Non standard browser env (web workers, react-native) lack needed support.
1656
- /* @__PURE__ */ function nonStandardBrowserEnv() {
1657
- return {
1658
- write: function write() {
1659
- },
1660
- read: function read() {
1661
- return null;
1662
- },
1663
- remove: function remove() {
1664
- }
1665
- };
1666
- }()
1667
- );
1668
-
1669
- // node_modules/axios/lib/helpers/isAbsoluteURL.js
1670
- function isAbsoluteURL(url) {
1671
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
1672
- }
1673
-
1674
- // node_modules/axios/lib/helpers/combineURLs.js
1675
- function combineURLs(baseURL, relativeURL) {
1676
- return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
1677
- }
1678
-
1679
- // node_modules/axios/lib/core/buildFullPath.js
1680
- function buildFullPath(baseURL, requestedURL) {
1681
- if (baseURL && !isAbsoluteURL(requestedURL)) {
1682
- return combineURLs(baseURL, requestedURL);
1683
- }
1684
- return requestedURL;
1685
- }
1686
-
1687
- // node_modules/axios/lib/helpers/isURLSameOrigin.js
1688
- var isURLSameOrigin_default = browser_default.isStandardBrowserEnv ? (
1689
- // Standard browser envs have full support of the APIs needed to test
1690
- // whether the request URL is of the same origin as current location.
1691
- function standardBrowserEnv2() {
1692
- const msie = /(msie|trident)/i.test(navigator.userAgent);
1693
- const urlParsingNode = document.createElement("a");
1694
- let originURL;
1695
- function resolveURL(url) {
1696
- let href = url;
1697
- if (msie) {
1698
- urlParsingNode.setAttribute("href", href);
1699
- href = urlParsingNode.href;
1700
- }
1701
- urlParsingNode.setAttribute("href", href);
1702
- return {
1703
- href: urlParsingNode.href,
1704
- protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "",
1705
- host: urlParsingNode.host,
1706
- search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "",
1707
- hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "",
1708
- hostname: urlParsingNode.hostname,
1709
- port: urlParsingNode.port,
1710
- pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname
1711
- };
1712
- }
1713
- originURL = resolveURL(window.location.href);
1714
- return function isURLSameOrigin(requestURL) {
1715
- const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL;
1716
- return parsed.protocol === originURL.protocol && parsed.host === originURL.host;
1717
- };
1718
- }()
1719
- ) : (
1720
- // Non standard browser envs (web workers, react-native) lack needed support.
1721
- /* @__PURE__ */ function nonStandardBrowserEnv2() {
1722
- return function isURLSameOrigin() {
1723
- return true;
1724
- };
1725
- }()
1726
- );
1727
-
1728
- // node_modules/axios/lib/helpers/parseProtocol.js
1729
- function parseProtocol(url) {
1730
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
1731
- return match && match[1] || "";
1732
- }
201
+ isVoiceRecordingAttachment: () => isVoiceRecordingAttachment,
202
+ isVoteAnswer: () => isVoteAnswer,
203
+ localMessageToNewMessagePayload: () => localMessageToNewMessagePayload,
204
+ logChatPromiseExecution: () => logChatPromiseExecution,
205
+ mapPollStateToResponse: () => mapPollStateToResponse,
206
+ pollCompositionStateProcessors: () => pollCompositionStateProcessors,
207
+ pollStateChangeValidators: () => pollStateChangeValidators,
208
+ postInsights: () => postInsights,
209
+ promoteChannel: () => promoteChannel,
210
+ readFileAsArrayBuffer: () => readFileAsArrayBuffer,
211
+ removeDiacritics: () => removeDiacritics,
212
+ replaceWordWithEntity: () => replaceWordWithEntity,
213
+ textIsEmpty: () => textIsEmpty,
214
+ timeLeftMs: () => timeLeftMs
215
+ });
216
+ module.exports = __toCommonJS(index_exports);
1733
217
 
1734
- // node_modules/axios/lib/helpers/speedometer.js
1735
- function speedometer(samplesCount, min) {
1736
- samplesCount = samplesCount || 10;
1737
- const bytes = new Array(samplesCount);
1738
- const timestamps = new Array(samplesCount);
1739
- let head = 0;
1740
- let tail = 0;
1741
- let firstSampleTS;
1742
- min = min !== void 0 ? min : 1e3;
1743
- return function push(chunkLength) {
1744
- const now = Date.now();
1745
- const startedAt = timestamps[tail];
1746
- if (!firstSampleTS) {
1747
- firstSampleTS = now;
1748
- }
1749
- bytes[head] = chunkLength;
1750
- timestamps[head] = now;
1751
- let i = tail;
1752
- let bytesCount = 0;
1753
- while (i !== head) {
1754
- bytesCount += bytes[i++];
1755
- i = i % samplesCount;
1756
- }
1757
- head = (head + 1) % samplesCount;
1758
- if (head === tail) {
1759
- tail = (tail + 1) % samplesCount;
1760
- }
1761
- if (now - firstSampleTS < min) {
1762
- return;
1763
- }
1764
- const passed = startedAt && now - startedAt;
1765
- return passed ? Math.round(bytesCount * 1e3 / passed) : void 0;
1766
- };
218
+ // src/base64.ts
219
+ var import_base64_js = require("base64-js");
220
+ function isString(arrayOrString) {
221
+ return typeof arrayOrString === "string";
1767
222
  }
1768
- var speedometer_default = speedometer;
1769
-
1770
- // node_modules/axios/lib/adapters/xhr.js
1771
- function progressEventReducer(listener, isDownloadStream) {
1772
- let bytesNotified = 0;
1773
- const _speedometer = speedometer_default(50, 250);
1774
- return (e) => {
1775
- const loaded = e.loaded;
1776
- const total = e.lengthComputable ? e.total : void 0;
1777
- const progressBytes = loaded - bytesNotified;
1778
- const rate = _speedometer(progressBytes);
1779
- const inRange = loaded <= total;
1780
- bytesNotified = loaded;
1781
- const data = {
1782
- loaded,
1783
- total,
1784
- progress: total ? loaded / total : void 0,
1785
- bytes: progressBytes,
1786
- rate: rate ? rate : void 0,
1787
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
1788
- event: e
1789
- };
1790
- data[isDownloadStream ? "download" : "upload"] = true;
1791
- listener(data);
1792
- };
223
+ function isMapStringCallback(arrayOrString, callback) {
224
+ return !!callback && isString(arrayOrString);
1793
225
  }
1794
- var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined";
1795
- var xhr_default = isXHRAdapterSupported && function(config) {
1796
- return new Promise(function dispatchXhrRequest(resolve, reject) {
1797
- let requestData = config.data;
1798
- const requestHeaders = AxiosHeaders_default.from(config.headers).normalize();
1799
- const responseType = config.responseType;
1800
- let onCanceled;
1801
- function done() {
1802
- if (config.cancelToken) {
1803
- config.cancelToken.unsubscribe(onCanceled);
1804
- }
1805
- if (config.signal) {
1806
- config.signal.removeEventListener("abort", onCanceled);
1807
- }
1808
- }
1809
- let contentType;
1810
- if (utils_default.isFormData(requestData)) {
1811
- if (browser_default.isStandardBrowserEnv || browser_default.isStandardBrowserWebWorkerEnv) {
1812
- requestHeaders.setContentType(false);
1813
- } else if (!requestHeaders.getContentType(/^\s*multipart\/form-data/)) {
1814
- requestHeaders.setContentType("multipart/form-data");
1815
- } else if (utils_default.isString(contentType = requestHeaders.getContentType())) {
1816
- requestHeaders.setContentType(contentType.replace(/^\s*(multipart\/form-data);+/, "$1"));
1817
- }
1818
- }
1819
- let request = new XMLHttpRequest();
1820
- if (config.auth) {
1821
- const username = config.auth.username || "";
1822
- const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : "";
1823
- requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password));
1824
- }
1825
- const fullPath = buildFullPath(config.baseURL, config.url);
1826
- request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true);
1827
- request.timeout = config.timeout;
1828
- function onloadend() {
1829
- if (!request) {
1830
- return;
1831
- }
1832
- const responseHeaders = AxiosHeaders_default.from(
1833
- "getAllResponseHeaders" in request && request.getAllResponseHeaders()
1834
- );
1835
- const responseData = !responseType || responseType === "text" || responseType === "json" ? request.responseText : request.response;
1836
- const response = {
1837
- data: responseData,
1838
- status: request.status,
1839
- statusText: request.statusText,
1840
- headers: responseHeaders,
1841
- config,
1842
- request
1843
- };
1844
- settle(function _resolve(value) {
1845
- resolve(value);
1846
- done();
1847
- }, function _reject(err) {
1848
- reject(err);
1849
- done();
1850
- }, response);
1851
- request = null;
1852
- }
1853
- if ("onloadend" in request) {
1854
- request.onloadend = onloadend;
1855
- } else {
1856
- request.onreadystatechange = function handleLoad() {
1857
- if (!request || request.readyState !== 4) {
1858
- return;
1859
- }
1860
- if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf("file:") === 0)) {
1861
- return;
1862
- }
1863
- setTimeout(onloadend);
1864
- };
1865
- }
1866
- request.onabort = function handleAbort() {
1867
- if (!request) {
1868
- return;
1869
- }
1870
- reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request));
1871
- request = null;
1872
- };
1873
- request.onerror = function handleError() {
1874
- reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request));
1875
- request = null;
1876
- };
1877
- request.ontimeout = function handleTimeout() {
1878
- let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded";
1879
- const transitional2 = config.transitional || transitional_default;
1880
- if (config.timeoutErrorMessage) {
1881
- timeoutErrorMessage = config.timeoutErrorMessage;
1882
- }
1883
- reject(new AxiosError_default(
1884
- timeoutErrorMessage,
1885
- transitional2.clarifyTimeoutError ? AxiosError_default.ETIMEDOUT : AxiosError_default.ECONNABORTED,
1886
- config,
1887
- request
1888
- ));
1889
- request = null;
1890
- };
1891
- if (browser_default.isStandardBrowserEnv) {
1892
- const xsrfValue = isURLSameOrigin_default(fullPath) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName);
1893
- if (xsrfValue) {
1894
- requestHeaders.set(config.xsrfHeaderName, xsrfValue);
1895
- }
1896
- }
1897
- requestData === void 0 && requestHeaders.setContentType(null);
1898
- if ("setRequestHeader" in request) {
1899
- utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {
1900
- request.setRequestHeader(key, val);
1901
- });
1902
- }
1903
- if (!utils_default.isUndefined(config.withCredentials)) {
1904
- request.withCredentials = !!config.withCredentials;
1905
- }
1906
- if (responseType && responseType !== "json") {
1907
- request.responseType = config.responseType;
1908
- }
1909
- if (typeof config.onDownloadProgress === "function") {
1910
- request.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true));
1911
- }
1912
- if (typeof config.onUploadProgress === "function" && request.upload) {
1913
- request.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress));
1914
- }
1915
- if (config.cancelToken || config.signal) {
1916
- onCanceled = (cancel) => {
1917
- if (!request) {
1918
- return;
1919
- }
1920
- reject(!cancel || cancel.type ? new CanceledError_default(null, config, request) : cancel);
1921
- request.abort();
1922
- request = null;
1923
- };
1924
- config.cancelToken && config.cancelToken.subscribe(onCanceled);
1925
- if (config.signal) {
1926
- config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled);
226
+ function map(arrayOrString, callback) {
227
+ const res = [];
228
+ if (isString(arrayOrString) && isMapStringCallback(arrayOrString, callback)) {
229
+ for (let k = 0, len = arrayOrString.length; k < len; k++) {
230
+ if (arrayOrString.charAt(k)) {
231
+ const kValue = arrayOrString.charAt(k);
232
+ const mappedValue = callback(kValue, k, arrayOrString);
233
+ res[k] = mappedValue;
1927
234
  }
1928
235
  }
1929
- const protocol = parseProtocol(fullPath);
1930
- if (protocol && browser_default.protocols.indexOf(protocol) === -1) {
1931
- reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config));
1932
- return;
1933
- }
1934
- request.send(requestData || null);
1935
- });
1936
- };
1937
-
1938
- // node_modules/axios/lib/adapters/adapters.js
1939
- var knownAdapters = {
1940
- http: null_default,
1941
- xhr: xhr_default
1942
- };
1943
- utils_default.forEach(knownAdapters, (fn, value) => {
1944
- if (fn) {
1945
- try {
1946
- Object.defineProperty(fn, "name", { value });
1947
- } catch (e) {
1948
- }
1949
- Object.defineProperty(fn, "adapterName", { value });
1950
- }
1951
- });
1952
- var renderReason = (reason) => `- ${reason}`;
1953
- var isResolvedHandle = (adapter) => utils_default.isFunction(adapter) || adapter === null || adapter === false;
1954
- var adapters_default = {
1955
- getAdapter: (adapters) => {
1956
- adapters = utils_default.isArray(adapters) ? adapters : [adapters];
1957
- const { length } = adapters;
1958
- let nameOrAdapter;
1959
- let adapter;
1960
- const rejectedReasons = {};
1961
- for (let i = 0; i < length; i++) {
1962
- nameOrAdapter = adapters[i];
1963
- let id;
1964
- adapter = nameOrAdapter;
1965
- if (!isResolvedHandle(nameOrAdapter)) {
1966
- adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];
1967
- if (adapter === void 0) {
1968
- throw new AxiosError_default(`Unknown adapter '${id}'`);
1969
- }
1970
- }
1971
- if (adapter) {
1972
- break;
236
+ } else if (!isString(arrayOrString) && !isMapStringCallback(arrayOrString, callback)) {
237
+ for (let k = 0, len = arrayOrString.length; k < len; k++) {
238
+ if (k in arrayOrString) {
239
+ const kValue = arrayOrString[k];
240
+ const mappedValue = callback(kValue, k, arrayOrString);
241
+ res[k] = mappedValue;
1973
242
  }
1974
- rejectedReasons[id || "#" + i] = adapter;
1975
- }
1976
- if (!adapter) {
1977
- const reasons = Object.entries(rejectedReasons).map(
1978
- ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build")
1979
- );
1980
- let s = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified";
1981
- throw new AxiosError_default(
1982
- `There is no suitable adapter to dispatch the request ` + s,
1983
- "ERR_NOT_SUPPORT"
1984
- );
1985
243
  }
1986
- return adapter;
1987
- },
1988
- adapters: knownAdapters
1989
- };
1990
-
1991
- // node_modules/axios/lib/core/dispatchRequest.js
1992
- function throwIfCancellationRequested(config) {
1993
- if (config.cancelToken) {
1994
- config.cancelToken.throwIfRequested();
1995
- }
1996
- if (config.signal && config.signal.aborted) {
1997
- throw new CanceledError_default(null, config);
1998
244
  }
245
+ return res;
1999
246
  }
2000
- function dispatchRequest(config) {
2001
- throwIfCancellationRequested(config);
2002
- config.headers = AxiosHeaders_default.from(config.headers);
2003
- config.data = transformData.call(
2004
- config,
2005
- config.transformRequest
2006
- );
2007
- if (["post", "put", "patch"].indexOf(config.method) !== -1) {
2008
- config.headers.setContentType("application/x-www-form-urlencoded", false);
2009
- }
2010
- const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter);
2011
- return adapter(config).then(function onAdapterResolution(response) {
2012
- throwIfCancellationRequested(config);
2013
- response.data = transformData.call(
2014
- config,
2015
- config.transformResponse,
2016
- response
2017
- );
2018
- response.headers = AxiosHeaders_default.from(response.headers);
2019
- return response;
2020
- }, function onAdapterRejection(reason) {
2021
- if (!isCancel(reason)) {
2022
- throwIfCancellationRequested(config);
2023
- if (reason && reason.response) {
2024
- reason.response.data = transformData.call(
2025
- config,
2026
- config.transformResponse,
2027
- reason.response
2028
- );
2029
- reason.response.headers = AxiosHeaders_default.from(reason.response.headers);
2030
- }
2031
- }
2032
- return Promise.reject(reason);
2033
- });
2034
- }
2035
-
2036
- // node_modules/axios/lib/core/mergeConfig.js
2037
- var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing;
2038
- function mergeConfig(config1, config2) {
2039
- config2 = config2 || {};
2040
- const config = {};
2041
- function getMergedValue(target, source, caseless) {
2042
- if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) {
2043
- return utils_default.merge.call({ caseless }, target, source);
2044
- } else if (utils_default.isPlainObject(source)) {
2045
- return utils_default.merge({}, source);
2046
- } else if (utils_default.isArray(source)) {
2047
- return source.slice();
2048
- }
2049
- return source;
2050
- }
2051
- function mergeDeepProperties(a, b, caseless) {
2052
- if (!utils_default.isUndefined(b)) {
2053
- return getMergedValue(a, b, caseless);
2054
- } else if (!utils_default.isUndefined(a)) {
2055
- return getMergedValue(void 0, a, caseless);
2056
- }
2057
- }
2058
- function valueFromConfig2(a, b) {
2059
- if (!utils_default.isUndefined(b)) {
2060
- return getMergedValue(void 0, b);
2061
- }
2062
- }
2063
- function defaultToConfig2(a, b) {
2064
- if (!utils_default.isUndefined(b)) {
2065
- return getMergedValue(void 0, b);
2066
- } else if (!utils_default.isUndefined(a)) {
2067
- return getMergedValue(void 0, a);
2068
- }
2069
- }
2070
- function mergeDirectKeys(a, b, prop) {
2071
- if (prop in config2) {
2072
- return getMergedValue(a, b);
2073
- } else if (prop in config1) {
2074
- return getMergedValue(void 0, a);
2075
- }
2076
- }
2077
- const mergeMap = {
2078
- url: valueFromConfig2,
2079
- method: valueFromConfig2,
2080
- data: valueFromConfig2,
2081
- baseURL: defaultToConfig2,
2082
- transformRequest: defaultToConfig2,
2083
- transformResponse: defaultToConfig2,
2084
- paramsSerializer: defaultToConfig2,
2085
- timeout: defaultToConfig2,
2086
- timeoutMessage: defaultToConfig2,
2087
- withCredentials: defaultToConfig2,
2088
- adapter: defaultToConfig2,
2089
- responseType: defaultToConfig2,
2090
- xsrfCookieName: defaultToConfig2,
2091
- xsrfHeaderName: defaultToConfig2,
2092
- onUploadProgress: defaultToConfig2,
2093
- onDownloadProgress: defaultToConfig2,
2094
- decompress: defaultToConfig2,
2095
- maxContentLength: defaultToConfig2,
2096
- maxBodyLength: defaultToConfig2,
2097
- beforeRedirect: defaultToConfig2,
2098
- transport: defaultToConfig2,
2099
- httpAgent: defaultToConfig2,
2100
- httpsAgent: defaultToConfig2,
2101
- cancelToken: defaultToConfig2,
2102
- socketPath: defaultToConfig2,
2103
- responseEncoding: defaultToConfig2,
2104
- validateStatus: mergeDirectKeys,
2105
- headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true)
2106
- };
2107
- utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {
2108
- const merge2 = mergeMap[prop] || mergeDeepProperties;
2109
- const configValue = merge2(config1[prop], config2[prop], prop);
2110
- utils_default.isUndefined(configValue) && merge2 !== mergeDirectKeys || (config[prop] = configValue);
2111
- });
2112
- return config;
2113
- }
2114
-
2115
- // node_modules/axios/lib/env/data.js
2116
- var VERSION = "1.6.0";
2117
-
2118
- // node_modules/axios/lib/helpers/validator.js
2119
- var validators = {};
2120
- ["object", "boolean", "number", "function", "string", "symbol"].forEach((type, i) => {
2121
- validators[type] = function validator(thing) {
2122
- return typeof thing === type || "a" + (i < 1 ? "n " : " ") + type;
2123
- };
2124
- });
2125
- var deprecatedWarnings = {};
2126
- validators.transitional = function transitional(validator, version, message) {
2127
- function formatMessage2(opt, desc) {
2128
- return "[Axios v" + VERSION + "] Transitional option '" + opt + "'" + desc + (message ? ". " + message : "");
2129
- }
2130
- return (value, opt, opts) => {
2131
- if (validator === false) {
2132
- throw new AxiosError_default(
2133
- formatMessage2(opt, " has been removed" + (version ? " in " + version : "")),
2134
- AxiosError_default.ERR_DEPRECATED
2135
- );
2136
- }
2137
- if (version && !deprecatedWarnings[opt]) {
2138
- deprecatedWarnings[opt] = true;
2139
- console.warn(
2140
- formatMessage2(
2141
- opt,
2142
- " has been deprecated since v" + version + " and will be removed in the near future"
2143
- )
2144
- );
2145
- }
2146
- return validator ? validator(value, opt, opts) : true;
2147
- };
2148
- };
2149
- function assertOptions(options, schema, allowUnknown) {
2150
- if (typeof options !== "object") {
2151
- throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE);
2152
- }
2153
- const keys = Object.keys(options);
2154
- let i = keys.length;
2155
- while (i-- > 0) {
2156
- const opt = keys[i];
2157
- const validator = schema[opt];
2158
- if (validator) {
2159
- const value = options[opt];
2160
- const result = value === void 0 || validator(value, opt, options);
2161
- if (result !== true) {
2162
- throw new AxiosError_default("option " + opt + " must be " + result, AxiosError_default.ERR_BAD_OPTION_VALUE);
2163
- }
2164
- continue;
2165
- }
2166
- if (allowUnknown !== true) {
2167
- throw new AxiosError_default("Unknown option " + opt, AxiosError_default.ERR_BAD_OPTION);
247
+ var encodeBase64 = (data) => (0, import_base64_js.fromByteArray)(new Uint8Array(map(data, (char) => char.charCodeAt(0))));
248
+ var decodeBase64 = (s) => {
249
+ const e = {}, w = String.fromCharCode, L = s.length;
250
+ let i, b = 0, c, x, l = 0, a, r = "";
251
+ const A = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
252
+ for (i = 0; i < 64; i++) {
253
+ e[A.charAt(i)] = i;
254
+ }
255
+ for (x = 0; x < L; x++) {
256
+ c = e[s.charAt(x)];
257
+ b = (b << 6) + c;
258
+ l += 6;
259
+ while (l >= 8) {
260
+ ((a = b >>> (l -= 8) & 255) || x < L - 2) && (r += w(a));
2168
261
  }
2169
262
  }
2170
- }
2171
- var validator_default = {
2172
- assertOptions,
2173
- validators
263
+ return r;
2174
264
  };
2175
265
 
2176
- // node_modules/axios/lib/core/Axios.js
2177
- var validators2 = validator_default.validators;
2178
- var Axios = class {
2179
- constructor(instanceConfig) {
2180
- this.defaults = instanceConfig;
2181
- this.interceptors = {
2182
- request: new InterceptorManager_default(),
2183
- response: new InterceptorManager_default()
266
+ // src/campaign.ts
267
+ var Campaign = class {
268
+ constructor(client, id, data) {
269
+ this.client = client;
270
+ this.id = id;
271
+ this.data = data;
272
+ }
273
+ async create() {
274
+ const body = {
275
+ id: this.id,
276
+ message_template: this.data?.message_template,
277
+ segment_ids: this.data?.segment_ids,
278
+ sender_id: this.data?.sender_id,
279
+ sender_mode: this.data?.sender_mode,
280
+ sender_visibility: this.data?.sender_visibility,
281
+ channel_template: this.data?.channel_template,
282
+ create_channels: this.data?.create_channels,
283
+ show_channels: this.data?.show_channels,
284
+ description: this.data?.description,
285
+ name: this.data?.name,
286
+ skip_push: this.data?.skip_push,
287
+ skip_webhook: this.data?.skip_webhook,
288
+ user_ids: this.data?.user_ids
2184
289
  };
290
+ const result = await this.client.createCampaign(body);
291
+ this.id = result.campaign.id;
292
+ this.data = result.campaign;
293
+ return result;
2185
294
  }
2186
- /**
2187
- * Dispatch a request
2188
- *
2189
- * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
2190
- * @param {?Object} config
2191
- *
2192
- * @returns {Promise} The Promise to be fulfilled
2193
- */
2194
- request(configOrUrl, config) {
2195
- if (typeof configOrUrl === "string") {
2196
- config = config || {};
2197
- config.url = configOrUrl;
2198
- } else {
2199
- config = configOrUrl || {};
2200
- }
2201
- config = mergeConfig(this.defaults, config);
2202
- const { transitional: transitional2, paramsSerializer, headers } = config;
2203
- if (transitional2 !== void 0) {
2204
- validator_default.assertOptions(transitional2, {
2205
- silentJSONParsing: validators2.transitional(validators2.boolean),
2206
- forcedJSONParsing: validators2.transitional(validators2.boolean),
2207
- clarifyTimeoutError: validators2.transitional(validators2.boolean)
2208
- }, false);
2209
- }
2210
- if (paramsSerializer != null) {
2211
- if (utils_default.isFunction(paramsSerializer)) {
2212
- config.paramsSerializer = {
2213
- serialize: paramsSerializer
2214
- };
2215
- } else {
2216
- validator_default.assertOptions(paramsSerializer, {
2217
- encode: validators2.function,
2218
- serialize: validators2.function
2219
- }, true);
2220
- }
2221
- }
2222
- config.method = (config.method || this.defaults.method || "get").toLowerCase();
2223
- let contextHeaders = headers && utils_default.merge(
2224
- headers.common,
2225
- headers[config.method]
2226
- );
2227
- headers && utils_default.forEach(
2228
- ["delete", "get", "head", "post", "put", "patch", "common"],
2229
- (method) => {
2230
- delete headers[method];
2231
- }
2232
- );
2233
- config.headers = AxiosHeaders_default.concat(contextHeaders, headers);
2234
- const requestInterceptorChain = [];
2235
- let synchronousRequestInterceptors = true;
2236
- this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {
2237
- if (typeof interceptor.runWhen === "function" && interceptor.runWhen(config) === false) {
2238
- return;
2239
- }
2240
- synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;
2241
- requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);
2242
- });
2243
- const responseInterceptorChain = [];
2244
- this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {
2245
- responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);
2246
- });
2247
- let promise;
2248
- let i = 0;
2249
- let len;
2250
- if (!synchronousRequestInterceptors) {
2251
- const chain = [dispatchRequest.bind(this), void 0];
2252
- chain.unshift.apply(chain, requestInterceptorChain);
2253
- chain.push.apply(chain, responseInterceptorChain);
2254
- len = chain.length;
2255
- promise = Promise.resolve(config);
2256
- while (i < len) {
2257
- promise = promise.then(chain[i++], chain[i++]);
2258
- }
2259
- return promise;
2260
- }
2261
- len = requestInterceptorChain.length;
2262
- let newConfig = config;
2263
- i = 0;
2264
- while (i < len) {
2265
- const onFulfilled = requestInterceptorChain[i++];
2266
- const onRejected = requestInterceptorChain[i++];
2267
- try {
2268
- newConfig = onFulfilled(newConfig);
2269
- } catch (error) {
2270
- onRejected.call(this, error);
2271
- break;
2272
- }
2273
- }
2274
- try {
2275
- promise = dispatchRequest.call(this, newConfig);
2276
- } catch (error) {
2277
- return Promise.reject(error);
2278
- }
2279
- i = 0;
2280
- len = responseInterceptorChain.length;
2281
- while (i < len) {
2282
- promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);
295
+ verifyCampaignId() {
296
+ if (!this.id) {
297
+ throw new Error(
298
+ "Campaign id is missing. Either create the campaign using campaign.create() or set the id during instantiation - const campaign = client.campaign(id)"
299
+ );
2283
300
  }
2284
- return promise;
2285
- }
2286
- getUri(config) {
2287
- config = mergeConfig(this.defaults, config);
2288
- const fullPath = buildFullPath(config.baseURL, config.url);
2289
- return buildURL(fullPath, config.params, config.paramsSerializer);
2290
- }
2291
- };
2292
- utils_default.forEach(["delete", "get", "head", "options"], function forEachMethodNoData(method) {
2293
- Axios.prototype[method] = function(url, config) {
2294
- return this.request(mergeConfig(config || {}, {
2295
- method,
2296
- url,
2297
- data: (config || {}).data
2298
- }));
2299
- };
2300
- });
2301
- utils_default.forEach(["post", "put", "patch"], function forEachMethodWithData(method) {
2302
- function generateHTTPMethod(isForm) {
2303
- return function httpMethod(url, data, config) {
2304
- return this.request(mergeConfig(config || {}, {
2305
- method,
2306
- headers: isForm ? {
2307
- "Content-Type": "multipart/form-data"
2308
- } : {},
2309
- url,
2310
- data
2311
- }));
2312
- };
2313
301
  }
2314
- Axios.prototype[method] = generateHTTPMethod();
2315
- Axios.prototype[method + "Form"] = generateHTTPMethod(true);
2316
- });
2317
- var Axios_default = Axios;
2318
-
2319
- // node_modules/axios/lib/cancel/CancelToken.js
2320
- var CancelToken = class _CancelToken {
2321
- constructor(executor) {
2322
- if (typeof executor !== "function") {
2323
- throw new TypeError("executor must be a function.");
2324
- }
2325
- let resolvePromise;
2326
- this.promise = new Promise(function promiseExecutor(resolve) {
2327
- resolvePromise = resolve;
2328
- });
2329
- const token = this;
2330
- this.promise.then((cancel) => {
2331
- if (!token._listeners) return;
2332
- let i = token._listeners.length;
2333
- while (i-- > 0) {
2334
- token._listeners[i](cancel);
2335
- }
2336
- token._listeners = null;
2337
- });
2338
- this.promise.then = (onfulfilled) => {
2339
- let _resolve;
2340
- const promise = new Promise((resolve) => {
2341
- token.subscribe(resolve);
2342
- _resolve = resolve;
2343
- }).then(onfulfilled);
2344
- promise.cancel = function reject() {
2345
- token.unsubscribe(_resolve);
2346
- };
2347
- return promise;
2348
- };
2349
- executor(function cancel(message, config, request) {
2350
- if (token.reason) {
2351
- return;
2352
- }
2353
- token.reason = new CanceledError_default(message, config, request);
2354
- resolvePromise(token.reason);
2355
- });
302
+ async start(options) {
303
+ this.verifyCampaignId();
304
+ return await this.client.startCampaign(this.id, options);
2356
305
  }
2357
- /**
2358
- * Throws a `CanceledError` if cancellation has been requested.
2359
- */
2360
- throwIfRequested() {
2361
- if (this.reason) {
2362
- throw this.reason;
2363
- }
306
+ update(data) {
307
+ this.verifyCampaignId();
308
+ return this.client.updateCampaign(this.id, data);
2364
309
  }
2365
- /**
2366
- * Subscribe to the cancel signal
2367
- */
2368
- subscribe(listener) {
2369
- if (this.reason) {
2370
- listener(this.reason);
2371
- return;
2372
- }
2373
- if (this._listeners) {
2374
- this._listeners.push(listener);
2375
- } else {
2376
- this._listeners = [listener];
2377
- }
310
+ async delete() {
311
+ this.verifyCampaignId();
312
+ return await this.client.deleteCampaign(this.id);
2378
313
  }
2379
- /**
2380
- * Unsubscribe from the cancel signal
2381
- */
2382
- unsubscribe(listener) {
2383
- if (!this._listeners) {
2384
- return;
2385
- }
2386
- const index = this._listeners.indexOf(listener);
2387
- if (index !== -1) {
2388
- this._listeners.splice(index, 1);
2389
- }
314
+ stop() {
315
+ this.verifyCampaignId();
316
+ return this.client.stopCampaign(this.id);
2390
317
  }
2391
- /**
2392
- * Returns an object that contains a new `CancelToken` and a function that, when called,
2393
- * cancels the `CancelToken`.
2394
- */
2395
- static source() {
2396
- let cancel;
2397
- const token = new _CancelToken(function executor(c) {
2398
- cancel = c;
2399
- });
2400
- return {
2401
- token,
2402
- cancel
2403
- };
318
+ get(options) {
319
+ this.verifyCampaignId();
320
+ return this.client.getCampaign(this.id, options);
2404
321
  }
2405
322
  };
2406
- var CancelToken_default = CancelToken;
2407
-
2408
- // node_modules/axios/lib/helpers/spread.js
2409
- function spread(callback) {
2410
- return function wrap(arr) {
2411
- return callback.apply(null, arr);
2412
- };
2413
- }
2414
-
2415
- // node_modules/axios/lib/helpers/isAxiosError.js
2416
- function isAxiosError(payload) {
2417
- return utils_default.isObject(payload) && payload.isAxiosError === true;
2418
- }
2419
-
2420
- // node_modules/axios/lib/helpers/HttpStatusCode.js
2421
- var HttpStatusCode = {
2422
- Continue: 100,
2423
- SwitchingProtocols: 101,
2424
- Processing: 102,
2425
- EarlyHints: 103,
2426
- Ok: 200,
2427
- Created: 201,
2428
- Accepted: 202,
2429
- NonAuthoritativeInformation: 203,
2430
- NoContent: 204,
2431
- ResetContent: 205,
2432
- PartialContent: 206,
2433
- MultiStatus: 207,
2434
- AlreadyReported: 208,
2435
- ImUsed: 226,
2436
- MultipleChoices: 300,
2437
- MovedPermanently: 301,
2438
- Found: 302,
2439
- SeeOther: 303,
2440
- NotModified: 304,
2441
- UseProxy: 305,
2442
- Unused: 306,
2443
- TemporaryRedirect: 307,
2444
- PermanentRedirect: 308,
2445
- BadRequest: 400,
2446
- Unauthorized: 401,
2447
- PaymentRequired: 402,
2448
- Forbidden: 403,
2449
- NotFound: 404,
2450
- MethodNotAllowed: 405,
2451
- NotAcceptable: 406,
2452
- ProxyAuthenticationRequired: 407,
2453
- RequestTimeout: 408,
2454
- Conflict: 409,
2455
- Gone: 410,
2456
- LengthRequired: 411,
2457
- PreconditionFailed: 412,
2458
- PayloadTooLarge: 413,
2459
- UriTooLong: 414,
2460
- UnsupportedMediaType: 415,
2461
- RangeNotSatisfiable: 416,
2462
- ExpectationFailed: 417,
2463
- ImATeapot: 418,
2464
- MisdirectedRequest: 421,
2465
- UnprocessableEntity: 422,
2466
- Locked: 423,
2467
- FailedDependency: 424,
2468
- TooEarly: 425,
2469
- UpgradeRequired: 426,
2470
- PreconditionRequired: 428,
2471
- TooManyRequests: 429,
2472
- RequestHeaderFieldsTooLarge: 431,
2473
- UnavailableForLegalReasons: 451,
2474
- InternalServerError: 500,
2475
- NotImplemented: 501,
2476
- BadGateway: 502,
2477
- ServiceUnavailable: 503,
2478
- GatewayTimeout: 504,
2479
- HttpVersionNotSupported: 505,
2480
- VariantAlsoNegotiates: 506,
2481
- InsufficientStorage: 507,
2482
- LoopDetected: 508,
2483
- NotExtended: 510,
2484
- NetworkAuthenticationRequired: 511
2485
- };
2486
- Object.entries(HttpStatusCode).forEach(([key, value]) => {
2487
- HttpStatusCode[value] = key;
2488
- });
2489
- var HttpStatusCode_default = HttpStatusCode;
2490
-
2491
- // node_modules/axios/lib/axios.js
2492
- function createInstance(defaultConfig) {
2493
- const context = new Axios_default(defaultConfig);
2494
- const instance = bind(Axios_default.prototype.request, context);
2495
- utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
2496
- utils_default.extend(instance, context, null, { allOwnKeys: true });
2497
- instance.create = function create(instanceConfig) {
2498
- return createInstance(mergeConfig(defaultConfig, instanceConfig));
2499
- };
2500
- return instance;
2501
- }
2502
- var axios = createInstance(defaults_default);
2503
- axios.Axios = Axios_default;
2504
- axios.CanceledError = CanceledError_default;
2505
- axios.CancelToken = CancelToken_default;
2506
- axios.isCancel = isCancel;
2507
- axios.VERSION = VERSION;
2508
- axios.toFormData = toFormData_default;
2509
- axios.AxiosError = AxiosError_default;
2510
- axios.Cancel = axios.CanceledError;
2511
- axios.all = function all(promises) {
2512
- return Promise.all(promises);
2513
- };
2514
- axios.spread = spread;
2515
- axios.isAxiosError = isAxiosError;
2516
- axios.mergeConfig = mergeConfig;
2517
- axios.AxiosHeaders = AxiosHeaders_default;
2518
- axios.formToJSON = (thing) => formDataToJSON_default(utils_default.isHTMLForm(thing) ? new FormData(thing) : thing);
2519
- axios.getAdapter = adapters_default.getAdapter;
2520
- axios.HttpStatusCode = HttpStatusCode_default;
2521
- axios.default = axios;
2522
- var axios_default = axios;
2523
-
2524
- // node_modules/axios/index.js
2525
- var {
2526
- Axios: Axios2,
2527
- AxiosError: AxiosError2,
2528
- CanceledError: CanceledError2,
2529
- isCancel: isCancel2,
2530
- CancelToken: CancelToken2,
2531
- VERSION: VERSION2,
2532
- all: all2,
2533
- Cancel,
2534
- isAxiosError: isAxiosError2,
2535
- spread: spread2,
2536
- toFormData: toFormData2,
2537
- AxiosHeaders: AxiosHeaders2,
2538
- HttpStatusCode: HttpStatusCode2,
2539
- formToJSON,
2540
- getAdapter,
2541
- mergeConfig: mergeConfig2
2542
- } = axios_default;
2543
323
 
2544
324
  // src/client.ts
325
+ var import_axios3 = __toESM(require("axios"));
2545
326
  var import_https = __toESM(require_https());
2546
327
 
2547
328
  // src/utils.ts
2548
- var import_form_data = __toESM(require_browser());
329
+ var import_form_data = __toESM(require("form-data"));
2549
330
 
2550
331
  // src/constants.ts
2551
332
  var DEFAULT_QUERY_CHANNELS_MESSAGE_LIST_PAGE_SIZE = 25;
@@ -2587,7 +368,7 @@ function logChatPromiseExecution(promise, name) {
2587
368
  });
2588
369
  }
2589
370
  var sleep = (m) => new Promise((r) => setTimeout(r, m));
2590
- function isFunction2(value) {
371
+ function isFunction(value) {
2591
372
  return typeof value === "function" || value instanceof Function || Object.prototype.toString.call(value) === "[object Function]";
2592
373
  }
2593
374
  var chatCodes = {
@@ -2597,7 +378,7 @@ var chatCodes = {
2597
378
  function isReadableStream(obj) {
2598
379
  return obj !== null && typeof obj === "object" && (obj.readable || typeof obj._read === "function");
2599
380
  }
2600
- function isBuffer2(obj) {
381
+ function isBuffer(obj) {
2601
382
  return obj != null && obj.constructor != null && // @ts-expect-error expected
2602
383
  typeof obj.constructor.isBuffer === "function" && // @ts-expect-error expected
2603
384
  obj.constructor.isBuffer(obj);
@@ -2629,7 +410,7 @@ function isOwnUserBaseProperty(property) {
2629
410
  }
2630
411
  function addFileToFormData(uri, name, contentType) {
2631
412
  const data = new import_form_data.default();
2632
- if (isReadableStream(uri) || isBuffer2(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
413
+ if (isReadableStream(uri) || isBuffer(uri) || isFileWebAPI(uri) || isBlobWebAPI(uri)) {
2633
414
  if (name) data.append("file", uri, name);
2634
415
  else data.append("file", uri);
2635
416
  } else {
@@ -3350,8 +1131,8 @@ var promoteChannel = ({
3350
1131
  );
3351
1132
  return newChannels;
3352
1133
  };
3353
- var isDate2 = (value) => !!value.getTime;
3354
- var isLocalMessage = (message) => isDate2(message.created_at);
1134
+ var isDate = (value) => !!value.getTime;
1135
+ var isLocalMessage = (message) => isDate(message.created_at);
3355
1136
  var runDetached = (callback, options) => {
3356
1137
  const { context, onSuccessCallback = () => void 0, onErrorCallback } = options ?? {};
3357
1138
  const defaultOnError = (error) => {
@@ -4063,14 +1844,14 @@ var isUploadedAttachment = (attachment) => isAudioAttachment(attachment) || isFi
4063
1844
  var isSharedLocationResponse = (location) => !!location.latitude && !!location.longitude && !!location.channel_cid;
4064
1845
 
4065
1846
  // src/messageComposer/fileUtils.ts
4066
- var isFile2 = (fileLike) => !!fileLike.lastModified && !("uri" in fileLike);
4067
- var isFileList2 = (obj) => {
1847
+ var isFile = (fileLike) => !!fileLike.lastModified && !("uri" in fileLike);
1848
+ var isFileList = (obj) => {
4068
1849
  if (obj === null || obj === void 0) return false;
4069
1850
  if (typeof obj !== "object") return false;
4070
1851
  return typeof FileList !== "undefined" && obj instanceof FileList || "item" in obj && "length" in obj && !Array.isArray(obj);
4071
1852
  };
4072
1853
  var isBlobButNotFile = (obj) => obj instanceof Blob && !(obj instanceof File);
4073
- var isFileReference = (obj) => obj !== null && typeof obj === "object" && !isFile2(obj) && !isBlobButNotFile(obj) && typeof obj.name === "string" && typeof obj.uri === "string" && typeof obj.size === "number" && typeof obj.type === "string";
1854
+ var isFileReference = (obj) => obj !== null && typeof obj === "object" && !isFile(obj) && !isBlobButNotFile(obj) && typeof obj.name === "string" && typeof obj.uri === "string" && typeof obj.size === "number" && typeof obj.type === "string";
4074
1855
  var createFileFromBlobs = ({
4075
1856
  blobsArray,
4076
1857
  fileName,
@@ -4418,7 +2199,7 @@ var AttachmentPreUploadMiddlewareExecutor = class extends MiddlewareExecutor {
4418
2199
 
4419
2200
  // src/store.ts
4420
2201
  var isPatch = (value) => typeof value === "function";
4421
- var noop2 = () => {
2202
+ var noop = () => {
4422
2203
  };
4423
2204
  var StateStore = class {
4424
2205
  constructor(value) {
@@ -4619,7 +2400,7 @@ var MergedStateStore = class _MergedStateStore extends StateStore {
4619
2400
  console.warn(
4620
2401
  `${_MergedStateStore.name}.addPreprocessor is disabled, call original.addPreprocessor or merged.addPreprocessor instead`
4621
2402
  );
4622
- return noop2;
2403
+ return noop;
4623
2404
  }
4624
2405
  };
4625
2406
 
@@ -5091,7 +2872,7 @@ var _AttachmentManager = class _AttachmentManager {
5091
2872
  } = uploadConfig;
5092
2873
  const sizeLimit = size_limit || DEFAULT_UPLOAD_SIZE_LIMIT_BYTES;
5093
2874
  const mimeType = fileLike.type;
5094
- if (isFile2(fileLike) || isFileReference(fileLike)) {
2875
+ if (isFile(fileLike) || isFileReference(fileLike)) {
5095
2876
  if (allowed_file_extensions?.length && !allowed_file_extensions.some(
5096
2877
  (ext) => fileLike.name.toLowerCase().endsWith(ext.toLowerCase())
5097
2878
  )) {
@@ -5162,7 +2943,7 @@ var _AttachmentManager = class _AttachmentManager {
5162
2943
  fileLike.type
5163
2944
  );
5164
2945
  }
5165
- const file = isFile2(fileLike) ? fileLike : createFileFromBlobs({
2946
+ const file = isFile(fileLike) ? fileLike : createFileFromBlobs({
5166
2947
  blobsArray: [fileLike],
5167
2948
  fileName: generateFileName(fileLike.type),
5168
2949
  mimeType: fileLike.type
@@ -5319,7 +3100,7 @@ var _AttachmentManager = class _AttachmentManager {
5319
3100
  };
5320
3101
  this.uploadFiles = async (files) => {
5321
3102
  if (!this.isUploadEnabled) return;
5322
- const iterableFiles = isFileList2(files) ? Array.from(files) : files;
3103
+ const iterableFiles = isFileList(files) ? Array.from(files) : files;
5323
3104
  return await Promise.all(
5324
3105
  iterableFiles.slice(0, this.availableUploadSlots).map(this.uploadFile)
5325
3106
  );
@@ -5418,7 +3199,7 @@ var _AttachmentManager = class _AttachmentManager {
5418
3199
  }
5419
3200
  };
5420
3201
  _AttachmentManager.toLocalUploadAttachment = (fileLike) => {
5421
- const file = isFileReference(fileLike) || isFile2(fileLike) ? fileLike : createFileFromBlobs({
3202
+ const file = isFileReference(fileLike) || isFile(fileLike) ? fileLike : createFileFromBlobs({
5422
3203
  blobsArray: [fileLike],
5423
3204
  fileName: generateFileName(fileLike.type),
5424
3205
  mimeType: fileLike.type
@@ -5882,7 +3663,7 @@ var createPollComposerStateMiddleware = ({
5882
3663
  } = {}) => {
5883
3664
  const universalHandler = ({
5884
3665
  state,
5885
- validators: validators3,
3666
+ validators,
5886
3667
  processors
5887
3668
  }) => {
5888
3669
  const { previousState, targetFields } = state;
@@ -5911,7 +3692,7 @@ var createPollComposerStateMiddleware = ({
5911
3692
  );
5912
3693
  }
5913
3694
  const newErrors = Object.keys(targetFields).reduce((acc, key) => {
5914
- const validator = validators3[key];
3695
+ const validator = validators[key];
5915
3696
  if (validator) {
5916
3697
  const error = validator({
5917
3698
  currentError: previousState.errors[key],
@@ -11153,22 +8934,11 @@ var ClientState = class {
11153
8934
  }
11154
8935
  };
11155
8936
 
11156
- // node_modules/isomorphic-ws/browser.js
11157
- var ws = null;
11158
- if (typeof WebSocket !== "undefined") {
11159
- ws = WebSocket;
11160
- } else if (typeof MozWebSocket !== "undefined") {
11161
- ws = MozWebSocket;
11162
- } else if (typeof global !== "undefined") {
11163
- ws = global.WebSocket || global.MozWebSocket;
11164
- } else if (typeof window !== "undefined") {
11165
- ws = window.WebSocket || window.MozWebSocket;
11166
- } else if (typeof self !== "undefined") {
11167
- ws = self.WebSocket || self.MozWebSocket;
11168
- }
11169
- var browser_default2 = ws;
8937
+ // src/connection.ts
8938
+ var import_isomorphic_ws = __toESM(require("isomorphic-ws"));
11170
8939
 
11171
8940
  // src/insights.ts
8941
+ var import_axios = __toESM(require("axios"));
11172
8942
  var InsightMetrics = class {
11173
8943
  constructor() {
11174
8944
  this.connectionStartTimestamp = null;
@@ -11181,7 +8951,7 @@ var postInsights = async (insightType, insights) => {
11181
8951
  const maxAttempts = 3;
11182
8952
  for (let i = 0; i < maxAttempts; i++) {
11183
8953
  try {
11184
- await axios_default.post(
8954
+ await import_axios.default.post(
11185
8955
  `https://chat-insights.getstream.io/insights/${insightType}`,
11186
8956
  insights
11187
8957
  );
@@ -11531,8 +9301,8 @@ var StableWSConnection = class {
11531
9301
  this.ws.removeAllListeners();
11532
9302
  }
11533
9303
  let isClosedPromise;
11534
- const { ws: ws2 } = this;
11535
- if (ws2 && ws2.close && ws2.readyState === ws2.OPEN) {
9304
+ const { ws } = this;
9305
+ if (ws && ws.close && ws.readyState === ws.OPEN) {
11536
9306
  isClosedPromise = new Promise((resolve) => {
11537
9307
  const onclose = (event) => {
11538
9308
  this._log(
@@ -11541,13 +9311,13 @@ var StableWSConnection = class {
11541
9311
  );
11542
9312
  resolve();
11543
9313
  };
11544
- ws2.onclose = onclose;
9314
+ ws.onclose = onclose;
11545
9315
  setTimeout(onclose, timeout != null ? timeout : 1e3);
11546
9316
  });
11547
9317
  this._log(
11548
9318
  `disconnect() - Manually closed connection by calling client.disconnect()`
11549
9319
  );
11550
- ws2.close(
9320
+ ws.close(
11551
9321
  chatCodes.WS_CLOSED_SUCCESS,
11552
9322
  "Manually closed connection by calling client.disconnect()"
11553
9323
  );
@@ -11587,7 +9357,7 @@ var StableWSConnection = class {
11587
9357
  wsURL,
11588
9358
  requestID: this.requestID
11589
9359
  });
11590
- this.ws = new browser_default2(wsURL);
9360
+ this.ws = new import_isomorphic_ws.default(wsURL);
11591
9361
  this.ws.onopen = this.onopen.bind(this, this.wsID);
11592
9362
  this.ws.onclose = this.onclose.bind(this, this.wsID);
11593
9363
  this.ws.onerror = this.onerror.bind(this, this.wsID);
@@ -11770,7 +9540,7 @@ var TokenManager = class {
11770
9540
  this.setTokenOrProvider = async (tokenOrProvider, user) => {
11771
9541
  this.validateToken(tokenOrProvider, user);
11772
9542
  this.user = user;
11773
- if (isFunction2(tokenOrProvider)) {
9543
+ if (isFunction(tokenOrProvider)) {
11774
9544
  this.tokenProvider = tokenOrProvider;
11775
9545
  this.type = "provider";
11776
9546
  }
@@ -11801,7 +9571,7 @@ var TokenManager = class {
11801
9571
  if (!this.secret && !tokenOrProvider) {
11802
9572
  throw new Error("User token can not be empty");
11803
9573
  }
11804
- if (tokenOrProvider && typeof tokenOrProvider !== "string" && !isFunction2(tokenOrProvider)) {
9574
+ if (tokenOrProvider && typeof tokenOrProvider !== "string" && !isFunction(tokenOrProvider)) {
11805
9575
  throw new Error("user token should either be a string or a function");
11806
9576
  }
11807
9577
  if (typeof tokenOrProvider === "string") {
@@ -11864,6 +9634,9 @@ var TokenManager = class {
11864
9634
  }
11865
9635
  };
11866
9636
 
9637
+ // src/connection_fallback.ts
9638
+ var import_axios2 = __toESM(require("axios"));
9639
+
11867
9640
  // src/errors.ts
11868
9641
  var APIErrorCodes = {
11869
9642
  "-1": { name: "InternalSystemError", retryable: true },
@@ -11939,7 +9712,7 @@ var WSConnectionFallback = class {
11939
9712
  /** @private */
11940
9713
  this._req = async (params, config, retry) => {
11941
9714
  if (!this.cancelToken && !params.close) {
11942
- this.cancelToken = axios_default.CancelToken.source();
9715
+ this.cancelToken = import_axios2.default.CancelToken.source();
11943
9716
  }
11944
9717
  try {
11945
9718
  const res = await this.client.doAxiosRequest(
@@ -11975,7 +9748,7 @@ var WSConnectionFallback = class {
11975
9748
  }
11976
9749
  }
11977
9750
  } catch (error) {
11978
- if (axios_default.isCancel(error)) {
9751
+ if (import_axios2.default.isCancel(error)) {
11979
9752
  this._log(`_poll() - axios canceled request`);
11980
9753
  return;
11981
9754
  }
@@ -12118,9 +9891,9 @@ var Segment = class {
12118
9891
  this.verifySegmentId();
12119
9892
  return this.client.segmentTargetExists(this.id, targetId);
12120
9893
  }
12121
- queryTargets(filter2 = {}, sort = [], options = {}) {
9894
+ queryTargets(filter = {}, sort = [], options = {}) {
12122
9895
  this.verifySegmentId();
12123
- return this.client.querySegmentTargets(this.id, filter2, sort, options);
9896
+ return this.client.querySegmentTargets(this.id, filter, sort, options);
12124
9897
  }
12125
9898
  };
12126
9899
 
@@ -13023,8 +10796,8 @@ var PollManager = class extends WithSubscriptions {
13023
10796
  this.setOrOverwriteInCache(poll);
13024
10797
  return this.fromState(id);
13025
10798
  };
13026
- this.queryPolls = async (filter2, sort = [], options = {}) => {
13027
- const { polls, next } = await this.client.queryPolls(filter2, sort, options);
10799
+ this.queryPolls = async (filter, sort = [], options = {}) => {
10800
+ const { polls, next } = await this.client.queryPolls(filter, sort, options);
13028
10801
  const pollInstances = polls.map((poll) => {
13029
10802
  this.setOrOverwriteInCache(poll, true);
13030
10803
  return this.fromState(poll.id);
@@ -13975,7 +11748,7 @@ _ReminderManager.isReminderWsEventPayload = (event) => !!event.reminder && (even
13975
11748
  var ReminderManager = _ReminderManager;
13976
11749
 
13977
11750
  // src/client.ts
13978
- function isString3(x) {
11751
+ function isString2(x) {
13979
11752
  return typeof x === "string" || x instanceof String;
13980
11753
  }
13981
11754
  var StreamChat = class _StreamChat {
@@ -14579,10 +12352,10 @@ var StreamChat = class _StreamChat {
14579
12352
  this.mutedUsers = [];
14580
12353
  this.moderation = new Moderation(this);
14581
12354
  this.notifications = options?.notifications ?? new NotificationManager();
14582
- if (secretOrOptions && isString3(secretOrOptions)) {
12355
+ if (secretOrOptions && isString2(secretOrOptions)) {
14583
12356
  this.secret = secretOrOptions;
14584
12357
  }
14585
- const inputOptions = options ? options : secretOrOptions && !isString3(secretOrOptions) ? secretOrOptions : {};
12358
+ const inputOptions = options ? options : secretOrOptions && !isString2(secretOrOptions) ? secretOrOptions : {};
14586
12359
  this.browser = typeof inputOptions.browser !== "undefined" ? inputOptions.browser : typeof window !== "undefined";
14587
12360
  this.node = !this.browser;
14588
12361
  this.options = {
@@ -14601,7 +12374,7 @@ var StreamChat = class _StreamChat {
14601
12374
  keepAliveMsecs: 3e3
14602
12375
  });
14603
12376
  }
14604
- this.axiosInstance = axios_default.create(this.options);
12377
+ this.axiosInstance = import_axios3.default.create(this.options);
14605
12378
  this.setBaseURL(this.options.baseURL || "https://chat.stream-io-api.com");
14606
12379
  if (typeof process !== "undefined" && "env" in process && process.env.STREAM_LOCAL_TEST_RUN) {
14607
12380
  this.setBaseURL("http://localhost:3030");
@@ -14622,7 +12395,7 @@ var StreamChat = class _StreamChat {
14622
12395
  this.defaultWSTimeoutWithFallback = 6 * 1e3;
14623
12396
  this.defaultWSTimeout = 15 * 1e3;
14624
12397
  this.axiosInstance.defaults.paramsSerializer = axiosParamsSerializer;
14625
- this.logger = isFunction2(inputOptions.logger) ? inputOptions.logger : () => null;
12398
+ this.logger = isFunction(inputOptions.logger) ? inputOptions.logger : () => null;
14626
12399
  this.recoverStateOnReconnect = this.options.recoverStateOnReconnect;
14627
12400
  this.threads = new ThreadManager({ client: this });
14628
12401
  this.polls = new PollManager({ client: this });
@@ -15230,9 +13003,9 @@ var StreamChat = class _StreamChat {
15230
13003
  *
15231
13004
  * @return {Promise<{ QueryReactionsAPIResponse } search channels response
15232
13005
  */
15233
- async queryReactions(messageID, filter2, sort = [], options = {}) {
13006
+ async queryReactions(messageID, filter, sort = [], options = {}) {
15234
13007
  const payload = {
15235
- filter: filter2,
13008
+ filter,
15236
13009
  sort: normalizeQuerySort(sort),
15237
13010
  ...options
15238
13011
  };
@@ -15240,7 +13013,7 @@ var StreamChat = class _StreamChat {
15240
13013
  try {
15241
13014
  const reactionsFromDb = await this.offlineDb.getReactions({
15242
13015
  messageId: messageID,
15243
- filters: filter2,
13016
+ filters: filter,
15244
13017
  sort,
15245
13018
  limit: options.limit
15246
13019
  });
@@ -15936,7 +13709,7 @@ var StreamChat = class _StreamChat {
15936
13709
  const now = /* @__PURE__ */ new Date();
15937
13710
  now.setSeconds(now.getSeconds() + timeoutOrExpirationDate);
15938
13711
  pinExpires = now.toISOString();
15939
- } else if (isString3(timeoutOrExpirationDate)) {
13712
+ } else if (isString2(timeoutOrExpirationDate)) {
15940
13713
  pinExpires = timeoutOrExpirationDate;
15941
13714
  } else if (timeoutOrExpirationDate instanceof Date) {
15942
13715
  pinExpires = timeoutOrExpirationDate.toISOString();
@@ -16231,7 +14004,7 @@ var StreamChat = class _StreamChat {
16231
14004
  if (this.userAgent) {
16232
14005
  return this.userAgent;
16233
14006
  }
16234
- const version = "9.20.2";
14007
+ const version = "9.20.3";
16235
14008
  const clientBundle = "browser-cjs";
16236
14009
  let userAgentString = "";
16237
14010
  if (this.sdkIdentifier) {
@@ -16626,12 +14399,12 @@ var StreamChat = class _StreamChat {
16626
14399
  body
16627
14400
  );
16628
14401
  }
16629
- querySegmentTargets(id, filter2 = {}, sort = [], options = {}) {
14402
+ querySegmentTargets(id, filter = {}, sort = [], options = {}) {
16630
14403
  this.validateServerSideAuth();
16631
14404
  return this.post(
16632
14405
  this.baseURL + `/segments/${encodeURIComponent(id)}/targets/query`,
16633
14406
  {
16634
- filter: filter2 || {},
14407
+ filter: filter || {},
16635
14408
  sort: sort || [],
16636
14409
  ...options
16637
14410
  }
@@ -16661,10 +14434,10 @@ var StreamChat = class _StreamChat {
16661
14434
  *
16662
14435
  * @return {Segment[]} Segments
16663
14436
  */
16664
- querySegments(filter2, sort, options = {}) {
14437
+ querySegments(filter, sort, options = {}) {
16665
14438
  this.validateServerSideAuth();
16666
14439
  return this.post(this.baseURL + `/segments/query`, {
16667
- filter: filter2,
14440
+ filter,
16668
14441
  sort,
16669
14442
  ...options
16670
14443
  });
@@ -16722,10 +14495,10 @@ var StreamChat = class _StreamChat {
16722
14495
  *
16723
14496
  * @return {Campaign[]} Campaigns
16724
14497
  */
16725
- async queryCampaigns(filter2, sort, options) {
14498
+ async queryCampaigns(filter, sort, options) {
16726
14499
  this.validateServerSideAuth();
16727
14500
  return await this.post(this.baseURL + `/campaigns/query`, {
16728
- filter: filter2,
14501
+ filter,
16729
14502
  sort,
16730
14503
  ...options || {}
16731
14504
  });
@@ -17164,12 +14937,12 @@ var StreamChat = class _StreamChat {
17164
14937
  * @param userId string The user id (only serverside)
17165
14938
  * @returns {APIResponse & QueryPollsResponse} The polls
17166
14939
  */
17167
- async queryPolls(filter2 = {}, sort = [], options = {}, userId) {
14940
+ async queryPolls(filter = {}, sort = [], options = {}, userId) {
17168
14941
  const q = userId ? `?user_id=${userId}` : "";
17169
14942
  return await this.post(
17170
14943
  this.baseURL + `/polls/query${q}`,
17171
14944
  {
17172
- filter: filter2,
14945
+ filter,
17173
14946
  sort: normalizeQuerySort(sort),
17174
14947
  ...options
17175
14948
  }
@@ -17184,12 +14957,12 @@ var StreamChat = class _StreamChat {
17184
14957
  * @param userId string The user id (only serverside)
17185
14958
  * @returns {APIResponse & PollVotesAPIResponse} The poll votes
17186
14959
  */
17187
- async queryPollVotes(pollId, filter2 = {}, sort = [], options = {}, userId) {
14960
+ async queryPollVotes(pollId, filter = {}, sort = [], options = {}, userId) {
17188
14961
  const q = userId ? `?user_id=${userId}` : "";
17189
14962
  return await this.post(
17190
14963
  this.baseURL + `/polls/${encodeURIComponent(pollId)}/votes${q}`,
17191
14964
  {
17192
- filter: filter2,
14965
+ filter,
17193
14966
  sort: normalizeQuerySort(sort),
17194
14967
  ...options
17195
14968
  }
@@ -17204,12 +14977,12 @@ var StreamChat = class _StreamChat {
17204
14977
  * @param userId string The user id (only serverside)
17205
14978
  * @returns {APIResponse & PollAnswersAPIResponse} The poll votes
17206
14979
  */
17207
- async queryPollAnswers(pollId, filter2 = {}, sort = [], options = {}, userId) {
14980
+ async queryPollAnswers(pollId, filter = {}, sort = [], options = {}, userId) {
17208
14981
  const q = userId ? `?user_id=${userId}` : "";
17209
14982
  return await this.post(
17210
14983
  this.baseURL + `/polls/${encodeURIComponent(pollId)}/votes${q}`,
17211
14984
  {
17212
- filter: { ...filter2, is_answer: true },
14985
+ filter: { ...filter, is_answer: true },
17213
14986
  sort: normalizeQuerySort(sort),
17214
14987
  ...options
17215
14988
  }
@@ -17222,11 +14995,11 @@ var StreamChat = class _StreamChat {
17222
14995
  * @param options Option object, {limit: 10}
17223
14996
  * @returns {APIResponse & QueryMessageHistoryResponse} The message histories
17224
14997
  */
17225
- async queryMessageHistory(filter2 = {}, sort = [], options = {}) {
14998
+ async queryMessageHistory(filter = {}, sort = [], options = {}) {
17226
14999
  return await this.post(
17227
15000
  this.baseURL + "/messages/history",
17228
15001
  {
17229
- filter: filter2,
15002
+ filter,
17230
15003
  sort: normalizeQuerySort(sort),
17231
15004
  ...options
17232
15005
  }
@@ -17313,9 +15086,9 @@ var StreamChat = class _StreamChat {
17313
15086
  * @param {QueryRemindersOptions} options The options for querying reminders
17314
15087
  * @returns {Promise<QueryRemindersResponse>}
17315
15088
  */
17316
- async queryReminders({ filter: filter2, sort, ...rest } = {}) {
15089
+ async queryReminders({ filter, sort, ...rest } = {}) {
17317
15090
  return await this.post(`${this.baseURL}/reminders/query`, {
17318
- filter: filter2,
15091
+ filter,
17319
15092
  sort: sort && normalizeQuerySort(sort),
17320
15093
  ...rest
17321
15094
  });
@@ -17545,6 +15318,7 @@ var OfflineError = class extends Error {
17545
15318
  };
17546
15319
 
17547
15320
  // src/offline-support/offline_sync_manager.ts
15321
+ var import_axios4 = require("axios");
17548
15322
  var OfflineDBSyncManager = class {
17549
15323
  constructor({
17550
15324
  client,
@@ -17669,7 +15443,7 @@ var OfflineDBSyncManager = class {
17669
15443
  });
17670
15444
  } catch (e) {
17671
15445
  console.log("An error has occurred while syncing the DB.", e);
17672
- if (isAxiosError2(e) && e.code === "ECONNABORTED") {
15446
+ if ((0, import_axios4.isAxiosError)(e) && e.code === "ECONNABORTED") {
17673
15447
  return;
17674
15448
  }
17675
15449
  const error = e;
@@ -18557,4 +16331,4 @@ var FixedSizeQueueCache = class {
18557
16331
  return foundItem;
18558
16332
  }
18559
16333
  };
18560
- //# sourceMappingURL=index.browser.cjs.map
16334
+ //# sourceMappingURL=index.browser.js.map