@cloudbase/container 2.5.37-alpha.3 → 2.5.37-alpha.4

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,2242 +0,0 @@
1
- /* 2.5.34-beta.0 */ !(function (t, e) {
2
- 'object' == typeof exports && 'object' == typeof module
3
- ? (module.exports = e())
4
- : 'function' == typeof define && define.amd
5
- ? define('cloudbase_container', [], e)
6
- : 'object' == typeof exports
7
- ? (exports.cloudbase_container = e())
8
- : (t.cloudbase_container = e())
9
- })('undefined' != typeof window ? window : this, () =>
10
- (() => {
11
- var t = {
12
- 671: (t, e) => {
13
- 'use strict'
14
- Object.defineProperty(e, '__esModule', { value: !0 }),
15
- (e.COMPONENT_NAME = void 0),
16
- (e.COMPONENT_NAME = 'container')
17
- },
18
- 976: function (t, e, n) {
19
- 'use strict'
20
- var r,
21
- o =
22
- (this && this.__extends) ||
23
- ((r = function (t, e) {
24
- return (r =
25
- Object.setPrototypeOf ||
26
- ({ __proto__: [] } instanceof Array &&
27
- function (t, e) {
28
- t.__proto__ = e
29
- }) ||
30
- function (t, e) {
31
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
32
- })(t, e)
33
- }),
34
- function (t, e) {
35
- if ('function' != typeof e && null !== e)
36
- throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null')
37
- function n() {
38
- this.constructor = t
39
- }
40
- r(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n()))
41
- }),
42
- i =
43
- (this && this.__assign) ||
44
- function () {
45
- return (i =
46
- Object.assign ||
47
- function (t) {
48
- for (var e, n = 1, r = arguments.length; n < r; n++)
49
- for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
50
- return t
51
- }).apply(this, arguments)
52
- },
53
- a =
54
- (this && this.__decorate) ||
55
- function (t, e, n, r) {
56
- var o,
57
- i = arguments.length,
58
- a = i < 3 ? e : null === r ? (r = Object.getOwnPropertyDescriptor(e, n)) : r
59
- if ('object' == typeof Reflect && 'function' == typeof Reflect.decorate)
60
- a = Reflect.decorate(t, e, n, r)
61
- else
62
- for (var c = t.length - 1; c >= 0; c--)
63
- (o = t[c]) && (a = (i < 3 ? o(a) : i > 3 ? o(e, n, a) : o(e, n)) || a)
64
- return i > 3 && a && Object.defineProperty(e, n, a), a
65
- },
66
- c =
67
- (this && this.__metadata) ||
68
- function (t, e) {
69
- if ('object' == typeof Reflect && 'function' == typeof Reflect.metadata) return Reflect.metadata(t, e)
70
- },
71
- s =
72
- (this && this.__awaiter) ||
73
- function (t, e, n, r) {
74
- return new (n || (n = Promise))(function (o, i) {
75
- function a(t) {
76
- try {
77
- s(r.next(t))
78
- } catch (t) {
79
- i(t)
80
- }
81
- }
82
- function c(t) {
83
- try {
84
- s(r.throw(t))
85
- } catch (t) {
86
- i(t)
87
- }
88
- }
89
- function s(t) {
90
- var e
91
- t.done
92
- ? o(t.value)
93
- : ((e = t.value),
94
- e instanceof n
95
- ? e
96
- : new n(function (t) {
97
- t(e)
98
- })).then(a, c)
99
- }
100
- s((r = r.apply(t, e || [])).next())
101
- })
102
- },
103
- u =
104
- (this && this.__generator) ||
105
- function (t, e) {
106
- var n,
107
- r,
108
- o,
109
- i,
110
- a = {
111
- label: 0,
112
- sent: function () {
113
- if (1 & o[0]) throw o[1]
114
- return o[1]
115
- },
116
- trys: [],
117
- ops: [],
118
- }
119
- return (
120
- (i = { next: c(0), throw: c(1), return: c(2) }),
121
- 'function' == typeof Symbol &&
122
- (i[Symbol.iterator] = function () {
123
- return this
124
- }),
125
- i
126
- )
127
- function c(c) {
128
- return function (s) {
129
- return (function (c) {
130
- if (n) throw new TypeError('Generator is already executing.')
131
- for (; i && ((i = 0), c[0] && (a = 0)), a; )
132
- try {
133
- if (
134
- ((n = 1),
135
- r &&
136
- (o = 2 & c[0] ? r.return : c[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) &&
137
- !(o = o.call(r, c[1])).done)
138
- )
139
- return o
140
- switch (((r = 0), o && (c = [2 & c[0], o.value]), c[0])) {
141
- case 0:
142
- case 1:
143
- o = c
144
- break
145
- case 4:
146
- return a.label++, { value: c[1], done: !1 }
147
- case 5:
148
- a.label++, (r = c[1]), (c = [0])
149
- continue
150
- case 7:
151
- ;(c = a.ops.pop()), a.trys.pop()
152
- continue
153
- default:
154
- if (
155
- !((o = a.trys), (o = o.length > 0 && o[o.length - 1]) || (6 !== c[0] && 2 !== c[0]))
156
- ) {
157
- a = 0
158
- continue
159
- }
160
- if (3 === c[0] && (!o || (c[1] > o[0] && c[1] < o[3]))) {
161
- a.label = c[1]
162
- break
163
- }
164
- if (6 === c[0] && a.label < o[1]) {
165
- ;(a.label = o[1]), (o = c)
166
- break
167
- }
168
- if (o && a.label < o[2]) {
169
- ;(a.label = o[2]), a.ops.push(c)
170
- break
171
- }
172
- o[2] && a.ops.pop(), a.trys.pop()
173
- continue
174
- }
175
- c = e.call(t, a)
176
- } catch (t) {
177
- ;(c = [6, t]), (r = 0)
178
- } finally {
179
- n = o = 0
180
- }
181
- if (5 & c[0]) throw c[1]
182
- return { value: c[0] ? c[1] : void 0, done: !0 }
183
- })([c, s])
184
- }
185
- }
186
- },
187
- l =
188
- (this && this.__rest) ||
189
- function (t, e) {
190
- var n = {}
191
- for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r])
192
- if (null != t && 'function' == typeof Object.getOwnPropertySymbols) {
193
- var o = 0
194
- for (r = Object.getOwnPropertySymbols(t); o < r.length; o++)
195
- e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]])
196
- }
197
- return n
198
- }
199
- Object.defineProperty(e, '__esModule', { value: !0 }), (e.registerContainers = e.CloudbaseContainers = void 0)
200
- var f = n(136),
201
- p = n(438),
202
- d = n(671),
203
- h = f.constants.ERRORS,
204
- y = f.constants.COMMUNITY_SITE_URL,
205
- v = f.utils.execCallback,
206
- g = f.utils.printWarn,
207
- w = f.helpers.catchErrorsDecorator,
208
- m = function () {
209
- throw new Error('getExportFunction 未实现')
210
- },
211
- b = function () {
212
- throw new Error('loadJSExportFunction 未实现')
213
- }
214
- ;(m = function () {
215
- new Error('小程序不支持 wasm 加载')
216
- }),
217
- (b = function () {
218
- new Error('小程序不支持动态 js 加载')
219
- })
220
- var _ = (function (t) {
221
- function e(e, n) {
222
- var r = this,
223
- o = JSON.stringify({ code: h.INVALID_PARAMS, msg: '['.concat(e, '] ').concat(n) })
224
- return ((r = t.call(this, o) || this).code = h.INVALID_PARAMS), r
225
- }
226
- return (
227
- o(e, t),
228
- (e.prototype.toJSON = function () {
229
- return { code: this.code, message: this.message }
230
- }),
231
- e
232
- )
233
- })(Error)
234
- function O(t, e, n) {
235
- void 0 === e && (e = d.COMPONENT_NAME), void 0 === n && (n = 'call container error')
236
- var r =
237
- t instanceof Error ? t : new Error('['.concat(e, '] ').concat((null == t ? void 0 : t.message) || n))
238
- return (r.code = (null == t ? void 0 : t.code) || 'UNKNOWN_ERROR'), r
239
- }
240
- var E = (e.CloudbaseContainers = (function () {
241
- function t(t) {
242
- var e = this
243
- if (
244
- ((this.config = i({}, t)),
245
- !this.config.wasmUrl && !this.config.jsUrl && !globalThis.cloudbase_private_link)
246
- )
247
- throw new _(''.concat(d.COMPONENT_NAME), '缺少 privatelink sdk 地址')
248
- this.config.wasmUrl
249
- ? (this.wasm = m(this.config.wasmUrl).catch(function (t) {
250
- if (e.config.jsUrl)
251
- return console.warn('load wams error, fall back to use js', t), b(e.config.jsUrl)
252
- if (globalThis.cloudbase_private_link) return globalThis.cloudbase_private_link
253
- throw t
254
- }))
255
- : this.config.jsUrl
256
- ? (this.wasm = b(this.config.jsUrl))
257
- : (this.wasm = Promise.resolve({
258
- initContainer: globalThis.cloudbase_private_link.initContainer,
259
- callContainer: globalThis.cloudbase_private_link.callContainer,
260
- }))
261
- }
262
- return (
263
- (t.prototype.callContainer = function (t, e) {
264
- return s(this, void 0, void 0, function () {
265
- var n, r, o, a, c, s, f, h, y, g, w, m, b, E, S, N, A, C
266
- return u(this, function (u) {
267
- switch (u.label) {
268
- case 0:
269
- return [4, this.initContainer(this.config)]
270
- case 1:
271
- return u.sent(), (n = ''.concat(d.COMPONENT_NAME, '.callContainer')), [4, this.wasm]
272
- case 2:
273
- if (
274
- ((r = u.sent().callContainer),
275
- (o = i({}, t)),
276
- (a = o.url),
277
- (E = o.method),
278
- (c = void 0 === E ? 'GET' : E),
279
- (S = o.header),
280
- (s = void 0 === S ? {} : S),
281
- (f = o.data),
282
- (N = o.timeout),
283
- (h = void 0 === N ? 6e4 : N),
284
- (A = o.dataType),
285
- (y = void 0 === A ? 'json' : A),
286
- (C = o.responseType),
287
- (g = void 0 === C ? 'text' : C),
288
- (w = l(o, ['url', 'method', 'header', 'data', 'timeout', 'dataType', 'responseType'])),
289
- !a)
290
- )
291
- throw new _(n, 'invalid request url')
292
- if (!c) throw new _(n, 'invalid request method')
293
- u.label = 3
294
- case 3:
295
- return (
296
- u.trys.push([3, 5, , 6]),
297
- [
298
- 4,
299
- new Promise(function (t, e) {
300
- var o = i(
301
- {
302
- url: a,
303
- method: c,
304
- header: s,
305
- data: (0, p.serializeRequestBody)(s, f, c),
306
- timeout: h,
307
- dataType: y,
308
- responseType: g,
309
- },
310
- w,
311
- )
312
- if (
313
- f &&
314
- ((0, p.isBuffer)(o.data) || 'string' == typeof o.data) &&
315
- (null == f ? void 0 : f.length) > 1024e4
316
- )
317
- e(new _(n, 'body too large'))
318
- else {
319
- if ('GET' === c) {
320
- var u = o.data
321
- if ((u && (o.data = void 0), !(0, p.isBuffer)(u) && 'string' != typeof u)) {
322
- var l = Object.entries(u || {}).reduce(function (t, e) {
323
- var n = e[0],
324
- r = e[1]
325
- return (
326
- t.push(
327
- ''.concat(encodeURIComponent(n), '=').concat(encodeURIComponent(String(r))),
328
- ),
329
- t
330
- )
331
- }, [])
332
- l.length && (u = l.join('&'))
333
- }
334
- if ('string' == typeof o.data) {
335
- var d = (0, p.parseURL)(a)
336
- d.search ? (d.search += '&'.concat(o.data)) : (d.search = '?'.concat(o.data)),
337
- (o.url = d.href),
338
- (o.data = void 0)
339
- }
340
- }
341
- r(
342
- i(i({}, o), {
343
- success: t,
344
- fail: function (t) {
345
- var r = (t || {}).data
346
- e(O(r, n, 'call container error'))
347
- },
348
- }),
349
- )
350
- }
351
- }),
352
- ]
353
- )
354
- case 4:
355
- return (m = u.sent()), [2, v(e, null, m)]
356
- case 5:
357
- return (b = u.sent()), v(e, b), [3, 6]
358
- case 6:
359
- return [2]
360
- }
361
- })
362
- })
363
- }),
364
- (t.prototype.initContainer = function (t) {
365
- return s(this, void 0, void 0, function () {
366
- var e,
367
- n = this
368
- return u(this, function (r) {
369
- switch (r.label) {
370
- case 0:
371
- return [4, this.wasm]
372
- case 1:
373
- return (
374
- (e = r.sent().initContainer),
375
- this.containerInitPromise ||
376
- (this.containerInitPromise = new Promise(function (r, o) {
377
- e({
378
- config: t,
379
- success: function (t) {
380
- '200' !== String(t.statusCode) &&
381
- o(
382
- O(t.data, ''.concat(d.COMPONENT_NAME, '.initContainer'), 'init container fail'),
383
- ),
384
- r(t)
385
- },
386
- fail: function (t) {
387
- o(O(t.data, ''.concat(d.COMPONENT_NAME, '.initContainer'), 'init container fail')),
388
- (n.containerInitPromise = null)
389
- },
390
- })
391
- })),
392
- [2, this.containerInitPromise]
393
- )
394
- }
395
- })
396
- })
397
- }),
398
- a(
399
- [
400
- w({
401
- customInfo: { className: 'Cloudbase', methodName: 'callContainer' },
402
- title: '调用失败',
403
- messages: [
404
- '请确认以下各项:',
405
- ' 1 - 调用 callContainer() 的语法或参数是否正确',
406
- ' 2 - 域名 & 路径是否存在',
407
- '如果问题依然存在,建议到官方问答社区提问或寻找帮助:'.concat(y),
408
- ],
409
- }),
410
- c('design:type', Function),
411
- c('design:paramtypes', [Object, Function]),
412
- c('design:returntype', Promise),
413
- ],
414
- t.prototype,
415
- 'callContainer',
416
- null,
417
- ),
418
- t
419
- )
420
- })()),
421
- S = {
422
- name: d.COMPONENT_NAME,
423
- namespace: 'container',
424
- entity: function (t) {
425
- if (this.containerInstance)
426
- return (
427
- g(h.INVALID_OPERATION, 'every cloudbase instance should has only one container object'),
428
- this.containerInstance
429
- )
430
- var e = new E(t)
431
- return (
432
- (this.containerInstance = e), (this.callContainer = e.callContainer.bind(e)), this.containerInstance
433
- )
434
- },
435
- }
436
- try {
437
- cloudbase.registerComponent(S)
438
- } catch (t) {}
439
- e.registerContainers = function (t) {
440
- try {
441
- t.registerComponent(S)
442
- } catch (t) {
443
- console.warn(t)
444
- }
445
- }
446
- },
447
- 438: (t, e, n) => {
448
- 'use strict'
449
- Object.defineProperty(e, '__esModule', { value: !0 }),
450
- (e.serializeRequestBody = e.isBuffer = e.parseURL = void 0)
451
- var r = n(136),
452
- o = n(671),
453
- i = r.constants.ERRORS
454
- function a(t) {
455
- return t instanceof ArrayBuffer || ArrayBuffer.isView(t)
456
- }
457
- function c(t) {
458
- var e = Object.entries(t || {}).reduce(function (t, e) {
459
- var n = e[0],
460
- r = e[1]
461
- return t.push(''.concat(encodeURIComponent(n), '=').concat(encodeURIComponent(r))), t
462
- }, [])
463
- if (e.length) return e.join('&')
464
- }
465
- ;(e.parseURL = function (t) {
466
- if (document) {
467
- var e = document.createElement('a')
468
- return (e.href = t), e
469
- }
470
- return new URL(new Request(t).url)
471
- }),
472
- (e.isBuffer = a),
473
- (e.serializeRequestBody = function (t, e, n) {
474
- void 0 === n && (n = 'POST')
475
- var r = e
476
- if ('object' == typeof e && !a(e)) {
477
- t['Content-Type'] || t['content-type'] || (t['Content-Type'] = 'application/json')
478
- var s = t['Content-Type'] || t['content-type']
479
- if ('GET' === n)
480
- try {
481
- return c(e) || ''
482
- } catch (t) {
483
- throw new Error(
484
- JSON.stringify({
485
- code: i.INVALID_PARAMS,
486
- msg: '['
487
- .concat(o.COMPONENT_NAME, '.callContainer] invalid data in query method, ')
488
- .concat(t.message),
489
- }),
490
- )
491
- }
492
- switch (s) {
493
- case 'application/json':
494
- try {
495
- r = JSON.stringify(e)
496
- } catch (t) {
497
- throw new Error(
498
- JSON.stringify({
499
- code: i.INVALID_PARAMS,
500
- msg: '['
501
- .concat(
502
- o.COMPONENT_NAME,
503
- '.callContainer] invalid data with content-type: application/json, ',
504
- )
505
- .concat(t.message),
506
- }),
507
- )
508
- }
509
- break
510
- case 'application/x-www-form-urlencoded':
511
- try {
512
- var u = c(e)
513
- u && (r = u)
514
- } catch (t) {
515
- throw new Error(
516
- JSON.stringify({
517
- code: i.INVALID_PARAMS,
518
- msg: '['
519
- .concat(
520
- o.COMPONENT_NAME,
521
- '.callContainer] invalid data with content-type: application/x-www-form-urlencoded,',
522
- )
523
- .concat(t.message),
524
- }),
525
- )
526
- }
527
- }
528
- }
529
- return r
530
- })
531
- },
532
- 112: function (t, e, n) {
533
- var r
534
- t.exports =
535
- ((r =
536
- r ||
537
- (function (t, e) {
538
- var r
539
- if (
540
- ('undefined' != typeof window && window.crypto && (r = window.crypto),
541
- 'undefined' != typeof self && self.crypto && (r = self.crypto),
542
- 'undefined' != typeof globalThis && globalThis.crypto && (r = globalThis.crypto),
543
- !r && 'undefined' != typeof window && window.msCrypto && (r = window.msCrypto),
544
- !r && void 0 !== n.g && n.g.crypto && (r = n.g.crypto),
545
- !r)
546
- )
547
- try {
548
- r = n(429)
549
- } catch (t) {}
550
- var o = function () {
551
- if (r) {
552
- if ('function' == typeof r.getRandomValues)
553
- try {
554
- return r.getRandomValues(new Uint32Array(1))[0]
555
- } catch (t) {}
556
- if ('function' == typeof r.randomBytes)
557
- try {
558
- return r.randomBytes(4).readInt32LE()
559
- } catch (t) {}
560
- }
561
- throw new Error('Native crypto module could not be used to get secure random number.')
562
- },
563
- i =
564
- Object.create ||
565
- (function () {
566
- function t() {}
567
- return function (e) {
568
- var n
569
- return (t.prototype = e), (n = new t()), (t.prototype = null), n
570
- }
571
- })(),
572
- a = {},
573
- c = (a.lib = {}),
574
- s = (c.Base = {
575
- extend: function (t) {
576
- var e = i(this)
577
- return (
578
- t && e.mixIn(t),
579
- (e.hasOwnProperty('init') && this.init !== e.init) ||
580
- (e.init = function () {
581
- e.$super.init.apply(this, arguments)
582
- }),
583
- (e.init.prototype = e),
584
- (e.$super = this),
585
- e
586
- )
587
- },
588
- create: function () {
589
- var t = this.extend()
590
- return t.init.apply(t, arguments), t
591
- },
592
- init: function () {},
593
- mixIn: function (t) {
594
- for (var e in t) t.hasOwnProperty(e) && (this[e] = t[e])
595
- t.hasOwnProperty('toString') && (this.toString = t.toString)
596
- },
597
- clone: function () {
598
- return this.init.prototype.extend(this)
599
- },
600
- }),
601
- u = (c.WordArray = s.extend({
602
- init: function (t, e) {
603
- ;(t = this.words = t || []), (this.sigBytes = null != e ? e : 4 * t.length)
604
- },
605
- toString: function (t) {
606
- return (t || f).stringify(this)
607
- },
608
- concat: function (t) {
609
- var e = this.words,
610
- n = t.words,
611
- r = this.sigBytes,
612
- o = t.sigBytes
613
- if ((this.clamp(), r % 4))
614
- for (var i = 0; i < o; i++) {
615
- var a = (n[i >>> 2] >>> (24 - (i % 4) * 8)) & 255
616
- e[(r + i) >>> 2] |= a << (24 - ((r + i) % 4) * 8)
617
- }
618
- else for (var c = 0; c < o; c += 4) e[(r + c) >>> 2] = n[c >>> 2]
619
- return (this.sigBytes += o), this
620
- },
621
- clamp: function () {
622
- var e = this.words,
623
- n = this.sigBytes
624
- ;(e[n >>> 2] &= 4294967295 << (32 - (n % 4) * 8)), (e.length = t.ceil(n / 4))
625
- },
626
- clone: function () {
627
- var t = s.clone.call(this)
628
- return (t.words = this.words.slice(0)), t
629
- },
630
- random: function (t) {
631
- for (var e = [], n = 0; n < t; n += 4) e.push(o())
632
- return new u.init(e, t)
633
- },
634
- })),
635
- l = (a.enc = {}),
636
- f = (l.Hex = {
637
- stringify: function (t) {
638
- for (var e = t.words, n = t.sigBytes, r = [], o = 0; o < n; o++) {
639
- var i = (e[o >>> 2] >>> (24 - (o % 4) * 8)) & 255
640
- r.push((i >>> 4).toString(16)), r.push((15 & i).toString(16))
641
- }
642
- return r.join('')
643
- },
644
- parse: function (t) {
645
- for (var e = t.length, n = [], r = 0; r < e; r += 2)
646
- n[r >>> 3] |= parseInt(t.substr(r, 2), 16) << (24 - (r % 8) * 4)
647
- return new u.init(n, e / 2)
648
- },
649
- }),
650
- p = (l.Latin1 = {
651
- stringify: function (t) {
652
- for (var e = t.words, n = t.sigBytes, r = [], o = 0; o < n; o++) {
653
- var i = (e[o >>> 2] >>> (24 - (o % 4) * 8)) & 255
654
- r.push(String.fromCharCode(i))
655
- }
656
- return r.join('')
657
- },
658
- parse: function (t) {
659
- for (var e = t.length, n = [], r = 0; r < e; r++)
660
- n[r >>> 2] |= (255 & t.charCodeAt(r)) << (24 - (r % 4) * 8)
661
- return new u.init(n, e)
662
- },
663
- }),
664
- d = (l.Utf8 = {
665
- stringify: function (t) {
666
- try {
667
- return decodeURIComponent(escape(p.stringify(t)))
668
- } catch (t) {
669
- throw new Error('Malformed UTF-8 data')
670
- }
671
- },
672
- parse: function (t) {
673
- return p.parse(unescape(encodeURIComponent(t)))
674
- },
675
- }),
676
- h = (c.BufferedBlockAlgorithm = s.extend({
677
- reset: function () {
678
- ;(this._data = new u.init()), (this._nDataBytes = 0)
679
- },
680
- _append: function (t) {
681
- 'string' == typeof t && (t = d.parse(t)), this._data.concat(t), (this._nDataBytes += t.sigBytes)
682
- },
683
- _process: function (e) {
684
- var n,
685
- r = this._data,
686
- o = r.words,
687
- i = r.sigBytes,
688
- a = this.blockSize,
689
- c = i / (4 * a),
690
- s = (c = e ? t.ceil(c) : t.max((0 | c) - this._minBufferSize, 0)) * a,
691
- l = t.min(4 * s, i)
692
- if (s) {
693
- for (var f = 0; f < s; f += a) this._doProcessBlock(o, f)
694
- ;(n = o.splice(0, s)), (r.sigBytes -= l)
695
- }
696
- return new u.init(n, l)
697
- },
698
- clone: function () {
699
- var t = s.clone.call(this)
700
- return (t._data = this._data.clone()), t
701
- },
702
- _minBufferSize: 0,
703
- })),
704
- y =
705
- ((c.Hasher = h.extend({
706
- cfg: s.extend(),
707
- init: function (t) {
708
- ;(this.cfg = this.cfg.extend(t)), this.reset()
709
- },
710
- reset: function () {
711
- h.reset.call(this), this._doReset()
712
- },
713
- update: function (t) {
714
- return this._append(t), this._process(), this
715
- },
716
- finalize: function (t) {
717
- return t && this._append(t), this._doFinalize()
718
- },
719
- blockSize: 16,
720
- _createHelper: function (t) {
721
- return function (e, n) {
722
- return new t.init(n).finalize(e)
723
- }
724
- },
725
- _createHmacHelper: function (t) {
726
- return function (e, n) {
727
- return new y.HMAC.init(t, n).finalize(e)
728
- }
729
- },
730
- })),
731
- (a.algo = {}))
732
- return a
733
- })(Math)),
734
- r)
735
- },
736
- 885: function (t, e, n) {
737
- var r, o, i
738
- t.exports =
739
- ((i = n(112)),
740
- (o = (r = i).lib.WordArray),
741
- (r.enc.Base64 = {
742
- stringify: function (t) {
743
- var e = t.words,
744
- n = t.sigBytes,
745
- r = this._map
746
- t.clamp()
747
- for (var o = [], i = 0; i < n; i += 3)
748
- for (
749
- var a =
750
- (((e[i >>> 2] >>> (24 - (i % 4) * 8)) & 255) << 16) |
751
- (((e[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 255) << 8) |
752
- ((e[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 255),
753
- c = 0;
754
- c < 4 && i + 0.75 * c < n;
755
- c++
756
- )
757
- o.push(r.charAt((a >>> (6 * (3 - c))) & 63))
758
- var s = r.charAt(64)
759
- if (s) for (; o.length % 4; ) o.push(s)
760
- return o.join('')
761
- },
762
- parse: function (t) {
763
- var e = t.length,
764
- n = this._map,
765
- r = this._reverseMap
766
- if (!r) {
767
- r = this._reverseMap = []
768
- for (var i = 0; i < n.length; i++) r[n.charCodeAt(i)] = i
769
- }
770
- var a = n.charAt(64)
771
- if (a) {
772
- var c = t.indexOf(a)
773
- ;-1 !== c && (e = c)
774
- }
775
- return (function (t, e, n) {
776
- for (var r = [], i = 0, a = 0; a < e; a++)
777
- if (a % 4) {
778
- var c = n[t.charCodeAt(a - 1)] << ((a % 4) * 2),
779
- s = n[t.charCodeAt(a)] >>> (6 - (a % 4) * 2),
780
- u = c | s
781
- ;(r[i >>> 2] |= u << (24 - (i % 4) * 8)), i++
782
- }
783
- return o.create(r, i)
784
- })(t, e, r)
785
- },
786
- _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
787
- }),
788
- i.enc.Base64)
789
- },
790
- 287: function (t, e, n) {
791
- var r
792
- t.exports = ((r = n(112)), r.enc.Utf8)
793
- },
794
- 652: function (t, e, n) {
795
- var r
796
- t.exports = ((r = n(112)), n(232), n(456), r.HmacSHA256)
797
- },
798
- 456: function (t, e, n) {
799
- var r, o, i, a
800
- t.exports =
801
- ((r = n(112)),
802
- (i = (o = r).lib.Base),
803
- (a = o.enc.Utf8),
804
- void (o.algo.HMAC = i.extend({
805
- init: function (t, e) {
806
- ;(t = this._hasher = new t.init()), 'string' == typeof e && (e = a.parse(e))
807
- var n = t.blockSize,
808
- r = 4 * n
809
- e.sigBytes > r && (e = t.finalize(e)), e.clamp()
810
- for (
811
- var o = (this._oKey = e.clone()), i = (this._iKey = e.clone()), c = o.words, s = i.words, u = 0;
812
- u < n;
813
- u++
814
- )
815
- (c[u] ^= 1549556828), (s[u] ^= 909522486)
816
- ;(o.sigBytes = i.sigBytes = r), this.reset()
817
- },
818
- reset: function () {
819
- var t = this._hasher
820
- t.reset(), t.update(this._iKey)
821
- },
822
- update: function (t) {
823
- return this._hasher.update(t), this
824
- },
825
- finalize: function (t) {
826
- var e = this._hasher,
827
- n = e.finalize(t)
828
- return e.reset(), e.finalize(this._oKey.clone().concat(n))
829
- },
830
- })))
831
- },
832
- 232: function (t, e, n) {
833
- var r
834
- t.exports =
835
- ((r = n(112)),
836
- (function (t) {
837
- var e = r,
838
- n = e.lib,
839
- o = n.WordArray,
840
- i = n.Hasher,
841
- a = e.algo,
842
- c = [],
843
- s = []
844
- !(function () {
845
- function e(e) {
846
- for (var n = t.sqrt(e), r = 2; r <= n; r++) if (!(e % r)) return !1
847
- return !0
848
- }
849
- function n(t) {
850
- return (4294967296 * (t - (0 | t))) | 0
851
- }
852
- for (var r = 2, o = 0; o < 64; )
853
- e(r) && (o < 8 && (c[o] = n(t.pow(r, 0.5))), (s[o] = n(t.pow(r, 1 / 3))), o++), r++
854
- })()
855
- var u = [],
856
- l = (a.SHA256 = i.extend({
857
- _doReset: function () {
858
- this._hash = new o.init(c.slice(0))
859
- },
860
- _doProcessBlock: function (t, e) {
861
- for (
862
- var n = this._hash.words,
863
- r = n[0],
864
- o = n[1],
865
- i = n[2],
866
- a = n[3],
867
- c = n[4],
868
- l = n[5],
869
- f = n[6],
870
- p = n[7],
871
- d = 0;
872
- d < 64;
873
- d++
874
- ) {
875
- if (d < 16) u[d] = 0 | t[e + d]
876
- else {
877
- var h = u[d - 15],
878
- y = ((h << 25) | (h >>> 7)) ^ ((h << 14) | (h >>> 18)) ^ (h >>> 3),
879
- v = u[d - 2],
880
- g = ((v << 15) | (v >>> 17)) ^ ((v << 13) | (v >>> 19)) ^ (v >>> 10)
881
- u[d] = y + u[d - 7] + g + u[d - 16]
882
- }
883
- var w = (r & o) ^ (r & i) ^ (o & i),
884
- m = ((r << 30) | (r >>> 2)) ^ ((r << 19) | (r >>> 13)) ^ ((r << 10) | (r >>> 22)),
885
- b =
886
- p +
887
- (((c << 26) | (c >>> 6)) ^ ((c << 21) | (c >>> 11)) ^ ((c << 7) | (c >>> 25))) +
888
- ((c & l) ^ (~c & f)) +
889
- s[d] +
890
- u[d]
891
- ;(p = f), (f = l), (l = c), (c = (a + b) | 0), (a = i), (i = o), (o = r), (r = (b + (m + w)) | 0)
892
- }
893
- ;(n[0] = (n[0] + r) | 0),
894
- (n[1] = (n[1] + o) | 0),
895
- (n[2] = (n[2] + i) | 0),
896
- (n[3] = (n[3] + a) | 0),
897
- (n[4] = (n[4] + c) | 0),
898
- (n[5] = (n[5] + l) | 0),
899
- (n[6] = (n[6] + f) | 0),
900
- (n[7] = (n[7] + p) | 0)
901
- },
902
- _doFinalize: function () {
903
- var e = this._data,
904
- n = e.words,
905
- r = 8 * this._nDataBytes,
906
- o = 8 * e.sigBytes
907
- return (
908
- (n[o >>> 5] |= 128 << (24 - (o % 32))),
909
- (n[14 + (((o + 64) >>> 9) << 4)] = t.floor(r / 4294967296)),
910
- (n[15 + (((o + 64) >>> 9) << 4)] = r),
911
- (e.sigBytes = 4 * n.length),
912
- this._process(),
913
- this._hash
914
- )
915
- },
916
- clone: function () {
917
- var t = i.clone.call(this)
918
- return (t._hash = this._hash.clone()), t
919
- },
920
- }))
921
- ;(e.SHA256 = i._createHelper(l)), (e.HmacSHA256 = i._createHmacHelper(l))
922
- })(Math),
923
- r.SHA256)
924
- },
925
- 136: (t, e, n) => {
926
- 'use strict'
927
- n.r(e),
928
- n.d(e, {
929
- adapters: () => i,
930
- cache: () => a,
931
- constants: () => r,
932
- events: () => c,
933
- helpers: () => s,
934
- jwt: () => xt,
935
- utils: () => o,
936
- })
937
- var r = {}
938
- n.r(r),
939
- n.d(r, {
940
- COMMUNITY_SITE_URL: () => g,
941
- ERRORS: () => w,
942
- IS_DEBUG_MODE: () => v,
943
- OATUH_LOGINTYPE: () => m,
944
- getProtocol: () => h,
945
- getSdkName: () => f,
946
- setProtocol: () => d,
947
- setSdkName: () => l,
948
- })
949
- var o = {}
950
- n.r(o),
951
- n.d(o, {
952
- createPromiseCallback: () => V,
953
- createSign: () => B,
954
- execCallback: () => z,
955
- formatUrl: () => L,
956
- genSeqId: () => M,
957
- getHash: () => J,
958
- getQuery: () => H,
959
- isArray: () => I,
960
- isFormData: () => k,
961
- isInstanceOf: () => T,
962
- isNull: () => x,
963
- isPalinObject: () => R,
964
- isString: () => j,
965
- isUndefined: () => P,
966
- printError: () => W,
967
- printGroupLog: () => K,
968
- printInfo: () => $,
969
- printWarn: () => F,
970
- removeParam: () => q,
971
- sleep: () => Y,
972
- throwError: () => G,
973
- toQueryString: () => D,
974
- transformPhone: () => X,
975
- })
976
- var i = {}
977
- n.r(i), n.d(i, { RUNTIME: () => Z, useAdapters: () => it, useDefaultAdapter: () => at })
978
- var a = {}
979
- n.r(a), n.d(a, { CloudbaseCache: () => ft })
980
- var c = {}
981
- n.r(c),
982
- n.d(c, {
983
- CloudbaseEvent: () => ht,
984
- CloudbaseEventEmitter: () => vt,
985
- IErrorEvent: () => yt,
986
- activateEvent: () => mt,
987
- addEventListener: () => wt,
988
- removeEventListener: () => bt,
989
- })
990
- var s = {}
991
- n.r(s), n.d(s, { catchErrorsDecorator: () => At })
992
- var u = '@cloudbase/js-sdk'
993
- function l(t) {
994
- u = t
995
- }
996
- function f() {
997
- return u
998
- }
999
- var p = 'https:'
1000
- function d(t) {
1001
- p = t
1002
- }
1003
- function h() {
1004
- return p
1005
- }
1006
- var y,
1007
- v = !1,
1008
- g = 'https://support.qq.com/products/148793',
1009
- w = {
1010
- INVALID_PARAMS: 'INVALID_PARAMS',
1011
- INVALID_SYNTAX: 'INVALID_SYNTAX',
1012
- INVALID_OPERATION: 'INVALID_OPERATION',
1013
- OPERATION_FAIL: 'OPERATION_FAIL',
1014
- NETWORK_ERROR: 'NETWORK_ERROR',
1015
- UNKOWN_ERROR: 'UNKOWN_ERROR',
1016
- },
1017
- m = 'constants'
1018
- !(function (t) {
1019
- ;(t.local = 'local'), (t.none = 'none'), (t.session = 'session')
1020
- })(y || (y = {}))
1021
- var b = function () {},
1022
- _ = function () {},
1023
- O = n(652),
1024
- E = n.n(O),
1025
- S = n(885),
1026
- N = n.n(S),
1027
- A = n(287),
1028
- C = n.n(A)
1029
- function I(t) {
1030
- return '[object Array]' === Object.prototype.toString.call(t)
1031
- }
1032
- function j(t) {
1033
- return 'string' == typeof t
1034
- }
1035
- function P(t) {
1036
- return void 0 === t
1037
- }
1038
- function R(t) {
1039
- return '[object Object]' === Object.prototype.toString.call(t)
1040
- }
1041
- function x(t) {
1042
- return '[object Null]' === Object.prototype.toString.call(t)
1043
- }
1044
- function T(t, e) {
1045
- return t instanceof e
1046
- }
1047
- function k(t) {
1048
- return '[object FormData]' === Object.prototype.toString.call(t)
1049
- }
1050
- function M() {
1051
- return Math.random().toString(16).slice(2)
1052
- }
1053
- function L(t, e, n) {
1054
- void 0 === n && (n = {})
1055
- var r = /\?/.test(e),
1056
- o = ''
1057
- return (
1058
- Object.keys(n).forEach(function (t) {
1059
- '' === o ? !r && (e += '?') : (o += '&'), (o += ''.concat(t, '=').concat(encodeURIComponent(n[t])))
1060
- }),
1061
- /^http(s)?:\/\//.test((e += o)) ? e : ''.concat(t).concat(e)
1062
- )
1063
- }
1064
- function U(t) {
1065
- var e = N().stringify(t)
1066
- return (e = (e = (e = e.replace(/=+$/, '')).replace(/\+/g, '-')).replace(/\//g, '_'))
1067
- }
1068
- function B(t, e) {
1069
- var n = U(C().parse(JSON.stringify({ alg: 'HS256', typ: 'JWT' }))),
1070
- r = U(C().parse(JSON.stringify(t))),
1071
- o = ''.concat(n, '.').concat(r),
1072
- i = U(E()(o, e))
1073
- return ''.concat(o, '.').concat(i)
1074
- }
1075
- function D(t) {
1076
- void 0 === t && (t = {})
1077
- var e = []
1078
- return (
1079
- Object.keys(t).forEach(function (n) {
1080
- e.push(''.concat(n, '=').concat(encodeURIComponent(t[n])))
1081
- }),
1082
- e.join('&')
1083
- )
1084
- }
1085
- function H(t, e) {
1086
- if ('undefined' == typeof window) return !1
1087
- var n = e || window.location.search,
1088
- r = new RegExp('(^|&)'.concat(t, '=([^&]*)(&|$)')),
1089
- o = n.substr(n.indexOf('?') + 1).match(r)
1090
- return null != o ? o[2] : ''
1091
- }
1092
- var J = function (t) {
1093
- if ('undefined' == typeof window) return ''
1094
- var e = window.location.hash.match(new RegExp('[#?&/]'.concat(t, '=([^&#]*)')))
1095
- return e ? e[1] : ''
1096
- }
1097
- function q(t, e) {
1098
- var n = e.split('?')[0],
1099
- r = [],
1100
- o = -1 !== e.indexOf('?') ? e.split('?')[1] : ''
1101
- if ('' !== o) {
1102
- for (var i = (r = o.split('&')).length - 1; i >= 0; i -= 1) r[i].split('=')[0] === t && r.splice(i, 1)
1103
- n = ''.concat(n, '?').concat(r.join('&'))
1104
- }
1105
- return n
1106
- }
1107
- function V() {
1108
- var t
1109
- if (!Promise) {
1110
- ;(t = function () {}).promise = {}
1111
- var e = function () {
1112
- throw new Error(
1113
- 'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.',
1114
- )
1115
- }
1116
- return (
1117
- Object.defineProperty(t.promise, 'then', { get: e }),
1118
- Object.defineProperty(t.promise, 'catch', { get: e }),
1119
- t
1120
- )
1121
- }
1122
- var n = new Promise(function (e, n) {
1123
- t = function (t, r) {
1124
- return t ? n(t) : e(r)
1125
- }
1126
- })
1127
- return (t.promise = n), t
1128
- }
1129
- function z(t, e, n) {
1130
- if ((void 0 === n && (n = null), t && 'function' == typeof t)) return t(e, n)
1131
- if (e) throw e
1132
- return n
1133
- }
1134
- function F(t, e) {
1135
- console.warn('['.concat(f(), '][').concat(t, ']:').concat(e))
1136
- }
1137
- function W(t, e) {
1138
- console.error({ code: t, msg: '['.concat(f(), '][').concat(t, ']:').concat(e) })
1139
- }
1140
- function $(t, e) {
1141
- console.log('['.concat(f(), '][').concat(t, ']:').concat(e))
1142
- }
1143
- function G(t, e) {
1144
- throw new Error(JSON.stringify({ code: t, msg: '['.concat(f(), '][').concat(t, ']:').concat(e) }))
1145
- }
1146
- function K(t) {
1147
- var e = t.title,
1148
- n = t.subtitle,
1149
- r = void 0 === n ? '' : n,
1150
- o = t.content,
1151
- i = void 0 === o ? [] : o,
1152
- a = t.printTrace,
1153
- c = void 0 !== a && a,
1154
- s = t.collapsed
1155
- void 0 !== s && s ? console.groupCollapsed(e, r) : console.group(e, r)
1156
- for (var u = 0, l = i; u < l.length; u++) {
1157
- var f = l[u],
1158
- p = f.type,
1159
- d = f.body
1160
- switch (p) {
1161
- case 'info':
1162
- console.log(d)
1163
- break
1164
- case 'warn':
1165
- console.warn(d)
1166
- break
1167
- case 'error':
1168
- console.error(d)
1169
- }
1170
- }
1171
- c && console.trace('stack trace:'), console.groupEnd()
1172
- }
1173
- var Y = function (t) {
1174
- return (
1175
- void 0 === t && (t = 0),
1176
- new Promise(function (e) {
1177
- return setTimeout(e, t)
1178
- })
1179
- )
1180
- }
1181
- function X(t) {
1182
- return '+86'.concat(t)
1183
- }
1184
- var Q,
1185
- Z,
1186
- tt =
1187
- ((Q = function (t, e) {
1188
- return (Q =
1189
- Object.setPrototypeOf ||
1190
- ({ __proto__: [] } instanceof Array &&
1191
- function (t, e) {
1192
- t.__proto__ = e
1193
- }) ||
1194
- function (t, e) {
1195
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
1196
- })(t, e)
1197
- }),
1198
- function (t, e) {
1199
- if ('function' != typeof e && null !== e)
1200
- throw new TypeError('Class extends value ' + String(e) + ' is not a constructor or null')
1201
- function n() {
1202
- this.constructor = t
1203
- }
1204
- Q(t, e), (t.prototype = null === e ? Object.create(e) : ((n.prototype = e.prototype), new n()))
1205
- }),
1206
- et = function () {
1207
- return (et =
1208
- Object.assign ||
1209
- function (t) {
1210
- for (var e, n = 1, r = arguments.length; n < r; n++)
1211
- for (var o in (e = arguments[n])) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
1212
- return t
1213
- }).apply(this, arguments)
1214
- },
1215
- nt = function (t, e, n, r) {
1216
- return new (n || (n = Promise))(function (o, i) {
1217
- function a(t) {
1218
- try {
1219
- s(r.next(t))
1220
- } catch (t) {
1221
- i(t)
1222
- }
1223
- }
1224
- function c(t) {
1225
- try {
1226
- s(r.throw(t))
1227
- } catch (t) {
1228
- i(t)
1229
- }
1230
- }
1231
- function s(t) {
1232
- var e
1233
- t.done
1234
- ? o(t.value)
1235
- : ((e = t.value),
1236
- e instanceof n
1237
- ? e
1238
- : new n(function (t) {
1239
- t(e)
1240
- })).then(a, c)
1241
- }
1242
- s((r = r.apply(t, e || [])).next())
1243
- })
1244
- },
1245
- rt = function (t, e) {
1246
- var n,
1247
- r,
1248
- o,
1249
- i,
1250
- a = {
1251
- label: 0,
1252
- sent: function () {
1253
- if (1 & o[0]) throw o[1]
1254
- return o[1]
1255
- },
1256
- trys: [],
1257
- ops: [],
1258
- }
1259
- return (
1260
- (i = { next: c(0), throw: c(1), return: c(2) }),
1261
- 'function' == typeof Symbol &&
1262
- (i[Symbol.iterator] = function () {
1263
- return this
1264
- }),
1265
- i
1266
- )
1267
- function c(c) {
1268
- return function (s) {
1269
- return (function (c) {
1270
- if (n) throw new TypeError('Generator is already executing.')
1271
- for (; i && ((i = 0), c[0] && (a = 0)), a; )
1272
- try {
1273
- if (
1274
- ((n = 1),
1275
- r &&
1276
- (o = 2 & c[0] ? r.return : c[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) &&
1277
- !(o = o.call(r, c[1])).done)
1278
- )
1279
- return o
1280
- switch (((r = 0), o && (c = [2 & c[0], o.value]), c[0])) {
1281
- case 0:
1282
- case 1:
1283
- o = c
1284
- break
1285
- case 4:
1286
- return a.label++, { value: c[1], done: !1 }
1287
- case 5:
1288
- a.label++, (r = c[1]), (c = [0])
1289
- continue
1290
- case 7:
1291
- ;(c = a.ops.pop()), a.trys.pop()
1292
- continue
1293
- default:
1294
- if (!((o = a.trys), (o = o.length > 0 && o[o.length - 1]) || (6 !== c[0] && 2 !== c[0]))) {
1295
- a = 0
1296
- continue
1297
- }
1298
- if (3 === c[0] && (!o || (c[1] > o[0] && c[1] < o[3]))) {
1299
- a.label = c[1]
1300
- break
1301
- }
1302
- if (6 === c[0] && a.label < o[1]) {
1303
- ;(a.label = o[1]), (o = c)
1304
- break
1305
- }
1306
- if (o && a.label < o[2]) {
1307
- ;(a.label = o[2]), a.ops.push(c)
1308
- break
1309
- }
1310
- o[2] && a.ops.pop(), a.trys.pop()
1311
- continue
1312
- }
1313
- c = e.call(t, a)
1314
- } catch (t) {
1315
- ;(c = [6, t]), (r = 0)
1316
- } finally {
1317
- n = o = 0
1318
- }
1319
- if (5 & c[0]) throw c[1]
1320
- return { value: c[0] ? c[1] : void 0, done: !0 }
1321
- })([c, s])
1322
- }
1323
- }
1324
- },
1325
- ot = (function (t) {
1326
- function e(e) {
1327
- var n = t.call(this) || this,
1328
- r = e.timeout,
1329
- o = e.timeoutMsg,
1330
- i = e.restrictedMethods
1331
- return (
1332
- (n.timeout = r || 0),
1333
- (n.timeoutMsg = o || '请求超时'),
1334
- (n.restrictedMethods = i || ['get', 'post', 'upload', 'download']),
1335
- n
1336
- )
1337
- }
1338
- return (
1339
- tt(e, t),
1340
- (e.prototype.get = function (t) {
1341
- return this.request(et(et({}, t), { method: 'get' }), this.restrictedMethods.includes('get'))
1342
- }),
1343
- (e.prototype.post = function (t) {
1344
- return this.request(et(et({}, t), { method: 'post' }), this.restrictedMethods.includes('post'))
1345
- }),
1346
- (e.prototype.put = function (t) {
1347
- return this.request(et(et({}, t), { method: 'put' }))
1348
- }),
1349
- (e.prototype.upload = function (t) {
1350
- var e = t.data,
1351
- n = t.file,
1352
- r = t.name,
1353
- o = t.method,
1354
- i = t.headers,
1355
- a = void 0 === i ? {} : i,
1356
- c = { post: 'post', put: 'put' }[null == o ? void 0 : o.toLowerCase()] || 'put',
1357
- s = new FormData()
1358
- return 'post' === c
1359
- ? (Object.keys(e).forEach(function (t) {
1360
- s.append(t, e[t])
1361
- }),
1362
- s.append('key', r),
1363
- s.append('file', n),
1364
- this.request(et(et({}, t), { data: s, method: c }), this.restrictedMethods.includes('upload')))
1365
- : this.request(
1366
- et(et({}, t), { method: 'put', headers: a, body: n }),
1367
- this.restrictedMethods.includes('upload'),
1368
- )
1369
- }),
1370
- (e.prototype.download = function (t) {
1371
- return nt(this, void 0, void 0, function () {
1372
- var e, n, r, o
1373
- return rt(this, function (i) {
1374
- switch (i.label) {
1375
- case 0:
1376
- return (
1377
- i.trys.push([0, 2, , 3]),
1378
- [4, this.get(et(et({}, t), { headers: {}, responseType: 'blob' }))]
1379
- )
1380
- case 1:
1381
- return (
1382
- (e = i.sent().data),
1383
- (n = window.URL.createObjectURL(new Blob([e]))),
1384
- (r = decodeURIComponent(new URL(t.url).pathname.split('/').pop() || '')),
1385
- ((o = document.createElement('a')).href = n),
1386
- o.setAttribute('download', r),
1387
- (o.style.display = 'none'),
1388
- document.body.appendChild(o),
1389
- o.click(),
1390
- window.URL.revokeObjectURL(n),
1391
- document.body.removeChild(o),
1392
- [3, 3]
1393
- )
1394
- case 2:
1395
- return i.sent(), [3, 3]
1396
- case 3:
1397
- return [
1398
- 2,
1399
- new Promise(function (e) {
1400
- e({ statusCode: 200, tempFilePath: t.url })
1401
- }),
1402
- ]
1403
- }
1404
- })
1405
- })
1406
- }),
1407
- (e.prototype.request = function (t, e) {
1408
- var n = this
1409
- void 0 === e && (e = !1)
1410
- var r = String(t.method).toLowerCase() || 'get'
1411
- return new Promise(function (o) {
1412
- var i,
1413
- a,
1414
- c = t.url,
1415
- s = t.headers,
1416
- u = void 0 === s ? {} : s,
1417
- l = t.data,
1418
- f = t.responseType,
1419
- p = t.withCredentials,
1420
- d = t.body,
1421
- y = t.onUploadProgress,
1422
- v = L(h(), c, 'get' === r ? l : {}),
1423
- g = new XMLHttpRequest()
1424
- g.open(r, v),
1425
- f && (g.responseType = f),
1426
- Object.keys(u).forEach(function (t) {
1427
- g.setRequestHeader(t, u[t])
1428
- }),
1429
- y && g.upload.addEventListener('progress', y),
1430
- (g.onreadystatechange = function () {
1431
- var t = {}
1432
- if (4 === g.readyState) {
1433
- var e = g
1434
- .getAllResponseHeaders()
1435
- .trim()
1436
- .split(/[\r\n]+/),
1437
- n = {}
1438
- e.forEach(function (t) {
1439
- var e = t.split(': '),
1440
- r = e.shift().toLowerCase(),
1441
- o = e.join(': ')
1442
- n[r] = o
1443
- }),
1444
- (t.header = n),
1445
- (t.statusCode = g.status)
1446
- try {
1447
- t.data = 'blob' === f ? g.response : JSON.parse(g.responseText)
1448
- } catch (e) {
1449
- t.data = 'blob' === f ? g.response : g.responseText
1450
- }
1451
- clearTimeout(i), o(t)
1452
- }
1453
- }),
1454
- e &&
1455
- n.timeout &&
1456
- (i = setTimeout(function () {
1457
- console.warn(n.timeoutMsg), g.abort()
1458
- }, n.timeout)),
1459
- (a = k(l)
1460
- ? l
1461
- : 'application/x-www-form-urlencoded' === u['content-type']
1462
- ? D(l)
1463
- : d || (l ? JSON.stringify(l) : void 0)),
1464
- p && (g.withCredentials = !0),
1465
- g.send(a)
1466
- })
1467
- }),
1468
- e
1469
- )
1470
- })(b)
1471
- function it(t) {
1472
- for (var e = 0, n = I(t) ? t : [t]; e < n.length; e++) {
1473
- var r = n[e],
1474
- o = r.isMatch,
1475
- i = r.genAdapter,
1476
- a = r.runtime
1477
- if (o()) return { adapter: i(), runtime: a }
1478
- }
1479
- }
1480
- function at() {
1481
- return {
1482
- adapter: { root: window, reqClass: ot, wsClass: WebSocket, localStorage: localStorage },
1483
- runtime: Z.WEB,
1484
- }
1485
- }
1486
- !(function (t) {
1487
- ;(t.WEB = 'web'), (t.WX_MP = 'wx_mp')
1488
- })(Z || (Z = {}))
1489
- var ct = (function () {
1490
- var t = function (e, n) {
1491
- return (t =
1492
- Object.setPrototypeOf ||
1493
- ({ __proto__: [] } instanceof Array &&
1494
- function (t, e) {
1495
- t.__proto__ = e
1496
- }) ||
1497
- function (t, e) {
1498
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
1499
- })(e, n)
1500
- }
1501
- return function (e, n) {
1502
- if ('function' != typeof n && null !== n)
1503
- throw new TypeError('Class extends value ' + String(n) + ' is not a constructor or null')
1504
- function r() {
1505
- this.constructor = e
1506
- }
1507
- t(e, n), (e.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r()))
1508
- }
1509
- })(),
1510
- st = function (t, e, n, r) {
1511
- return new (n || (n = Promise))(function (o, i) {
1512
- function a(t) {
1513
- try {
1514
- s(r.next(t))
1515
- } catch (t) {
1516
- i(t)
1517
- }
1518
- }
1519
- function c(t) {
1520
- try {
1521
- s(r.throw(t))
1522
- } catch (t) {
1523
- i(t)
1524
- }
1525
- }
1526
- function s(t) {
1527
- var e
1528
- t.done
1529
- ? o(t.value)
1530
- : ((e = t.value),
1531
- e instanceof n
1532
- ? e
1533
- : new n(function (t) {
1534
- t(e)
1535
- })).then(a, c)
1536
- }
1537
- s((r = r.apply(t, e || [])).next())
1538
- })
1539
- },
1540
- ut = function (t, e) {
1541
- var n,
1542
- r,
1543
- o,
1544
- i,
1545
- a = {
1546
- label: 0,
1547
- sent: function () {
1548
- if (1 & o[0]) throw o[1]
1549
- return o[1]
1550
- },
1551
- trys: [],
1552
- ops: [],
1553
- }
1554
- return (
1555
- (i = { next: c(0), throw: c(1), return: c(2) }),
1556
- 'function' == typeof Symbol &&
1557
- (i[Symbol.iterator] = function () {
1558
- return this
1559
- }),
1560
- i
1561
- )
1562
- function c(c) {
1563
- return function (s) {
1564
- return (function (c) {
1565
- if (n) throw new TypeError('Generator is already executing.')
1566
- for (; i && ((i = 0), c[0] && (a = 0)), a; )
1567
- try {
1568
- if (
1569
- ((n = 1),
1570
- r &&
1571
- (o = 2 & c[0] ? r.return : c[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) &&
1572
- !(o = o.call(r, c[1])).done)
1573
- )
1574
- return o
1575
- switch (((r = 0), o && (c = [2 & c[0], o.value]), c[0])) {
1576
- case 0:
1577
- case 1:
1578
- o = c
1579
- break
1580
- case 4:
1581
- return a.label++, { value: c[1], done: !1 }
1582
- case 5:
1583
- a.label++, (r = c[1]), (c = [0])
1584
- continue
1585
- case 7:
1586
- ;(c = a.ops.pop()), a.trys.pop()
1587
- continue
1588
- default:
1589
- if (!((o = a.trys), (o = o.length > 0 && o[o.length - 1]) || (6 !== c[0] && 2 !== c[0]))) {
1590
- a = 0
1591
- continue
1592
- }
1593
- if (3 === c[0] && (!o || (c[1] > o[0] && c[1] < o[3]))) {
1594
- a.label = c[1]
1595
- break
1596
- }
1597
- if (6 === c[0] && a.label < o[1]) {
1598
- ;(a.label = o[1]), (o = c)
1599
- break
1600
- }
1601
- if (o && a.label < o[2]) {
1602
- ;(a.label = o[2]), a.ops.push(c)
1603
- break
1604
- }
1605
- o[2] && a.ops.pop(), a.trys.pop()
1606
- continue
1607
- }
1608
- c = e.call(t, a)
1609
- } catch (t) {
1610
- ;(c = [6, t]), (r = 0)
1611
- } finally {
1612
- n = o = 0
1613
- }
1614
- if (5 & c[0]) throw c[1]
1615
- return { value: c[0] ? c[1] : void 0, done: !0 }
1616
- })([c, s])
1617
- }
1618
- }
1619
- },
1620
- lt = (function (t) {
1621
- function e(e) {
1622
- var n = t.call(this) || this
1623
- return (n.root = e), e.tcbCacheObject || (e.tcbCacheObject = {}), n
1624
- }
1625
- return (
1626
- ct(e, t),
1627
- (e.prototype.setItem = function (t, e) {
1628
- this.root.tcbCacheObject[t] = e
1629
- }),
1630
- (e.prototype.getItem = function (t) {
1631
- return this.root.tcbCacheObject[t]
1632
- }),
1633
- (e.prototype.removeItem = function (t) {
1634
- delete this.root.tcbCacheObject[t]
1635
- }),
1636
- (e.prototype.clear = function () {
1637
- delete this.root.tcbCacheObject
1638
- }),
1639
- e
1640
- )
1641
- })(_)
1642
- var ft = (function () {
1643
- function t(t) {
1644
- this.keys = {}
1645
- var e = t.persistence,
1646
- n = t.platformInfo,
1647
- r = void 0 === n ? {} : n,
1648
- o = t.keys,
1649
- i = void 0 === o ? {} : o
1650
- ;(this.platformInfo = r),
1651
- this.storage ||
1652
- ((this.persistenceTag = this.platformInfo.adapter.primaryStorage || e),
1653
- (this.storage = (function (t, e) {
1654
- switch (t) {
1655
- case 'local':
1656
- return e.localStorage
1657
- ? e.localStorage
1658
- : (F(w.INVALID_PARAMS, 'localStorage is not supported on current platform'), new lt(e.root))
1659
- case 'none':
1660
- return new lt(e.root)
1661
- default:
1662
- return e.localStorage
1663
- ? e.localStorage
1664
- : (F(w.INVALID_PARAMS, 'localStorage is not supported on current platform'), new lt(e.root))
1665
- }
1666
- })(this.persistenceTag, this.platformInfo.adapter)),
1667
- (this.keys = i))
1668
- }
1669
- return (
1670
- Object.defineProperty(t.prototype, 'mode', {
1671
- get: function () {
1672
- return this.storage.mode || 'sync'
1673
- },
1674
- enumerable: !1,
1675
- configurable: !0,
1676
- }),
1677
- Object.defineProperty(t.prototype, 'persistence', {
1678
- get: function () {
1679
- return this.persistenceTag
1680
- },
1681
- enumerable: !1,
1682
- configurable: !0,
1683
- }),
1684
- (t.prototype.setStore = function (t, e, n) {
1685
- if ('async' !== this.mode) {
1686
- if (this.storage)
1687
- try {
1688
- var r = { version: n || 'localCachev1', content: e }
1689
- this.storage.setItem(t, JSON.stringify(r))
1690
- } catch (t) {
1691
- throw new Error(
1692
- JSON.stringify({
1693
- code: w.OPERATION_FAIL,
1694
- msg: '['.concat(f(), '][').concat(w.OPERATION_FAIL, ']setStore failed'),
1695
- info: t,
1696
- }),
1697
- )
1698
- }
1699
- } else
1700
- F(
1701
- w.INVALID_OPERATION,
1702
- "current platform's storage is asynchronous, please use setStoreAsync insteed",
1703
- )
1704
- }),
1705
- (t.prototype.setStoreAsync = function (t, e, n) {
1706
- return st(this, void 0, void 0, function () {
1707
- var r
1708
- return ut(this, function (o) {
1709
- switch (o.label) {
1710
- case 0:
1711
- if (!this.storage) return [2]
1712
- o.label = 1
1713
- case 1:
1714
- return (
1715
- o.trys.push([1, 3, , 4]),
1716
- (r = { version: n || 'localCachev1', content: e }),
1717
- [4, this.storage.setItem(t, JSON.stringify(r))]
1718
- )
1719
- case 2:
1720
- return o.sent(), [3, 4]
1721
- case 3:
1722
- return o.sent(), [2]
1723
- case 4:
1724
- return [2]
1725
- }
1726
- })
1727
- })
1728
- }),
1729
- (t.prototype.getStore = function (t, e) {
1730
- var n
1731
- if ('async' !== this.mode) {
1732
- try {
1733
- if (
1734
- 'undefined' != typeof process &&
1735
- (null === (n = process.env) || void 0 === n ? void 0 : n.tcb_token)
1736
- )
1737
- return process.env.tcb_token
1738
- if (!this.storage) return ''
1739
- } catch (t) {
1740
- return ''
1741
- }
1742
- e = e || 'localCachev1'
1743
- var r = this.storage.getItem(t)
1744
- return r && r.indexOf(e) >= 0 ? JSON.parse(r).content : ''
1745
- }
1746
- F(w.INVALID_OPERATION, "current platform's storage is asynchronous, please use getStoreAsync insteed")
1747
- }),
1748
- (t.prototype.getStoreAsync = function (t, e) {
1749
- var n
1750
- return st(this, void 0, void 0, function () {
1751
- var r
1752
- return ut(this, function (o) {
1753
- switch (o.label) {
1754
- case 0:
1755
- try {
1756
- if (
1757
- 'undefined' != typeof process &&
1758
- (null === (n = process.env) || void 0 === n ? void 0 : n.tcb_token)
1759
- )
1760
- return [2, process.env.tcb_token]
1761
- if (!this.storage) return [2, '']
1762
- } catch (t) {
1763
- return [2, '']
1764
- }
1765
- return (e = e || 'localCachev1'), [4, this.storage.getItem(t)]
1766
- case 1:
1767
- return (r = o.sent()) && r.indexOf(e) >= 0 ? [2, JSON.parse(r).content] : [2, '']
1768
- }
1769
- })
1770
- })
1771
- }),
1772
- (t.prototype.removeStore = function (t) {
1773
- 'async' !== this.mode
1774
- ? this.storage.removeItem(t)
1775
- : F(
1776
- w.INVALID_OPERATION,
1777
- "current platform's storage is asynchronous, please use removeStoreAsync insteed",
1778
- )
1779
- }),
1780
- (t.prototype.removeStoreAsync = function (t) {
1781
- return st(this, void 0, void 0, function () {
1782
- return ut(this, function (e) {
1783
- switch (e.label) {
1784
- case 0:
1785
- return [4, this.storage.removeItem(t)]
1786
- case 1:
1787
- return e.sent(), [2]
1788
- }
1789
- })
1790
- })
1791
- }),
1792
- t
1793
- )
1794
- })(),
1795
- pt = (function () {
1796
- var t = function (e, n) {
1797
- return (t =
1798
- Object.setPrototypeOf ||
1799
- ({ __proto__: [] } instanceof Array &&
1800
- function (t, e) {
1801
- t.__proto__ = e
1802
- }) ||
1803
- function (t, e) {
1804
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n])
1805
- })(e, n)
1806
- }
1807
- return function (e, n) {
1808
- if ('function' != typeof n && null !== n)
1809
- throw new TypeError('Class extends value ' + String(n) + ' is not a constructor or null')
1810
- function r() {
1811
- this.constructor = e
1812
- }
1813
- t(e, n), (e.prototype = null === n ? Object.create(n) : ((r.prototype = n.prototype), new r()))
1814
- }
1815
- })(),
1816
- dt = function (t, e, n) {
1817
- if (n || 2 === arguments.length)
1818
- for (var r, o = 0, i = e.length; o < i; o++)
1819
- (!r && o in e) || (r || (r = Array.prototype.slice.call(e, 0, o)), (r[o] = e[o]))
1820
- return t.concat(r || Array.prototype.slice.call(e))
1821
- }
1822
- var ht = function (t, e) {
1823
- ;(this.data = e || null), (this.name = t)
1824
- },
1825
- yt = (function (t) {
1826
- function e(e, n) {
1827
- var r = t.call(this, 'error', { error: e, data: n }) || this
1828
- return (r.error = e), r
1829
- }
1830
- return pt(e, t), e
1831
- })(ht),
1832
- vt = (function () {
1833
- function t() {
1834
- this.listeners = {}
1835
- }
1836
- return (
1837
- (t.prototype.on = function (t, e) {
1838
- return (
1839
- (function (t, e, n) {
1840
- ;(n[t] = n[t] || []), n[t].push(e)
1841
- })(t, e, this.listeners),
1842
- this
1843
- )
1844
- }),
1845
- (t.prototype.off = function (t, e) {
1846
- return (
1847
- (function (t, e, n) {
1848
- if (null == n ? void 0 : n[t]) {
1849
- var r = n[t].indexOf(e)
1850
- ;-1 !== r && n[t].splice(r, 1)
1851
- }
1852
- })(t, e, this.listeners),
1853
- this
1854
- )
1855
- }),
1856
- (t.prototype.fire = function (t, e) {
1857
- if (T(t, yt)) return console.error(t.error), this
1858
- var n = j(t) ? new ht(t, e || {}) : t,
1859
- r = n.name
1860
- if (this.listens(r)) {
1861
- n.target = this
1862
- for (var o = 0, i = this.listeners[r] ? dt([], this.listeners[r], !0) : []; o < i.length; o++) {
1863
- i[o].call(this, n)
1864
- }
1865
- }
1866
- return this
1867
- }),
1868
- (t.prototype.listens = function (t) {
1869
- return this.listeners[t] && this.listeners[t].length > 0
1870
- }),
1871
- t
1872
- )
1873
- })(),
1874
- gt = new vt()
1875
- function wt(t, e) {
1876
- gt.on(t, e)
1877
- }
1878
- function mt(t, e) {
1879
- void 0 === e && (e = {}), gt.fire(t, e)
1880
- }
1881
- function bt(t, e) {
1882
- gt.off(t, e)
1883
- }
1884
- var _t = function (t, e, n, r) {
1885
- return new (n || (n = Promise))(function (o, i) {
1886
- function a(t) {
1887
- try {
1888
- s(r.next(t))
1889
- } catch (t) {
1890
- i(t)
1891
- }
1892
- }
1893
- function c(t) {
1894
- try {
1895
- s(r.throw(t))
1896
- } catch (t) {
1897
- i(t)
1898
- }
1899
- }
1900
- function s(t) {
1901
- var e
1902
- t.done
1903
- ? o(t.value)
1904
- : ((e = t.value),
1905
- e instanceof n
1906
- ? e
1907
- : new n(function (t) {
1908
- t(e)
1909
- })).then(a, c)
1910
- }
1911
- s((r = r.apply(t, e || [])).next())
1912
- })
1913
- },
1914
- Ot = function (t, e) {
1915
- var n,
1916
- r,
1917
- o,
1918
- i,
1919
- a = {
1920
- label: 0,
1921
- sent: function () {
1922
- if (1 & o[0]) throw o[1]
1923
- return o[1]
1924
- },
1925
- trys: [],
1926
- ops: [],
1927
- }
1928
- return (
1929
- (i = { next: c(0), throw: c(1), return: c(2) }),
1930
- 'function' == typeof Symbol &&
1931
- (i[Symbol.iterator] = function () {
1932
- return this
1933
- }),
1934
- i
1935
- )
1936
- function c(c) {
1937
- return function (s) {
1938
- return (function (c) {
1939
- if (n) throw new TypeError('Generator is already executing.')
1940
- for (; i && ((i = 0), c[0] && (a = 0)), a; )
1941
- try {
1942
- if (
1943
- ((n = 1),
1944
- r &&
1945
- (o = 2 & c[0] ? r.return : c[0] ? r.throw || ((o = r.return) && o.call(r), 0) : r.next) &&
1946
- !(o = o.call(r, c[1])).done)
1947
- )
1948
- return o
1949
- switch (((r = 0), o && (c = [2 & c[0], o.value]), c[0])) {
1950
- case 0:
1951
- case 1:
1952
- o = c
1953
- break
1954
- case 4:
1955
- return a.label++, { value: c[1], done: !1 }
1956
- case 5:
1957
- a.label++, (r = c[1]), (c = [0])
1958
- continue
1959
- case 7:
1960
- ;(c = a.ops.pop()), a.trys.pop()
1961
- continue
1962
- default:
1963
- if (!((o = a.trys), (o = o.length > 0 && o[o.length - 1]) || (6 !== c[0] && 2 !== c[0]))) {
1964
- a = 0
1965
- continue
1966
- }
1967
- if (3 === c[0] && (!o || (c[1] > o[0] && c[1] < o[3]))) {
1968
- a.label = c[1]
1969
- break
1970
- }
1971
- if (6 === c[0] && a.label < o[1]) {
1972
- ;(a.label = o[1]), (o = c)
1973
- break
1974
- }
1975
- if (o && a.label < o[2]) {
1976
- ;(a.label = o[2]), a.ops.push(c)
1977
- break
1978
- }
1979
- o[2] && a.ops.pop(), a.trys.pop()
1980
- continue
1981
- }
1982
- c = e.call(t, a)
1983
- } catch (t) {
1984
- ;(c = [6, t]), (r = 0)
1985
- } finally {
1986
- n = o = 0
1987
- }
1988
- if (5 & c[0]) throw c[1]
1989
- return { value: c[0] ? c[1] : void 0, done: !0 }
1990
- })([c, s])
1991
- }
1992
- }
1993
- },
1994
- Et = !1
1995
- 'undefined' != typeof navigator && navigator.userAgent && (Et = -1 !== navigator.userAgent.indexOf('Firefox'))
1996
- var St = Et ? /(\.js\/)?__decorate(\$\d+)?<@.*\d$/ : /(\/\w+\.js\.)?__decorate(\$\d+)?\s*\(.*\)$/,
1997
- Nt = /https?:\/\/.+:\d*\/.*\.js:\d+:\d+/
1998
- function At(t) {
1999
- var e = t.mode,
2000
- n = void 0 === e ? 'async' : e,
2001
- r = t.customInfo,
2002
- o = void 0 === r ? {} : r,
2003
- i = t.title,
2004
- a = t.messages,
2005
- c = void 0 === a ? [] : a
2006
- return function (t, e, r) {
2007
- if (v) {
2008
- var a = o.className || t.constructor.name,
2009
- s = o.methodName || e,
2010
- u = r.value,
2011
- l = (function (t) {
2012
- var e = '',
2013
- n = t.stack.split('\n'),
2014
- r = n.findIndex(function (t) {
2015
- return St.test(t)
2016
- })
2017
- if (-1 !== r) {
2018
- var o = Nt.exec(n[r + 1] || '')
2019
- e = o ? o[0] : ''
2020
- }
2021
- return e
2022
- })(new Error())
2023
- r.value =
2024
- 'sync' === n
2025
- ? function () {
2026
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]
2027
- var n = Ct({ err: new Error(), className: a, methodName: s, sourceLink: l })
2028
- try {
2029
- return u.apply(this, t)
2030
- } catch (t) {
2031
- var r = t,
2032
- o = t.message,
2033
- f = t.error,
2034
- p = t.error_description,
2035
- d = {
2036
- title: i || ''.concat(a, '.').concat(s, ' failed'),
2037
- content: [{ type: 'error', body: t }],
2038
- }
2039
- if (o && /^\{.*\}$/.test(o)) {
2040
- var h = JSON.parse(o)
2041
- ;(d.subtitle = o),
2042
- h.code &&
2043
- (n ? ((n.code = h.code), (n.msg = h.msg)) : ((t.code = h.code), (t.message = h.msg)),
2044
- (r = n || t),
2045
- (d.content = c.map(function (t) {
2046
- return { type: 'info', body: t }
2047
- })))
2048
- }
2049
- throw (
2050
- (f &&
2051
- p &&
2052
- ((d.subtitle = p),
2053
- n ? ((n.code = f), (n.msg = p)) : ((t.code = f), (t.message = p)),
2054
- (r = n || t),
2055
- (d.content = c.map(function (t) {
2056
- return { type: 'info', body: t }
2057
- }))),
2058
- K(d),
2059
- r)
2060
- )
2061
- }
2062
- }
2063
- : function () {
2064
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e]
2065
- return _t(this, void 0, void 0, function () {
2066
- var e, n, r, o, f, p, d, h
2067
- return Ot(this, function (y) {
2068
- switch (y.label) {
2069
- case 0:
2070
- ;(e = Ct({ err: new Error(), className: a, methodName: s, sourceLink: l })),
2071
- (y.label = 1)
2072
- case 1:
2073
- return y.trys.push([1, 3, , 4]), [4, u.apply(this, t)]
2074
- case 2:
2075
- return [2, y.sent()]
2076
- case 3:
2077
- throw (
2078
- ((n = y.sent()),
2079
- (r = n),
2080
- (o = n.message),
2081
- (f = n.error),
2082
- (p = n.error_description),
2083
- (d = {
2084
- title: i || ''.concat(a, '.').concat(s, ' failed'),
2085
- content: [{ type: 'error', body: n }],
2086
- }),
2087
- o &&
2088
- /^\{.*\}$/.test(o) &&
2089
- ((h = JSON.parse(o)),
2090
- (d.subtitle = h),
2091
- h.code &&
2092
- (e
2093
- ? ((e.code = h.code), (e.message = h.msg))
2094
- : ((n.code = h.code), (n.message = h.msg)),
2095
- (r = e || n),
2096
- (d.content = c.map(function (t) {
2097
- return { type: 'info', body: t }
2098
- })))),
2099
- f &&
2100
- p &&
2101
- ((d.subtitle = p),
2102
- e ? ((e.code = f), (e.msg = p)) : ((n.code = f), (n.message = p)),
2103
- (r = e || n),
2104
- (d.content = c.map(function (t) {
2105
- return { type: 'info', body: t }
2106
- }))),
2107
- K(d),
2108
- r)
2109
- )
2110
- case 4:
2111
- return [2]
2112
- }
2113
- })
2114
- })
2115
- }
2116
- }
2117
- }
2118
- }
2119
- function Ct(t) {
2120
- var e = t.err,
2121
- n = t.className,
2122
- r = t.methodName,
2123
- o = t.sourceLink
2124
- if (!o) return null
2125
- var i,
2126
- a = e.stack.split('\n'),
2127
- c = Et
2128
- ? /^catchErrorsDecorator\/<\/descriptor.value@.*\d$/
2129
- : new RegExp(''.concat(n, '\\.descriptor.value\\s*\\[as\\s').concat(r, '\\]\\s*\\(.*\\)$')),
2130
- s = Et
2131
- ? /^catchErrorsDecorator\/<\/descriptor.value/
2132
- : new RegExp(''.concat(n, '\\.descriptor.value\\s*\\[as\\s').concat(r, '\\]')),
2133
- u = a.findIndex(function (t) {
2134
- return c.test(t)
2135
- })
2136
- if (-1 !== u) {
2137
- var l = a.filter(function (t, e) {
2138
- return e > u
2139
- })
2140
- l.unshift(a[u].replace(s, ''.concat(n, '.').concat(r)).replace(Nt, o)),
2141
- ((i = new Error()).stack = ''.concat(Et ? '@debugger' : 'Error', '\n').concat(l.join('\n')))
2142
- }
2143
- return i
2144
- }
2145
- function It(t) {
2146
- this.message = t
2147
- }
2148
- ;(It.prototype = new Error()), (It.prototype.name = 'InvalidCharacterError')
2149
- var jt =
2150
- ('undefined' != typeof window && window.atob && window.atob.bind(window)) ||
2151
- function (t) {
2152
- var e = String(t).replace(/=+$/, '')
2153
- if (e.length % 4 == 1) throw new It("'atob' failed: The string to be decoded is not correctly encoded.")
2154
- for (
2155
- var n, r, o = 0, i = 0, a = '';
2156
- (r = e.charAt(i++));
2157
- ~r && ((n = o % 4 ? 64 * n + r : r), o++ % 4)
2158
- ? (a += String.fromCharCode(255 & (n >> ((-2 * o) & 6))))
2159
- : 0
2160
- )
2161
- r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.indexOf(r)
2162
- return a
2163
- }
2164
- function Pt(t) {
2165
- var e = t.replace(/-/g, '+').replace(/_/g, '/')
2166
- switch (e.length % 4) {
2167
- case 0:
2168
- break
2169
- case 2:
2170
- e += '=='
2171
- break
2172
- case 3:
2173
- e += '='
2174
- break
2175
- default:
2176
- throw 'Illegal base64url string!'
2177
- }
2178
- try {
2179
- return (function (t) {
2180
- return decodeURIComponent(
2181
- jt(t).replace(/(.)/g, function (t, e) {
2182
- var n = e.charCodeAt(0).toString(16).toUpperCase()
2183
- return n.length < 2 && (n = '0' + n), '%' + n
2184
- }),
2185
- )
2186
- })(e)
2187
- } catch (t) {
2188
- return jt(e)
2189
- }
2190
- }
2191
- function Rt(t) {
2192
- this.message = t
2193
- }
2194
- ;(Rt.prototype = new Error()), (Rt.prototype.name = 'InvalidTokenError')
2195
- var xt = {
2196
- decode: function (t, e) {
2197
- if ('string' != typeof t) throw new Rt('Invalid token specified')
2198
- var n = !0 === (e = e || {}).header ? 0 : 1
2199
- try {
2200
- return JSON.parse(Pt(t.split('.')[n]))
2201
- } catch (t) {
2202
- throw new Rt('Invalid token specified: ' + t.message)
2203
- }
2204
- },
2205
- }
2206
- },
2207
- 429: () => {},
2208
- },
2209
- e = {}
2210
- function n(r) {
2211
- var o = e[r]
2212
- if (void 0 !== o) return o.exports
2213
- var i = (e[r] = { exports: {} })
2214
- return t[r].call(i.exports, i, i.exports, n), i.exports
2215
- }
2216
- return (
2217
- (n.n = (t) => {
2218
- var e = t && t.__esModule ? () => t.default : () => t
2219
- return n.d(e, { a: e }), e
2220
- }),
2221
- (n.d = (t, e) => {
2222
- for (var r in e) n.o(e, r) && !n.o(t, r) && Object.defineProperty(t, r, { enumerable: !0, get: e[r] })
2223
- }),
2224
- (n.g = (function () {
2225
- if ('object' == typeof globalThis) return globalThis
2226
- try {
2227
- return this || new Function('return this')()
2228
- } catch (t) {
2229
- if ('object' == typeof window) return window
2230
- }
2231
- })()),
2232
- (n.o = (t, e) => Object.prototype.hasOwnProperty.call(t, e)),
2233
- (n.r = (t) => {
2234
- 'undefined' != typeof Symbol &&
2235
- Symbol.toStringTag &&
2236
- Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }),
2237
- Object.defineProperty(t, '__esModule', { value: !0 })
2238
- }),
2239
- n(976)
2240
- )
2241
- })(),
2242
- )