@solana/web3.js 1.24.3 → 1.25.1
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.
- package/lib/index.browser.esm.js +558 -22
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +1 -1
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.esm.js +1 -1
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +564 -30
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +5 -3
- package/src/connection.ts +2 -1
package/lib/index.iife.js
CHANGED
|
@@ -18,6 +18,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
18
18
|
|
|
19
19
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
20
20
|
|
|
21
|
+
function getDefaultExportFromCjs (x) {
|
|
22
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
23
|
+
}
|
|
24
|
+
|
|
21
25
|
function getAugmentedNamespace(n) {
|
|
22
26
|
if (n.__esModule) return n;
|
|
23
27
|
var a = Object.defineProperty({}, '__esModule', {value: true});
|
|
@@ -8327,7 +8331,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
8327
8331
|
|
|
8328
8332
|
var bs58$1 = bs58;
|
|
8329
8333
|
|
|
8330
|
-
var browser$
|
|
8334
|
+
var browser$1 = {};
|
|
8331
8335
|
|
|
8332
8336
|
/* eslint-env browser */
|
|
8333
8337
|
|
|
@@ -8378,10 +8382,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
8378
8382
|
return options.outputFormat === 'hex' ? bufferToHex(hash) : hash;
|
|
8379
8383
|
};
|
|
8380
8384
|
|
|
8381
|
-
browser$
|
|
8382
|
-
var sha256 = browser$
|
|
8383
|
-
browser$
|
|
8384
|
-
browser$
|
|
8385
|
+
browser$1.sha1 = create$1('SHA-1');
|
|
8386
|
+
var sha256 = browser$1.sha256 = create$1('SHA-256');
|
|
8387
|
+
browser$1.sha384 = create$1('SHA-384');
|
|
8388
|
+
browser$1.sha512 = create$1('SHA-512');
|
|
8385
8389
|
|
|
8386
8390
|
var lib$1 = {};
|
|
8387
8391
|
|
|
@@ -11937,7 +11941,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
11937
11941
|
*
|
|
11938
11942
|
* @augments {Layout}
|
|
11939
11943
|
*/
|
|
11940
|
-
var Blob = /** @class */ (function (_super) {
|
|
11944
|
+
var Blob$1 = /** @class */ (function (_super) {
|
|
11941
11945
|
__extends(Blob, _super);
|
|
11942
11946
|
function Blob(length, property) {
|
|
11943
11947
|
var _this = this;
|
|
@@ -12004,7 +12008,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
12004
12008
|
};
|
|
12005
12009
|
return Blob;
|
|
12006
12010
|
}(Layout));
|
|
12007
|
-
Layout$1.Blob = Blob;
|
|
12011
|
+
Layout$1.Blob = Blob$1;
|
|
12008
12012
|
/**
|
|
12009
12013
|
* Contain a `NUL`-terminated UTF8 string.
|
|
12010
12014
|
*
|
|
@@ -12312,7 +12316,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
12312
12316
|
/** Factory for {@link UnionLayoutDiscriminator} values. */
|
|
12313
12317
|
Layout$1.unionLayoutDiscriminator = (function (layout, property) { return new UnionLayoutDiscriminator(layout, property); });
|
|
12314
12318
|
/** Factory for {@link Blob} values. */
|
|
12315
|
-
var blob = Layout$1.blob = (function (length, property) { return new Blob(length, property); });
|
|
12319
|
+
var blob = Layout$1.blob = (function (length, property) { return new Blob$1(length, property); });
|
|
12316
12320
|
/** Factory for {@link CString} values. */
|
|
12317
12321
|
Layout$1.cstr = (function (property) { return new CString(property); });
|
|
12318
12322
|
/** Factory for {@link UTF8} values. */
|
|
@@ -14270,36 +14274,566 @@ var solanaWeb3 = (function (exports) {
|
|
|
14270
14274
|
|
|
14271
14275
|
}
|
|
14272
14276
|
|
|
14273
|
-
var
|
|
14277
|
+
var browserPonyfill = {exports: {}};
|
|
14274
14278
|
|
|
14275
14279
|
(function (module, exports) {
|
|
14280
|
+
var global = typeof self !== 'undefined' ? self : commonjsGlobal;
|
|
14281
|
+
var __self__ = (function () {
|
|
14282
|
+
function F() {
|
|
14283
|
+
this.fetch = false;
|
|
14284
|
+
this.DOMException = global.DOMException;
|
|
14285
|
+
}
|
|
14286
|
+
F.prototype = global;
|
|
14287
|
+
return new F();
|
|
14288
|
+
})();
|
|
14289
|
+
(function(self) {
|
|
14276
14290
|
|
|
14277
|
-
|
|
14278
|
-
var getGlobal = function () {
|
|
14279
|
-
// the only reliable means to get the global object is
|
|
14280
|
-
// `Function('return this')()`
|
|
14281
|
-
// However, this causes CSP violations in Chrome apps.
|
|
14282
|
-
if (typeof self !== 'undefined') { return self; }
|
|
14283
|
-
if (typeof window !== 'undefined') { return window; }
|
|
14284
|
-
if (typeof global !== 'undefined') { return global; }
|
|
14285
|
-
throw new Error('unable to locate global object');
|
|
14286
|
-
};
|
|
14291
|
+
((function (exports) {
|
|
14287
14292
|
|
|
14288
|
-
|
|
14293
|
+
var support = {
|
|
14294
|
+
searchParams: 'URLSearchParams' in self,
|
|
14295
|
+
iterable: 'Symbol' in self && 'iterator' in Symbol,
|
|
14296
|
+
blob:
|
|
14297
|
+
'FileReader' in self &&
|
|
14298
|
+
'Blob' in self &&
|
|
14299
|
+
(function() {
|
|
14300
|
+
try {
|
|
14301
|
+
new Blob();
|
|
14302
|
+
return true
|
|
14303
|
+
} catch (e) {
|
|
14304
|
+
return false
|
|
14305
|
+
}
|
|
14306
|
+
})(),
|
|
14307
|
+
formData: 'FormData' in self,
|
|
14308
|
+
arrayBuffer: 'ArrayBuffer' in self
|
|
14309
|
+
};
|
|
14289
14310
|
|
|
14290
|
-
|
|
14311
|
+
function isDataView(obj) {
|
|
14312
|
+
return obj && DataView.prototype.isPrototypeOf(obj)
|
|
14313
|
+
}
|
|
14314
|
+
|
|
14315
|
+
if (support.arrayBuffer) {
|
|
14316
|
+
var viewClasses = [
|
|
14317
|
+
'[object Int8Array]',
|
|
14318
|
+
'[object Uint8Array]',
|
|
14319
|
+
'[object Uint8ClampedArray]',
|
|
14320
|
+
'[object Int16Array]',
|
|
14321
|
+
'[object Uint16Array]',
|
|
14322
|
+
'[object Int32Array]',
|
|
14323
|
+
'[object Uint32Array]',
|
|
14324
|
+
'[object Float32Array]',
|
|
14325
|
+
'[object Float64Array]'
|
|
14326
|
+
];
|
|
14291
14327
|
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14328
|
+
var isArrayBufferView =
|
|
14329
|
+
ArrayBuffer.isView ||
|
|
14330
|
+
function(obj) {
|
|
14331
|
+
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
|
14332
|
+
};
|
|
14333
|
+
}
|
|
14334
|
+
|
|
14335
|
+
function normalizeName(name) {
|
|
14336
|
+
if (typeof name !== 'string') {
|
|
14337
|
+
name = String(name);
|
|
14338
|
+
}
|
|
14339
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
|
14340
|
+
throw new TypeError('Invalid character in header field name')
|
|
14341
|
+
}
|
|
14342
|
+
return name.toLowerCase()
|
|
14343
|
+
}
|
|
14344
|
+
|
|
14345
|
+
function normalizeValue(value) {
|
|
14346
|
+
if (typeof value !== 'string') {
|
|
14347
|
+
value = String(value);
|
|
14348
|
+
}
|
|
14349
|
+
return value
|
|
14350
|
+
}
|
|
14351
|
+
|
|
14352
|
+
// Build a destructive iterator for the value list
|
|
14353
|
+
function iteratorFor(items) {
|
|
14354
|
+
var iterator = {
|
|
14355
|
+
next: function() {
|
|
14356
|
+
var value = items.shift();
|
|
14357
|
+
return {done: value === undefined, value: value}
|
|
14358
|
+
}
|
|
14359
|
+
};
|
|
14360
|
+
|
|
14361
|
+
if (support.iterable) {
|
|
14362
|
+
iterator[Symbol.iterator] = function() {
|
|
14363
|
+
return iterator
|
|
14364
|
+
};
|
|
14365
|
+
}
|
|
14366
|
+
|
|
14367
|
+
return iterator
|
|
14368
|
+
}
|
|
14369
|
+
|
|
14370
|
+
function Headers(headers) {
|
|
14371
|
+
this.map = {};
|
|
14372
|
+
|
|
14373
|
+
if (headers instanceof Headers) {
|
|
14374
|
+
headers.forEach(function(value, name) {
|
|
14375
|
+
this.append(name, value);
|
|
14376
|
+
}, this);
|
|
14377
|
+
} else if (Array.isArray(headers)) {
|
|
14378
|
+
headers.forEach(function(header) {
|
|
14379
|
+
this.append(header[0], header[1]);
|
|
14380
|
+
}, this);
|
|
14381
|
+
} else if (headers) {
|
|
14382
|
+
Object.getOwnPropertyNames(headers).forEach(function(name) {
|
|
14383
|
+
this.append(name, headers[name]);
|
|
14384
|
+
}, this);
|
|
14385
|
+
}
|
|
14386
|
+
}
|
|
14387
|
+
|
|
14388
|
+
Headers.prototype.append = function(name, value) {
|
|
14389
|
+
name = normalizeName(name);
|
|
14390
|
+
value = normalizeValue(value);
|
|
14391
|
+
var oldValue = this.map[name];
|
|
14392
|
+
this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
|
14393
|
+
};
|
|
14394
|
+
|
|
14395
|
+
Headers.prototype['delete'] = function(name) {
|
|
14396
|
+
delete this.map[normalizeName(name)];
|
|
14397
|
+
};
|
|
14398
|
+
|
|
14399
|
+
Headers.prototype.get = function(name) {
|
|
14400
|
+
name = normalizeName(name);
|
|
14401
|
+
return this.has(name) ? this.map[name] : null
|
|
14402
|
+
};
|
|
14403
|
+
|
|
14404
|
+
Headers.prototype.has = function(name) {
|
|
14405
|
+
return this.map.hasOwnProperty(normalizeName(name))
|
|
14406
|
+
};
|
|
14407
|
+
|
|
14408
|
+
Headers.prototype.set = function(name, value) {
|
|
14409
|
+
this.map[normalizeName(name)] = normalizeValue(value);
|
|
14410
|
+
};
|
|
14411
|
+
|
|
14412
|
+
Headers.prototype.forEach = function(callback, thisArg) {
|
|
14413
|
+
for (var name in this.map) {
|
|
14414
|
+
if (this.map.hasOwnProperty(name)) {
|
|
14415
|
+
callback.call(thisArg, this.map[name], name, this);
|
|
14416
|
+
}
|
|
14417
|
+
}
|
|
14418
|
+
};
|
|
14419
|
+
|
|
14420
|
+
Headers.prototype.keys = function() {
|
|
14421
|
+
var items = [];
|
|
14422
|
+
this.forEach(function(value, name) {
|
|
14423
|
+
items.push(name);
|
|
14424
|
+
});
|
|
14425
|
+
return iteratorFor(items)
|
|
14426
|
+
};
|
|
14427
|
+
|
|
14428
|
+
Headers.prototype.values = function() {
|
|
14429
|
+
var items = [];
|
|
14430
|
+
this.forEach(function(value) {
|
|
14431
|
+
items.push(value);
|
|
14432
|
+
});
|
|
14433
|
+
return iteratorFor(items)
|
|
14434
|
+
};
|
|
14435
|
+
|
|
14436
|
+
Headers.prototype.entries = function() {
|
|
14437
|
+
var items = [];
|
|
14438
|
+
this.forEach(function(value, name) {
|
|
14439
|
+
items.push([name, value]);
|
|
14440
|
+
});
|
|
14441
|
+
return iteratorFor(items)
|
|
14442
|
+
};
|
|
14443
|
+
|
|
14444
|
+
if (support.iterable) {
|
|
14445
|
+
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
|
14446
|
+
}
|
|
14447
|
+
|
|
14448
|
+
function consumed(body) {
|
|
14449
|
+
if (body.bodyUsed) {
|
|
14450
|
+
return Promise.reject(new TypeError('Already read'))
|
|
14451
|
+
}
|
|
14452
|
+
body.bodyUsed = true;
|
|
14453
|
+
}
|
|
14454
|
+
|
|
14455
|
+
function fileReaderReady(reader) {
|
|
14456
|
+
return new Promise(function(resolve, reject) {
|
|
14457
|
+
reader.onload = function() {
|
|
14458
|
+
resolve(reader.result);
|
|
14459
|
+
};
|
|
14460
|
+
reader.onerror = function() {
|
|
14461
|
+
reject(reader.error);
|
|
14462
|
+
};
|
|
14463
|
+
})
|
|
14464
|
+
}
|
|
14465
|
+
|
|
14466
|
+
function readBlobAsArrayBuffer(blob) {
|
|
14467
|
+
var reader = new FileReader();
|
|
14468
|
+
var promise = fileReaderReady(reader);
|
|
14469
|
+
reader.readAsArrayBuffer(blob);
|
|
14470
|
+
return promise
|
|
14471
|
+
}
|
|
14472
|
+
|
|
14473
|
+
function readBlobAsText(blob) {
|
|
14474
|
+
var reader = new FileReader();
|
|
14475
|
+
var promise = fileReaderReady(reader);
|
|
14476
|
+
reader.readAsText(blob);
|
|
14477
|
+
return promise
|
|
14478
|
+
}
|
|
14479
|
+
|
|
14480
|
+
function readArrayBufferAsText(buf) {
|
|
14481
|
+
var view = new Uint8Array(buf);
|
|
14482
|
+
var chars = new Array(view.length);
|
|
14483
|
+
|
|
14484
|
+
for (var i = 0; i < view.length; i++) {
|
|
14485
|
+
chars[i] = String.fromCharCode(view[i]);
|
|
14486
|
+
}
|
|
14487
|
+
return chars.join('')
|
|
14488
|
+
}
|
|
14489
|
+
|
|
14490
|
+
function bufferClone(buf) {
|
|
14491
|
+
if (buf.slice) {
|
|
14492
|
+
return buf.slice(0)
|
|
14493
|
+
} else {
|
|
14494
|
+
var view = new Uint8Array(buf.byteLength);
|
|
14495
|
+
view.set(new Uint8Array(buf));
|
|
14496
|
+
return view.buffer
|
|
14497
|
+
}
|
|
14498
|
+
}
|
|
14499
|
+
|
|
14500
|
+
function Body() {
|
|
14501
|
+
this.bodyUsed = false;
|
|
14502
|
+
|
|
14503
|
+
this._initBody = function(body) {
|
|
14504
|
+
this._bodyInit = body;
|
|
14505
|
+
if (!body) {
|
|
14506
|
+
this._bodyText = '';
|
|
14507
|
+
} else if (typeof body === 'string') {
|
|
14508
|
+
this._bodyText = body;
|
|
14509
|
+
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
|
14510
|
+
this._bodyBlob = body;
|
|
14511
|
+
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
|
14512
|
+
this._bodyFormData = body;
|
|
14513
|
+
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
14514
|
+
this._bodyText = body.toString();
|
|
14515
|
+
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
|
14516
|
+
this._bodyArrayBuffer = bufferClone(body.buffer);
|
|
14517
|
+
// IE 10-11 can't handle a DataView body.
|
|
14518
|
+
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
|
14519
|
+
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
|
14520
|
+
this._bodyArrayBuffer = bufferClone(body);
|
|
14521
|
+
} else {
|
|
14522
|
+
this._bodyText = body = Object.prototype.toString.call(body);
|
|
14523
|
+
}
|
|
14524
|
+
|
|
14525
|
+
if (!this.headers.get('content-type')) {
|
|
14526
|
+
if (typeof body === 'string') {
|
|
14527
|
+
this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
|
14528
|
+
} else if (this._bodyBlob && this._bodyBlob.type) {
|
|
14529
|
+
this.headers.set('content-type', this._bodyBlob.type);
|
|
14530
|
+
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
14531
|
+
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
|
14532
|
+
}
|
|
14533
|
+
}
|
|
14534
|
+
};
|
|
14535
|
+
|
|
14536
|
+
if (support.blob) {
|
|
14537
|
+
this.blob = function() {
|
|
14538
|
+
var rejected = consumed(this);
|
|
14539
|
+
if (rejected) {
|
|
14540
|
+
return rejected
|
|
14541
|
+
}
|
|
14542
|
+
|
|
14543
|
+
if (this._bodyBlob) {
|
|
14544
|
+
return Promise.resolve(this._bodyBlob)
|
|
14545
|
+
} else if (this._bodyArrayBuffer) {
|
|
14546
|
+
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
|
14547
|
+
} else if (this._bodyFormData) {
|
|
14548
|
+
throw new Error('could not read FormData body as blob')
|
|
14549
|
+
} else {
|
|
14550
|
+
return Promise.resolve(new Blob([this._bodyText]))
|
|
14551
|
+
}
|
|
14552
|
+
};
|
|
14553
|
+
|
|
14554
|
+
this.arrayBuffer = function() {
|
|
14555
|
+
if (this._bodyArrayBuffer) {
|
|
14556
|
+
return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
|
|
14557
|
+
} else {
|
|
14558
|
+
return this.blob().then(readBlobAsArrayBuffer)
|
|
14559
|
+
}
|
|
14560
|
+
};
|
|
14561
|
+
}
|
|
14562
|
+
|
|
14563
|
+
this.text = function() {
|
|
14564
|
+
var rejected = consumed(this);
|
|
14565
|
+
if (rejected) {
|
|
14566
|
+
return rejected
|
|
14567
|
+
}
|
|
14568
|
+
|
|
14569
|
+
if (this._bodyBlob) {
|
|
14570
|
+
return readBlobAsText(this._bodyBlob)
|
|
14571
|
+
} else if (this._bodyArrayBuffer) {
|
|
14572
|
+
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
|
14573
|
+
} else if (this._bodyFormData) {
|
|
14574
|
+
throw new Error('could not read FormData body as text')
|
|
14575
|
+
} else {
|
|
14576
|
+
return Promise.resolve(this._bodyText)
|
|
14577
|
+
}
|
|
14578
|
+
};
|
|
14579
|
+
|
|
14580
|
+
if (support.formData) {
|
|
14581
|
+
this.formData = function() {
|
|
14582
|
+
return this.text().then(decode)
|
|
14583
|
+
};
|
|
14584
|
+
}
|
|
14585
|
+
|
|
14586
|
+
this.json = function() {
|
|
14587
|
+
return this.text().then(JSON.parse)
|
|
14588
|
+
};
|
|
14589
|
+
|
|
14590
|
+
return this
|
|
14591
|
+
}
|
|
14592
|
+
|
|
14593
|
+
// HTTP methods whose capitalization should be normalized
|
|
14594
|
+
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
|
14595
|
+
|
|
14596
|
+
function normalizeMethod(method) {
|
|
14597
|
+
var upcased = method.toUpperCase();
|
|
14598
|
+
return methods.indexOf(upcased) > -1 ? upcased : method
|
|
14599
|
+
}
|
|
14600
|
+
|
|
14601
|
+
function Request(input, options) {
|
|
14602
|
+
options = options || {};
|
|
14603
|
+
var body = options.body;
|
|
14604
|
+
|
|
14605
|
+
if (input instanceof Request) {
|
|
14606
|
+
if (input.bodyUsed) {
|
|
14607
|
+
throw new TypeError('Already read')
|
|
14608
|
+
}
|
|
14609
|
+
this.url = input.url;
|
|
14610
|
+
this.credentials = input.credentials;
|
|
14611
|
+
if (!options.headers) {
|
|
14612
|
+
this.headers = new Headers(input.headers);
|
|
14613
|
+
}
|
|
14614
|
+
this.method = input.method;
|
|
14615
|
+
this.mode = input.mode;
|
|
14616
|
+
this.signal = input.signal;
|
|
14617
|
+
if (!body && input._bodyInit != null) {
|
|
14618
|
+
body = input._bodyInit;
|
|
14619
|
+
input.bodyUsed = true;
|
|
14620
|
+
}
|
|
14621
|
+
} else {
|
|
14622
|
+
this.url = String(input);
|
|
14623
|
+
}
|
|
14624
|
+
|
|
14625
|
+
this.credentials = options.credentials || this.credentials || 'same-origin';
|
|
14626
|
+
if (options.headers || !this.headers) {
|
|
14627
|
+
this.headers = new Headers(options.headers);
|
|
14628
|
+
}
|
|
14629
|
+
this.method = normalizeMethod(options.method || this.method || 'GET');
|
|
14630
|
+
this.mode = options.mode || this.mode || null;
|
|
14631
|
+
this.signal = options.signal || this.signal;
|
|
14632
|
+
this.referrer = null;
|
|
14633
|
+
|
|
14634
|
+
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
|
14635
|
+
throw new TypeError('Body not allowed for GET or HEAD requests')
|
|
14636
|
+
}
|
|
14637
|
+
this._initBody(body);
|
|
14638
|
+
}
|
|
14639
|
+
|
|
14640
|
+
Request.prototype.clone = function() {
|
|
14641
|
+
return new Request(this, {body: this._bodyInit})
|
|
14642
|
+
};
|
|
14643
|
+
|
|
14644
|
+
function decode(body) {
|
|
14645
|
+
var form = new FormData();
|
|
14646
|
+
body
|
|
14647
|
+
.trim()
|
|
14648
|
+
.split('&')
|
|
14649
|
+
.forEach(function(bytes) {
|
|
14650
|
+
if (bytes) {
|
|
14651
|
+
var split = bytes.split('=');
|
|
14652
|
+
var name = split.shift().replace(/\+/g, ' ');
|
|
14653
|
+
var value = split.join('=').replace(/\+/g, ' ');
|
|
14654
|
+
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
14655
|
+
}
|
|
14656
|
+
});
|
|
14657
|
+
return form
|
|
14658
|
+
}
|
|
14659
|
+
|
|
14660
|
+
function parseHeaders(rawHeaders) {
|
|
14661
|
+
var headers = new Headers();
|
|
14662
|
+
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
|
14663
|
+
// https://tools.ietf.org/html/rfc7230#section-3.2
|
|
14664
|
+
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
|
14665
|
+
preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
|
|
14666
|
+
var parts = line.split(':');
|
|
14667
|
+
var key = parts.shift().trim();
|
|
14668
|
+
if (key) {
|
|
14669
|
+
var value = parts.join(':').trim();
|
|
14670
|
+
headers.append(key, value);
|
|
14671
|
+
}
|
|
14672
|
+
});
|
|
14673
|
+
return headers
|
|
14674
|
+
}
|
|
14675
|
+
|
|
14676
|
+
Body.call(Request.prototype);
|
|
14677
|
+
|
|
14678
|
+
function Response(bodyInit, options) {
|
|
14679
|
+
if (!options) {
|
|
14680
|
+
options = {};
|
|
14681
|
+
}
|
|
14682
|
+
|
|
14683
|
+
this.type = 'default';
|
|
14684
|
+
this.status = options.status === undefined ? 200 : options.status;
|
|
14685
|
+
this.ok = this.status >= 200 && this.status < 300;
|
|
14686
|
+
this.statusText = 'statusText' in options ? options.statusText : 'OK';
|
|
14687
|
+
this.headers = new Headers(options.headers);
|
|
14688
|
+
this.url = options.url || '';
|
|
14689
|
+
this._initBody(bodyInit);
|
|
14690
|
+
}
|
|
14691
|
+
|
|
14692
|
+
Body.call(Response.prototype);
|
|
14693
|
+
|
|
14694
|
+
Response.prototype.clone = function() {
|
|
14695
|
+
return new Response(this._bodyInit, {
|
|
14696
|
+
status: this.status,
|
|
14697
|
+
statusText: this.statusText,
|
|
14698
|
+
headers: new Headers(this.headers),
|
|
14699
|
+
url: this.url
|
|
14700
|
+
})
|
|
14701
|
+
};
|
|
14702
|
+
|
|
14703
|
+
Response.error = function() {
|
|
14704
|
+
var response = new Response(null, {status: 0, statusText: ''});
|
|
14705
|
+
response.type = 'error';
|
|
14706
|
+
return response
|
|
14707
|
+
};
|
|
14296
14708
|
|
|
14297
|
-
|
|
14298
|
-
|
|
14299
|
-
|
|
14300
|
-
|
|
14709
|
+
var redirectStatuses = [301, 302, 303, 307, 308];
|
|
14710
|
+
|
|
14711
|
+
Response.redirect = function(url, status) {
|
|
14712
|
+
if (redirectStatuses.indexOf(status) === -1) {
|
|
14713
|
+
throw new RangeError('Invalid status code')
|
|
14714
|
+
}
|
|
14715
|
+
|
|
14716
|
+
return new Response(null, {status: status, headers: {location: url}})
|
|
14717
|
+
};
|
|
14718
|
+
|
|
14719
|
+
exports.DOMException = self.DOMException;
|
|
14720
|
+
try {
|
|
14721
|
+
new exports.DOMException();
|
|
14722
|
+
} catch (err) {
|
|
14723
|
+
exports.DOMException = function(message, name) {
|
|
14724
|
+
this.message = message;
|
|
14725
|
+
this.name = name;
|
|
14726
|
+
var error = Error(message);
|
|
14727
|
+
this.stack = error.stack;
|
|
14728
|
+
};
|
|
14729
|
+
exports.DOMException.prototype = Object.create(Error.prototype);
|
|
14730
|
+
exports.DOMException.prototype.constructor = exports.DOMException;
|
|
14731
|
+
}
|
|
14732
|
+
|
|
14733
|
+
function fetch(input, init) {
|
|
14734
|
+
return new Promise(function(resolve, reject) {
|
|
14735
|
+
var request = new Request(input, init);
|
|
14736
|
+
|
|
14737
|
+
if (request.signal && request.signal.aborted) {
|
|
14738
|
+
return reject(new exports.DOMException('Aborted', 'AbortError'))
|
|
14739
|
+
}
|
|
14740
|
+
|
|
14741
|
+
var xhr = new XMLHttpRequest();
|
|
14742
|
+
|
|
14743
|
+
function abortXhr() {
|
|
14744
|
+
xhr.abort();
|
|
14745
|
+
}
|
|
14746
|
+
|
|
14747
|
+
xhr.onload = function() {
|
|
14748
|
+
var options = {
|
|
14749
|
+
status: xhr.status,
|
|
14750
|
+
statusText: xhr.statusText,
|
|
14751
|
+
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
|
14752
|
+
};
|
|
14753
|
+
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
|
14754
|
+
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
|
14755
|
+
resolve(new Response(body, options));
|
|
14756
|
+
};
|
|
14757
|
+
|
|
14758
|
+
xhr.onerror = function() {
|
|
14759
|
+
reject(new TypeError('Network request failed'));
|
|
14760
|
+
};
|
|
14761
|
+
|
|
14762
|
+
xhr.ontimeout = function() {
|
|
14763
|
+
reject(new TypeError('Network request failed'));
|
|
14764
|
+
};
|
|
14765
|
+
|
|
14766
|
+
xhr.onabort = function() {
|
|
14767
|
+
reject(new exports.DOMException('Aborted', 'AbortError'));
|
|
14768
|
+
};
|
|
14769
|
+
|
|
14770
|
+
xhr.open(request.method, request.url, true);
|
|
14771
|
+
|
|
14772
|
+
if (request.credentials === 'include') {
|
|
14773
|
+
xhr.withCredentials = true;
|
|
14774
|
+
} else if (request.credentials === 'omit') {
|
|
14775
|
+
xhr.withCredentials = false;
|
|
14776
|
+
}
|
|
14777
|
+
|
|
14778
|
+
if ('responseType' in xhr && support.blob) {
|
|
14779
|
+
xhr.responseType = 'blob';
|
|
14780
|
+
}
|
|
14781
|
+
|
|
14782
|
+
request.headers.forEach(function(value, name) {
|
|
14783
|
+
xhr.setRequestHeader(name, value);
|
|
14784
|
+
});
|
|
14785
|
+
|
|
14786
|
+
if (request.signal) {
|
|
14787
|
+
request.signal.addEventListener('abort', abortXhr);
|
|
14788
|
+
|
|
14789
|
+
xhr.onreadystatechange = function() {
|
|
14790
|
+
// DONE (success or failure)
|
|
14791
|
+
if (xhr.readyState === 4) {
|
|
14792
|
+
request.signal.removeEventListener('abort', abortXhr);
|
|
14793
|
+
}
|
|
14794
|
+
};
|
|
14795
|
+
}
|
|
14796
|
+
|
|
14797
|
+
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
|
14798
|
+
})
|
|
14799
|
+
}
|
|
14800
|
+
|
|
14801
|
+
fetch.polyfill = true;
|
|
14802
|
+
|
|
14803
|
+
if (!self.fetch) {
|
|
14804
|
+
self.fetch = fetch;
|
|
14805
|
+
self.Headers = Headers;
|
|
14806
|
+
self.Request = Request;
|
|
14807
|
+
self.Response = Response;
|
|
14808
|
+
}
|
|
14809
|
+
|
|
14810
|
+
exports.Headers = Headers;
|
|
14811
|
+
exports.Request = Request;
|
|
14812
|
+
exports.Response = Response;
|
|
14813
|
+
exports.fetch = fetch;
|
|
14814
|
+
|
|
14815
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14816
|
+
|
|
14817
|
+
return exports;
|
|
14301
14818
|
|
|
14302
|
-
|
|
14819
|
+
})({}));
|
|
14820
|
+
})(__self__);
|
|
14821
|
+
__self__.fetch.ponyfill = true;
|
|
14822
|
+
// Remove "polyfill" property added by whatwg-fetch
|
|
14823
|
+
delete __self__.fetch.polyfill;
|
|
14824
|
+
// Choose between native implementation (global) or custom implementation (__self__)
|
|
14825
|
+
// var ctx = global.fetch ? global : __self__;
|
|
14826
|
+
var ctx = __self__; // this line disable service worker support temporarily
|
|
14827
|
+
exports = ctx.fetch; // To enable: import fetch from 'cross-fetch'
|
|
14828
|
+
exports.default = ctx.fetch; // For TypeScript consumers without esModuleInterop.
|
|
14829
|
+
exports.fetch = ctx.fetch; // To enable: import {fetch} from 'cross-fetch'
|
|
14830
|
+
exports.Headers = ctx.Headers;
|
|
14831
|
+
exports.Request = ctx.Request;
|
|
14832
|
+
exports.Response = ctx.Response;
|
|
14833
|
+
module.exports = exports;
|
|
14834
|
+
}(browserPonyfill, browserPonyfill.exports));
|
|
14835
|
+
|
|
14836
|
+
var fetch = /*@__PURE__*/getDefaultExportFromCjs(browserPonyfill.exports);
|
|
14303
14837
|
|
|
14304
14838
|
/**
|
|
14305
14839
|
* A `StructFailure` represents a single specific failure in validation.
|