@panpanzhao/component-ui 1.24.1218 → 1.24.1224

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.
@@ -1,1052 +0,0 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
40
- /******/ }
41
- /******/ };
42
- /******/
43
- /******/ // define __esModule on exports
44
- /******/ __webpack_require__.r = function(exports) {
45
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
46
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
47
- /******/ }
48
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
49
- /******/ };
50
- /******/
51
- /******/ // create a fake namespace object
52
- /******/ // mode & 1: value is a module id, require it
53
- /******/ // mode & 2: merge all properties of value into the ns
54
- /******/ // mode & 4: return value when already ns object
55
- /******/ // mode & 8|1: behave like require
56
- /******/ __webpack_require__.t = function(value, mode) {
57
- /******/ if(mode & 1) value = __webpack_require__(value);
58
- /******/ if(mode & 8) return value;
59
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
60
- /******/ var ns = Object.create(null);
61
- /******/ __webpack_require__.r(ns);
62
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
63
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
64
- /******/ return ns;
65
- /******/ };
66
- /******/
67
- /******/ // getDefaultExport function for compatibility with non-harmony modules
68
- /******/ __webpack_require__.n = function(module) {
69
- /******/ var getter = module && module.__esModule ?
70
- /******/ function getDefault() { return module['default']; } :
71
- /******/ function getModuleExports() { return module; };
72
- /******/ __webpack_require__.d(getter, 'a', getter);
73
- /******/ return getter;
74
- /******/ };
75
- /******/
76
- /******/ // Object.prototype.hasOwnProperty.call
77
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
78
- /******/
79
- /******/ // __webpack_public_path__
80
- /******/ __webpack_require__.p = "/dist/";
81
- /******/
82
- /******/
83
- /******/ // Load entry module and return exports
84
- /******/ return __webpack_require__(__webpack_require__.s = 1);
85
- /******/ })
86
- /************************************************************************/
87
- /******/ ([
88
- /* 0 */
89
- /***/ (function(module, exports, __webpack_require__) {
90
-
91
- (function (factory) {
92
- if (true) {
93
- module.exports = factory();
94
- } else { var glob; }
95
- })(function (undefined) {
96
- "use strict";
97
-
98
- var add32 = function add32(a, b) {
99
- return a + b & 4294967295;
100
- },
101
- hex_chr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
102
- function cmn(q, a, b, x, s, t) {
103
- a = add32(add32(a, q), add32(x, t));
104
- return add32(a << s | a >>> 32 - s, b);
105
- }
106
- function md5cycle(x, k) {
107
- var a = x[0],
108
- b = x[1],
109
- c = x[2],
110
- d = x[3];
111
- a += (b & c | ~b & d) + k[0] - 680876936 | 0;
112
- a = (a << 7 | a >>> 25) + b | 0;
113
- d += (a & b | ~a & c) + k[1] - 389564586 | 0;
114
- d = (d << 12 | d >>> 20) + a | 0;
115
- c += (d & a | ~d & b) + k[2] + 606105819 | 0;
116
- c = (c << 17 | c >>> 15) + d | 0;
117
- b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
118
- b = (b << 22 | b >>> 10) + c | 0;
119
- a += (b & c | ~b & d) + k[4] - 176418897 | 0;
120
- a = (a << 7 | a >>> 25) + b | 0;
121
- d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
122
- d = (d << 12 | d >>> 20) + a | 0;
123
- c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
124
- c = (c << 17 | c >>> 15) + d | 0;
125
- b += (c & d | ~c & a) + k[7] - 45705983 | 0;
126
- b = (b << 22 | b >>> 10) + c | 0;
127
- a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
128
- a = (a << 7 | a >>> 25) + b | 0;
129
- d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
130
- d = (d << 12 | d >>> 20) + a | 0;
131
- c += (d & a | ~d & b) + k[10] - 42063 | 0;
132
- c = (c << 17 | c >>> 15) + d | 0;
133
- b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
134
- b = (b << 22 | b >>> 10) + c | 0;
135
- a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
136
- a = (a << 7 | a >>> 25) + b | 0;
137
- d += (a & b | ~a & c) + k[13] - 40341101 | 0;
138
- d = (d << 12 | d >>> 20) + a | 0;
139
- c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
140
- c = (c << 17 | c >>> 15) + d | 0;
141
- b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
142
- b = (b << 22 | b >>> 10) + c | 0;
143
- a += (b & d | c & ~d) + k[1] - 165796510 | 0;
144
- a = (a << 5 | a >>> 27) + b | 0;
145
- d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
146
- d = (d << 9 | d >>> 23) + a | 0;
147
- c += (d & b | a & ~b) + k[11] + 643717713 | 0;
148
- c = (c << 14 | c >>> 18) + d | 0;
149
- b += (c & a | d & ~a) + k[0] - 373897302 | 0;
150
- b = (b << 20 | b >>> 12) + c | 0;
151
- a += (b & d | c & ~d) + k[5] - 701558691 | 0;
152
- a = (a << 5 | a >>> 27) + b | 0;
153
- d += (a & c | b & ~c) + k[10] + 38016083 | 0;
154
- d = (d << 9 | d >>> 23) + a | 0;
155
- c += (d & b | a & ~b) + k[15] - 660478335 | 0;
156
- c = (c << 14 | c >>> 18) + d | 0;
157
- b += (c & a | d & ~a) + k[4] - 405537848 | 0;
158
- b = (b << 20 | b >>> 12) + c | 0;
159
- a += (b & d | c & ~d) + k[9] + 568446438 | 0;
160
- a = (a << 5 | a >>> 27) + b | 0;
161
- d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
162
- d = (d << 9 | d >>> 23) + a | 0;
163
- c += (d & b | a & ~b) + k[3] - 187363961 | 0;
164
- c = (c << 14 | c >>> 18) + d | 0;
165
- b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
166
- b = (b << 20 | b >>> 12) + c | 0;
167
- a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
168
- a = (a << 5 | a >>> 27) + b | 0;
169
- d += (a & c | b & ~c) + k[2] - 51403784 | 0;
170
- d = (d << 9 | d >>> 23) + a | 0;
171
- c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
172
- c = (c << 14 | c >>> 18) + d | 0;
173
- b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
174
- b = (b << 20 | b >>> 12) + c | 0;
175
- a += (b ^ c ^ d) + k[5] - 378558 | 0;
176
- a = (a << 4 | a >>> 28) + b | 0;
177
- d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
178
- d = (d << 11 | d >>> 21) + a | 0;
179
- c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
180
- c = (c << 16 | c >>> 16) + d | 0;
181
- b += (c ^ d ^ a) + k[14] - 35309556 | 0;
182
- b = (b << 23 | b >>> 9) + c | 0;
183
- a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
184
- a = (a << 4 | a >>> 28) + b | 0;
185
- d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
186
- d = (d << 11 | d >>> 21) + a | 0;
187
- c += (d ^ a ^ b) + k[7] - 155497632 | 0;
188
- c = (c << 16 | c >>> 16) + d | 0;
189
- b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
190
- b = (b << 23 | b >>> 9) + c | 0;
191
- a += (b ^ c ^ d) + k[13] + 681279174 | 0;
192
- a = (a << 4 | a >>> 28) + b | 0;
193
- d += (a ^ b ^ c) + k[0] - 358537222 | 0;
194
- d = (d << 11 | d >>> 21) + a | 0;
195
- c += (d ^ a ^ b) + k[3] - 722521979 | 0;
196
- c = (c << 16 | c >>> 16) + d | 0;
197
- b += (c ^ d ^ a) + k[6] + 76029189 | 0;
198
- b = (b << 23 | b >>> 9) + c | 0;
199
- a += (b ^ c ^ d) + k[9] - 640364487 | 0;
200
- a = (a << 4 | a >>> 28) + b | 0;
201
- d += (a ^ b ^ c) + k[12] - 421815835 | 0;
202
- d = (d << 11 | d >>> 21) + a | 0;
203
- c += (d ^ a ^ b) + k[15] + 530742520 | 0;
204
- c = (c << 16 | c >>> 16) + d | 0;
205
- b += (c ^ d ^ a) + k[2] - 995338651 | 0;
206
- b = (b << 23 | b >>> 9) + c | 0;
207
- a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
208
- a = (a << 6 | a >>> 26) + b | 0;
209
- d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
210
- d = (d << 10 | d >>> 22) + a | 0;
211
- c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
212
- c = (c << 15 | c >>> 17) + d | 0;
213
- b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
214
- b = (b << 21 | b >>> 11) + c | 0;
215
- a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
216
- a = (a << 6 | a >>> 26) + b | 0;
217
- d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
218
- d = (d << 10 | d >>> 22) + a | 0;
219
- c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
220
- c = (c << 15 | c >>> 17) + d | 0;
221
- b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
222
- b = (b << 21 | b >>> 11) + c | 0;
223
- a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
224
- a = (a << 6 | a >>> 26) + b | 0;
225
- d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
226
- d = (d << 10 | d >>> 22) + a | 0;
227
- c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
228
- c = (c << 15 | c >>> 17) + d | 0;
229
- b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
230
- b = (b << 21 | b >>> 11) + c | 0;
231
- a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
232
- a = (a << 6 | a >>> 26) + b | 0;
233
- d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
234
- d = (d << 10 | d >>> 22) + a | 0;
235
- c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
236
- c = (c << 15 | c >>> 17) + d | 0;
237
- b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
238
- b = (b << 21 | b >>> 11) + c | 0;
239
- x[0] = a + x[0] | 0;
240
- x[1] = b + x[1] | 0;
241
- x[2] = c + x[2] | 0;
242
- x[3] = d + x[3] | 0;
243
- }
244
- function md5blk(s) {
245
- var md5blks = [],
246
- i;
247
- for (i = 0; i < 64; i += 4) {
248
- md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
249
- }
250
- return md5blks;
251
- }
252
- function md5blk_array(a) {
253
- var md5blks = [],
254
- i;
255
- for (i = 0; i < 64; i += 4) {
256
- md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
257
- }
258
- return md5blks;
259
- }
260
- function md51(s) {
261
- var n = s.length,
262
- state = [1732584193, -271733879, -1732584194, 271733878],
263
- i,
264
- length,
265
- tail,
266
- tmp,
267
- lo,
268
- hi;
269
- for (i = 64; i <= n; i += 64) {
270
- md5cycle(state, md5blk(s.substring(i - 64, i)));
271
- }
272
- s = s.substring(i - 64);
273
- length = s.length;
274
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
275
- for (i = 0; i < length; i += 1) {
276
- tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
277
- }
278
- tail[i >> 2] |= 128 << (i % 4 << 3);
279
- if (i > 55) {
280
- md5cycle(state, tail);
281
- for (i = 0; i < 16; i += 1) {
282
- tail[i] = 0;
283
- }
284
- }
285
- tmp = n * 8;
286
- tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
287
- lo = parseInt(tmp[2], 16);
288
- hi = parseInt(tmp[1], 16) || 0;
289
- tail[14] = lo;
290
- tail[15] = hi;
291
- md5cycle(state, tail);
292
- return state;
293
- }
294
- function md51_array(a) {
295
- var n = a.length,
296
- state = [1732584193, -271733879, -1732584194, 271733878],
297
- i,
298
- length,
299
- tail,
300
- tmp,
301
- lo,
302
- hi;
303
- for (i = 64; i <= n; i += 64) {
304
- md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
305
- }
306
- a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);
307
- length = a.length;
308
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
309
- for (i = 0; i < length; i += 1) {
310
- tail[i >> 2] |= a[i] << (i % 4 << 3);
311
- }
312
- tail[i >> 2] |= 128 << (i % 4 << 3);
313
- if (i > 55) {
314
- md5cycle(state, tail);
315
- for (i = 0; i < 16; i += 1) {
316
- tail[i] = 0;
317
- }
318
- }
319
- tmp = n * 8;
320
- tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
321
- lo = parseInt(tmp[2], 16);
322
- hi = parseInt(tmp[1], 16) || 0;
323
- tail[14] = lo;
324
- tail[15] = hi;
325
- md5cycle(state, tail);
326
- return state;
327
- }
328
- function rhex(n) {
329
- var s = "",
330
- j;
331
- for (j = 0; j < 4; j += 1) {
332
- s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];
333
- }
334
- return s;
335
- }
336
- function hex(x) {
337
- var i;
338
- for (i = 0; i < x.length; i += 1) {
339
- x[i] = rhex(x[i]);
340
- }
341
- return x.join("");
342
- }
343
- if (hex(md51("hello")) !== "5d41402abc4b2a76b9719d911017c592") {
344
- add32 = function add32(x, y) {
345
- var lsw = (x & 65535) + (y & 65535),
346
- msw = (x >> 16) + (y >> 16) + (lsw >> 16);
347
- return msw << 16 | lsw & 65535;
348
- };
349
- }
350
- if (typeof ArrayBuffer !== "undefined" && !ArrayBuffer.prototype.slice) {
351
- (function () {
352
- function clamp(val, length) {
353
- val = val | 0 || 0;
354
- if (val < 0) {
355
- return Math.max(val + length, 0);
356
- }
357
- return Math.min(val, length);
358
- }
359
- ArrayBuffer.prototype.slice = function (from, to) {
360
- var length = this.byteLength,
361
- begin = clamp(from, length),
362
- end = length,
363
- num,
364
- target,
365
- targetArray,
366
- sourceArray;
367
- if (to !== undefined) {
368
- end = clamp(to, length);
369
- }
370
- if (begin > end) {
371
- return new ArrayBuffer(0);
372
- }
373
- num = end - begin;
374
- target = new ArrayBuffer(num);
375
- targetArray = new Uint8Array(target);
376
- sourceArray = new Uint8Array(this, begin, num);
377
- targetArray.set(sourceArray);
378
- return target;
379
- };
380
- })();
381
- }
382
- function toUtf8(str) {
383
- if (/[\u0080-\uFFFF]/.test(str)) {
384
- str = unescape(encodeURIComponent(str));
385
- }
386
- return str;
387
- }
388
- function utf8Str2ArrayBuffer(str, returnUInt8Array) {
389
- var length = str.length,
390
- buff = new ArrayBuffer(length),
391
- arr = new Uint8Array(buff),
392
- i;
393
- for (i = 0; i < length; i += 1) {
394
- arr[i] = str.charCodeAt(i);
395
- }
396
- return returnUInt8Array ? arr : buff;
397
- }
398
- function arrayBuffer2Utf8Str(buff) {
399
- return String.fromCharCode.apply(null, new Uint8Array(buff));
400
- }
401
- function concatenateArrayBuffers(first, second, returnUInt8Array) {
402
- var result = new Uint8Array(first.byteLength + second.byteLength);
403
- result.set(new Uint8Array(first));
404
- result.set(new Uint8Array(second), first.byteLength);
405
- return returnUInt8Array ? result : result.buffer;
406
- }
407
- function hexToBinaryString(hex) {
408
- var bytes = [],
409
- length = hex.length,
410
- x;
411
- for (x = 0; x < length - 1; x += 2) {
412
- bytes.push(parseInt(hex.substr(x, 2), 16));
413
- }
414
- return String.fromCharCode.apply(String, bytes);
415
- }
416
- function SparkMD5() {
417
- this.reset();
418
- }
419
- SparkMD5.prototype.append = function (str) {
420
- this.appendBinary(toUtf8(str));
421
- return this;
422
- };
423
- SparkMD5.prototype.appendBinary = function (contents) {
424
- this._buff += contents;
425
- this._length += contents.length;
426
- var length = this._buff.length,
427
- i;
428
- for (i = 64; i <= length; i += 64) {
429
- md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
430
- }
431
- this._buff = this._buff.substring(i - 64);
432
- return this;
433
- };
434
- SparkMD5.prototype.end = function (raw) {
435
- var buff = this._buff,
436
- length = buff.length,
437
- i,
438
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
439
- ret;
440
- for (i = 0; i < length; i += 1) {
441
- tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);
442
- }
443
- this._finish(tail, length);
444
- ret = hex(this._hash);
445
- if (raw) {
446
- ret = hexToBinaryString(ret);
447
- }
448
- this.reset();
449
- return ret;
450
- };
451
- SparkMD5.prototype.reset = function () {
452
- this._buff = "";
453
- this._length = 0;
454
- this._hash = [1732584193, -271733879, -1732584194, 271733878];
455
- return this;
456
- };
457
- SparkMD5.prototype.getState = function () {
458
- return {
459
- buff: this._buff,
460
- length: this._length,
461
- hash: this._hash.slice()
462
- };
463
- };
464
- SparkMD5.prototype.setState = function (state) {
465
- this._buff = state.buff;
466
- this._length = state.length;
467
- this._hash = state.hash;
468
- return this;
469
- };
470
- SparkMD5.prototype.destroy = function () {
471
- delete this._hash;
472
- delete this._buff;
473
- delete this._length;
474
- };
475
- SparkMD5.prototype._finish = function (tail, length) {
476
- var i = length,
477
- tmp,
478
- lo,
479
- hi;
480
- tail[i >> 2] |= 128 << (i % 4 << 3);
481
- if (i > 55) {
482
- md5cycle(this._hash, tail);
483
- for (i = 0; i < 16; i += 1) {
484
- tail[i] = 0;
485
- }
486
- }
487
- tmp = this._length * 8;
488
- tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
489
- lo = parseInt(tmp[2], 16);
490
- hi = parseInt(tmp[1], 16) || 0;
491
- tail[14] = lo;
492
- tail[15] = hi;
493
- md5cycle(this._hash, tail);
494
- };
495
- SparkMD5.hash = function (str, raw) {
496
- return SparkMD5.hashBinary(toUtf8(str), raw);
497
- };
498
- SparkMD5.hashBinary = function (content, raw) {
499
- var hash = md51(content),
500
- ret = hex(hash);
501
- return raw ? hexToBinaryString(ret) : ret;
502
- };
503
- SparkMD5.ArrayBuffer = function () {
504
- this.reset();
505
- };
506
- SparkMD5.ArrayBuffer.prototype.append = function (arr) {
507
- var buff = concatenateArrayBuffers(this._buff.buffer, arr, true),
508
- length = buff.length,
509
- i;
510
- this._length += arr.byteLength;
511
- for (i = 64; i <= length; i += 64) {
512
- md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
513
- }
514
- this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);
515
- return this;
516
- };
517
- SparkMD5.ArrayBuffer.prototype.end = function (raw) {
518
- var buff = this._buff,
519
- length = buff.length,
520
- tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
521
- i,
522
- ret;
523
- for (i = 0; i < length; i += 1) {
524
- tail[i >> 2] |= buff[i] << (i % 4 << 3);
525
- }
526
- this._finish(tail, length);
527
- ret = hex(this._hash);
528
- if (raw) {
529
- ret = hexToBinaryString(ret);
530
- }
531
- this.reset();
532
- return ret;
533
- };
534
- SparkMD5.ArrayBuffer.prototype.reset = function () {
535
- this._buff = new Uint8Array(0);
536
- this._length = 0;
537
- this._hash = [1732584193, -271733879, -1732584194, 271733878];
538
- return this;
539
- };
540
- SparkMD5.ArrayBuffer.prototype.getState = function () {
541
- var state = SparkMD5.prototype.getState.call(this);
542
- state.buff = arrayBuffer2Utf8Str(state.buff);
543
- return state;
544
- };
545
- SparkMD5.ArrayBuffer.prototype.setState = function (state) {
546
- state.buff = utf8Str2ArrayBuffer(state.buff, true);
547
- return SparkMD5.prototype.setState.call(this, state);
548
- };
549
- SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
550
- SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
551
- SparkMD5.ArrayBuffer.hash = function (arr, raw) {
552
- var hash = md51_array(new Uint8Array(arr)),
553
- ret = hex(hash);
554
- return raw ? hexToBinaryString(ret) : ret;
555
- };
556
- return SparkMD5;
557
- });
558
-
559
- /***/ }),
560
- /* 1 */
561
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
562
-
563
- "use strict";
564
- __webpack_require__.r(__webpack_exports__);
565
- /* harmony import */ var _spark_md5_min_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
566
- /* harmony import */ var _spark_md5_min_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_spark_md5_min_js__WEBPACK_IMPORTED_MODULE_0__);
567
- function _regeneratorRuntime() {
568
- "use strict";
569
-
570
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
571
- _regeneratorRuntime = function _regeneratorRuntime() {
572
- return e;
573
- };
574
- var t,
575
- e = {},
576
- r = Object.prototype,
577
- n = r.hasOwnProperty,
578
- o = Object.defineProperty || function (t, e, r) {
579
- t[e] = r.value;
580
- },
581
- i = "function" == typeof Symbol ? Symbol : {},
582
- a = i.iterator || "@@iterator",
583
- c = i.asyncIterator || "@@asyncIterator",
584
- u = i.toStringTag || "@@toStringTag";
585
- function define(t, e, r) {
586
- return Object.defineProperty(t, e, {
587
- value: r,
588
- enumerable: !0,
589
- configurable: !0,
590
- writable: !0
591
- }), t[e];
592
- }
593
- try {
594
- define({}, "");
595
- } catch (t) {
596
- define = function define(t, e, r) {
597
- return t[e] = r;
598
- };
599
- }
600
- function wrap(t, e, r, n) {
601
- var i = e && e.prototype instanceof Generator ? e : Generator,
602
- a = Object.create(i.prototype),
603
- c = new Context(n || []);
604
- return o(a, "_invoke", {
605
- value: makeInvokeMethod(t, r, c)
606
- }), a;
607
- }
608
- function tryCatch(t, e, r) {
609
- try {
610
- return {
611
- type: "normal",
612
- arg: t.call(e, r)
613
- };
614
- } catch (t) {
615
- return {
616
- type: "throw",
617
- arg: t
618
- };
619
- }
620
- }
621
- e.wrap = wrap;
622
- var h = "suspendedStart",
623
- l = "suspendedYield",
624
- f = "executing",
625
- s = "completed",
626
- y = {};
627
- function Generator() {}
628
- function GeneratorFunction() {}
629
- function GeneratorFunctionPrototype() {}
630
- var p = {};
631
- define(p, a, function () {
632
- return this;
633
- });
634
- var d = Object.getPrototypeOf,
635
- v = d && d(d(values([])));
636
- v && v !== r && n.call(v, a) && (p = v);
637
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
638
- function defineIteratorMethods(t) {
639
- ["next", "throw", "return"].forEach(function (e) {
640
- define(t, e, function (t) {
641
- return this._invoke(e, t);
642
- });
643
- });
644
- }
645
- function AsyncIterator(t, e) {
646
- function invoke(r, o, i, a) {
647
- var c = tryCatch(t[r], t, o);
648
- if ("throw" !== c.type) {
649
- var u = c.arg,
650
- h = u.value;
651
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
652
- invoke("next", t, i, a);
653
- }, function (t) {
654
- invoke("throw", t, i, a);
655
- }) : e.resolve(h).then(function (t) {
656
- u.value = t, i(u);
657
- }, function (t) {
658
- return invoke("throw", t, i, a);
659
- });
660
- }
661
- a(c.arg);
662
- }
663
- var r;
664
- o(this, "_invoke", {
665
- value: function value(t, n) {
666
- function callInvokeWithMethodAndArg() {
667
- return new e(function (e, r) {
668
- invoke(t, n, e, r);
669
- });
670
- }
671
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
672
- }
673
- });
674
- }
675
- function makeInvokeMethod(e, r, n) {
676
- var o = h;
677
- return function (i, a) {
678
- if (o === f) throw new Error("Generator is already running");
679
- if (o === s) {
680
- if ("throw" === i) throw a;
681
- return {
682
- value: t,
683
- done: !0
684
- };
685
- }
686
- for (n.method = i, n.arg = a;;) {
687
- var c = n.delegate;
688
- if (c) {
689
- var u = maybeInvokeDelegate(c, n);
690
- if (u) {
691
- if (u === y) continue;
692
- return u;
693
- }
694
- }
695
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
696
- if (o === h) throw o = s, n.arg;
697
- n.dispatchException(n.arg);
698
- } else "return" === n.method && n.abrupt("return", n.arg);
699
- o = f;
700
- var p = tryCatch(e, r, n);
701
- if ("normal" === p.type) {
702
- if (o = n.done ? s : l, p.arg === y) continue;
703
- return {
704
- value: p.arg,
705
- done: n.done
706
- };
707
- }
708
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
709
- }
710
- };
711
- }
712
- function maybeInvokeDelegate(e, r) {
713
- var n = r.method,
714
- o = e.iterator[n];
715
- if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
716
- var i = tryCatch(o, e.iterator, r.arg);
717
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
718
- var a = i.arg;
719
- return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
720
- }
721
- function pushTryEntry(t) {
722
- var e = {
723
- tryLoc: t[0]
724
- };
725
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
726
- }
727
- function resetTryEntry(t) {
728
- var e = t.completion || {};
729
- e.type = "normal", delete e.arg, t.completion = e;
730
- }
731
- function Context(t) {
732
- this.tryEntries = [{
733
- tryLoc: "root"
734
- }], t.forEach(pushTryEntry, this), this.reset(!0);
735
- }
736
- function values(e) {
737
- if (e || "" === e) {
738
- var r = e[a];
739
- if (r) return r.call(e);
740
- if ("function" == typeof e.next) return e;
741
- if (!isNaN(e.length)) {
742
- var o = -1,
743
- i = function next() {
744
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
745
- return next.value = t, next.done = !0, next;
746
- };
747
- return i.next = i;
748
- }
749
- }
750
- throw new TypeError(typeof e + " is not iterable");
751
- }
752
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
753
- value: GeneratorFunctionPrototype,
754
- configurable: !0
755
- }), o(GeneratorFunctionPrototype, "constructor", {
756
- value: GeneratorFunction,
757
- configurable: !0
758
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
759
- var e = "function" == typeof t && t.constructor;
760
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
761
- }, e.mark = function (t) {
762
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
763
- }, e.awrap = function (t) {
764
- return {
765
- __await: t
766
- };
767
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
768
- return this;
769
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
770
- void 0 === i && (i = Promise);
771
- var a = new AsyncIterator(wrap(t, r, n, o), i);
772
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
773
- return t.done ? t.value : a.next();
774
- });
775
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
776
- return this;
777
- }), define(g, "toString", function () {
778
- return "[object Generator]";
779
- }), e.keys = function (t) {
780
- var e = Object(t),
781
- r = [];
782
- for (var n in e) r.push(n);
783
- return r.reverse(), function next() {
784
- for (; r.length;) {
785
- var t = r.pop();
786
- if (t in e) return next.value = t, next.done = !1, next;
787
- }
788
- return next.done = !0, next;
789
- };
790
- }, e.values = values, Context.prototype = {
791
- constructor: Context,
792
- reset: function reset(e) {
793
- if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
794
- },
795
- stop: function stop() {
796
- this.done = !0;
797
- var t = this.tryEntries[0].completion;
798
- if ("throw" === t.type) throw t.arg;
799
- return this.rval;
800
- },
801
- dispatchException: function dispatchException(e) {
802
- if (this.done) throw e;
803
- var r = this;
804
- function handle(n, o) {
805
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
806
- }
807
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
808
- var i = this.tryEntries[o],
809
- a = i.completion;
810
- if ("root" === i.tryLoc) return handle("end");
811
- if (i.tryLoc <= this.prev) {
812
- var c = n.call(i, "catchLoc"),
813
- u = n.call(i, "finallyLoc");
814
- if (c && u) {
815
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
816
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
817
- } else if (c) {
818
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
819
- } else {
820
- if (!u) throw new Error("try statement without catch or finally");
821
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
822
- }
823
- }
824
- }
825
- },
826
- abrupt: function abrupt(t, e) {
827
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
828
- var o = this.tryEntries[r];
829
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
830
- var i = o;
831
- break;
832
- }
833
- }
834
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
835
- var a = i ? i.completion : {};
836
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
837
- },
838
- complete: function complete(t, e) {
839
- if ("throw" === t.type) throw t.arg;
840
- return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
841
- },
842
- finish: function finish(t) {
843
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
844
- var r = this.tryEntries[e];
845
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
846
- }
847
- },
848
- catch: function _catch(t) {
849
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
850
- var r = this.tryEntries[e];
851
- if (r.tryLoc === t) {
852
- var n = r.completion;
853
- if ("throw" === n.type) {
854
- var o = n.arg;
855
- resetTryEntry(r);
856
- }
857
- return o;
858
- }
859
- }
860
- throw new Error("illegal catch attempt");
861
- },
862
- delegateYield: function delegateYield(e, r, n) {
863
- return this.delegate = {
864
- iterator: values(e),
865
- resultName: r,
866
- nextLoc: n
867
- }, "next" === this.method && (this.arg = t), y;
868
- }
869
- }, e;
870
- }
871
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
872
- try {
873
- var info = gen[key](arg);
874
- var value = info.value;
875
- } catch (error) {
876
- reject(error);
877
- return;
878
- }
879
- if (info.done) {
880
- resolve(value);
881
- } else {
882
- Promise.resolve(value).then(_next, _throw);
883
- }
884
- }
885
- function _asyncToGenerator(fn) {
886
- return function () {
887
- var self = this,
888
- args = arguments;
889
- return new Promise(function (resolve, reject) {
890
- var gen = fn.apply(self, args);
891
- function _next(value) {
892
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
893
- }
894
- function _throw(err) {
895
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
896
- }
897
- _next(undefined);
898
- });
899
- };
900
- }
901
-
902
- // self.importScripts("spark-md5.min.js");
903
-
904
- // 创建文件切片
905
- function createFileChunk(file, chunkSize) {
906
- return new Promise(function (resolve, reject) {
907
- var fileChunkList = [];
908
- var cur = 0;
909
- while (cur < file.size) {
910
- // Blob 接口的 slice() 方法创建并返回一个新的 Blob 对象,该对象包含调用它的 blob 的子集中的数据。
911
- fileChunkList.push({
912
- chunkFile: file.slice(cur, cur + chunkSize)
913
- });
914
- cur += chunkSize;
915
- }
916
- // 返回全部文件切片
917
- resolve(fileChunkList);
918
- });
919
- }
920
-
921
- // 加载并计算文件切片的MD5
922
- function calculateChunksHash(_x) {
923
- return _calculateChunksHash.apply(this, arguments);
924
- } // 监听消息
925
- function _calculateChunksHash() {
926
- _calculateChunksHash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(fileChunkList) {
927
- var spark, percentage, count, loadNext, _loadNext, fileHash;
928
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
929
- while (1) switch (_context3.prev = _context3.next) {
930
- case 0:
931
- _loadNext = function _loadNext3() {
932
- _loadNext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(index) {
933
- var md5;
934
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
935
- while (1) switch (_context2.prev = _context2.next) {
936
- case 0:
937
- if (!(index >= fileChunkList.length)) {
938
- _context2.next = 3;
939
- break;
940
- }
941
- // 所有切片都已处理完毕
942
- md5 = spark.end();
943
- return _context2.abrupt("return", md5);
944
- case 3:
945
- return _context2.abrupt("return", new Promise(function (resolve, reject) {
946
- var reader = new FileReader();
947
- reader.readAsArrayBuffer(fileChunkList[index].chunkFile);
948
- reader.onload = function (e) {
949
- count++;
950
- spark.append(e.target.result);
951
-
952
- // 更新进度并处理下一个切片
953
- percentage += 100 / fileChunkList.length;
954
- self.postMessage({
955
- percentage: percentage
956
- }); // 发送进度到主线程
957
-
958
- resolve(loadNext(index + 1)); // 递归调用,处理下一个切片
959
- };
960
- reader.onerror = function (err) {
961
- reject(err); // 如果读取错误,则拒绝Promise
962
- };
963
- }));
964
- case 4:
965
- case "end":
966
- return _context2.stop();
967
- }
968
- }, _callee2);
969
- }));
970
- return _loadNext.apply(this, arguments);
971
- };
972
- loadNext = function _loadNext2(_x3) {
973
- return _loadNext.apply(this, arguments);
974
- };
975
- // 初始化脚本
976
- spark = new _spark_md5_min_js__WEBPACK_IMPORTED_MODULE_0___default.a.ArrayBuffer(); // const spark = new self.SparkMD5.ArrayBuffer();
977
- // 计算切片进度(拓展功能,可自行添加)
978
- percentage = 0; // 计算切片次数
979
- count = 0; // 递归函数,用于处理文件切片
980
- _context3.prev = 5;
981
- _context3.next = 8;
982
- return loadNext(0);
983
- case 8:
984
- fileHash = _context3.sent;
985
- // 等待所有切片处理完毕
986
- self.postMessage({
987
- percentage: 100,
988
- fileHash: fileHash,
989
- fileChunkList: fileChunkList
990
- }); // 发送最终结果到主线程
991
- self.close(); // 关闭Worker
992
- _context3.next = 17;
993
- break;
994
- case 13:
995
- _context3.prev = 13;
996
- _context3.t0 = _context3["catch"](5);
997
- self.postMessage({
998
- name: "error",
999
- data: _context3.t0
1000
- }); // 发送错误到主线程
1001
- self.close();
1002
- // 关闭Worker
1003
- case 17:
1004
- case "end":
1005
- return _context3.stop();
1006
- }
1007
- }, _callee3, null, [[5, 13]]);
1008
- }));
1009
- return _calculateChunksHash.apply(this, arguments);
1010
- }
1011
- self.addEventListener("message", /*#__PURE__*/function () {
1012
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
1013
- var _e$data, file, chunkSize, fileChunkList;
1014
- return _regeneratorRuntime().wrap(function _callee$(_context) {
1015
- while (1) switch (_context.prev = _context.next) {
1016
- case 0:
1017
- _context.prev = 0;
1018
- _e$data = e.data, file = _e$data.file, chunkSize = _e$data.chunkSize;
1019
- _context.next = 4;
1020
- return createFileChunk(file, chunkSize);
1021
- case 4:
1022
- fileChunkList = _context.sent;
1023
- _context.next = 7;
1024
- return calculateChunksHash(fileChunkList);
1025
- case 7:
1026
- _context.next = 12;
1027
- break;
1028
- case 9:
1029
- _context.prev = 9;
1030
- _context.t0 = _context["catch"](0);
1031
- // 这里实际上不会捕获到calculateChunksHash中的错误,因为错误已经在Worker内部处理了
1032
- // 但如果未来有其他的异步操作,这里可以捕获到它们
1033
- console.error("worker监听发生错误:", _context.t0);
1034
- case 12:
1035
- case "end":
1036
- return _context.stop();
1037
- }
1038
- }, _callee, null, [[0, 9]]);
1039
- }));
1040
- return function (_x2) {
1041
- return _ref.apply(this, arguments);
1042
- };
1043
- }(), false);
1044
-
1045
- // 主线程可以监听 Worker 是否发生错误。如果发生错误,Worker 会触发主线程的error事件。
1046
- self.addEventListener("error", function (event) {
1047
- console.log("Worker触发主线程的error事件:", event);
1048
- self.close(); // 关闭Worker
1049
- });
1050
-
1051
- /***/ })
1052
- /******/ ]);