@micromerce/media-fileuploader 1.0.2026 → 1.0.2044
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/dist/cjs/index.js +444 -2424
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/FileUploader.stories.d.ts +1 -8
- package/dist/esm/index.js +444 -2424
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/FileUploader.stories.d.ts +1 -8
- package/package.json +12 -16
package/dist/cjs/index.js
CHANGED
|
@@ -13,10 +13,8 @@ function _typeof$9(o) {
|
|
|
13
13
|
}, _typeof$9(o);
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
function _classCallCheck$9(
|
|
17
|
-
if (!(
|
|
18
|
-
throw new TypeError("Cannot call a class as a function");
|
|
19
|
-
}
|
|
16
|
+
function _classCallCheck$9(a, n) {
|
|
17
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
function toPrimitive(t, r) {
|
|
@@ -35,116 +33,91 @@ function toPropertyKey(t) {
|
|
|
35
33
|
return "symbol" == _typeof$9(i) ? i : i + "";
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
function _defineProperties$8(
|
|
39
|
-
for (var
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
descriptor.configurable = true;
|
|
43
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
44
|
-
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
36
|
+
function _defineProperties$8(e, r) {
|
|
37
|
+
for (var t = 0; t < r.length; t++) {
|
|
38
|
+
var o = r[t];
|
|
39
|
+
o.enumerable = o.enumerable || false, o.configurable = true, "value" in o && (o.writable = true), Object.defineProperty(e, toPropertyKey(o.key), o);
|
|
45
40
|
}
|
|
46
41
|
}
|
|
47
|
-
function _createClass$9(
|
|
48
|
-
|
|
49
|
-
if (staticProps) _defineProperties$8(Constructor, staticProps);
|
|
50
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
42
|
+
function _createClass$9(e, r, t) {
|
|
43
|
+
return r && _defineProperties$8(e.prototype, r), t && _defineProperties$8(e, t), Object.defineProperty(e, "prototype", {
|
|
51
44
|
writable: false
|
|
52
|
-
});
|
|
53
|
-
return Constructor;
|
|
45
|
+
}), e;
|
|
54
46
|
}
|
|
55
47
|
|
|
56
|
-
function _assertThisInitialized$2(
|
|
57
|
-
if (
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
return self;
|
|
48
|
+
function _assertThisInitialized$2(e) {
|
|
49
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
50
|
+
return e;
|
|
61
51
|
}
|
|
62
52
|
|
|
63
|
-
function _setPrototypeOf$2(
|
|
64
|
-
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
};
|
|
68
|
-
return _setPrototypeOf$2(o, p);
|
|
53
|
+
function _setPrototypeOf$2(t, e) {
|
|
54
|
+
return _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
55
|
+
return t.__proto__ = e, t;
|
|
56
|
+
}, _setPrototypeOf$2(t, e);
|
|
69
57
|
}
|
|
70
58
|
|
|
71
|
-
function _inherits$2(
|
|
72
|
-
if (typeof
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
59
|
+
function _inherits$2(t, e) {
|
|
60
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
61
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
76
62
|
constructor: {
|
|
77
|
-
value:
|
|
63
|
+
value: t,
|
|
78
64
|
writable: true,
|
|
79
65
|
configurable: true
|
|
80
66
|
}
|
|
81
|
-
})
|
|
82
|
-
Object.defineProperty(subClass, "prototype", {
|
|
67
|
+
}), Object.defineProperty(t, "prototype", {
|
|
83
68
|
writable: false
|
|
84
|
-
});
|
|
85
|
-
if (superClass) _setPrototypeOf$2(subClass, superClass);
|
|
69
|
+
}), e && _setPrototypeOf$2(t, e);
|
|
86
70
|
}
|
|
87
71
|
|
|
88
|
-
function _possibleConstructorReturn$2(
|
|
89
|
-
if (
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
93
|
-
}
|
|
94
|
-
return _assertThisInitialized$2(self);
|
|
72
|
+
function _possibleConstructorReturn$2(t, e) {
|
|
73
|
+
if (e && ("object" == _typeof$9(e) || "function" == typeof e)) return e;
|
|
74
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
75
|
+
return _assertThisInitialized$2(t);
|
|
95
76
|
}
|
|
96
77
|
|
|
97
|
-
function _getPrototypeOf$2(
|
|
98
|
-
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function
|
|
99
|
-
return
|
|
100
|
-
};
|
|
101
|
-
return _getPrototypeOf$2(o);
|
|
78
|
+
function _getPrototypeOf$2(t) {
|
|
79
|
+
return _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
80
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
81
|
+
}, _getPrototypeOf$2(t);
|
|
102
82
|
}
|
|
103
83
|
|
|
104
|
-
function _defineProperty$2(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
writable: true
|
|
112
|
-
});
|
|
113
|
-
} else {
|
|
114
|
-
obj[key] = value;
|
|
115
|
-
}
|
|
116
|
-
return obj;
|
|
84
|
+
function _defineProperty$2(e, r, t) {
|
|
85
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
86
|
+
value: t,
|
|
87
|
+
enumerable: true,
|
|
88
|
+
configurable: true,
|
|
89
|
+
writable: true
|
|
90
|
+
}) : e[r] = t, e;
|
|
117
91
|
}
|
|
118
92
|
|
|
119
|
-
function _arrayWithHoles$1(
|
|
120
|
-
if (Array.isArray(
|
|
93
|
+
function _arrayWithHoles$1(r) {
|
|
94
|
+
if (Array.isArray(r)) return r;
|
|
121
95
|
}
|
|
122
96
|
|
|
123
|
-
function _iterableToArray(
|
|
124
|
-
if (typeof Symbol
|
|
97
|
+
function _iterableToArray(r) {
|
|
98
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
125
99
|
}
|
|
126
100
|
|
|
127
|
-
function _arrayLikeToArray$1(
|
|
128
|
-
|
|
129
|
-
for (var
|
|
130
|
-
return
|
|
101
|
+
function _arrayLikeToArray$1(r, a) {
|
|
102
|
+
(null == a || a > r.length) && (a = r.length);
|
|
103
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
104
|
+
return n;
|
|
131
105
|
}
|
|
132
106
|
|
|
133
|
-
function _unsupportedIterableToArray$1(
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
107
|
+
function _unsupportedIterableToArray$1(r, a) {
|
|
108
|
+
if (r) {
|
|
109
|
+
if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
|
|
110
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
111
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
|
|
112
|
+
}
|
|
140
113
|
}
|
|
141
114
|
|
|
142
115
|
function _nonIterableRest$1() {
|
|
143
116
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
144
117
|
}
|
|
145
118
|
|
|
146
|
-
function _toArray(
|
|
147
|
-
return _arrayWithHoles$1(
|
|
119
|
+
function _toArray(r) {
|
|
120
|
+
return _arrayWithHoles$1(r) || _iterableToArray(r) || _unsupportedIterableToArray$1(r) || _nonIterableRest$1();
|
|
148
121
|
}
|
|
149
122
|
|
|
150
123
|
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -2883,8 +2856,8 @@ function _iterableToArrayLimit$1(r, l) {
|
|
|
2883
2856
|
}
|
|
2884
2857
|
}
|
|
2885
2858
|
|
|
2886
|
-
function _slicedToArray$1(
|
|
2887
|
-
return _arrayWithHoles$1(
|
|
2859
|
+
function _slicedToArray$1(r, e) {
|
|
2860
|
+
return _arrayWithHoles$1(r) || _iterableToArrayLimit$1(r, e) || _unsupportedIterableToArray$1(r, e) || _nonIterableRest$1();
|
|
2888
2861
|
}
|
|
2889
2862
|
|
|
2890
2863
|
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -4480,7 +4453,7 @@ function encodeFilename(name) {
|
|
|
4480
4453
|
* Takes a file object and turns it into fileID, by converting file.name to lowercase,
|
|
4481
4454
|
* removing extra characters and adding type, size and lastModified
|
|
4482
4455
|
*/
|
|
4483
|
-
function generateFileID(file) {
|
|
4456
|
+
function generateFileID(file, instanceId) {
|
|
4484
4457
|
// It's tempting to do `[items].filter(Boolean).join('-')` here, but that
|
|
4485
4458
|
// is slower! simple string concatenation is fast
|
|
4486
4459
|
|
|
@@ -4511,7 +4484,7 @@ function hasFileStableId(file) {
|
|
|
4511
4484
|
const stableIdProviders = new Set(['box', 'dropbox', 'drive', 'facebook', 'unsplash']);
|
|
4512
4485
|
return stableIdProviders.has(file.remote.provider);
|
|
4513
4486
|
}
|
|
4514
|
-
function getSafeFileId(file) {
|
|
4487
|
+
function getSafeFileId(file, instanceId) {
|
|
4515
4488
|
if (hasFileStableId(file)) return file.id;
|
|
4516
4489
|
const fileType = getFileType(file);
|
|
4517
4490
|
return generateFileID({
|
|
@@ -4621,25 +4594,23 @@ const debugLogger = {
|
|
|
4621
4594
|
}
|
|
4622
4595
|
};
|
|
4623
4596
|
|
|
4624
|
-
var prettierBytes = function prettierBytes(
|
|
4625
|
-
if (typeof
|
|
4626
|
-
throw new TypeError(`Expected a number, got ${typeof
|
|
4597
|
+
var prettierBytes = function prettierBytes(input) {
|
|
4598
|
+
if (typeof input !== 'number' || Number.isNaN(input)) {
|
|
4599
|
+
throw new TypeError(`Expected a number, got ${typeof input}`);
|
|
4627
4600
|
}
|
|
4628
|
-
const neg =
|
|
4629
|
-
|
|
4601
|
+
const neg = input < 0;
|
|
4602
|
+
let num = Math.abs(input);
|
|
4630
4603
|
if (neg) {
|
|
4631
4604
|
num = -num;
|
|
4632
4605
|
}
|
|
4633
|
-
if (num
|
|
4634
|
-
return
|
|
4606
|
+
if (num === 0) {
|
|
4607
|
+
return '0 B';
|
|
4635
4608
|
}
|
|
4609
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
4636
4610
|
const exponent = Math.min(Math.floor(Math.log(num) / Math.log(1024)), units.length - 1);
|
|
4637
|
-
|
|
4611
|
+
const value = Number(num / 1024 ** exponent);
|
|
4638
4612
|
const unit = units[exponent];
|
|
4639
|
-
|
|
4640
|
-
return `${(neg ? '-' : '') + num.toFixed(0)} ${unit}`;
|
|
4641
|
-
}
|
|
4642
|
-
return `${(neg ? '-' : '') + num.toFixed(1)} ${unit}`;
|
|
4613
|
+
return `${value >= 10 || value % 1 === 0 ? Math.round(value) : value.toFixed(1)} ${unit}`;
|
|
4643
4614
|
};
|
|
4644
4615
|
|
|
4645
4616
|
|
|
@@ -6983,2136 +6954,150 @@ class UIPlugin extends BasePlugin {
|
|
|
6983
6954
|
onUnmount() {}
|
|
6984
6955
|
}
|
|
6985
6956
|
|
|
6986
|
-
var global$1 = (typeof global !== "undefined" ? global :
|
|
6987
|
-
typeof self !== "undefined" ? self :
|
|
6988
|
-
typeof window !== "undefined" ? window : {});
|
|
6989
|
-
|
|
6990
|
-
var lookup = [];
|
|
6991
|
-
var revLookup = [];
|
|
6992
|
-
var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
|
|
6993
|
-
var inited = false;
|
|
6994
|
-
function init () {
|
|
6995
|
-
inited = true;
|
|
6996
|
-
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
|
6997
|
-
for (var i = 0, len = code.length; i < len; ++i) {
|
|
6998
|
-
lookup[i] = code[i];
|
|
6999
|
-
revLookup[code.charCodeAt(i)] = i;
|
|
7000
|
-
}
|
|
7001
|
-
|
|
7002
|
-
revLookup['-'.charCodeAt(0)] = 62;
|
|
7003
|
-
revLookup['_'.charCodeAt(0)] = 63;
|
|
7004
|
-
}
|
|
7005
|
-
|
|
7006
|
-
function toByteArray (b64) {
|
|
7007
|
-
if (!inited) {
|
|
7008
|
-
init();
|
|
7009
|
-
}
|
|
7010
|
-
var i, j, l, tmp, placeHolders, arr;
|
|
7011
|
-
var len = b64.length;
|
|
7012
|
-
|
|
7013
|
-
if (len % 4 > 0) {
|
|
7014
|
-
throw new Error('Invalid string. Length must be a multiple of 4')
|
|
7015
|
-
}
|
|
7016
|
-
|
|
7017
|
-
// the number of equal signs (place holders)
|
|
7018
|
-
// if there are two placeholders, than the two characters before it
|
|
7019
|
-
// represent one byte
|
|
7020
|
-
// if there is only one, then the three characters before it represent 2 bytes
|
|
7021
|
-
// this is just a cheap hack to not do indexOf twice
|
|
7022
|
-
placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
|
|
7023
|
-
|
|
7024
|
-
// base64 is 4/3 + up to two characters of the original data
|
|
7025
|
-
arr = new Arr(len * 3 / 4 - placeHolders);
|
|
7026
|
-
|
|
7027
|
-
// if there are placeholders, only get up to the last complete 4 chars
|
|
7028
|
-
l = placeHolders > 0 ? len - 4 : len;
|
|
7029
|
-
|
|
7030
|
-
var L = 0;
|
|
7031
|
-
|
|
7032
|
-
for (i = 0, j = 0; i < l; i += 4, j += 3) {
|
|
7033
|
-
tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)];
|
|
7034
|
-
arr[L++] = (tmp >> 16) & 0xFF;
|
|
7035
|
-
arr[L++] = (tmp >> 8) & 0xFF;
|
|
7036
|
-
arr[L++] = tmp & 0xFF;
|
|
7037
|
-
}
|
|
7038
|
-
|
|
7039
|
-
if (placeHolders === 2) {
|
|
7040
|
-
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4);
|
|
7041
|
-
arr[L++] = tmp & 0xFF;
|
|
7042
|
-
} else if (placeHolders === 1) {
|
|
7043
|
-
tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2);
|
|
7044
|
-
arr[L++] = (tmp >> 8) & 0xFF;
|
|
7045
|
-
arr[L++] = tmp & 0xFF;
|
|
7046
|
-
}
|
|
7047
|
-
|
|
7048
|
-
return arr
|
|
7049
|
-
}
|
|
7050
|
-
|
|
7051
|
-
function tripletToBase64 (num) {
|
|
7052
|
-
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
|
|
7053
|
-
}
|
|
7054
|
-
|
|
7055
|
-
function encodeChunk (uint8, start, end) {
|
|
7056
|
-
var tmp;
|
|
7057
|
-
var output = [];
|
|
7058
|
-
for (var i = start; i < end; i += 3) {
|
|
7059
|
-
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
|
|
7060
|
-
output.push(tripletToBase64(tmp));
|
|
7061
|
-
}
|
|
7062
|
-
return output.join('')
|
|
7063
|
-
}
|
|
7064
|
-
|
|
7065
|
-
function fromByteArray (uint8) {
|
|
7066
|
-
if (!inited) {
|
|
7067
|
-
init();
|
|
7068
|
-
}
|
|
7069
|
-
var tmp;
|
|
7070
|
-
var len = uint8.length;
|
|
7071
|
-
var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
|
|
7072
|
-
var output = '';
|
|
7073
|
-
var parts = [];
|
|
7074
|
-
var maxChunkLength = 16383; // must be multiple of 3
|
|
7075
|
-
|
|
7076
|
-
// go through the array every three bytes, we'll deal with trailing stuff later
|
|
7077
|
-
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
|
7078
|
-
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)));
|
|
7079
|
-
}
|
|
7080
|
-
|
|
7081
|
-
// pad the end with zeros, but make sure to not forget the extra bytes
|
|
7082
|
-
if (extraBytes === 1) {
|
|
7083
|
-
tmp = uint8[len - 1];
|
|
7084
|
-
output += lookup[tmp >> 2];
|
|
7085
|
-
output += lookup[(tmp << 4) & 0x3F];
|
|
7086
|
-
output += '==';
|
|
7087
|
-
} else if (extraBytes === 2) {
|
|
7088
|
-
tmp = (uint8[len - 2] << 8) + (uint8[len - 1]);
|
|
7089
|
-
output += lookup[tmp >> 10];
|
|
7090
|
-
output += lookup[(tmp >> 4) & 0x3F];
|
|
7091
|
-
output += lookup[(tmp << 2) & 0x3F];
|
|
7092
|
-
output += '=';
|
|
7093
|
-
}
|
|
7094
|
-
|
|
7095
|
-
parts.push(output);
|
|
7096
|
-
|
|
7097
|
-
return parts.join('')
|
|
7098
|
-
}
|
|
7099
|
-
|
|
7100
|
-
function read (buffer, offset, isLE, mLen, nBytes) {
|
|
7101
|
-
var e, m;
|
|
7102
|
-
var eLen = nBytes * 8 - mLen - 1;
|
|
7103
|
-
var eMax = (1 << eLen) - 1;
|
|
7104
|
-
var eBias = eMax >> 1;
|
|
7105
|
-
var nBits = -7;
|
|
7106
|
-
var i = isLE ? (nBytes - 1) : 0;
|
|
7107
|
-
var d = isLE ? -1 : 1;
|
|
7108
|
-
var s = buffer[offset + i];
|
|
7109
|
-
|
|
7110
|
-
i += d;
|
|
7111
|
-
|
|
7112
|
-
e = s & ((1 << (-nBits)) - 1);
|
|
7113
|
-
s >>= (-nBits);
|
|
7114
|
-
nBits += eLen;
|
|
7115
|
-
for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
|
7116
|
-
|
|
7117
|
-
m = e & ((1 << (-nBits)) - 1);
|
|
7118
|
-
e >>= (-nBits);
|
|
7119
|
-
nBits += mLen;
|
|
7120
|
-
for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
|
|
7121
|
-
|
|
7122
|
-
if (e === 0) {
|
|
7123
|
-
e = 1 - eBias;
|
|
7124
|
-
} else if (e === eMax) {
|
|
7125
|
-
return m ? NaN : ((s ? -1 : 1) * Infinity)
|
|
7126
|
-
} else {
|
|
7127
|
-
m = m + Math.pow(2, mLen);
|
|
7128
|
-
e = e - eBias;
|
|
7129
|
-
}
|
|
7130
|
-
return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
|
|
7131
|
-
}
|
|
7132
|
-
|
|
7133
|
-
function write (buffer, value, offset, isLE, mLen, nBytes) {
|
|
7134
|
-
var e, m, c;
|
|
7135
|
-
var eLen = nBytes * 8 - mLen - 1;
|
|
7136
|
-
var eMax = (1 << eLen) - 1;
|
|
7137
|
-
var eBias = eMax >> 1;
|
|
7138
|
-
var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0);
|
|
7139
|
-
var i = isLE ? 0 : (nBytes - 1);
|
|
7140
|
-
var d = isLE ? 1 : -1;
|
|
7141
|
-
var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
|
|
7142
|
-
|
|
7143
|
-
value = Math.abs(value);
|
|
7144
|
-
|
|
7145
|
-
if (isNaN(value) || value === Infinity) {
|
|
7146
|
-
m = isNaN(value) ? 1 : 0;
|
|
7147
|
-
e = eMax;
|
|
7148
|
-
} else {
|
|
7149
|
-
e = Math.floor(Math.log(value) / Math.LN2);
|
|
7150
|
-
if (value * (c = Math.pow(2, -e)) < 1) {
|
|
7151
|
-
e--;
|
|
7152
|
-
c *= 2;
|
|
7153
|
-
}
|
|
7154
|
-
if (e + eBias >= 1) {
|
|
7155
|
-
value += rt / c;
|
|
7156
|
-
} else {
|
|
7157
|
-
value += rt * Math.pow(2, 1 - eBias);
|
|
7158
|
-
}
|
|
7159
|
-
if (value * c >= 2) {
|
|
7160
|
-
e++;
|
|
7161
|
-
c /= 2;
|
|
7162
|
-
}
|
|
7163
|
-
|
|
7164
|
-
if (e + eBias >= eMax) {
|
|
7165
|
-
m = 0;
|
|
7166
|
-
e = eMax;
|
|
7167
|
-
} else if (e + eBias >= 1) {
|
|
7168
|
-
m = (value * c - 1) * Math.pow(2, mLen);
|
|
7169
|
-
e = e + eBias;
|
|
7170
|
-
} else {
|
|
7171
|
-
m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
|
|
7172
|
-
e = 0;
|
|
7173
|
-
}
|
|
7174
|
-
}
|
|
7175
|
-
|
|
7176
|
-
for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
|
|
7177
|
-
|
|
7178
|
-
e = (e << mLen) | m;
|
|
7179
|
-
eLen += mLen;
|
|
7180
|
-
for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
|
|
7181
|
-
|
|
7182
|
-
buffer[offset + i - d] |= s * 128;
|
|
7183
|
-
}
|
|
7184
|
-
|
|
7185
|
-
var toString$1 = {}.toString;
|
|
7186
|
-
|
|
7187
|
-
var isArray = Array.isArray || function (arr) {
|
|
7188
|
-
return toString$1.call(arr) == '[object Array]';
|
|
7189
|
-
};
|
|
7190
|
-
|
|
7191
|
-
/*!
|
|
7192
|
-
* The buffer module from node.js, for the browser.
|
|
7193
|
-
*
|
|
7194
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
7195
|
-
* @license MIT
|
|
7196
|
-
*/
|
|
7197
|
-
/* eslint-disable no-proto */
|
|
7198
|
-
|
|
7199
|
-
|
|
7200
|
-
var INSPECT_MAX_BYTES = 50;
|
|
7201
|
-
|
|
7202
6957
|
/**
|
|
7203
|
-
*
|
|
7204
|
-
* === true Use Uint8Array implementation (fastest)
|
|
7205
|
-
* === false Use Object implementation (most compatible, even IE6)
|
|
7206
|
-
*
|
|
7207
|
-
* Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
|
|
7208
|
-
* Opera 11.6+, iOS 4.2+.
|
|
7209
|
-
*
|
|
7210
|
-
* Due to various browser bugs, sometimes the Object implementation will be used even
|
|
7211
|
-
* when the browser supports typed arrays.
|
|
7212
|
-
*
|
|
7213
|
-
* Note:
|
|
6958
|
+
* base64.ts
|
|
7214
6959
|
*
|
|
7215
|
-
*
|
|
7216
|
-
*
|
|
6960
|
+
* Licensed under the BSD 3-Clause License.
|
|
6961
|
+
* http://opensource.org/licenses/BSD-3-Clause
|
|
7217
6962
|
*
|
|
7218
|
-
*
|
|
6963
|
+
* References:
|
|
6964
|
+
* http://en.wikipedia.org/wiki/Base64
|
|
7219
6965
|
*
|
|
7220
|
-
*
|
|
7221
|
-
* incorrect length in some situations.
|
|
7222
|
-
|
|
7223
|
-
* We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
|
|
7224
|
-
* get the Object implementation, which is slower but behaves correctly.
|
|
6966
|
+
* @author Dan Kogai (https://github.com/dankogai)
|
|
7225
6967
|
*/
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
/*
|
|
7231
|
-
* Export kMaxLength after typed array support is determined.
|
|
6968
|
+
const version = '3.9.3';
|
|
6969
|
+
/**
|
|
6970
|
+
* @deprecated use lowercase `version`.
|
|
7232
6971
|
*/
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
function
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
}
|
|
7240
|
-
|
|
7241
|
-
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
if (that === null) {
|
|
7252
|
-
that = new Buffer(length);
|
|
7253
|
-
}
|
|
7254
|
-
that.length = length;
|
|
7255
|
-
}
|
|
7256
|
-
|
|
7257
|
-
return that
|
|
7258
|
-
}
|
|
7259
|
-
|
|
6972
|
+
const VERSION = version;
|
|
6973
|
+
const _TD = typeof TextDecoder === 'function' ? new TextDecoder('utf-8', { ignoreBOM: true }) : undefined;
|
|
6974
|
+
const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
6975
|
+
const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
6976
|
+
const b64chs = Array.prototype.slice.call(b64ch);
|
|
6977
|
+
const b64tab = ((a) => {
|
|
6978
|
+
let tab = {};
|
|
6979
|
+
a.forEach((c, i) => tab[c] = i);
|
|
6980
|
+
return tab;
|
|
6981
|
+
})(b64chs);
|
|
6982
|
+
const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
6983
|
+
const _fromCC = String.fromCharCode.bind(String);
|
|
6984
|
+
const _U8Afrom = typeof Uint8Array.from === 'function'
|
|
6985
|
+
? Uint8Array.from.bind(Uint8Array)
|
|
6986
|
+
: (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
|
|
6987
|
+
const _mkUriSafe = (src) => src
|
|
6988
|
+
.replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
|
|
6989
|
+
const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
|
|
7260
6990
|
/**
|
|
7261
|
-
*
|
|
7262
|
-
* prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
|
|
7263
|
-
* `Uint8Array`, so the returned instances will have all the node `Buffer` methods
|
|
7264
|
-
* and the `Uint8Array` methods. Square bracket notation works as expected -- it
|
|
7265
|
-
* returns a single octet.
|
|
7266
|
-
*
|
|
7267
|
-
* The `Uint8Array` prototype remains unmodified.
|
|
6991
|
+
* polyfill version of `btoa`
|
|
7268
6992
|
*/
|
|
7269
|
-
|
|
7270
|
-
|
|
7271
|
-
|
|
7272
|
-
|
|
7273
|
-
|
|
7274
|
-
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
6993
|
+
const btoaPolyfill = (bin) => {
|
|
6994
|
+
// console.log('polyfilled');
|
|
6995
|
+
let u32, c0, c1, c2, asc = '';
|
|
6996
|
+
const pad = bin.length % 3;
|
|
6997
|
+
for (let i = 0; i < bin.length;) {
|
|
6998
|
+
if ((c0 = bin.charCodeAt(i++)) > 255 ||
|
|
6999
|
+
(c1 = bin.charCodeAt(i++)) > 255 ||
|
|
7000
|
+
(c2 = bin.charCodeAt(i++)) > 255)
|
|
7001
|
+
throw new TypeError('invalid character found');
|
|
7002
|
+
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
7003
|
+
asc += b64chs[u32 >> 18 & 63]
|
|
7004
|
+
+ b64chs[u32 >> 12 & 63]
|
|
7005
|
+
+ b64chs[u32 >> 6 & 63]
|
|
7006
|
+
+ b64chs[u32 & 63];
|
|
7281
7007
|
}
|
|
7282
|
-
return
|
|
7283
|
-
}
|
|
7284
|
-
return from(this, arg, encodingOrOffset, length)
|
|
7285
|
-
}
|
|
7286
|
-
|
|
7287
|
-
Buffer.poolSize = 8192; // not used by this implementation
|
|
7288
|
-
|
|
7289
|
-
// TODO: Legacy, not needed anymore. Remove in next major version.
|
|
7290
|
-
Buffer._augment = function (arr) {
|
|
7291
|
-
arr.__proto__ = Buffer.prototype;
|
|
7292
|
-
return arr
|
|
7008
|
+
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
7293
7009
|
};
|
|
7294
|
-
|
|
7295
|
-
function from (that, value, encodingOrOffset, length) {
|
|
7296
|
-
if (typeof value === 'number') {
|
|
7297
|
-
throw new TypeError('"value" argument must not be a number')
|
|
7298
|
-
}
|
|
7299
|
-
|
|
7300
|
-
if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
|
|
7301
|
-
return fromArrayBuffer(that, value, encodingOrOffset, length)
|
|
7302
|
-
}
|
|
7303
|
-
|
|
7304
|
-
if (typeof value === 'string') {
|
|
7305
|
-
return fromString(that, value, encodingOrOffset)
|
|
7306
|
-
}
|
|
7307
|
-
|
|
7308
|
-
return fromObject(that, value)
|
|
7309
|
-
}
|
|
7310
|
-
|
|
7311
7010
|
/**
|
|
7312
|
-
*
|
|
7313
|
-
*
|
|
7314
|
-
*
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
}
|
|
7329
|
-
|
|
7330
|
-
function assertSize (size) {
|
|
7331
|
-
if (typeof size !== 'number') {
|
|
7332
|
-
throw new TypeError('"size" argument must be a number')
|
|
7333
|
-
} else if (size < 0) {
|
|
7334
|
-
throw new RangeError('"size" argument must not be negative')
|
|
7335
|
-
}
|
|
7336
|
-
}
|
|
7337
|
-
|
|
7338
|
-
function alloc (that, size, fill, encoding) {
|
|
7339
|
-
assertSize(size);
|
|
7340
|
-
if (size <= 0) {
|
|
7341
|
-
return createBuffer(that, size)
|
|
7342
|
-
}
|
|
7343
|
-
if (fill !== undefined) {
|
|
7344
|
-
// Only pay attention to encoding if it's a string. This
|
|
7345
|
-
// prevents accidentally sending in a number that would
|
|
7346
|
-
// be interpretted as a start offset.
|
|
7347
|
-
return typeof encoding === 'string'
|
|
7348
|
-
? createBuffer(that, size).fill(fill, encoding)
|
|
7349
|
-
: createBuffer(that, size).fill(fill)
|
|
7350
|
-
}
|
|
7351
|
-
return createBuffer(that, size)
|
|
7352
|
-
}
|
|
7353
|
-
|
|
7011
|
+
* does what `window.btoa` of web browsers do.
|
|
7012
|
+
* @param {String} bin binary string
|
|
7013
|
+
* @returns {string} Base64-encoded string
|
|
7014
|
+
*/
|
|
7015
|
+
const _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)
|
|
7016
|
+
: btoaPolyfill;
|
|
7017
|
+
const _fromUint8Array = typeof Uint8Array.prototype.toBase64 === 'function' ? (u8a) => u8a.toBase64()
|
|
7018
|
+
: (u8a) => {
|
|
7019
|
+
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
|
|
7020
|
+
const maxargs = 0x1000;
|
|
7021
|
+
let strs = [];
|
|
7022
|
+
for (let i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
7023
|
+
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
7024
|
+
}
|
|
7025
|
+
return _btoa(strs.join(''));
|
|
7026
|
+
};
|
|
7354
7027
|
/**
|
|
7355
|
-
*
|
|
7356
|
-
*
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
|
|
7360
|
-
|
|
7361
|
-
|
|
7362
|
-
|
|
7363
|
-
|
|
7364
|
-
|
|
7365
|
-
|
|
7366
|
-
|
|
7367
|
-
|
|
7028
|
+
* converts a Uint8Array to a Base64 string.
|
|
7029
|
+
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
|
|
7030
|
+
* @returns {string} Base64 string
|
|
7031
|
+
*/
|
|
7032
|
+
const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
7033
|
+
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
7034
|
+
// const utob = (src: string) => unescape(encodeURIComponent(src));
|
|
7035
|
+
// reverting good old fationed regexp
|
|
7036
|
+
const cb_utob = (c) => {
|
|
7037
|
+
if (c.length < 2) {
|
|
7038
|
+
var cc = c.charCodeAt(0);
|
|
7039
|
+
return cc < 0x80 ? c
|
|
7040
|
+
: cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
|
|
7041
|
+
+ _fromCC(0x80 | (cc & 0x3f)))
|
|
7042
|
+
: (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
|
|
7043
|
+
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
7044
|
+
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
7045
|
+
}
|
|
7046
|
+
else {
|
|
7047
|
+
var cc = 0x10000
|
|
7048
|
+
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
7049
|
+
+ (c.charCodeAt(1) - 0xDC00);
|
|
7050
|
+
return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
|
|
7051
|
+
+ _fromCC(0x80 | ((cc >>> 12) & 0x3f))
|
|
7052
|
+
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
7053
|
+
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
7368
7054
|
}
|
|
7369
|
-
}
|
|
7370
|
-
return that
|
|
7371
|
-
}
|
|
7372
|
-
|
|
7373
|
-
/**
|
|
7374
|
-
* Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
|
|
7375
|
-
* */
|
|
7376
|
-
Buffer.allocUnsafe = function (size) {
|
|
7377
|
-
return allocUnsafe(null, size)
|
|
7378
7055
|
};
|
|
7056
|
+
const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\x00-\x7F]/g;
|
|
7057
|
+
/**
|
|
7058
|
+
* @deprecated should have been internal use only.
|
|
7059
|
+
* @param {string} src UTF-8 string
|
|
7060
|
+
* @returns {string} UTF-16 string
|
|
7061
|
+
*/
|
|
7062
|
+
const utob = (u) => u.replace(re_utob, cb_utob);
|
|
7063
|
+
//
|
|
7064
|
+
const _encode = _TE
|
|
7065
|
+
? (s) => _fromUint8Array(_TE.encode(s))
|
|
7066
|
+
: (s) => _btoa(utob(s));
|
|
7067
|
+
/**
|
|
7068
|
+
* converts a UTF-8-encoded string to a Base64 string.
|
|
7069
|
+
* @param {boolean} [urlsafe] if `true` make the result URL-safe
|
|
7070
|
+
* @returns {string} Base64 string
|
|
7071
|
+
*/
|
|
7072
|
+
const encode$1 = (src, urlsafe = false) => urlsafe
|
|
7073
|
+
? _mkUriSafe(_encode(src))
|
|
7074
|
+
: _encode(src);
|
|
7379
7075
|
/**
|
|
7380
|
-
*
|
|
7076
|
+
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
|
|
7077
|
+
* @returns {string} Base64 string
|
|
7381
7078
|
*/
|
|
7382
|
-
|
|
7383
|
-
|
|
7384
|
-
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
that = that.slice(0, actual);
|
|
7405
|
-
}
|
|
7406
|
-
|
|
7407
|
-
return that
|
|
7408
|
-
}
|
|
7409
|
-
|
|
7410
|
-
function fromArrayLike (that, array) {
|
|
7411
|
-
var length = array.length < 0 ? 0 : checked(array.length) | 0;
|
|
7412
|
-
that = createBuffer(that, length);
|
|
7413
|
-
for (var i = 0; i < length; i += 1) {
|
|
7414
|
-
that[i] = array[i] & 255;
|
|
7415
|
-
}
|
|
7416
|
-
return that
|
|
7417
|
-
}
|
|
7418
|
-
|
|
7419
|
-
function fromArrayBuffer (that, array, byteOffset, length) {
|
|
7420
|
-
array.byteLength; // this throws if `array` is not a valid ArrayBuffer
|
|
7421
|
-
|
|
7422
|
-
if (byteOffset < 0 || array.byteLength < byteOffset) {
|
|
7423
|
-
throw new RangeError('\'offset\' is out of bounds')
|
|
7424
|
-
}
|
|
7425
|
-
|
|
7426
|
-
if (array.byteLength < byteOffset + (length || 0)) {
|
|
7427
|
-
throw new RangeError('\'length\' is out of bounds')
|
|
7428
|
-
}
|
|
7429
|
-
|
|
7430
|
-
if (byteOffset === undefined && length === undefined) {
|
|
7431
|
-
array = new Uint8Array(array);
|
|
7432
|
-
} else if (length === undefined) {
|
|
7433
|
-
array = new Uint8Array(array, byteOffset);
|
|
7434
|
-
} else {
|
|
7435
|
-
array = new Uint8Array(array, byteOffset, length);
|
|
7436
|
-
}
|
|
7437
|
-
|
|
7438
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
7439
|
-
// Return an augmented `Uint8Array` instance, for best performance
|
|
7440
|
-
that = array;
|
|
7441
|
-
that.__proto__ = Buffer.prototype;
|
|
7442
|
-
} else {
|
|
7443
|
-
// Fallback: Return an object instance of the Buffer class
|
|
7444
|
-
that = fromArrayLike(that, array);
|
|
7445
|
-
}
|
|
7446
|
-
return that
|
|
7447
|
-
}
|
|
7448
|
-
|
|
7449
|
-
function fromObject (that, obj) {
|
|
7450
|
-
if (internalIsBuffer(obj)) {
|
|
7451
|
-
var len = checked(obj.length) | 0;
|
|
7452
|
-
that = createBuffer(that, len);
|
|
7453
|
-
|
|
7454
|
-
if (that.length === 0) {
|
|
7455
|
-
return that
|
|
7456
|
-
}
|
|
7457
|
-
|
|
7458
|
-
obj.copy(that, 0, 0, len);
|
|
7459
|
-
return that
|
|
7460
|
-
}
|
|
7461
|
-
|
|
7462
|
-
if (obj) {
|
|
7463
|
-
if ((typeof ArrayBuffer !== 'undefined' &&
|
|
7464
|
-
obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
|
|
7465
|
-
if (typeof obj.length !== 'number' || isnan(obj.length)) {
|
|
7466
|
-
return createBuffer(that, 0)
|
|
7467
|
-
}
|
|
7468
|
-
return fromArrayLike(that, obj)
|
|
7469
|
-
}
|
|
7470
|
-
|
|
7471
|
-
if (obj.type === 'Buffer' && isArray(obj.data)) {
|
|
7472
|
-
return fromArrayLike(that, obj.data)
|
|
7473
|
-
}
|
|
7474
|
-
}
|
|
7475
|
-
|
|
7476
|
-
throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
|
|
7477
|
-
}
|
|
7478
|
-
|
|
7479
|
-
function checked (length) {
|
|
7480
|
-
// Note: cannot use `length < kMaxLength()` here because that fails when
|
|
7481
|
-
// length is NaN (which is otherwise coerced to zero.)
|
|
7482
|
-
if (length >= kMaxLength()) {
|
|
7483
|
-
throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
|
|
7484
|
-
'size: 0x' + kMaxLength().toString(16) + ' bytes')
|
|
7485
|
-
}
|
|
7486
|
-
return length | 0
|
|
7487
|
-
}
|
|
7488
|
-
Buffer.isBuffer = isBuffer;
|
|
7489
|
-
function internalIsBuffer (b) {
|
|
7490
|
-
return !!(b != null && b._isBuffer)
|
|
7491
|
-
}
|
|
7492
|
-
|
|
7493
|
-
Buffer.compare = function compare (a, b) {
|
|
7494
|
-
if (!internalIsBuffer(a) || !internalIsBuffer(b)) {
|
|
7495
|
-
throw new TypeError('Arguments must be Buffers')
|
|
7496
|
-
}
|
|
7497
|
-
|
|
7498
|
-
if (a === b) return 0
|
|
7499
|
-
|
|
7500
|
-
var x = a.length;
|
|
7501
|
-
var y = b.length;
|
|
7502
|
-
|
|
7503
|
-
for (var i = 0, len = Math.min(x, y); i < len; ++i) {
|
|
7504
|
-
if (a[i] !== b[i]) {
|
|
7505
|
-
x = a[i];
|
|
7506
|
-
y = b[i];
|
|
7507
|
-
break
|
|
7508
|
-
}
|
|
7509
|
-
}
|
|
7510
|
-
|
|
7511
|
-
if (x < y) return -1
|
|
7512
|
-
if (y < x) return 1
|
|
7513
|
-
return 0
|
|
7514
|
-
};
|
|
7515
|
-
|
|
7516
|
-
Buffer.isEncoding = function isEncoding (encoding) {
|
|
7517
|
-
switch (String(encoding).toLowerCase()) {
|
|
7518
|
-
case 'hex':
|
|
7519
|
-
case 'utf8':
|
|
7520
|
-
case 'utf-8':
|
|
7521
|
-
case 'ascii':
|
|
7522
|
-
case 'latin1':
|
|
7523
|
-
case 'binary':
|
|
7524
|
-
case 'base64':
|
|
7525
|
-
case 'ucs2':
|
|
7526
|
-
case 'ucs-2':
|
|
7527
|
-
case 'utf16le':
|
|
7528
|
-
case 'utf-16le':
|
|
7529
|
-
return true
|
|
7530
|
-
default:
|
|
7531
|
-
return false
|
|
7532
|
-
}
|
|
7533
|
-
};
|
|
7534
|
-
|
|
7535
|
-
Buffer.concat = function concat (list, length) {
|
|
7536
|
-
if (!isArray(list)) {
|
|
7537
|
-
throw new TypeError('"list" argument must be an Array of Buffers')
|
|
7538
|
-
}
|
|
7539
|
-
|
|
7540
|
-
if (list.length === 0) {
|
|
7541
|
-
return Buffer.alloc(0)
|
|
7542
|
-
}
|
|
7543
|
-
|
|
7544
|
-
var i;
|
|
7545
|
-
if (length === undefined) {
|
|
7546
|
-
length = 0;
|
|
7547
|
-
for (i = 0; i < list.length; ++i) {
|
|
7548
|
-
length += list[i].length;
|
|
7549
|
-
}
|
|
7550
|
-
}
|
|
7551
|
-
|
|
7552
|
-
var buffer = Buffer.allocUnsafe(length);
|
|
7553
|
-
var pos = 0;
|
|
7554
|
-
for (i = 0; i < list.length; ++i) {
|
|
7555
|
-
var buf = list[i];
|
|
7556
|
-
if (!internalIsBuffer(buf)) {
|
|
7557
|
-
throw new TypeError('"list" argument must be an Array of Buffers')
|
|
7558
|
-
}
|
|
7559
|
-
buf.copy(buffer, pos);
|
|
7560
|
-
pos += buf.length;
|
|
7561
|
-
}
|
|
7562
|
-
return buffer
|
|
7563
|
-
};
|
|
7564
|
-
|
|
7565
|
-
function byteLength (string, encoding) {
|
|
7566
|
-
if (internalIsBuffer(string)) {
|
|
7567
|
-
return string.length
|
|
7568
|
-
}
|
|
7569
|
-
if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
|
|
7570
|
-
(ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
|
|
7571
|
-
return string.byteLength
|
|
7572
|
-
}
|
|
7573
|
-
if (typeof string !== 'string') {
|
|
7574
|
-
string = '' + string;
|
|
7575
|
-
}
|
|
7576
|
-
|
|
7577
|
-
var len = string.length;
|
|
7578
|
-
if (len === 0) return 0
|
|
7579
|
-
|
|
7580
|
-
// Use a for loop to avoid recursion
|
|
7581
|
-
var loweredCase = false;
|
|
7582
|
-
for (;;) {
|
|
7583
|
-
switch (encoding) {
|
|
7584
|
-
case 'ascii':
|
|
7585
|
-
case 'latin1':
|
|
7586
|
-
case 'binary':
|
|
7587
|
-
return len
|
|
7588
|
-
case 'utf8':
|
|
7589
|
-
case 'utf-8':
|
|
7590
|
-
case undefined:
|
|
7591
|
-
return utf8ToBytes(string).length
|
|
7592
|
-
case 'ucs2':
|
|
7593
|
-
case 'ucs-2':
|
|
7594
|
-
case 'utf16le':
|
|
7595
|
-
case 'utf-16le':
|
|
7596
|
-
return len * 2
|
|
7597
|
-
case 'hex':
|
|
7598
|
-
return len >>> 1
|
|
7599
|
-
case 'base64':
|
|
7600
|
-
return base64ToBytes(string).length
|
|
7601
|
-
default:
|
|
7602
|
-
if (loweredCase) return utf8ToBytes(string).length // assume utf8
|
|
7603
|
-
encoding = ('' + encoding).toLowerCase();
|
|
7604
|
-
loweredCase = true;
|
|
7605
|
-
}
|
|
7606
|
-
}
|
|
7607
|
-
}
|
|
7608
|
-
Buffer.byteLength = byteLength;
|
|
7609
|
-
|
|
7610
|
-
function slowToString (encoding, start, end) {
|
|
7611
|
-
var loweredCase = false;
|
|
7612
|
-
|
|
7613
|
-
// No need to verify that "this.length <= MAX_UINT32" since it's a read-only
|
|
7614
|
-
// property of a typed array.
|
|
7615
|
-
|
|
7616
|
-
// This behaves neither like String nor Uint8Array in that we set start/end
|
|
7617
|
-
// to their upper/lower bounds if the value passed is out of range.
|
|
7618
|
-
// undefined is handled specially as per ECMA-262 6th Edition,
|
|
7619
|
-
// Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
|
|
7620
|
-
if (start === undefined || start < 0) {
|
|
7621
|
-
start = 0;
|
|
7622
|
-
}
|
|
7623
|
-
// Return early if start > this.length. Done here to prevent potential uint32
|
|
7624
|
-
// coercion fail below.
|
|
7625
|
-
if (start > this.length) {
|
|
7626
|
-
return ''
|
|
7627
|
-
}
|
|
7628
|
-
|
|
7629
|
-
if (end === undefined || end > this.length) {
|
|
7630
|
-
end = this.length;
|
|
7631
|
-
}
|
|
7632
|
-
|
|
7633
|
-
if (end <= 0) {
|
|
7634
|
-
return ''
|
|
7635
|
-
}
|
|
7636
|
-
|
|
7637
|
-
// Force coersion to uint32. This will also coerce falsey/NaN values to 0.
|
|
7638
|
-
end >>>= 0;
|
|
7639
|
-
start >>>= 0;
|
|
7640
|
-
|
|
7641
|
-
if (end <= start) {
|
|
7642
|
-
return ''
|
|
7643
|
-
}
|
|
7644
|
-
|
|
7645
|
-
if (!encoding) encoding = 'utf8';
|
|
7646
|
-
|
|
7647
|
-
while (true) {
|
|
7648
|
-
switch (encoding) {
|
|
7649
|
-
case 'hex':
|
|
7650
|
-
return hexSlice(this, start, end)
|
|
7651
|
-
|
|
7652
|
-
case 'utf8':
|
|
7653
|
-
case 'utf-8':
|
|
7654
|
-
return utf8Slice(this, start, end)
|
|
7655
|
-
|
|
7656
|
-
case 'ascii':
|
|
7657
|
-
return asciiSlice(this, start, end)
|
|
7658
|
-
|
|
7659
|
-
case 'latin1':
|
|
7660
|
-
case 'binary':
|
|
7661
|
-
return latin1Slice(this, start, end)
|
|
7662
|
-
|
|
7663
|
-
case 'base64':
|
|
7664
|
-
return base64Slice(this, start, end)
|
|
7665
|
-
|
|
7666
|
-
case 'ucs2':
|
|
7667
|
-
case 'ucs-2':
|
|
7668
|
-
case 'utf16le':
|
|
7669
|
-
case 'utf-16le':
|
|
7670
|
-
return utf16leSlice(this, start, end)
|
|
7671
|
-
|
|
7672
|
-
default:
|
|
7673
|
-
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
|
|
7674
|
-
encoding = (encoding + '').toLowerCase();
|
|
7675
|
-
loweredCase = true;
|
|
7676
|
-
}
|
|
7677
|
-
}
|
|
7678
|
-
}
|
|
7679
|
-
|
|
7680
|
-
// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
|
|
7681
|
-
// Buffer instances.
|
|
7682
|
-
Buffer.prototype._isBuffer = true;
|
|
7683
|
-
|
|
7684
|
-
function swap (b, n, m) {
|
|
7685
|
-
var i = b[n];
|
|
7686
|
-
b[n] = b[m];
|
|
7687
|
-
b[m] = i;
|
|
7688
|
-
}
|
|
7689
|
-
|
|
7690
|
-
Buffer.prototype.swap16 = function swap16 () {
|
|
7691
|
-
var len = this.length;
|
|
7692
|
-
if (len % 2 !== 0) {
|
|
7693
|
-
throw new RangeError('Buffer size must be a multiple of 16-bits')
|
|
7694
|
-
}
|
|
7695
|
-
for (var i = 0; i < len; i += 2) {
|
|
7696
|
-
swap(this, i, i + 1);
|
|
7697
|
-
}
|
|
7698
|
-
return this
|
|
7699
|
-
};
|
|
7700
|
-
|
|
7701
|
-
Buffer.prototype.swap32 = function swap32 () {
|
|
7702
|
-
var len = this.length;
|
|
7703
|
-
if (len % 4 !== 0) {
|
|
7704
|
-
throw new RangeError('Buffer size must be a multiple of 32-bits')
|
|
7705
|
-
}
|
|
7706
|
-
for (var i = 0; i < len; i += 4) {
|
|
7707
|
-
swap(this, i, i + 3);
|
|
7708
|
-
swap(this, i + 1, i + 2);
|
|
7709
|
-
}
|
|
7710
|
-
return this
|
|
7711
|
-
};
|
|
7712
|
-
|
|
7713
|
-
Buffer.prototype.swap64 = function swap64 () {
|
|
7714
|
-
var len = this.length;
|
|
7715
|
-
if (len % 8 !== 0) {
|
|
7716
|
-
throw new RangeError('Buffer size must be a multiple of 64-bits')
|
|
7717
|
-
}
|
|
7718
|
-
for (var i = 0; i < len; i += 8) {
|
|
7719
|
-
swap(this, i, i + 7);
|
|
7720
|
-
swap(this, i + 1, i + 6);
|
|
7721
|
-
swap(this, i + 2, i + 5);
|
|
7722
|
-
swap(this, i + 3, i + 4);
|
|
7723
|
-
}
|
|
7724
|
-
return this
|
|
7725
|
-
};
|
|
7726
|
-
|
|
7727
|
-
Buffer.prototype.toString = function toString () {
|
|
7728
|
-
var length = this.length | 0;
|
|
7729
|
-
if (length === 0) return ''
|
|
7730
|
-
if (arguments.length === 0) return utf8Slice(this, 0, length)
|
|
7731
|
-
return slowToString.apply(this, arguments)
|
|
7732
|
-
};
|
|
7733
|
-
|
|
7734
|
-
Buffer.prototype.equals = function equals (b) {
|
|
7735
|
-
if (!internalIsBuffer(b)) throw new TypeError('Argument must be a Buffer')
|
|
7736
|
-
if (this === b) return true
|
|
7737
|
-
return Buffer.compare(this, b) === 0
|
|
7738
|
-
};
|
|
7739
|
-
|
|
7740
|
-
Buffer.prototype.inspect = function inspect () {
|
|
7741
|
-
var str = '';
|
|
7742
|
-
var max = INSPECT_MAX_BYTES;
|
|
7743
|
-
if (this.length > 0) {
|
|
7744
|
-
str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
|
|
7745
|
-
if (this.length > max) str += ' ... ';
|
|
7746
|
-
}
|
|
7747
|
-
return '<Buffer ' + str + '>'
|
|
7748
|
-
};
|
|
7749
|
-
|
|
7750
|
-
Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
|
|
7751
|
-
if (!internalIsBuffer(target)) {
|
|
7752
|
-
throw new TypeError('Argument must be a Buffer')
|
|
7753
|
-
}
|
|
7754
|
-
|
|
7755
|
-
if (start === undefined) {
|
|
7756
|
-
start = 0;
|
|
7757
|
-
}
|
|
7758
|
-
if (end === undefined) {
|
|
7759
|
-
end = target ? target.length : 0;
|
|
7760
|
-
}
|
|
7761
|
-
if (thisStart === undefined) {
|
|
7762
|
-
thisStart = 0;
|
|
7763
|
-
}
|
|
7764
|
-
if (thisEnd === undefined) {
|
|
7765
|
-
thisEnd = this.length;
|
|
7766
|
-
}
|
|
7767
|
-
|
|
7768
|
-
if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
|
|
7769
|
-
throw new RangeError('out of range index')
|
|
7770
|
-
}
|
|
7771
|
-
|
|
7772
|
-
if (thisStart >= thisEnd && start >= end) {
|
|
7773
|
-
return 0
|
|
7774
|
-
}
|
|
7775
|
-
if (thisStart >= thisEnd) {
|
|
7776
|
-
return -1
|
|
7777
|
-
}
|
|
7778
|
-
if (start >= end) {
|
|
7779
|
-
return 1
|
|
7780
|
-
}
|
|
7781
|
-
|
|
7782
|
-
start >>>= 0;
|
|
7783
|
-
end >>>= 0;
|
|
7784
|
-
thisStart >>>= 0;
|
|
7785
|
-
thisEnd >>>= 0;
|
|
7786
|
-
|
|
7787
|
-
if (this === target) return 0
|
|
7788
|
-
|
|
7789
|
-
var x = thisEnd - thisStart;
|
|
7790
|
-
var y = end - start;
|
|
7791
|
-
var len = Math.min(x, y);
|
|
7792
|
-
|
|
7793
|
-
var thisCopy = this.slice(thisStart, thisEnd);
|
|
7794
|
-
var targetCopy = target.slice(start, end);
|
|
7795
|
-
|
|
7796
|
-
for (var i = 0; i < len; ++i) {
|
|
7797
|
-
if (thisCopy[i] !== targetCopy[i]) {
|
|
7798
|
-
x = thisCopy[i];
|
|
7799
|
-
y = targetCopy[i];
|
|
7800
|
-
break
|
|
7801
|
-
}
|
|
7802
|
-
}
|
|
7803
|
-
|
|
7804
|
-
if (x < y) return -1
|
|
7805
|
-
if (y < x) return 1
|
|
7806
|
-
return 0
|
|
7807
|
-
};
|
|
7808
|
-
|
|
7809
|
-
// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
|
|
7810
|
-
// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
|
|
7811
|
-
//
|
|
7812
|
-
// Arguments:
|
|
7813
|
-
// - buffer - a Buffer to search
|
|
7814
|
-
// - val - a string, Buffer, or number
|
|
7815
|
-
// - byteOffset - an index into `buffer`; will be clamped to an int32
|
|
7816
|
-
// - encoding - an optional encoding, relevant is val is a string
|
|
7817
|
-
// - dir - true for indexOf, false for lastIndexOf
|
|
7818
|
-
function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
|
|
7819
|
-
// Empty buffer means no match
|
|
7820
|
-
if (buffer.length === 0) return -1
|
|
7821
|
-
|
|
7822
|
-
// Normalize byteOffset
|
|
7823
|
-
if (typeof byteOffset === 'string') {
|
|
7824
|
-
encoding = byteOffset;
|
|
7825
|
-
byteOffset = 0;
|
|
7826
|
-
} else if (byteOffset > 0x7fffffff) {
|
|
7827
|
-
byteOffset = 0x7fffffff;
|
|
7828
|
-
} else if (byteOffset < -2147483648) {
|
|
7829
|
-
byteOffset = -2147483648;
|
|
7830
|
-
}
|
|
7831
|
-
byteOffset = +byteOffset; // Coerce to Number.
|
|
7832
|
-
if (isNaN(byteOffset)) {
|
|
7833
|
-
// byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
|
|
7834
|
-
byteOffset = dir ? 0 : (buffer.length - 1);
|
|
7835
|
-
}
|
|
7836
|
-
|
|
7837
|
-
// Normalize byteOffset: negative offsets start from the end of the buffer
|
|
7838
|
-
if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
|
|
7839
|
-
if (byteOffset >= buffer.length) {
|
|
7840
|
-
if (dir) return -1
|
|
7841
|
-
else byteOffset = buffer.length - 1;
|
|
7842
|
-
} else if (byteOffset < 0) {
|
|
7843
|
-
if (dir) byteOffset = 0;
|
|
7844
|
-
else return -1
|
|
7845
|
-
}
|
|
7846
|
-
|
|
7847
|
-
// Normalize val
|
|
7848
|
-
if (typeof val === 'string') {
|
|
7849
|
-
val = Buffer.from(val, encoding);
|
|
7850
|
-
}
|
|
7851
|
-
|
|
7852
|
-
// Finally, search either indexOf (if dir is true) or lastIndexOf
|
|
7853
|
-
if (internalIsBuffer(val)) {
|
|
7854
|
-
// Special case: looking for empty string/buffer always fails
|
|
7855
|
-
if (val.length === 0) {
|
|
7856
|
-
return -1
|
|
7857
|
-
}
|
|
7858
|
-
return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
|
|
7859
|
-
} else if (typeof val === 'number') {
|
|
7860
|
-
val = val & 0xFF; // Search for a byte value [0-255]
|
|
7861
|
-
if (Buffer.TYPED_ARRAY_SUPPORT &&
|
|
7862
|
-
typeof Uint8Array.prototype.indexOf === 'function') {
|
|
7863
|
-
if (dir) {
|
|
7864
|
-
return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
|
|
7865
|
-
} else {
|
|
7866
|
-
return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
|
|
7867
|
-
}
|
|
7868
|
-
}
|
|
7869
|
-
return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
|
|
7870
|
-
}
|
|
7871
|
-
|
|
7872
|
-
throw new TypeError('val must be string, number or Buffer')
|
|
7873
|
-
}
|
|
7874
|
-
|
|
7875
|
-
function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
|
|
7876
|
-
var indexSize = 1;
|
|
7877
|
-
var arrLength = arr.length;
|
|
7878
|
-
var valLength = val.length;
|
|
7879
|
-
|
|
7880
|
-
if (encoding !== undefined) {
|
|
7881
|
-
encoding = String(encoding).toLowerCase();
|
|
7882
|
-
if (encoding === 'ucs2' || encoding === 'ucs-2' ||
|
|
7883
|
-
encoding === 'utf16le' || encoding === 'utf-16le') {
|
|
7884
|
-
if (arr.length < 2 || val.length < 2) {
|
|
7885
|
-
return -1
|
|
7886
|
-
}
|
|
7887
|
-
indexSize = 2;
|
|
7888
|
-
arrLength /= 2;
|
|
7889
|
-
valLength /= 2;
|
|
7890
|
-
byteOffset /= 2;
|
|
7891
|
-
}
|
|
7892
|
-
}
|
|
7893
|
-
|
|
7894
|
-
function read (buf, i) {
|
|
7895
|
-
if (indexSize === 1) {
|
|
7896
|
-
return buf[i]
|
|
7897
|
-
} else {
|
|
7898
|
-
return buf.readUInt16BE(i * indexSize)
|
|
7899
|
-
}
|
|
7900
|
-
}
|
|
7901
|
-
|
|
7902
|
-
var i;
|
|
7903
|
-
if (dir) {
|
|
7904
|
-
var foundIndex = -1;
|
|
7905
|
-
for (i = byteOffset; i < arrLength; i++) {
|
|
7906
|
-
if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
|
|
7907
|
-
if (foundIndex === -1) foundIndex = i;
|
|
7908
|
-
if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
|
|
7909
|
-
} else {
|
|
7910
|
-
if (foundIndex !== -1) i -= i - foundIndex;
|
|
7911
|
-
foundIndex = -1;
|
|
7912
|
-
}
|
|
7913
|
-
}
|
|
7914
|
-
} else {
|
|
7915
|
-
if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
|
|
7916
|
-
for (i = byteOffset; i >= 0; i--) {
|
|
7917
|
-
var found = true;
|
|
7918
|
-
for (var j = 0; j < valLength; j++) {
|
|
7919
|
-
if (read(arr, i + j) !== read(val, j)) {
|
|
7920
|
-
found = false;
|
|
7921
|
-
break
|
|
7922
|
-
}
|
|
7923
|
-
}
|
|
7924
|
-
if (found) return i
|
|
7925
|
-
}
|
|
7926
|
-
}
|
|
7927
|
-
|
|
7928
|
-
return -1
|
|
7929
|
-
}
|
|
7930
|
-
|
|
7931
|
-
Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
|
|
7932
|
-
return this.indexOf(val, byteOffset, encoding) !== -1
|
|
7933
|
-
};
|
|
7934
|
-
|
|
7935
|
-
Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
|
|
7936
|
-
return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
|
|
7937
|
-
};
|
|
7938
|
-
|
|
7939
|
-
Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
|
|
7940
|
-
return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
|
|
7941
|
-
};
|
|
7942
|
-
|
|
7943
|
-
function hexWrite (buf, string, offset, length) {
|
|
7944
|
-
offset = Number(offset) || 0;
|
|
7945
|
-
var remaining = buf.length - offset;
|
|
7946
|
-
if (!length) {
|
|
7947
|
-
length = remaining;
|
|
7948
|
-
} else {
|
|
7949
|
-
length = Number(length);
|
|
7950
|
-
if (length > remaining) {
|
|
7951
|
-
length = remaining;
|
|
7952
|
-
}
|
|
7953
|
-
}
|
|
7954
|
-
|
|
7955
|
-
// must be an even number of digits
|
|
7956
|
-
var strLen = string.length;
|
|
7957
|
-
if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
|
|
7958
|
-
|
|
7959
|
-
if (length > strLen / 2) {
|
|
7960
|
-
length = strLen / 2;
|
|
7961
|
-
}
|
|
7962
|
-
for (var i = 0; i < length; ++i) {
|
|
7963
|
-
var parsed = parseInt(string.substr(i * 2, 2), 16);
|
|
7964
|
-
if (isNaN(parsed)) return i
|
|
7965
|
-
buf[offset + i] = parsed;
|
|
7966
|
-
}
|
|
7967
|
-
return i
|
|
7968
|
-
}
|
|
7969
|
-
|
|
7970
|
-
function utf8Write (buf, string, offset, length) {
|
|
7971
|
-
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
|
|
7972
|
-
}
|
|
7973
|
-
|
|
7974
|
-
function asciiWrite (buf, string, offset, length) {
|
|
7975
|
-
return blitBuffer(asciiToBytes(string), buf, offset, length)
|
|
7976
|
-
}
|
|
7977
|
-
|
|
7978
|
-
function latin1Write (buf, string, offset, length) {
|
|
7979
|
-
return asciiWrite(buf, string, offset, length)
|
|
7980
|
-
}
|
|
7981
|
-
|
|
7982
|
-
function base64Write (buf, string, offset, length) {
|
|
7983
|
-
return blitBuffer(base64ToBytes(string), buf, offset, length)
|
|
7984
|
-
}
|
|
7985
|
-
|
|
7986
|
-
function ucs2Write (buf, string, offset, length) {
|
|
7987
|
-
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
|
|
7988
|
-
}
|
|
7989
|
-
|
|
7990
|
-
Buffer.prototype.write = function write (string, offset, length, encoding) {
|
|
7991
|
-
// Buffer#write(string)
|
|
7992
|
-
if (offset === undefined) {
|
|
7993
|
-
encoding = 'utf8';
|
|
7994
|
-
length = this.length;
|
|
7995
|
-
offset = 0;
|
|
7996
|
-
// Buffer#write(string, encoding)
|
|
7997
|
-
} else if (length === undefined && typeof offset === 'string') {
|
|
7998
|
-
encoding = offset;
|
|
7999
|
-
length = this.length;
|
|
8000
|
-
offset = 0;
|
|
8001
|
-
// Buffer#write(string, offset[, length][, encoding])
|
|
8002
|
-
} else if (isFinite(offset)) {
|
|
8003
|
-
offset = offset | 0;
|
|
8004
|
-
if (isFinite(length)) {
|
|
8005
|
-
length = length | 0;
|
|
8006
|
-
if (encoding === undefined) encoding = 'utf8';
|
|
8007
|
-
} else {
|
|
8008
|
-
encoding = length;
|
|
8009
|
-
length = undefined;
|
|
8010
|
-
}
|
|
8011
|
-
// legacy write(string, encoding, offset, length) - remove in v0.13
|
|
8012
|
-
} else {
|
|
8013
|
-
throw new Error(
|
|
8014
|
-
'Buffer.write(string, encoding, offset[, length]) is no longer supported'
|
|
8015
|
-
)
|
|
8016
|
-
}
|
|
8017
|
-
|
|
8018
|
-
var remaining = this.length - offset;
|
|
8019
|
-
if (length === undefined || length > remaining) length = remaining;
|
|
8020
|
-
|
|
8021
|
-
if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
|
|
8022
|
-
throw new RangeError('Attempt to write outside buffer bounds')
|
|
8023
|
-
}
|
|
8024
|
-
|
|
8025
|
-
if (!encoding) encoding = 'utf8';
|
|
8026
|
-
|
|
8027
|
-
var loweredCase = false;
|
|
8028
|
-
for (;;) {
|
|
8029
|
-
switch (encoding) {
|
|
8030
|
-
case 'hex':
|
|
8031
|
-
return hexWrite(this, string, offset, length)
|
|
8032
|
-
|
|
8033
|
-
case 'utf8':
|
|
8034
|
-
case 'utf-8':
|
|
8035
|
-
return utf8Write(this, string, offset, length)
|
|
8036
|
-
|
|
8037
|
-
case 'ascii':
|
|
8038
|
-
return asciiWrite(this, string, offset, length)
|
|
8039
|
-
|
|
8040
|
-
case 'latin1':
|
|
8041
|
-
case 'binary':
|
|
8042
|
-
return latin1Write(this, string, offset, length)
|
|
8043
|
-
|
|
8044
|
-
case 'base64':
|
|
8045
|
-
// Warning: maxLength not taken into account in base64Write
|
|
8046
|
-
return base64Write(this, string, offset, length)
|
|
8047
|
-
|
|
8048
|
-
case 'ucs2':
|
|
8049
|
-
case 'ucs-2':
|
|
8050
|
-
case 'utf16le':
|
|
8051
|
-
case 'utf-16le':
|
|
8052
|
-
return ucs2Write(this, string, offset, length)
|
|
8053
|
-
|
|
8054
|
-
default:
|
|
8055
|
-
if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
|
|
8056
|
-
encoding = ('' + encoding).toLowerCase();
|
|
8057
|
-
loweredCase = true;
|
|
8058
|
-
}
|
|
8059
|
-
}
|
|
8060
|
-
};
|
|
8061
|
-
|
|
8062
|
-
Buffer.prototype.toJSON = function toJSON () {
|
|
8063
|
-
return {
|
|
8064
|
-
type: 'Buffer',
|
|
8065
|
-
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
8066
|
-
}
|
|
8067
|
-
};
|
|
8068
|
-
|
|
8069
|
-
function base64Slice (buf, start, end) {
|
|
8070
|
-
if (start === 0 && end === buf.length) {
|
|
8071
|
-
return fromByteArray(buf)
|
|
8072
|
-
} else {
|
|
8073
|
-
return fromByteArray(buf.slice(start, end))
|
|
8074
|
-
}
|
|
8075
|
-
}
|
|
8076
|
-
|
|
8077
|
-
function utf8Slice (buf, start, end) {
|
|
8078
|
-
end = Math.min(buf.length, end);
|
|
8079
|
-
var res = [];
|
|
8080
|
-
|
|
8081
|
-
var i = start;
|
|
8082
|
-
while (i < end) {
|
|
8083
|
-
var firstByte = buf[i];
|
|
8084
|
-
var codePoint = null;
|
|
8085
|
-
var bytesPerSequence = (firstByte > 0xEF) ? 4
|
|
8086
|
-
: (firstByte > 0xDF) ? 3
|
|
8087
|
-
: (firstByte > 0xBF) ? 2
|
|
8088
|
-
: 1;
|
|
8089
|
-
|
|
8090
|
-
if (i + bytesPerSequence <= end) {
|
|
8091
|
-
var secondByte, thirdByte, fourthByte, tempCodePoint;
|
|
8092
|
-
|
|
8093
|
-
switch (bytesPerSequence) {
|
|
8094
|
-
case 1:
|
|
8095
|
-
if (firstByte < 0x80) {
|
|
8096
|
-
codePoint = firstByte;
|
|
8097
|
-
}
|
|
8098
|
-
break
|
|
8099
|
-
case 2:
|
|
8100
|
-
secondByte = buf[i + 1];
|
|
8101
|
-
if ((secondByte & 0xC0) === 0x80) {
|
|
8102
|
-
tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F);
|
|
8103
|
-
if (tempCodePoint > 0x7F) {
|
|
8104
|
-
codePoint = tempCodePoint;
|
|
8105
|
-
}
|
|
8106
|
-
}
|
|
8107
|
-
break
|
|
8108
|
-
case 3:
|
|
8109
|
-
secondByte = buf[i + 1];
|
|
8110
|
-
thirdByte = buf[i + 2];
|
|
8111
|
-
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
|
|
8112
|
-
tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F);
|
|
8113
|
-
if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
|
|
8114
|
-
codePoint = tempCodePoint;
|
|
8115
|
-
}
|
|
8116
|
-
}
|
|
8117
|
-
break
|
|
8118
|
-
case 4:
|
|
8119
|
-
secondByte = buf[i + 1];
|
|
8120
|
-
thirdByte = buf[i + 2];
|
|
8121
|
-
fourthByte = buf[i + 3];
|
|
8122
|
-
if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
|
|
8123
|
-
tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F);
|
|
8124
|
-
if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
|
|
8125
|
-
codePoint = tempCodePoint;
|
|
8126
|
-
}
|
|
8127
|
-
}
|
|
8128
|
-
}
|
|
8129
|
-
}
|
|
8130
|
-
|
|
8131
|
-
if (codePoint === null) {
|
|
8132
|
-
// we did not generate a valid codePoint so insert a
|
|
8133
|
-
// replacement char (U+FFFD) and advance only 1 byte
|
|
8134
|
-
codePoint = 0xFFFD;
|
|
8135
|
-
bytesPerSequence = 1;
|
|
8136
|
-
} else if (codePoint > 0xFFFF) {
|
|
8137
|
-
// encode to utf16 (surrogate pair dance)
|
|
8138
|
-
codePoint -= 0x10000;
|
|
8139
|
-
res.push(codePoint >>> 10 & 0x3FF | 0xD800);
|
|
8140
|
-
codePoint = 0xDC00 | codePoint & 0x3FF;
|
|
8141
|
-
}
|
|
8142
|
-
|
|
8143
|
-
res.push(codePoint);
|
|
8144
|
-
i += bytesPerSequence;
|
|
8145
|
-
}
|
|
8146
|
-
|
|
8147
|
-
return decodeCodePointsArray(res)
|
|
8148
|
-
}
|
|
8149
|
-
|
|
8150
|
-
// Based on http://stackoverflow.com/a/22747272/680742, the browser with
|
|
8151
|
-
// the lowest limit is Chrome, with 0x10000 args.
|
|
8152
|
-
// We go 1 magnitude less, for safety
|
|
8153
|
-
var MAX_ARGUMENTS_LENGTH = 0x1000;
|
|
8154
|
-
|
|
8155
|
-
function decodeCodePointsArray (codePoints) {
|
|
8156
|
-
var len = codePoints.length;
|
|
8157
|
-
if (len <= MAX_ARGUMENTS_LENGTH) {
|
|
8158
|
-
return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
|
|
8159
|
-
}
|
|
8160
|
-
|
|
8161
|
-
// Decode in chunks to avoid "call stack size exceeded".
|
|
8162
|
-
var res = '';
|
|
8163
|
-
var i = 0;
|
|
8164
|
-
while (i < len) {
|
|
8165
|
-
res += String.fromCharCode.apply(
|
|
8166
|
-
String,
|
|
8167
|
-
codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
|
|
8168
|
-
);
|
|
8169
|
-
}
|
|
8170
|
-
return res
|
|
8171
|
-
}
|
|
8172
|
-
|
|
8173
|
-
function asciiSlice (buf, start, end) {
|
|
8174
|
-
var ret = '';
|
|
8175
|
-
end = Math.min(buf.length, end);
|
|
8176
|
-
|
|
8177
|
-
for (var i = start; i < end; ++i) {
|
|
8178
|
-
ret += String.fromCharCode(buf[i] & 0x7F);
|
|
8179
|
-
}
|
|
8180
|
-
return ret
|
|
8181
|
-
}
|
|
8182
|
-
|
|
8183
|
-
function latin1Slice (buf, start, end) {
|
|
8184
|
-
var ret = '';
|
|
8185
|
-
end = Math.min(buf.length, end);
|
|
8186
|
-
|
|
8187
|
-
for (var i = start; i < end; ++i) {
|
|
8188
|
-
ret += String.fromCharCode(buf[i]);
|
|
8189
|
-
}
|
|
8190
|
-
return ret
|
|
8191
|
-
}
|
|
8192
|
-
|
|
8193
|
-
function hexSlice (buf, start, end) {
|
|
8194
|
-
var len = buf.length;
|
|
8195
|
-
|
|
8196
|
-
if (!start || start < 0) start = 0;
|
|
8197
|
-
if (!end || end < 0 || end > len) end = len;
|
|
8198
|
-
|
|
8199
|
-
var out = '';
|
|
8200
|
-
for (var i = start; i < end; ++i) {
|
|
8201
|
-
out += toHex(buf[i]);
|
|
8202
|
-
}
|
|
8203
|
-
return out
|
|
8204
|
-
}
|
|
8205
|
-
|
|
8206
|
-
function utf16leSlice (buf, start, end) {
|
|
8207
|
-
var bytes = buf.slice(start, end);
|
|
8208
|
-
var res = '';
|
|
8209
|
-
for (var i = 0; i < bytes.length; i += 2) {
|
|
8210
|
-
res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
|
|
8211
|
-
}
|
|
8212
|
-
return res
|
|
8213
|
-
}
|
|
8214
|
-
|
|
8215
|
-
Buffer.prototype.slice = function slice (start, end) {
|
|
8216
|
-
var len = this.length;
|
|
8217
|
-
start = ~~start;
|
|
8218
|
-
end = end === undefined ? len : ~~end;
|
|
8219
|
-
|
|
8220
|
-
if (start < 0) {
|
|
8221
|
-
start += len;
|
|
8222
|
-
if (start < 0) start = 0;
|
|
8223
|
-
} else if (start > len) {
|
|
8224
|
-
start = len;
|
|
8225
|
-
}
|
|
8226
|
-
|
|
8227
|
-
if (end < 0) {
|
|
8228
|
-
end += len;
|
|
8229
|
-
if (end < 0) end = 0;
|
|
8230
|
-
} else if (end > len) {
|
|
8231
|
-
end = len;
|
|
8232
|
-
}
|
|
8233
|
-
|
|
8234
|
-
if (end < start) end = start;
|
|
8235
|
-
|
|
8236
|
-
var newBuf;
|
|
8237
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8238
|
-
newBuf = this.subarray(start, end);
|
|
8239
|
-
newBuf.__proto__ = Buffer.prototype;
|
|
8240
|
-
} else {
|
|
8241
|
-
var sliceLen = end - start;
|
|
8242
|
-
newBuf = new Buffer(sliceLen, undefined);
|
|
8243
|
-
for (var i = 0; i < sliceLen; ++i) {
|
|
8244
|
-
newBuf[i] = this[i + start];
|
|
8245
|
-
}
|
|
8246
|
-
}
|
|
8247
|
-
|
|
8248
|
-
return newBuf
|
|
8249
|
-
};
|
|
8250
|
-
|
|
8251
|
-
/*
|
|
8252
|
-
* Need to make sure that buffer isn't trying to write out of bounds.
|
|
8253
|
-
*/
|
|
8254
|
-
function checkOffset (offset, ext, length) {
|
|
8255
|
-
if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
|
|
8256
|
-
if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
|
|
8257
|
-
}
|
|
8258
|
-
|
|
8259
|
-
Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
|
|
8260
|
-
offset = offset | 0;
|
|
8261
|
-
byteLength = byteLength | 0;
|
|
8262
|
-
if (!noAssert) checkOffset(offset, byteLength, this.length);
|
|
8263
|
-
|
|
8264
|
-
var val = this[offset];
|
|
8265
|
-
var mul = 1;
|
|
8266
|
-
var i = 0;
|
|
8267
|
-
while (++i < byteLength && (mul *= 0x100)) {
|
|
8268
|
-
val += this[offset + i] * mul;
|
|
8269
|
-
}
|
|
8270
|
-
|
|
8271
|
-
return val
|
|
8272
|
-
};
|
|
8273
|
-
|
|
8274
|
-
Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
|
|
8275
|
-
offset = offset | 0;
|
|
8276
|
-
byteLength = byteLength | 0;
|
|
8277
|
-
if (!noAssert) {
|
|
8278
|
-
checkOffset(offset, byteLength, this.length);
|
|
8279
|
-
}
|
|
8280
|
-
|
|
8281
|
-
var val = this[offset + --byteLength];
|
|
8282
|
-
var mul = 1;
|
|
8283
|
-
while (byteLength > 0 && (mul *= 0x100)) {
|
|
8284
|
-
val += this[offset + --byteLength] * mul;
|
|
8285
|
-
}
|
|
8286
|
-
|
|
8287
|
-
return val
|
|
8288
|
-
};
|
|
8289
|
-
|
|
8290
|
-
Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
|
|
8291
|
-
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
8292
|
-
return this[offset]
|
|
8293
|
-
};
|
|
8294
|
-
|
|
8295
|
-
Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
|
|
8296
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
8297
|
-
return this[offset] | (this[offset + 1] << 8)
|
|
8298
|
-
};
|
|
8299
|
-
|
|
8300
|
-
Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
|
|
8301
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
8302
|
-
return (this[offset] << 8) | this[offset + 1]
|
|
8303
|
-
};
|
|
8304
|
-
|
|
8305
|
-
Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
|
|
8306
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
8307
|
-
|
|
8308
|
-
return ((this[offset]) |
|
|
8309
|
-
(this[offset + 1] << 8) |
|
|
8310
|
-
(this[offset + 2] << 16)) +
|
|
8311
|
-
(this[offset + 3] * 0x1000000)
|
|
8312
|
-
};
|
|
8313
|
-
|
|
8314
|
-
Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
|
|
8315
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
8316
|
-
|
|
8317
|
-
return (this[offset] * 0x1000000) +
|
|
8318
|
-
((this[offset + 1] << 16) |
|
|
8319
|
-
(this[offset + 2] << 8) |
|
|
8320
|
-
this[offset + 3])
|
|
8321
|
-
};
|
|
8322
|
-
|
|
8323
|
-
Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
|
|
8324
|
-
offset = offset | 0;
|
|
8325
|
-
byteLength = byteLength | 0;
|
|
8326
|
-
if (!noAssert) checkOffset(offset, byteLength, this.length);
|
|
8327
|
-
|
|
8328
|
-
var val = this[offset];
|
|
8329
|
-
var mul = 1;
|
|
8330
|
-
var i = 0;
|
|
8331
|
-
while (++i < byteLength && (mul *= 0x100)) {
|
|
8332
|
-
val += this[offset + i] * mul;
|
|
8333
|
-
}
|
|
8334
|
-
mul *= 0x80;
|
|
8335
|
-
|
|
8336
|
-
if (val >= mul) val -= Math.pow(2, 8 * byteLength);
|
|
8337
|
-
|
|
8338
|
-
return val
|
|
8339
|
-
};
|
|
8340
|
-
|
|
8341
|
-
Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
|
|
8342
|
-
offset = offset | 0;
|
|
8343
|
-
byteLength = byteLength | 0;
|
|
8344
|
-
if (!noAssert) checkOffset(offset, byteLength, this.length);
|
|
8345
|
-
|
|
8346
|
-
var i = byteLength;
|
|
8347
|
-
var mul = 1;
|
|
8348
|
-
var val = this[offset + --i];
|
|
8349
|
-
while (i > 0 && (mul *= 0x100)) {
|
|
8350
|
-
val += this[offset + --i] * mul;
|
|
8351
|
-
}
|
|
8352
|
-
mul *= 0x80;
|
|
8353
|
-
|
|
8354
|
-
if (val >= mul) val -= Math.pow(2, 8 * byteLength);
|
|
8355
|
-
|
|
8356
|
-
return val
|
|
8357
|
-
};
|
|
8358
|
-
|
|
8359
|
-
Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
|
|
8360
|
-
if (!noAssert) checkOffset(offset, 1, this.length);
|
|
8361
|
-
if (!(this[offset] & 0x80)) return (this[offset])
|
|
8362
|
-
return ((0xff - this[offset] + 1) * -1)
|
|
8363
|
-
};
|
|
8364
|
-
|
|
8365
|
-
Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
|
|
8366
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
8367
|
-
var val = this[offset] | (this[offset + 1] << 8);
|
|
8368
|
-
return (val & 0x8000) ? val | 0xFFFF0000 : val
|
|
8369
|
-
};
|
|
8370
|
-
|
|
8371
|
-
Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
|
|
8372
|
-
if (!noAssert) checkOffset(offset, 2, this.length);
|
|
8373
|
-
var val = this[offset + 1] | (this[offset] << 8);
|
|
8374
|
-
return (val & 0x8000) ? val | 0xFFFF0000 : val
|
|
8375
|
-
};
|
|
8376
|
-
|
|
8377
|
-
Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
|
|
8378
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
8379
|
-
|
|
8380
|
-
return (this[offset]) |
|
|
8381
|
-
(this[offset + 1] << 8) |
|
|
8382
|
-
(this[offset + 2] << 16) |
|
|
8383
|
-
(this[offset + 3] << 24)
|
|
8384
|
-
};
|
|
8385
|
-
|
|
8386
|
-
Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
|
|
8387
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
8388
|
-
|
|
8389
|
-
return (this[offset] << 24) |
|
|
8390
|
-
(this[offset + 1] << 16) |
|
|
8391
|
-
(this[offset + 2] << 8) |
|
|
8392
|
-
(this[offset + 3])
|
|
8393
|
-
};
|
|
8394
|
-
|
|
8395
|
-
Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
|
|
8396
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
8397
|
-
return read(this, offset, true, 23, 4)
|
|
8398
|
-
};
|
|
8399
|
-
|
|
8400
|
-
Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
|
|
8401
|
-
if (!noAssert) checkOffset(offset, 4, this.length);
|
|
8402
|
-
return read(this, offset, false, 23, 4)
|
|
8403
|
-
};
|
|
8404
|
-
|
|
8405
|
-
Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
|
|
8406
|
-
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
8407
|
-
return read(this, offset, true, 52, 8)
|
|
8408
|
-
};
|
|
8409
|
-
|
|
8410
|
-
Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
|
|
8411
|
-
if (!noAssert) checkOffset(offset, 8, this.length);
|
|
8412
|
-
return read(this, offset, false, 52, 8)
|
|
8413
|
-
};
|
|
8414
|
-
|
|
8415
|
-
function checkInt (buf, value, offset, ext, max, min) {
|
|
8416
|
-
if (!internalIsBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
|
|
8417
|
-
if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
|
|
8418
|
-
if (offset + ext > buf.length) throw new RangeError('Index out of range')
|
|
8419
|
-
}
|
|
8420
|
-
|
|
8421
|
-
Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
|
|
8422
|
-
value = +value;
|
|
8423
|
-
offset = offset | 0;
|
|
8424
|
-
byteLength = byteLength | 0;
|
|
8425
|
-
if (!noAssert) {
|
|
8426
|
-
var maxBytes = Math.pow(2, 8 * byteLength) - 1;
|
|
8427
|
-
checkInt(this, value, offset, byteLength, maxBytes, 0);
|
|
8428
|
-
}
|
|
8429
|
-
|
|
8430
|
-
var mul = 1;
|
|
8431
|
-
var i = 0;
|
|
8432
|
-
this[offset] = value & 0xFF;
|
|
8433
|
-
while (++i < byteLength && (mul *= 0x100)) {
|
|
8434
|
-
this[offset + i] = (value / mul) & 0xFF;
|
|
8435
|
-
}
|
|
8436
|
-
|
|
8437
|
-
return offset + byteLength
|
|
8438
|
-
};
|
|
8439
|
-
|
|
8440
|
-
Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
|
|
8441
|
-
value = +value;
|
|
8442
|
-
offset = offset | 0;
|
|
8443
|
-
byteLength = byteLength | 0;
|
|
8444
|
-
if (!noAssert) {
|
|
8445
|
-
var maxBytes = Math.pow(2, 8 * byteLength) - 1;
|
|
8446
|
-
checkInt(this, value, offset, byteLength, maxBytes, 0);
|
|
8447
|
-
}
|
|
8448
|
-
|
|
8449
|
-
var i = byteLength - 1;
|
|
8450
|
-
var mul = 1;
|
|
8451
|
-
this[offset + i] = value & 0xFF;
|
|
8452
|
-
while (--i >= 0 && (mul *= 0x100)) {
|
|
8453
|
-
this[offset + i] = (value / mul) & 0xFF;
|
|
8454
|
-
}
|
|
8455
|
-
|
|
8456
|
-
return offset + byteLength
|
|
8457
|
-
};
|
|
8458
|
-
|
|
8459
|
-
Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
|
|
8460
|
-
value = +value;
|
|
8461
|
-
offset = offset | 0;
|
|
8462
|
-
if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
|
|
8463
|
-
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
|
|
8464
|
-
this[offset] = (value & 0xff);
|
|
8465
|
-
return offset + 1
|
|
8466
|
-
};
|
|
8467
|
-
|
|
8468
|
-
function objectWriteUInt16 (buf, value, offset, littleEndian) {
|
|
8469
|
-
if (value < 0) value = 0xffff + value + 1;
|
|
8470
|
-
for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
|
|
8471
|
-
buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
|
|
8472
|
-
(littleEndian ? i : 1 - i) * 8;
|
|
8473
|
-
}
|
|
8474
|
-
}
|
|
8475
|
-
|
|
8476
|
-
Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
|
|
8477
|
-
value = +value;
|
|
8478
|
-
offset = offset | 0;
|
|
8479
|
-
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
|
|
8480
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8481
|
-
this[offset] = (value & 0xff);
|
|
8482
|
-
this[offset + 1] = (value >>> 8);
|
|
8483
|
-
} else {
|
|
8484
|
-
objectWriteUInt16(this, value, offset, true);
|
|
8485
|
-
}
|
|
8486
|
-
return offset + 2
|
|
8487
|
-
};
|
|
8488
|
-
|
|
8489
|
-
Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
|
|
8490
|
-
value = +value;
|
|
8491
|
-
offset = offset | 0;
|
|
8492
|
-
if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
|
|
8493
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8494
|
-
this[offset] = (value >>> 8);
|
|
8495
|
-
this[offset + 1] = (value & 0xff);
|
|
8496
|
-
} else {
|
|
8497
|
-
objectWriteUInt16(this, value, offset, false);
|
|
8498
|
-
}
|
|
8499
|
-
return offset + 2
|
|
8500
|
-
};
|
|
8501
|
-
|
|
8502
|
-
function objectWriteUInt32 (buf, value, offset, littleEndian) {
|
|
8503
|
-
if (value < 0) value = 0xffffffff + value + 1;
|
|
8504
|
-
for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
|
|
8505
|
-
buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff;
|
|
8506
|
-
}
|
|
8507
|
-
}
|
|
8508
|
-
|
|
8509
|
-
Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
|
|
8510
|
-
value = +value;
|
|
8511
|
-
offset = offset | 0;
|
|
8512
|
-
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
|
|
8513
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8514
|
-
this[offset + 3] = (value >>> 24);
|
|
8515
|
-
this[offset + 2] = (value >>> 16);
|
|
8516
|
-
this[offset + 1] = (value >>> 8);
|
|
8517
|
-
this[offset] = (value & 0xff);
|
|
8518
|
-
} else {
|
|
8519
|
-
objectWriteUInt32(this, value, offset, true);
|
|
8520
|
-
}
|
|
8521
|
-
return offset + 4
|
|
8522
|
-
};
|
|
8523
|
-
|
|
8524
|
-
Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
|
|
8525
|
-
value = +value;
|
|
8526
|
-
offset = offset | 0;
|
|
8527
|
-
if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
|
|
8528
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8529
|
-
this[offset] = (value >>> 24);
|
|
8530
|
-
this[offset + 1] = (value >>> 16);
|
|
8531
|
-
this[offset + 2] = (value >>> 8);
|
|
8532
|
-
this[offset + 3] = (value & 0xff);
|
|
8533
|
-
} else {
|
|
8534
|
-
objectWriteUInt32(this, value, offset, false);
|
|
8535
|
-
}
|
|
8536
|
-
return offset + 4
|
|
8537
|
-
};
|
|
8538
|
-
|
|
8539
|
-
Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
|
|
8540
|
-
value = +value;
|
|
8541
|
-
offset = offset | 0;
|
|
8542
|
-
if (!noAssert) {
|
|
8543
|
-
var limit = Math.pow(2, 8 * byteLength - 1);
|
|
8544
|
-
|
|
8545
|
-
checkInt(this, value, offset, byteLength, limit - 1, -limit);
|
|
8546
|
-
}
|
|
8547
|
-
|
|
8548
|
-
var i = 0;
|
|
8549
|
-
var mul = 1;
|
|
8550
|
-
var sub = 0;
|
|
8551
|
-
this[offset] = value & 0xFF;
|
|
8552
|
-
while (++i < byteLength && (mul *= 0x100)) {
|
|
8553
|
-
if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
|
|
8554
|
-
sub = 1;
|
|
8555
|
-
}
|
|
8556
|
-
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
|
|
8557
|
-
}
|
|
8558
|
-
|
|
8559
|
-
return offset + byteLength
|
|
8560
|
-
};
|
|
8561
|
-
|
|
8562
|
-
Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
|
|
8563
|
-
value = +value;
|
|
8564
|
-
offset = offset | 0;
|
|
8565
|
-
if (!noAssert) {
|
|
8566
|
-
var limit = Math.pow(2, 8 * byteLength - 1);
|
|
8567
|
-
|
|
8568
|
-
checkInt(this, value, offset, byteLength, limit - 1, -limit);
|
|
8569
|
-
}
|
|
8570
|
-
|
|
8571
|
-
var i = byteLength - 1;
|
|
8572
|
-
var mul = 1;
|
|
8573
|
-
var sub = 0;
|
|
8574
|
-
this[offset + i] = value & 0xFF;
|
|
8575
|
-
while (--i >= 0 && (mul *= 0x100)) {
|
|
8576
|
-
if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
|
|
8577
|
-
sub = 1;
|
|
8578
|
-
}
|
|
8579
|
-
this[offset + i] = ((value / mul) >> 0) - sub & 0xFF;
|
|
8580
|
-
}
|
|
8581
|
-
|
|
8582
|
-
return offset + byteLength
|
|
8583
|
-
};
|
|
8584
|
-
|
|
8585
|
-
Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
|
|
8586
|
-
value = +value;
|
|
8587
|
-
offset = offset | 0;
|
|
8588
|
-
if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -128);
|
|
8589
|
-
if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
|
|
8590
|
-
if (value < 0) value = 0xff + value + 1;
|
|
8591
|
-
this[offset] = (value & 0xff);
|
|
8592
|
-
return offset + 1
|
|
8593
|
-
};
|
|
8594
|
-
|
|
8595
|
-
Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
|
|
8596
|
-
value = +value;
|
|
8597
|
-
offset = offset | 0;
|
|
8598
|
-
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
|
|
8599
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8600
|
-
this[offset] = (value & 0xff);
|
|
8601
|
-
this[offset + 1] = (value >>> 8);
|
|
8602
|
-
} else {
|
|
8603
|
-
objectWriteUInt16(this, value, offset, true);
|
|
8604
|
-
}
|
|
8605
|
-
return offset + 2
|
|
8606
|
-
};
|
|
8607
|
-
|
|
8608
|
-
Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
|
|
8609
|
-
value = +value;
|
|
8610
|
-
offset = offset | 0;
|
|
8611
|
-
if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -32768);
|
|
8612
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8613
|
-
this[offset] = (value >>> 8);
|
|
8614
|
-
this[offset + 1] = (value & 0xff);
|
|
8615
|
-
} else {
|
|
8616
|
-
objectWriteUInt16(this, value, offset, false);
|
|
8617
|
-
}
|
|
8618
|
-
return offset + 2
|
|
8619
|
-
};
|
|
8620
|
-
|
|
8621
|
-
Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
|
|
8622
|
-
value = +value;
|
|
8623
|
-
offset = offset | 0;
|
|
8624
|
-
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
|
|
8625
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8626
|
-
this[offset] = (value & 0xff);
|
|
8627
|
-
this[offset + 1] = (value >>> 8);
|
|
8628
|
-
this[offset + 2] = (value >>> 16);
|
|
8629
|
-
this[offset + 3] = (value >>> 24);
|
|
8630
|
-
} else {
|
|
8631
|
-
objectWriteUInt32(this, value, offset, true);
|
|
8632
|
-
}
|
|
8633
|
-
return offset + 4
|
|
8634
|
-
};
|
|
8635
|
-
|
|
8636
|
-
Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
|
|
8637
|
-
value = +value;
|
|
8638
|
-
offset = offset | 0;
|
|
8639
|
-
if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -2147483648);
|
|
8640
|
-
if (value < 0) value = 0xffffffff + value + 1;
|
|
8641
|
-
if (Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8642
|
-
this[offset] = (value >>> 24);
|
|
8643
|
-
this[offset + 1] = (value >>> 16);
|
|
8644
|
-
this[offset + 2] = (value >>> 8);
|
|
8645
|
-
this[offset + 3] = (value & 0xff);
|
|
8646
|
-
} else {
|
|
8647
|
-
objectWriteUInt32(this, value, offset, false);
|
|
8648
|
-
}
|
|
8649
|
-
return offset + 4
|
|
8650
|
-
};
|
|
8651
|
-
|
|
8652
|
-
function checkIEEE754 (buf, value, offset, ext, max, min) {
|
|
8653
|
-
if (offset + ext > buf.length) throw new RangeError('Index out of range')
|
|
8654
|
-
if (offset < 0) throw new RangeError('Index out of range')
|
|
8655
|
-
}
|
|
8656
|
-
|
|
8657
|
-
function writeFloat (buf, value, offset, littleEndian, noAssert) {
|
|
8658
|
-
if (!noAssert) {
|
|
8659
|
-
checkIEEE754(buf, value, offset, 4);
|
|
8660
|
-
}
|
|
8661
|
-
write(buf, value, offset, littleEndian, 23, 4);
|
|
8662
|
-
return offset + 4
|
|
8663
|
-
}
|
|
8664
|
-
|
|
8665
|
-
Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
|
|
8666
|
-
return writeFloat(this, value, offset, true, noAssert)
|
|
8667
|
-
};
|
|
8668
|
-
|
|
8669
|
-
Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
|
|
8670
|
-
return writeFloat(this, value, offset, false, noAssert)
|
|
8671
|
-
};
|
|
8672
|
-
|
|
8673
|
-
function writeDouble (buf, value, offset, littleEndian, noAssert) {
|
|
8674
|
-
if (!noAssert) {
|
|
8675
|
-
checkIEEE754(buf, value, offset, 8);
|
|
8676
|
-
}
|
|
8677
|
-
write(buf, value, offset, littleEndian, 52, 8);
|
|
8678
|
-
return offset + 8
|
|
8679
|
-
}
|
|
8680
|
-
|
|
8681
|
-
Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
|
|
8682
|
-
return writeDouble(this, value, offset, true, noAssert)
|
|
8683
|
-
};
|
|
8684
|
-
|
|
8685
|
-
Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
|
|
8686
|
-
return writeDouble(this, value, offset, false, noAssert)
|
|
8687
|
-
};
|
|
8688
|
-
|
|
8689
|
-
// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
|
|
8690
|
-
Buffer.prototype.copy = function copy (target, targetStart, start, end) {
|
|
8691
|
-
if (!start) start = 0;
|
|
8692
|
-
if (!end && end !== 0) end = this.length;
|
|
8693
|
-
if (targetStart >= target.length) targetStart = target.length;
|
|
8694
|
-
if (!targetStart) targetStart = 0;
|
|
8695
|
-
if (end > 0 && end < start) end = start;
|
|
8696
|
-
|
|
8697
|
-
// Copy 0 bytes; we're done
|
|
8698
|
-
if (end === start) return 0
|
|
8699
|
-
if (target.length === 0 || this.length === 0) return 0
|
|
8700
|
-
|
|
8701
|
-
// Fatal error conditions
|
|
8702
|
-
if (targetStart < 0) {
|
|
8703
|
-
throw new RangeError('targetStart out of bounds')
|
|
8704
|
-
}
|
|
8705
|
-
if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
|
|
8706
|
-
if (end < 0) throw new RangeError('sourceEnd out of bounds')
|
|
8707
|
-
|
|
8708
|
-
// Are we oob?
|
|
8709
|
-
if (end > this.length) end = this.length;
|
|
8710
|
-
if (target.length - targetStart < end - start) {
|
|
8711
|
-
end = target.length - targetStart + start;
|
|
8712
|
-
}
|
|
8713
|
-
|
|
8714
|
-
var len = end - start;
|
|
8715
|
-
var i;
|
|
8716
|
-
|
|
8717
|
-
if (this === target && start < targetStart && targetStart < end) {
|
|
8718
|
-
// descending copy from end
|
|
8719
|
-
for (i = len - 1; i >= 0; --i) {
|
|
8720
|
-
target[i + targetStart] = this[i + start];
|
|
8721
|
-
}
|
|
8722
|
-
} else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
|
|
8723
|
-
// ascending copy from start
|
|
8724
|
-
for (i = 0; i < len; ++i) {
|
|
8725
|
-
target[i + targetStart] = this[i + start];
|
|
8726
|
-
}
|
|
8727
|
-
} else {
|
|
8728
|
-
Uint8Array.prototype.set.call(
|
|
8729
|
-
target,
|
|
8730
|
-
this.subarray(start, start + len),
|
|
8731
|
-
targetStart
|
|
8732
|
-
);
|
|
8733
|
-
}
|
|
8734
|
-
|
|
8735
|
-
return len
|
|
8736
|
-
};
|
|
8737
|
-
|
|
8738
|
-
// Usage:
|
|
8739
|
-
// buffer.fill(number[, offset[, end]])
|
|
8740
|
-
// buffer.fill(buffer[, offset[, end]])
|
|
8741
|
-
// buffer.fill(string[, offset[, end]][, encoding])
|
|
8742
|
-
Buffer.prototype.fill = function fill (val, start, end, encoding) {
|
|
8743
|
-
// Handle string cases:
|
|
8744
|
-
if (typeof val === 'string') {
|
|
8745
|
-
if (typeof start === 'string') {
|
|
8746
|
-
encoding = start;
|
|
8747
|
-
start = 0;
|
|
8748
|
-
end = this.length;
|
|
8749
|
-
} else if (typeof end === 'string') {
|
|
8750
|
-
encoding = end;
|
|
8751
|
-
end = this.length;
|
|
8752
|
-
}
|
|
8753
|
-
if (val.length === 1) {
|
|
8754
|
-
var code = val.charCodeAt(0);
|
|
8755
|
-
if (code < 256) {
|
|
8756
|
-
val = code;
|
|
8757
|
-
}
|
|
8758
|
-
}
|
|
8759
|
-
if (encoding !== undefined && typeof encoding !== 'string') {
|
|
8760
|
-
throw new TypeError('encoding must be a string')
|
|
8761
|
-
}
|
|
8762
|
-
if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
|
|
8763
|
-
throw new TypeError('Unknown encoding: ' + encoding)
|
|
8764
|
-
}
|
|
8765
|
-
} else if (typeof val === 'number') {
|
|
8766
|
-
val = val & 255;
|
|
8767
|
-
}
|
|
8768
|
-
|
|
8769
|
-
// Invalid ranges are not set to a default, so can range check early.
|
|
8770
|
-
if (start < 0 || this.length < start || this.length < end) {
|
|
8771
|
-
throw new RangeError('Out of range index')
|
|
8772
|
-
}
|
|
8773
|
-
|
|
8774
|
-
if (end <= start) {
|
|
8775
|
-
return this
|
|
8776
|
-
}
|
|
8777
|
-
|
|
8778
|
-
start = start >>> 0;
|
|
8779
|
-
end = end === undefined ? this.length : end >>> 0;
|
|
8780
|
-
|
|
8781
|
-
if (!val) val = 0;
|
|
8782
|
-
|
|
8783
|
-
var i;
|
|
8784
|
-
if (typeof val === 'number') {
|
|
8785
|
-
for (i = start; i < end; ++i) {
|
|
8786
|
-
this[i] = val;
|
|
8787
|
-
}
|
|
8788
|
-
} else {
|
|
8789
|
-
var bytes = internalIsBuffer(val)
|
|
8790
|
-
? val
|
|
8791
|
-
: utf8ToBytes(new Buffer(val, encoding).toString());
|
|
8792
|
-
var len = bytes.length;
|
|
8793
|
-
for (i = 0; i < end - start; ++i) {
|
|
8794
|
-
this[i + start] = bytes[i % len];
|
|
8795
|
-
}
|
|
8796
|
-
}
|
|
8797
|
-
|
|
8798
|
-
return this
|
|
8799
|
-
};
|
|
8800
|
-
|
|
8801
|
-
// HELPER FUNCTIONS
|
|
8802
|
-
// ================
|
|
8803
|
-
|
|
8804
|
-
var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
|
|
8805
|
-
|
|
8806
|
-
function base64clean (str) {
|
|
8807
|
-
// Node strips out invalid characters like \n and \t from the string, base64-js does not
|
|
8808
|
-
str = stringtrim(str).replace(INVALID_BASE64_RE, '');
|
|
8809
|
-
// Node converts strings with length < 2 to ''
|
|
8810
|
-
if (str.length < 2) return ''
|
|
8811
|
-
// Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
|
|
8812
|
-
while (str.length % 4 !== 0) {
|
|
8813
|
-
str = str + '=';
|
|
8814
|
-
}
|
|
8815
|
-
return str
|
|
8816
|
-
}
|
|
8817
|
-
|
|
8818
|
-
function stringtrim (str) {
|
|
8819
|
-
if (str.trim) return str.trim()
|
|
8820
|
-
return str.replace(/^\s+|\s+$/g, '')
|
|
8821
|
-
}
|
|
8822
|
-
|
|
8823
|
-
function toHex (n) {
|
|
8824
|
-
if (n < 16) return '0' + n.toString(16)
|
|
8825
|
-
return n.toString(16)
|
|
8826
|
-
}
|
|
8827
|
-
|
|
8828
|
-
function utf8ToBytes (string, units) {
|
|
8829
|
-
units = units || Infinity;
|
|
8830
|
-
var codePoint;
|
|
8831
|
-
var length = string.length;
|
|
8832
|
-
var leadSurrogate = null;
|
|
8833
|
-
var bytes = [];
|
|
8834
|
-
|
|
8835
|
-
for (var i = 0; i < length; ++i) {
|
|
8836
|
-
codePoint = string.charCodeAt(i);
|
|
8837
|
-
|
|
8838
|
-
// is surrogate component
|
|
8839
|
-
if (codePoint > 0xD7FF && codePoint < 0xE000) {
|
|
8840
|
-
// last char was a lead
|
|
8841
|
-
if (!leadSurrogate) {
|
|
8842
|
-
// no lead yet
|
|
8843
|
-
if (codePoint > 0xDBFF) {
|
|
8844
|
-
// unexpected trail
|
|
8845
|
-
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
|
|
8846
|
-
continue
|
|
8847
|
-
} else if (i + 1 === length) {
|
|
8848
|
-
// unpaired lead
|
|
8849
|
-
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
|
|
8850
|
-
continue
|
|
8851
|
-
}
|
|
8852
|
-
|
|
8853
|
-
// valid lead
|
|
8854
|
-
leadSurrogate = codePoint;
|
|
8855
|
-
|
|
8856
|
-
continue
|
|
8857
|
-
}
|
|
8858
|
-
|
|
8859
|
-
// 2 leads in a row
|
|
8860
|
-
if (codePoint < 0xDC00) {
|
|
8861
|
-
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
|
|
8862
|
-
leadSurrogate = codePoint;
|
|
8863
|
-
continue
|
|
8864
|
-
}
|
|
8865
|
-
|
|
8866
|
-
// valid surrogate pair
|
|
8867
|
-
codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
|
|
8868
|
-
} else if (leadSurrogate) {
|
|
8869
|
-
// valid bmp char, but last char was a lead
|
|
8870
|
-
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
|
|
8871
|
-
}
|
|
8872
|
-
|
|
8873
|
-
leadSurrogate = null;
|
|
8874
|
-
|
|
8875
|
-
// encode utf8
|
|
8876
|
-
if (codePoint < 0x80) {
|
|
8877
|
-
if ((units -= 1) < 0) break
|
|
8878
|
-
bytes.push(codePoint);
|
|
8879
|
-
} else if (codePoint < 0x800) {
|
|
8880
|
-
if ((units -= 2) < 0) break
|
|
8881
|
-
bytes.push(
|
|
8882
|
-
codePoint >> 0x6 | 0xC0,
|
|
8883
|
-
codePoint & 0x3F | 0x80
|
|
8884
|
-
);
|
|
8885
|
-
} else if (codePoint < 0x10000) {
|
|
8886
|
-
if ((units -= 3) < 0) break
|
|
8887
|
-
bytes.push(
|
|
8888
|
-
codePoint >> 0xC | 0xE0,
|
|
8889
|
-
codePoint >> 0x6 & 0x3F | 0x80,
|
|
8890
|
-
codePoint & 0x3F | 0x80
|
|
8891
|
-
);
|
|
8892
|
-
} else if (codePoint < 0x110000) {
|
|
8893
|
-
if ((units -= 4) < 0) break
|
|
8894
|
-
bytes.push(
|
|
8895
|
-
codePoint >> 0x12 | 0xF0,
|
|
8896
|
-
codePoint >> 0xC & 0x3F | 0x80,
|
|
8897
|
-
codePoint >> 0x6 & 0x3F | 0x80,
|
|
8898
|
-
codePoint & 0x3F | 0x80
|
|
8899
|
-
);
|
|
8900
|
-
} else {
|
|
8901
|
-
throw new Error('Invalid code point')
|
|
8902
|
-
}
|
|
8903
|
-
}
|
|
8904
|
-
|
|
8905
|
-
return bytes
|
|
8906
|
-
}
|
|
8907
|
-
|
|
8908
|
-
function asciiToBytes (str) {
|
|
8909
|
-
var byteArray = [];
|
|
8910
|
-
for (var i = 0; i < str.length; ++i) {
|
|
8911
|
-
// Node's code seems to be doing this and not & 0x7F..
|
|
8912
|
-
byteArray.push(str.charCodeAt(i) & 0xFF);
|
|
8913
|
-
}
|
|
8914
|
-
return byteArray
|
|
8915
|
-
}
|
|
8916
|
-
|
|
8917
|
-
function utf16leToBytes (str, units) {
|
|
8918
|
-
var c, hi, lo;
|
|
8919
|
-
var byteArray = [];
|
|
8920
|
-
for (var i = 0; i < str.length; ++i) {
|
|
8921
|
-
if ((units -= 2) < 0) break
|
|
8922
|
-
|
|
8923
|
-
c = str.charCodeAt(i);
|
|
8924
|
-
hi = c >> 8;
|
|
8925
|
-
lo = c % 256;
|
|
8926
|
-
byteArray.push(lo);
|
|
8927
|
-
byteArray.push(hi);
|
|
8928
|
-
}
|
|
8929
|
-
|
|
8930
|
-
return byteArray
|
|
8931
|
-
}
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
function base64ToBytes (str) {
|
|
8935
|
-
return toByteArray(base64clean(str))
|
|
8936
|
-
}
|
|
8937
|
-
|
|
8938
|
-
function blitBuffer (src, dst, offset, length) {
|
|
8939
|
-
for (var i = 0; i < length; ++i) {
|
|
8940
|
-
if ((i + offset >= dst.length) || (i >= src.length)) break
|
|
8941
|
-
dst[i + offset] = src[i];
|
|
8942
|
-
}
|
|
8943
|
-
return i
|
|
8944
|
-
}
|
|
8945
|
-
|
|
8946
|
-
function isnan (val) {
|
|
8947
|
-
return val !== val // eslint-disable-line no-self-compare
|
|
8948
|
-
}
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
// the following is from is-buffer, also by Feross Aboukhadijeh and with same lisence
|
|
8952
|
-
// The _isBuffer check is for Safari 5-7 support, because it's missing
|
|
8953
|
-
// Object.prototype.constructor. Remove this eventually
|
|
8954
|
-
function isBuffer(obj) {
|
|
8955
|
-
return obj != null && (!!obj._isBuffer || isFastBuffer(obj) || isSlowBuffer(obj))
|
|
8956
|
-
}
|
|
8957
|
-
|
|
8958
|
-
function isFastBuffer (obj) {
|
|
8959
|
-
return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
|
|
8960
|
-
}
|
|
8961
|
-
|
|
8962
|
-
// For Node v0.10 support. Remove this eventually.
|
|
8963
|
-
function isSlowBuffer (obj) {
|
|
8964
|
-
return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isFastBuffer(obj.slice(0, 0))
|
|
8965
|
-
}
|
|
8966
|
-
|
|
8967
|
-
/**
|
|
8968
|
-
* base64.ts
|
|
8969
|
-
*
|
|
8970
|
-
* Licensed under the BSD 3-Clause License.
|
|
8971
|
-
* http://opensource.org/licenses/BSD-3-Clause
|
|
8972
|
-
*
|
|
8973
|
-
* References:
|
|
8974
|
-
* http://en.wikipedia.org/wiki/Base64
|
|
8975
|
-
*
|
|
8976
|
-
* @author Dan Kogai (https://github.com/dankogai)
|
|
8977
|
-
*/
|
|
8978
|
-
const version = '3.7.7';
|
|
8979
|
-
/**
|
|
8980
|
-
* @deprecated use lowercase `version`.
|
|
8981
|
-
*/
|
|
8982
|
-
const VERSION = version;
|
|
8983
|
-
const _hasBuffer = typeof Buffer === 'function';
|
|
8984
|
-
const _TD = typeof TextDecoder === 'function' ? new TextDecoder() : undefined;
|
|
8985
|
-
const _TE = typeof TextEncoder === 'function' ? new TextEncoder() : undefined;
|
|
8986
|
-
const b64ch = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
|
|
8987
|
-
const b64chs = Array.prototype.slice.call(b64ch);
|
|
8988
|
-
const b64tab = ((a) => {
|
|
8989
|
-
let tab = {};
|
|
8990
|
-
a.forEach((c, i) => tab[c] = i);
|
|
8991
|
-
return tab;
|
|
8992
|
-
})(b64chs);
|
|
8993
|
-
const b64re = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;
|
|
8994
|
-
const _fromCC = String.fromCharCode.bind(String);
|
|
8995
|
-
const _U8Afrom = typeof Uint8Array.from === 'function'
|
|
8996
|
-
? Uint8Array.from.bind(Uint8Array)
|
|
8997
|
-
: (it) => new Uint8Array(Array.prototype.slice.call(it, 0));
|
|
8998
|
-
const _mkUriSafe = (src) => src
|
|
8999
|
-
.replace(/=/g, '').replace(/[+\/]/g, (m0) => m0 == '+' ? '-' : '_');
|
|
9000
|
-
const _tidyB64 = (s) => s.replace(/[^A-Za-z0-9\+\/]/g, '');
|
|
9001
|
-
/**
|
|
9002
|
-
* polyfill version of `btoa`
|
|
9003
|
-
*/
|
|
9004
|
-
const btoaPolyfill = (bin) => {
|
|
9005
|
-
// console.log('polyfilled');
|
|
9006
|
-
let u32, c0, c1, c2, asc = '';
|
|
9007
|
-
const pad = bin.length % 3;
|
|
9008
|
-
for (let i = 0; i < bin.length;) {
|
|
9009
|
-
if ((c0 = bin.charCodeAt(i++)) > 255 ||
|
|
9010
|
-
(c1 = bin.charCodeAt(i++)) > 255 ||
|
|
9011
|
-
(c2 = bin.charCodeAt(i++)) > 255)
|
|
9012
|
-
throw new TypeError('invalid character found');
|
|
9013
|
-
u32 = (c0 << 16) | (c1 << 8) | c2;
|
|
9014
|
-
asc += b64chs[u32 >> 18 & 63]
|
|
9015
|
-
+ b64chs[u32 >> 12 & 63]
|
|
9016
|
-
+ b64chs[u32 >> 6 & 63]
|
|
9017
|
-
+ b64chs[u32 & 63];
|
|
9018
|
-
}
|
|
9019
|
-
return pad ? asc.slice(0, pad - 3) + "===".substring(pad) : asc;
|
|
9020
|
-
};
|
|
9021
|
-
/**
|
|
9022
|
-
* does what `window.btoa` of web browsers do.
|
|
9023
|
-
* @param {String} bin binary string
|
|
9024
|
-
* @returns {string} Base64-encoded string
|
|
9025
|
-
*/
|
|
9026
|
-
const _btoa = typeof btoa === 'function' ? (bin) => btoa(bin)
|
|
9027
|
-
: _hasBuffer ? (bin) => Buffer.from(bin, 'binary').toString('base64')
|
|
9028
|
-
: btoaPolyfill;
|
|
9029
|
-
const _fromUint8Array = _hasBuffer
|
|
9030
|
-
? (u8a) => Buffer.from(u8a).toString('base64')
|
|
9031
|
-
: (u8a) => {
|
|
9032
|
-
// cf. https://stackoverflow.com/questions/12710001/how-to-convert-uint8-array-to-base64-encoded-string/12713326#12713326
|
|
9033
|
-
const maxargs = 0x1000;
|
|
9034
|
-
let strs = [];
|
|
9035
|
-
for (let i = 0, l = u8a.length; i < l; i += maxargs) {
|
|
9036
|
-
strs.push(_fromCC.apply(null, u8a.subarray(i, i + maxargs)));
|
|
9037
|
-
}
|
|
9038
|
-
return _btoa(strs.join(''));
|
|
9039
|
-
};
|
|
9040
|
-
/**
|
|
9041
|
-
* converts a Uint8Array to a Base64 string.
|
|
9042
|
-
* @param {boolean} [urlsafe] URL-and-filename-safe a la RFC4648 §5
|
|
9043
|
-
* @returns {string} Base64 string
|
|
9044
|
-
*/
|
|
9045
|
-
const fromUint8Array = (u8a, urlsafe = false) => urlsafe ? _mkUriSafe(_fromUint8Array(u8a)) : _fromUint8Array(u8a);
|
|
9046
|
-
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
9047
|
-
// const utob = (src: string) => unescape(encodeURIComponent(src));
|
|
9048
|
-
// reverting good old fationed regexp
|
|
9049
|
-
const cb_utob = (c) => {
|
|
9050
|
-
if (c.length < 2) {
|
|
9051
|
-
var cc = c.charCodeAt(0);
|
|
9052
|
-
return cc < 0x80 ? c
|
|
9053
|
-
: cc < 0x800 ? (_fromCC(0xc0 | (cc >>> 6))
|
|
9054
|
-
+ _fromCC(0x80 | (cc & 0x3f)))
|
|
9055
|
-
: (_fromCC(0xe0 | ((cc >>> 12) & 0x0f))
|
|
9056
|
-
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
9057
|
-
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
9058
|
-
}
|
|
9059
|
-
else {
|
|
9060
|
-
var cc = 0x10000
|
|
9061
|
-
+ (c.charCodeAt(0) - 0xD800) * 0x400
|
|
9062
|
-
+ (c.charCodeAt(1) - 0xDC00);
|
|
9063
|
-
return (_fromCC(0xf0 | ((cc >>> 18) & 0x07))
|
|
9064
|
-
+ _fromCC(0x80 | ((cc >>> 12) & 0x3f))
|
|
9065
|
-
+ _fromCC(0x80 | ((cc >>> 6) & 0x3f))
|
|
9066
|
-
+ _fromCC(0x80 | (cc & 0x3f)));
|
|
9067
|
-
}
|
|
9068
|
-
};
|
|
9069
|
-
const re_utob = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g;
|
|
9070
|
-
/**
|
|
9071
|
-
* @deprecated should have been internal use only.
|
|
9072
|
-
* @param {string} src UTF-8 string
|
|
9073
|
-
* @returns {string} UTF-16 string
|
|
9074
|
-
*/
|
|
9075
|
-
const utob = (u) => u.replace(re_utob, cb_utob);
|
|
9076
|
-
//
|
|
9077
|
-
const _encode = _hasBuffer
|
|
9078
|
-
? (s) => Buffer.from(s, 'utf8').toString('base64')
|
|
9079
|
-
: _TE
|
|
9080
|
-
? (s) => _fromUint8Array(_TE.encode(s))
|
|
9081
|
-
: (s) => _btoa(utob(s));
|
|
9082
|
-
/**
|
|
9083
|
-
* converts a UTF-8-encoded string to a Base64 string.
|
|
9084
|
-
* @param {boolean} [urlsafe] if `true` make the result URL-safe
|
|
9085
|
-
* @returns {string} Base64 string
|
|
9086
|
-
*/
|
|
9087
|
-
const encode$1 = (src, urlsafe = false) => urlsafe
|
|
9088
|
-
? _mkUriSafe(_encode(src))
|
|
9089
|
-
: _encode(src);
|
|
9090
|
-
/**
|
|
9091
|
-
* converts a UTF-8-encoded string to URL-safe Base64 RFC4648 §5.
|
|
9092
|
-
* @returns {string} Base64 string
|
|
9093
|
-
*/
|
|
9094
|
-
const encodeURI = (src) => encode$1(src, true);
|
|
9095
|
-
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
9096
|
-
// const btou = (src: string) => decodeURIComponent(escape(src));
|
|
9097
|
-
// reverting good old fationed regexp
|
|
9098
|
-
const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
9099
|
-
const cb_btou = (cccc) => {
|
|
9100
|
-
switch (cccc.length) {
|
|
9101
|
-
case 4:
|
|
9102
|
-
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
9103
|
-
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
9104
|
-
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
9105
|
-
| (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
|
|
9106
|
-
return (_fromCC((offset >>> 10) + 0xD800)
|
|
9107
|
-
+ _fromCC((offset & 0x3FF) + 0xDC00));
|
|
9108
|
-
case 3:
|
|
9109
|
-
return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
|
|
9110
|
-
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
9111
|
-
| (0x3f & cccc.charCodeAt(2)));
|
|
9112
|
-
default:
|
|
9113
|
-
return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
|
|
9114
|
-
| (0x3f & cccc.charCodeAt(1)));
|
|
9115
|
-
}
|
|
7079
|
+
const encodeURI = (src) => encode$1(src, true);
|
|
7080
|
+
// This trick is found broken https://github.com/dankogai/js-base64/issues/130
|
|
7081
|
+
// const btou = (src: string) => decodeURIComponent(escape(src));
|
|
7082
|
+
// reverting good old fationed regexp
|
|
7083
|
+
const re_btou = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g;
|
|
7084
|
+
const cb_btou = (cccc) => {
|
|
7085
|
+
switch (cccc.length) {
|
|
7086
|
+
case 4:
|
|
7087
|
+
var cp = ((0x07 & cccc.charCodeAt(0)) << 18)
|
|
7088
|
+
| ((0x3f & cccc.charCodeAt(1)) << 12)
|
|
7089
|
+
| ((0x3f & cccc.charCodeAt(2)) << 6)
|
|
7090
|
+
| (0x3f & cccc.charCodeAt(3)), offset = cp - 0x10000;
|
|
7091
|
+
return (_fromCC((offset >>> 10) + 0xD800)
|
|
7092
|
+
+ _fromCC((offset & 0x3FF) + 0xDC00));
|
|
7093
|
+
case 3:
|
|
7094
|
+
return _fromCC(((0x0f & cccc.charCodeAt(0)) << 12)
|
|
7095
|
+
| ((0x3f & cccc.charCodeAt(1)) << 6)
|
|
7096
|
+
| (0x3f & cccc.charCodeAt(2)));
|
|
7097
|
+
default:
|
|
7098
|
+
return _fromCC(((0x1f & cccc.charCodeAt(0)) << 6)
|
|
7099
|
+
| (0x3f & cccc.charCodeAt(1)));
|
|
7100
|
+
}
|
|
9116
7101
|
};
|
|
9117
7102
|
/**
|
|
9118
7103
|
* @deprecated should have been internal use only.
|
|
@@ -9129,17 +7114,24 @@ const atobPolyfill = (asc) => {
|
|
|
9129
7114
|
if (!b64re.test(asc))
|
|
9130
7115
|
throw new TypeError('malformed base64.');
|
|
9131
7116
|
asc += '=='.slice(2 - (asc.length & 3));
|
|
9132
|
-
let u24,
|
|
7117
|
+
let u24, r1, r2;
|
|
7118
|
+
let binArray = []; // use array to avoid minor gc in loop
|
|
9133
7119
|
for (let i = 0; i < asc.length;) {
|
|
9134
7120
|
u24 = b64tab[asc.charAt(i++)] << 18
|
|
9135
7121
|
| b64tab[asc.charAt(i++)] << 12
|
|
9136
7122
|
| (r1 = b64tab[asc.charAt(i++)]) << 6
|
|
9137
7123
|
| (r2 = b64tab[asc.charAt(i++)]);
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
7124
|
+
if (r1 === 64) {
|
|
7125
|
+
binArray.push(_fromCC(u24 >> 16 & 255));
|
|
7126
|
+
}
|
|
7127
|
+
else if (r2 === 64) {
|
|
7128
|
+
binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255));
|
|
7129
|
+
}
|
|
7130
|
+
else {
|
|
7131
|
+
binArray.push(_fromCC(u24 >> 16 & 255, u24 >> 8 & 255, u24 & 255));
|
|
7132
|
+
}
|
|
9141
7133
|
}
|
|
9142
|
-
return
|
|
7134
|
+
return binArray.join('');
|
|
9143
7135
|
};
|
|
9144
7136
|
/**
|
|
9145
7137
|
* does what `window.atob` of web browsers do.
|
|
@@ -9147,22 +7139,18 @@ const atobPolyfill = (asc) => {
|
|
|
9147
7139
|
* @returns {string} binary string
|
|
9148
7140
|
*/
|
|
9149
7141
|
const _atob = typeof atob === 'function' ? (asc) => atob(_tidyB64(asc))
|
|
9150
|
-
:
|
|
9151
|
-
: atobPolyfill;
|
|
7142
|
+
: atobPolyfill;
|
|
9152
7143
|
//
|
|
9153
|
-
const _toUint8Array =
|
|
9154
|
-
? (a) => _U8Afrom(
|
|
9155
|
-
: (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
|
|
7144
|
+
const _toUint8Array = typeof Uint8Array.fromBase64 === 'function'
|
|
7145
|
+
? (a) => Uint8Array.fromBase64(a) : (a) => _U8Afrom(_atob(a).split('').map(c => c.charCodeAt(0)));
|
|
9156
7146
|
/**
|
|
9157
7147
|
* converts a Base64 string to a Uint8Array.
|
|
9158
7148
|
*/
|
|
9159
7149
|
const toUint8Array = (a) => _toUint8Array(_unURI(a));
|
|
9160
7150
|
//
|
|
9161
|
-
const _decode =
|
|
9162
|
-
? (a) =>
|
|
9163
|
-
:
|
|
9164
|
-
? (a) => _TD.decode(_toUint8Array(a))
|
|
9165
|
-
: (a) => btou(_atob(a));
|
|
7151
|
+
const _decode = _TD
|
|
7152
|
+
? (a) => _TD.decode(_toUint8Array(a))
|
|
7153
|
+
: (a) => btou(_atob(a));
|
|
9166
7154
|
const _unURI = (a) => _tidyB64(a.replace(/[-_]/g, (m0) => m0 == '-' ? '+' : '/'));
|
|
9167
7155
|
/**
|
|
9168
7156
|
* converts a Base64 string to a UTF-8 string.
|
|
@@ -12776,6 +10764,10 @@ function prettyBytes(number, options) {
|
|
|
12776
10764
|
return prefix + numberString + separator + unit;
|
|
12777
10765
|
}
|
|
12778
10766
|
|
|
10767
|
+
var global$1 = (typeof global !== "undefined" ? global :
|
|
10768
|
+
typeof self !== "undefined" ? self :
|
|
10769
|
+
typeof window !== "undefined" ? window : {});
|
|
10770
|
+
|
|
12779
10771
|
var env = {};
|
|
12780
10772
|
|
|
12781
10773
|
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
|
|
@@ -12792,252 +10784,279 @@ var browser$1 = {
|
|
|
12792
10784
|
|
|
12793
10785
|
var reactIs$3 = {exports: {}};
|
|
12794
10786
|
|
|
12795
|
-
var
|
|
10787
|
+
var reactIs_production = {};
|
|
12796
10788
|
|
|
12797
10789
|
/**
|
|
12798
10790
|
* @license React
|
|
12799
|
-
* react-is.production.
|
|
10791
|
+
* react-is.production.js
|
|
12800
10792
|
*
|
|
12801
|
-
* Copyright (c)
|
|
10793
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12802
10794
|
*
|
|
12803
10795
|
* This source code is licensed under the MIT license found in the
|
|
12804
10796
|
* LICENSE file in the root directory of this source tree.
|
|
12805
10797
|
*/
|
|
12806
10798
|
|
|
12807
|
-
var
|
|
12808
|
-
|
|
12809
|
-
function
|
|
12810
|
-
if (
|
|
12811
|
-
|
|
12812
|
-
var
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
hasRequiredReactIs_development$2 = 1;
|
|
12827
|
-
|
|
12828
|
-
if (browser$1.env.NODE_ENV !== "production") {
|
|
12829
|
-
(function() {
|
|
12830
|
-
|
|
12831
|
-
// ATTENTION
|
|
12832
|
-
// When adding new symbols to this file,
|
|
12833
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
12834
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
12835
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
12836
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
12837
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
12838
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
12839
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
12840
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
12841
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
12842
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
12843
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
12844
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
12845
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
12846
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
12847
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
12848
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
12849
|
-
|
|
12850
|
-
// -----------------------------------------------------------------------------
|
|
12851
|
-
|
|
12852
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
12853
|
-
var enableCacheElement = false;
|
|
12854
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
12855
|
-
|
|
12856
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
12857
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
12858
|
-
// issues in DEV builds.
|
|
12859
|
-
|
|
12860
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
12861
|
-
|
|
12862
|
-
var REACT_MODULE_REFERENCE;
|
|
12863
|
-
|
|
12864
|
-
{
|
|
12865
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
12866
|
-
}
|
|
12867
|
-
|
|
12868
|
-
function isValidElementType(type) {
|
|
12869
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
12870
|
-
return true;
|
|
12871
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
12875
|
-
return true;
|
|
12876
|
-
}
|
|
12877
|
-
|
|
12878
|
-
if (typeof type === 'object' && type !== null) {
|
|
12879
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
12880
|
-
// types supported by any Flight configuration anywhere since
|
|
12881
|
-
// we don't know which Flight build this will end up being used
|
|
12882
|
-
// with.
|
|
12883
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
12884
|
-
return true;
|
|
12885
|
-
}
|
|
12886
|
-
}
|
|
12887
|
-
|
|
12888
|
-
return false;
|
|
12889
|
-
}
|
|
12890
|
-
|
|
10799
|
+
var hasRequiredReactIs_production;
|
|
10800
|
+
|
|
10801
|
+
function requireReactIs_production () {
|
|
10802
|
+
if (hasRequiredReactIs_production) return reactIs_production;
|
|
10803
|
+
hasRequiredReactIs_production = 1;
|
|
10804
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
10805
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
10806
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
10807
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
10808
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|
10809
|
+
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
10810
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
10811
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
10812
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
10813
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
10814
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
10815
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
10816
|
+
REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
|
|
10817
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
12891
10818
|
function typeOf(object) {
|
|
12892
|
-
if (
|
|
10819
|
+
if ("object" === typeof object && null !== object) {
|
|
12893
10820
|
var $$typeof = object.$$typeof;
|
|
12894
|
-
|
|
12895
10821
|
switch ($$typeof) {
|
|
12896
10822
|
case REACT_ELEMENT_TYPE:
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
switch (type) {
|
|
10823
|
+
switch (((object = object.type), object)) {
|
|
12900
10824
|
case REACT_FRAGMENT_TYPE:
|
|
12901
10825
|
case REACT_PROFILER_TYPE:
|
|
12902
10826
|
case REACT_STRICT_MODE_TYPE:
|
|
12903
10827
|
case REACT_SUSPENSE_TYPE:
|
|
12904
10828
|
case REACT_SUSPENSE_LIST_TYPE:
|
|
12905
|
-
|
|
12906
|
-
|
|
10829
|
+
case REACT_VIEW_TRANSITION_TYPE:
|
|
10830
|
+
return object;
|
|
12907
10831
|
default:
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
switch ($$typeofType) {
|
|
12911
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
10832
|
+
switch (((object = object && object.$$typeof), object)) {
|
|
12912
10833
|
case REACT_CONTEXT_TYPE:
|
|
12913
10834
|
case REACT_FORWARD_REF_TYPE:
|
|
12914
10835
|
case REACT_LAZY_TYPE:
|
|
12915
10836
|
case REACT_MEMO_TYPE:
|
|
12916
|
-
|
|
12917
|
-
|
|
12918
|
-
|
|
10837
|
+
return object;
|
|
10838
|
+
case REACT_CONSUMER_TYPE:
|
|
10839
|
+
return object;
|
|
12919
10840
|
default:
|
|
12920
10841
|
return $$typeof;
|
|
12921
10842
|
}
|
|
12922
|
-
|
|
12923
10843
|
}
|
|
12924
|
-
|
|
12925
10844
|
case REACT_PORTAL_TYPE:
|
|
12926
10845
|
return $$typeof;
|
|
12927
10846
|
}
|
|
12928
10847
|
}
|
|
12929
|
-
|
|
12930
|
-
return undefined;
|
|
12931
|
-
}
|
|
12932
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
12933
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
12934
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
12935
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
12936
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
12937
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
12938
|
-
var Memo = REACT_MEMO_TYPE;
|
|
12939
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
12940
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
12941
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
12942
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
12943
|
-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
12944
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
12945
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
12946
|
-
|
|
12947
|
-
function isAsyncMode(object) {
|
|
12948
|
-
{
|
|
12949
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
12950
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
12951
|
-
|
|
12952
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
12953
|
-
}
|
|
12954
|
-
}
|
|
12955
|
-
|
|
12956
|
-
return false;
|
|
12957
|
-
}
|
|
12958
|
-
function isConcurrentMode(object) {
|
|
12959
|
-
{
|
|
12960
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
12961
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
12962
|
-
|
|
12963
|
-
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
12964
|
-
}
|
|
12965
|
-
}
|
|
12966
|
-
|
|
12967
|
-
return false;
|
|
12968
10848
|
}
|
|
12969
|
-
|
|
10849
|
+
reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
10850
|
+
reactIs_production.ContextProvider = REACT_CONTEXT_TYPE;
|
|
10851
|
+
reactIs_production.Element = REACT_ELEMENT_TYPE;
|
|
10852
|
+
reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
10853
|
+
reactIs_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
10854
|
+
reactIs_production.Lazy = REACT_LAZY_TYPE;
|
|
10855
|
+
reactIs_production.Memo = REACT_MEMO_TYPE;
|
|
10856
|
+
reactIs_production.Portal = REACT_PORTAL_TYPE;
|
|
10857
|
+
reactIs_production.Profiler = REACT_PROFILER_TYPE;
|
|
10858
|
+
reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
10859
|
+
reactIs_production.Suspense = REACT_SUSPENSE_TYPE;
|
|
10860
|
+
reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
10861
|
+
reactIs_production.isContextConsumer = function (object) {
|
|
10862
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
10863
|
+
};
|
|
10864
|
+
reactIs_production.isContextProvider = function (object) {
|
|
12970
10865
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
12971
|
-
}
|
|
12972
|
-
function
|
|
12973
|
-
return
|
|
12974
|
-
|
|
12975
|
-
|
|
12976
|
-
|
|
12977
|
-
|
|
12978
|
-
|
|
10866
|
+
};
|
|
10867
|
+
reactIs_production.isElement = function (object) {
|
|
10868
|
+
return (
|
|
10869
|
+
"object" === typeof object &&
|
|
10870
|
+
null !== object &&
|
|
10871
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
10872
|
+
);
|
|
10873
|
+
};
|
|
10874
|
+
reactIs_production.isForwardRef = function (object) {
|
|
12979
10875
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
12980
|
-
}
|
|
12981
|
-
function
|
|
10876
|
+
};
|
|
10877
|
+
reactIs_production.isFragment = function (object) {
|
|
12982
10878
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
12983
|
-
}
|
|
12984
|
-
function
|
|
10879
|
+
};
|
|
10880
|
+
reactIs_production.isLazy = function (object) {
|
|
12985
10881
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
12986
|
-
}
|
|
12987
|
-
function
|
|
10882
|
+
};
|
|
10883
|
+
reactIs_production.isMemo = function (object) {
|
|
12988
10884
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
12989
|
-
}
|
|
12990
|
-
function
|
|
10885
|
+
};
|
|
10886
|
+
reactIs_production.isPortal = function (object) {
|
|
12991
10887
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
12992
|
-
}
|
|
12993
|
-
function
|
|
10888
|
+
};
|
|
10889
|
+
reactIs_production.isProfiler = function (object) {
|
|
12994
10890
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
12995
|
-
}
|
|
12996
|
-
function
|
|
10891
|
+
};
|
|
10892
|
+
reactIs_production.isStrictMode = function (object) {
|
|
12997
10893
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
12998
|
-
}
|
|
12999
|
-
function
|
|
10894
|
+
};
|
|
10895
|
+
reactIs_production.isSuspense = function (object) {
|
|
13000
10896
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
13001
|
-
}
|
|
13002
|
-
function
|
|
10897
|
+
};
|
|
10898
|
+
reactIs_production.isSuspenseList = function (object) {
|
|
13003
10899
|
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
13004
|
-
}
|
|
10900
|
+
};
|
|
10901
|
+
reactIs_production.isValidElementType = function (type) {
|
|
10902
|
+
return "string" === typeof type ||
|
|
10903
|
+
"function" === typeof type ||
|
|
10904
|
+
type === REACT_FRAGMENT_TYPE ||
|
|
10905
|
+
type === REACT_PROFILER_TYPE ||
|
|
10906
|
+
type === REACT_STRICT_MODE_TYPE ||
|
|
10907
|
+
type === REACT_SUSPENSE_TYPE ||
|
|
10908
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
|
10909
|
+
type === REACT_VIEW_TRANSITION_TYPE ||
|
|
10910
|
+
("object" === typeof type &&
|
|
10911
|
+
null !== type &&
|
|
10912
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
|
10913
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
|
10914
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
|
10915
|
+
type.$$typeof === REACT_CONSUMER_TYPE ||
|
|
10916
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
10917
|
+
type.$$typeof === REACT_CLIENT_REFERENCE ||
|
|
10918
|
+
void 0 !== type.getModuleId))
|
|
10919
|
+
? true
|
|
10920
|
+
: false;
|
|
10921
|
+
};
|
|
10922
|
+
reactIs_production.typeOf = typeOf;
|
|
10923
|
+
return reactIs_production;
|
|
10924
|
+
}
|
|
10925
|
+
|
|
10926
|
+
var reactIs_development$2 = {};
|
|
13005
10927
|
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
10928
|
+
var hasRequiredReactIs_development$2;
|
|
10929
|
+
|
|
10930
|
+
function requireReactIs_development$2 () {
|
|
10931
|
+
if (hasRequiredReactIs_development$2) return reactIs_development$2;
|
|
10932
|
+
hasRequiredReactIs_development$2 = 1;
|
|
10933
|
+
"production" !== browser$1.env.NODE_ENV &&
|
|
10934
|
+
(function () {
|
|
10935
|
+
function typeOf(object) {
|
|
10936
|
+
if ("object" === typeof object && null !== object) {
|
|
10937
|
+
var $$typeof = object.$$typeof;
|
|
10938
|
+
switch ($$typeof) {
|
|
10939
|
+
case REACT_ELEMENT_TYPE:
|
|
10940
|
+
switch (((object = object.type), object)) {
|
|
10941
|
+
case REACT_FRAGMENT_TYPE:
|
|
10942
|
+
case REACT_PROFILER_TYPE:
|
|
10943
|
+
case REACT_STRICT_MODE_TYPE:
|
|
10944
|
+
case REACT_SUSPENSE_TYPE:
|
|
10945
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
10946
|
+
case REACT_VIEW_TRANSITION_TYPE:
|
|
10947
|
+
return object;
|
|
10948
|
+
default:
|
|
10949
|
+
switch (((object = object && object.$$typeof), object)) {
|
|
10950
|
+
case REACT_CONTEXT_TYPE:
|
|
10951
|
+
case REACT_FORWARD_REF_TYPE:
|
|
10952
|
+
case REACT_LAZY_TYPE:
|
|
10953
|
+
case REACT_MEMO_TYPE:
|
|
10954
|
+
return object;
|
|
10955
|
+
case REACT_CONSUMER_TYPE:
|
|
10956
|
+
return object;
|
|
10957
|
+
default:
|
|
10958
|
+
return $$typeof;
|
|
10959
|
+
}
|
|
10960
|
+
}
|
|
10961
|
+
case REACT_PORTAL_TYPE:
|
|
10962
|
+
return $$typeof;
|
|
10963
|
+
}
|
|
10964
|
+
}
|
|
10965
|
+
}
|
|
10966
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
10967
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
10968
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
10969
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
10970
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler"),
|
|
10971
|
+
REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
10972
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
10973
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
10974
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
10975
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
10976
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
10977
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
10978
|
+
REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"),
|
|
10979
|
+
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
10980
|
+
reactIs_development$2.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
10981
|
+
reactIs_development$2.ContextProvider = REACT_CONTEXT_TYPE;
|
|
10982
|
+
reactIs_development$2.Element = REACT_ELEMENT_TYPE;
|
|
10983
|
+
reactIs_development$2.ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
10984
|
+
reactIs_development$2.Fragment = REACT_FRAGMENT_TYPE;
|
|
10985
|
+
reactIs_development$2.Lazy = REACT_LAZY_TYPE;
|
|
10986
|
+
reactIs_development$2.Memo = REACT_MEMO_TYPE;
|
|
10987
|
+
reactIs_development$2.Portal = REACT_PORTAL_TYPE;
|
|
10988
|
+
reactIs_development$2.Profiler = REACT_PROFILER_TYPE;
|
|
10989
|
+
reactIs_development$2.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
10990
|
+
reactIs_development$2.Suspense = REACT_SUSPENSE_TYPE;
|
|
10991
|
+
reactIs_development$2.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
10992
|
+
reactIs_development$2.isContextConsumer = function (object) {
|
|
10993
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
10994
|
+
};
|
|
10995
|
+
reactIs_development$2.isContextProvider = function (object) {
|
|
10996
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
10997
|
+
};
|
|
10998
|
+
reactIs_development$2.isElement = function (object) {
|
|
10999
|
+
return (
|
|
11000
|
+
"object" === typeof object &&
|
|
11001
|
+
null !== object &&
|
|
11002
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
11003
|
+
);
|
|
11004
|
+
};
|
|
11005
|
+
reactIs_development$2.isForwardRef = function (object) {
|
|
11006
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
11007
|
+
};
|
|
11008
|
+
reactIs_development$2.isFragment = function (object) {
|
|
11009
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
11010
|
+
};
|
|
11011
|
+
reactIs_development$2.isLazy = function (object) {
|
|
11012
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
11013
|
+
};
|
|
11014
|
+
reactIs_development$2.isMemo = function (object) {
|
|
11015
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
11016
|
+
};
|
|
11017
|
+
reactIs_development$2.isPortal = function (object) {
|
|
11018
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
11019
|
+
};
|
|
11020
|
+
reactIs_development$2.isProfiler = function (object) {
|
|
11021
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
11022
|
+
};
|
|
11023
|
+
reactIs_development$2.isStrictMode = function (object) {
|
|
11024
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
11025
|
+
};
|
|
11026
|
+
reactIs_development$2.isSuspense = function (object) {
|
|
11027
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
11028
|
+
};
|
|
11029
|
+
reactIs_development$2.isSuspenseList = function (object) {
|
|
11030
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
11031
|
+
};
|
|
11032
|
+
reactIs_development$2.isValidElementType = function (type) {
|
|
11033
|
+
return "string" === typeof type ||
|
|
11034
|
+
"function" === typeof type ||
|
|
11035
|
+
type === REACT_FRAGMENT_TYPE ||
|
|
11036
|
+
type === REACT_PROFILER_TYPE ||
|
|
11037
|
+
type === REACT_STRICT_MODE_TYPE ||
|
|
11038
|
+
type === REACT_SUSPENSE_TYPE ||
|
|
11039
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
|
11040
|
+
type === REACT_VIEW_TRANSITION_TYPE ||
|
|
11041
|
+
("object" === typeof type &&
|
|
11042
|
+
null !== type &&
|
|
11043
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
|
11044
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
|
11045
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
|
11046
|
+
type.$$typeof === REACT_CONSUMER_TYPE ||
|
|
11047
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
11048
|
+
type.$$typeof === REACT_CLIENT_REFERENCE ||
|
|
11049
|
+
void 0 !== type.getModuleId))
|
|
11050
|
+
? true
|
|
11051
|
+
: false;
|
|
11052
|
+
};
|
|
11053
|
+
reactIs_development$2.typeOf = typeOf;
|
|
13034
11054
|
})();
|
|
13035
|
-
}
|
|
13036
11055
|
return reactIs_development$2;
|
|
13037
11056
|
}
|
|
13038
11057
|
|
|
13039
11058
|
if (browser$1.env.NODE_ENV === 'production') {
|
|
13040
|
-
reactIs$3.exports =
|
|
11059
|
+
reactIs$3.exports = requireReactIs_production();
|
|
13041
11060
|
} else {
|
|
13042
11061
|
reactIs$3.exports = requireReactIs_development$2();
|
|
13043
11062
|
}
|
|
@@ -13715,7 +11734,8 @@ function memoize(fn) {
|
|
|
13715
11734
|
};
|
|
13716
11735
|
}
|
|
13717
11736
|
|
|
13718
|
-
|
|
11737
|
+
// eslint-disable-next-line no-undef
|
|
11738
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
13719
11739
|
|
|
13720
11740
|
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
|
13721
11741
|
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|